@yuriai/web 0.2.14 → 0.2.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/dist/assets/{AgentAvatar-DJCC3Aqe.js → AgentAvatar-CVIpaYPU.js} +1 -1
  2. package/dist/assets/AssistantView-D5vJW3gp.js +3 -0
  3. package/dist/assets/{DiagramView-B7Z-RJUd.js → DiagramView-HNaj_sVG.js} +1 -1
  4. package/dist/assets/{FadeInOnReveal-CxIQc2_J.js → FadeInOnReveal-Dq1IuEQp.js} +1 -1
  5. package/dist/assets/{GuiPluginSurface-DCkAA0R4.js → GuiPluginSurface-N-iK-MeX.js} +1 -1
  6. package/dist/assets/{GuiPluginWindow-pZqqyXGs.js → GuiPluginWindow-ClutFX_h.js} +1 -1
  7. package/dist/assets/Icon-tnX3bel1.js +1 -0
  8. package/dist/assets/{ImageLoadingPlaceholder-B5t9zOYn.js → ImageLoadingPlaceholder-IE6JO3WM.js} +1 -1
  9. package/dist/assets/{LoadingImage-ByZs_EGY.js → LoadingImage-DNZmZRZS.js} +1 -1
  10. package/dist/assets/{MarkdownRenderer-CYvVcdhy.js → MarkdownRenderer-DuA1vlFT.js} +2 -2
  11. package/dist/assets/{MarkdownRendererImpl-C_h6Vpba.js → MarkdownRendererImpl-BwZ91PA5.js} +1 -1
  12. package/dist/assets/{MarkstreamRendererImpl-BE2iZJll.js → MarkstreamRendererImpl-kgBwH_VF.js} +1 -1
  13. package/dist/assets/{MobileDetailNavigation-D57BJCZT.js → MobileDetailNavigation-sm5MbnK3.js} +1 -1
  14. package/dist/assets/{MobileResizableSheet-BdOIJ61C.js → MobileResizableSheet-Cw6rRBR2.js} +1 -1
  15. package/dist/assets/{MobileShareBridge-BMbgy_Y9.js → MobileShareBridge-BjpB1cz1.js} +1 -1
  16. package/dist/assets/{MobileTabPageHeader-BW9y2zRG.js → MobileTabPageHeader-CEsc9PYV.js} +1 -1
  17. package/dist/assets/{MultiRunWindow-qgKnxGjk.js → MultiRunWindow-pslncrAh.js} +1 -1
  18. package/dist/assets/{OnboardingScreen-CXIYe29y.js → OnboardingScreen-o9e7j2Lk.js} +1 -1
  19. package/dist/assets/{OverlayScrollbar-0_OUbhJe.js → OverlayScrollbar-BA6KEyhj.js} +1 -1
  20. package/dist/assets/{SettingsView-RfNOKLm3.js → SettingsView-20rmUHhk.js} +12 -12
  21. package/dist/assets/{SettingsWindow-tXzBaLS_.js → SettingsWindow-D-Vjsme7.js} +1 -1
  22. package/dist/assets/{TerminalView-aZe7_W0A.js → TerminalView-B4bliT5i.js} +1 -1
  23. package/dist/assets/ToolOutputDialog-D1rZbaHo.js +10 -0
  24. package/dist/assets/{YuriLogo-_lN4cqhJ.js → YuriLogo-CDmH1ycw.js} +1 -1
  25. package/dist/assets/{appThemeRegistry-Br3aTf8c.js → appThemeRegistry-DyTPt9Uq.js} +1 -1
  26. package/dist/assets/{button-DFX-UCuQ.js → button-BEOJB042.js} +1 -1
  27. package/dist/assets/{capgoAdapter-VGW_DUcK.js → capgoAdapter-BrU-ms8F.js} +1 -1
  28. package/dist/assets/{collapsible-CDkbWw1M.js → collapsible-DrQlDm15.js} +1 -1
  29. package/dist/assets/{diagram-JdjLWkpD.js → diagram-DyQPPDKS.js} +1 -1
  30. package/dist/assets/{dialog-jQrYy1B7.js → dialog-CooVl0xA.js} +1 -1
  31. package/dist/assets/{dropdown-menu.styles-EKni18O6.js → dropdown-menu.styles-Bj4YEb3T.js} +1 -1
  32. package/dist/assets/{es-BJGEAUsH.js → es-DklBd0ox.js} +1 -1
  33. package/dist/assets/{fileMentionTouchSelection-f8n4X8BW.js → fileMentionTouchSelection-8I9u8H6l.js} +1 -1
  34. package/dist/assets/{fr-CFAAV_Hr.js → fr-CVUs46wM.js} +1 -1
  35. package/dist/assets/{gitApi-CjQVuhXI.js → gitApi-BVMvxPtG.js} +1 -1
  36. package/dist/assets/{input-g3JXmugD.js → input-B-4VixoV.js} +1 -1
  37. package/dist/assets/{insertionBoundaries-DQMPnN81.js → insertionBoundaries-YVc2e3H2.js} +1 -1
  38. package/dist/assets/{ja-1qFce7BA.js → ja-5reg09JK.js} +1 -1
  39. package/dist/assets/{ko-BDwpL-64.js → ko-DZdC6ooz.js} +1 -1
  40. package/dist/assets/main-Cs5VJerX.js +169 -0
  41. package/dist/assets/{main-CIqFfTRC.js → main-DZ5HVH-j.js} +2 -2
  42. package/dist/assets/{markdownHeightCache-BsFt9Iuh.js → markdownHeightCache-SdaL8x58.js} +1 -1
  43. package/dist/assets/{mcpQueries-DJfEAbB6.js → mcpQueries-B1ZULr7c.js} +1 -1
  44. package/dist/assets/{miniChat-C6iONZ7A.js → miniChat-DUSGfEUO.js} +2 -2
  45. package/dist/assets/{mobile-EJ2ArrGZ.js → mobile-CMXtTX1x.js} +2 -2
  46. package/dist/assets/{mobileBackNavigation-DCfPeDp4.js → mobileBackNavigation-D-cRdrKd.js} +1 -1
  47. package/dist/assets/{multirun-Cw4SWn2h.js → multirun-D6bNScic.js} +1 -1
  48. package/dist/assets/{native-config-D_5OLigY.js → native-config-obwt8WA1.js} +1 -1
  49. package/dist/assets/{pl-COzHGIeC.js → pl-BerZSK-a.js} +1 -1
  50. package/dist/assets/{projectMeta-DbrpqsSQ.js → projectMeta-LtQkG8fN.js} +1 -1
  51. package/dist/assets/{pt-BR-B6ps5NQH.js → pt-BR-ydmV6U49.js} +1 -1
  52. package/dist/assets/{readiness-D-k9h36r.js → readiness-BWBtf7Am.js} +1 -1
  53. package/dist/assets/{renderElectronMiniChatApp-Bnv9tCyw.js → renderElectronMiniChatApp-EL2J2wQd.js} +2 -2
  54. package/dist/assets/{renderMobileApp-C1wyf84w.js → renderMobileApp-DOCWKmuC.js} +6 -6
  55. package/dist/assets/{runtimeConfig-V7w7piDM.js → runtimeConfig-D577Rc9x.js} +1 -1
  56. package/dist/assets/{runtimeEndpointReset-86pXjFoO.js → runtimeEndpointReset-C5EiiaQf.js} +4 -4
  57. package/dist/assets/{scheduledTaskNavigation-DPl7XI48.js → scheduledTaskNavigation-CJEzv5Zr.js} +1 -1
  58. package/dist/assets/{sessionChangeSummary-DdG2p-qM.js → sessionChangeSummary-DAV313F8.js} +1 -1
  59. package/dist/assets/{sessionLookup-En7eKd0r.js → sessionLookup-CN_iYfk5.js} +1 -1
  60. package/dist/assets/{sortable-tabs-strip-Bp_bMUwf.js → sortable-tabs-strip-9okrTn1K.js} +1 -1
  61. package/dist/assets/{speechSettingsQueries-DJpyiHX1.js → speechSettingsQueries-BvJCYdR_.js} +1 -1
  62. package/dist/assets/src-nJdn6EvY.css +2 -0
  63. package/dist/assets/{store-CKaWYiP4.js → store-ClIuNNU7.js} +2 -2
  64. package/dist/assets/{textarea-BuvlUTo2.js → textarea-9sBs8Uld.js} +1 -1
  65. package/dist/assets/{tooltip-Byl6nrXB.js → tooltip-BkcQKx-p.js} +1 -1
  66. package/dist/assets/{types-CVQBgR8T.js → types-BcumvHrl.js} +1 -1
  67. package/dist/assets/{uk-StL0Y7Ti.js → uk-BnTevguX.js} +1 -1
  68. package/dist/assets/{useAppFontEffects-CeYo_5_Z.js → useAppFontEffects-D9c0mG1P.js} +51 -51
  69. package/dist/assets/{useDesktopWindowControlsLayout-BhIAC-yK.js → useDesktopWindowControlsLayout-Dx-zWLPl.js} +1 -1
  70. package/dist/assets/{useEffectiveDirectory-DvnOvqoO.js → useEffectiveDirectory-DPvKdopQ.js} +1 -1
  71. package/dist/assets/{useMobileNavigationStore-mTG_inGR.js → useMobileNavigationStore-9pGm6Lkc.js} +22 -22
  72. package/dist/assets/useWorkerHighlightedLines-DSzghYUI.js +7 -0
  73. package/dist/assets/{vendor-framer-motion-D8hQsul-.js → vendor-framer-motion-BQ3-sJMO.js} +1 -1
  74. package/dist/assets/vendor-motion-B4xmxmaP.js +1 -0
  75. package/dist/assets/{zh-CN-CxO7ZteK.js → zh-CN-DT6qIAPJ.js} +1 -1
  76. package/dist/assets/{zh-TW-9MJgbinh.js → zh-TW-CtLsIcFb.js} +1 -1
  77. package/dist/index.html +6 -6
  78. package/dist/mini-chat.html +6 -6
  79. package/dist/mobile.html +6 -6
  80. package/package.json +1 -1
  81. package/server/lib/assistants/DOCUMENTATION.md +29 -2
  82. package/server/lib/assistants/contact-attachments.http.test.js +1 -1
  83. package/server/lib/assistants/contact-greeting.js +18 -0
  84. package/server/lib/assistants/harness.js +2 -0
  85. package/server/lib/assistants/harness.test.js +4 -0
  86. package/server/lib/assistants/service.js +47 -5
  87. package/server/lib/assistants/service.test.js +214 -26
  88. package/dist/assets/AssistantView-Ba0QibJU.js +0 -3
  89. package/dist/assets/Icon-C1nXIg7J.js +0 -1
  90. package/dist/assets/ToolOutputDialog-BVplHxKd.js +0 -10
  91. package/dist/assets/main-DrimNmCT.js +0 -169
  92. package/dist/assets/src-dSUmXLC4.css +0 -2
  93. package/dist/assets/useWorkerHighlightedLines-Ez7d_RoZ.js +0 -7
  94. package/dist/assets/vendor-motion-DufQFNcM.js +0 -1
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ToolOutputDialog-BVplHxKd.js","assets/rolldown-runtime-hePW80VL.js","assets/runtime-auth-ef9W7A43.js","assets/runtime-switch-CAZiOV2G.js","assets/runtime-fetch-BAN5Gnnp.js","assets/desktop-dp2Z0toS.js","assets/runtimeAPIRegistry-C2VogTny.js","assets/vendor-base-ui-CdzJ6My_.js","assets/useUIStore-NMQx_cnG.js","assets/vendor-zustand-o69pgTEK.js","assets/brand-storage-bootstrap-D4BW3w-M.js","assets/brand-storage-migration-Bhz6UOBJ.js","assets/vendor-react-BP2cRVqX.js","assets/vendor-tanstack-react-query-CdqCAt40.js","assets/vendor-tanstack-query-core-BWz0ose6.js","assets/runtime-file-resource-D3k0hKDj.js","assets/queryRuntime-BuRnpVtK.js","assets/fileQueries-DbUx7NwP.js","assets/runtime-file-store-BVRgEtI-.js","assets/path-utils-jGozTg9d.js","assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js","assets/runtime-file-download-BzblfnMx.js","assets/platform-syRnKuVU.js","assets/vendor-pierre-diffs-DPBtNDJ5.js","assets/vendor-hast-util-to-html-Bw_SgZ1t.js","assets/vendor-character-entities-legacy-Wut6vMuj.js","assets/vendor-character-entities-html4-DlN_yAFd.js","assets/vendor-ccount-CyGsA0u7.js","assets/vendor-comma-separated-tokens-B9ouxNNS.js","assets/vendor-oniguruma-to-es-CrHzjjSU.js","assets/vendor-oniguruma-parser-D2DIvhSP.js","assets/vendor-diff-Dq7CZNim.js","assets/vendor-lru_map-BMOrLc9L.js","assets/vendor-reactuses-core-BJ-jJ4YM.js","assets/vendor-lodash-es-DfLbG5Af.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/button-DFX-UCuQ.js","assets/store-CKaWYiP4.js","assets/vendor-class-variance-authority-BLUaYARZ.js","assets/vendor-tailwind-merge-BicNWLTg.js","assets/useThemeSystem-8jhE4Zyk.js","assets/Icon-C1nXIg7J.js","assets/dialog-jQrYy1B7.js","assets/image-loading-FUFYiO1j.js","assets/image-loading-D9Z_BASK.css","assets/MobileWindowStack-DGLdgoGr.js","assets/appThemeRegistry-Br3aTf8c.js","assets/useMobileNavigationStore-mTG_inGR.js","assets/gitApiHttp-BtI23x-7.js","assets/vendor-opencode-client-fxfj4IA_.js","assets/vendor-effect-DV9F8PTZ.js","assets/persistence-BfjCXjLZ.js","assets/pathNormalization-ewtPqJWn.js","assets/vendor-pathe-vBmvQE8f.js","assets/vendor-sonner-ZS8XIOVl.js","assets/useAssistantUIStore-rdsbsVts.js","assets/vendor-zod-Dzk5kdUU.js","assets/vendor-fuse.js-DB5wDJbI.js","assets/vendor-fuzzysort-ukaRp9PC.js","assets/agentColors-DWSbQXy2.js","assets/rasterizePng-056Poix7.js","assets/MarkdownRenderer-CYvVcdhy.js","assets/useEffectiveDirectory-DvnOvqoO.js","assets/markdownHeightCache-BsFt9Iuh.js","assets/dualLimitLru-D8Sphgua.js","assets/toolHelpers-DL452NVK.js","assets/ImageLoadingPlaceholder-B5t9zOYn.js","assets/useWorkerHighlightedLines-Ez7d_RoZ.js","assets/tooltip-Byl6nrXB.js","assets/vendor-tanstack-react-virtual-B_EO--9t.js","assets/markdownTheme-DHoKvD6O.js","assets/markdown-worker-oBGEB9Eg.js","assets/mobileBackNavigation-DCfPeDp4.js","assets/ToolOutputDialog-CbGuK5bP.css"])))=>i.map(i=>d[i]);
2
- import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{c as n,i as r,n as i}from"./runtime-switch-CAZiOV2G.js";import{a}from"./vendor-zustand-o69pgTEK.js";import{it as o,rt as s}from"./vendor-base-ui-CdzJ6My_.js";import{n as c}from"./useUIStore-NMQx_cnG.js";import{$ as l,B as u,J as d,K as f,U as p,X as m,q as h,st as g,z as _}from"./persistence-BfjCXjLZ.js";import{n as v}from"./vendor-react-BP2cRVqX.js";import{s as y}from"./vendor-tanstack-react-query-CdqCAt40.js";import{o as b}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{n as x,r as S}from"./platform-syRnKuVU.js";import{r as C}from"./vendor-sonner-ZS8XIOVl.js";import{a as w,f as T,i as E,o as D,p as O,r as k}from"./vendor-reactuses-core-BJ-jJ4YM.js";import{f as A,r as j,t as M}from"./button-DFX-UCuQ.js";import{i as N,n as P}from"./MobileShareBridge-BMbgy_Y9.js";import{E as F,M as I,P as L,T as R,_ as z,c as B,d as V,g as ee,i as te,n as H,o as U,p as W,r as ne,t as re,u as G,y as ie}from"./MobileDetailNavigation-D57BJCZT.js";import{Eo as ae,Ir as oe,Lr as se,Yt as ce,ct as K,o as le,wn as ue}from"./useMobileNavigationStore-mTG_inGR.js";import{i as de,n as q,r as fe}from"./useAssistantUIStore-rdsbsVts.js";import{t as J}from"./AgentAvatar-DJCC3Aqe.js";import{o as pe,t as me,u as he}from"./vendor-framer-motion-D8hQsul-.js";import{n as Y}from"./Icon-C1nXIg7J.js";import{a as X,i as ge,n as _e,o as ve,r as ye,t as be}from"./dialog-jQrYy1B7.js";import{r as xe}from"./device-DzWRCXhq.js";import{c as Z,s as Se}from"./image-loading-FUFYiO1j.js";import{E as Ce,S as we,T as Te,a as Ee,c as De,d as Oe,f as ke,i as Ae,l as je,m as Me,n as Ne,p as Pe,r as Fe,s as Ie,t as Le,u as Re,w as ze,y as Be}from"./sessionChangeSummary-DdG2p-qM.js";import{a as Ve,n as He,r as Ue,t as We}from"./fileMentionTouchSelection-f8n4X8BW.js";import{a as Ge,o as Ke,t as qe}from"./MarkdownRenderer-CYvVcdhy.js";import{n as Je}from"./textarea-BuvlUTo2.js";import{t as Ye}from"./ImageLoadingPlaceholder-B5t9zOYn.js";import{t as Xe}from"./LoadingImage-ByZs_EGY.js";import{t as Ze}from"./vendor-motion-DufQFNcM.js";import{a as Qe,c as $e,l as et,o as tt,s as nt,t as rt}from"./scheduledTaskNavigation-DPl7XI48.js";import{a as it,o as at,t as ot}from"./sessionLookup-En7eKd0r.js";import{i as st,n as ct,r as lt}from"./assistant-attachment-cache-lEUFn3mr.js";var ut=v(),Q=t(o(),1),$=s();function dt({snapshot:e,rowClassName:t,compact:n=!1}){let{t:r}=A(),[i,a]=Q.useState(!1),o=Q.useRef(!1),s=k(async()=>{if(!o.current){o.current=!0,a(!0);try{(await G(e)).failed&&C.error(r(`assistants.unread.markAllFailed`))}catch{C.error(r(`assistants.unread.markAllFailed`))}finally{o.current=!1,a(!1)}}}),c=e.assistants.some(e=>(e.unreadCount??0)>0);return!n&&!c?null:(0,$.jsx)(`div`,{className:t,style:n&&!c?{visibility:`hidden`}:void 0,children:(0,$.jsx)(M,{type:`button`,variant:`ghost`,size:`xs`,onClick:s,className:n?`h-auto bg-transparent px-1 py-1 text-[11px] font-normal text-muted-foreground hover:bg-transparent whitespace-nowrap`:`max-w-full whitespace-normal text-right`,disabled:i||!e.assistants.some(e=>(e.unreadCount??0)>0&&e.readTip),"aria-busy":i,children:r(`assistants.unread.markAll`)})})}var ft=a(e=>({workingByID:{},setWorking:(t,n)=>e(e=>({workingByID:{...e.workingByID,[t]:n}}))})),pt=({sending:e=!1,processing:t=!1,serverWorking:n=!1})=>e||t||n,mt=(e,t)=>{let n=(0,ut.c)(5),r=t!==void 0&&t,i;n[0]===e?i=n[1]:(i=t=>!!t.workingByID[e],n[0]=e,n[1]=i);let a=ft(i),o;return n[2]!==a||n[3]!==r?(o=pt({processing:a,serverWorking:r}),n[2]=a,n[3]=r,n[4]=o):o=n[4],o},ht=e=>{let t=(0,ut.c)(22),{name:n,avatarSeed:r,size:i,label:a,working:o,showWorkingDot:s,className:c,hoverTarget:l}=e,u=i===void 0?24:i,d=s===void 0||s,{t:f}=A(),p;t[0]!==n||t[1]!==o?(p=e=>o!==void 0&&!!e.workingByID[n],t[0]=n,t[1]=o,t[2]=p):p=t[2];let m=ft(p),h=!!(o||m),g=`calc(${u}px * var(--dpt-n, 1))`,_;t[3]===c?_=t[4]:(_=j(`relative inline-block shrink-0 align-middle leading-none`,c),t[3]=c,t[4]=_);let v;t[5]===g?v=t[6]:(v={width:g,minWidth:g,maxWidth:g,height:g,minHeight:g,maxHeight:g},t[5]=g,t[6]=v);let y=o===void 0?void 0:h?`working`:`idle`,b=r??n,x;t[7]!==l||t[8]!==a||t[9]!==u||t[10]!==y||t[11]!==b?(x=(0,$.jsx)(J,{kind:`assistant`,motion:y,name:b,size:u,label:a,hoverTarget:l}),t[7]=l,t[8]=a,t[9]=u,t[10]=y,t[11]=b,t[12]=x):x=t[12];let S;t[13]!==d||t[14]!==f||t[15]!==o?(S=o&&d?(0,$.jsx)(`span`,{className:`pointer-events-none absolute right-0 bottom-0 size-2.5 translate-x-0.5 translate-y-0.5 rounded-full bg-[var(--status-success)] ring-2 ring-background`,"data-assistant-working-dot":``,"aria-label":f(`assistants.contact.working`)}):null,t[13]=d,t[14]=f,t[15]=o,t[16]=S):S=t[16];let C;return t[17]!==_||t[18]!==v||t[19]!==x||t[20]!==S?(C=(0,$.jsxs)(`span`,{className:_,style:v,"data-assistant-working-avatar":``,children:[x,S]}),t[17]=_,t[18]=v,t[19]=x,t[20]=S,t[21]=C):C=t[21],C},gt=e=>{for(let t=e.messages.length-1;t>=0;t--){let n=e.messages[t];if(n.parts.some(F)&&Number.isFinite(new Date(n.createdAt).getTime()))return{timestamp:n.createdAt,empty:!1}}return{timestamp:void 0,empty:e.generation>=0&&e.olderComplete&&!e.hasMessageGap}},_t=(e,t)=>{let n=(0,ut.c)(5),r;n[0]!==e||n[1]!==t?(r=ne(e,t),n[0]=e,n[1]=t,n[2]=r):r=n[2];let i;return n[3]===r?i=n[4]:(i={...r,enabled:!1,select:gt},n[3]=r,n[4]=i),y(i)},vt=3e5,yt=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate();function bt(e){let t=new Map,n=null;for(let r of e){if(!(r.status===`error`||r.status===`failed`||r.parts.some(e=>e.type!==`text`||e.text.trim()&&!e.text.trim().startsWith(`yuri.settle.`)&&!e.text.trim().startsWith(`oc.settle.`))))continue;let e=new Date(r.createdAt);Number.isFinite(e.getTime())&&((!n||!yt(n,e)||e.getTime()-n.getTime()>vt)&&t.set(r.messageID,r.createdAt),n=e)}return t}function xt(e,t,n){let r=new Intl.DateTimeFormat(e,{hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`}),i=new Intl.DateTimeFormat(e,{month:`long`,day:`numeric`}),a=new Intl.DateTimeFormat(e,{year:`numeric`,month:`long`,day:`numeric`});return e=>{let o=new Date(e);return`${yt(o,n)?t:(o.getFullYear()===n.getFullYear()?i:a).format(o)} ${r.format(o)}`}}var St=Q.memo(e=>{let t=(0,ut.c)(17),{assistantID:n,serverWorking:r,lastContactAt:i}=e,{t:a,locale:o}=A(),s=mt(n,r),c=_t(n,Z()),l;t[0]!==c||t[1]!==i?(l=i!==void 0&&Number.isFinite(new Date(i).getTime())?i:c.data?.timestamp,t[0]=c,t[1]=i,t[2]=l):l=t[2];let u=l,d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=new Date().toDateString(),t[3]=d):d=t[3];let f=d,p;t[4]===a?p=t[5]:(p=a(`common.date.today`),t[4]=a,t[5]=p);let m=p,h;bb0:{if(u===void 0){h=null;break bb0}let e;t[6]!==o||t[7]!==u||t[8]!==m?(e=xt(o,m,new Date(f))(u),t[6]=o,t[7]=u,t[8]=m,t[9]=e):e=t[9],h=e}let g=h,_;t[10]!==c||t[11]!==g||t[12]!==a||t[13]!==s?(_=s?a(`assistants.conversation.typing`):g?a(`assistants.conversation.lastContact`,{time:g}):c.data?.empty?a(`assistants.conversation.neverContacted`):c.isError?a(`assistants.contact.loadFailed`):a(`common.loading`),t[10]=c,t[11]=g,t[12]=a,t[13]=s,t[14]=_):_=t[14];let v=_,y;return t[15]===v?y=t[16]:(y=(0,$.jsx)(`span`,{className:`mt-1 block truncate typography-micro font-normal leading-4 text-muted-foreground/70`,"aria-live":`polite`,title:v,children:v}),t[15]=v,t[16]=y),y});function Ct(e){let t=(0,ut.c)(12),{assistantID:n,position:a}=e,o=Q.useRef(null),s=Q.useRef(!1),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={busy:!1,done:!1,retryAt:0},t[0]=c):c=t[0];let l=Q.useRef(c),[u]=Q.useState(kt),d;t[1]!==n||t[2]!==a||t[3]!==u?(d=()=>{let e=o.current;if(!e||!s.current||l.current.busy||l.current.done||Date.now()<l.current.retryAt||u.transport!==r()||u.generation!==i()||document.visibilityState!==`visible`||(x()?!document.documentElement.classList.contains(`yuri-native-app-active`):!document.hasFocus())||e.parentElement?.closest(`[inert], [aria-hidden="true"]`))return;let t=e.closest(`[data-assistant-contact-transcript]`);if(!t||t.scrollHeight-t.scrollTop-t.clientHeight>2)return;let c=e.getBoundingClientRect(),d=t.getBoundingClientRect(),f=window.visualViewport,p=f?.offsetTop??0,m=p+(f?.height??window.innerHeight);c.height<=0||c.width<=0||c.bottom>Math.min(d.bottom,m)||c.top<Math.max(d.top,p)||c.right<=Math.max(d.left,0)||c.left>=Math.min(d.right,window.innerWidth)||(l.current.busy=!0,V(n,a).then(()=>{l.current.done=!0}).catch(()=>{l.current.retryAt=Date.now()+15e3}).finally(()=>{l.current.busy=!1}))},t[1]=n,t[2]=a,t[3]=u,t[4]=d):d=t[4];let f=k(d),p;t[5]===f?p=t[6]:(p=e=>{s.current=e.some(Ot),f()},t[5]=f,t[6]=p);let m;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(m={threshold:1},t[7]=m):m=t[7],w(o,k(p),m),E(`visibilitychange`,f,Dt),E(`focus`,f,Et),E(`resize`,f,Tt);let h,g;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>o.current?.closest(`[data-assistant-contact-transcript]`),g={passive:!0},t[8]=h,t[9]=g):(h=t[8],g=t[9]),E(`scroll`,f,h,g);let _;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(_={attributes:!0,attributeFilter:[`class`]},t[10]=_):_=t[10],T(f,wt,_),D(f,15e3);let v;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(`span`,{ref:o,"aria-hidden":`true`,className:`absolute bottom-0 left-0 block h-px w-px`,"data-assistant-read-marker":``}),t[11]=v):v=t[11],v}function wt(){return document.documentElement}function Tt(){return window.visualViewport}function Et(){return window}function Dt(){return document}function Ot(e){return e.isIntersecting&&e.intersectionRatio===1}function kt(){return{transport:r(),generation:i()}}var At=()=>{},jt=Q.memo(Ce),Mt=e=>e?.directories.flatMap(({directory:e,sessions:t})=>e?t.filter(e=>!e.time.archived).map(t=>({...t,directory:e||t.location?.directory||t.directory||``})).filter(e=>e.directory.length>0):[])??null,Nt=Q.forwardRef(({query:e,isMobile:t,listId:n,onHighlightChange:r,onSelect:i,onClose:a},o)=>{let{t:s}=A(),c=Z(),l=y({...se(c),select:Mt}),u=Q.useMemo(()=>K({sessions:l.data??[],currentSessionId:null,searchQuery:e,limit:e.trim()?10:3}),[l.data,e]),[d,f]=Q.useState({query:e,index:0}),p=Math.min(d.query===e?d.index:0,Math.max(0,u.length-1)),m=Q.useRef(null),h=Q.useRef([]),g=Q.useMemo(We,[]);E(`pointerdown`,e=>{e.target instanceof Node&&!m.current?.contains(e.target)&&a()},void 0,{capture:!0}),Q.useLayoutEffect(()=>{h.current[p]?.scrollIntoView?.({block:`nearest`})},[p]),Q.useLayoutEffect(()=>{r(u.length?`${n}-${p}`:void 0)},[p,n,u.length,r]);let _=k(t=>{if(t===`Escape`){a();return}u.length&&(t===`ArrowDown`&&f({query:e,index:(p+1)%u.length}),t===`ArrowUp`&&f({query:e,index:(p-1+u.length)%u.length}),(t===`Enter`||t===`Tab`)&&i(u[p]))});return Q.useImperativeHandle(o,()=>({keyDown:_}),[_]),(0,$.jsxs)(He,{ref:m,isMobile:t,className:`max-w-[640px] max-h-64`,children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 px-3 py-1`,children:[(0,$.jsx)(`span`,{className:`min-w-0 flex-1 text-[length:calc(var(--text-meta)*0.875)] leading-4 text-muted-foreground`,children:s(`assistants.contact.sessionMention.scope`)}),(0,$.jsx)(M,{type:`button`,size:`xs`,variant:`ghost`,"aria-label":s(`dialog.common.actions.close`),onClick:a,children:(0,$.jsx)(Y,{name:`close`,className:`size-4`})})]}),l.isPending?(0,$.jsx)(`p`,{role:`status`,className:`px-3 py-2 typography-meta text-muted-foreground`,children:s(`common.loading`)}):null,l.isError?(0,$.jsxs)(`div`,{role:`alert`,className:`px-3 py-2 typography-meta text-[var(--status-error)]`,children:[s(`assistants.contact.sessionMention.loadFailed`),(0,$.jsx)(M,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>void l.refetch(),children:s(`chat.history.retry`)})]}):null,l.isSuccess&&!u.length?(0,$.jsx)(`p`,{role:`status`,className:`px-3 py-2 typography-meta text-muted-foreground`,children:s(l.data===null?`common.unavailable`:`sessions.sidebar.empty.noMatches.title`)}):null,(0,$.jsx)(Je,{preventOverscroll:!0,outerClassName:`flex-1 min-h-0`,className:`px-0`,children:(0,$.jsx)(`div`,{id:n,role:`listbox`,"aria-label":s(`chat.fileMentionAutocomplete.groups.sessions`),className:`p-1.5`,children:u.map((r,a)=>(0,$.jsxs)(`div`,{id:`${n}-${a}`,role:`option`,"aria-selected":a===p,ref:e=>{h.current[a]=e},className:j(`flex min-h-10 cursor-pointer items-center gap-2 rounded-md px-1.5 py-1 typography-ui-label`,Ue(t,a===p)),onMouseDown:e=>e.preventDefault(),onMouseMove:()=>f({query:e,index:a}),onPointerDown:e=>{e.pointerType===`touch`&&g.pointerDown(e.clientX,e.clientY)},onPointerMove:e=>{e.pointerType===`touch`&&g.pointerMove(e.clientX,e.clientY)},onPointerUp:e=>{e.pointerType===`touch`&&g.pointerUp(()=>i(r))&&(e.preventDefault(),e.stopPropagation())},onPointerCancel:()=>g.pointerCancel(),onClick:()=>g.click(()=>i(r)),children:[(0,$.jsx)(Y,{name:`chat-thread`,className:`size-4 shrink-0 text-muted-foreground`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{className:`truncate font-medium leading-5`,title:r.title,children:r.title||s(`chat.fileMentionAutocomplete.untitledSession`)}),(0,$.jsx)(`div`,{className:`truncate text-[length:calc(var(--text-meta)*0.875)] leading-4 text-muted-foreground`,title:r.directory,children:r.directory})]})]},`${r.directory}:${r.id}`))})}),t?null:(0,$.jsx)(`div`,{className:`mx-1.5 shrink-0 border-t px-1.5 py-1 text-[length:calc(var(--text-meta)*0.875)] leading-4 text-muted-foreground`,children:s(`chat.autocomplete.keyboardHint`)})]})}),Pt=e=>{let t=(0,ut.c)(122),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({active:n,working:o,onChange:r,onVoiceSend:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=o!==void 0&&o,{t:c}=A(),l=Q.useRef(null),m=n&&!!a.isMobile&&!!i,v;t[6]===m?v=t[7]:(v={available:m},t[6]=m,t[7]=v);let{enabled:y,hint:b,onHintChange:x}=Te(v),S;t[8]!==b||t[9]!==a.placeholder||t[10]!==c?(S=b===null?a.placeholder:c(b===`recording`?`chat.dictation.releaseSend`:b===`cancelling`?`chat.dictation.releaseCancel`:b===`editing`?`chat.dictation.releaseEdit`:`chat.dictation.processing`),t[8]=b,t[9]=a.placeholder,t[10]=c,t[11]=S):S=t[11];let C=S,w;t[12]===a.value?w=t[13]:(w=()=>({canonical:a.value,document:p(a.value,new Map)}),t[12]=a.value,t[13]=w);let[T,E]=Q.useState(w),D;t[14]!==T.canonical||t[15]!==T.document||t[16]!==a.value?(D=T.canonical===a.value?T.document:p(a.value,new Map),t[14]=T.canonical,t[15]=T.document,t[16]=a.value,t[17]=D):D=t[17];let O=D,[M,N]=Q.useState(0),[P,F]=Q.useState(!0),[I,L]=Q.useState(!1),[R,z]=Q.useState(),B=Q.useRef(null),V=Q.useRef(null),ee=Q.useRef(null),te=Q.useRef(null),H;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(H=je(),t[18]=H):H=t[18];let U=Q.useRef(H),W=Q.useId(),ne;t[19]!==n||t[20]!==I||t[21]!==M||t[22]!==P||t[23]!==O.text||t[24]!==a.disabled||t[25]!==a.pending?(ne=n&&!a.pending&&!a.disabled&&!P&&!I?Ve({text:O.text,cursor:M}):null,t[19]=n,t[20]=I,t[21]=M,t[22]=P,t[23]=O.text,t[24]=a.disabled,t[25]=a.pending,t[26]=ne):ne=t[26];let re=ne,G=re?.kind===`mention`?re:null,ie;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(ie=()=>{te.current!==null&&(B.current?.focus({preventScroll:!0}),B.current?.setSelectionRange(te.current,te.current),te.current=null)},t[27]=ie):ie=t[27];let ae;t[28]===O?ae=t[29]:(ae=[O],t[28]=O,t[29]=ae),Q.useLayoutEffect(ie,ae);let oe;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(oe=()=>F(!0),t[30]=oe):oe=t[30];let se=k(oe),ce;t[31]!==I||t[32]!==M||t[33]!==O||t[34]!==r?(ce=(e,t,n)=>{let i=n===void 0||n,a=d(e);a.ok&&(i&&(U.current=Re(U.current,{before:De(O,[],{start:B.current?.selectionStart??M,end:B.current?.selectionEnd??M}),after:De(e,[],{start:t,end:t})})),I||(te.current=t),N(t),E({canonical:a.text,document:e}),r(a.text))},t[31]=I,t[32]=M,t[33]=O,t[34]=r,t[35]=ce):ce=t[35];let K=k(ce),le;t[36]!==K||t[37]!==O||t[38]!==G||t[39]!==c?(le=e=>{if(!G)return;let t=e.title||c(`chat.fileMentionAutocomplete.untitledSession`),n=u(O,G.tokenStart,G.tokenEnd,{id:`session:${e.id}:${crypto.randomUUID()}`,kind:`session`,sessionId:e.id,display:g({trigger:`@`,icon:`chat-thread`,label:t})},{inlineBoundaries:!0,padDocumentEdges:!0}),r=n.caret+ +(n.document.text[n.caret]===` `);F(!0),K(n.document,r)},t[36]=K,t[37]=O,t[38]=G,t[39]=c,t[40]=le):le=t[40];let ue=k(le),de;t[41]!==n||t[42]!==K||t[43]!==O||t[44]!==a.disabled||t[45]!==a.pending?(de=e=>{if(!n||a.pending||a.disabled||!e.trim())return;let t=O.text?`${O.text} ${e}`:e,r=f(O,t,t.length,t.length);K(r.document,r.caret),F(!0)},t[41]=n,t[42]=K,t[43]=O,t[44]=a.disabled,t[45]=a.pending,t[46]=de):de=t[46];let q=k(de),fe;t[47]!==n||t[48]!==O.text||t[49]!==q||t[50]!==r||t[51]!==i||t[52]!==a.disabled||t[53]!==a.pending?(fe=e=>{if(!(!n||a.pending||a.disabled||!e.trim())){if(O.text){q(e);return}r(e),i?.(e)}},t[47]=n,t[48]=O.text,t[49]=q,t[50]=r,t[51]=i,t[52]=a.disabled,t[53]=a.pending,t[54]=fe):fe=t[54];let J=k(fe),pe;t[55]!==K||t[56]!==O?(pe=(e,t)=>{let n=e.currentTarget;if(n.selectionStart===n.selectionEnd||!e.clipboardData||!O.references.some(e=>e.start<n.selectionEnd&&e.end>n.selectionStart))return;let r=_(n.selectionStart,n.selectionEnd,O.references)??{start:n.selectionStart,end:n.selectionEnd},i=d({text:O.text.slice(r.start,r.end),references:O.references.filter(e=>e.start>=r.start&&e.end<=r.end).map(e=>({...e,start:e.start-r.start,end:e.end-r.start}))});if(i.ok&&(e.preventDefault(),e.clipboardData.setData(`text/plain`,i.text),t)){let e=f(O,O.text.slice(0,r.start)+O.text.slice(r.end),r.start,r.start);K(e.document,e.caret)}},t[55]=K,t[56]=O,t[57]=pe):pe=t[57];let me=k(pe),he;t[58]!==O.references||t[59]!==O.text?(he=Me(O.text,O.references.map(Ft))?.map(It),t[58]=O.references,t[59]=O.text,t[60]=he):he=t[60];let Y=he,X=y&&O.text.length===0?`true`:void 0,ge;t[61]!==y||t[62]!==q||t[63]!==a.disabled||t[64]!==a.pending||t[65]!==J||t[66]!==x?(ge=y&&(0,$.jsx)(jt,{containerRef:l,disabled:!!(a.pending||a.disabled),onInsert:q,onSend:J,onRelease:At,onHintChange:x}),t[61]=y,t[62]=q,t[63]=a.disabled,t[64]=a.pending,t[65]=J,t[66]=x,t[67]=ge):ge=t[67];let _e=O.text,ve=a.pending||s,ye;t[68]===a?ye=t[69]:(ye=()=>{a.pending||a.onSubmit()},t[68]=a,t[69]=ye);let be=a.layout===`inline`?`py-3 leading-6`:`pt-4 pb-2`,xe;t[70]!==a.textLayoutClassName||t[71]!==be?(xe=j(`whitespace-pre-wrap break-words overflow-hidden px-3 typography-markdown md:typography-ui-label`,be,a.textLayoutClassName),t[70]=a.textLayoutClassName,t[71]=be,t[72]=xe):xe=t[72];let Z;t[73]!==K||t[74]!==O?(Z=(e,t)=>{let n=f(O,e,t?.target.selectionStart??e.length,t?.target.selectionEnd??e.length);K(n.document,n.caret),F(t?.nativeEvent?.inputType===`insertFromPaste`)},t[73]=K,t[74]=O,t[75]=Z):Z=t[75];let Se=G?W:void 0,Ce=G?R:void 0,Ee;t[76]===a.textareaProps?Ee=t[77]:(Ee=e=>{a.textareaProps?.onScroll?.(e),V.current&&(V.current.scrollTop=e.currentTarget.scrollTop,V.current.scrollLeft=e.currentTarget.scrollLeft)},t[76]=a.textareaProps,t[77]=Ee);let Ae,Ne;t[78]!==me||t[79]!==a.textareaProps?(Ae=e=>{a.textareaProps?.onCopy?.(e),e.defaultPrevented||me(e,!1)},Ne=e=>{a.textareaProps?.onCut?.(e),e.defaultPrevented||me(e,!0)},t[78]=me,t[79]=a.textareaProps,t[80]=Ae,t[81]=Ne):(Ae=t[80],Ne=t[81]);let Pe;t[82]===a.textareaProps?Pe=t[83]:(Pe=e=>{N(e.currentTarget.selectionStart),a.textareaProps?.onSelect?.(e)},t[82]=a.textareaProps,t[83]=Pe);let Fe,Ie;t[84]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=()=>{L(!0)},Ie=e=>{L(!1),N(e.currentTarget.selectionStart)},t[84]=Fe,t[85]=Ie):(Fe=t[84],Ie=t[85]);let Le;t[86]!==K||t[87]!==I||t[88]!==O||t[89]!==G||t[90]!==a.textareaProps?(Le=e=>{if(a.textareaProps?.onKeyDown?.(e),!(e.defaultPrevented||we(e))){if(I){e.key===`Enter`&&e.preventDefault();return}if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`z`){let t=e.shiftKey?Oe(U.current,O):ke(U.current,O);t&&(e.preventDefault(),U.current=t.history,K(t.snapshot.document,t.snapshot.selection.end,!1),F(!0));return}if(e.key===`Backspace`||e.key===`Delete`){let t=h(O,{key:e.key,selectionStart:e.currentTarget.selectionStart,selectionEnd:e.currentTarget.selectionEnd,altKey:e.altKey});if(t){e.preventDefault(),K(t.document,t.caret),F(!0);return}}G&&[`ArrowDown`,`ArrowUp`,`Enter`,`Tab`,`Escape`].includes(e.key)&&(e.preventDefault(),e.stopPropagation(),ee.current?.keyDown(e.key))}},t[86]=K,t[87]=I,t[88]=O,t[89]=G,t[90]=a.textareaProps,t[91]=Le):Le=t[91];let ze;t[92]!==a.textareaProps||t[93]!==Se||t[94]!==Ce||t[95]!==Ee||t[96]!==Ae||t[97]!==Ne||t[98]!==Pe||t[99]!==Le?(ze={...a.textareaProps,"aria-controls":Se,"aria-activedescendant":Ce,"aria-autocomplete":`list`,onScroll:Ee,onCopy:Ae,onCut:Ne,onSelect:Pe,onCompositionStart:Fe,onCompositionEnd:Ie,onKeyDown:Le},t[92]=a.textareaProps,t[93]=Se,t[94]=Ce,t[95]=Ee,t[96]=Ae,t[97]=Ne,t[98]=Pe,t[99]=Le,t[100]=ze):ze=t[100];let He;t[101]!==se||t[102]!==W||t[103]!==G||t[104]!==a.isMobile||t[105]!==ue?(He=G?(0,$.jsx)(Nt,{ref:ee,query:G.query,isMobile:a.isMobile??!1,listId:W,onHighlightChange:z,onSelect:ue,onClose:se}):null,t[101]=se,t[102]=W,t[103]=G,t[104]=a.isMobile,t[105]=ue,t[106]=He):He=t[106];let Ue;t[107]!==O.text||t[108]!==Y||t[109]!==C||t[110]!==a||t[111]!==ve||t[112]!==ye||t[113]!==xe||t[114]!==Z||t[115]!==ze||t[116]!==He?(Ue=(0,$.jsx)(Be,{...a,value:_e,pending:ve,placeholder:C,disableInputWhilePending:!1,inputRef:B,onSubmit:ye,highlightedContent:Y,highlightRef:V,textLayoutClassName:xe,onChange:Z,textareaProps:ze,children:He}),t[107]=O.text,t[108]=Y,t[109]=C,t[110]=a,t[111]=ve,t[112]=ye,t[113]=xe,t[114]=Z,t[115]=ze,t[116]=He,t[117]=Ue):Ue=t[117];let We;return t[118]!==X||t[119]!==ge||t[120]!==Ue?(We=(0,$.jsxs)(`div`,{ref:l,className:`yuri-hold-to-talk-container`,"data-hold-to-talk-empty":X,children:[ge,Ue]}),t[118]=X,t[119]=ge,t[120]=Ue,t[121]=We):We=t[121],We};function Ft(e){return{start:e.start,end:e.end,priority:103,...m(e)}}function It(e,t){return(0,$.jsx)(`span`,{className:e.className,children:e.visual?(0,$.jsx)(Pe,{visual:e.visual,text:e.text}):e.text},`${t}-${e.text.length}`)}var Lt=`rounded-[1.35rem] border border-border/40 cursor-zoom-in`;function Rt({assistantID:e,descriptor:t,onShowPopup:n}){let{t:r}=A(),i=Z(),{attachmentID:a,sha256:o,size:s,mime:c,filename:l}=t,u=Q.useMemo(()=>({type:`file`,attachmentID:a,sha256:o,size:s,mime:c,filename:l}),[a,o,s,c,l]),d=c.startsWith(`image/`),f=Ge(l??``,c),[p,m]=Q.useState(0),[h,g]=Q.useState(``),[_,v]=Q.useState(!1),[y,b]=Q.useState(!1),x=Q.useRef(null),S=Q.useRef([]);Q.useEffect(()=>{g(``),v(!1);let t=new AbortController,n;return d&&lt(e,u,{signal:t.signal}).then(e=>{if(t.signal.aborted){e.release();return}n=e.release,g(e.url)}).catch(()=>{t.signal.aborted||v(!0)}),()=>{t.abort(),n?.()}},[e,u,i,d,p]),Q.useEffect(()=>()=>{x.current?.abort(),S.current.forEach(e=>URL.revokeObjectURL(e)),S.current=[]},[e,u,i]);let C=k(async(t=!1)=>{if(x.current)return;let i=new AbortController;x.current=i,b(!0),v(!1);try{let a=await ct(e,u,{signal:i.signal});if(i.signal.aborted)return;S.current.forEach(e=>URL.revokeObjectURL(e));let o=URL.createObjectURL(a);if(S.current=[o],t&&n){n({open:!0,title:l||r(`assistants.contact.attachment.file`),content:``,video:{url:o,mimeType:c,filename:l}});return}let s=document.createElement(`a`);s.href=o,s.download=l||r(`assistants.contact.attachment.file`),document.body.appendChild(s),s.click(),s.remove()}catch{i.signal.aborted||v(!0)}finally{x.current===i&&(x.current=null),i.signal.aborted||b(!1)}}),w=l||r(d?`assistants.contact.attachment.image`:`assistants.contact.attachment.file`),T=k(e=>{!n||!h||n({open:!0,title:w,content:``,metadata:{tool:`image-preview`,filename:w,mime:c},previewSource:e.currentTarget,image:{url:h,mimeType:c,filename:w,size:s,gallery:[{url:h,mimeType:c,filename:w,size:s}],index:0}})});return d&&h&&!_?(0,$.jsx)(Xe,{src:h,alt:w,contentFrame:!0,className:Lt,onError:()=>v(!0),onClick:T,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),T(e))},role:`button`,tabIndex:0,"data-assistant-contact-image":``}):d&&!_?(0,$.jsx)(Ye,{className:`h-[var(--yuri-content-image-height)] w-[min(20rem,100%)] rounded-[1.35rem]`}):(0,$.jsxs)(`div`,{className:`flex max-w-full flex-col gap-1 rounded-[1.25rem] bg-[var(--surface-muted)] px-3.5 py-2.5 ring-1 ring-inset ring-[var(--surface-subtle)]`,"data-assistant-contact-file":``,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,$.jsx)(Y,{name:`file-text`,className:`size-4 shrink-0 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`truncate typography-ui`,children:w})]}),_?(0,$.jsx)(`p`,{role:`alert`,className:`typography-micro text-[var(--status-error)]`,children:r(`assistants.contact.attachment.loadFailed`)}):null,d&&!_||y?(0,$.jsx)(`span`,{role:`status`,className:`typography-micro text-muted-foreground`,children:r(`common.loading`)}):(0,$.jsx)(M,{type:`button`,size:`sm`,variant:`ghost`,onClick:d?()=>m(e=>e+1):()=>void C(f&&!!n),children:r(_?`chat.history.retry`:f&&n?`contextPanel.mode.preview`:`assistants.contact.attachment.download`)})]})}function zt(e){let t=(0,ut.c)(39),{part:n,onShowPopup:r}=e,{t:i}=A(),a=/^(?:https?:|data:|blob:)/i.test(n.url)?n.url:``,o=Se(a,``),[s,c]=Q.useState(!1),l;t[0]!==n.filename||t[1]!==i?(l=n.filename||i(`assistants.contact.attachment.image`),t[0]=n.filename,t[1]=i,t[2]=l):l=t[2];let u=l,d;t[3]!==u||t[4]!==r||t[5]!==o?(d=e=>{!r||!o||r({open:!0,title:u,content:``,metadata:{tool:`image-preview`,filename:u},previewSource:e.currentTarget,image:{url:o,filename:u,gallery:[{url:o,filename:u}],index:0}})},t[3]=u,t[4]=r,t[5]=o,t[6]=d):d=t[6];let f=k(d);if(Ge(a,n.mime)&&a&&r){let e;t[7]!==r||t[8]!==n.filename||t[9]!==n.mime||t[10]!==a||t[11]!==i?(e=()=>r({open:!0,title:n.filename||i(`assistants.contact.attachment.file`),content:``,video:{url:a,filename:n.filename,mimeType:n.mime}}),t[7]=r,t[8]=n.filename,t[9]=n.mime,t[10]=a,t[11]=i,t[12]=e):e=t[12];let o;t[13]!==n.filename||t[14]!==i?(o=n.filename||i(`contextPanel.mode.preview`),t[13]=n.filename,t[14]=i,t[15]=o):o=t[15];let s;return t[16]!==e||t[17]!==o?(s=(0,$.jsx)(M,{variant:`secondary`,size:`sm`,onClick:e,children:o}),t[16]=e,t[17]=o,t[18]=s):s=t[18],s}if(n.mime.startsWith(`image/`)&&o&&!s){let e;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(e=()=>c(!0),t[19]=e):e=t[19];let n;t[20]===f?n=t[21]:(n=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),f(e))},t[20]=f,t[21]=n);let r;return t[22]!==u||t[23]!==f||t[24]!==o||t[25]!==n?(r=(0,$.jsx)(Xe,{src:o,alt:u,contentFrame:!0,className:Lt,onError:e,onClick:f,onKeyDown:n,role:`button`,tabIndex:0,"data-assistant-contact-image":``}),t[22]=u,t[23]=f,t[24]=o,t[25]=n,t[26]=r):r=t[26],r}let p;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(Y,{name:`file-text`,className:`size-4 shrink-0 text-muted-foreground`}),t[27]=p):p=t[27];let m;t[28]!==n.filename||t[29]!==i?(m=n.filename||i(`assistants.contact.attachment.file`),t[28]=n.filename,t[29]=i,t[30]=m):m=t[30];let h;t[31]===m?h=t[32]:(h=(0,$.jsx)(`span`,{className:`truncate typography-ui`,children:m}),t[31]=m,t[32]=h);let g;t[33]!==s||t[34]!==i?(g=s?(0,$.jsx)(M,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>c(!1),children:i(`chat.history.retry`)}):null,t[33]=s,t[34]=i,t[35]=g):g=t[35];let _;return t[36]!==h||t[37]!==g?(_=(0,$.jsxs)(`div`,{className:`flex max-w-full items-center gap-2.5 rounded-[1.25rem] bg-[var(--surface-muted)] px-3.5 py-2.5`,"data-assistant-contact-file":``,children:[p,h,g]}),t[36]=h,t[37]=g,t[38]=_):_=t[38],_}function Bt(e){let t=(0,ut.c)(5),{assistantID:n,part:r,onShowPopup:i}=e,a=Z(),o;return t[0]!==n||t[1]!==i||t[2]!==r||t[3]!==a?(o=`attachmentID`in r?(0,$.jsx)(Rt,{assistantID:n,descriptor:r,onShowPopup:i},`${a}:${n}:${r.attachmentID}:${r.sha256}`):(0,$.jsx)(zt,{part:r,onShowPopup:i},`${a}:${r.url}`),t[0]=n,t[1]=i,t[2]=r,t[3]=a,t[4]=o):o=t[4],o}var Vt=[],Ht=e=>e.flatMap(e=>e.type===`text`&&e.text.trim()?[e.text]:[]).join(`
3
- `),Ut=(e,t,n,r=Date.now())=>({assistantID:e,messageID:t,parts:n,status:`sending`,createdAt:r}),Wt=(e,t)=>{let n=e.filter(e=>e.assistantID===t);return n.length===e.length?e:n},Gt=(e,t)=>{let n=e.filter(e=>e.assistantID===t);return n.length===e.length?e:n},Kt=(e,t,n,r)=>({messageID:t?`${e.turnID}:preview:${t.bubbleIndex}`:`${e.turnID}:preview:${r}`,assistantID:e.assistantID,role:`assistant`,turnID:e.turnID,bubbleIndex:t?.bubbleIndex??0,createdAt:t?.occurredAt??e.occurredAt,ordinal:n,status:r,fromAssistantID:null,fromAssistantName:null,parts:t?[{type:`text`,text:t.text}]:[],text:t?.text??``,cards:[]}),qt=(e,t,n)=>{let r=e.bubbles.filter(e=>!t.has(e.bubbleIndex)).map((t,r)=>Kt(e,t,n+r,t.done?`complete`:`streaming`));return e.status===`failed`?[...r,Kt(e,null,n+r.length,`failed`)]:e.status===`admitted`||e.status===`streaming`?[...r,Kt(e,null,n+r.length,`admitted`)]:r},Jt=(e,t,n,r=[])=>{let i=new Set(e.map(e=>e.messageID)),a=t.flatMap((t,r)=>t.assistantID!==n||i.has(t.messageID)?[]:[{messageID:t.messageID,assistantID:n,role:`user`,turnID:t.messageID,bubbleIndex:0,createdAt:t.createdAt,ordinal:e.length+r,status:t.status,fromAssistantID:null,fromAssistantName:null,parts:[...t.parts],text:Ht(t.parts),cards:[]}]),o=a.length===0?e:[...e,...a],s=r.filter(e=>e.assistantID===n);if(s.length===0)return o;let c=new Map,l=new Map;o.forEach((e,t)=>{if(c.set(e.turnID,t),e.role!==`assistant`||e.messageID.includes(`:preview:`))return;let n=l.get(e.turnID)??new Set;n.add(e.bubbleIndex),l.set(e.turnID,n)});let u=new Map,d=[];for(let e of s){let t=qt(e,l.get(e.turnID)??new Set,o.length+d.length);if(t.length===0)continue;let n=c.get(e.turnID);if(n===void 0){if(e.status===`failed`&&o.some(t=>t.turnID!==e.turnID))continue;d.push(...t);continue}let r=u.get(n)??[];r.push(...t),u.set(n,r)}return u.size===0&&d.length===0?o:o.flatMap((e,t)=>[e,...u.get(t)??[]]).concat(d)},Yt=(e,t)=>{let n=new Set(t.map(e=>e.messageID)),r=e.filter(e=>!n.has(e.messageID));return r.length===e.length?e:r},Xt=(e,t)=>e.map(e=>e.messageID===t?{...e,status:`admitted`}:e),Zt=(e,t,n,r=Date.now())=>{let i=e.filter(e=>e.assistantID!==t||e.status!==`failed`||e.turnID===n);return i.some(e=>e.assistantID===t&&e.turnID===n)?i.length===e.length?e:i:[...i,{assistantID:t,turnID:n,status:`admitted`,bubbles:[],occurredAt:r}]},Qt=(e,t,n)=>!t?.turnID||!t.assistantID||n?.has(t.turnID)?e:Zt(e,t.assistantID,t.turnID,t.admittedAt),$t=(e,t)=>{let n=t.assistantID,r=t.pendingSendTurnIDs??new Set,i=t.settledTurnIDs??new Set,a=typeof t.snapshotRevision==`number`&&Number.isFinite(t.snapshotRevision)?t.snapshotRevision:null,o=t.admissionRevisionByTurnID instanceof Map?t.admissionRevisionByTurnID:new Map(Object.entries(t.admissionRevisionByTurnID??{}).map(([e,t])=>[e,Number(t)])),s=t.occurredAt??Date.now(),c=t.activeContactTurn&&t.activeContactTurn.turnID?t.activeContactTurn:null,l=!!(t.serverWorking||c),u=Qt(e,c?{assistantID:n,turnID:c.turnID,admittedAt:c.admittedAt}:null,i),d=Array.isArray(t.messages)?t.messages:[];for(let e of d)e.role===`assistant`&&e.status===`error`&&(r.has(e.turnID)||i.has(e.turnID)||(u=tn(u,{assistantID:n,turnID:e.turnID,status:`error`,error:e.text||`upstream_error`,occurredAt:s})));if(u=nn(u,d),l){let t=u.filter(e=>{if(e.assistantID!==n||e.status!==`admitted`&&e.status!==`streaming`||r.has(e.turnID)||c&&e.turnID===c.turnID)return!0;let t=o.get(e.turnID);return typeof t==`number`&&a!=null&&a<t?!0:typeof t==`number`&&a!=null&&a>=t&&e.turnID!==c?.turnID?!1:!c||e.turnID===c.turnID});return t.length===e.length&&t.every((t,n)=>t===e[n])?e:t}if(a==null)return u.length===e.length&&u.every((t,n)=>t===e[n])?e:u;let f=u.filter(e=>{if(e.assistantID!==n||e.status!==`admitted`&&e.status!==`streaming`||r.has(e.turnID))return!0;if(i.has(e.turnID))return!1;let t=o.get(e.turnID);return typeof t==`number`&&a<t});return f.length===e.length&&f.every((t,n)=>t===e[n])?e:f.length===u.length?u:f},en=(e,t)=>Zt(e,t.assistantID,t.turnID,t.occurredAt).map(e=>{if(e.assistantID!==t.assistantID||e.turnID!==t.turnID||e.status===`failed`||e.status===`complete`)return e;let n=e.bubbles.find(e=>e.bubbleIndex===t.bubbleIndex);if(n?.done)return e;let r=n?{...n,text:`${n.text}${t.delta}`,done:t.done,occurredAt:t.occurredAt}:{bubbleIndex:t.bubbleIndex,text:t.delta,done:t.done,occurredAt:t.occurredAt},i=n?e.bubbles.map(e=>e.bubbleIndex===t.bubbleIndex?r:e):[...e.bubbles,r].sort((e,t)=>e.bubbleIndex-t.bubbleIndex);return{...e,status:`streaming`,bubbles:i}}),tn=(e,t,n={})=>n.requireExisting&&!e.some(e=>e.assistantID===t.assistantID&&e.turnID===t.turnID)?e:Zt(e,t.assistantID,t.turnID,t.occurredAt).map(e=>e.assistantID!==t.assistantID||e.turnID!==t.turnID||e.status===`complete`||e.status===`failed`?e:{...e,status:t.status===`error`?`failed`:`complete`,...t.error?{error:t.error}:{}}),nn=(e,t)=>{let n=new Set(t.map(e=>e.turnID).filter(Boolean)),r=t.length>0?t[t.length-1]?.turnID??null:null,i=[...e].reverse().find(e=>e.status===`admitted`||e.status===`streaming`)?.turnID??r,a=new Set(t.flatMap(e=>e.role===`assistant`?[e.turnID]:[])),o=e.filter(e=>e.status===`admitted`||e.status===`streaming`||!(e.status===`complete`&&a.has(e.turnID)||!n.has(e.turnID)||e.status===`failed`&&(i&&i!==e.turnID||r&&r!==e.turnID)));return o.length===e.length?e:o},rn=(e,t,n)=>e.map(e=>e.messageID===t?{...e,status:`failed`,error:n}:e),an=(e,t)=>{if(e instanceof I){if(e.code===`no_provider`)return t.noProvider;if(e.code===`admission_timeout`||e.code===`generate_timeout`)return t.timedOut;if(e.message&&e.message!==e.code)return e.message}return L(e)?t.timedOut:t.sendFailed},on=()=>{let e=!1;return{tryAcquire:()=>!e&&(e=!0,!0),release:()=>{e=!1}}},sn=e=>{let t=e.text.trim();if(e.sending||!t&&e.attachments.length===0||!e.gate.tryAcquire())return{ok:!1};let n=[...t?[{type:`text`,text:t}]:[],...e.attachments.map(e=>({type:`file`,mime:e.mime,url:e.url,filename:e.name}))],r=e.createMessageID();return{ok:!0,messageID:r,parts:n,turn:Ut(e.assistantID,r,n,e.createdAt)}},cn=e=>e.some(e=>e.status===`sending`),ln=e=>e.some(e=>e.status===`admitted`||e.status===`streaming`),un=[`cursor-pointer rounded-[1.35rem] bg-[var(--surface-elevated)] ring-1 ring-inset ring-[var(--surface-subtle)]`,`px-3.5 py-3 text-left transition-[background-color,box-shadow,transform] duration-200 ease-out motion-reduce:transition-none`,`hover:-translate-y-px hover:bg-interactive-hover/45 hover:shadow-sm active:translate-y-0 motion-reduce:hover:translate-y-0`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]`].join(` `),dn=`${un} w-fit min-w-0 max-w-[min(100%,15rem)]`,fn=`${un} w-fit min-w-0 max-w-[min(100%,20rem)]`;function pn(e,t){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())}var mn=e=>{let t=(0,ut.c)(23),{card:n}=e,{t:r}=A(),i=ze(),a;t[0]===i?a=t[1]:(a=i&&!S(),t[0]=i,t[1]=a);let o=!!a,s=n.name,c=`${n.providerID}/${n.modelID}`,l;t[2]!==n.assistantID||t[3]!==o?(l=()=>{if(o){le.getState().openAssistant(n.assistantID);return}q(n.assistantID)},t[2]=n.assistantID,t[3]=o,t[4]=l):l=t[4];let u=k(l),d;t[5]===u?d=t[6]:(d=e=>{pn(e,u)},t[5]=u,t[6]=d);let f=k(d),p;t[7]!==r||t[8]!==s?(p=r(`assistants.contact.card.assistant.aria`,{name:s}),t[7]=r,t[8]=s,t[9]=p):p=t[9];let m;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(`span`,{className:`relative inline-block size-10 shrink-0 leading-none`,"aria-hidden":!0,children:(0,$.jsx)(`span`,{className:`flex size-10 items-center justify-center rounded-xl bg-[var(--surface-muted)] text-foreground`,children:(0,$.jsx)(Y,{name:`robot-2`,className:`size-5`})})}),t[10]=m):m=t[10];let h;t[11]===s?h=t[12]:(h=(0,$.jsx)(`h3`,{className:`min-w-0 line-clamp-2 break-words typography-ui-label font-medium leading-5 text-foreground`,children:s}),t[11]=s,t[12]=h);let g;t[13]===c?g=t[14]:(g=(0,$.jsx)(`p`,{className:`truncate typography-micro font-normal leading-4 text-muted-foreground`,children:c}),t[13]=c,t[14]=g);let _;t[15]!==h||t[16]!==g?(_=(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[m,(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[h,g]})]}),t[15]=h,t[16]=g,t[17]=_):_=t[17];let v;return t[18]!==f||t[19]!==u||t[20]!==p||t[21]!==_?(v=(0,$.jsx)(`article`,{className:dn,role:`button`,tabIndex:0,"aria-label":p,"data-assistant-contact-card":`assistant`,onClick:u,onKeyDown:f,children:_}),t[18]=f,t[19]=u,t[20]=p,t[21]=_,t[22]=v):v=t[22],v},hn=e=>{let t=(0,ut.c)(30),{card:n}=e,{t:r}=A(),i=n.name,a;t[0]!==n.kind||t[1]!==r?(a=n.kind===`daily`||n.kind===`weekly`||n.kind===`once`||n.kind===`cron`?r(`sessions.scheduledTasks.editor.scheduleType.${n.kind}`):n.kind,t[0]=n.kind,t[1]=r,t[2]=a):a=t[2];let o=a,s;t[3]!==n.time||t[4]!==o?(s=[o,n.time].filter(Boolean),t[3]=n.time,t[4]=o,t[5]=s):s=t[5];let c=s.join(` · `),l;t[6]!==n.prompt||t[7]!==c?(l=c.trim()||(typeof n.prompt==`string`?n.prompt.trim():``),t[6]=n.prompt,t[7]=c,t[8]=l):l=t[8];let u=l,d;t[9]!==n.projectID||t[10]!==n.taskID?(d=()=>{rt(n.projectID,n.taskID)},t[9]=n.projectID,t[10]=n.taskID,t[11]=d):d=t[11];let f=k(d),p;t[12]===f?p=t[13]:(p=e=>{pn(e,f)},t[12]=f,t[13]=p);let m=k(p),h;t[14]!==r||t[15]!==i?(h=r(`assistants.contact.card.schedule.aria`,{name:i}),t[14]=r,t[15]=i,t[16]=h):h=t[16];let g;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(`span`,{className:`relative inline-block size-10 shrink-0 leading-none`,"aria-hidden":!0,children:(0,$.jsx)(`span`,{className:`flex size-10 items-center justify-center rounded-xl bg-[var(--surface-muted)] text-foreground`,children:(0,$.jsx)(Y,{name:`calendar`,className:`size-5`})})}),t[17]=g):g=t[17];let _;t[18]===i?_=t[19]:(_=(0,$.jsx)(`h3`,{className:`min-w-0 line-clamp-2 break-words typography-ui-label font-medium leading-5 text-foreground`,children:i}),t[18]=i,t[19]=_);let v;t[20]===u?v=t[21]:(v=u?(0,$.jsx)(`p`,{className:`truncate typography-micro font-normal leading-4 text-muted-foreground`,children:u}):null,t[20]=u,t[21]=v);let y;t[22]!==_||t[23]!==v?(y=(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[g,(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[_,v]})]}),t[22]=_,t[23]=v,t[24]=y):y=t[24];let b;return t[25]!==m||t[26]!==f||t[27]!==y||t[28]!==h?(b=(0,$.jsx)(`article`,{className:dn,role:`button`,tabIndex:0,"aria-label":h,"data-assistant-contact-card":`schedule`,onClick:f,onKeyDown:m,children:y}),t[25]=m,t[26]=f,t[27]=y,t[28]=h,t[29]=b):b=t[29],b},gn=(e,t)=>t===`cancelled`?t:e===`busy`||e===`retry`?e:t===`error`||t===`question`||t===`complete`?t:e===`idle`?`complete`:t===`busy`||t===`retry`||t===`idle`?t:t||`busy`,_n=e=>e===`cancelled`?`assistants.contact.card.session.status.cancelled`:e===`busy`?`assistants.contact.card.session.status.busy`:e===`retry`?`assistants.contact.card.session.status.retry`:e===`idle`?`assistants.contact.card.session.status.idle`:e===`complete`?`assistants.contact.card.session.status.complete`:e===`error`?`assistants.contact.card.session.status.error`:e===`question`?`assistants.contact.card.session.status.question`:null,vn=e=>e===`busy`?`bg-[var(--status-info)]/10 text-[var(--status-info)]`:e===`retry`||e===`question`?`bg-[var(--status-warning)]/10 text-[var(--status-warning)]`:e===`error`?`bg-[var(--status-error)]/10 text-[var(--status-error)]`:e===`idle`||e===`complete`?`bg-[var(--status-success)]/10 text-[var(--status-success)]`:`bg-[var(--surface-muted)] text-muted-foreground`,yn=e=>e.split(/[/\\]/u).filter(Boolean).at(-1)||e,bn=e=>{let t=(0,ut.c)(35),{card:n}=e,{t:r}=A(),i=ze(),a;t[0]===i?a=t[1]:(a=i&&!S(),t[0]=i,t[1]=a);let o=!!a,s;t[2]===n.sessionID?s=t[3]:(s=e=>e.activeSessions.find(e=>e.id===n.sessionID)??e.archivedSessions.find(e=>e.id===n.sessionID)??null,t[2]=n.sessionID,t[3]=s);let l=oe(s),u=ce(n.sessionID),d=(typeof l?.title==`string`&&l.title.trim()?l.title.trim():null)||n.title||r(`assistants.contact.card.session.untitled`),f=gn(u?.type,n.status),p=_n(f),m=f===`busy`||f===`retry`,h=yn(typeof l?.directory==`string`&&l.directory.trim()?l.directory.trim():n.directory),g=Ne(l)||n.branch,_=Ae(l),v=Fe(l),y=Le(v),b=[h,_,g].filter(xn),x;t[4]!==n.directory||t[5]!==n.sessionID||t[6]!==o?(x=()=>{let e=ot(n.sessionID)?.directory||n.directory;ue(n.sessionID,e,{phoneShell:o,switchToChat:!0}),o||c.getState().setActiveMainTab(`chat`)},t[4]=n.directory,t[5]=n.sessionID,t[6]=o,t[7]=x):x=t[7];let C=k(x),w;t[8]===C?w=t[9]:(w=e=>{pn(e,C)},t[8]=C,t[9]=w);let T=k(w),E=fn,D=r(`assistants.contact.card.session.aria`,{title:d}),O;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsx)(`span`,{className:`flex size-10 items-center justify-center rounded-xl bg-[var(--surface-muted)] text-foreground`,children:(0,$.jsx)(Y,{name:`chat-3`,className:`size-5`})}),t[10]=O):O=t[10];let M;t[11]===m?M=t[12]:(M=m?(0,$.jsx)(`span`,{className:`pointer-events-none absolute right-0 bottom-0 size-2.5 translate-x-0.5 translate-y-0.5 rounded-full bg-[var(--status-success)] ring-2 ring-[var(--surface-elevated)]`,"data-assistant-working-dot":``,"aria-hidden":!0}):null,t[11]=m,t[12]=M);let N;t[13]===M?N=t[14]:(N=(0,$.jsxs)(`span`,{className:`relative inline-block size-10 shrink-0 leading-none`,"aria-hidden":!0,children:[O,M]}),t[13]=M,t[14]=N);let P;t[15]===d?P=t[16]:(P=(0,$.jsx)(`h3`,{className:`min-w-0 flex-1 line-clamp-2 break-words typography-ui-label font-medium leading-5 text-foreground`,children:d}),t[15]=d,t[16]=P);let F=p?(0,$.jsx)(`span`,{className:j(`shrink-0 rounded-full px-1.5 py-0.5 typography-micro leading-none`,vn(f)),children:r(p)}):null,I;t[17]!==P||t[18]!==F?(I=(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[P,F]}),t[17]=P,t[18]=F,t[19]=I):I=t[19];let L;t[20]===b?L=t[21]:(L=b.length>0?(0,$.jsx)(`p`,{className:`truncate typography-micro font-normal leading-4 text-muted-foreground`,children:b.join(` · `)}):null,t[20]=b,t[21]=L);let R=y||v?.files!==void 0&&v.files>0?(0,$.jsxs)(`p`,{className:`flex flex-wrap items-baseline gap-x-1.5 typography-micro tabular-nums`,children:[v?.additions===void 0?null:(0,$.jsxs)(`span`,{className:`text-[var(--status-success)]`,children:[`+`,v.additions]}),v?.deletions===void 0?null:(0,$.jsxs)(`span`,{className:`text-[var(--status-error)]`,children:[`−`,v.deletions]}),v?.files===void 0?null:(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:v.files===1?r(`assistants.contact.card.session.changes.filesSingle`,{count:v.files}):r(`assistants.contact.card.session.changes.filesPlural`,{count:v.files})})]}):null,z;t[22]!==I||t[23]!==L||t[24]!==R?(z=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[I,L,R]}),t[22]=I,t[23]=L,t[24]=R,t[25]=z):z=t[25];let B;t[26]!==N||t[27]!==z?(B=(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[N,z]}),t[26]=N,t[27]=z,t[28]=B):B=t[28];let V;return t[29]!==T||t[30]!==C||t[31]!==B||t[32]!==E||t[33]!==D?(V=(0,$.jsx)(`article`,{className:E,role:`button`,tabIndex:0,"aria-label":D,"data-assistant-contact-card":`session`,onClick:C,onKeyDown:T,children:B}),t[29]=T,t[30]=C,t[31]=B,t[32]=E,t[33]=D,t[34]=V):V=t[34],V};function xn(e){return!!(e&&e.trim())}var Sn=2,Cn=1500,wn=e=>({scrollTop:e.scrollTop,scrollHeight:e.scrollHeight,clientHeight:e.clientHeight}),Tn=e=>e.scrollHeight-e.scrollTop-e.clientHeight,En=e=>Tn(e)<=Sn,Dn=(e,t)=>{let n=t instanceof Element?t:t instanceof Node?t.parentElement:null;for(;n&&n!==e;){if(n instanceof HTMLElement&&n.scrollHeight>n.clientHeight+1&&n.scrollTop+n.clientHeight<n.scrollHeight-1)return!0;n=n.parentElement}return!1},On=e=>e.altKey||e.ctrlKey||e.metaKey?!1:e.key===`ArrowDown`||e.key===`PageDown`||e.key===`End`,kn=({active:e,assistantID:t,contentRevision:n,onLoadEarlier:r})=>{let i=Q.useRef(null),[a,o]=Q.useState(null),[s,c]=Q.useState(null),l=Q.useRef(!0),u=Q.useRef(null),d=Q.useRef(null),f=Q.useRef(null),p=Q.useRef(0),m=Q.useRef(null),h=Q.useRef(null),g=Q.useRef(e);g.current=e;let _=me(),v=Q.useRef(!1),y=Q.useRef(null),b=Q.useRef(null),x=k(()=>{y.current?.stop(),y.current=null,b.current=null}),S=Q.useMemo(()=>e=>{i.current=e,o(t=>t===e?t:e)},[]),C=Q.useMemo(()=>e=>{c(t=>t===e?t:e)},[]),w=k(()=>{let e=i.current;if(!e||!g.current||l.current)return;let t=e.getBoundingClientRect().top,n=Array.from(e.querySelectorAll(`[data-message-id]`)).find(e=>e.getBoundingClientRect().bottom>t);u.current=n?{id:n.dataset.messageId,offset:n.getBoundingClientRect().top-t,scrollTop:e.scrollTop}:null}),T=k(()=>{let e=i.current,t=u.current;if(!e||!g.current||l.current)return;if(!t){w();return}let n=e.scrollTop-t.scrollTop;if(Math.abs(n)>.5&&m.current){p.current=e.scrollTop,w();return}let r=Array.from(e.querySelectorAll(`[data-message-id]`)).find(e=>e.dataset.messageId===t.id);if(!r){w();return}let a=r.getBoundingClientRect().top-e.getBoundingClientRect().top-(t.offset-n);Math.abs(a)>.5&&(e.scrollTop+=a),p.current=e.scrollTop,u.current={id:t.id,offset:r.getBoundingClientRect().top-e.getBoundingClientRect().top,scrollTop:e.scrollTop}}),D=k(()=>{x(),l.current=!1,p.current=i.current?.scrollTop??0,w()}),A=Q.useRef(null),j=k(e=>{let t=i.current;!g.current||!t||(A.current=e??null,l.current=!0,u.current=null,h.current=null,p.current=t.scrollTop)}),M=k(()=>{if(!g.current||!l.current)return!1;let e=i.current;if(!e)return!1;let t=wn(e),n=Math.min(p.current,Math.max(0,t.scrollHeight-t.clientHeight));if(t.scrollTop<n-.5)return x(),l.current=!1,p.current=t.scrollTop,w(),!1;let r=!v.current;if(r&&e.querySelector(`[data-message-id]`)&&(v.current=!0),En(t))return x(),p.current=t.scrollTop,!1;let a=Math.max(0,t.scrollHeight-t.clientHeight);if(!r&&!_){if(b.current===a)return!1;x(),b.current=a;let t=A.current;return A.current=null,y.current=pe(e.scrollTop,a,{duration:t?.duration??.22,ease:t?[...t.ease]:`easeOut`,onUpdate:t=>{if(!g.current||!l.current||i.current!==e)return;let n=Math.max(0,e.scrollHeight-e.clientHeight);if(e.scrollTop<Math.min(p.current,n)-.5){l.current=!1,x(),p.current=e.scrollTop,w();return}e.scrollTop=Math.min(Math.max(e.scrollTop,t),n),p.current=e.scrollTop},onComplete:()=>{y.current=null,b.current=null}}),!0}return x(),e.scrollTop=a,p.current=e.scrollTop,!0}),N=k(e=>{h.current={direction:e,expiresAt:performance.now()+Cn}}),P=k(()=>{let e=h.current;return e?performance.now()>e.expiresAt?(h.current=null,null):e.direction:null}),F=k(()=>{x(),l.current=!1,w()}),I=k(()=>{if(!g.current)return;let e=i.current;if(!e)return;let t=wn(e),n=t.scrollTop>p.current,a=Math.min(p.current,Math.max(0,t.scrollHeight-t.clientHeight));if(p.current=t.scrollTop,l.current){t.scrollTop<a-.5&&F();return}let o=P();T(),t.scrollTop<=80&&o===`up`&&r?.(),n&&En(t)&&(o===`down`||o===`scrollbar`)&&(l.current=!0)}),L=k(e=>{let t=i.current;if(!(!t||e.deltaY===0)){if(e.deltaY<0){if(Ie(t,e.target))return;N(`up`),F(),t.scrollTop<=80&&r?.();return}Dn(t,e.target)||N(`down`)}}),R=k(e=>{h.current=null;let t=e.touches.item(0);m.current=t?{x:t.clientX,y:t.clientY,deltaX:0,deltaY:0}:null}),z=k(e=>{let t=i.current,n=e.touches.item(0);if(!t||!n){m.current=null;return}let a=m.current;if(!a)return;let o=n.clientY-a.y,s=o*a.deltaY<0,c=(s?0:a.deltaX)+n.clientX-a.x,l=(s?0:a.deltaY)+o;if(m.current={x:n.clientX,y:n.clientY,deltaX:c,deltaY:l},!(Math.abs(c)>=Math.abs(l))){if(l>0&&Ie(t,e.target)||l<0&&Dn(t,e.target)){m.current.deltaX=0,m.current.deltaY=0;return}N(l>0?`up`:`down`),l>2&&(F(),t.scrollTop<=80&&r?.())}}),B=k(()=>{m.current=null}),V=k(e=>{if(Ee(e)){N(`up`),F(),(i.current?.scrollTop??1/0)<=80&&r?.();return}On(e)&&N(`down`)}),ee=k(e=>{let t=i.current;e.pointerType===`mouse`&&e.target===t&&N(`scrollbar`)});Q.useLayoutEffect(()=>{let n=e?t:null,r=i.current;(d.current!==n||f.current!==r)&&(x(),v.current=!1,d.current=n,f.current=r,l.current=!0,u.current=null,h.current=null,m.current=null,p.current=r?.scrollTop??0),e&&(M(),T())},[e,t,n,a,_]),Q.useLayoutEffect(()=>()=>{x()},[e,t,a,x]);let te=Q.useMemo(()=>()=>void 0,[]),H=e&&a?a:te,U=Q.useMemo(()=>({passive:!0}),[]);E(`scroll`,I,H,U),E(`wheel`,L,H,U),E(`touchstart`,R,H,U),E(`touchmove`,z,H,U),E(`touchend`,B,H,U),E(`touchcancel`,B,H,U),E(`keydown`,V,H),E(`pointerdown`,ee,H,U);let W=k(()=>{M(),T()});return O(typeof ResizeObserver<`u`&&e?s:null,W),{scrollRef:S,contentRef:C,preparePrepend:D,followLatest:j}},An=.3,jn=[.19919472913616398,.010644531250000006,.27920937042459737,.91025390625],Mn=[.23,1,.32,1],Nn=he(...jn),Pn=he(...Mn),Fn=.15,In=.1,Ln=.08,Rn=e=>({left:e.left,top:e.top,width:e.width,height:e.height}),zn=e=>Number.parseFloat(e)||0,Bn=(e,t,n)=>e+(t-e)*n,Vn=e=>[e.borderTopLeftRadius,e.borderTopRightRadius,e.borderBottomRightRadius,e.borderBottomLeftRadius],Hn=e=>{let t=e.getBoundingClientRect(),n=window.getComputedStyle(e),r=t.left+zn(n.borderLeftWidth)+zn(n.paddingLeft),i=t.top+zn(n.borderTopWidth)+zn(n.paddingTop);return{left:r,top:i,width:t.right-zn(n.borderRightWidth)-zn(n.paddingRight)-r,height:t.bottom-zn(n.borderBottomWidth)-zn(n.paddingBottom)-i}},Un=e=>({color:e.color,fontFamily:e.fontFamily,fontSize:e.fontSize,fontWeight:e.fontWeight,fontFeatureSettings:e.fontFeatureSettings,letterSpacing:e.letterSpacing,lineHeight:e.lineHeight,whiteSpace:`pre-wrap`,overflowWrap:`anywhere`}),Wn=(e,t,n=!1)=>{if(!t.value.trim())return null;let r=window.getComputedStyle(e),i=Hn(t),a=t.parentElement?.querySelector(`[data-composer-highlight]`),o=Un(window.getComputedStyle(t));return a&&(o.color=window.getComputedStyle(a).color),{compact:n,background:Rn(e.getBoundingClientRect()),backgroundColor:r.backgroundColor,radii:Vn(r),text:t.value,textBox:{...i,top:i.top-t.scrollTop},textStyle:o}},Gn=e=>{let t=document.createElement(`div`);return Object.assign(t.style,{position:`absolute`,pointerEvents:`none`,margin:`0px`,...e}),t},Kn=(e,t,n,r)=>(e.style.opacity=String(t),pe(e,{opacity:[t,n]},{duration:r,ease:`linear`})),qn=(e,t,n=t,r)=>{let i=window.getComputedStyle(t),a=Vn(i),o=Rn(t.getBoundingClientRect()),s=Hn(t),c=e.compact?{...e.background,left:e.textBox.left-zn(i.paddingLeft),width:Math.min(e.background.width,Math.max(120,o.width+32))}:e.background,l={left:c.left,top:c.top+c.height-o.height},u={x:e.textBox.left-l.left-(s.left-o.left),y:e.textBox.top-l.top-(s.top-o.top)},d=Gn({position:`fixed`,left:`0px`,top:`0px`,overflow:`hidden`,zIndex:`60`,willChange:`transform, width, height`});d.setAttribute(`aria-hidden`,`true`),d.setAttribute(`data-assistant-contact-send-flight`,``),d.style.backgroundColor=e.backgroundColor;let f=Gn({...e.textStyle,left:`0px`,top:`0px`,width:`${e.textBox.width}px`});f.textContent=e.text;let p=Gn({...Un(i),left:`0px`,top:`0px`,width:`${s.width}px`});p.textContent=t.textContent??``,d.append(f,p);let m=n=>{let r=Nn(n),i=Pn(n),m=Rn(t.getBoundingClientRect()),h=c,g=Bn(h.left,m.left,i),_=Bn(h.left+h.width,m.left+m.width,i),v=Bn(h.top+h.height,m.top+m.height,r),y=Bn(h.height,m.height,r),b=v-y;d.style.transform=`translate3d(${g}px, ${b}px, 0)`,d.style.width=`${_-g}px`,d.style.height=`${y}px`,d.style.borderRadius=a.map((t,n)=>`${Bn(zn(e.radii[n]),zn(t),r)}px`).join(` `);let x=m.left+(l.left-o.left)*(1-i),S=m.top+(l.top-o.top)*(1-r),C=`translate3d(${x+(s.left-o.left)+u.x*(1-r)-g}px, ${S+(s.top-o.top)+u.y*(1-r)-b}px, 0)`;f.style.transform=C,p.style.transform=C},h=!1,g=[],_=()=>{h||(h=!0,g.forEach(e=>e.stop()),d.remove(),n.style.visibility=``,r?.())};return n.style.visibility=`hidden`,m(0),document.body.appendChild(d),g.push(pe(d,{backgroundColor:[e.backgroundColor,i.backgroundColor]},{duration:Fn,ease:`linear`}),Kn(f,1,0,In),Kn(p,0,1,Ln),pe(0,1,{duration:An,ease:`linear`,onUpdate:m,onComplete:_})),_},Jn=64,Yn=e=>{if(!e)return[];let t=Array.from(e.files||[]);return t.length>0?t:Array.from(e.items||[]).filter(e=>e.kind===`file`).map(e=>e.getAsFile()).filter(e=>e instanceof File)},Xn=e=>Array.from(e?.files||[]),Zn=async(e,t=l)=>{let n=[],r=0;for(let i of Array.from(e||[])){if(!i||i.size<=0)continue;if(i.size>26214400){r+=1;continue}let e=URL.createObjectURL(i);n.push({id:t(),url:e,name:i.name.trim()||`attachment`,mime:i.type.trim()||`application/octet-stream`,file:i})}return{attachments:n,skippedTooLarge:r}},Qn=(e,t)=>{let n=[...e,...t];for(let e of n.slice(Jn))e.url.startsWith(`blob:`)&&URL.revokeObjectURL(e.url);return n.slice(0,Jn)},$n=Ke(()=>b(()=>import(`./ToolOutputDialog-BVplHxKd.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73]))),er=e=>e.trim().startsWith(`yuri.settle.`)||e.trim().startsWith(`oc.settle.`),tr=e=>e.status===`error`||e.status===`failed`&&e.messageID.endsWith(`:preview:failed`),nr=e=>e.role===`assistant`&&e.status!==`error`&&e.parts.some(e=>e.type===`text`)?`${e.turnID}:assistant:${e.bubbleIndex}`:e.messageID,rr=({assistant:e,warning:t,active:n,overlayHeader:r=!1})=>{let{t:i,locale:a}=A(),o=Z(),s=c(e=>e.isMobile),u=ee(),d=ie(),f=z(e.id,n),p=c(e=>e.isSettingsDialogOpen),m=n&&!p&&!f.hasMessageGap?R(e,f.data):null,h=N(e.name).displayName||e.name,g=(e,t)=>{let n=e?d.data?.assistants.find(t=>t.id===e):void 0;return n?N(n.name).displayName||n.name:t||i(`assistants.contact.peer.unknown`)},[_,v]=Q.useState(``),[y,b]=Q.useState([]),x=Q.useRef(null),S=Q.useRef(new Map),C=Q.useRef(new AbortController);Q.useEffect(()=>{let e=new AbortController;return C.current=e,()=>e.abort()},[e.id,o]);let w=Q.useRef(new Set);Q.useEffect(()=>{let e=new Set(y.map(e=>e.url));for(let t of w.current)e.has(t)||URL.revokeObjectURL(t);w.current=e},[y]),Q.useEffect(()=>()=>{for(let e of w.current)URL.revokeObjectURL(e)},[]);let[T,E]=Q.useState([]),[D,O]=Q.useState([]),[F,L]=Q.useState(null),[B,V]=Q.useState({open:!1,title:``,content:``}),U=c(e=>e.setImagePreviewOpen),ne=k(e=>{(e.image||e.mermaid||e.video)&&(V(e),U(!0))}),re=k(e=>{V(t=>({...t,open:e})),U(e)});Q.useEffect(()=>()=>{U(!1)},[U]);let G=Q.useRef(!1);Q.useEffect(()=>{S.current.clear(),x.current=null,E([]),O([]),L(null)},[o]);let oe=Q.useMemo(()=>on(),[]),se=Q.useRef(new Set),ce=Q.useRef(new Map),K=ft(e=>e.setWorking),le=f.data?.messages??Vt,ue=Wt(T,e.id),de=Gt(D,e.id),q=Jt(le,ue,e.id,de).filter(e=>{if(e.status===`admitted`&&e.messageID.endsWith(`:preview:admitted`))return!1;let t=Array.isArray(e.parts)?e.parts:[];return t.length===0||t.some(e=>!(e.type===`text`&&er(e.text)))}),fe=q.length-1;for(;fe>=0&&tr(q[fe]);)--fe;let J=q.filter((e,t)=>!tr(e)||t>fe),pe=bt(J),he=me(),X=`${o}:${e.id}`,ge=Q.useRef(null),_e=ge.current,ve=_e?.lastID?J.findIndex(e=>nr(e)===_e.lastID):-1,ye=n&&!he&&_e?.scope===X&&_e.ready&&(_e.lastID===null||ve>=0);Q.useLayoutEffect(()=>{let e=J.at(-1);ge.current={scope:X,ready:n&&f.isSuccess,lastID:e?nr(e):null}});let be=new Date().toDateString(),xe=i(`common.date.today`),Se=Q.useMemo(()=>xt(a,xe,new Date(be)),[a,xe,be]),Ce=cn(ue),we=ln(de),Te=!!(e.working||e.activeContactTurn),Ee=d.data?.revision??null,De=de.reduce((e,t)=>e+t.bubbles.reduce((e,t)=>e+t.text.length,0),0),Oe=new Map(de.map(e=>[e.turnID,e])),ke=Q.useRef(!1),Ae=k(async(e=!1)=>{if(!(!n||ke.current||f.isFetchingPreviousPage||f.isFillingMessageGap)&&!(e&&f.previousPageError)&&!(!f.hasPreviousPage&&!f.hasMessageGap)){ke.current=!0,Ne();try{f.hasMessageGap?await f.retryMessageGap():await f.fetchPreviousPage()}catch{}finally{ke.current=!1}}}),{scrollRef:je,contentRef:Me,preparePrepend:Ne,followLatest:Pe}=kn({active:n,assistantID:e.id,contentRevision:`${J[0]?.messageID}:${J.length}:${De}:${f.isFetchingPreviousPage}:${f.hasPreviousPage}:${f.isFillingMessageGap}`,onLoadEarlier:()=>{Ae(!0)}}),Fe=Q.useRef(null),Ie=Q.useRef(null),Le=Q.useRef(null),Re=Q.useRef(null),ze=Q.useRef(null),[Be,Ve]=Q.useState(null),He=()=>{let e=Ie.current?.querySelector(`[data-assistant-contact-composer-surface]`),t=e?.querySelector(`textarea`);return e&&t?Wn(e,t,!s):null};Q.useLayoutEffect(()=>{let e=Le.current;if(!e)return;Le.current=null;let t=Array.from(Fe.current?.querySelectorAll(`[data-message-id]`)??[]).find(t=>t.dataset.messageId===e.messageID)?.querySelector(`[data-assistant-contact-text]`),n=()=>Ve(t=>t?.messageID===e.messageID?null:t);if(!t){n();return}ze.current?.(),ze.current=qn(e.source,t,t,n)}),Q.useEffect(()=>()=>{Le.current=null,ze.current?.(),ze.current=null},[n,e.id,o]),Q.useEffect(()=>{L(null),se.current.clear(),ce.current=new Map,E(t=>Wt(t,e.id)),O(t=>Gt(t,e.id)),V({open:!1,title:``,content:``}),U(!1)},[e.id,U]),Q.useEffect(()=>{E(e=>Yt(e,le))},[le]),Q.useEffect(()=>{let t=new Set(ue.filter(e=>e.status===`sending`).map(e=>e.messageID));O(n=>$t(n,{assistantID:e.id,activeContactTurn:e.activeContactTurn?{turnID:e.activeContactTurn.turnID,admittedAt:e.activeContactTurn.admittedAt}:null,serverWorking:Te,snapshotRevision:Ee,admissionRevisionByTurnID:ce.current,pendingSendTurnIDs:t,messages:le,settledTurnIDs:se.current}))},[e.activeContactTurn,e.id,le,ue,Te,Ee]),Q.useEffect(()=>{K(e.id,Ce||we||Te)},[e.id,we,Ce,Te,K]),Q.useEffect(()=>{let t=e.id;return()=>{K(t,!1)}},[e.id,K]);let Ue=k(t=>{if(!(!(`assistantID`in t)||t.assistantID!==e.id)){if(t.type===`contact-turn-start`){se.current.delete(t.turnID),O(e=>Zt(e,t.assistantID,t.turnID,t.occurredAt));return}if(t.type===`contact-bubble-delta`){if(se.current.has(t.turnID))return;O(e=>en(e,t));return}t.type===`contact-turn-end`&&(se.current.add(t.turnID),O(e=>nn(tn(e,t,{requireExisting:!0}),le)))}});Q.useEffect(()=>{if(n)return ae(Ue)},[n,e.id]);let We=k(async e=>{if(Ce)return;let t=C.current,n=await Zn(e);if(t.signal.aborted){n.attachments.forEach(e=>URL.revokeObjectURL(e.url));return}n.skippedTooLarge>0&&L(i(`assistants.contact.attachment.tooLarge`)),n.attachments.length!==0&&b(e=>Qn(e,n.attachments))}),Ge=k(e=>{let t=Yn(e.clipboardData);t.length!==0&&(e.preventDefault(),We(t))}),Ke=k(e=>{Array.from(e.dataTransfer?.types??[]).includes(`Files`)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`)}),Je=k(e=>{let t=Xn(e.dataTransfer);t.length!==0&&(e.preventDefault(),We(t))}),Ye=k(async t=>{let r=C.current,a=t??_,o=y,s=e.id,c=x.current,d=c?.assistantID===s&&c.text===a&&c.attachments===o?c.messageID:null,f=sn({gate:oe,sending:cn(ue),text:a,attachments:o,assistantID:s,createMessageID:()=>d||`yuri_contact_${l()}`});if(!f.ok)return;K(s,!0),x.current={assistantID:s,text:a,attachments:o,messageID:f.messageID};let p=o.length===0,m=p&&t===void 0&&!d&&n&&!he?He():null;Le.current=m?{messageID:f.messageID,source:m}:null,Ve(m?{scope:X,messageID:f.messageID}:null),Re.current=m?f.messageID:Re.current,Pe(m?{duration:An,ease:jn}:void 0),p&&v(e=>e===a?``:e),E(e=>[...e.filter(e=>e.messageID!==f.messageID),f.turn]),L(null);let g=()=>{v(e=>e===a?``:e),b(e=>e.filter(e=>!o.includes(e))),o.forEach(e=>S.current.delete(`${s}:${e.id}`)),x.current=null};try{let t=[];for(let e of o){let n=`${s}:${e.id}`,i=S.current.get(n);if(!i){if(i=await st(s,e.file,e.id,r.signal),r.signal.aborted)return;S.current.set(n,i)}t.push(i)}if(r.signal.aborted)return;let n=[...f.parts.filter(e=>e.type===`text`),...t];E(e=>e.map(e=>e.messageID===f.messageID?{...e,parts:n}:e));let i=await W(s,f.messageID,{parts:n});if(r.signal.aborted)return;g(),typeof i.revision==`number`&&ce.current.set(f.messageID,i.revision),E(e=>Xt(e,f.messageID)),se.current.has(f.messageID)||O(e=>Zt(e,s,f.messageID)),u.data?.serverInstanceID&&P({serverInstanceID:u.data.serverInstanceID,assistantID:s,name:h,avatarSeed:e.avatarSeed??s}).catch(()=>void 0)}catch(e){if(r.signal.aborted)return;if(e instanceof I&&e.code===`admission_timeout`)try{let e=await te(s,f.messageID);if(r.signal.aborted)return;if(e){g(),typeof e.revision==`number`&&ce.current.set(f.messageID,e.revision),E(e=>Xt(e,f.messageID)),se.current.has(f.messageID)||O(e=>Zt(e,s,f.messageID));return}}catch{}let t=an(e,{noProvider:i(`assistants.contact.noProvider`),sendFailed:i(`assistants.contact.sendFailed`),timedOut:i(`assistants.contact.timedOut`)});E(e=>rn(e,f.messageID,t)),p&&v(e=>e===``?a:e),L(t)}finally{oe.release()}}),Xe=k(async()=>{if(G.current)return;G.current=!0;let t=C.current;L(null);try{await H(e.id,e)}catch(e){t.signal.aborted||L(e instanceof Error?e.message:i(`settings.mcp.page.toast.unexpectedError`))}finally{G.current=!1}}),Qe=f.isError&&J.length===0,$e=f.isSuccess&&J.length===0,et=new Map(ue.map(e=>[e.messageID,e]));return(0,$.jsxs)(`div`,{ref:Fe,className:`flex min-h-0 flex-1 flex-col bg-background`,children:[(0,$.jsxs)(`div`,{ref:je,className:j(`min-h-0 flex-1 overflow-x-hidden overflow-y-auto px-4 sm:px-8`,s&&`pb-11`,r?`pt-[calc(max(0.625rem,var(--yuri-safe-area-top,0px))+var(--yuri-mobile-detail-navigation-height)+1.25rem)]`:`pt-5 sm:pt-7`),style:{overflowAnchor:`none`,overscrollBehavior:`contain`,overscrollBehaviorY:`contain`},"data-assistant-contact-transcript":``,children:[t?(0,$.jsx)(`p`,{className:`mb-3 typography-micro text-[var(--status-warning)]`,children:t}):null,Qe?(0,$.jsxs)(`div`,{ref:Me,className:`mx-auto flex h-full min-h-56 max-w-xs flex-col items-center justify-center pb-16 text-center`,"data-assistant-contact-error":``,children:[(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(ht,{name:e.id,avatarSeed:e.avatarSeed,size:44,label:h}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:`absolute -right-1 -bottom-1 flex size-5 items-center justify-center rounded-full bg-[var(--surface-elevated)] text-[var(--status-error)] ring-2 ring-background`,children:(0,$.jsx)(Y,{name:`error-warning`,className:`size-3`})})]}),(0,$.jsx)(`p`,{className:`mt-4 typography-ui-label font-medium text-foreground`,children:h}),(0,$.jsx)(`p`,{className:`mt-1.5 typography-ui leading-6 text-muted-foreground`,children:i(`assistants.contact.loadFailed`)}),(0,$.jsx)(M,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>void f.refetch(),children:i(`chat.history.retry`)})]}):$e?(0,$.jsxs)(`div`,{ref:Me,className:`mx-auto flex h-full min-h-56 max-w-sm flex-col items-center justify-center pb-16 text-center`,"data-assistant-contact-empty":``,children:[(0,$.jsx)(ht,{name:e.id,avatarSeed:e.avatarSeed,size:48,label:h,className:`opacity-90`}),(0,$.jsx)(`p`,{className:`mt-5 typography-ui-header font-medium tracking-[-0.01em] text-foreground`,children:i(`assistants.conversation.emptyTitle`,{name:h})}),(0,$.jsx)(`p`,{className:`mt-2 max-w-xs typography-ui leading-6 text-muted-foreground/80`,children:i(`assistants.contact.empty`)})]}):(0,$.jsxs)(`div`,{ref:Me,className:`relative mx-auto flex w-full max-w-[42rem] flex-col pb-12`,"data-assistant-contact-content":``,children:[f.isPending?(0,$.jsx)(`p`,{role:`status`,className:`py-3 text-center typography-micro text-muted-foreground`,children:i(`common.loading`)}):null,f.hasPreviousPage||f.hasMessageGap?(0,$.jsxs)(`div`,{className:`mb-3 flex flex-col items-center gap-1`,"data-assistant-contact-pagination":``,"aria-busy":f.isFetchingPreviousPage||f.isFillingMessageGap,children:[f.previousPageError?(0,$.jsx)(`p`,{role:`alert`,className:`typography-micro text-[var(--status-error)]`,children:i(`chat.history.loadOlderFailed`)}):null,f.hasMessageGap?(0,$.jsx)(`p`,{role:`status`,className:`typography-micro text-muted-foreground`,children:i(`assistants.contact.history.gap`)}):null,(0,$.jsx)(M,{type:`button`,size:`sm`,variant:`ghost`,disabled:f.isFetchingPreviousPage||f.isFillingMessageGap,onClick:()=>void Ae(),children:i(f.isFetchingPreviousPage||f.isFillingMessageGap?`chat.history.loadingMore`:f.previousPageError||f.hasMessageGap?`chat.history.retry`:`chat.history.loadOlder`)})]}):null,J.map((t,n)=>{let r=`${X}:${nr(t)}`,a=n>0?J[n-1]:null,s=pe.get(t.messageID),c=s!==void 0,l=c?(0,$.jsx)(`div`,{className:`flex w-full justify-center px-4 pt-7 pb-4 first:pt-1`,"data-assistant-contact-time":``,children:(0,$.jsx)(`time`,{dateTime:new Date(s).toISOString(),className:`text-[11px] font-normal leading-4 tabular-nums text-muted-foreground/70`,children:Se(s)})}):null,u=t.role===`user`,f=t.role===`peer`,p=t.role===`assistant`&&!c&&a?.role===`assistant`&&a.turnID===t.turnID,_=a?.turnID!==t.turnID,v=!u&&(f||!p),y=f?g(t.fromAssistantID,t.fromAssistantName):h,b=f&&t.fromAssistantID?d.data?.assistants.find(e=>e.id===t.fromAssistantID):e,x=et.get(t.messageID),S=Oe.get(t.turnID),C=t.status===`failed`&&t.messageID.endsWith(`:preview:failed`);return t.status===`error`||C?(0,$.jsxs)(Q.Fragment,{children:[l,(0,$.jsxs)(`div`,{"data-message-id":t.messageID,"data-assistant-contact-error":``,className:j(`relative px-1`,!c&&`mt-3`),children:[(0,$.jsx)(`p`,{role:`alert`,className:`whitespace-pre-wrap text-center text-[11px] font-normal leading-4 text-muted-foreground [overflow-wrap:anywhere]`,children:t.text||S?.error||i(`assistants.contact.sendFailed`)}),m?.messageID===t.messageID?(0,$.jsx)(Ct,{assistantID:e.id,position:m},`${o}:${e.id}:${m.generation}:${m.ordinal}`):null]})]},r):(0,$.jsxs)(Q.Fragment,{children:[l,(0,$.jsxs)(Ze.div,{"data-message-id":t.messageID,initial:ye&&n>ve&&t.messageID!==Re.current?{opacity:0,y:4}:!1,animate:{opacity:1,y:0},transition:{duration:he?0:.18,ease:`easeOut`},className:j(`flex w-full`,u?`justify-end`:`justify-start`,c?`mt-0`:_?`mt-6 first:mt-0`:p?`mt-1.5`:`mt-3`),"data-assistant-contact-role":t.role,"data-assistant-contact-turn-status":x?.status??t.status,"data-assistant-contact-run-start":t.role===`assistant`&&!p?``:void 0,children:[u?null:(0,$.jsx)(`div`,{className:`mr-2.5 flex w-8 shrink-0 justify-center pt-0.5`,children:v?(0,$.jsx)(ht,{name:b?.id||t.fromAssistantID||e.id,avatarSeed:b?.avatarSeed??(t.fromAssistantID?void 0:e.avatarSeed),size:28,label:y,working:t.status===`streaming`||void 0,showWorkingDot:!1}):(0,$.jsx)(`span`,{className:`size-7`,"aria-hidden":!0})}),(0,$.jsxs)(`div`,{className:j(`relative flex min-w-0 flex-col gap-1.5`,u?`max-w-[min(82%,30rem)] items-end`:`max-w-[min(84%,34rem)] items-start`),children:[f?(0,$.jsx)(`span`,{className:`mb-0.5 px-1 typography-micro text-muted-foreground/75`,children:i(`assistants.contact.peer.from`,{name:y})}):null,t.parts.map((n,a)=>{if(n.type===`card`&&n.cardType===`session`)return(0,$.jsx)(bn,{card:n},`${r}:card:${a}`);if(n.type===`card`&&n.cardType===`assistant`)return(0,$.jsx)(mn,{card:n},`${r}:card:${a}`);if(n.type===`card`&&n.cardType===`schedule`)return(0,$.jsx)(hn,{card:n},`${r}:card:${a}`);if(n.type===`file`)return(0,$.jsx)(Bt,{assistantID:e.id,part:n,onShowPopup:ne},`${r}:file:${a}`);if(n.type===`text`&&er(n.text))return null;if(n.type===`text`&&(n.text.trim()||t.status===`streaming`)){let e=!u,o=e&&/^!\[(?:\\.|[^\]\\\n])*\]\(\s*(?:<[^>\n]+>|[^\s()]+)(?:\s+"[^"\n]*")?\s*\)$/.test(n.text.trim());return(0,$.jsx)(`div`,{"aria-label":f?i(`assistants.contact.peer.aria`,{name:y}):void 0,"data-assistant-contact-text":``,"data-assistant-contact-media":o||void 0,className:j(`min-w-0 max-w-full [overflow-wrap:anywhere] rounded-[1.35rem] typography-markdown leading-6`,o?`p-0`:`px-4 py-2.5`,e?null:`whitespace-pre-wrap`,o?`text-foreground`:u?`rounded-[1.15rem] rounded-br-lg bg-[var(--primary-base)]/90 text-[var(--primary-foreground)]`:f?`rounded-[1.25rem] border border-dashed border-border/50 bg-[var(--surface-muted)]/70 text-foreground`:`bg-[var(--surface-muted)] text-foreground`),children:e?(0,$.jsx)(qe,{content:n.text,messageId:r,isAnimated:!1,isStreaming:t.status===`streaming`,variant:`assistant`,enableFileReferences:!1,onShowPopup:ne,className:`w-full min-w-0 [overflow-wrap:anywhere]`}):n.text},`${r}:text:${a}`)}return null}),x?.status===`sending`?(0,$.jsx)(`p`,{className:`absolute right-1 top-full mt-1 typography-micro text-muted-foreground/75`,children:i(`assistants.contact.sending`)}):null,x?.status===`failed`?(0,$.jsx)(`p`,{className:`px-1 typography-micro text-[var(--status-error)]`,children:x.error||i(`assistants.contact.sendFailed`)}):null,m?.messageID===t.messageID?(0,$.jsx)(Ct,{assistantID:e.id,position:m},`${o}:${e.id}:${m.generation}:${m.ordinal}`):null]})]})]},r)}),(0,$.jsx)(`div`,{className:`pointer-events-none absolute bottom-1 left-[2.625rem] flex h-10 items-center`,"data-assistant-contact-status-slot":``,children:!Ce&&Be?.scope!==X&&(we||Te)?(0,$.jsxs)(Ze.div,{role:`status`,"aria-label":i(`assistants.contact.processing`),initial:!he&&{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{duration:he?0:.18,ease:`easeOut`},className:`relative inline-flex h-9 origin-bottom-left items-center gap-1 rounded-[1.35rem] bg-[var(--surface-muted)] px-4 text-muted-foreground/70`,"data-assistant-contact-processing":``,children:[(0,$.jsx)(`div`,{className:`absolute -left-[2.625rem] top-0.5 flex w-8 justify-center`,"data-assistant-contact-processing-avatar":``,children:(0,$.jsx)(ht,{name:e.id,avatarSeed:e.avatarSeed,size:28,label:h,working:!0,showWorkingDot:!1})}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 animate-pulse rounded-full bg-current [animation-delay:-0.45s] [animation-duration:1.4s] motion-reduce:animate-none`}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 animate-pulse rounded-full bg-current [animation-delay:-0.22s] [animation-duration:1.4s] motion-reduce:animate-none`}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 animate-pulse rounded-full bg-current [animation-duration:1.4s] motion-reduce:animate-none`})]}):null})]})]}),(0,$.jsxs)(`footer`,{ref:Ie,className:`relative z-10 shrink-0 bg-background pt-1`,"data-assistant-contact-composer":``,children:[F?(0,$.jsxs)(`div`,{className:`chat-input-column mb-2 flex items-center gap-2`,children:[(0,$.jsx)(`p`,{role:`alert`,className:`typography-micro text-[var(--status-error)]`,children:F}),x.current?(0,$.jsx)(M,{type:`button`,size:`sm`,variant:`ghost`,disabled:Ce,onClick:()=>void Ye(),children:i(`chat.history.retry`)}):null]}):null,(0,$.jsx)(`form`,{className:j(`relative w-full pt-1.5 pb-4`,s&&`bottom-safe-area yuri-mobile-composer`),onSubmit:e=>{e.preventDefault(),Ye()},onDragOver:Ke,onDrop:Je,children:(0,$.jsx)(`div`,{className:`chat-input-column relative overflow-visible`,children:(0,$.jsx)(Pt,{active:n,layout:`inline`,value:_,attachments:y,pending:Ce,working:we||Te,onStop:we||Te?()=>{Xe()}:void 0,stopLabel:i(`chat.chatInput.actions.stopGeneratingAria`),isMobile:s,placeholder:i(`assistants.contact.placeholder`,{name:h}),sendLabel:i(`assistants.contact.send`),addFilesLabel:i(`assistants.contact.addFiles`),removeAttachmentLabel:i(`assistants.contact.removeAttachment`),fileAccept:`*/*`,onChange:e=>v(e),onVoiceSend:e=>{Ye(e)},onSubmit:()=>{Ye()},onAddFiles:e=>{We(e)},onRemoveAttachment:t=>{Ce||(S.current.delete(`${e.id}:${t}`),x.current=null,b(e=>e.filter(e=>e.id!==t)))},onPaste:Ge,onDragOver:Ke,onDrop:Je,className:j(`relative z-10`,s&&`yuri-mobile-composer-surface`),style:{borderRadius:`1.5rem`},"data-assistant-contact-composer-surface":``,textareaProps:{"aria-label":i(`assistants.contact.placeholder`,{name:h})}},`${o}:${e.id}`)})})]}),B.open?(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)($n,{popup:B,onOpenChange:re,isMobile:s})}):null]})};async function ir(e){await U(e);let t=de.getState().defaultShareAssistant;if(t?.assistantID!==e.id)return;let n=await B();n.serverInstanceID&&t.serverInstanceID===n.serverInstanceID&&de.getState().setDefaultShareAssistant(null)}function ar({assistant:e,open:t,onOpenChange:n,onDeleted:r}){let{t:i}=A(),[a,o]=Q.useState(!1),s=e?N(e.name).displayName||e.name:``,c=k(e=>{a&&!e||n(e)}),l=k(()=>{a||n(!1)}),u=k(async()=>{if(!(!e||a)){o(!0);try{await ir(e),r?.(e.id),n(!1),C.success(i(`assistants.settings.toast.deleted`))}catch{C.error(i(`assistants.settings.toast.deleteFailed`))}finally{o(!1)}}});return(0,$.jsx)(be,{open:t&&e!==null,onOpenChange:c,children:(0,$.jsxs)(_e,{className:`max-w-md`,children:[(0,$.jsxs)(X,{children:[(0,$.jsx)(ve,{children:i(`assistants.settings.delete`)}),(0,$.jsx)(ye,{children:i(`assistants.settings.deleteConfirm`,{name:s})})]}),(0,$.jsxs)(ge,{children:[(0,$.jsx)(M,{size:`sm`,variant:`ghost`,onClick:l,disabled:a,children:i(`settings.common.actions.cancel`)}),(0,$.jsx)(M,{size:`sm`,variant:`destructive`,onClick:u,disabled:a,children:i(`settings.common.actions.delete`)})]})]})})}var or=`block min-w-0 max-w-full truncate typography-micro text-muted-foreground`,sr={image:`assistants.contact.attachment.image`,file:`assistants.contact.attachment.file`,session:`assistants.contact.card.session.untitled`,assistant:`assistants.title`,schedule:`assistants.settings.scheduledTasks.title`};function cr(e,t){return e?.text.replace(/\s+/gu,` `).trim()||t(e?.fallbackKind?sr[e.fallbackKind]:`assistants.contact.empty`)}var lr=e=>e.capabilityPending?`loading`:e.capabilityError||e.supported!==!0||e.capabilityEnabled!==!0?`unavailable`:e.snapshotPending?`loading`:e.snapshotEnabled===!0?e.assistantCount===0?`onboarding`:e.hasAssistant?`ready`:e.snapshotSettled?`unavailable`:`loading`:`unavailable`,ur=e({AssistantView:()=>pr}),dr=e=>{let t=(0,ut.c)(21),{assistant:n,onBack:r,onOpenSettings:i}=e,{t:a}=A(),o=ze(),s;t[0]===n?s=t[1]:(s=n?N(n.name):null,t[0]=n,t[1]=s);let c=s,l=n&&c?c.displayName||n.name:``,u;t[2]!==n||t[3]!==o||t[4]!==i?(u=()=>{if(n){if(i){i(n.id);return}fe(n.id,o?{openMobileSettings:o.openSettings}:void 0)}},t[2]=n,t[3]=o,t[4]=i,t[5]=u):u=t[5];let d=k(u),f;t[6]!==n||t[7]!==l||t[8]!==a?(f=n?(0,$.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2.5`,children:[(0,$.jsx)(ht,{name:n.id,avatarSeed:n.avatarSeed,size:40,label:l,working:!!(n.working||n.activeContactTurn),showWorkingDot:!1}),(0,$.jsxs)(`span`,{className:`min-w-0`,children:[(0,$.jsx)(`span`,{className:`block truncate font-medium leading-5 tracking-[-0.01em]`,children:l||a(`assistants.title`)}),(0,$.jsx)(St,{assistantID:n.id,serverWorking:!!(n.working||n.activeContactTurn),lastContactAt:n.latestMessagePreview?.createdAt})]})]}):l||a(`assistants.title`),t[6]=n,t[7]=l,t[8]=a,t[9]=f):f=t[9];let p;t[10]===a?p=t[11]:(p=a(`assistants.actions.backToChat`),t[10]=a,t[11]=p);let m;t[12]!==n||t[13]!==d||t[14]!==a?(m=n?[{icon:`settings-3`,ariaLabel:a(`assistants.conversation.openSettings`),onClick:d}]:[],t[12]=n,t[13]=d,t[14]=a,t[15]=m):m=t[15];let h;return t[16]!==r||t[17]!==f||t[18]!==p||t[19]!==m?(h=(0,$.jsx)(re,{title:f,backAriaLabel:p,onBack:r,actions:m,overlay:!0}),t[16]=r,t[17]=f,t[18]=p,t[19]=m,t[20]=h):h=t[20],h},fr=e=>{let t=(0,ut.c)(53),{avatarSeed:n,unreadCount:r,summary:i,assistantID:a,displayName:o,selected:s,enabled:c,editLabel:l,deleteLabel:u,onSelect:d,onEdit:f,onDelete:p,serverWorking:m}=e,h=mt(a,m!==void 0&&m),[g,_]=Q.useState(!1),v=Q.useRef(null),y;t[0]===d?y=t[1]:(y=()=>d(),t[0]=d,t[1]=y);let b=k(y),x;t[2]===f?x=t[3]:(x=()=>{_(!1),f()},t[2]=f,t[3]=x);let S=k(x),C;t[4]===p?C=t[5]:(C=()=>{_(!1),p()},t[4]=p,t[5]=C);let w=k(C),T;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(T=e=>{e.preventDefault(),_(!0)},t[6]=T):T=t[6];let E=s?`border-border/50 bg-[var(--surface-elevated)]`:`border-transparent hover:bg-interactive-hover`,D=!c&&`opacity-65`,O;t[7]!==E||t[8]!==D?(O=j(`flex w-full min-h-11 items-center gap-3 rounded-xl border px-3 py-3 text-left outline-none transition-[background-color,border-color,opacity] duration-150 ease-out active:bg-interactive-active focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)] motion-reduce:transition-none`,E,D),t[7]=E,t[8]=D,t[9]=O):O=t[9];let A;t[10]!==b||t[11]!==s||t[12]!==O?(A=(0,$.jsx)(`button`,{ref:v,type:`button`,role:`option`,"aria-selected":s,onClick:b,onContextMenu:T,className:O}),t[10]=b,t[11]=s,t[12]=O,t[13]=A):A=t[13];let M;t[14]!==a||t[15]!==n||t[16]!==o||t[17]!==h?(M=(0,$.jsx)(ht,{name:a,avatarSeed:n,size:44,label:o,working:h,hoverTarget:v}),t[14]=a,t[15]=n,t[16]=o,t[17]=h,t[18]=M):M=t[18];let N=s?`font-semibold`:`font-medium`,P;t[19]===N?P=t[20]:(P=j(`block truncate typography-ui-label leading-5`,N),t[19]=N,t[20]=P);let F;t[21]!==o||t[22]!==P?(F=(0,$.jsx)(`span`,{className:P,children:o}),t[21]=o,t[22]=P,t[23]=F):F=t[23];let I;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(I=j(or,`mt-1 leading-5`),t[24]=I):I=t[24];let L;t[25]===i?L=t[26]:(L=(0,$.jsx)(`span`,{className:I,children:i}),t[25]=i,t[26]=L);let R;t[27]!==F||t[28]!==L?(R=(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[F,L]}),t[27]=F,t[28]=L,t[29]=R):R=t[29];let z;t[30]===r?z=t[31]:(z=(0,$.jsx)(it,{count:r,className:`h-3.5 min-w-3.5 bg-[oklch(from_var(--primary-base)_calc(l_*_0.78)_c_h)] px-1 text-[10px] text-[var(--color-white)] shadow-none`}),t[30]=r,t[31]=z);let B;t[32]!==M||t[33]!==R||t[34]!==z||t[35]!==A?(B=(0,$.jsxs)(et,{render:A,children:[M,R,z]}),t[32]=M,t[33]=R,t[34]=z,t[35]=A,t[36]=B):B=t[36];let V;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsx)(Y,{name:`edit`,className:`size-4`}),t[37]=V):V=t[37];let ee;t[38]!==l||t[39]!==S?(ee=(0,$.jsxs)(nt,{onClick:S,children:[V,l]}),t[38]=l,t[39]=S,t[40]=ee):ee=t[40];let te;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,$.jsx)($e,{}),t[41]=te):te=t[41];let H;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,$.jsx)(Y,{name:`delete-bin`,className:`size-4`}),t[42]=H):H=t[42];let U;t[43]!==u||t[44]!==w?(U=(0,$.jsxs)(nt,{onClick:w,className:`text-[var(--status-error)] focus:text-[var(--status-error)] data-[highlighted]:text-[var(--status-error)] [&_svg]:text-[var(--status-error)]`,children:[H,u]}),t[43]=u,t[44]=w,t[45]=U):U=t[45];let W;t[46]!==ee||t[47]!==U?(W=(0,$.jsxs)(tt,{className:`min-w-[10rem]`,children:[ee,te,U]}),t[46]=ee,t[47]=U,t[48]=W):W=t[48];let ne;return t[49]!==g||t[50]!==B||t[51]!==W?(ne=(0,$.jsxs)(Qe,{open:g,onOpenChange:_,children:[B,W]}),t[49]=g,t[50]=B,t[51]=W,t[52]=ne):ne=t[52],ne},pr=e=>{let t=(0,ut.c)(118),{activeOverride:i,onMobileBack:a,onMobileOpenSettings:o}=e,{t:s}=A(),{isMobile:l}=xe(),u=ze(),d=Q.useSyncExternalStore(n,r,r),f=c(mr),p=i??f,m=c(hr),h=l||m,g=ee(),_=ie(),v=_.data;v?.assistants;let y;t[0]===v?.assistants?y=t[1]:(y=v?.assistants??[],t[0]=v?.assistants,t[1]=y);let b;t[2]===y?b=t[3]:(b=at(y),t[2]=y,t[3]=b);let x=b,S;t[4]===d?S=t[5]:(S=e=>e.assistantByTransport[d]??null,t[4]=d,t[5]=S);let C=de(S),w=de(gr),T=de(_r),E;t[6]!==C||t[7]!==v?.assistants?(E=v?.assistants.find(e=>e.id===C)??null,t[6]=C,t[7]=v?.assistants,t[8]=E):E=t[8];let D=E,O;t[9]!==w||t[10]!==C||t[11]!==v?(O=()=>{!C&&v?.assistants[0]&&w(v.assistants[0].id)},t[9]=w,t[10]=C,t[11]=v,t[12]=O):O=t[12];let P=v?.assistants,F;t[13]!==w||t[14]!==C||t[15]!==P?(F=[w,C,P],t[13]=w,t[14]=C,t[15]=P,t[16]=F):F=t[16],Q.useEffect(O,F);let I;t[17]!==D||t[18]!==w||t[19]!==C||t[20]!==v?.assistants||t[21]!==_.isSuccess?(I=()=>{_.isSuccess&&C&&!D&&w(v?.assistants[0]?.id??null)},t[17]=D,t[18]=w,t[19]=C,t[20]=v?.assistants,t[21]=_.isSuccess,t[22]=I):I=t[22];let L=v?.assistants,R;t[23]!==D||t[24]!==w||t[25]!==C||t[26]!==_.isSuccess||t[27]!==L?(R=[D,w,C,L,_.isSuccess],t[23]=D,t[24]=w,t[25]=C,t[26]=_.isSuccess,t[27]=L,t[28]=R):R=t[28],Q.useEffect(I,R);let z;t[29]!==u||t[30]!==T?(z=()=>{if(T(),u){u.openSettings();return}let e=c.getState();e.setSettingsPage(`assistants`),e.setSettingsDialogOpen(!0)},t[29]=u,t[30]=T,t[31]=z):z=t[31];let B=k(z),V;t[32]===u?V=t[33]:(V=e=>{fe(e,u?{openMobileSettings:u.openSettings}:void 0)},t[32]=u,t[33]=V);let te=k(V),H;t[34]!==D||t[35]!==u?(H=()=>{D&&fe(D.id,u?{openMobileSettings:u.openSettings}:void 0)},t[34]=D,t[35]=u,t[36]=H):H=t[36];let U=k(H),[W,ne]=Q.useState(null),re;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(re=e=>{ne(e)},t[37]=re):re=t[37];let G=k(re),ae;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(ae=e=>{e||ne(null)},t[38]=ae):ae=t[38];let oe=k(ae),se=k(vr),ce;t[39]!==a||t[40]!==se?(ce=()=>{if(a){a();return}se()},t[39]=a,t[40]=se,t[41]=ce):ce=t[41];let K=k(ce),le=lr({capabilityPending:g.isPending,snapshotPending:_.isPending,capabilityError:g.isError,supported:g.data?.supported,capabilityEnabled:g.data?.enabled,snapshotEnabled:v?.enabled,snapshotSettled:_.isSuccess,assistantCount:v?.assistants.length??0,hasAssistant:!!D}),ue;t[42]!==D||t[43]!==K||t[44]!==h||t[45]!==o?(ue=(e,t,n,r)=>(0,$.jsxs)(`div`,{className:`relative flex h-full min-h-0 flex-col`,children:[h?(0,$.jsx)(dr,{assistant:D,onBack:K,onOpenSettings:o}):null,(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center px-6 pt-[calc(max(0.25rem,var(--yuri-safe-area-top,0px))+var(--yuri-mobile-detail-navigation-height,3.5rem))] text-center`,children:[(0,$.jsx)(Y,{name:e,className:`size-6 text-muted-foreground`}),(0,$.jsx)(`h1`,{className:`mt-4 typography-ui-header font-semibold`,children:t}),n?(0,$.jsx)(`p`,{className:`mt-2 max-w-md typography-ui text-muted-foreground`,children:n}):null,r?(0,$.jsx)(`div`,{className:`mt-5`,children:r}):null]})]}),t[42]=D,t[43]=K,t[44]=h,t[45]=o,t[46]=ue):ue=t[46];let q=ue;if(le===`loading`){let e;t[47]!==D||t[48]!==K||t[49]!==h||t[50]!==o?(e=h?(0,$.jsx)(dr,{assistant:D,onBack:K,onOpenSettings:o}):null,t[47]=D,t[48]=K,t[49]=h,t[50]=o,t[51]=e):e=t[51];let n;t[52]===s?n=t[53]:(n=s(`common.loading`),t[52]=s,t[53]=n);let r;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(Y,{name:`loader-4`,className:`size-6 animate-spin text-muted-foreground`}),t[54]=r):r=t[54];let i;t[55]===n?i=t[56]:(i=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center px-6 pt-[calc(max(0.25rem,var(--yuri-safe-area-top,0px))+var(--yuri-mobile-detail-navigation-height,3.5rem))] text-center`,"aria-busy":`true`,"aria-label":n,"data-assistant-workspace-loading":``,children:r}),t[55]=n,t[56]=i);let a;return t[57]!==e||t[58]!==i?(a=(0,$.jsxs)(`div`,{className:`relative flex h-full min-h-0 flex-col`,children:[e,i]}),t[57]=e,t[58]=i,t[59]=a):a=t[59],a}if(le===`unavailable`){let e;return t[60]!==q||t[61]!==s?(e=q(`cloud-off`,s(`assistants.state.unavailable`)),t[60]=q,t[61]=s,t[62]=e):e=t[62],e}if(le===`onboarding`){let e;if(t[63]!==B||t[64]!==q||t[65]!==s){let n=s(`assistants.onboarding.title`),r=s(`assistants.onboarding.description`),i;t[67]===s?i=t[68]:(i=s(`assistants.onboarding.action`),t[67]=s,t[68]=i);let a;t[69]!==B||t[70]!==i?(a=(0,$.jsx)(M,{onClick:B,children:i}),t[69]=B,t[70]=i,t[71]=a):a=t[71],e=q(`ai-agent`,n,r,a),t[63]=B,t[64]=q,t[65]=s,t[66]=e}else e=t[66];return e}if(!v||!D){let e;return t[72]!==q||t[73]!==s?(e=q(`cloud-off`,s(`assistants.state.unavailable`)),t[72]=q,t[73]=s,t[74]=e):e=t[74],e}let J;t[75]===D.name?J=t[76]:(J=N(D.name),t[75]=D.name,t[76]=J);let pe=J,me;t[77]!==D.enabled||t[78]!==_.isError||t[79]!==s?(me=D.enabled?_.isError?s(`assistants.state.staleSnapshot`):null:s(`assistants.state.assistantDisabled`),t[77]=D.enabled,t[78]=_.isError,t[79]=s,t[80]=me):me=t[80];let he=me,X;t[81]!==x||t[82]!==h||t[83]!==B||t[84]!==te||t[85]!==G||t[86]!==w||t[87]!==C||t[88]!==v||t[89]!==s?(X=h?null:(0,$.jsxs)(`section`,{className:`flex h-full min-h-0 w-[clamp(16rem,22vw,20rem)] shrink-0 flex-col overflow-hidden`,children:[(0,$.jsxs)(`header`,{className:`flex shrink-0 items-center gap-3 px-4 pb-3 pt-4 sm:px-5`,children:[(0,$.jsx)(`h1`,{className:`min-w-0 truncate typography-ui-label font-semibold text-foreground`,children:s(`assistants.title`)}),(0,$.jsx)(dt,{snapshot:v,compact:!0,rowClassName:`min-w-0 flex-1`}),(0,$.jsx)(M,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":s(`assistants.settings.create`),onClick:B,children:(0,$.jsx)(Y,{name:`add`,className:`size-4`})})]}),(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 pb-4 sm:px-4`,role:`listbox`,"aria-label":s(`assistants.listAria`),children:(0,$.jsx)(`div`,{className:`flex flex-col gap-1 pt-3`,children:x.map(e=>{let t=e.id===C,n=N(e.name);return(0,$.jsx)(fr,{assistantID:e.id,avatarSeed:e.avatarSeed,unreadCount:e.unreadCount??0,summary:cr(e.latestMessagePreview,s),displayName:n.displayName,selected:t,enabled:e.enabled,editLabel:s(`assistants.menu.edit`),deleteLabel:s(`assistants.settings.delete`),assignedSessionIDs:e.assignedSessionIDs,serverWorking:e.working,onSelect:()=>w(e.id),onEdit:()=>te(e.id),onDelete:()=>G(e)},e.id)})})})]}),t[81]=x,t[82]=h,t[83]=B,t[84]=te,t[85]=G,t[86]=w,t[87]=C,t[88]=v,t[89]=s,t[90]=X):X=t[90];let ge=W!==null,_e;t[91]!==W||t[92]!==oe||t[93]!==ge?(_e=(0,$.jsx)(ar,{assistant:W,open:ge,onOpenChange:oe}),t[91]=W,t[92]=oe,t[93]=ge,t[94]=_e):_e=t[94];let ve=!h&&`border-l border-[var(--surface-subtle)]`,ye;t[95]===ve?ye=t[96]:(ye=j(`relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background`,ve),t[95]=ve,t[96]=ye);let be;t[97]!==D||t[98]!==K||t[99]!==h||t[100]!==o||t[101]!==U||t[102]!==pe||t[103]!==s?(be=h?(0,$.jsx)(dr,{assistant:D,onBack:K,onOpenSettings:o}):(0,$.jsxs)(`header`,{className:`flex h-16 shrink-0 items-center gap-3.5 border-b border-[var(--surface-subtle)]/70 px-5 sm:px-7`,children:[(0,$.jsx)(ht,{name:D.id,avatarSeed:D.avatarSeed,size:40,label:pe.displayName||D.name,working:!!(D.working||D.activeContactTurn),showWorkingDot:!1}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{className:`truncate typography-ui-label font-semibold leading-5 tracking-[-0.01em] text-foreground`,children:pe.displayName}),(0,$.jsx)(St,{assistantID:D.id,serverWorking:!!(D.working||D.activeContactTurn),lastContactAt:D.latestMessagePreview?.createdAt})]}),(0,$.jsx)(M,{type:`button`,variant:`ghost`,size:`icon`,className:`size-8 shrink-0 rounded-full text-muted-foreground/65 transition-colors hover:text-foreground`,onClick:U,"aria-label":s(`assistants.conversation.openSettings`),children:(0,$.jsx)(Y,{name:`settings-3`,className:`size-4`})})]}),t[97]=D,t[98]=K,t[99]=h,t[100]=o,t[101]=U,t[102]=pe,t[103]=s,t[104]=be):be=t[104];let Z;t[105]!==p||t[106]!==D||t[107]!==h||t[108]!==he?(Z=(0,$.jsx)(rr,{assistant:D,warning:he,active:p,overlayHeader:h}),t[105]=p,t[106]=D,t[107]=h,t[108]=he,t[109]=Z):Z=t[109];let Se;t[110]!==ye||t[111]!==be||t[112]!==Z?(Se=(0,$.jsxs)(`div`,{className:ye,children:[be,Z]}),t[110]=ye,t[111]=be,t[112]=Z,t[113]=Se):Se=t[113];let Ce;return t[114]!==X||t[115]!==_e||t[116]!==Se?(Ce=(0,$.jsxs)(`div`,{className:`relative flex h-full min-h-0 overflow-hidden bg-background`,"data-presentation":`workspace`,children:[X,_e,Se]}),t[114]=X,t[115]=_e,t[116]=Se,t[117]=Ce):Ce=t[117],Ce};function mr(e){return e.activeMainTab===`assistant`}function hr(e){return e.isMobile}function gr(e){return e.selectAssistant}function _r(e){return e.requestCreate}function vr(){c.getState().setActiveMainTab(`chat`)}export{ar as a,dt as c,cr as i,ur as n,ht as o,or as r,mt as s,pr as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{it as t,rt as n}from"./vendor-base-ui-CdzJ6My_.js";import{r}from"./button-DFX-UCuQ.js";var i=e(t(),1),a={add:`<path d="M5 12h14" /> <path d="M12 5v14" />`,"add-circle":`<circle cx="12" cy="12" r="10" /> <path d="M8 12h8" /> <path d="M12 8v8" />`,"ai-agent":`<rect x="4" y="7.5" width="16" height="13" rx="4.5" /><path d="M12 7.5V4.75" /><circle cx="12" cy="3.5" r="1.25" /><path d="M1.75 12.5v3M22.25 12.5v3M9 12.5v2M15 12.5v2" />`,"ai-agent-fill":`<path d="M12 8V4H8" fill="currentColor"/> <rect width="16" height="12" x="4" y="8" rx="2" /> <path d="M2 14h2" fill="currentColor"/> <path d="M20 14h2" fill="currentColor"/> <path d="M15 13v2" fill="currentColor"/> <path d="M9 13v2" fill="currentColor"/>`,"ai-generate-2":`<path d="m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72" /> <path d="m14 7 3 3" /> <path d="M5 6v4" /> <path d="M19 14v4" /> <path d="M10 2v2" /> <path d="M7 8H3" /> <path d="M21 16h-4" /> <path d="M11 3H9" />`,alert:`<circle cx="12" cy="12" r="10" /> <line x1="12" x2="12" y1="8" y2="12" /> <line x1="12" x2="12.01" y1="16" y2="16" />`,"alert-fill":`<path d="M12.8659 3.00017L22.3922 19.5002C22.6684 19.9785 22.5045 20.5901 22.0262 20.8662C21.8742 20.954 21.7017 21.0002 21.5262 21.0002H2.47363C1.92135 21.0002 1.47363 20.5525 1.47363 20.0002C1.47363 19.8246 1.51984 19.6522 1.60761 19.5002L11.1339 3.00017C11.41 2.52187 12.0216 2.358 12.4999 2.63414C12.6519 2.72191 12.7782 2.84815 12.8659 3.00017ZM10.9999 16.0002V18.0002H12.9999V16.0002H10.9999ZM10.9999 9.00017V14.0002H12.9999V9.00017H10.9999Z" fill="currentColor" stroke="none"/>`,"align-justify":`<path d="M3 5h18" /> <path d="M3 12h18" /> <path d="M3 19h18" />`,apple:`<path d="M12 6.528V3a1 1 0 0 1 1-1h0" /> <path d="M18.237 21A15 15 0 0 0 22 11a6 6 0 0 0-10-4.472A6 6 0 0 0 2 11a15.1 15.1 0 0 0 3.763 10 3 3 0 0 0 3.648.648 5.5 5.5 0 0 1 5.178 0A3 3 0 0 0 18.237 21" />`,"apps-2-ai":`<rect width="7" height="7" x="3" y="3" rx="1" /> <rect width="7" height="7" x="14" y="3" rx="1" /> <rect width="7" height="7" x="14" y="14" rx="1" /> <rect width="7" height="7" x="3" y="14" rx="1" />`,archive:`<rect width="20" height="5" x="2" y="3" rx="1" /> <path d="M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8" /> <path d="M10 12h4" />`,"archive-stack":`<rect width="20" height="5" x="2" y="3" rx="1" /> <path d="M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8" /> <path d="M10 12h4" />`,"arrow-down":`<path d="M12 5v14" /> <path d="m19 12-7 7-7-7" />`,"arrow-down-s":`<path d="m6 9 6 6 6-6" />`,"arrow-go-back":`<path d="M9 14 4 9l5-5" /><path d="M4 9h10.5a5.5 5.5 0 0 1 0 11H12" />`,"arrow-go-forward":`<path d="m15 14 5-5-5-5" /> <path d="M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13" />`,"arrow-left":`<path d="m12 19-7-7 7-7" /> <path d="M19 12H5" />`,"arrow-left-long":`<path d="m12 19-7-7 7-7" /> <path d="M19 12H5" />`,"arrow-left-right":`<path d="M8 7H3v5" /><path d="m3 7 7 7" /><path d="M16 17h5v-5" /><path d="m21 17-7-7" />`,"arrow-left-s":`<path d="m15 18-6-6 6-6" />`,"arrow-right":`<path d="M5 12h14" /> <path d="m12 5 7 7-7 7" />`,"arrow-right-s":`<path d="m9 18 6-6-6-6" />`,"arrow-up":`<path d="m5 12 7-7 7 7" /> <path d="M12 19V5" />`,"arrow-up-double":`<path d="m17 11-5-5-5 5" /> <path d="m17 18-5-5-5 5" />`,"arrow-up-s":`<path d="m18 15-6-6-6 6" />`,"attachment-2":`<path d="m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551" />`,"bar-chart-2":`<path d="M3 3v16a2 2 0 0 0 2 2h16" /> <path d="M18 17V9" /> <path d="M13 17V5" /> <path d="M8 17v-3" />`,"bar-chart-box":`<path d="M3 3v16a2 2 0 0 0 2 2h16" /> <path d="M18 17V9" /> <path d="M13 17V5" /> <path d="M8 17v-3" />`,book:`<path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20" />`,"book-open":`<path d="M12 7v14" /> <path d="M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z" />`,booklet:`<path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20" />`,brain:`<path d="M12 18V5" /> <path d="M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4" /> <path d="M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5" /> <path d="M17.997 5.125a4 4 0 0 1 2.526 5.77" /> <path d="M18 18a4 4 0 0 0 2-7.464" /> <path d="M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517" /> <path d="M6 18a4 4 0 0 1-2-7.464" /> <path d="M6.003 5.125a4 4 0 0 0-2.526 5.77" />`,"brain-ai-3":`<path d="M12 18V5" /> <path d="M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4" /> <path d="M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5" /> <path d="M17.997 5.125a4 4 0 0 1 2.526 5.77" /> <path d="M18 18a4 4 0 0 0 2-7.464" /> <path d="M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517" /> <path d="M6 18a4 4 0 0 1-2-7.464" /> <path d="M6.003 5.125a4 4 0 0 0-2.526 5.77" />`,briefcase:`<path d="M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16" /> <rect width="20" height="14" x="2" y="6" rx="2" />`,bug:`<path d="M12 20v-9" /> <path d="M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z" /> <path d="M14.12 3.88 16 2" /> <path d="M21 21a4 4 0 0 0-3.81-4" /> <path d="M21 5a4 4 0 0 1-3.55 3.97" /> <path d="M22 13h-4" /> <path d="M3 21a4 4 0 0 1 3.81-4" /> <path d="M3 5a4 4 0 0 0 3.55 3.97" /> <path d="M6 13H2" /> <path d="m8 2 1.88 1.88" /> <path d="M9 7.13V6a3 3 0 1 1 6 0v1.13" />`,calendar:`<path d="M8 2v4" /> <path d="M16 2v4" /> <rect width="18" height="18" x="3" y="4" rx="2" /> <path d="M3 10h18" />`,"calendar-schedule":`<path d="M16 14v2.2l1.6 1" /> <path d="M16 2v4" /> <path d="M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5" /> <path d="M3 10h5" /> <path d="M8 2v4" /> <circle cx="16" cy="16" r="6" />`,camera:`<path d="M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z" /> <circle cx="12" cy="13" r="3" />`,changes:`<path d="M6 8h12M12 2v12M6 21h12" />`,"chat-1":`<path d="M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z" />`,"chat-3":`<path d="M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z" />`,"chat-4":`<path d="M12 3a9 9 0 0 1 7.45 14.05L21 21l-4.05-1.55A9 9 0 1 1 12 3Z" />`,"chat-ai-3":`<path d="M12 6V2H8" /> <path d="M15 11v2" /> <path d="M2 12h2" /> <path d="M20 12h2" /> <path d="M20 16a2 2 0 0 1-2 2H8.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 4 20.286V8a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2z" /> <path d="M9 11v2" />`,"chat-history":`<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" /> <path d="M3 3v5h5" /> <path d="M12 7v5l4 2" />`,"chat-new":`<path d="M11.5 4.5H9A4.5 4.5 0 0 0 4.5 9v6.5A4.5 4.5 0 0 0 9 20h6.5a4.5 4.5 0 0 0 4.5-4.5V13" /><path d="m10 14.25.6-1.8a2 2 0 0 1 .48-.78l6.62-6.62a1.91 1.91 0 0 1 2.7 2.7l-6.62 6.62a2 2 0 0 1-.78.48l-1.8.6a.95.95 0 0 1-1.2-1.2Z" />`,"chat-thread":`<path d="M10.5 7C11.3 4.9 13.1 3.5 15.25 3.5c3.45 0 6.25 2.45 6.25 5.5 0 1.13-.38 2.18-1.03 3.06l.58 2.14-2.3-.75c-.4.18-.8.32-1.2.43" /><path d="M8.5 8.25c-3.6 0-6.5 2.55-6.5 5.75 0 1.21.42 2.33 1.13 3.25l-.63 2.27 2.48-.8c1.04.56 2.24.88 3.52.88 3.6 0 6.5-2.55 6.5-5.75S12.1 8.25 8.5 8.25Z" />`,check:`<path d="M20 6 9 17l-5-5" />`,checkbox:`<rect width="18" height="18" x="3" y="3" rx="2" /> <path d="m9 12 2 2 4-4" />`,"checkbox-blank":`<rect width="18" height="18" x="3" y="3" rx="2" />`,"checkbox-blank-circle-fill":`<circle cx="12" cy="12" r="10" fill="currentColor"/>`,"checkbox-circle":`<circle cx="12" cy="12" r="10" /> <path d="m9 12 2 2 4-4" />`,"checkbox-circle-fill":`<path d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM17.4571 9.45711L11 15.9142L6.79289 11.7071L8.20711 10.2929L11 13.0858L16.0429 8.04289L17.4571 9.45711Z" fill="currentColor" stroke="none"/>`,"checkbox-multiple":`<path d="m12 15 2 2 4-4" /> <rect width="14" height="14" x="8" y="8" rx="2" ry="2" /> <path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />`,clipboard:`<rect width="8" height="4" x="8" y="2" rx="1" ry="1" /> <path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2" />`,close:`<path d="M18 6 6 18" /> <path d="m6 6 12 12" />`,"close-circle":`<circle cx="12" cy="12" r="10" /> <path d="m15 9-6 6" /> <path d="m9 9 6 6" />`,cloud:`<path d="M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z" />`,"cloud-off":`<path d="M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057" /> <path d="M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78" /> <path d="m2 2 20 20" />`,code:`<path d="m16 18 6-6-6-6" /> <path d="m8 6-6 6 6 6" />`,"code-ai":`<path d="m16 18 6-6-6-6" /> <path d="m8 6-6 6 6 6" />`,"code-box":`<path d="m18 16 4-4-4-4" /> <path d="m6 8-4 4 4 4" /> <path d="m14.5 4-5 16" />`,"code-sslash":`<path d="m16 18 6-6-6-6" /> <path d="m8 6-6 6 6 6" />`,command:`<path d="M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3" />`,"compass-3":`<circle cx="12" cy="12" r="10" /> <path d="m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z" />`,computer:`<rect width="20" height="14" x="2" y="3" rx="2" /> <line x1="8" x2="16" y1="21" y2="21" /> <line x1="12" x2="12" y1="17" y2="21" />`,"contract-up-down":`<path d="m7 20 5-5 5 5" /> <path d="m7 4 5 5 5-5" />`,"corner-down-left":`<path d="M20 4v7a4 4 0 0 1-4 4H4" /> <path d="m9 10-5 5 5 5" />`,cursor:`<path d="M12.586 12.586 19 19" /> <path d="M3.688 3.037a.497.497 0 0 0-.651.651l6.5 15.999a.501.501 0 0 0 .947-.062l1.569-6.083a2 2 0 0 1 1.448-1.479l6.124-1.579a.5.5 0 0 0 .063-.947z" />`,"database-2":`<ellipse cx="12" cy="5" rx="9" ry="3" /> <path d="M3 5V19A9 3 0 0 0 21 19V5" /> <path d="M3 12A9 3 0 0 0 21 12" />`,"delete-bin":`<path d="M10 11v6" /> <path d="M14 11v6" /> <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" /> <path d="M3 6h18" /> <path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />`,"device-android":`<path d="m7 9-2-3.5M17 9l2-3.5" /><path d="M2 18a10 10 0 0 1 20 0H2Z" /><path d="M7.5 14h.01M16.5 14h.01" />`,"device-apple":`<path d="M12.9 6.3c.9-.1 2-.6 2.6-1.5.6-.8.9-1.9.8-2.8-1 .1-2.1.7-2.8 1.5-.6.7-1 1.8-.9 2.8Z" /><path d="M16.4 12.6c0-2 1.6-3 1.7-3.1-.9-1.4-2.4-1.6-2.9-1.6-1.2-.1-2.4.7-3 .7-.6 0-1.6-.7-2.6-.7-1.3 0-2.6.8-3.3 2-1.4 2.5-.4 6.1 1 8.1.7 1 1.5 2.1 2.5 2 1-.04 1.4-.6 2.6-.6s1.5.6 2.6.6c1.1 0 1.8-1 2.5-2 .8-1.2 1.1-2.3 1.1-2.4-.02-.01-2.2-.9-2.2-3z" />`,"device-cli":`<rect x="2.5" y="3.5" width="19" height="17" rx="4" /><path d="m8 10 2.25 2L8 14" /><path d="M12.75 14h3.5" />`,"device-desktop":`<rect x="2.5" y="4" width="19" height="12.5" rx="3.5" /><path d="M9 20h6" /><path d="M12 16.5V20" />`,"device-ios":`<path d="M12.9 6.3c.9-.1 2-.6 2.6-1.5.6-.8.9-1.9.8-2.8-1 .1-2.1.7-2.8 1.5-.6.7-1 1.8-.9 2.8Z" /><path d="M16.4 12.6c0-2 1.6-3 1.7-3.1-.9-1.4-2.4-1.6-2.9-1.6-1.2-.1-2.4.7-3 .7-.6 0-1.6-.7-2.6-.7-1.3 0-2.6.8-3.3 2-1.4 2.5-.4 6.1 1 8.1.7 1 1.5 2.1 2.5 2 1-.04 1.4-.6 2.6-.6s1.5.6 2.6.6c1.1 0 1.8-1 2.5-2 .8-1.2 1.1-2.3 1.1-2.4-.02-.01-2.2-.9-2.2-3z" />`,"device-linux":`<rect x="2.5" y="3.5" width="19" height="17" rx="4" /><path d="m8 10 2.25 2L8 14" /><path d="M12.75 14h3.5" />`,"device-macos":`<rect x="2.5" y="4" width="19" height="12.5" rx="3.5" /><path d="M9 20h6" /><path d="M12 16.5V20" />`,"device-tablet":`<rect x="4.5" y="2.5" width="15" height="19" rx="4" /><path d="M11.5 18h1" />`,"device-windows":`<rect x="2.5" y="4" width="19" height="12.5" rx="3.5" /><path d="M9 20h6" /><path d="M12 16.5V20" />`,"devices-connected":`<path d="M13 17H5a2.5 2.5 0 0 1-2.5-2.5v-8A2.5 2.5 0 0 1 5 4h12a2.5 2.5 0 0 1 2.5 2.5V8M8 20h4M10 17v3" /><rect x="15" y="10" width="7" height="11" rx="2" /><path d="M18 18.5h1" />`,"discord-fill":`<path d="M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719" fill="currentColor"/>`,"donut-chart":`<path d="M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z" /> <path d="M21.21 15.89A10 10 0 1 1 8 2.83" />`,"donut-chart-fill":`<path d="M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z" fill="currentColor"/> <path d="M21.21 15.89A10 10 0 1 1 8 2.83" fill="currentColor"/>`,download:`<path d="M12 15V3" /> <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" /> <path d="m7 10 5 5 5-5" />`,"download-2-fill":`<path d="M4 19H20V12H22V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V12H4V19ZM14 9H19L12 16L5 9H10V3H14V9Z" fill="currentColor" stroke="none"/>`,"download-cloud":`<path d="M12 13v8l-4-4" /> <path d="m12 21 4-4" /> <path d="M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284" />`,"drag-move-2":`<circle cx="9" cy="12" r="1" /> <circle cx="9" cy="5" r="1" /> <circle cx="9" cy="19" r="1" /> <circle cx="15" cy="12" r="1" /> <circle cx="15" cy="5" r="1" /> <circle cx="15" cy="19" r="1" />`,draggable:`<circle cx="9" cy="12" r="1" /> <circle cx="9" cy="5" r="1" /> <circle cx="9" cy="19" r="1" /> <circle cx="15" cy="12" r="1" /> <circle cx="15" cy="5" r="1" /> <circle cx="15" cy="19" r="1" />`,earth:`<circle cx="12" cy="12" r="10" /> <path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20" /> <path d="M2 12h20" />`,edit:`<path d="M15 5.5 18.5 9" /><path d="M4.5 19.5 5.75 14.75 15.25 5.25a2.1 2.1 0 0 1 3 0l.5.5a2.1 2.1 0 0 1 0 3L9.25 18.25Z" />`,"edit-2":`<path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" />`,"emotion-happy":`<circle cx="12" cy="12" r="10" /> <path d="M8 14s1.5 2 4 2 4-2 4-2" /> <line x1="9" x2="9.01" y1="9" y2="9" /> <line x1="15" x2="15.01" y1="9" y2="9" />`,"equalizer-2":`<path d="M10 5H3" /> <path d="M12 19H3" /> <path d="M14 3v4" /> <path d="M16 17v4" /> <path d="M21 12h-9" /> <path d="M21 19h-5" /> <path d="M21 5h-7" /> <path d="M8 10v4" /> <path d="M8 12H3" />`,"error-warning":`<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" /> <path d="M12 9v4" /> <path d="M12 17h.01" />`,"error-warning-fill":`<path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 15V17H13V15H11ZM11 7V13H13V7H11Z" fill="currentColor" stroke="none"/>`,"expand-up-down":`<path d="m7 15 5 5 5-5" /> <path d="m7 9 5-5 5 5" />`,"external-link":`<path d="M15 3h6v6" /> <path d="M10 14 21 3" /> <path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" />`,eye:`<path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0" /> <circle cx="12" cy="12" r="3" />`,"eye-off":`<path d="M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49" /> <path d="M14.084 14.158a3 3 0 0 1-4.242-4.242" /> <path d="M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143" /> <path d="m2 2 20 20" />`,file:`<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" />`,"file-add":`<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M9 15h6" /> <path d="M12 18v-6" />`,"file-check":`<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="m9 15 2 2 4-4" />`,"file-check-fill":`<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" fill="currentColor"/> <path d="M14 2v5a1 1 0 0 0 1 1h5" fill="currentColor"/> <path d="m9 15 2 2 4-4" fill="currentColor"/>`,"file-code":`<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M10 12.5 8 15l2 2.5" /> <path d="m14 12.5 2 2.5-2 2.5" />`,"file-copy":`<rect width="14" height="14" x="8" y="8" rx="3.5" ry="3.5" /><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />`,"file-copy-2":`<path d="M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8" /> <path d="M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z" /> <path d="M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1" />`,"file-download":`<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M12 18v-6" /> <path d="m9 15 3 3 3-3" />`,"file-edit":`<path d="M10 21H7a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h5.2c.8 0 1.6.3 2.1.9l2.8 2.8c.6.5.9 1.3.9 2.1V10M12 3.2V7a2 2 0 0 0 2 2h3.8" /><path d="m12 17 6-6a2.1 2.1 0 0 1 3 3l-6 6-4 1 1-4ZM17 12l3 3" />`,"file-image":`<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <circle cx="10" cy="12" r="2" /> <path d="m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22" />`,"file-list-2":`<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M10 9H8" /> <path d="M16 13H8" /> <path d="M16 17H8" />`,"file-music":`<path d="M11.65 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v10.35" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M8 20v-7l3 1.474" /> <circle cx="6" cy="20" r="2" />`,"file-pdf":`<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M10 9H8" /> <path d="M16 13H8" /> <path d="M16 17H8" />`,"file-search":`<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <circle cx="11.5" cy="14.5" r="2.5" /> <path d="M13.3 16.3 15 18" />`,"file-text":`<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M10 9H8" /> <path d="M16 13H8" /> <path d="M16 17H8" />`,"file-transfer":`<path d="M4 11V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-1" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M2 15h10" /> <path d="m9 18 3-3-3-3" />`,"file-video":`<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z" />`,flashlight:`<path d="M12 13v1" /> <path d="M17 2a1 1 0 0 1 1 1v4a3 3 0 0 1-.6 1.8l-.6.8A4 4 0 0 0 16 12v8a2 2 0 0 1-2 2H10a2 2 0 0 1-2-2v-8a4 4 0 0 0-.8-2.4l-.6-.8A3 3 0 0 1 6 7V3a1 1 0 0 1 1-1z" /> <path d="M6 6h12" />`,flask:`<path d="M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2" /> <path d="M6.453 15h11.094" /> <path d="M8.5 2h7" />`,"fold-vertical":`<path d="M12 22v-6" /> <path d="M12 8V2" /> <path d="M4 12H2" /> <path d="M10 12H8" /> <path d="M16 12h-2" /> <path d="M22 12h-2" /> <path d="m15 19-3-3-3 3" /> <path d="m15 5-3 3-3-3" />`,folder:`<path d="M3 17V6a3 3 0 0 1 3-3h2.2c.9 0 1.7.4 2.2 1.1l.6.8c.5.7 1.3 1.1 2.2 1.1H18a3 3 0 0 1 3 3v1M3 17l3-5a3 3 0 0 1 2.6-1.5h10.6a2 2 0 0 1 1.9 2.6l-1.5 5a2.7 2.7 0 0 1-2.6 1.9H6a3 3 0 0 1-3-3Z" />`,"folder-3":`<path d="M3 17V6a3 3 0 0 1 3-3h2.2c.9 0 1.7.4 2.2 1.1l.6.8c.5.7 1.3 1.1 2.2 1.1H18a3 3 0 0 1 3 3v1M3 17l3-5a3 3 0 0 1 2.6-1.5h10.6a2 2 0 0 1 1.9 2.6l-1.5 5a2.7 2.7 0 0 1-2.6 1.9H6a3 3 0 0 1-3-3Z" />`,"folder-3-fill":`<path d="M3 17V6a3 3 0 0 1 3-3h2.2c.9 0 1.7.4 2.2 1.1l.6.8c.5.7 1.3 1.1 2.2 1.1H18a3 3 0 0 1 3 3v1M3 17l3-5a3 3 0 0 1 2.6-1.5h10.6a2 2 0 0 1 1.9 2.6l-1.5 5a2.7 2.7 0 0 1-2.6 1.9H6a3 3 0 0 1-3-3Z" />`,"folder-6":`<path d="M3 17V6a3 3 0 0 1 3-3h2.2c.9 0 1.7.4 2.2 1.1l.6.8c.5.7 1.3 1.1 2.2 1.1H18a3 3 0 0 1 3 3v1M3 17l3-5a3 3 0 0 1 2.6-1.5h10.6a2 2 0 0 1 1.9 2.6l-1.5 5a2.7 2.7 0 0 1-2.6 1.9H6a3 3 0 0 1-3-3Z" />`,"folder-add":`<path d="M3 17V6a3 3 0 0 1 3-3h2.2c.9 0 1.7.4 2.2 1.1l.6.8c.5.7 1.3 1.1 2.2 1.1H18a3 3 0 0 1 3 3v1M3 17l3-5a3 3 0 0 1 2.6-1.5h10.6a2 2 0 0 1 1.9 2.6l-1.5 5a2.7 2.7 0 0 1-2.6 1.9H6a3 3 0 0 1-3-3Z" /><path d="M12 11v6" /><path d="M9 14h6" />`,"folder-open":`<path d="M3 17V6a3 3 0 0 1 3-3h2.2c.9 0 1.7.4 2.2 1.1l.6.8c.5.7 1.3 1.1 2.2 1.1H18a3 3 0 0 1 3 3v1M3 17l3-5a3 3 0 0 1 2.6-1.5h10.6a2 2 0 0 1 1.9 2.6l-1.5 5a2.7 2.7 0 0 1-2.6 1.9H6a3 3 0 0 1-3-3Z" />`,"folder-open-fill":`<path d="M3 17V6a3 3 0 0 1 3-3h2.2c.9 0 1.7.4 2.2 1.1l.6.8c.5.7 1.3 1.1 2.2 1.1H18a3 3 0 0 1 3 3v1M3 17l3-5a3 3 0 0 1 2.6-1.5h10.6a2 2 0 0 1 1.9 2.6l-1.5 5a2.7 2.7 0 0 1-2.6 1.9H6a3 3 0 0 1-3-3Z" />`,"folder-received":`<path d="M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1" /> <path d="M2 13h10" /> <path d="m9 16 3-3-3-3" />`,folders:`<path d="M3 17V6a3 3 0 0 1 3-3h2.2c.9 0 1.7.4 2.2 1.1l.6.8c.5.7 1.3 1.1 2.2 1.1H18a3 3 0 0 1 3 3v1M3 17l3-5a3 3 0 0 1 2.6-1.5h10.6a2 2 0 0 1 1.9 2.6l-1.5 5a2.7 2.7 0 0 1-2.6 1.9H6a3 3 0 0 1-3-3Z" />`,fullscreen:`<path d="M8 3H5a2 2 0 0 0-2 2v3" /> <path d="M21 8V5a2 2 0 0 0-2-2h-3" /> <path d="M3 16v3a2 2 0 0 0 2 2h3" /> <path d="M16 21h3a2 2 0 0 0 2-2v-3" />`,"fullscreen-exit":`<path d="M8 3v3a2 2 0 0 1-2 2H3" /> <path d="M21 8h-3a2 2 0 0 1-2-2V3" /> <path d="M3 16h3a2 2 0 0 1 2 2v3" /> <path d="M16 21v-3a2 2 0 0 1 2-2h3" />`,gamepad:`<line x1="6" x2="10" y1="11" y2="11" /> <line x1="8" x2="8" y1="9" y2="13" /> <line x1="15" x2="15.01" y1="12" y2="12" /> <line x1="18" x2="18.01" y1="10" y2="10" /> <path d="M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z" />`,"git-branch":`<circle cx="6" cy="17.5" r="2.75" /><circle cx="18" cy="6.5" r="2.75" /><path d="M6 14.75V3.5M18 9.25c0 4.75-3.5 8.25-9.25 8.25" />`,"git-close-pull-request":`<circle cx="6" cy="6" r="3" /> <path d="M6 9v12" /> <path d="m21 3-6 6" /> <path d="m21 9-6-6" /> <path d="M18 11.5V15" /> <circle cx="18" cy="18" r="3" />`,"git-commit":`<circle cx="12" cy="12" r="3" /> <line x1="3" x2="9" y1="12" y2="12" /> <line x1="15" x2="21" y1="12" y2="12" />`,"git-merge":`<circle cx="18" cy="18" r="3" /> <circle cx="6" cy="6" r="3" /> <path d="M6 21V9a9 9 0 0 0 9 9" />`,"git-pr-draft":`<circle cx="18" cy="18" r="3" /> <circle cx="6" cy="6" r="3" /> <path d="M18 6V5" /> <path d="M18 11v-1" /> <line x1="6" x2="6" y1="9" y2="21" />`,"git-pull-request":`<circle cx="18" cy="18" r="3" /> <circle cx="6" cy="6" r="3" /> <path d="M13 6h3a2 2 0 0 1 2 2v7" /> <line x1="6" x2="6" y1="9" y2="21" />`,"git-repository":`<path d="M18 19a5 5 0 0 1-5-5v8" /> <path d="M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5" /> <circle cx="13" cy="12" r="2" /> <circle cx="20" cy="19" r="2" />`,github:`<path d="M5.88401 18.6533C5.58404 18.4526 5.32587 18.1975 5.0239 17.8369C4.91473 17.7065 4.47283 17.1524 4.55811 17.2583C4.09533 16.6833 3.80296 16.417 3.50156 16.3089C2.9817 16.1225 2.7114 15.5499 2.89784 15.0301C3.08428 14.5102 3.65685 14.2399 4.17672 14.4263C4.92936 14.6963 5.43847 15.1611 6.12425 16.0143C6.03025 15.8974 6.46364 16.441 6.55731 16.5529C6.74784 16.7804 6.88732 16.9182 6.99629 16.9911C7.20118 17.1283 7.58451 17.1874 8.14709 17.1311C8.17065 16.7489 8.24136 16.3783 8.34919 16.0358C5.38097 15.3104 3.70116 13.3952 3.70116 9.63971C3.70116 8.40085 4.0704 7.28393 4.75917 6.3478C4.5415 5.45392 4.57433 4.37284 5.06092 3.15636C5.1725 2.87739 5.40361 2.66338 5.69031 2.57352C5.77242 2.54973 5.81791 2.53915 5.89878 2.52673C6.70167 2.40343 7.83573 2.69705 9.31449 3.62336C10.181 3.41879 11.0885 3.315 12.0012 3.315C12.9129 3.315 13.8196 3.4186 14.6854 3.62277C16.1619 2.69 17.2986 2.39649 18.1072 2.52651C18.1919 2.54013 18.2645 2.55783 18.3249 2.57766C18.6059 2.66991 18.8316 2.88179 18.9414 3.15636C19.4279 4.37256 19.4608 5.45344 19.2433 6.3472C19.9342 7.28337 20.3012 8.39208 20.3012 9.63971C20.3012 13.3968 18.627 15.3048 15.6588 16.032C15.7837 16.447 15.8496 16.9105 15.8496 17.4121C15.8496 18.0765 15.8471 18.711 15.8424 19.4225C15.8412 19.6127 15.8397 19.8159 15.8375 20.1281C16.2129 20.2109 16.5229 20.5077 16.6031 20.9089C16.7114 21.4504 16.3602 21.9773 15.8186 22.0856C14.6794 22.3134 13.8353 21.5538 13.8353 20.5611C13.8353 20.4708 13.836 20.3417 13.8375 20.1145C13.8398 19.8015 13.8412 19.599 13.8425 19.4094C13.8471 18.7019 13.8496 18.0716 13.8496 17.4121C13.8496 16.7148 13.6664 16.2602 13.4237 16.051C12.7627 15.4812 13.0977 14.3973 13.965 14.2999C16.9314 13.9666 18.3012 12.8177 18.3012 9.63971C18.3012 8.68508 17.9893 7.89571 17.3881 7.23559C17.1301 6.95233 17.0567 6.54659 17.199 6.19087C17.3647 5.77663 17.4354 5.23384 17.2941 4.57702L17.2847 4.57968C16.7928 4.71886 16.1744 5.0198 15.4261 5.5285C15.182 5.69438 14.8772 5.74401 14.5932 5.66413C13.7729 5.43343 12.8913 5.315 12.0012 5.315C11.111 5.315 10.2294 5.43343 9.40916 5.66413C9.12662 5.74359 8.82344 5.69492 8.57997 5.53101C7.8274 5.02439 7.2056 4.72379 6.71079 4.58376C6.56735 5.23696 6.63814 5.77782 6.80336 6.19087C6.94565 6.54659 6.87219 6.95233 6.61423 7.23559C6.01715 7.8912 5.70116 8.69376 5.70116 9.63971C5.70116 12.8116 7.07225 13.9683 10.023 14.2999C10.8883 14.3971 11.2246 15.4769 10.5675 16.0482C10.3751 16.2156 10.1384 16.7802 10.1384 17.4121V20.5611C10.1384 21.5474 9.30356 22.2869 8.17878 22.09C7.63476 21.9948 7.27093 21.4766 7.36613 20.9326C7.43827 20.5204 7.75331 20.2116 8.13841 20.1276V19.1381C7.22829 19.1994 6.47656 19.0498 5.88401 18.6533Z" fill="currentColor"/>`,"github-fill":`<path d="M12.001 2C6.47598 2 2.00098 6.475 2.00098 12C2.00098 16.425 4.86348 20.1625 8.83848 21.4875C9.33848 21.575 9.52598 21.275 9.52598 21.0125C9.52598 20.775 9.51348 19.9875 9.51348 19.15C7.00098 19.6125 6.35098 18.5375 6.15098 17.975C6.03848 17.6875 5.55098 16.8 5.12598 16.5625C4.77598 16.375 4.27598 15.9125 5.11348 15.9C5.90098 15.8875 6.46348 16.625 6.65098 16.925C7.55098 18.4375 8.98848 18.0125 9.56348 17.75C9.65098 17.1 9.91348 16.6625 10.201 16.4125C7.97598 16.1625 5.65098 15.3 5.65098 11.475C5.65098 10.3875 6.03848 9.4875 6.67598 8.7875C6.57598 8.5375 6.22598 7.5125 6.77598 6.1375C6.77598 6.1375 7.61348 5.875 9.52598 7.1625C10.326 6.9375 11.176 6.825 12.026 6.825C12.876 6.825 13.726 6.9375 14.526 7.1625C16.4385 5.8625 17.276 6.1375 17.276 6.1375C17.826 7.5125 17.476 8.5375 17.376 8.7875C18.0135 9.4875 18.401 10.375 18.401 11.475C18.401 15.3125 16.0635 16.1625 13.8385 16.4125C14.201 16.725 14.5135 17.325 14.5135 18.2625C14.5135 19.6 14.501 20.675 14.501 21.0125C14.501 21.275 14.6885 21.5875 15.1885 21.4875C19.259 20.1133 21.9999 16.2963 22.001 12C22.001 6.475 17.526 2 12.001 2Z" fill="currentColor"/>`,global:`<circle cx="12" cy="12" r="10" /> <path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20" /> <path d="M2 12h20" />`,"graduation-cap":`<path d="M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z" /> <path d="M22 10v6" /> <path d="M6 12.5V16a6 3 0 0 0 12 0v-3.5" />`,hammer:`<path d="m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9" /> <path d="m18 15 4-4" /> <path d="m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5" />`,heart:`<path d="M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5" />`,history:`<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" /> <path d="M3 3v5h5" /> <path d="M12 7v5l4 2" />`,home:`<path d="M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8" /> <path d="M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />`,hourglass:`<path d="M8 3.5h8c.8 0 1.5.7 1.5 1.5 0 2.6-1.8 4.5-3.8 5.9-.4.3-.7.6-.7 1.1s.3.8.7 1.1c2 1.4 3.8 3.3 3.8 5.9 0 .8-.7 1.5-1.5 1.5H8c-.8 0-1.5-.7-1.5-1.5 0-2.6 1.8-4.5 3.8-5.9.4-.3.7-.6.7-1.1s-.3-.8-.7-1.1C8.3 9.5 6.5 7.6 6.5 5c0-.8.7-1.5 1.5-1.5z" />`,"hourglass-fill":`<path d="M5 22h14" fill="currentColor"/> <path d="M5 2h14" fill="currentColor"/> <path d="M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22" fill="currentColor"/> <path d="M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2" fill="currentColor"/>`,"image-download":`<path d="M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21" /> <path d="m14 19 3 3v-5.5" /> <path d="m17 22 3-3" /> <circle cx="9" cy="9" r="2" />`,"inbox-archive":`<rect width="20" height="5" x="2" y="3" rx="1" /> <path d="M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8" /> <path d="M10 12h4" />`,"inbox-unarchive":`<rect width="20" height="5" x="2" y="3" rx="1" /> <path d="M4 8v11a2 2 0 0 0 2 2h2" /> <path d="M20 8v11a2 2 0 0 1-2 2h-2" /> <path d="m9 15 3-3 3 3" /> <path d="M12 12v9" />`,"inbox-unarchive-fill":`<rect width="20" height="5" x="2" y="3" rx="1" /> <path d="M4 8v11a2 2 0 0 0 2 2h2" fill="currentColor"/> <path d="M20 8v11a2 2 0 0 1-2 2h-2" fill="currentColor"/> <path d="m9 15 3-3 3 3" fill="currentColor"/> <path d="M12 12v9" fill="currentColor"/>`,information:`<circle cx="12" cy="12" r="10" /> <path d="M12 16v-4" /> <path d="M12 8h.01" />`,"information-fill":`<path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 11V17H13V11H11ZM11 7V9H13V7H11Z" fill="currentColor" stroke="none"/>`,key:`<path d="m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4" /> <path d="m21 2-9.6 9.6" /> <circle cx="7.5" cy="15.5" r="5.5" />`,"layout-column":`<rect width="18" height="18" x="3" y="3" rx="2" /> <path d="M12 3v18" />`,"layout-left":`<rect width="18" height="18" x="3" y="3" rx="2" /> <path d="M9 3v18" />`,"layout-left-rounded":`<rect width="18" height="18" x="3" y="3" rx="4" /><path d="M9.5 3v18" />`,"layout-right":`<rect width="18" height="18" x="3" y="3" rx="2" /> <path d="M15 3v18" />`,leaf:`<path d="M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z" /> <path d="M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12" />`,lightbulb:`<path d="M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5" /> <path d="M9 18h6" /> <path d="M10 22h4" />`,"link-unlink-m":`<path d="m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71" /> <path d="m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71" /> <line x1="8" x2="8" y1="2" y2="5" /> <line x1="2" x2="5" y1="8" y2="8" /> <line x1="16" x2="16" y1="19" y2="22" /> <line x1="19" x2="22" y1="16" y2="16" />`,"list-check-2":`<path d="M13 5h8" /> <path d="M13 12h8" /> <path d="M13 19h8" /> <path d="m3 17 2 2 4-4" /> <path d="m3 7 2 2 4-4" />`,"list-check-3":`<path d="M13 5h8" /> <path d="M13 12h8" /> <path d="M13 19h8" /> <path d="m3 17 2 2 4-4" /> <rect x="3" y="4" width="6" height="6" rx="1" />`,"list-unordered":`<path d="M3 5h.01" /> <path d="M3 12h.01" /> <path d="M3 19h.01" /> <path d="M8 5h13" /> <path d="M8 12h13" /> <path d="M8 19h13" />`,loader:`<path d="M12 2v4" /> <path d="m16.2 7.8 2.9-2.9" /> <path d="M18 12h4" /> <path d="m16.2 16.2 2.9 2.9" /> <path d="M12 18v4" /> <path d="m4.9 19.1 2.9-2.9" /> <path d="M2 12h4" /> <path d="m4.9 4.9 2.9 2.9" />`,"loader-4":`<path d="M21 12a9 9 0 1 1-6.219-8.56" />`,lock:`<rect width="18" height="11" x="3" y="11" rx="2" ry="2" /> <path d="M7 11V7a5 5 0 0 1 10 0v4" />`,"lock-2":`<rect width="18" height="11" x="3" y="11" rx="2" ry="2" /> <path d="M7 11V7a5 5 0 0 1 10 0v4" />`,"lock-unlock":`<rect width="18" height="11" x="3" y="11" rx="2" ry="2" /> <path d="M7 11V7a5 5 0 0 1 9.9-1" />`,"loop-right-ai":`<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" /> <path d="M21 3v5h-5" /> <path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" /> <path d="M8 16H3v5" />`,macbook:`<path d="M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z" /> <path d="M20.054 15.987H3.946" />`,"menu-2":`<path d="M4 5h16" /> <path d="M4 12h16" /> <path d="M4 19h16" />`,"menu-fold-2":`<rect width="18" height="18" x="3" y="3" rx="2" /> <path d="M9 3v18" /> <path d="m16 15-3-3 3-3" />`,"menu-search":`<path d="m21 21-4.34-4.34" /> <circle cx="11" cy="11" r="8" />`,mic:`<path d="M12 19v3" /> <path d="M19 10v2a7 7 0 0 1-14 0v-2" /> <rect x="9" y="2" width="6" height="13" rx="3" />`,"mic-fill":`<path d="M11.9998 1C14.7612 1 16.9998 3.23858 16.9998 6V10C16.9998 12.7614 14.7612 15 11.9998 15C9.23833 15 6.99976 12.7614 6.99976 10V6C6.99976 3.23858 9.23833 1 11.9998 1ZM3.05469 11H5.07065C5.55588 14.3923 8.47329 17 11.9998 17C15.5262 17 18.4436 14.3923 18.9289 11H20.9448C20.4837 15.1716 17.1714 18.4839 12.9998 18.9451V23H10.9998V18.9451C6.82814 18.4839 3.51584 15.1716 3.05469 11Z" fill="currentColor" stroke="none"/>`,more:`<circle cx="12" cy="12" r="1" /> <circle cx="19" cy="12" r="1" /> <circle cx="5" cy="12" r="1" />`,"more-2":`<circle cx="12" cy="12" r="1" /> <circle cx="19" cy="12" r="1" /> <circle cx="5" cy="12" r="1" />`,"more-2-fill":`<circle cx="12" cy="12" r="1" fill="currentColor"/> <circle cx="19" cy="12" r="1" fill="currentColor"/> <circle cx="5" cy="12" r="1" fill="currentColor"/>`,music:`<path d="M9 18V5l12-2v13" /> <circle cx="6" cy="18" r="3" /> <circle cx="18" cy="16" r="3" />`,"node-tree":`<rect x="9" y="3" width="6" height="5" rx="2" /><path d="M12 8v1.5c0 4-6 2-6 6.5M12 9.5c0 4 6 2 6 6.5" /><rect x="3" y="16" width="6" height="5" rx="2" /><rect x="15" y="16" width="6" height="5" rx="2" />`,"notification-3":`<path d="M10.268 21a2 2 0 0 0 3.464 0" /> <path d="M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326" />`,palette:`<path d="M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z" /> <circle cx="13.5" cy="6.5" r=".5" fill="currentColor" /> <circle cx="17.5" cy="10.5" r=".5" fill="currentColor" /> <circle cx="6.5" cy="12.5" r=".5" fill="currentColor" /> <circle cx="8.5" cy="7.5" r=".5" fill="currentColor" />`,pause:`<path d="M6 5H8V19H6V5ZM16 5H18V19H16V5Z" fill="currentColor" stroke="none"/>`,"pause-circle":`<circle cx="12" cy="12" r="10" /> <line x1="10" x2="10" y1="15" y2="9" /> <line x1="14" x2="14" y1="15" y2="9" />`,pencil:`<path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" /> <path d="m15 5 4 4" />`,"pencil-ai":`<path d="M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z" /> <path d="M20 2v4" /> <path d="M22 4h-4" /> <circle cx="4" cy="20" r="2" />`,"pencil-ai-2":`<path d="M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z" /> <path d="M20 2v4" /> <path d="M22 4h-4" /> <circle cx="4" cy="20" r="2" />`,"picture-in-picture-2":`<path d="M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4" /> <rect width="10" height="7" x="12" y="13" rx="2" />`,"pie-chart":`<path d="M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z" /> <path d="M21.21 15.89A10 10 0 1 1 8 2.83" />`,play:`<path d="M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z" />`,"play-list-add":`<path d="M16 5H3" /> <path d="M11 12H3" /> <path d="M16 19H3" /> <path d="M18 9v6" /> <path d="M21 12h-6" />`,plug:`<path d="M12 22v-5" /> <path d="M15 8V2" /> <path d="M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z" /> <path d="M9 8V2" />`,"plug-2":`<path d="M12 22v-5" /> <path d="M15 8V2" /> <path d="M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z" /> <path d="M9 8V2" />`,pulse:`<path d="M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2" />`,pushpin:`<path d="M12 17v5" /> <path d="M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z" />`,"pushpin-2":`<path d="M12 17v5" /> <path d="M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z" />`,"pushpin-2-fill":`<path d="M22.3126 10.1753L20.8984 11.5895L20.1913 10.8824L15.9486 15.125L15.2415 18.6606L13.8273 20.0748L9.58466 15.8321L4.63492 20.7819L3.2207 19.3677L8.17045 14.4179L3.92781 10.1753L5.34202 8.76107L8.87756 8.05396L13.1202 3.81132L12.4131 3.10422L13.8273 1.69L22.3126 10.1753Z" fill="currentColor" />`,question:`<circle cx="12" cy="12" r="10" /> <path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" /> <path d="M12 17h.01" />`,"record-circle":`<circle cx="12" cy="12" r="10" /> <circle cx="12" cy="12" r="1" />`,refresh:`<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" /> <path d="M21 3v5h-5" /> <path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" /> <path d="M8 16H3v5" />`,restart:`<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" /> <path d="M3 3v5h5" />`,robot:`<path d="M12 8V4H8" /> <rect width="16" height="12" x="4" y="8" rx="2" /> <path d="M2 14h2" /> <path d="M20 14h2" /> <path d="M15 13v2" /> <path d="M9 13v2" />`,"robot-2":`<path d="M12 8V4H8" /> <rect width="16" height="12" x="4" y="8" rx="2" /> <path d="M2 14h2" /> <path d="M20 14h2" /> <path d="M15 13v2" /> <path d="M9 13v2" />`,rocket:`<path d="M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5" /> <path d="M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09" /> <path d="M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z" /> <path d="M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05" />`,"save-3":`<path d="M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z" /> <path d="M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7" /> <path d="M7 3v4a1 1 0 0 0 1 1h7" />`,"scales-3":`<path d="M12 3v18" /> <path d="m19 8 3 8a5 5 0 0 1-6 0zV7" /> <path d="M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1" /> <path d="m5 8 3 8a5 5 0 0 1-6 0zV7" /> <path d="M7 21h10" />`,"scan-2":`<path d="M3 7V5a2 2 0 0 1 2-2h2" /> <path d="M17 3h2a2 2 0 0 1 2 2v2" /> <path d="M21 17v2a2 2 0 0 1-2 2h-2" /> <path d="M7 21H5a2 2 0 0 1-2-2v-2" />`,scissors:`<circle cx="6" cy="6" r="3" /> <path d="M8.12 8.12 12 12" /> <path d="M20 4 8.12 15.88" /> <circle cx="6" cy="18" r="3" /> <path d="M14.8 14.8 20 20" />`,search:`<path d="m21 21-4.34-4.34" /> <circle cx="11" cy="11" r="8" />`,"search-eye":`<path d="M3 7V5a2 2 0 0 1 2-2h2" /> <path d="M17 3h2a2 2 0 0 1 2 2v2" /> <path d="M21 17v2a2 2 0 0 1-2 2h-2" /> <path d="M7 21H5a2 2 0 0 1-2-2v-2" /> <circle cx="12" cy="12" r="3" /> <path d="m16 16-1.9-1.9" />`,"send-plane":`<path d="M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z" /> <path d="m21.854 2.147-10.94 10.939" />`,"send-plane-2":`<path d="M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z" /> <path d="M6 12h16" />`,server:`<rect width="20" height="8" x="2" y="2" rx="2" ry="2" /> <rect width="20" height="8" x="2" y="14" rx="2" ry="2" /> <line x1="6" x2="6.01" y1="6" y2="6" /> <line x1="6" x2="6.01" y1="18" y2="18" />`,"settings-2":`<path d="M14 17H5" /> <path d="M19 7h-9" /> <circle cx="17" cy="17" r="3" /> <circle cx="7" cy="7" r="3" />`,"settings-3":`<path d="M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" /> <circle cx="12" cy="12" r="3" />`,"share-2":`<path d="M12 2v13" /> <path d="m16 6-4-4-4 4" /> <path d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8" />`,shield:`<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" />`,"shield-check":`<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" /> <path d="m9 12 2 2 4-4" />`,"shield-keyhole":`<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" />`,"shield-user":`<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" /> <path d="M6.376 18.91a6 6 0 0 1 11.249.003" /> <circle cx="12" cy="11" r="4" />`,shuffle:`<path d="m18 14 4 4-4 4" /> <path d="m18 2 4 4-4 4" /> <path d="M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22" /> <path d="M2 6h1.972a4 4 0 0 1 3.6 2.2" /> <path d="M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45" />`,"slash-commands-2":`<path d="M12 19h8" /> <path d="m4 17 6-6-6-6" />`,smartphone:`<rect width="14" height="20" x="5" y="2" rx="2" ry="2" /> <path d="M12 18h.01" />`,sparkling:`<path d="M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z" /> <path d="M20 2v4" /> <path d="M22 4h-4" /> <circle cx="4" cy="20" r="2" />`,"split-cells-horizontal":`<path d="M8 19H5c-1 0-2-1-2-2V7c0-1 1-2 2-2h3" /> <path d="M16 5h3c1 0 2 1 2 2v10c0 1-1 2-2 2h-3" /> <line x1="12" x2="12" y1="4" y2="20" />`,stack:`<path d="M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z" /> <path d="M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12" /> <path d="M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17" />`,star:`<path d="M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z" />`,"star-fill":`<path d="M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z" fill="currentColor"/>`,"sticky-note":`<path d="M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z" /> <path d="M15 3v5a1 1 0 0 0 1 1h5" />`,stop:`<rect width="18" height="18" x="3" y="3" rx="2" />`,"stop-circle":`<circle cx="12" cy="12" r="9" /><rect x="9.25" y="9.25" width="5.5" height="5.5" rx="1.25" />`,subtract:`<path d="M5 12h14" />`,survey:`<rect width="8" height="4" x="8" y="2" rx="1" ry="1" /> <path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2" /> <path d="M12 11h4" /> <path d="M12 16h4" /> <path d="M8 11h.01" /> <path d="M8 16h.01" />`,target:`<circle cx="12" cy="12" r="10" /> <circle cx="12" cy="12" r="6" /> <circle cx="12" cy="12" r="2" />`,task:`<path d="M21.801 10A10 10 0 1 1 17 3.335" /> <path d="m9 11 3 3L22 4" />`,terminal:`<path d="M12 19h8" /> <path d="m4 17 6-6-6-6" />`,"terminal-box":`<path d="M12 19h8" /> <path d="m4 17 6-6-6-6" />`,"terminal-window":`<path d="m7 11 2-2-2-2" /> <path d="M11 13h4" /> <rect width="18" height="18" x="3" y="3" rx="2" ry="2" />`,text:`<path d="M12 4v16" /> <path d="M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2" /> <path d="M9 20h6" />`,"text-wrap":`<path d="m16 16-3 3 3 3" /> <path d="M3 12h14.5a1 1 0 0 1 0 7H13" /> <path d="M3 19h6" /> <path d="M3 5h18" />`,time:`<circle cx="12" cy="12" r="9" /><path d="M12 7v5.25l3.25 1.75" />`,timer:`<line x1="10" x2="14" y1="2" y2="2" /> <line x1="12" x2="15" y1="14" y2="11" /> <circle cx="12" cy="14" r="8" />`,tools:`<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z" />`,"twitter-xfill":`<path d="M17.6874 3.0625L12.6907 8.77425L8.37045 3.0625H2.11328L9.58961 12.8387L2.50378 20.9375H5.53795L11.0068 14.6886L15.7863 20.9375H21.8885L14.095 10.6342L20.7198 3.0625H17.6874ZM16.6232 19.1225L5.65436 4.78217H7.45745L18.3034 19.1225H16.6232Z" fill="currentColor"/>`,unpin:`<path d="M12 17v5" /> <path d="M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89" /> <path d="m2 2 20 20" /> <path d="M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11" />`,user:`<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> <circle cx="12" cy="7" r="4" />`,"user-3":`<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> <circle cx="12" cy="7" r="4" />`,"video-chat":`<path d="m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5" /> <rect x="2" y="6" width="14" height="12" rx="2" />`,"volume-up":`<path d="M11.5 4.25a.75.75 0 0 0-1.25-.56L6 7.5H3.5A1.5 1.5 0 0 0 2 9v6a1.5 1.5 0 0 0 1.5 1.5H6l4.25 3.81a.75.75 0 0 0 1.25-.56Z" /><path d="M16 8a6 6 0 0 1 0 8M19 4.5a10.5 10.5 0 0 1 0 15" />`,"volume-up-fill":`<path d="M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z" fill="currentColor" stroke="none"/>`,window:`<rect x="2" y="4" width="20" height="16" rx="2" /> <path d="M10 4v4" /> <path d="M2 8h20" /> <path d="M6 4v4" />`},o=n(),s=`yuri-icon-sprite-v2`,c=1.5,l=(()=>{let e=2166136261;for(let[t,n]of Object.entries(a)){let r=`${t}:${n};`;for(let t=0;t<r.length;t+=1)e=Math.imul(e^r.charCodeAt(t),16777619)}return(e>>>0).toString(36)})(),u=!1,d=new Set,f=null;function p(e){if(u&&d.has(e)&&f===l||typeof document>`u`)return;let t=document.body;if(!t)return;let n=document.getElementById(s);if(n){let t=new Set(Array.from(n.querySelectorAll(`symbol[id^="yuri-"]`),e=>e.id.slice(3)));if(!n.innerHTML.includes(`--yuri-icon-stroke`)||n.dataset.spriteSignature!==l||!t.has(e))n.remove();else{u=!0,d=t,f=l;return}}let r=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);r.id=s,r.setAttribute(`aria-hidden`,`true`),r.dataset.spriteSignature=l,r.style.display=`none`,r.innerHTML=Object.entries(a).map(([e,t])=>`<symbol id="yuri-${e}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--yuri-icon-stroke, ${c})" stroke-linecap="round" stroke-linejoin="round">${t}</symbol>`).join(``),t.insertBefore(r,t.firstChild),u=!0,d=new Set(Object.keys(a)),f=l}var m=i.memo(({name:e,className:t,weight:n=`regular`,style:i,...a})=>{typeof document<`u`&&p(e);let s=n===`medium`?2:c;return(0,o.jsx)(`svg`,{className:r(`yuri-icon`,t),viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,stroke:`currentColor`,strokeWidth:s,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{"--yuri-icon-stroke":s,...i},...a,children:(0,o.jsx)(`use`,{href:`#yuri-${e}`})})});m.displayName=`Icon`;export{m as n,a as r,c as t};
@@ -1,10 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{_ as t,t as n,v as r,w as i}from"./runtime-auth-ef9W7A43.js";import{c as a,i as o}from"./runtime-switch-CAZiOV2G.js";import{n as s}from"./runtime-fetch-BAN5Gnnp.js";import{C as c}from"./desktop-dp2Z0toS.js";import{t as l}from"./runtimeAPIRegistry-C2VogTny.js";import{it as u,nt as d,rt as f}from"./vendor-base-ui-CdzJ6My_.js";import{_ as p}from"./useUIStore-NMQx_cnG.js";import{n as m}from"./vendor-react-BP2cRVqX.js";import{s as h}from"./vendor-tanstack-react-query-CdqCAt40.js";import{c as g,f as _,o as v,s as y}from"./runtime-file-resource-D3k0hKDj.js";import{a as b,n as x}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{n as S,t as C}from"./runtime-file-download-BzblfnMx.js";import{n as w}from"./platform-syRnKuVU.js";import{a as T,i as E}from"./vendor-pierre-diffs-DPBtNDJ5.js";import{r as D}from"./vendor-reactuses-core-BJ-jJ4YM.js";import{f as O,r as k,t as A}from"./button-DFX-UCuQ.js";import{n as j,t as ee}from"./useThemeSystem-8jhE4Zyk.js";import{n as M}from"./Icon-C1nXIg7J.js";import{n as N,t as te}from"./dialog-jQrYy1B7.js";import{a as P,c as F,d as I,i as L,o as ne}from"./image-loading-FUFYiO1j.js";import{t as re}from"./MobileWindowStack-DGLdgoGr.js";import{t as ie}from"./appThemeRegistry-Br3aTf8c.js";import{a as ae,n as R}from"./MarkdownRenderer-CYvVcdhy.js";import{a as oe}from"./toolHelpers-DL452NVK.js";import{n as se}from"./useEffectiveDirectory-DvnOvqoO.js";import{t as ce}from"./ImageLoadingPlaceholder-B5t9zOYn.js";import{d as le,f as z,g as B,h as ue,l as V,m as de,n as H,p as U,r as W,s as G,t as fe,u as pe}from"./useWorkerHighlightedLines-Ez7d_RoZ.js";import{t as me}from"./vendor-tanstack-react-virtual-B_EO--9t.js";import{n as he}from"./markdownTheme-DHoKvD6O.js";import{n as ge}from"./mobileBackNavigation-DCfPeDp4.js";var K=m(),q=e(u(),1),J=f(),_e=80,Y=20,ve=q.memo(e=>{let t=(0,K.c)(26),{lines:n,language:r,maxHeight:i,showLineNumbers:a,lineStyles:o}=e,s=i===void 0?`60vh`:i,c=a===void 0||a,{currentTheme:l}=j(),u;t[0]===l?u=t[1]:(u=he(l),t[0]=l,t[1]=u);let d=u,f;t[2]===n?f=t[3]:(f=n.map(be).join(`
2
- `),t[2]=n,t[3]=f);let p=fe(f,r);if(!(n.length>_e)){let e=d,r;t[4]!==s||t[5]!==e?(r={...e,maxHeight:s,overflow:`auto`},t[4]=s,t[5]=e,t[6]=r):r=t[6];let i;if(t[7]!==p||t[8]!==o||t[9]!==n||t[10]!==c){let e;t[12]!==p||t[13]!==o||t[14]!==c?(e=(e,t)=>(0,J.jsx)(X,{line:e,html:p?.[t],showLineNumbers:c,style:o?.(e)},t),t[12]=p,t[13]=o,t[14]=c,t[15]=e):e=t[15],i=n.map(e),t[7]=p,t[8]=o,t[9]=n,t[10]=c,t[11]=i}else i=t[11];let a;return t[16]!==r||t[17]!==i?(a=(0,J.jsx)(`div`,{className:`typography-code font-mono w-full min-w-0`,style:r,children:i}),t[16]=r,t[17]=i,t[18]=a):a=t[18],a}let m;return t[19]!==p||t[20]!==o||t[21]!==n||t[22]!==s||t[23]!==c||t[24]!==d?(m=(0,J.jsx)(ye,{lines:n,highlighted:p,syntaxVars:d,maxHeight:s,showLineNumbers:c,lineStyles:o}),t[19]=p,t[20]=o,t[21]=n,t[22]=s,t[23]=c,t[24]=d,t[25]=m):m=t[25],m});ve.displayName=`VirtualizedCodeBlock`;var ye=q.memo(({lines:e,highlighted:t,syntaxVars:n,maxHeight:r,showLineNumbers:i,lineStyles:a})=>{let o=q.useRef(null),s=`min(${e.length*Y}px, ${r})`,c=me({count:e.length,getScrollElement:()=>o.current,estimateSize:()=>Y,overscan:20}),l=c.getVirtualItems();return(0,J.jsx)(`div`,{ref:o,className:`typography-code font-mono w-full min-w-0`,style:{...n,height:s,maxHeight:r,overflow:`auto`},children:(0,J.jsx)(`div`,{style:{height:c.getTotalSize(),position:`relative`},children:l.map(n=>{let r=e[n.index];return r?(0,J.jsx)(`div`,{"data-index":n.index,ref:c.measureElement,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${n.start}px)`},children:(0,J.jsx)(X,{line:r,html:t?.[n.index],showLineNumbers:i,style:a?.(r)})},n.index):null})})})});ye.displayName=`VirtualizedRows`;var X=q.memo(e=>{let t=(0,K.c)(12),{line:n,html:r,showLineNumbers:i,style:a}=e,o;t[0]!==n.isInfo||t[1]!==n.lineNumber||t[2]!==i?(o=i&&(0,J.jsx)(`span`,{className:`w-10 flex-shrink-0 text-right pr-3 select-none border-r mr-3 -my-0.5 py-0.5`,style:{color:`var(--tools-edit-line-number)`,borderColor:`var(--tools-border)`},children:!n.isInfo&&n.lineNumber!=null?n.lineNumber:``}),t[0]=n.isInfo,t[1]=n.lineNumber,t[2]=i,t[3]=o):o=t[3];let s;t[4]!==r||t[5]!==n.isInfo||t[6]!==n.text?(s=(0,J.jsx)(`div`,{className:`flex-1 min-w-0`,children:n.isInfo?(0,J.jsx)(`div`,{className:`whitespace-pre-wrap break-words text-muted-foreground/70 italic`,children:n.text}):r===void 0?(0,J.jsx)(`div`,{className:`whitespace-pre`,children:n.text}):(0,J.jsx)(`div`,{className:`whitespace-pre`,dangerouslySetInnerHTML:{__html:r}})}),t[4]=r,t[5]=n.isInfo,t[6]=n.text,t[7]=s):s=t[7];let c;return t[8]!==a||t[9]!==o||t[10]!==s?(c=(0,J.jsxs)(`div`,{className:`typography-code font-mono flex w-full min-w-0`,style:a,children:[o,s]}),t[8]=a,t[9]=o,t[10]=s,t[11]=c):c=t[11],c});X.displayName=`VirtualizedCodeBlock.Row`;function be(e){return e.text}var xe=q.memo(function({jsonString:e,className:t,maxHeight:n=`100%`,initiallyExpandedDepth:r=2}){let{t:i}=O(),a=q.useRef(null),[o,s]=q.useState(null),c=q.useMemo(()=>{try{let t=e.trim();if(!t)return s(i(`jsonTreeView.error.emptyJson`)),null;let n=JSON.parse(t);return s(null),n}catch(e){return s(e instanceof Error?e.message:i(`jsonTreeView.error.invalidJson`)),null}},[e,i]),l=q.useCallback(()=>{a.current?.expandAll()},[]),u=q.useCallback(()=>{a.current?.collapseAll()},[]);return o?(0,J.jsx)(`div`,{className:t,children:(0,J.jsxs)(`div`,{className:`rounded-md border border-[var(--interactive-border)] bg-[var(--syntax-base-background)] p-4`,children:[(0,J.jsx)(`div`,{className:`mb-1 font-medium text-[var(--surface-foreground)]`,children:i(`jsonTreeView.error.invalidJsonTitle`)}),(0,J.jsx)(`div`,{className:`font-mono text-xs text-[var(--surface-mutedForeground)]`,children:o})]})}):c===null?null:(0,J.jsxs)(`div`,{className:t,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-1 border-b border-[var(--interactive-border)] px-2 py-1`,children:[(0,J.jsxs)(A,{variant:`ghost`,size:`xs`,onClick:l,className:`gap-1 text-xs text-muted-foreground`,children:[(0,J.jsx)(M,{name:`arrow-down-s`,className:`h-3 w-3`}),i(`jsonTreeView.actions.expandAll`)]}),(0,J.jsxs)(A,{variant:`ghost`,size:`xs`,onClick:u,className:`gap-1 text-xs text-muted-foreground`,children:[(0,J.jsx)(M,{name:`arrow-up-s`,className:`h-3 w-3`}),i(`jsonTreeView.actions.collapseAll`)]})]}),(0,J.jsx)(`div`,{className:`bg-[var(--syntax-base-background)] py-1`,style:{maxHeight:n,overflow:`auto`},children:(0,J.jsx)(W,{ref:a,data:c,maxHeight:n,initiallyExpandedDepth:r})})]})}),Se=class extends Error{key;params;constructor(e,t){super(e),this.name=`MermaidLoadFailure`,this.key=e,this.params=t}},Ce=(e,t)=>new Se(e,t),we=e=>e instanceof Se,Te=e=>e+1,Ee=(e,t)=>e===t,De=e=>{let t=e.indexOf(`,`);if(t<0)throw Ce(`chat.toolOutputDialog.mermaid.dataUrlMalformed`);let n=e.slice(0,t).toLowerCase(),r=e.slice(t+1);return n.includes(`;base64`)?atob(r):decodeURIComponent(r)},Oe=e=>Promise.resolve().then(()=>De(e)),ke=1,Ae=56,Z=(e,t,n)=>Math.min(n,Math.max(t,e)),je=({isMobile:e,pointerType:t,cancelled:n,moved:r,suppressTap:i,targetWasCanvas:a,start:o,end:s,startScale:c,hasMultipleImages:l})=>{if(n||i)return`none`;let u={x:s.x-o.x,y:s.y-o.y},d=Math.hypot(u.x,u.y),f=t!==`mouse`;if(e&&f&&c<=1.01&&Math.abs(u.x)>=Ae&&Math.abs(u.x)>Math.abs(u.y)*1.2)return l?u.x<0?`next`:`previous`:`none`;let p=!r&&d<=10;return e&&f&&p||!e&&t===`mouse`&&p&&a?`close`:`none`},Me=(e,t)=>{if(e.width<=0||e.height<=0||t.width<=0||t.height<=0)return{width:1,height:1};let n=Math.min(t.width/e.width,t.height/e.height);return{width:Math.max(1,e.width*n),height:Math.max(1,e.height*n)}},Q=(e,t)=>{let n=t.minScale??ke,r=t.maxScale??5,i=Z(e.scale,n,r),a=Math.max(0,(t.image.width*i-t.viewport.width)/2),o=Math.max(0,(t.image.height*i-t.viewport.height)/2);return{scale:i,x:Z(e.x,-a,a),y:Z(e.y,-o,o)}},Ne=(e,t,n,r,i)=>{let a=Z(t,i.minScale??ke,i.maxScale??5),o=a/e.scale;return Q({scale:a,x:n.x-r.x-(n.x-r.x-e.x)*o,y:n.y-r.y-(n.y-r.y-e.y)*o},i)},Pe=(e,t,n)=>Q({...e,x:e.x+t.x,y:e.y+t.y},n),Fe=(e,t,n,r,i,a)=>{let o=Z(r,a.minScale??ke,a.maxScale??5),s=o/e.scale;return Q({scale:o,x:n.x-i.x-(t.x-i.x-e.x)*s,y:n.y-i.y-(t.y-i.y-e.y)*s},a)},Ie=500,Le=24,Re=(e,t={})=>{let n=t.target??(typeof document>`u`?null:document);if(!n)return()=>{};let r=t.durationMs??Ie,i=t.maxDistance??Le,a=!0,o,s=()=>{a&&(a=!1,n.removeEventListener(`click`,c,!0),o!==void 0&&globalThis.clearTimeout(o))},c=t=>{let n=t;typeof n.clientX==`number`&&typeof n.clientY==`number`&&(Math.hypot(n.clientX-e.x,n.clientY-e.y)>i||(s(),t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()))};return n.addEventListener(`click`,c,!0),o=globalThis.setTimeout(s,r),s},ze=(e,t,n={})=>{Re(e,n),t()},Be=e(d(),1);function Ve(e,t,n,r,i){let a=e instanceof HTMLImageElement?e:e.querySelector(`img`);if(!a||!t.complete||!t.naturalWidth||!t.animate)return;let o=t.getBoundingClientRect(),s=a.getBoundingClientRect();if(!o.width||!o.height||!s.width||!s.height)return;let c=getComputedStyle(a),l=t.naturalWidth/t.naturalHeight,u=c.objectFit===`cover`?Math.max(s.width,s.height*l):Math.min(s.width,s.height*l),d=u/l,f=c.objectPosition.split(` `);if(!f.every(e=>e.endsWith(`%`)))return;let p=(s.width-u)*parseFloat(f[0])/100,m=(s.height-d)*parseFloat(f[1]??f[0])/100,h=s.left,g=s.top,_=s.right,v=s.bottom,y=c.borderRadius;for(let e=a.parentElement;e;e=e.parentElement){let t=getComputedStyle(e),n=e.getBoundingClientRect();[`hidden`,`clip`,`auto`,`scroll`].includes(t.overflowX)&&(h=Math.max(h,n.left),_=Math.min(_,n.right)),[`hidden`,`clip`,`auto`,`scroll`].includes(t.overflowY)&&(g=Math.max(g,n.top),v=Math.min(v,n.bottom)),n.width===s.width&&n.height===s.height&&t.borderRadius!==`0px`&&(y=t.borderRadius)}if(_<=h||v<=g)return;let b=document.createElement(`div`);b.dataset.mediaCropAnimation=``,b.setAttribute(`aria-hidden`,`true`),Object.assign(b.style,{position:`fixed`,left:`0`,top:`0`,overflow:`hidden`,pointerEvents:`none`,zIndex:`51`,contain:`paint`});let x=document.createElement(`img`);x.src=t.currentSrc||t.src,x.alt=``,Object.assign(x.style,{display:`block`,width:`${o.width}px`,height:`${o.height}px`,maxWidth:`none`,transformOrigin:`0 0`}),b.append(x),document.body.append(b);let S={transform:`translate(${o.left}px, ${o.top}px)`,width:`${o.width}px`,height:`${o.height}px`,borderRadius:`0px`},C={transform:`translate(${h}px, ${g}px)`,width:`${_-h}px`,height:`${v-g}px`,borderRadius:y},w={transform:`translate(0px, 0px) scale(1)`},T={transform:`translate(${s.left+p-h}px, ${s.top+m-g}px) scale(${u/o.width})`},E={duration:280,easing:`cubic-bezier(0.2, 0, 0, 1)`,fill:`both`},D=t.style.visibility;t.style.visibility=`hidden`;let O=[b.animate(r?[S,C]:[C,S],E),x.animate(r?[w,T]:[T,w],E),n.animate({opacity:r?[1,0]:[0,1]},E)],k=!1,A=(e=!1)=>{b.remove(),t.style.visibility=D,O.forEach((t,n)=>{(!e||n!==2)&&t.cancel()})};return Promise.all(O.map(e=>e.finished)).then(()=>{k||(A(r),i())},()=>{k||(A(),i())}),()=>{k=!0,A()}}function He(e,t,n,r,i=()=>{}){let a=e?.getBoundingClientRect(),o=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;if(!o&&e?.isConnected&&t instanceof HTMLImageElement&&n&&a?.width&&a.height&&a.bottom>0&&a.top<window.innerHeight&&a.right>0&&a.left<window.innerWidth){let a=Ve(e,t,n,r,i);if(a)return a}if(!document.startViewTransition||o||!e?.isConnected||!t||!n||!a?.width||!a.height||a.bottom<=0||a.top>=window.innerHeight||a.right<=0||a.left>=window.innerWidth){if(!n?.animate||o)return i(),()=>{};let e=n.animate({opacity:r?[1,0]:[0,1]},{duration:150,fill:`forwards`}),t=!1;return e.finished.then(()=>{t||i()},()=>{}),()=>{t=!0,e.cancel()}}let s=e.style.viewTransitionName,c=t.style.viewTransitionName,l=n.style.visibility,u=!1,d=`yuri-media-preview`;e.style.viewTransitionName=r?`none`:d,t.style.viewTransitionName=r?d:`none`,r||(n.style.visibility=`hidden`);let f=document.startViewTransition(()=>{u||(e.style.viewTransitionName=r?d:`none`,t.style.viewTransitionName=r?`none`:d,n.style.visibility=r?`hidden`:l)}),p=()=>{e.style.viewTransitionName=s,t.style.viewTransitionName=c,n.style.visibility=l};f.ready.catch(()=>{});let m=()=>{u||(p(),i())};return f.finished.then(m,m),()=>{u=!0,f.skipTransition(),p()}}function Ue(e){let t=(0,K.c)(12),{onClose:n,isMobile:r,size:i}=e,{t:a}=O(),o;t[0]!==r||t[1]!==i?(o=r?{top:`calc(var(--yuri-safe-area-top, 0px) + 0.5rem)`,right:`calc(var(--yuri-safe-area-right, 0px) + 0.75rem)`}:{top:i?`calc(50% - ${i.height/2}px + 0.5rem)`:`0.5rem`,right:i?`calc(50% - ${i.width/2}px + 0.5rem)`:`0.5rem`},t[0]=r,t[1]=i,t[2]=o):o=t[2];let s;t[3]===a?s=t[4]:(s=a(`dialog.common.actions.close`),t[3]=a,t[4]=s);let c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,J.jsx)(M,{name:`close`,className:`size-5`}),t[5]=c):c=t[5];let l;t[6]!==n||t[7]!==s?(l=(0,J.jsx)(A,{variant:`mobileGlass`,size:`mobileIcon`,"aria-label":s,onClick:n,children:c}),t[6]=n,t[7]=s,t[8]=l):l=t[8];let u;return t[9]!==o||t[10]!==l?(u=(0,J.jsx)(`div`,{className:`absolute right-3 z-20`,style:o,children:l}),t[9]=o,t[10]=l,t[11]=u):u=t[11],u}function We(e){let t=(0,K.c)(9),{children:n,isMobile:r}=e,i;t[0]===r?i=t[1]:(i=r?{bottom:`calc(var(--yuri-safe-area-bottom, 0px) + 0.75rem)`,right:`calc(var(--yuri-safe-area-right, 0px) + 0.75rem)`}:{bottom:`1rem`,left:`1rem`},t[0]=r,t[1]=i);let a=r?`mobile`:`desktop`,o=`pointer-events-auto flex items-center text-[var(--yuri-media-preview-foreground)] ${r?`gap-1.5`:`gap-2`}`,s;t[2]!==n||t[3]!==a||t[4]!==o?(s=(0,J.jsx)(`div`,{"data-media-preview-toolbar":a,className:o,onPointerDown:Ke,onDoubleClick:Ge,children:n}),t[2]=n,t[3]=a,t[4]=o,t[5]=s):s=t[5];let c;return t[6]!==i||t[7]!==s?(c=(0,J.jsx)(`div`,{className:`pointer-events-none absolute z-20`,style:i,children:s}),t[6]=i,t[7]=s,t[8]=c):c=t[8],c}function Ge(e){return e.stopPropagation()}function Ke(e){return e.stopPropagation()}function qe(e){let t=(0,K.c)(28),{open:n,title:r,kind:i,source:a,isMobile:o,onOpenChange:s,children:c}=e,l=q.useRef(null),u=q.useId(),d=q.useRef(null),f=q.useRef(!1),[p,m]=q.useState(!1),h;t[0]!==s||t[1]!==a?(h=()=>{if(f.current)return;f.current=!0,d.current?.();let e=l.current?.querySelector(`[data-preview-transition-target]`)??null;d.current=He(e?.dataset.previewReturn===`false`?void 0:a,e,l.current,!0,()=>{m(!0),s(!1)})},t[0]=s,t[1]=a,t[2]=h):h=t[2];let g=D(h),_=`${i}-preview`,v=n&&!p&&o,y;t[3]!==g||t[4]!==_||t[5]!==v?(y={id:_,active:v,layer:`overlay`,onBack:g,surfaceRef:l},t[3]=g,t[4]=_,t[5]=v,t[6]=y):y=t[6],ge(y);let b,x;if(t[7]!==g||t[8]!==p||t[9]!==o||t[10]!==u||t[11]!==n||t[12]!==a?(b=()=>{if(!n){m(!1),f.current=!1;return}if(p)return;let e=l.current,t=document.activeElement instanceof HTMLElement?document.activeElement:null,r=o?re.add({id:u,onClose:g},document.body):void 0;return e?.querySelector(`button`)?.focus({preventScroll:!0}),d.current=He(a,e?.querySelector(`[data-preview-transition-target]`)??null,e,!1),()=>{d.current?.(),d.current=null,f.current=!1,r?.(),t?.isConnected&&t.focus({preventScroll:!0})}},x=[p,n,a,o,u,g],t[7]=g,t[8]=p,t[9]=o,t[10]=u,t[11]=n,t[12]=a,t[13]=b,t[14]=x):(b=t[13],x=t[14]),q.useLayoutEffect(b,x),!n||p||typeof document>`u`)return null;let S=o?`var(--yuri-media-preview-background)`:`color-mix(in srgb, var(--yuri-media-preview-background) ${i===`mermaid`?90:70}%, transparent)`,C;t[15]===S?C=t[16]:(C={backgroundColor:S,color:`var(--yuri-media-preview-foreground)`},t[15]=S,t[16]=C);let w;t[17]===g?w=t[18]:(w=e=>{if(!e.currentTarget.contains(e.target)||(e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),g()),e.key!==`Tab`))return;let t=Array.from(e.currentTarget.querySelectorAll(`button:not([disabled]), a[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex="0"]`)),n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())},t[17]=g,t[18]=w);let T;t[19]!==c||t[20]!==g?(T=c(g),t[19]=c,t[20]=g,t[21]=T):T=t[21];let E;return t[22]!==i||t[23]!==T||t[24]!==C||t[25]!==w||t[26]!==r?(E=(0,Be.createPortal)((0,J.jsx)(`div`,{ref:l,role:`dialog`,"aria-modal":`true`,"aria-label":r,"data-media-preview":i,"data-page-scroll-lock":`true`,tabIndex:-1,className:`fixed inset-0 z-[80] overflow-hidden select-none [-webkit-touch-callout:none]`,style:C,onClick:Je,onKeyDown:w,children:T}),document.body),t[22]=i,t[23]=T,t[24]=C,t[25]=w,t[26]=r,t[27]=E):E=t[27],E}function Je(e){e.stopPropagation()}var Ye=1048576,$=b(`YuriVideo`),Xe=e=>{let t=/^bytes=(\d*)-(\d*)$/.exec(e||`bytes=0-1048575`);if(!t||!t[1]&&!t[2])throw Error(`Invalid media range`);if(!t[1]){let e=Number(t[2]);if(!Number.isSafeInteger(e)||e<=0)throw Error(`Invalid media range`);return`bytes=-${Math.min(e,Ye)}`}let n=Number(t[1]),r=t[2]?Number(t[2]):n+Ye-1;if(!Number.isSafeInteger(n)||!Number.isSafeInteger(r)||r<n)throw Error(`Invalid media range`);return`bytes=${n}-${Math.min(r,n+Ye-1)}`},Ze=e=>{let t=``;for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t)};async function Qe(e,n,r){if(!x.isNativePlatform()||x.getPlatform()!==`ios`||!x.isPluginAvailable(`YuriVideo`))return null;let i=o(),c=crypto.randomUUID(),l=new Map,u=!1,d=()=>{},f=()=>{},p=async()=>{if(!u){u=!0,d(),f(),r.removeEventListener(`abort`,m);for(let e of l.values())e.abort();l.clear(),await Promise.allSettled([g?.remove(),$.release({assetId:c})])}},m=()=>{p()},h=async t=>{if(t.assetId!==c||u)return;if(t.cancelled){l.get(t.requestId)?.abort();return}if(l.has(t.requestId))return;let a=new AbortController;l.set(t.requestId,a);let d;try{if(i!==o()||r.aborted)throw Error(`Video runtime changed`);let c=t.method===`HEAD`?`bytes=0-0`:Xe(t.range),l=new URLSearchParams(e.split(`?`)[1]??``);(n.query instanceof URLSearchParams?n.query:new URLSearchParams(n.query)).forEach((e,t)=>l.set(t,e));let f=l.get(`path`);d=e.split(`?`)[0]===`/api/fs/raw`&&f?await y({path:f,range:c,signal:a.signal,directory:new Headers(n.headers).get(`x-opencode-directory`)??l.get(`directory`)??void 0,allowOutsideWorkspace:l.get(`allowOutsideWorkspace`)===`true`,outsideFileGrant:l.get(`outsideFileGrant`)??void 0}):await s(e,{...n,headers:{Range:c},signal:a.signal});let p=d.headers.get(`content-range`)||``;if(d.status===416&&/^bytes \*\/\d+$/.test(p)){await $.respond({requestId:t.requestId,status:416,contentRange:p,dataBase64:``});return}let m=/^bytes (\d+)-(\d+)\/(\d+)$/.exec(p);if(d.status!==206||!m)throw Error(`Host does not support video ranges`);let[h,g,_]=m.slice(1).map(Number),v=g-h+1;if(![h,g,_].every(Number.isSafeInteger)||v<=0||v>1048576||g>=_)throw Error(`Invalid video range response`);let b=d.body?.getReader();if(!b)throw Error(`Missing video response body`);let x=new Uint8Array(v),S=0;try{for(;;){let{done:e,value:t}=await b.read();if(e)break;if(S+t.length>v)throw Error(`Oversized video range`);x.set(t,S),S+=t.length}}finally{await b.cancel().catch(()=>{}),b.releaseLock()}if(S!==v)throw Error(`Truncated video range`);if(u||a.signal.aborted||i!==o())return;let C=d.headers.get(`content-type`)?.split(`;`)[0]||`application/octet-stream`;await $.respond({requestId:t.requestId,status:t.method===`HEAD`?200:206,contentType:C,contentRange:t.method===`HEAD`?void 0:p,contentLength:t.method===`HEAD`?_:v,dataBase64:t.method===`HEAD`?``:Ze(x)})}catch{!u&&!a.signal.aborted&&await $.respond({requestId:t.requestId,status:502,dataBase64:``}).catch(()=>{})}finally{d?.body&&!d.body.locked&&await d.body.cancel().catch(()=>{}),l.delete(t.requestId)}},g=await $.addListener(`request`,e=>{h(e)});r.addEventListener(`abort`,m,{once:!0}),d=a(m),f=t(m);try{r.throwIfAborted();let{url:e}=await $.create({assetId:c});if(u||r.aborted)throw await $.release({assetId:c}),new DOMException(`Aborted`,`AbortError`);return{url:e,release:p}}catch(e){throw await p(),e}}var $e=`image/png`,et=b(`YuriMedia`),tt=e=>{let t=e.toLowerCase().split(`;`)[0]?.trim()||$e;if(t===`image/jpeg`||t===`image/jpg`)return`jpg`;if(t===`image/webp`)return`webp`;if(t===`image/gif`)return`gif`;if(t===`image/svg+xml`)return`svg`;if(t===`image/png`)return`png`;if(t===`video/quicktime`)return`mov`;let n=t.split(`/`)[1];return n&&/^[a-z0-9.+-]+$/i.test(n)?n:`png`},nt=(e,t)=>{let n=`${t.startsWith(`video/`)?`video`:`image`}.${tt(t)}`,r=(((e||``).trim()||n).split(/[\\/]/).pop()||n).replace(/[^\w.\- ()[\]]+/g,`_`).replace(/^\.+/,``);return r?/\.[a-z0-9]{1,8}$/i.test(r)?r:`${r}.${tt(t)}`:n},rt=e=>new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{if(typeof r.result==`string`){t(r.result);return}n(Error(`Failed to encode image`))},r.onerror=()=>n(r.error??Error(`Failed to encode image`)),r.readAsDataURL(e)}),it=async e=>{let t=await rt(e),n=t.indexOf(`,`);return n>=0?t.slice(n+1):t},at=(e,t)=>{let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),window.setTimeout(()=>URL.revokeObjectURL(n),1e3)},ot=async(e,t,n)=>{if(e.startsWith(`yuri-asset:`)){let r=await _(e,t,n);if(r)return r;if(w())throw Error(`Image display stream is no longer available`)}return v(e,t,n)},st=async(e,t,n)=>g({path:e,signal:t},n),ct=async(e,t,n)=>{let r=e.effectiveDirectory??``,i=null;e.prefetchedBlob&&e.prefetchedBlob.size>0&&(i=e.prefetchedBlob);let a=e.displayUrl?.trim();if(!i&&a&&(!/^https?:/i.test(a)||!L(P(e.sourceUrl,r))))try{i=await ot(a,t,n)}catch{t?.throwIfAborted(),i=null,n?.(0)}if(!i){let a=e.sourceUrl.trim();if(!a)throw Error(`Image source is empty`);if(/^(?:data|blob):/i.test(a)||/^https?:/i.test(a)||/^\/api(?=\/|[?#]|$)/.test(a))i=await ot(a,t,n);else{let e=P(a,r);i=L(e)?await st(e.path,t,n):await ot(e.source,t,n)}}if(!i||i.size<=0)throw Error(`Image is empty`);n?.(100);let o=(e.mimeType||(i.type&&/^(image|video)\//.test(i.type)?i.type:``)||(e.kind===`video`?`video/mp4`:``)||$e).split(`;`)[0].trim()||$e;return{blob:i,filename:nt(e.filename,o),mimeType:o}},lt=()=>!w()||x===void 0?!1:x.isPluginAvailable(`YuriMedia`),ut=async(e,t,n)=>{let r=P(e.sourceUrl,e.effectiveDirectory??``);if(c()&&e.kind===`video`&&!lt()){let e=l()?.files;if(L(r)&&e?.downloadFile)return t?.throwIfAborted(),await e.downloadFile(r.path),`saved`;throw Error(`Video download is unavailable for this source in VS Code`)}if(L(r)&&!e.prefetchedBlob&&!/^(?:blob|data|yuri-asset):/i.test(e.displayUrl??``)&&!lt()&&!c())return await C({path:r.path,filename:e.filename,signal:t},n),`downloaded`;let{blob:i,filename:a,mimeType:o}=await ct(e,t,n);if(t?.throwIfAborted(),lt()){let n=await it(i);if(t?.throwIfAborted(),e.kind===`video`){if((await et.saveFile({dataBase64:n,mimeType:o,filename:a}))?.cancelled)throw new DOMException(`Save cancelled`,`AbortError`);return`saved`}return await et.saveImage({dataBase64:n,mimeType:o,filename:a}),`saved`}if(c()){let e=l()?.vscode;if(e?.saveImage){let t=await rt(i);return await e.saveImage({fileName:a,dataUrl:t}),`saved`}}return at(i,a),`downloaded`};function dt(e){let t=(0,K.c)(34),{target:n,isMobile:r}=e,{t:i}=O(),[a,o]=q.useState(`idle`),[s,c]=q.useState(0),l=q.useRef(null),u,d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>()=>l.current?.abort(),d=[],t[0]=u,t[1]=d):(u=t[0],d=t[1]),q.useEffect(u,d);let f;t[2]===n?f=t[3]:(f=async()=>{if(l.current)return;let e=new AbortController;l.current=e,o(`saving`),c(0);try{await ut(n,e.signal,t=>{e.signal.aborted||c(t)}),e.signal.aborted||o(`saved`)}catch(t){let n=t;if(e.signal.aborted)return;l.current=null,o(n instanceof DOMException&&n.name===`AbortError`?`idle`:`error`)}},t[2]=n,t[3]=f);let p=D(f),m=a===`saving`,h=a===`saved`,g;t[4]!==h||t[5]!==m||t[6]!==i||t[7]!==n?(g=i(m?`chat.image.actions.saving`:h?`filesView.editor.saved`:n.kind===`video`?`filesView.editor.saveFile`:`chat.image.actions.saveImage`),t[4]=h,t[5]=m,t[6]=i,t[7]=n,t[8]=g):g=t[8];let _=g,v=r?`ghost`:`mobileGlass`,y=r?`icon`:`mobileIcon`,b=m||h,x;t[9]!==r||t[10]!==_||t[11]!==s||t[12]!==h||t[13]!==m?(x=m?(0,J.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:r?`size-4`:`size-6`,role:`progressbar`,"aria-label":_,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":s??void 0,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,children:[(0,J.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,opacity:`0.25`}),(0,J.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,pathLength:`100`,strokeDasharray:`${s??0} 100`,transform:`rotate(-90 12 12)`})]}):h?(0,J.jsx)(M,{name:`check`,weight:`medium`,className:r?`size-4`:`size-6`}):(0,J.jsx)(M,{name:`download-2-fill`,className:r?`size-4`:`size-6`}),t[9]=r,t[10]=_,t[11]=s,t[12]=h,t[13]=m,t[14]=x):x=t[14];let S;t[15]!==_||t[16]!==p||t[17]!==m||t[18]!==a||t[19]!==v||t[20]!==y||t[21]!==b||t[22]!==x?(S=(0,J.jsx)(A,{variant:v,size:y,"data-media-save":a,className:`rounded-full [corner-shape:round] disabled:opacity-100`,"aria-label":_,"aria-busy":m,disabled:b,onClick:p,children:x}),t[15]=_,t[16]=p,t[17]=m,t[18]=a,t[19]=v,t[20]=y,t[21]=b,t[22]=x,t[23]=S):S=t[23];let C;t[24]!==_||t[25]!==a||t[26]!==i||t[27]!==n?(C=a===`error`?i(n.kind===`video`?`filesView.toast.saveFailed`:`chat.image.actions.saveFailed`):a===`idle`?``:_,t[24]=_,t[25]=a,t[26]=i,t[27]=n,t[28]=C):C=t[28];let w;t[29]===C?w=t[30]:(w=(0,J.jsx)(`span`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:C}),t[29]=C,t[30]=w);let T;return t[31]!==w||t[32]!==S?(T=(0,J.jsxs)(J.Fragment,{children:[S,w]}),t[31]=w,t[32]=S,t[33]=T):T=t[33],T}function ft({video:e,onClose:t,isMobile:a}){let{t:o}=O(),s=se()??``,c=e.directory??s,l=F(),u=P(e.url,c),d=L(u)?u.path:``,f=/^\/api(?=\/|[?#]|$)/.test(e.url)?e.url:``,p=!!(d||f),m=`${l}\n${c}\n${e.url}`,[_,y]=q.useState();q.useEffect(()=>{if(!p)return;let e=new AbortController,t;return Qe(f||`/api/fs/raw`,{query:d?{path:d}:void 0},e.signal).then(async n=>{if(e.signal.aborted){await n?.release();return}t=n?.release,y({key:m,url:n?.url,unsupported:!n})}).catch(()=>{e.signal.aborted||y({key:m,error:!0})}),()=>{e.abort(),t?.()}},[p,d,f,m]);let b=_?.key===m?_:void 0,[x,C]=q.useState(0);q.useEffect(()=>{if(!p||i())return;let e=n(),t=r(()=>C(e=>e+1));return()=>{t(),e()}},[p,l]);let w=h({queryKey:[`video-preview`,l,c,e.url,x],enabled:p&&b?.unsupported===!0,gcTime:0,staleTime:1/0,retry:!1,queryFn:async({signal:e})=>{if(!i()){let t=await S(f||`/api/fs/raw`,d?{path:d}:void 0);return e.throwIfAborted(),{url:t,blob:void 0}}return{blob:d?await g({path:d,signal:e}):await v(f,e),url:void 0}}}),[T,E]=q.useState(null);q.useEffect(()=>{if(!w.data?.blob)return;let e=URL.createObjectURL(w.data.blob);return E({blob:w.data.blob,url:e}),()=>URL.revokeObjectURL(e)},[w.data]);let D=p?b?.url||w.data?.url||(T?.blob===w.data?.blob?T?.url:``):u.source,[k,A]=q.useState(),j=b?.error||w.isError||!!(D&&k===D);return(0,J.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-3 p-4`,children:[(0,J.jsx)(Ue,{onClose:t,isMobile:a}),!D&&!j&&(0,J.jsx)(`p`,{role:`status`,children:o(`common.loading`)}),j&&(0,J.jsx)(`p`,{role:`alert`,children:o(`filesView.error.readFileFailed`)}),D&&(0,J.jsx)(`video`,{src:D,controls:!0,playsInline:!0,preload:`metadata`,"aria-label":e.filename,className:`max-h-[80dvh] w-full max-w-5xl object-contain`,onError:()=>A(D),controlsList:`nodownload`,onContextMenu:e=>e.preventDefault()},D),(0,J.jsx)(We,{isMobile:a,children:(0,J.jsx)(dt,{isMobile:a,target:{kind:`video`,sourceUrl:e.url,displayUrl:b?.url||w.data?.url?void 0:D,filename:e.filename,mimeType:e.mimeType,effectiveDirectory:c,prefetchedBlob:w.data?.blob}},m)})]})}var pt=400,mt=(e,t)=>new Se(e,t),ht=e=>{let t=`h-3.5 w-3.5 flex-shrink-0`,n=e.toLowerCase();return n===`reasoning`?(0,J.jsx)(M,{name:`brain-ai-3`,className:t}):n===`image-preview`?(0,J.jsx)(M,{name:`file-image`,className:t}):n===`mermaid-preview`?(0,J.jsx)(M,{name:`file-list-2`,className:t}):n===`edit`||n===`multiedit`||n===`apply_patch`||n===`str_replace`||n===`str_replace_based_edit_tool`?(0,J.jsx)(M,{name:`pencil-ai`,className:t}):n===`write`||n===`create`||n===`file_write`||n===`read`||n===`view`||n===`file_read`||n===`cat`?(0,J.jsx)(M,{name:`file-pdf`,className:t}):n===`bash`||n===`shell`||n===`cmd`||n===`terminal`?(0,J.jsx)(M,{name:`terminal-box`,className:t}):n===`list`||n===`ls`||n===`dir`||n===`list_files`?(0,J.jsx)(M,{name:`folder-6`,className:t}):n===`search`||n===`grep`||n===`find`||n===`ripgrep`?(0,J.jsx)(M,{name:`search`,className:t}):n===`glob`?(0,J.jsx)(M,{name:`file-search`,className:t}):n===`fetch`||n===`curl`||n===`wget`||n===`webfetch`?(0,J.jsx)(M,{name:`global`,className:t}):n===`web-search`||n===`websearch`||n===`search_web`||n===`google`||n===`bing`||n===`duckduckgo`?(0,J.jsx)(M,{name:`search`,className:t}):n===`todowrite`||n===`todoread`?(0,J.jsx)(M,{name:`list-check-3`,className:t}):n.startsWith(`git`)?(0,J.jsx)(M,{name:`git-branch`,className:t}):(0,J.jsx)(M,{name:`tools`,className:t})},gt={style:{background:`transparent`,backgroundColor:`transparent`,fontSize:`inherit`}},_t={download:!1,copy:!1,showPanZoomControls:!0},vt=`
3
- [data-diff-header],
4
- [data-diff] {
5
- [data-separator] {
6
- height: 24px !important;
7
- }
8
- }
9
- `,yt={hunkLineCount:50,lineHeight:24,diffHeaderHeight:44,hunkSeparatorHeight:24,spacing:0},bt=()=>{let e=(0,K.c)(22),t=ee(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=I(!1),e[0]=n):n=e[0];let r=n,i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=I(!0),e[1]=i):i=e[1];let a=i,o;e[2]===t?.availableThemes?o=e[3]:(o=()=>t?.availableThemes??[r,a],e[2]=t?.availableThemes,e[3]=o),t?.availableThemes;let s;e[4]===o?s=e[5]:(s=o(),e[4]=o,e[5]=s);let c=s,l=t?.lightThemeId??r.metadata.id,u=t?.darkThemeId??a.metadata.id,d;e[6]!==c||e[7]!==l?(d=c.find(e=>e.metadata.id===l)??r,e[6]=c,e[7]=l,e[8]=d):d=e[8];let f=d,p;e[9]!==c||e[10]!==u?(p=c.find(e=>e.metadata.id===u)??a,e[9]=c,e[10]=u,e[11]=p):p=e[11];let m=p,h,g;e[12]!==m||e[13]!==f?(h=()=>{ie(f),ie(m)},g=[m,f],e[12]=m,e[13]=f,e[14]=h,e[15]=g):(h=e[14],g=e[15]),q.useEffect(h,g);let _=t?.currentTheme.metadata.variant??`light`,v;e[16]!==m.metadata.id||e[17]!==f.metadata.id?(v={light:f.metadata.id,dark:m.metadata.id},e[16]=m.metadata.id,e[17]=f.metadata.id,e[18]=v):v=e[18];let y=_===`dark`?`dark`:`light`,b;return e[19]!==v||e[20]!==y?(b={theme:v,themeType:y},e[19]=v,e[20]=y,e[21]=b):b=e[21],b},xt=()=>({width:typeof window<`u`?window.innerWidth:0,height:typeof window<`u`?window.innerHeight:0}),St=e=>{let t=(0,K.c)(3),[n,r]=q.useState(xt),i,a;return t[0]===e?(i=t[1],a=t[2]):(i=()=>{if(!e||typeof window>`u`)return;let t=()=>{r(xt())};return t(),window.addEventListener(`resize`,t),()=>{window.removeEventListener(`resize`,t)}},a=[e],t[0]=e,t[1]=i,t[2]=a),q.useEffect(i,a),n},Ct=({popup:e,onOpenChange:t,isMobile:n})=>{let{t:r}=O(),i=ee(),a=se()??``,o=e.image?.directory??a,s=q.useMemo(()=>{let t=e.image;if(!t)return[];let n=Array.isArray(t.gallery)?t.gallery.filter(e=>!!e?.url):[];return n.length>0?n:[{url:t.url,mimeType:t.mimeType,filename:t.filename,size:t.size}]},[e.image]),[c,l]=q.useState(()=>{let t=e.image?.index??s.findIndex(t=>t.url===e.image?.url);return t>=0&&t<s.length?t:0}),u=e.previewSource instanceof HTMLImageElement?e.previewSource:void 0,d=u?.naturalWidth&&u.naturalHeight?{width:u.naturalWidth,height:u.naturalHeight}:null,[f,p]=q.useState(d),[m,h]=q.useState(!!d),g=e.open,_=St(e.open),v=q.useRef(null),y=q.useRef(null),b=q.useRef(null),x=q.useRef(null),S=q.useRef({scale:1,x:0,y:0}),C=q.useRef({image:{width:1,height:1},viewport:{width:1,height:1},maxScale:5}),w=q.useRef(new Map),T=q.useRef(null),E=q.useRef(null),j=q.useRef(null),N=q.useRef(null),te=q.useRef(0);q.useEffect(()=>{e.open&&(te.current=typeof performance<`u`?performance.now():Date.now())},[e.open]);let P=D(()=>(typeof performance<`u`?performance.now():Date.now())-te.current<pt);q.useEffect(()=>{if(!e.open||s.length===0)return;let t=typeof e.image?.index==`number`?e.image.index:-1;if(t>=0&&t<s.length){l(t);return}let n=e.image?.url?s.findIndex(t=>t.url===e.image?.url):-1;l(n>=0?n:0)},[s,e.image?.index,e.image?.url,e.open]);let F=s[c]??s[0]??e.image,I=ne(F?.url??``,o,`preview`),L=I.source||(F?.url===e.image?.url?u?.currentSrc:``)||``,re=`${I.key}\n${L}`,[ie,ae]=q.useState(``),R=!!(I.error||ie===re),oe=D(()=>ae(re)),le=F?.filename||e.title,z=s.length>1,B=D(()=>{s.length<=1||l(e=>(e-1+s.length)%s.length)}),ue=D(()=>{s.length<=1||l(e=>(e+1)%s.length)}),V=q.useMemo(()=>{let e={width:Math.max(1,_.width*(n?1:.8)),height:Math.max(1,_.height*(n?1:.95))};return f?Me(f,e):e},[f,n,_.height,_.width]),de=q.useMemo(()=>({image:V,viewport:{width:Math.max(1,_.width),height:Math.max(1,_.height)},maxScale:5}),[V,_.height,_.width]),H=D((e,t=!1)=>{let n=Q(e,C.current);S.current=n,N.current={transform:n,animate:t},!(j.current!==null||typeof window>`u`)&&(j.current=window.requestAnimationFrame(()=>{j.current=null;let e=N.current;N.current=null,e&&(b.current&&(b.current.style.transition=e.animate?`transform 180ms cubic-bezier(0.22, 1, 0.36, 1)`:`none`,b.current.style.transform=`translate3d(${e.transform.x}px, ${e.transform.y}px, 0) scale(${e.transform.scale})`),x.current&&(x.current.textContent=`${Math.round(e.transform.scale*100)}%`),v.current&&(v.current.style.cursor=e.transform.scale>1?`grab`:`zoom-in`))}))}),U=D((e=!0)=>{H({scale:1,x:0,y:0},e)}),W=D(()=>({x:C.current.viewport.width/2,y:C.current.viewport.height/2})),G=D((e,t,n=!1)=>{H(Ne(S.current,e,t,W(),C.current),n)}),fe=D(e=>{if(S.current.scale>1.01){U(!0);return}G(2,e,!0)}),pe=D(e=>{if(!(n||e.defaultPrevented)){if(e.key===`+`||e.key===`=`){e.preventDefault(),G(S.current.scale*1.4,W(),!0);return}if(e.key===`-`||e.key===`_`){e.preventDefault(),G(S.current.scale/1.4,W(),!0);return}if(e.key===`0`){e.preventDefault(),U(!0);return}if(e.key===`ArrowLeft`&&z){e.preventDefault(),B();return}e.key===`ArrowRight`&&z&&(e.preventDefault(),ue())}});q.useEffect(()=>{if(e.open)return window.addEventListener(`keydown`,pe),()=>{window.removeEventListener(`keydown`,pe)}},[e.open]),q.useEffect(()=>{j.current!==null&&window.cancelAnimationFrame(j.current),j.current=null,N.current=null;let t=F?.url===e.image?.url?u:void 0;p(t?.naturalWidth&&t.naturalHeight?{width:t.naturalWidth,height:t.naturalHeight}:null),h(!!t?.naturalWidth),S.current={scale:1,x:0,y:0},w.current.clear(),T.current=null,E.current=null,b.current&&(b.current.style.transform=`translate3d(0, 0, 0) scale(1)`),x.current&&(x.current.textContent=`100%`)},[F?.url,L,e.image?.url,u]),q.useLayoutEffect(()=>{C.current=de;let e=Q(S.current,C.current);S.current=e,b.current&&(b.current.style.transition=`none`,b.current.style.transform=`translate3d(${e.x}px, ${e.y}px, 0) scale(${e.scale})`)},[de]),q.useEffect(()=>()=>{j.current!==null&&window.cancelAnimationFrame(j.current),j.current=null,N.current=null},[]);let me=D(e=>{if(n)return;e.preventDefault();let t={x:e.clientX,y:e.clientY},r=Math.exp(-e.deltaY*.002);G(S.current.scale*r,t)});q.useEffect(()=>{let e=v.current;if(!(!g||n||!e))return e.addEventListener(`wheel`,me,{passive:!1}),()=>e.removeEventListener(`wheel`,me)},[n,g]);let he=D(e=>{n||(e.preventDefault(),fe({x:e.clientX,y:e.clientY}))}),ge=D(e=>{e.preventDefault(),e.stopPropagation()}),K=D(e=>{e.pointerType!==`mouse`&&e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId);let t={x:e.clientX,y:e.clientY};if(w.current.set(e.pointerId,{point:t,pointerType:e.pointerType}),w.current.size===1){T.current={pointerId:e.pointerId,pointerType:e.pointerType,start:t,transform:S.current,moved:!1,targetWasCanvas:e.target===e.currentTarget,suppressTap:!1},v.current&&S.current.scale>1&&(v.current.style.cursor=`grabbing`);return}T.current&&(T.current.suppressTap=!0);let n=Array.from(w.current.values()).slice(0,2).map(e=>e.point),r=n[1].x-n[0].x,i=n[1].y-n[0].y;E.current={distance:Math.max(1,Math.hypot(r,i)),midpoint:{x:(n[0].x+n[1].x)/2,y:(n[0].y+n[1].y)/2},transform:S.current},T.current&&(T.current.suppressTap=!0)}),_e=D(e=>{if(!w.current.has(e.pointerId))return;e.preventDefault();let t={x:e.clientX,y:e.clientY};if(w.current.set(e.pointerId,{point:t,pointerType:e.pointerType}),w.current.size>=2&&E.current){let e=Array.from(w.current.values()).slice(0,2).map(e=>e.point),t=e[1].x-e[0].x,n=e[1].y-e[0].y,r={x:(e[0].x+e[1].x)/2,y:(e[0].y+e[1].y)/2},i=E.current.transform.scale*Math.hypot(t,n)/E.current.distance;H(Fe(E.current.transform,E.current.midpoint,r,i,W(),C.current));return}let n=T.current;if(!n||n.pointerId!==e.pointerId)return;let r={x:t.x-n.start.x,y:t.y-n.start.y};Math.hypot(r.x,r.y)>10&&(n.moved=!0),n.transform.scale>1.01&&H(Pe(n.transform,r,C.current))}),Y=D((e,r)=>{let i=T.current,a=w.current.get(e.pointerId)?{x:e.clientX,y:e.clientY}:void 0;if(w.current.delete(e.pointerId),i?.pointerId===e.pointerId&&a){let e=je({isMobile:n,pointerType:i.pointerType,cancelled:r,moved:i.moved||Math.hypot(a.x-i.start.x,a.y-i.start.y)>10,suppressTap:i.suppressTap,targetWasCanvas:i.targetWasCanvas,start:i.start,end:a,startScale:i.transform.scale,hasMultipleImages:z});if(e===`next`&&ue(),e===`previous`&&B(),e===`close`){if(P())return;if(n&&i.pointerType!==`mouse`){ze(a,()=>t(!1));return}t(!1)}}if(w.current.size===1){let[e,t]=Array.from(w.current.entries())[0];T.current={pointerId:e,pointerType:t.pointerType,start:t.point,transform:S.current,moved:!1,targetWasCanvas:!1,suppressTap:!0},E.current=null}else w.current.size===0&&(T.current=null,E.current=null,v.current&&(v.current.style.cursor=S.current.scale>1?`grab`:`zoom-in`));e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)}),ve=D(e=>{e.preventDefault(),e.stopPropagation(),T.current&&(T.current.suppressTap=!0)}),ye=D(e=>{let t=e.currentTarget;t.naturalWidth>0&&t.naturalHeight>0&&p(e=>e?.width===t.naturalWidth&&e.height===t.naturalHeight?e:{width:t.naturalWidth,height:t.naturalHeight}),h(!0)});if(!g||!F||typeof document>`u`)return null;let X=i?.currentTheme.metadata.variant===`dark`?`text-foreground hover:bg-foreground/15 hover:text-foreground`:`text-background hover:bg-background/15 hover:text-background`;return(0,J.jsxs)(`div`,{ref:y,className:`absolute inset-0 overflow-hidden select-none`,tabIndex:-1,onClick:ge,children:[(0,J.jsx)(Ue,{onClose:()=>t(!1),isMobile:n,size:V}),(0,J.jsxs)(`div`,{ref:v,className:`absolute inset-0 flex items-center justify-center overflow-hidden touch-none [overscroll-behavior:none]`,onDoubleClick:n?void 0:he,onContextMenu:ve,onPointerDown:K,onPointerMove:_e,onPointerUp:e=>Y(e,!1),onPointerCancel:e=>Y(e,!0),onLostPointerCapture:e=>Y(e,!0),children:[!m&&!R&&(0,J.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,role:`status`,children:(0,J.jsx)(ce,{className:`aspect-square w-64 max-w-[80vw] rounded-xl`})}),R?(0,J.jsx)(`p`,{role:`status`,className:`px-6 text-center typography-ui-label`,children:r(`filesView.error.readFileFailed`)}):(0,J.jsx)(`img`,{ref:b,"data-preview-transition-target":``,"data-preview-return":F?.url===e.image?.url,src:L||void 0,alt:le??``,className:k(`block max-w-none object-contain will-change-transform`,m?`opacity-100`:`opacity-0`),style:{width:`${V.width}px`,height:`${V.height}px`},loading:`lazy`,draggable:!1,onLoad:ye,onError:oe})]}),(0,J.jsxs)(We,{isMobile:n,children:[z&&(0,J.jsxs)(`span`,{"data-media-gallery-counter":``,className:`min-w-10 px-1 text-center typography-micro tabular-nums opacity-80`,children:[c+1,` / `,s.length]}),z&&(0,J.jsx)(`span`,{className:`mx-0.5 h-4 w-px bg-current opacity-15`,"aria-hidden":`true`}),(0,J.jsx)(A,{variant:n?`ghost`:`mobileGlass`,size:n?`icon`:`mobileIcon`,className:k(`rounded-full`,n&&`size-8`,n&&X),onClick:()=>G(S.current.scale/1.4,W(),!0),"aria-label":r(`chat.toolOutputDialog.image.zoomOutAria`),title:r(`chat.toolOutputDialog.image.zoomOutAria`),children:(0,J.jsx)(M,{name:`subtract`,weight:`medium`,className:n?`size-4`:`size-6`})}),(0,J.jsxs)(A,{variant:n?`ghost`:`mobileGlass`,size:n?`sm`:`lg`,"data-media-zoom-reset":``,className:k(`rounded-full tabular-nums`,n?`min-w-12`:`min-w-20`,n&&X),onClick:()=>U(!0),"aria-label":r(`chat.toolOutputDialog.image.resetZoomAria`),title:r(`chat.toolOutputDialog.image.resetZoomAria`),children:[(0,J.jsx)(M,{name:`restart`,weight:`medium`,className:n?`size-3.5`:`size-5`}),(0,J.jsx)(`span`,{ref:x,children:`100%`})]}),(0,J.jsx)(A,{variant:n?`ghost`:`mobileGlass`,size:n?`icon`:`mobileIcon`,className:k(`rounded-full`,n&&`size-8`,n&&X),onClick:()=>G(S.current.scale*1.4,W(),!0),"aria-label":r(`chat.toolOutputDialog.image.zoomInAria`),title:r(`chat.toolOutputDialog.image.zoomInAria`),children:(0,J.jsx)(M,{name:`add`,weight:`medium`,className:n?`size-4`:`size-6`})}),(0,J.jsx)(dt,{isMobile:n,target:{sourceUrl:F.url||L,displayUrl:L||void 0,filename:F.filename||e.image?.filename||e.title,mimeType:F.mimeType||e.image?.mimeType,effectiveDirectory:o}},I.key)]})]})},wt=q.memo(e=>{let t=(0,K.c)(7),{popup:n,diffViewMode:r,pierreThemeConfig:i}=e,a=n.content||``,o=r===`unified`?`unified`:`split`,s;t[0]!==i.theme||t[1]!==i.themeType||t[2]!==o?(s={diffStyle:o,diffIndicators:`none`,hunkSeparators:`line-info-basic`,lineDiffType:`none`,disableFileHeader:!0,maxLineDiffLength:1e3,expansionLineCount:20,overflow:`wrap`,theme:i.theme,themeType:i.themeType,unsafeCSS:vt},t[0]=i.theme,t[1]=i.themeType,t[2]=o,t[3]=s):s=t[3];let c;return t[4]!==a||t[5]!==s?(c=(0,J.jsx)(`div`,{className:`typography-code`,children:(0,J.jsx)(E,{patch:a,metrics:yt,options:s,className:`block w-full`})}),t[4]=a,t[5]=s,t[6]=c):c=t[6],c});wt.displayName=`DialogUnifiedDiff`;var Tt=q.memo(e=>{let t=(0,K.c)(29),{popup:n,pierreThemeConfig:r}=e,i;t[0]===n.content?i=t[1]:(i=V(n.content),t[0]=n.content,t[1]=i);let a=i,o=n.metadata?.input,s;t[2]===o?s=t[3]:(s=typeof o==`object`&&o?o:{},t[2]=o,t[3]=s);let c=s,l=typeof c.offset==`number`?c.offset:0,u=typeof c.file_path==`string`?c.file_path:typeof c.filePath==`string`?c.filePath:typeof c.path==`string`?c.path:`read-output`,d;t[4]===a.lines?d=t[5]:(d=a.lines.map(Ot).join(`
10
- `),t[4]=a.lines,t[5]=d);let f=d,p;t[6]!==u||t[7]!==n.language?(p=n.language||oe(u)||`text`,t[6]=u,t[7]=n.language,t[8]=p):p=t[8];let m=p,h;t[9]===a.lines?h=t[10]:(h=a.lines.some(kt),t[9]=a.lines,t[10]=h);let g=h,_;if(t[11]!==g||t[12]!==l||t[13]!==a.lines||t[14]!==a.type){_=[];let e=l;for(let t of a.lines){t.lineNumber!==null&&(e=t.lineNumber);let n=a.type===`file`&&!g&&t.lineNumber===null&&!t.isInfo,r=t.lineNumber??(n?e+1:null);typeof r==`number`&&(e=r),_.push({text:t.text,lineNumber:r,isInfo:t.isInfo})}t[11]=g,t[12]=l,t[13]=a.lines,t[14]=a.type,t[15]=_}else _=t[15];let v=_;if(a.type===`file`){let e=m||void 0,n;t[16]!==f||t[17]!==u||t[18]!==e?(n={name:u,contents:f,lang:e},t[16]=f,t[17]=u,t[18]=e,t[19]=n):n=t[19];let i;t[20]!==r.theme||t[21]!==r.themeType?(i={disableFileHeader:!0,overflow:`wrap`,theme:r.theme,themeType:r.themeType},t[20]=r.theme,t[21]=r.themeType,t[22]=i):i=t[22];let a;return t[23]!==n||t[24]!==i?(a=(0,J.jsx)(T,{file:n,options:i,className:`block w-full`}),t[23]=n,t[24]=i,t[25]=a):a=t[25],a}let y;return t[26]!==v||t[27]!==m?(y=(0,J.jsx)(ve,{lines:v,language:m,maxHeight:`70vh`}),t[26]=v,t[27]=m,t[28]=y):y=t[28],y});Tt.displayName=`DialogReadContent`;var Et=({popup:e,onOpenChange:t,isMobile:n})=>{let{t:r}=O(),i=ee(),a=q.useMemo(()=>i?.currentTheme.metadata.variant===`dark`?i.currentTheme:i?.availableThemes.find(e=>e.metadata.id===i.darkThemeId&&e.metadata.variant===`dark`)??I(!0),[i?.currentTheme,i?.availableThemes,i?.darkThemeId]),[o,s]=q.useState(e.mermaid?.source||``),[c,l]=q.useState(e.mermaid?.source?`ready`:`idle`),[u,d]=q.useState(``),f=q.useRef(0),p=q.useCallback(e=>{let t=e.trim();if(!t.toLowerCase().startsWith(`file://`))return null;let n=e=>{if(!e||/[\0\r\n]/.test(e))return!1;let t=e.replace(/\\/g,`/`);return t.split(`/`).filter(Boolean).includes(`..`)?!1:t.startsWith(`/`)?!0:/^[A-Za-z]:\//.test(t)},r=e=>e.replace(/%([0-9A-Fa-f]{2})/g,(e,t)=>{let n=Number.parseInt(t,16);return Number.isFinite(n)?String.fromCharCode(n):`%${t}`});if(typeof URL.canParse==`function`&&URL.canParse(t)){let e=r(new URL(t).pathname||``);return/^\/[A-Za-z]:\//.test(e)&&(e=e.slice(1)),n(e)?e:null}let i=t.replace(/^file:\/\//i,``),a=r(i);return n(a)?a:n(i)?i:null},[]),m=q.useCallback(async()=>{let t=e.mermaid,n=Te(f.current);if(f.current=n,!t?.url){l(`error`),d(r(`chat.toolOutputDialog.mermaid.missingSource`));return}if(t.source){s(t.source),l(`ready`),d(``);return}l(`loading`),d(``);let i;if(t.url.startsWith(`data:`))i=Oe(t.url);else if(t.url.toLowerCase().startsWith(`file://`)){let e=p(t.url);i=e?y({path:e}).then(e=>e.ok?e.text():Promise.reject(mt(`chat.toolOutputDialog.mermaid.readFileFailedWithStatus`,{status:e.status}))):Promise.reject(mt(`chat.toolOutputDialog.mermaid.invalidLocalPath`))}else{let e=typeof URL.canParse==`function`&&URL.canParse(t.url,window.location.origin)?new URL(t.url,window.location.origin):null;i=!e||e.protocol!==`http:`&&e.protocol!==`https:`?Promise.reject(mt(`chat.toolOutputDialog.mermaid.unsupportedUrlProtocol`)):fetch(e.toString()).then(e=>e.ok?e.text():Promise.reject(mt(`chat.toolOutputDialog.mermaid.loadFailedWithStatus`,{status:e.status})))}await i.then(e=>{Ee(f.current,n)&&(s(e),l(`ready`))}).catch(e=>{Ee(f.current,n)&&(l(`error`),d(we(e)?r(e.key,e.params):r(`chat.toolOutputDialog.mermaid.loadFailed`)))})},[p,e.mermaid,r]);q.useEffect(()=>{!e.open||!e.mermaid||m()},[m,e.mermaid,e.open]);let h=`\`\`\`mermaid\n${o}\n\`\`\``;return!e.open||typeof document>`u`?null:(0,J.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,onClick:e=>{e.target===e.currentTarget&&t(!1)},children:(0,J.jsxs)(`div`,{"data-mermaid-preview":`true`,"data-preview-transition-target":``,className:`relative flex min-h-0 flex-col overflow-hidden`,style:{width:n?`100%`:`80%`,height:n?`100%`:`95%`},onMouseDown:e=>e.stopPropagation(),children:[(0,J.jsx)(Ue,{onClose:()=>t(!1),isMobile:n}),(0,J.jsx)(`div`,{className:`relative min-h-0 flex-1 overflow-hidden`,children:(0,J.jsxs)(`div`,{className:`h-full overflow-hidden`,children:[c===`loading`&&(0,J.jsxs)(`div`,{className:`h-full min-h-28 flex items-center justify-center gap-2 text-muted-foreground typography-meta`,children:[(0,J.jsx)(M,{name:`loader-4`,className:`h-4 w-4 animate-spin`}),(0,J.jsx)(`span`,{children:r(`chat.toolOutputDialog.mermaid.loading`)})]}),c===`error`&&(0,J.jsxs)(`div`,{className:`rounded-xl border p-3 space-y-3`,style:{backgroundColor:`var(--status-error-background)`,borderColor:`var(--status-error-border)`},children:[(0,J.jsx)(`p`,{className:`typography-markdown`,style:{color:`var(--status-error)`},children:u||r(`chat.toolOutputDialog.mermaid.renderFailed`)}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>{m()},className:`px-3 py-1.5 rounded-lg typography-meta border transition-colors hover:bg-[var(--interactive-hover)]`,style:{borderColor:`var(--interactive-border)`,color:`var(--surface-foreground)`},children:r(`chat.toolOutputDialog.mermaid.retry`)})]}),c===`ready`&&(0,J.jsx)(`div`,{className:`h-full`,children:(0,J.jsx)(R,{content:h,variant:`tool`,allowMermaidWheelEvents:!0,className:`markdown-mermaid-fullscreen h-full`,mermaidControls:_t,mermaidTheme:a,enableFileReferences:!1})})]})})]})})},Dt=e=>{let t=(0,K.c)(52),{popup:n,onOpenChange:r,isMobile:i}=e,{t:a}=O(),[o,s]=q.useState(`unified`),c=bt(),l;t[0]===n.open?l=t[1]:(l=()=>{n.open&&s(`unified`)},t[0]=n.open,t[1]=l);let u;t[2]!==n.open||t[3]!==n.title?(u=[n.open,n.title],t[2]=n.open,t[3]=n.title,t[4]=u):u=t[4],q.useEffect(l,u);let d=n.video??(n.image&&ae(n.image.url,n.image.mimeType)?n.image:void 0);if(n.image||n.mermaid||d){let e=d?`video`:n.image?`image`:`mermaid`,a;t[5]!==i||t[6]!==n||t[7]!==d?(a=e=>(0,J.jsx)(J.Fragment,{children:d?(0,J.jsx)(ft,{video:d,onClose:e,isMobile:i}):n.image?(0,J.jsx)(Ct,{popup:n,onOpenChange:e,isMobile:i}):(0,J.jsx)(Et,{popup:n,onOpenChange:e,isMobile:i})}),t[5]=i,t[6]=n,t[7]=d,t[8]=a):a=t[8];let o;return t[9]!==i||t[10]!==r||t[11]!==n.open||t[12]!==n.previewSource||t[13]!==n.title||t[14]!==e||t[15]!==a?(o=(0,J.jsx)(qe,{open:n.open,title:n.title,kind:e,source:n.previewSource,isMobile:i,onOpenChange:r,children:a}),t[9]=i,t[10]=r,t[11]=n.open,t[12]=n.previewSource,t[13]=n.title,t[14]=e,t[15]=a,t[16]=o):o=t[16],o}let f=n.open,m=i?`w-[95vw] max-w-[95vw]`:`max-w-5xl`,h=i?`[&>button]:right-1`:`[&>button]:top-2.5 [&>button]:right-4`,g;t[17]!==m||t[18]!==h?(g=k(`overflow-hidden flex flex-col min-h-0 pt-3 pb-4 px-4 gap-1`,`[&>button]:top-1.5`,m,h),t[17]=m,t[18]=h,t[19]=g):g=t[19];let _;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(_={maxHeight:`90vh`},t[20]=_):_=t[20];let v;t[21]===n.metadata?v=t[22]:(v=n.metadata?.tool?ht(n.metadata.tool):(0,J.jsx)(M,{name:`tools`,className:`h-3.5 w-3.5 text-foreground flex-shrink-0`}),t[21]=n.metadata,t[22]=v);let y;t[23]===n.title?y=t[24]:(y=(0,J.jsx)(`span`,{className:`break-words flex-1 leading-tight`,children:n.title}),t[23]=n.title,t[24]=y);let b;t[25]!==o||t[26]!==n.isDiff?(b=n.isDiff&&(0,J.jsx)(H,{mode:o,onModeChange:s,className:`mr-8 flex-shrink-0`}),t[25]=o,t[26]=n.isDiff,t[27]=b):b=t[27];let x;t[28]!==b||t[29]!==v||t[30]!==y?(x=(0,J.jsx)(`div`,{className:`flex-shrink-0 pb-1`,children:(0,J.jsxs)(`div`,{className:`flex items-start gap-2 text-foreground typography-ui-header font-semibold`,children:[v,y,b]})}),t[28]=b,t[29]=v,t[30]=y,t[31]=x):x=t[31];let S;t[32]!==c||t[33]!==n.metadata?(S=n.metadata?.input&&typeof n.metadata.input==`object`&&Object.keys(n.metadata.input).length>0&&n.metadata?.tool!==`todowrite`&&n.metadata?.tool!==`todoread`&&n.metadata?.tool!==`apply_patch`?(()=>{let e=n.metadata,t=e.input,r=e=>{let n=t[e];return typeof n==`string`?n:typeof n==`number`?String(n):null};return(0,J.jsxs)(`div`,{className:`border-b border-border/20 p-4 -mx-3`,children:[(0,J.jsx)(`div`,{className:`typography-markdown font-medium text-muted-foreground mb-2 px-3`,children:e.tool===`bash`||e.tool===`shell`?`Command:`:e.tool===`task`||e.tool===`subagent`?`Task Details:`:`Input:`}),(e.tool===`bash`||e.tool===`shell`)&&r(`command`)?(0,J.jsx)(`div`,{className:`tool-input-surface bg-transparent rounded-xl border border-border/20 mx-3`,children:(0,J.jsx)(B,{language:`bash`,code:r(`command`),style:p.getPopupStyles(),codeStyle:gt.style,wrap:!0})}):(e.tool===`task`||e.tool===`subagent`)&&r(`prompt`)?(0,J.jsxs)(`div`,{className:`tool-input-surface bg-transparent rounded-xl border border-border/20 font-mono whitespace-pre-wrap text-foreground/90 mx-3`,style:p.getPopupStyles(),children:[r(`description`)?`Task: ${r(`description`)}\n`:``,r(`subagent_type`)||r(`agent`)?`Agent Type: ${r(`subagent_type`)||r(`agent`)}\n`:``,`Instructions:\n${r(`prompt`)}`]}):e.tool===`write`&&r(`content`)?(0,J.jsx)(`div`,{className:`tool-input-surface bg-transparent rounded-xl border border-border/20 mx-3`,children:(0,J.jsx)(T,{file:{name:r(`filePath`)||r(`file_path`)||`new-file`,contents:r(`content`),lang:oe(r(`filePath`)||r(`file_path`)||``)||void 0},options:{disableFileHeader:!0,overflow:`wrap`,theme:c.theme,themeType:c.themeType},className:`block w-full`})}):(0,J.jsx)(`div`,{className:`tool-input-surface bg-transparent rounded-xl border border-border/20 font-mono whitespace-pre-wrap text-foreground/90 mx-3`,style:p.getPopupStyles(),children:G(t,e.tool)})]})})():null,t[32]=c,t[33]=n.metadata,t[34]=S):S=t[34];let C;t[35]!==o||t[36]!==i||t[37]!==c||t[38]!==n||t[39]!==a?(C=n.isDiff?(0,J.jsx)(wt,{popup:n,diffViewMode:o,pierreThemeConfig:c}):n.content?(0,J.jsx)(`div`,{className:`p-4`,children:(()=>{let e=n.metadata?.tool;return e===`todowrite`||e===`todoread`?U(n.content)||(0,J.jsx)(B,{language:`json`,code:n.content,style:p.getPopupContainerStyles(),codeStyle:gt.style,wrap:!0}):e===`list`?z(n.content)||(0,J.jsx)(`pre`,{className:`typography-markdown bg-muted/30 p-2 rounded-xl border border-border/20 font-mono whitespace-pre-wrap`,children:n.content}):e===`grep`?le(n.content,i)||(0,J.jsx)(`pre`,{className:`typography-code bg-muted/30 p-2 rounded-xl border border-border/20 font-mono whitespace-pre-wrap`,children:n.content}):e===`glob`?pe(n.content,i)||(0,J.jsx)(`pre`,{className:`typography-code bg-muted/30 p-2 rounded-xl border border-border/20 font-mono whitespace-pre-wrap`,children:n.content}):e===`task`||e===`subagent`||e===`reasoning`?(0,J.jsx)(`div`,{className:e===`reasoning`?`text-muted-foreground/70`:``,children:(0,J.jsx)(R,{content:n.content,variant:`tool`})}):e===`web-search`||e===`websearch`||e===`search_web`?de(n.content)||(0,J.jsx)(B,{language:`text`,code:n.content,style:p.getPopupContainerStyles(),codeStyle:gt.style,wrap:!0}):e===`read`?(0,J.jsx)(Tt,{popup:n,pierreThemeConfig:c}):(n.content?ue(n.content):{data:null,isJson:!1}).isJson?(0,J.jsx)(xe,{jsonString:n.content,initiallyExpandedDepth:3,maxHeight:`70vh`}):(0,J.jsx)(B,{language:n.language||`text`,code:n.content,style:p.getPopupContainerStyles(),codeStyle:gt.style,wrap:!0})})()}):(0,J.jsxs)(`div`,{className:`p-8 text-muted-foreground typography-ui-header`,children:[(0,J.jsx)(`div`,{className:`mb-2`,children:a(`chat.toolOutputDialog.commandCompleted`)}),(0,J.jsx)(`div`,{className:`typography-meta`,children:a(`chat.toolOutputDialog.noOutputProduced`)})]}),t[35]=o,t[36]=i,t[37]=c,t[38]=n,t[39]=a,t[40]=C):C=t[40];let w;t[41]!==S||t[42]!==C?(w=(0,J.jsx)(`div`,{className:`flex-1 min-h-0 rounded-xl border border-border/30 bg-muted/10 overflow-hidden`,children:(0,J.jsxs)(`div`,{className:`tool-output-surface h-full max-h-[75vh] overflow-y-auto px-3 pr-4`,children:[S,C]})}),t[41]=S,t[42]=C,t[43]=w):w=t[43];let E;t[44]!==x||t[45]!==w||t[46]!==g?(E=(0,J.jsxs)(N,{className:g,style:_,children:[x,w]}),t[44]=x,t[45]=w,t[46]=g,t[47]=E):E=t[47];let D;return t[48]!==r||t[49]!==n.open||t[50]!==E?(D=(0,J.jsx)(te,{open:f,onOpenChange:r,children:E}),t[48]=r,t[49]=n.open,t[50]=E,t[51]=D):D=t[51],D};function Ot(e){return e.text}function kt(e){return e.lineNumber!==null}export{Dt as default};