@decocms/mesh 2.14.0 → 2.14.1

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 (138) hide show
  1. package/dist/client/assets/{AlertCircle-DeHvJZzp.js → AlertCircle-CMyS46jH.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-Dan_IIKP.js → ArrowLeft-Dsh9IWd-.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-B2eKsIZo.js → ArrowUp-CXsDJznS.js} +1 -1
  4. package/dist/client/assets/{Check-VfxUlV5P.js → Check-BEhtk6Py.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-OK90XtVB.js → ChevronDown-BRxtl0-A.js} +1 -1
  6. package/dist/client/assets/{Clock-CRgmR_1n.js → Clock-BSrN61cb.js} +1 -1
  7. package/dist/client/assets/{Code01-B9DNMb5j.js → Code01-Bu5zpyWd.js} +1 -1
  8. package/dist/client/assets/{Copy01-dbjgqDL6.js → Copy01-B7vmVdHF.js} +1 -1
  9. package/dist/client/assets/{DotsHorizontal-BpvBcoMa.js → DotsHorizontal-B0iNa4YA.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-XnGZcIeo.js → DotsVertical-CdUtOOoG.js} +1 -1
  11. package/dist/client/assets/{Download01-C8jw9jFZ.js → Download01-D1VGE3pA.js} +1 -1
  12. package/dist/client/assets/{Edit01-Ddbn6DsS.js → Edit01-CGqnOdlK.js} +1 -1
  13. package/dist/client/assets/{File06-DCHrHfbn.js → File06-De52zO32.js} +1 -1
  14. package/dist/client/assets/{FilterLines-BzWlfPby.js → FilterLines-ClFUJXZP.js} +1 -1
  15. package/dist/client/assets/{FlipBackward-Bum_Ktlp.js → FlipBackward-B4GimHkg.js} +1 -1
  16. package/dist/client/assets/{GitBranch01-CVAiK8ZD.js → GitBranch01-B40VcD0l.js} +1 -1
  17. package/dist/client/assets/{Grid01-AMlhaaWH.js → Grid01-CoHgfBeE.js} +1 -1
  18. package/dist/client/assets/{Home02-CnvrJTir.js → Home02-Dax6TXzJ.js} +1 -1
  19. package/dist/client/assets/{Image01-Bch9iOev.js → Image01-D_Oad7Fi.js} +1 -1
  20. package/dist/client/assets/{Inbox01-y9RgqkXP.js → Inbox01-DU8gyK-F.js} +1 -1
  21. package/dist/client/assets/{InfoCircle-HrYndWCZ.js → InfoCircle-Na8jygcw.js} +1 -1
  22. package/dist/client/assets/{Key01-DS2WWoiQ.js → Key01-BbSMVBZS.js} +1 -1
  23. package/dist/client/assets/{LinkExternal01-DzBB4jwo.js → LinkExternal01-5OOaoko1.js} +1 -1
  24. package/dist/client/assets/{List-BDW462gC.js → List-BXC8ldIg.js} +1 -1
  25. package/dist/client/assets/{Loading01-OB_JRXd5.js → Loading01-DxDL3s7X.js} +1 -1
  26. package/dist/client/assets/{Lock01-B_KYH87b.js → Lock01-C1zaHQP8.js} +1 -1
  27. package/dist/client/assets/{Play-VfPQ9yON.js → Play-ClPvjsPL.js} +1 -1
  28. package/dist/client/assets/{Plus-CgcZFggs.js → Plus-WrA7kzKa.js} +1 -1
  29. package/dist/client/assets/{SearchMd-DRJ07Awx.js → SearchMd-JSFwoON0.js} +1 -1
  30. package/dist/client/assets/{Terminal-FTJQx4pc.js → Terminal-BtV_FLPF.js} +1 -1
  31. package/dist/client/assets/{Trash01-BDWyzvD2.js → Trash01-MX6mkM7g.js} +1 -1
  32. package/dist/client/assets/{Upload01-CB1SFmVO.js → Upload01-BGvogcXt.js} +1 -1
  33. package/dist/client/assets/{X-CVhiWYv-.js → X-q5bh176U.js} +1 -1
  34. package/dist/client/assets/{XClose-C895iFVX.js → XClose-D_dGSZ7W.js} +1 -1
  35. package/dist/client/assets/{alert-dialog-D9k51qgG.js → alert-dialog-ocEz50Se.js} +1 -1
  36. package/dist/client/assets/{auth-catchall-BDKZr3VK.js → auth-catchall-BJS8UgWt.js} +1 -1
  37. package/dist/client/assets/{avatar-BLmwViC3.js → avatar-Dtkx4Tl-.js} +1 -1
  38. package/dist/client/assets/{badge-CMZTNGZo.js → badge-BkSn2oaB.js} +1 -1
  39. package/dist/client/assets/{binder-Bcr51BHa.js → binder-BVHRVoIY.js} +1 -1
  40. package/dist/client/assets/{button-2azNqzUx.js → button-CICpj3wE.js} +1 -1
  41. package/dist/client/assets/{card-WAuUk8Uz.js → card-BMkFh6vi.js} +1 -1
  42. package/dist/client/assets/{checkbox-E6g3eWVz.js → checkbox-DTTIHxXg.js} +1 -1
  43. package/dist/client/assets/{collection-detail-DiFfTEhG.js → collection-detail-CDCE926k.js} +1 -1
  44. package/dist/client/assets/{collection-display-button-B3beugJ4.js → collection-display-button-3hmFOeDC.js} +1 -1
  45. package/dist/client/assets/{collection-header-MCgfYSgE.js → collection-header-B6vJy14N.js} +1 -1
  46. package/dist/client/assets/{collection-page-CB_Az4GO.js → collection-page-Dt6I6Mr4.js} +1 -1
  47. package/dist/client/assets/{collection-search-DL-7oL5d.js → collection-search-ClK_cOgs.js} +1 -1
  48. package/dist/client/assets/{collection-tab-C_pl92IS.js → collection-tab-D8CKnWEB.js} +1 -1
  49. package/dist/client/assets/{collection-table-wrapper-CAH6fKB1.js → collection-table-wrapper-CUsQQB3S.js} +1 -1
  50. package/dist/client/assets/{connection-CXC8d3Ae.js → connection-Mp3hTHGP.js} +1 -1
  51. package/dist/client/assets/{connection-card-BTOP5EHD.js → connection-card-Cm6sQJt-.js} +1 -1
  52. package/dist/client/assets/{connection-detail-BHduC6at.js → connection-detail-CS7YtOxG.js} +1 -1
  53. package/dist/client/assets/{connections-Cm-7oBJu.js → connections-BXBUh1-5.js} +1 -1
  54. package/dist/client/assets/constants-DsV2FGIq.js +1 -0
  55. package/dist/client/assets/{create-organization-dialog-MS4oQ7Sl.js → create-organization-dialog-Kd2yuwpA.js} +1 -1
  56. package/dist/client/assets/{dialog-DSU0GEtE.js → dialog-CuzZhGeu.js} +1 -1
  57. package/dist/client/assets/{dropdown-menu-DRkETp4T.js → dropdown-menu-D1uHrxpy.js} +1 -1
  58. package/dist/client/assets/{dynamic-plugin-layout-CXggkl7m.js → dynamic-plugin-layout-BWtm_52W.js} +1 -1
  59. package/dist/client/assets/{empty-state-C3NzxCFI.js → empty-state-B8LlErgw.js} +1 -1
  60. package/dist/client/assets/{empty-state-DKa1iDdq.js → empty-state-BhACvnGF.js} +1 -1
  61. package/dist/client/assets/{env-vars-editor-D54i65KN.js → env-vars-editor-BSBPtnyc.js} +1 -1
  62. package/dist/client/assets/{error-boundary-DU6_J5et.js → error-boundary-u4ffWLYf.js} +1 -1
  63. package/dist/client/assets/extract-connection-data-DSV8dsp9.js +1 -0
  64. package/dist/client/assets/{file-browser-B8xb3wGm.js → file-browser-CZ1PEthx.js} +2 -2
  65. package/dist/client/assets/{form-DM9msJYn.js → form-f0_t6ok_.js} +1 -1
  66. package/dist/client/assets/{gateway-detail-6QzPV4MT.js → gateway-detail-D4FxMVxj.js} +1 -1
  67. package/dist/client/assets/{gateways-DcbIYmOg.js → gateways-DjekxeB3.js} +1 -1
  68. package/dist/client/assets/{grid-view-DjeV3XAc.js → grid-view-BYe4Rwz4.js} +1 -1
  69. package/dist/client/assets/{home-BkFYrMbJ.js → home-C6GUJREk.js} +1 -1
  70. package/dist/client/assets/{index-C5xxIZ3a.js → index-BZk2eMPx.js} +3 -3
  71. package/dist/client/assets/{index-CYR9-1-4.js → index-BrOzWsZC.js} +1 -1
  72. package/dist/client/assets/index-CFMXrMRQ.js +25 -0
  73. package/dist/client/assets/{index-BQiKVu3k.js → index-DB3GMPX_.js} +1 -1
  74. package/dist/client/assets/{index-Dk3lubBQ.js → index-pvGhQBw9.js} +2 -2
  75. package/dist/client/assets/{infiniteQueryObserver-CUXkVkPG.js → infiniteQueryObserver-DjOTL7tS.js} +1 -1
  76. package/dist/client/assets/{input-CBrhxHNe.js → input-Chnnz9Uq.js} +1 -1
  77. package/dist/client/assets/{layout-MOaKucBL.js → layout-CE7L7dZF.js} +1 -1
  78. package/dist/client/assets/{lazy-highlighter-C2ClCxhY.js → lazy-highlighter-HM0cmsZA.js} +1 -1
  79. package/dist/client/assets/{localstorage-keys-BJk6gyyN.js → localstorage-keys-CdhAbc7P.js} +1 -1
  80. package/dist/client/assets/{login-RFCnTbJl.js → login-D-qtMr1_.js} +1 -1
  81. package/dist/client/assets/mcp-oauth-Bkju1UsK.js +1 -0
  82. package/dist/client/assets/{mcp-server-card-DYesFUUw.js → mcp-server-card-CsdbMsCj.js} +1 -1
  83. package/dist/client/assets/mcp-server-detail-BI6WT6NT.js +1 -0
  84. package/dist/client/assets/{members-wdr88rOm.js → members-DIF2fQ00.js} +1 -1
  85. package/dist/client/assets/{monaco-editor-B2ZJ-0S4.js → monaco-editor--HoIUuQe.js} +1 -1
  86. package/dist/client/assets/{monitoring-Cr82twHN.js → monitoring-Gwgg901f.js} +1 -1
  87. package/dist/client/assets/{oauth-callback-BddKzzFQ.js → oauth-callback-C8OVySGi.js} +1 -1
  88. package/dist/client/assets/{page-DhI0Qooi.js → page-BthOOB1S.js} +1 -1
  89. package/dist/client/assets/{page-D_NhUEfH.js → page-rpmGCt1t.js} +1 -1
  90. package/dist/client/assets/{pin-to-sidebar-button-CVN6Bdsp.js → pin-to-sidebar-button--fqmK37a.js} +1 -1
  91. package/dist/client/assets/{plugin-empty-state-srmGKRQU.js → plugin-empty-state-BPlieumE.js} +1 -1
  92. package/dist/client/assets/{plugin-header-Dg9-cQAj.js → plugin-header-CcEHY2ra.js} +1 -1
  93. package/dist/client/assets/{plugins-Dawnh_sQ.js → plugins-BR7M1iih.js} +1 -1
  94. package/dist/client/assets/{popover-HE15ABOl.js → popover-Cq8T_QGa.js} +1 -1
  95. package/dist/client/assets/{project-context-provider-B1gr9e2f.js → project-context-provider-CUiGxKJp.js} +1 -1
  96. package/dist/client/assets/{registry-utils-COqteFH4.js → registry-utils-h9Ud__h7.js} +1 -1
  97. package/dist/client/assets/{resizable-B8j7Xubf.js → resizable-S6LzYu6C.js} +1 -1
  98. package/dist/client/assets/{resource-tabs-B1oXSRkv.js → resource-tabs-Blq_ajNW.js} +1 -1
  99. package/dist/client/assets/{select-DkAjMxeq.js → select-BOEg6aAK.js} +1 -1
  100. package/dist/client/assets/{settings-Clme5cH0.js → settings-C0Cv06sV.js} +1 -1
  101. package/dist/client/assets/{shell-layout-BuirxVot.js → shell-layout-BRSb3To9.js} +1 -1
  102. package/dist/client/assets/{spinner-Dwr2EFZD.js → spinner-BSgPnpsR.js} +1 -1
  103. package/dist/client/assets/{switch-C9XtHYD0.js → switch-CkVmNhCD.js} +1 -1
  104. package/dist/client/assets/{textarea-CyM57U4B.js → textarea-BgUJNVXI.js} +1 -1
  105. package/dist/client/assets/{thread-history-popover-DlGwptvV.js → thread-history-popover-SCaQRi-L.js} +2 -2
  106. package/dist/client/assets/{tool-set-selector-B9-4X5pd.js → tool-set-selector-BVPKiJOI.js} +1 -1
  107. package/dist/client/assets/{tools-list-DJqzZm19.js → tools-list-DsOacuX3.js} +1 -1
  108. package/dist/client/assets/{tooltip-DHS6wGWv.js → tooltip-DySBr2SY.js} +1 -1
  109. package/dist/client/assets/{use-binding-Cn24Ren1.js → use-binding-s4bqKdJA.js} +1 -1
  110. package/dist/client/assets/{use-collections-CbsNEj5T.js → use-collections-JQXbZBdV.js} +1 -1
  111. package/dist/client/assets/{use-connection-BhdfednN.js → use-connection-BF1UFzlw.js} +1 -1
  112. package/dist/client/assets/{use-connection-resources-D6kK3b1i.js → use-connection-resources-D5d-M6jn.js} +1 -1
  113. package/dist/client/assets/{use-create-gateway-dtd5LmVR.js → use-create-gateway-DLr-GNpv.js} +1 -1
  114. package/dist/client/assets/{use-gateway-Ck94EUZ3.js → use-gateway-B5GGqvj7.js} +1 -1
  115. package/dist/client/assets/{use-gateway-system-prompt-C9-1moLN.js → use-gateway-system-prompt-K6FCpGjs.js} +1 -1
  116. package/dist/client/assets/{use-list-state-CQtVDn-T.js → use-list-state-BkPjBg3I.js} +1 -1
  117. package/dist/client/assets/{use-mcp-C1X3fEnH.js → use-mcp-C-3NLCFo.js} +1 -1
  118. package/dist/client/assets/{use-members-Bh37cZiw.js → use-members-B9HW4lZd.js} +1 -1
  119. package/dist/client/assets/{use-mobile-CuBmA9jm.js → use-mobile-zhrv6Pzr.js} +1 -1
  120. package/dist/client/assets/{use-organization-settings-BNK4p5TK.js → use-organization-settings-DTSCQFPr.js} +1 -1
  121. package/dist/client/assets/{use-tool-call-DzBMga46.js → use-tool-call-BMUEJvVc.js} +1 -1
  122. package/dist/client/assets/useInfiniteQuery-qVzxuL4i.js +1 -0
  123. package/dist/client/assets/{useMutation-BEX5R6ly.js → useMutation-B64mCwly.js} +1 -1
  124. package/dist/client/assets/useQuery-Dr4r_H_i.js +1 -0
  125. package/dist/client/assets/{value-UH6V0tmj.js → value-DvmerOpY.js} +1 -1
  126. package/dist/client/assets/{view-mode-toggle-kdDPGpPT.js → view-mode-toggle-DXknlAX3.js} +1 -1
  127. package/dist/client/assets/{workflow-DgZwuETF.js → workflow-Bi0pfrEf.js} +1 -1
  128. package/dist/client/index.html +1 -1
  129. package/dist/server/cli.js +3 -3
  130. package/dist/server/server.js +2 -2
  131. package/package.json +1 -1
  132. package/dist/client/assets/constants-B-ATh8ff.js +0 -1
  133. package/dist/client/assets/extract-connection-data-Hjw19oaR.js +0 -1
  134. package/dist/client/assets/index-DUfEAj2z.js +0 -25
  135. package/dist/client/assets/mcp-oauth-CuMRVoyP.js +0 -1
  136. package/dist/client/assets/mcp-server-detail-CBjpnL21.js +0 -1
  137. package/dist/client/assets/useInfiniteQuery-B7UO0aOm.js +0 -1
  138. package/dist/client/assets/useQuery-BbeI5BfO.js +0 -1
@@ -1 +1 @@
1
- import{r as N,f as $,v as B,z as D,y as P,t as C,K as I,a as K,j as s,a3 as Q,w as A,c as H,x as L}from"./index-Dk3lubBQ.js";import{C as T}from"./collection-header-MCgfYSgE.js";import{C as W}from"./collection-page-CB_Az4GO.js";import{u as Y}from"./project-context-provider-B1gr9e2f.js";import{B as w}from"./button-2azNqzUx.js";import{a as Z,F as k,b as R,c as E,d as O,f as M,e as G}from"./form-DM9msJYn.js";import{I as U}from"./input-CBrhxHNe.js";import{u as J}from"./useMutation-BEX5R6ly.js";import{i as V}from"./Grid01-AMlhaaWH.js";import{i as X}from"./Upload01-CB1SFmVO.js";import{i as _}from"./X-CVhiWYv-.js";import"./collection-display-button-B3beugJ4.js";import"./dropdown-menu-DRkETp4T.js";import"./ArrowUp-B2eKsIZo.js";import"./Check-VfxUlV5P.js";import"./List-BDW462gC.js";import"./tooltip-DHS6wGWv.js";import"./view-mode-toggle-kdDPGpPT.js";const q=({size:d=24,color:e="currentColor",...r})=>N.createElement("svg",{viewBox:"0 0 24 24",width:d,height:d,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},N.createElement("path",{d:"m2 14.5 9.642 4.821c.131.066.197.099.266.111.06.012.123.012.184 0 .069-.012.135-.045.266-.11L22 14.5m-20-5 9.642-4.821c.131-.066.197-.098.266-.111a.5.5 0 0 1 .184 0c.069.013.135.045.266.111L22 9.5l-9.642 4.821a1.028 1.028 0 0 1-.266.111.501.501 0 0 1-.184 0c-.069-.012-.135-.045-.266-.11L2 9.5Z"}));q.displayName="LayersTwo01";const ee=A({name:L().min(1,"Name is required").max(255,"Name is too long"),slug:L().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:L().optional()});function se(d){const e=H.c(24),{value:r,onChange:a,name:m}=d,o=N.useRef(null);let u;e[0]!==a?(u=S=>{const F=S.target.files?.[0];if(F){if(F.size>2097152){C.error("Image must be smaller than 2MB");return}const c=new FileReader;c.onerror=()=>{const y=c.error;console.error("FileReader error:",y),C.error(y?.message||"Failed to read image file. Please try again."),o.current&&(o.current.value="")},c.onloadend=()=>{if(c.readyState===FileReader.DONE&&c.result){const y=c.result;a(y)}},c.readAsDataURL(F)}},e[0]=a,e[1]=u):u=e[1];const j=u;let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{o.current?.click()},e[2]=l):l=e[2];const t=l;let i;e[3]!==a?(i=S=>{S.stopPropagation(),a("")},e[3]=a,e[4]=i):i=e[4];const n=i;let g;e[5]!==j?(g=s.jsx("input",{type:"file",ref:o,className:"hidden",accept:"image/*",onChange:j}),e[5]=j,e[6]=g):g=e[6];let x;e[7]!==n||e[8]!==m||e[9]!==r?(x=r?s.jsxs("div",{className:"relative group",children:[s.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:s.jsx("img",{src:r,alt:m||"Organization logo",className:"w-full h-full object-cover"})}),s.jsx("button",{type:"button",onClick:n,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:s.jsx(_,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:t,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground",children:[s.jsx(X,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),e[7]=n,e[8]=m,e[9]=r,e[10]=x):x=e[10];const z=r?"Change Logo":"Upload Logo";let h;e[11]!==z?(h=s.jsx(w,{type:"button",variant:"outline",size:"sm",onClick:t,className:"mb-2",children:z}),e[11]=z,e[12]=h):h=e[12];let f;e[13]!==n||e[14]!==r?(f=r&&s.jsx(w,{type:"button",variant:"ghost",size:"sm",onClick:n,className:"ml-2",children:"Remove"}),e[13]=n,e[14]=r,e[15]=f):f=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),e[16]=v):v=e[16];let p;e[17]!==h||e[18]!==f?(p=s.jsxs("div",{className:"flex-1",children:[h,f,v]}),e[17]=h,e[18]=f,e[19]=p):p=e[19];let b;return e[20]!==p||e[21]!==g||e[22]!==x?(b=s.jsxs("div",{className:"flex items-start gap-4",children:[g,x,p]}),e[20]=p,e[21]=g,e[22]=x,e[23]=b):b=e[23],b}function be(){const d=$(),{org:e}=Y(),r=B(),[a,m]=N.useState(!1),o=D({resolver:P(ee),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),u=J({mutationFn:async t=>{const i={name:t.name,slug:t.slug};t.logo&&(i.logo=t.logo);const n=await K.organization.update({organizationId:e.id,data:i});if(n?.error)throw new Error(n.error.message||"Failed to update organization");return n},onSuccess:t=>{r.invalidateQueries({queryKey:I.organizations()}),r.invalidateQueries({queryKey:I.activeOrganization(e.slug)}),C.success("Organization settings updated successfully"),t?.data?.slug&&t.data.slug!==e.slug&&d({to:"/$org/settings",params:{org:t.data.slug}})},onError:t=>{C.error(t instanceof Error?t.message:"Failed to update organization")},onSettled:()=>{m(!1)}}),j=t=>{m(!0),u.mutate(t)},l=o.formState.isDirty;return s.jsxs(W,{children:[s.jsx(T,{title:"Settings"}),s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx("div",{className:"p-5 max-w-2xl",children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Organization"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Update your organization's name, slug, and logo."})]}),s.jsx(Z,{...o,children:s.jsxs("form",{onSubmit:o.handleSubmit(j),className:"space-y-6",children:[s.jsx(k,{control:o.control,name:"name",render:({field:t})=>s.jsxs(R,{children:[s.jsx(E,{children:"Organization Name"}),s.jsx(O,{children:s.jsx(U,{placeholder:"My Organization",...t,disabled:a})}),s.jsx(M,{})]})}),s.jsx(k,{control:o.control,name:"slug",render:({field:t})=>s.jsxs(R,{children:[s.jsx(E,{children:"Organization Slug"}),s.jsx(O,{children:s.jsx(U,{placeholder:"my-organization",...t,disabled:a,onChange:i=>{const n=i.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");t.onChange(n)}})}),s.jsx(G,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(M,{})]})}),s.jsx(k,{control:o.control,name:"logo",render:({field:t})=>s.jsxs(R,{children:[s.jsx(E,{children:"Logo"}),s.jsx(O,{children:s.jsx(se,{value:t.value,onChange:t.onChange,name:o.watch("name")})}),s.jsx(M,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(w,{type:"submit",disabled:!l||a,className:"min-w-24",children:a?"Saving...":"Save Changes"}),l&&s.jsx(w,{type:"button",variant:"outline",onClick:()=>o.reset(),disabled:a,children:"Cancel"})]})]})}),s.jsxs("div",{className:"border-t border-border pt-6 mt-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"More Settings"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Additional configuration options for your organization."})]}),s.jsx("div",{className:"mt-4",children:s.jsxs(Q,{to:"/$org/settings/plugins",params:{org:e.slug},className:"flex items-center justify-between p-4 rounded-lg border border-border hover:bg-accent/50 transition-colors group",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(q,{className:"h-5 w-5 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-foreground",children:"Plugins"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Enable or disable plugins for your organization"})]})]}),s.jsx(V,{className:"h-5 w-5 text-muted-foreground group-hover:text-foreground transition-colors"})]})})]})]})})})})})]})}export{be as default};
1
+ import{r as N,f as $,v as B,z as D,y as P,t as C,K as I,a as K,j as s,a3 as Q,w as A,c as H,x as L}from"./index-pvGhQBw9.js";import{C as T}from"./collection-header-B6vJy14N.js";import{C as W}from"./collection-page-Dt6I6Mr4.js";import{u as Y}from"./project-context-provider-CUiGxKJp.js";import{B as w}from"./button-CICpj3wE.js";import{a as Z,F as k,b as R,c as E,d as O,f as M,e as G}from"./form-f0_t6ok_.js";import{I as U}from"./input-Chnnz9Uq.js";import{u as J}from"./useMutation-B64mCwly.js";import{i as V}from"./Grid01-CoHgfBeE.js";import{i as X}from"./Upload01-BGvogcXt.js";import{i as _}from"./X-q5bh176U.js";import"./collection-display-button-3hmFOeDC.js";import"./dropdown-menu-D1uHrxpy.js";import"./ArrowUp-CXsDJznS.js";import"./Check-BEhtk6Py.js";import"./List-BXC8ldIg.js";import"./tooltip-DySBr2SY.js";import"./view-mode-toggle-DXknlAX3.js";const q=({size:d=24,color:e="currentColor",...r})=>N.createElement("svg",{viewBox:"0 0 24 24",width:d,height:d,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},N.createElement("path",{d:"m2 14.5 9.642 4.821c.131.066.197.099.266.111.06.012.123.012.184 0 .069-.012.135-.045.266-.11L22 14.5m-20-5 9.642-4.821c.131-.066.197-.098.266-.111a.5.5 0 0 1 .184 0c.069.013.135.045.266.111L22 9.5l-9.642 4.821a1.028 1.028 0 0 1-.266.111.501.501 0 0 1-.184 0c-.069-.012-.135-.045-.266-.11L2 9.5Z"}));q.displayName="LayersTwo01";const ee=A({name:L().min(1,"Name is required").max(255,"Name is too long"),slug:L().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:L().optional()});function se(d){const e=H.c(24),{value:r,onChange:a,name:m}=d,o=N.useRef(null);let u;e[0]!==a?(u=S=>{const F=S.target.files?.[0];if(F){if(F.size>2097152){C.error("Image must be smaller than 2MB");return}const c=new FileReader;c.onerror=()=>{const y=c.error;console.error("FileReader error:",y),C.error(y?.message||"Failed to read image file. Please try again."),o.current&&(o.current.value="")},c.onloadend=()=>{if(c.readyState===FileReader.DONE&&c.result){const y=c.result;a(y)}},c.readAsDataURL(F)}},e[0]=a,e[1]=u):u=e[1];const j=u;let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{o.current?.click()},e[2]=l):l=e[2];const t=l;let i;e[3]!==a?(i=S=>{S.stopPropagation(),a("")},e[3]=a,e[4]=i):i=e[4];const n=i;let g;e[5]!==j?(g=s.jsx("input",{type:"file",ref:o,className:"hidden",accept:"image/*",onChange:j}),e[5]=j,e[6]=g):g=e[6];let x;e[7]!==n||e[8]!==m||e[9]!==r?(x=r?s.jsxs("div",{className:"relative group",children:[s.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:s.jsx("img",{src:r,alt:m||"Organization logo",className:"w-full h-full object-cover"})}),s.jsx("button",{type:"button",onClick:n,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:s.jsx(_,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:t,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground",children:[s.jsx(X,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),e[7]=n,e[8]=m,e[9]=r,e[10]=x):x=e[10];const z=r?"Change Logo":"Upload Logo";let h;e[11]!==z?(h=s.jsx(w,{type:"button",variant:"outline",size:"sm",onClick:t,className:"mb-2",children:z}),e[11]=z,e[12]=h):h=e[12];let f;e[13]!==n||e[14]!==r?(f=r&&s.jsx(w,{type:"button",variant:"ghost",size:"sm",onClick:n,className:"ml-2",children:"Remove"}),e[13]=n,e[14]=r,e[15]=f):f=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),e[16]=v):v=e[16];let p;e[17]!==h||e[18]!==f?(p=s.jsxs("div",{className:"flex-1",children:[h,f,v]}),e[17]=h,e[18]=f,e[19]=p):p=e[19];let b;return e[20]!==p||e[21]!==g||e[22]!==x?(b=s.jsxs("div",{className:"flex items-start gap-4",children:[g,x,p]}),e[20]=p,e[21]=g,e[22]=x,e[23]=b):b=e[23],b}function be(){const d=$(),{org:e}=Y(),r=B(),[a,m]=N.useState(!1),o=D({resolver:P(ee),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),u=J({mutationFn:async t=>{const i={name:t.name,slug:t.slug};t.logo&&(i.logo=t.logo);const n=await K.organization.update({organizationId:e.id,data:i});if(n?.error)throw new Error(n.error.message||"Failed to update organization");return n},onSuccess:t=>{r.invalidateQueries({queryKey:I.organizations()}),r.invalidateQueries({queryKey:I.activeOrganization(e.slug)}),C.success("Organization settings updated successfully"),t?.data?.slug&&t.data.slug!==e.slug&&d({to:"/$org/settings",params:{org:t.data.slug}})},onError:t=>{C.error(t instanceof Error?t.message:"Failed to update organization")},onSettled:()=>{m(!1)}}),j=t=>{m(!0),u.mutate(t)},l=o.formState.isDirty;return s.jsxs(W,{children:[s.jsx(T,{title:"Settings"}),s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx("div",{className:"p-5 max-w-2xl",children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Organization"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Update your organization's name, slug, and logo."})]}),s.jsx(Z,{...o,children:s.jsxs("form",{onSubmit:o.handleSubmit(j),className:"space-y-6",children:[s.jsx(k,{control:o.control,name:"name",render:({field:t})=>s.jsxs(R,{children:[s.jsx(E,{children:"Organization Name"}),s.jsx(O,{children:s.jsx(U,{placeholder:"My Organization",...t,disabled:a})}),s.jsx(M,{})]})}),s.jsx(k,{control:o.control,name:"slug",render:({field:t})=>s.jsxs(R,{children:[s.jsx(E,{children:"Organization Slug"}),s.jsx(O,{children:s.jsx(U,{placeholder:"my-organization",...t,disabled:a,onChange:i=>{const n=i.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");t.onChange(n)}})}),s.jsx(G,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(M,{})]})}),s.jsx(k,{control:o.control,name:"logo",render:({field:t})=>s.jsxs(R,{children:[s.jsx(E,{children:"Logo"}),s.jsx(O,{children:s.jsx(se,{value:t.value,onChange:t.onChange,name:o.watch("name")})}),s.jsx(M,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(w,{type:"submit",disabled:!l||a,className:"min-w-24",children:a?"Saving...":"Save Changes"}),l&&s.jsx(w,{type:"button",variant:"outline",onClick:()=>o.reset(),disabled:a,children:"Cancel"})]})]})}),s.jsxs("div",{className:"border-t border-border pt-6 mt-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"More Settings"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Additional configuration options for your organization."})]}),s.jsx("div",{className:"mt-4",children:s.jsxs(Q,{to:"/$org/settings/plugins",params:{org:e.slug},className:"flex items-center justify-between p-4 rounded-lg border border-border hover:bg-accent/50 transition-colors group",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(q,{className:"h-5 w-5 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-foreground",children:"Plugins"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Enable or disable plugins for your organization"})]})]}),s.jsx(V,{className:"h-5 w-5 text-muted-foreground group-hover:text-foreground transition-colors"})]})})]})]})})})})})]})}export{be as default};
@@ -1,3 +1,3 @@
1
- import{r as S,e as es,a as q,j as n,f as ze,t as Y,c as h,R as ts,T as ss,D as ns,C as as,P as os,g as is,O as ls,h as rs,i as cs,k as Nt,p as ds,l as ms,d as wt,G as fs,m as us,S as yt,n as ps,o as hs,N as xs,q as gs,K as bs,s as Ct}from"./index-Dk3lubBQ.js";import{E as lt}from"./error-boundary-DU6_J5et.js";import{B as J,c as T}from"./button-2azNqzUx.js";import{P as _t,a as kt,b as It}from"./popover-HE15ABOl.js";import{B as ft}from"./badge-CMZTNGZo.js";import{i as Ge}from"./Check-VfxUlV5P.js";import{n as ut}from"./Inbox01-y9RgqkXP.js";import{s as pt}from"./XClose-C895iFVX.js";import{i as js}from"./File06-DCHrHfbn.js";import{i as $e}from"./X-CVhiWYv-.js";import{u as Me}from"./use-mobile-CuBmA9jm.js";import{T as $t,a as zt,b as Mt,c as Ot}from"./tooltip-DHS6wGWv.js";import{S as Tt,u as vs,a as Ss,b as Ns,c as ws,N as ys,G as at,T as Cs,d as _s,D as ks}from"./thread-history-popover-DlGwptvV.js";import{u as rt,a as Is}from"./use-organization-settings-BNK4p5TK.js";import{u as Fe,L as ht,P as $s,O as zs}from"./project-context-provider-B1gr9e2f.js";import{n as Ms,I as xt}from"./empty-state-C3NzxCFI.js";import{i as ot}from"./use-gateway-Ck94EUZ3.js";import{a as Os}from"./Home02-CnvrJTir.js";import{C as Ts}from"./create-organization-dialog-MS4oQ7Sl.js";import{I as As}from"./input-CBrhxHNe.js";import{A as ee}from"./avatar-BLmwViC3.js";import{c as Rs}from"./Grid01-AMlhaaWH.js";import{D as Es,a as Ps,b as Ds,c as Ls,u as Bs,d as Hs,e as Us,C as P,f as gt,g as Gs,h as Fs,i as Ws,U as Vs,G as Ks,M as Zs}from"./index-C5xxIZ3a.js";import{D as Ys,a as qs,b as Js,c as Xs,d as bt}from"./dropdown-menu-DRkETp4T.js";import{a as At}from"./Copy01-dbjgqDL6.js";import{n as jt}from"./LinkExternal01-DzBB4jwo.js";import{D as Qs,a as en,b as tn,c as sn,d as nn}from"./dialog-DSU0GEtE.js";import{L as an}from"./form-DM9msJYn.js";import{S as on}from"./switch-C9XtHYD0.js";import{i as ln}from"./Code01-B9DNMb5j.js";import{u as We,L as Ve}from"./localstorage-keys-BJk6gyyN.js";import{R as Rt,a as rn,b as cn}from"./resizable-B8j7Xubf.js";import{s as dn}from"./Plus-CgcZFggs.js";import{u as mn}from"./use-connection-BhdfednN.js";import{u as fn}from"./use-binding-Cn24Ren1.js";import"./use-gateway-system-prompt-C9-1moLN.js";import"./ChevronDown-OK90XtVB.js";import"./Edit01-Ddbn6DsS.js";import"./well-known-mcp-D13f-8h2.js";import"./generate-id-Dyweu44Y.js";import"./Clock-CRgmR_1n.js";import"./SearchMd-DRJ07Awx.js";import"./Trash01-BDWyzvD2.js";import"./useMutation-BEX5R6ly.js";import"./connection-CXC8d3Ae.js";import"./use-collections-CbsNEj5T.js";import"./alert-dialog-D9k51qgG.js";import"./spinner-Dwr2EFZD.js";import"./use-create-gateway-dtd5LmVR.js";import"./AlertCircle-DeHvJZzp.js";import"./ArrowUp-B2eKsIZo.js";import"./textarea-CyM57U4B.js";import"./Terminal-FTJQx4pc.js";import"./monaco-editor-B2ZJ-0S4.js";import"./select-DkAjMxeq.js";import"./Image01-Bch9iOev.js";import"./InfoCircle-HrYndWCZ.js";import"./useQuery-BbeI5BfO.js";import"./binder-Bcr51BHa.js";const Et=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M9 7H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 7.76 3 8.04 3 8.6v10.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21H9m0 0h6m-6 0V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 3 10.04 3 10.6 3h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 3.76 15 4.04 15 4.6V21m0-10h4.4c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C21 11.76 21 12.04 21 12.6v6.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C20.24 21 19.96 21 19.4 21H15"}));Et.displayName="BarChart10";const Pt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M15 21v-5.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 14 13.96 14 13.4 14h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 14.76 9 15.04 9 15.6V21M3 7a3 3 0 0 0 6 0 3 3 0 1 0 6 0 3 3 0 1 0 6 0M6.2 21h11.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3H6.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21Z"}));Pt.displayName="Building02";const Dt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"}));Dt.displayName="ChevronSelectorVertical";const Lt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M2 12h20M2 12c0 5.523 4.477 10 10 10M2 12C2 6.477 6.477 2 12 2m10 10c0 5.523-4.477 10-10 10m10-10c0-5.523-4.477-10-10-10m0 0a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10m0-20a15.3 15.3 0 0 0-4 10 15.3 15.3 0 0 0 4 10"}));Lt.displayName="Globe01";const Bt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M15 3v18M7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3Z"}));Bt.displayName="LayoutRight";const Ht=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"m16 17 5-5m0 0-5-5m5 5H9m0-9H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21H9"}));Ht.displayName="LogOut01";const Ut=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"m2 7 8.165 5.715c.661.463.992.695 1.351.784a2 2 0 0 0 .968 0c.36-.09.69-.32 1.351-.784L22 7M6.8 20h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 17.72 22 16.88 22 15.2V8.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 4 18.88 4 17.2 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v6.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 20 5.12 20 6.8 20Z"}));Ut.displayName="Mail01";const ct=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}),S.createElement("path",{d:"M18.727 14.727a1.5 1.5 0 0 0 .3 1.655l.055.054a1.816 1.816 0 0 1 0 2.573 1.818 1.818 0 0 1-2.573 0l-.055-.055a1.5 1.5 0 0 0-1.654-.3 1.5 1.5 0 0 0-.91 1.373v.155a1.818 1.818 0 1 1-3.636 0V20.1a1.5 1.5 0 0 0-.981-1.373 1.5 1.5 0 0 0-1.655.3l-.054.055a1.818 1.818 0 0 1-3.106-1.287 1.818 1.818 0 0 1 .533-1.286l.054-.055a1.5 1.5 0 0 0 .3-1.654 1.5 1.5 0 0 0-1.372-.91h-.155a1.818 1.818 0 1 1 0-3.636H3.9a1.5 1.5 0 0 0 1.373-.981 1.5 1.5 0 0 0-.3-1.655l-.055-.054A1.818 1.818 0 1 1 7.491 4.99l.054.054a1.5 1.5 0 0 0 1.655.3h.073a1.5 1.5 0 0 0 .909-1.372v-.155a1.818 1.818 0 0 1 3.636 0V3.9a1.499 1.499 0 0 0 .91 1.373 1.5 1.5 0 0 0 1.654-.3l.054-.055a1.817 1.817 0 0 1 2.573 0 1.819 1.819 0 0 1 0 2.573l-.055.054a1.5 1.5 0 0 0-.3 1.655v.073a1.5 1.5 0 0 0 1.373.909h.155a1.818 1.818 0 0 1 0 3.636H20.1a1.499 1.499 0 0 0-1.373.91Z"}));ct.displayName="Settings01";const Gt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M22 21v-2a4.002 4.002 0 0 0-3-3.874M15.5 3.291a4.001 4.001 0 0 1 0 7.418M17 21c0-1.864 0-2.796-.305-3.53a4 4 0 0 0-2.164-2.165C13.796 15 12.864 15 11 15H8c-1.864 0-2.796 0-3.53.305a4 4 0 0 0-2.166 2.164C2 18.204 2 19.136 2 21M13.5 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}));Gt.displayName="Users01";const Ft=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M13 2 4.093 12.688c-.348.418-.523.628-.525.804a.5.5 0 0 0 .185.397c.138.111.41.111.955.111H12l-1 8 8.907-10.688c.348-.418.523-.628.525-.804a.5.5 0 0 0-.185-.397c-.138-.111-.41-.111-.955-.111H12l1-8Z"}));Ft.displayName="Zap";function un({invitation:t,onStatusChange:e}){const[s,a]=S.useState(!1),[o,i]=S.useState(!1),l=ze(),r=async()=>{a(!0);try{const u=await q.organization.acceptInvitation({invitationId:t.id});if(u.error)Y.error(u.error.message),a(!1);else{e(t.id,"accepted");const x=await q.organization.setActive({organizationId:t.organizationId});x?.data?.slug?(Y.success("Invitation accepted!"),l({to:"/$org",params:{org:x.data.slug}})):(Y.success("Invitation accepted! Redirecting..."),l({to:"/"}))}}catch{Y.error("Failed to accept invitation"),a(!1)}},c=async()=>{i(!0);try{const u=await q.organization.rejectInvitation({invitationId:t.id});u.error?(Y.error(u.error.message),i(!1)):(Y.success("Invitation rejected"),e(t.id,"rejected"),i(!1))}catch{Y.error("Failed to reject invitation"),i(!1)}},d=t.organizationName||t.organizationId,m=t.inviter?.name||t.inviter?.email||t.email||"Someone",f=t.status==="pending",p=t.status==="accepted",b=t.status==="rejected";return n.jsxs("div",{className:`flex items-center gap-3 px-3 py-2 h-12 border-b border-border/50 last:border-b-0 ${f?"":"opacity-50"}`,children:[n.jsx("div",{className:"shrink-0 size-5 flex items-center justify-center",children:n.jsx(Ut,{size:16,className:"text-muted-foreground"})}),n.jsxs("p",{className:"flex-1 text-sm text-foreground min-w-0 whitespace-nowrap overflow-hidden",children:[n.jsx("span",{className:"font-semibold inline-block max-w-[120px] truncate align-bottom",children:m})," invited you to join ",n.jsx("span",{className:"font-semibold inline-block max-w-[200px] truncate align-bottom",children:d})]}),n.jsx("div",{className:"flex items-center gap-1 shrink-0",children:f?n.jsxs(n.Fragment,{children:[n.jsx(J,{variant:"ghost",size:"icon",onClick:c,disabled:s||o,className:"h-8 w-8",children:n.jsx(pt,{size:14})}),n.jsx(J,{variant:"outline",size:"icon",onClick:r,disabled:s||o,className:"h-8 w-8",children:n.jsx(Ge,{size:14})})]}):p?n.jsxs(ft,{variant:"outline",className:"h-6 px-2 text-xs",children:[n.jsx(Ge,{size:12}),"Accepted"]}):b?n.jsxs(ft,{variant:"outline",className:"h-6 px-2 text-xs",children:[n.jsx(pt,{size:12}),"Declined"]}):null})]})}function pn(){const[t,e]=S.useState(!1),s=S.useContext(es),{data:a}=s.hooks.useListUserInvitations(),{data:o}=q.useListOrganizations(),[i,l]=S.useState({}),d=(a??[]).map(u=>{const x=(o??[]).find(g=>g.id===u.organizationId);return{...u,organizationSlug:x?.slug||u.organizationSlug,organizationName:x?.name||u.organizationName}}).map(u=>({...u,status:i[u.id]||u.status})),m=[...d].sort((u,x)=>{const g={pending:0,accepted:1,rejected:2};return(g[u.status]??999)-(g[x.status]??999)}),p=d.filter(u=>u.status==="pending").length>0,b=(u,x)=>{l(g=>({...g,[u]:x}))};return n.jsxs(_t,{open:t,onOpenChange:e,children:[n.jsx(kt,{asChild:!0,children:n.jsxs(J,{variant:"ghost",size:"sm",className:"relative h-7 w-7 p-0","aria-label":"Inbox",children:[n.jsx(ut,{size:18,className:"text-muted-foreground"}),p&&n.jsx("span",{className:"absolute bottom-1 right-0.5 h-2 w-2 rounded-full bg-destructive ring-2 ring-background"})]})}),n.jsxs(It,{align:"end",className:"w-[480px] p-0 overflow-hidden",children:[n.jsx("div",{className:"px-4 py-3 border-b border-border",children:n.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Inbox"})}),n.jsx("div",{className:"max-h-96 overflow-auto",children:m.length>0?m.map(u=>n.jsx(un,{invitation:u,onStatusChange:b},u.id)):n.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[n.jsx(ut,{size:32,className:"text-muted-foreground/40 mb-2"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"No invitations at the moment"})]})})]})]})}function hn(t){const e=h.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n.jsx(ts,{"data-slot":"sheet",...s}),e[2]=s,e[3]=a):a=e[3],a}function xn(t){const e=h.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n.jsx(os,{"data-slot":"sheet-portal",...s}),e[2]=s,e[3]=a):a=e[3],a}function gn(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx(ls,{"data-slot":"sheet-overlay",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}function bn(t){const e=h.c(17);let s,a,o,i;e[0]!==t?({className:a,children:s,side:i,...o}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=i):(s=e[1],a=e[2],o=e[3],i=e[4]);const l=i===void 0?"right":i;let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(gn,{}),e[5]=r):r=e[5];const c=l==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",d=l==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",m=l==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",f=l==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t";let p;e[6]!==a||e[7]!==c||e[8]!==d||e[9]!==m||e[10]!==f?(p=T("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",c,d,m,f,a),e[6]=a,e[7]=c,e[8]=d,e[9]=m,e[10]=f,e[11]=p):p=e[11];let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsxs(is,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[n.jsx($e,{className:"size-4"}),n.jsx("span",{className:"sr-only",children:"Close"})]}),e[12]=b):b=e[12];let u;return e[13]!==s||e[14]!==o||e[15]!==p?(u=n.jsxs(xn,{children:[r,n.jsxs(as,{"data-slot":"sheet-content",className:p,...o,children:[s,b]})]}),e[13]=s,e[14]=o,e[15]=p,e[16]=u):u=e[16],u}function jn(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("flex flex-col gap-1.5 p-4",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx("div",{"data-slot":"sheet-header",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}function vn(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("text-foreground font-semibold",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx(ss,{"data-slot":"sheet-title",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}function Sn(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("text-muted-foreground text-sm",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx(ns,{"data-slot":"sheet-description",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}const Nn="sidebar_state",wn=3600*24*7,yn="16rem",Cn="18rem",_n="3rem",kn="b",Wt=S.createContext(null);function dt(){const t=S.useContext(Wt);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function In(t){const e=h.c(21),{defaultOpen:s,open:a,onOpenChange:o,children:i}=t,l=s===void 0?!0:s,r=Me(),[c,d]=S.useState(!1),[m,f]=S.useState(l),p=a??m;let b;e[0]!==p||e[1]!==o?(b=O=>{const _=typeof O=="function"?O(p):O;o?o(_):f(_),document.cookie=`${Nn}=${_}; path=/; max-age=${wn}`},e[0]=p,e[1]=o,e[2]=b):b=e[2];const u=b;let x;e[3]!==r||e[4]!==u?(x=()=>r?d(zn):u($n),e[3]=r,e[4]=u,e[5]=x):x=e[5];const g=x;let j,v;e[6]!==g?(j=()=>{const O=_=>{if(_.key===kn&&(_.metaKey||_.ctrlKey)){const M=_.target;if(M.tagName==="INPUT"||M.tagName==="TEXTAREA"||M.isContentEditable)return;_.preventDefault(),g()}};return globalThis.addEventListener("keydown",O),()=>globalThis.removeEventListener("keydown",O)},v=[g],e[6]=g,e[7]=j,e[8]=v):(j=e[7],v=e[8]),S.useEffect(j,v);const w=p?"expanded":"collapsed";let $;e[9]!==r||e[10]!==p||e[11]!==c||e[12]!==u||e[13]!==w||e[14]!==g?($={state:w,open:p,setOpen:u,isMobile:r,openMobile:c,setOpenMobile:d,toggleSidebar:g},e[9]=r,e[10]=p,e[11]=c,e[12]=u,e[13]=w,e[14]=g,e[15]=$):$=e[15];const y=$;let N;e[16]!==i?(N=n.jsx(zt,{delayDuration:0,children:i}),e[16]=i,e[17]=N):N=e[17];let C;return e[18]!==y||e[19]!==N?(C=n.jsx(Wt.Provider,{value:y,children:N}),e[18]=y,e[19]=N,e[20]=C):C=e[20],C}function $n(t){return!t}function zn(t){return!t}function Mn(t){const e=h.c(14);let s,a,o,i;e[0]!==t?({className:a,style:i,children:s,...o}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=i):(s=e[1],a=e[2],o=e[3],i=e[4]);let l;e[5]!==i?(l={"--sidebar-width":yn,"--sidebar-width-icon":_n,...i},e[5]=i,e[6]=l):l=e[6];const r=l;let c;e[7]!==a?(c=T("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",a),e[7]=a,e[8]=c):c=e[8];let d;return e[9]!==s||e[10]!==o||e[11]!==r||e[12]!==c?(d=n.jsx("div",{"data-slot":"sidebar-wrapper",style:r,className:c,...o,children:s}),e[9]=s,e[10]=o,e[11]=r,e[12]=c,e[13]=d):d=e[13],d}function On(t){const e=h.c(46);let s,a,o,i,l,r;e[0]!==t?({side:i,variant:l,collapsible:r,className:a,children:s,...o}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=i,e[5]=l,e[6]=r):(s=e[1],a=e[2],o=e[3],i=e[4],l=e[5],r=e[6]);const c=i===void 0?"left":i,d=l===void 0?"sidebar":l,m=r===void 0?"offcanvas":r,{isMobile:f,state:p,openMobile:b,setOpenMobile:u}=dt();if(m==="none"){let _;e[7]!==a?(_=T("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",a),e[7]=a,e[8]=_):_=e[8];let M;return e[9]!==s||e[10]!==o||e[11]!==_?(M=n.jsx("div",{"data-slot":"sidebar",className:_,...o,children:s}),e[9]=s,e[10]=o,e[11]=_,e[12]=M):M=e[12],M}if(f){let _;e[13]===Symbol.for("react.memo_cache_sentinel")?(_={"--sidebar-width":Cn},e[13]=_):_=e[13];let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=n.jsxs(jn,{className:"sr-only",children:[n.jsx(vn,{children:"Sidebar"}),n.jsx(Sn,{children:"Displays the mobile sidebar."})]}),e[14]=M):M=e[14];let k;e[15]!==s?(k=n.jsx("div",{className:"flex h-full w-full flex-col",children:s}),e[15]=s,e[16]=k):k=e[16];let I;e[17]!==c||e[18]!==k?(I=n.jsxs(bn,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:_,side:c,children:[M,k]}),e[17]=c,e[18]=k,e[19]=I):I=e[19];let A;return e[20]!==b||e[21]!==o||e[22]!==u||e[23]!==I?(A=n.jsx(hn,{open:b,onOpenChange:u,...o,children:I}),e[20]=b,e[21]=o,e[22]=u,e[23]=I,e[24]=A):A=e[24],A}const x=p==="collapsed"?m:"",g=d==="floating"||d==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let j;e[25]!==g?(j=T("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",g),e[25]=g,e[26]=j):j=e[26];let v;e[27]!==j?(v=n.jsx("div",{"data-slot":"sidebar-gap",className:j}),e[27]=j,e[28]=v):v=e[28];const w=c==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",$=d==="floating"||d==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let y;e[29]!==a||e[30]!==w||e[31]!==$?(y=T("fixed top-12 bottom-0 z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",w,$,a),e[29]=a,e[30]=w,e[31]=$,e[32]=y):y=e[32];let N;e[33]!==s?(N=n.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border py-2 flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s}),e[33]=s,e[34]=N):N=e[34];let C;e[35]!==o||e[36]!==y||e[37]!==N?(C=n.jsx("div",{"data-slot":"sidebar-container",className:y,...o,children:N}),e[35]=o,e[36]=y,e[37]=N,e[38]=C):C=e[38];let O;return e[39]!==c||e[40]!==p||e[41]!==C||e[42]!==x||e[43]!==v||e[44]!==d?(O=n.jsxs("div",{className:"group peer text-foreground hidden md:block border-r","data-state":p,"data-collapsible":x,"data-variant":d,"data-side":c,"data-slot":"sidebar",children:[v,C]}),e[39]=c,e[40]=p,e[41]=C,e[42]=x,e[43]=v,e[44]=d,e[45]=O):O=e[45],O}function Tn(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx("main",{"data-slot":"sidebar-inset",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}function An(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("h-4 m-0! w-full",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx("div",{"data-sidebar":"separator",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}function Rn(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}function En(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}function Pn(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("w-full text-sm",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}function Dn(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("flex w-full min-w-0 flex-col gap-1",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}function Ke(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("group/menu-item relative",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}const Ln=rs("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-lg px-2 py-1.5 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding,colors] transition-colors duration-150 ease-out hover:transition-none focus-visible:ring-2 active:bg-sidebar-accent/75 disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent/75 [&>span:last-child]:truncate [&>svg]:size-[18px] [&>svg]:shrink-0 [&>svg]:text-muted-foreground",{variants:{variant:{default:"hover:bg-sidebar-accent text-sidebar-foreground/80 active:text-sidebar-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-7 text-sm font-[450]",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Vt(t){const e=h.c(28);let s,a,o,i,l,r,c;e[0]!==t?({asChild:o,isActive:i,variant:l,size:r,tooltip:c,className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=i,e[5]=l,e[6]=r,e[7]=c):(s=e[1],a=e[2],o=e[3],i=e[4],l=e[5],r=e[6],c=e[7]);const d=o===void 0?!1:o,m=i===void 0?!1:i,f=l===void 0?"default":l,p=r===void 0?"default":r,b=d?cs:"button",{isMobile:u,state:x}=dt();let g;e[8]!==s||e[9]!==p||e[10]!==f?(g=T(Ln({variant:f,size:p}),s),e[8]=s,e[9]=p,e[10]=f,e[11]=g):g=e[11];let j;e[12]!==b||e[13]!==m||e[14]!==a||e[15]!==p||e[16]!==g?(j=n.jsx(b,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":p,"data-active":m,className:g,...a}),e[12]=b,e[13]=m,e[14]=a,e[15]=p,e[16]=g,e[17]=j):j=e[17];const v=j;if(!c)return v;if(typeof c=="string"){let C;e[18]!==c?(C={children:c},e[18]=c,e[19]=C):C=e[19],c=C}let w;e[20]!==v?(w=n.jsx(Mt,{asChild:!0,children:v}),e[20]=v,e[21]=w):w=e[21];const $=x!=="collapsed"||u;let y;e[22]!==$||e[23]!==c?(y=n.jsx($t,{side:"right",align:"center",hidden:$,...c}),e[22]=$,e[23]=c,e[24]=y):y=e[24];let N;return e[25]!==w||e[26]!==y?(N=n.jsxs(Ot,{children:[w,y]}),e[25]=w,e[26]=y,e[27]=N):N=e[27],N}function Bn(t){const e=h.c(26),{item:s}=t,a=ze(),{org:o}=Fe(),i=rt(o.id),l=Is(o.id);let r;e[0]!==l.update||e[1]!==s.url||e[2]!==i?.sidebar_items?(r=async()=>{const $=(i?.sidebar_items||[]).filter(y=>y.url!==s.url);await l.update.mutateAsync({sidebar_items:$})},e[0]=l.update,e[1]=s.url,e[2]=i?.sidebar_items,e[3]=r):r=e[3];const c=r;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=/^https?:\/\/.+/,e[4]=d):d=e[4];let m;e[5]!==s.icon?(m=d.test(s.icon),e[5]=s.icon,e[6]=m):m=e[6];const f=m;let p;e[7]!==s.url||e[8]!==a?(p=()=>{a({to:s.url})},e[7]=s.url,e[8]=a,e[9]=p):p=e[9];const b=s.title;let u;e[10]!==f||e[11]!==s.icon||e[12]!==s.title?(u=n.jsx("div",{className:"flex items-center justify-center shrink-0",children:f?n.jsx("img",{src:s.icon,alt:s.title,className:"h-4 w-4 rounded object-cover"}):n.jsx(js,{size:16,className:"text-muted-foreground group-hover/item:text-foreground transition-colors"})}),e[10]=f,e[11]=s.icon,e[12]=s.title,e[13]=u):u=e[13];let x;e[14]!==s.title?(x=s.title.toLocaleLowerCase(),e[14]=s.title,e[15]=x):x=e[15];let g;e[16]!==x?(g=n.jsx("div",{className:"flex-1 min-w-0 flex flex-col items-start",children:n.jsx("span",{className:"truncate text-sm w-full capitalize",children:x})}),e[16]=x,e[17]=g):g=e[17];let j;e[18]!==c?(j=n.jsx($e,{size:16,className:"text-muted-foreground opacity-0 group-hover/item:opacity-50 hover:opacity-100 cursor-pointer",onClick:w=>{w.preventDefault(),w.stopPropagation(),c()}}),e[18]=c,e[19]=j):j=e[19];let v;return e[20]!==s.title||e[21]!==p||e[22]!==u||e[23]!==g||e[24]!==j?(v=n.jsx(Ke,{children:n.jsxs(Vt,{className:"w-full pr-2 group/item relative cursor-pointer text-foreground/90 hover:text-foreground",onClick:p,tooltip:b,children:[u,g,j]})}),e[20]=s.title,e[21]=p,e[22]=u,e[23]=g,e[24]=j,e[25]=v):v=e[25],v}function Hn(){const t=h.c(4),{org:e}=Fe(),a=rt(e.id)?.sidebar_items;if(!a?.length)return null;let o;t[0]!==a?(o=a.map(Un),t[0]=a,t[1]=o):o=t[1];let i;return t[2]!==o?(i=n.jsx(Kt,{children:o}),t[2]=o,t[3]=i):i=t[3],i}function Un(t){return n.jsx(Bn,{item:t},t.url)}function vt(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Ke,{children:n.jsx("div",{className:"flex items-center gap-2 px-4 py-2",children:n.jsx(Tt,{className:"h-4 flex-1"})})}),t[0]=e):e=t[0],e}function Kt(t){const e=h.c(4),{children:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(An,{className:"my-2 -ml-1"}),e[0]=a):a=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(Ke,{children:n.jsx("div",{className:"group-data-[collapsible=icon]:hidden px-2 py-0 text-xs font-medium h-6 text-muted-foreground flex items-center justify-between",children:n.jsx("span",{className:"whitespace-nowrap",children:"Pinned Views"})})}),e[1]=o):o=e[1];let i;return e[2]!==s?(i=n.jsxs(n.Fragment,{children:[a,o,s]}),e[2]=s,e[3]=i):i=e[3],i}function Gn(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(S.Suspense,{fallback:n.jsxs(Kt,{children:[n.jsx(vt,{}),n.jsx(vt,{})]}),children:n.jsx(Hn,{})}),t[0]=e):e=t[0],e}function Fn(){const t=h.c(14),{locator:e,org:s}=Fe(),a=ze(),o=Nt(),{org:i}=ht.parse(e);let l;t[0]!==e?(l=ht.isOrgAdminProject(e),t[0]=e,t[1]=l):l=t[1];const r=l,c=rt(s.id);let d;t[2]!==c?.enabled_plugins?(d=c?.enabled_plugins??[],t[2]=c?.enabled_plugins,t[3]=d):d=t[3];const m=d;let f;t[4]!==m?(f=C=>m.includes(C.pluginId),t[4]=m,t[5]=f):f=t[5];const p=ds.filter(f),b=o.location.pathname===`/${i}`||o.location.pathname===`/${i}/`;let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Os,{}),t[6]=u):u=t[6];let x;t[7]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(Pt,{}),t[7]=x):x=t[7];let g;t[8]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(Ms,{}),t[8]=g):g=t[8];let j;t[9]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(ot,{}),t[9]=j):j=t[9];let v;t[10]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Ft,{}),t[10]=v):v=t[10];let w;t[11]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(Et,{}),t[11]=w):w=t[11];let $;t[12]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx(Gt,{}),t[12]=$):$=t[12];let y;t[13]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(ct,{}),t[13]=y):y=t[13];const N=[{key:"home",label:"Home",icon:u,onClick:()=>{b?window.dispatchEvent(new CustomEvent("reset-home-view")):a({to:"/$org",params:{org:i}})}},{key:"store",label:"Store",icon:x,onClick:()=>a({to:"/$org/store",params:{org:i}})},...p.map(C=>({key:C.pluginId,label:C.label,icon:C.icon,onClick:()=>a({to:"/$org/$pluginId",params:{org:i,pluginId:C.pluginId}})})),{key:"mcps",label:"Connections",icon:g,onClick:()=>a({to:"/$org/mcps",params:{org:i}})},{key:"gateways",label:"Agents",icon:j,onClick:()=>a({to:"/$org/gateways",params:{org:i}})},{key:"workflow",label:"Workflows",icon:v,onClick:()=>a({to:"/$org/workflows",params:{org:i}})},{key:"monitoring",label:"Monitoring",icon:w,onClick:()=>a({to:"/$org/monitoring",params:{org:i}})},{key:"members",label:"Members",icon:$,onClick:()=>a({to:"/$org/members",params:{org:i}})},{key:"settings",label:"Settings",icon:y,onClick:()=>a({to:"/$org/settings",params:{org:i}})}];return r?N:[]}function Zt(t){const e=h.c(10),{navigationItems:s,footer:a,additionalContent:o,variant:i,collapsible:l}=t,r=i===void 0?"sidebar":i,c=l===void 0?"icon":l;let d;e[0]!==s?(d=s.map(Wn),e[0]=s,e[1]=d):d=e[1];let m;e[2]!==o||e[3]!==d?(m=n.jsx(Rn,{className:"flex-1 overflow-x-hidden",children:n.jsx(En,{className:"font-medium",children:n.jsx(Pn,{children:n.jsxs(Dn,{className:"gap-0.5",children:[d,o]})})})}),e[2]=o,e[3]=d,e[4]=m):m=e[4];let f;return e[5]!==c||e[6]!==a||e[7]!==m||e[8]!==r?(f=n.jsxs(On,{variant:r,collapsible:c,children:[m,a]}),e[5]=c,e[6]=a,e[7]=m,e[8]=r,e[9]=f):f=e[9],f}function Wn(t){return n.jsx(Ke,{children:n.jsxs(Vt,{className:"group/nav-item cursor-pointer text-foreground/90 hover:text-foreground",onClick:t.onClick,isActive:t.isActive,tooltip:t.label,children:[n.jsx("span",{className:"text-muted-foreground group-hover/nav-item:text-foreground transition-colors [&>svg]:size-4",children:t.icon}),n.jsx("span",{className:"truncate",children:t.label})]})},t.key)}Zt.Skeleton=function(){return n.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,s)=>n.jsx("div",{className:"w-full h-8",children:n.jsx(Tt,{className:"h-full bg-sidebar-accent rounded-md"})},s))})};function Vn(){const t=h.c(3),e=Fn();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(n.Fragment,{children:n.jsx(lt,{children:n.jsx(S.Suspense,{fallback:null,children:n.jsx(Gn,{})})})}),t[0]=s):s=t[0];let a;return t[1]!==e?(a=n.jsx(Zt,{navigationItems:e,additionalContent:s}),t[1]=e,t[2]=a):a=t[2],a}function Kn(t){const e=h.c(12);let s,a,o,i;e[0]!==t?({className:s,orientation:o,decorative:i,...a}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=i):(s=e[1],a=e[2],o=e[3],i=e[4]);const l=o===void 0?"horizontal":o,r=i===void 0?!0:i;let c;e[5]!==s?(c=T("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",s),e[5]=s,e[6]=c):c=e[6];let d;return e[7]!==r||e[8]!==l||e[9]!==a||e[10]!==c?(d=n.jsx(ms,{"data-slot":"separator-root",decorative:r,orientation:l,className:c,...a}),e[7]=r,e[8]=l,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}const Yt=S.createContext(null);function Zn(){const t=S.useContext(Yt);if(!t)throw new Error("TopbarSwitcher compound components must be used within TopbarSwitcher.Root");return t}function Yn(t){const e=h.c(10),{children:s,onItemHover:a}=t,[o,i]=S.useState(null);let l;e[0]!==a?(l=f=>{i(f),a?.(f)},e[0]=a,e[1]=l):l=e[1];const r=l;let c;e[2]!==o||e[3]!==r?(c={hoveredItem:o,setHoveredItem:r},e[2]=o,e[3]=r,e[4]=c):c=e[4];let d;e[5]!==s?(d=n.jsx(_t,{children:s}),e[5]=s,e[6]=d):d=e[6];let m;return e[7]!==c||e[8]!==d?(m=n.jsx(Yt.Provider,{value:c,children:d}),e[7]=c,e[8]=d,e[9]=m):m=e[9],m}function qn(t){const e=h.c(6),{children:s,onClick:a}=t;let o;e[0]!==s||e[1]!==a?(o=n.jsx(J,{variant:"link",className:"p-0.5 h-auto",onClick:a,type:"button",children:s}),e[0]=s,e[1]=a,e[2]=o):o=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(kt,{asChild:!0,children:n.jsx(J,{size:"icon",variant:"ghost",className:"w-6 h-6 p-0",children:n.jsx(Dt,{size:16,className:"opacity-50"})})}),e[3]=i):i=e[3];let l;return e[4]!==o?(l=n.jsxs("div",{className:"flex items-center gap-1",children:[o,i]}),e[4]=o,e[5]=l):l=e[5],l}function Jn(t){const e=h.c(8),{item:s,fallback:a}=t,o=a===void 0?"":a,i=s?.avatarUrl??"",l=s?.name??o;let r;e[0]!==i||e[1]!==l?(r=n.jsx(ee,{url:i,fallback:l,size:"xs",objectFit:"contain"}),e[0]=i,e[1]=l,e[2]=r):r=e[2];const c=s?.name??o;let d;e[3]!==c?(d=n.jsx("span",{children:c}),e[3]=c,e[4]=d):d=e[4];let m;return e[5]!==r||e[6]!==d?(m=n.jsxs("div",{className:"flex items-center gap-2",children:[r,d]}),e[5]=r,e[6]=d,e[7]=m):m=e[7],m}function Xn(t){const e=h.c(6),{children:s,align:a}=t,o=a===void 0?"start":a,l=S.Children.toArray(s).filter(Qn).length===1?"280px":"480px";let r;e[0]!==l?(r={width:l},e[0]=l,e[1]=r):r=e[1];let c;return e[2]!==o||e[3]!==s||e[4]!==r?(c=n.jsx(It,{align:o,className:"p-0 flex items-start",style:r,children:s}),e[2]=o,e[3]=s,e[4]=r,e[5]=c):c=e[5],c}function Qn(t){return S.isValidElement(t)&&(t.type===Jt||t.type===qt)}function qt(t){const e=h.c(5),{children:s,className:a}=t;let o;e[0]!==a?(o=T("flex flex-col border-border w-[240px] border-r last:border-r-0 last:w-full",a),e[0]=a,e[1]=o):o=e[1];let i;return e[2]!==s||e[3]!==o?(i=n.jsx("div",{className:o,children:s}),e[2]=s,e[3]=o,e[4]=i):i=e[4],i}const Jt=qt;function ea(t){const e=h.c(6),{placeholder:s,value:a,onChange:o}=t,i=s===void 0?"Search...":s;let l;e[0]!==o?(l=c=>o(c.target.value),e[0]=o,e[1]=l):l=e[1];let r;return e[2]!==i||e[3]!==l||e[4]!==a?(r=n.jsx(As,{placeholder:i,value:a,onChange:l,className:"rounded-none border-t-0 border-x-0 focus-visible:border-border focus-visible:ring-0"}),e[2]=i,e[3]=l,e[4]=a,e[5]=r):r=e[5],r}function ta(t){const e=h.c(6),{children:s,emptyMessage:a}=t,o=a===void 0?"No items found.":a,i=S.Children.count(s)>0;let l;e[0]!==o||e[1]!==i?(l=!i&&n.jsx("div",{className:"text-muted-foreground text-sm px-1 py-8 text-center",children:o}),e[0]=o,e[1]=i,e[2]=l):l=e[2];let r;return e[3]!==s||e[4]!==l?(r=n.jsxs("div",{className:"flex flex-col gap-0.5 p-1 max-h-44 overflow-y-auto",children:[l,s]}),e[3]=s,e[4]=l,e[5]=r):r=e[5],r}function sa(t){const e=h.c(15),{item:s,onClick:a,onHover:o,children:i}=t,l=Zn();let r;e[0]!==l||e[1]!==s||e[2]!==o?(r=()=>{l.setHoveredItem(s.slug),o?.(s)},e[0]=l,e[1]=s,e[2]=o,e[3]=r):r=e[3];const c=r;let d;e[4]!==s||e[5]!==a?(d=()=>a(s),e[4]=s,e[5]=a,e[6]=d):d=e[6];let m;e[7]!==i||e[8]!==s.avatarUrl||e[9]!==s.name?(m=i||n.jsxs(n.Fragment,{children:[n.jsx(ee,{url:s.avatarUrl??"",fallback:s.name,size:"xs",className:"w-[22px]! h-[22px]!",objectFit:"contain"}),n.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:s.name})]}),e[7]=i,e[8]=s.avatarUrl,e[9]=s.name,e[10]=m):m=e[10];let f;return e[11]!==c||e[12]!==d||e[13]!==m?(f=n.jsx(J,{onClick:d,onMouseEnter:c,variant:"ghost",size:"sm",className:"w-full justify-start font-normal",children:m}),e[11]=c,e[12]=d,e[13]=m,e[14]=f):f=e[14],f}function na(t){const e=h.c(2),{children:s}=t;let a;return e[0]!==s?(a=n.jsx("div",{className:"px-1 pb-1 pt-0.5",children:s}),e[0]=s,e[1]=a):a=e[1],a}function aa(t){const e=h.c(11),{onClick:s,icon:a,children:o,variant:i}=t,r=(i===void 0?"default":i)==="muted"&&"text-muted-foreground";let c;e[0]!==r?(c=T("w-full justify-start font-normal",r),e[0]=r,e[1]=c):c=e[1];let d;e[2]!==a?(d=a&&n.jsx("span",{className:"[&>svg]:size-4",children:a}),e[2]=a,e[3]=d):d=e[3];let m;e[4]!==o?(m=n.jsx("span",{children:o}),e[4]=o,e[5]=m):m=e[5];let f;return e[6]!==s||e[7]!==c||e[8]!==d||e[9]!==m?(f=n.jsxs(J,{variant:"ghost",size:"sm",className:c,onClick:s,children:[d,m]}),e[6]=s,e[7]=c,e[8]=d,e[9]=m,e[10]=f):f=e[10],f}function oa(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Kn,{}),t[0]=e):e=t[0],e}function ia(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"h-4 w-16 bg-accent rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const G=Object.assign(Yn,{Trigger:qn,CurrentItem:Jn,Content:Xn,Panel:Jt,Search:ea,Items:ta,Item:sa,Actions:na,Action:aa,Separator:oa,Skeleton:ia});function it(){const t=h.c(59);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:s}=wt(e),{data:a}=q.useListOrganizations(),o=ze();let i;t[1]!==s||t[2]!==a?(i=a?.find(R=>R.slug===s),t[1]=s,t[2]=a,t[3]=i):i=t[3];const l=i,[r,c]=S.useState(""),[d,m]=S.useState(!1);let f,p,b,u,x,g,j,v;if(t[4]!==l||t[5]!==o||t[6]!==s||t[7]!==r||t[8]!==a){const L=(a?(()=>{const D=a.filter(V=>V.name.toLowerCase().includes(r.toLowerCase()));if(s){const V=D.findIndex(X=>X.slug===s);if(V>0){const X=D[V];X&&(D.splice(V,1),D.unshift(X))}}return D})():[]).map(la);let B;t[17]!==l?(B=l?{slug:l.slug,name:l.name,avatarUrl:l.logo}:void 0,t[17]=l,t[18]=B):B=t[18];const z=B;u=G;let U;t[19]!==o||t[20]!==s?(U=()=>o({to:"/$org",params:{org:s??""}}),t[19]=o,t[20]=s,t[21]=U):U=t[21];let E;t[22]!==z?(E=n.jsx(G.CurrentItem,{item:z}),t[22]=z,t[23]=E):E=t[23],t[24]!==U||t[25]!==E?(v=n.jsx(G.Trigger,{onClick:U,children:E}),t[24]=U,t[25]=E,t[26]=v):v=t[26],b=G.Content,p=G.Panel,t[27]!==r?(j=n.jsx(G.Search,{placeholder:"Search organizations...",value:r,onChange:c}),t[27]=r,t[28]=j):j=t[28],f=G.Items,x="No organizations found.";let F;t[29]!==o?(F=D=>n.jsx(G.Item,{item:D,onClick:V=>o({to:"/$org",params:{org:V.slug}})},D.slug),t[29]=o,t[30]=F):F=t[30],g=L.map(F),t[4]=l,t[5]=o,t[6]=s,t[7]=r,t[8]=a,t[9]=f,t[10]=p,t[11]=b,t[12]=u,t[13]=x,t[14]=g,t[15]=j,t[16]=v}else f=t[9],p=t[10],b=t[11],u=t[12],x=t[13],g=t[14],j=t[15],v=t[16];let w;t[31]!==f||t[32]!==x||t[33]!==g?(w=n.jsx(f,{emptyMessage:x,children:g}),t[31]=f,t[32]=x,t[33]=g,t[34]=w):w=t[34];let $,y;t[35]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx(G.Actions,{children:n.jsx(G.Action,{onClick:()=>m(!0),variant:"muted",children:"+ Create organization"})}),y=n.jsx(G.Separator,{}),t[35]=$,t[36]=y):($=t[35],y=t[36]);let N;t[37]!==o?(N=()=>o({to:"/"}),t[37]=o,t[38]=N):N=t[38];let C;t[39]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(Rs,{}),t[39]=C):C=t[39];let O;t[40]!==N?(O=n.jsx(G.Actions,{children:n.jsx(G.Action,{onClick:N,icon:C,children:"See all organizations"})}),t[40]=N,t[41]=O):O=t[41];let _;t[42]!==p||t[43]!==O||t[44]!==j||t[45]!==w?(_=n.jsxs(p,{children:[j,w,$,y,O]}),t[42]=p,t[43]=O,t[44]=j,t[45]=w,t[46]=_):_=t[46];let M;t[47]!==b||t[48]!==_?(M=n.jsx(b,{children:_}),t[47]=b,t[48]=_,t[49]=M):M=t[49];let k;t[50]!==u||t[51]!==M||t[52]!==v?(k=n.jsxs(u,{children:[v,M]}),t[50]=u,t[51]=M,t[52]=v,t[53]=k):k=t[53];let I;t[54]!==d?(I=n.jsx(Ts,{open:d,onOpenChange:m}),t[54]=d,t[55]=I):I=t[55];let A;return t[56]!==k||t[57]!==I?(A=n.jsxs(n.Fragment,{children:[k,I]}),t[56]=k,t[57]=I,t[58]=A):A=t[58],A}function la(t){return{slug:t.slug,name:t.name,avatarUrl:t.logo}}it.Skeleton=G.Skeleton;const Xt=S.createContext({setOpen:()=>{}}),ra=()=>S.useContext(Xt),ca=t=>{const e=h.c(25);let s,a,o,i,l;e[0]!==t?({children:s,defaultOpen:a,open:i,onOpenChange:o,...l}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=i,e[5]=l):(s=e[1],a=e[2],o=e[3],i=e[4],l=e[5]);const r=a??!1;let c;e[6]!==o||e[7]!==i||e[8]!==r?(c={prop:i,defaultProp:r,onChange:o},e[6]=o,e[7]=i,e[8]=r,e[9]=c):c=e[9];const[d,m]=Bs(c);let f;e[10]!==m?(f={setOpen:m},e[10]=m,e[11]=f):f=e[11];let p;e[12]!==s||e[13]!==d||e[14]!==l||e[15]!==m?(p=n.jsx(Hs,{open:d,onOpenChange:m,...l,children:s}),e[12]=s,e[13]=d,e[14]=l,e[15]=m,e[16]=p):p=e[16];let b;e[17]!==d||e[18]!==l||e[19]!==m||e[20]!==p?(b=n.jsx(Js,{open:d,onOpenChange:m,...l,children:p}),e[17]=d,e[18]=l,e[19]=m,e[20]=p,e[21]=b):b=e[21];let u;return e[22]!==f||e[23]!==b?(u=n.jsx(Xt.Provider,{value:f,children:b}),e[22]=f,e[23]=b,e[24]=u):u=e[24],u},da=t=>{const{children:e,title:s,...a}=t,o=Me(),{className:i,...l}=a;return o?n.jsxs(Ps,{...l,children:[n.jsx(Ds,{className:"hidden",children:n.jsx(Ls,{children:s})}),n.jsx("div",{className:T("flex flex-col gap-2 p-2 py-4",i),children:e})]}):n.jsx(qs,{...a,children:e})},ma=t=>{const{children:e,...s}=t,{setOpen:a}=ra(),o=Me(),{className:i,...l}=s;return o?n.jsx("div",{...l,onClick:r=>{a(!1);const{onClick:c}=l;c?.(r)},className:T("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",i),children:e}):n.jsx(Xs,{...s,children:e})},fa=t=>{const e=h.c(7);let s,a;e[0]!==t?({children:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);const o=Me();let i;return e[3]!==s||e[4]!==o||e[5]!==a?(i=o?n.jsx(Es,{asChild:!0,children:s}):n.jsx(Ys,{...a,children:s}),e[3]=s,e[4]=o,e[5]=a,e[6]=i):i=e[6],i},ua=t=>{const e=h.c(7);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);const o=Me();let i;return e[3]!==s||e[4]!==o||e[5]!==a?(i=o?n.jsx(bt,{className:T(s),...a}):n.jsx(bt,{className:T(s),...a}),e[3]=s,e[4]=o,e[5]=a,e[6]=i):i=e[6],i};function pa(t){const e=h.c(11),{user:s,trigger:a,align:o,children:i}=t,l=o===void 0?"start":o;let r;e[0]!==a||e[1]!==s?(r=a(s),e[0]=a,e[1]=s,e[2]=r):r=e[2];let c;e[3]!==r?(c=n.jsx(fa,{asChild:!0,children:n.jsx("div",{children:r})}),e[3]=r,e[4]=c):c=e[4];let d;e[5]!==l||e[6]!==i?(d=n.jsx(da,{side:"top",align:l,className:"md:w-[240px]",children:i}),e[5]=l,e[6]=i,e[7]=d):d=e[7];let m;return e[8]!==c||e[9]!==d?(m=n.jsxs(ca,{children:[c,d]}),e[8]=c,e[9]=d,e[10]=m):m=e[10],m}function ha(t){const e=h.c(8),{children:s,onClick:a,className:o,asChild:i}=t;let l;e[0]!==i||e[1]!==s||e[2]!==a?(l=i?s:n.jsx("button",{type:"button",className:"flex items-center gap-2 text-sm w-full cursor-pointer",onClick:a,children:s}),e[0]=i,e[1]=s,e[2]=a,e[3]=l):l=e[3];let r;return e[4]!==i||e[5]!==o||e[6]!==l?(r=n.jsx(ma,{asChild:i,className:o,children:l}),e[4]=i,e[5]=o,e[6]=l,e[7]=r):r=e[7],r}function xa(t){const e=h.c(2),{className:s}=t;let a;return e[0]!==s?(a=n.jsx(ua,{className:s}),e[0]=s,e[1]=a):a=e[1],a}function ga(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const Z=Object.assign(pa,{Item:ha,Separator:xa,Skeleton:ga});function ba(t){const e=h.c(48),{open:s,onOpenChange:a,user:o,userImage:i}=t,[l,r]=Us(),[c,d]=S.useState(!1);let m;e[0]!==o.id?(m=()=>{navigator.clipboard.writeText(o.id),d(!0),setTimeout(()=>d(!1),2e3)},e[0]=o.id,e[1]=m):m=e[1];const f=m;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(Qs,{className:"text-base",children:"Profile Settings"}),e[2]=p):p=e[2];let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsxs(en,{className:"px-6 pt-6 pb-4 border-b border-border shrink-0 relative",children:[p,n.jsxs(tn,{className:"absolute top-1/2 right-4 -translate-y-1/2 cursor-pointer rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",children:[n.jsx($e,{size:16}),n.jsx("span",{className:"sr-only",children:"Close"})]})]}),e[3]=b):b=e[3];const u=o.name||"U";let x;e[4]!==u||e[5]!==i?(x=n.jsx(ee,{url:i,fallback:u,shape:"circle",size:"xl",className:"h-16 w-16"}),e[4]=u,e[5]=i,e[6]=x):x=e[6];const g=o.name||"User";let j;e[7]!==g?(j=n.jsx("span",{className:"text-base font-medium text-foreground",children:g}),e[7]=g,e[8]=j):j=e[8];let v;e[9]!==o.email?(v=n.jsx("span",{className:"text-sm text-muted-foreground",children:o.email}),e[9]=o.email,e[10]=v):v=e[10];let w;e[11]!==j||e[12]!==v?(w=n.jsxs("div",{className:"flex flex-col gap-1",children:[j,v]}),e[11]=j,e[12]=v,e[13]=w):w=e[13];let $;e[14]!==x||e[15]!==w?($=n.jsxs("div",{className:"flex items-center gap-4",children:[x,w]}),e[14]=x,e[15]=w,e[16]=$):$=e[16];let y;e[17]!==l||e[18]!==r?(y=()=>r(!l),e[17]=l,e[18]=r,e[19]=y):y=e[19];let N;e[20]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsxs("div",{className:"flex flex-col gap-1 flex-1 min-w-0",children:[n.jsxs(an,{className:"text-sm font-medium text-foreground flex items-center gap-2 pointer-events-none",children:[n.jsx(ln,{size:16,className:"text-muted-foreground"}),"Developer Mode"]}),n.jsx("p",{className:"text-xs text-muted-foreground pointer-events-none",children:"Show technical details like JSON input/output for tool calls"})]}),e[20]=N):N=e[20];let C;e[21]!==l||e[22]!==r?(C=n.jsx("div",{onClick:ja,children:n.jsx(on,{checked:l,onCheckedChange:r})}),e[21]=l,e[22]=r,e[23]=C):C=e[23];let O;e[24]!==y||e[25]!==C?(O=n.jsxs("button",{type:"button",onClick:y,className:"flex items-center justify-between gap-4 p-4 rounded-lg border border-border hover:bg-accent/50 transition-colors text-left w-full cursor-pointer",children:[N,C]}),e[24]=y,e[25]=C,e[26]=O):O=e[26];let _;e[27]!==$||e[28]!==O?(_=n.jsxs("div",{className:"p-5 space-y-6 min-h-[225px]",children:[$,O]}),e[27]=$,e[28]=O,e[29]=_):_=e[29];let M;e[30]!==o.id?(M=n.jsx("span",{className:"font-mono text-xs",children:o.id}),e[30]=o.id,e[31]=M):M=e[31];let k;e[32]!==c?(k=c?n.jsx(Ge,{size:14,className:"text-green-600"}):n.jsx(At,{size:14,className:"opacity-0 group-hover:opacity-100 transition-opacity"}),e[32]=c,e[33]=k):k=e[33];let I;e[34]!==f||e[35]!==M||e[36]!==k?(I=n.jsx(Mt,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:f,className:"group flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[M,k]})}),e[34]=f,e[35]=M,e[36]=k,e[37]=I):I=e[37];let A;e[38]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx($t,{side:"top",children:n.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[38]=A):A=e[38];let R;e[39]!==I?(R=n.jsx("div",{className:"border-t border-border px-5 py-4 flex items-center shrink-0",children:n.jsx(zt,{children:n.jsxs(Ot,{children:[I,A]})})}),e[39]=I,e[40]=R):R=e[40];let L;e[41]!==_||e[42]!==R?(L=n.jsxs(sn,{className:"sm:max-w-lg sm:max-h-[85vh] p-0 flex flex-col",closeButtonClassName:"hidden",children:[b,n.jsxs("div",{className:"flex flex-col",children:[_,R]})]}),e[41]=_,e[42]=R,e[43]=L):L=e[43];let B;return e[44]!==a||e[45]!==s||e[46]!==L?(B=n.jsx(nn,{open:s,onOpenChange:a,children:L}),e[44]=a,e[45]=s,e[46]=L,e[47]=B):B=e[47],B}function ja(t){return t.stopPropagation()}function va(t){const e=h.c(47),{user:s,userImage:a}=t,[o,i]=S.useState(!1),[l,r]=S.useState(!1);let c;e[0]!==s.email||e[1]!==s.id||e[2]!==s.name?(c=()=>{const B=`ID: ${s.id}
1
+ import{r as S,e as es,a as q,j as n,f as ze,t as Y,c as h,R as ts,T as ss,D as ns,C as as,P as os,g as is,O as ls,h as rs,i as cs,k as Nt,p as ds,l as ms,d as wt,G as fs,m as us,S as yt,n as ps,o as hs,N as xs,q as gs,K as bs,s as Ct}from"./index-pvGhQBw9.js";import{E as lt}from"./error-boundary-u4ffWLYf.js";import{B as J,c as T}from"./button-CICpj3wE.js";import{P as _t,a as kt,b as It}from"./popover-Cq8T_QGa.js";import{B as ft}from"./badge-BkSn2oaB.js";import{i as Ge}from"./Check-BEhtk6Py.js";import{n as ut}from"./Inbox01-DU8gyK-F.js";import{s as pt}from"./XClose-D_dGSZ7W.js";import{i as js}from"./File06-De52zO32.js";import{i as $e}from"./X-q5bh176U.js";import{u as Me}from"./use-mobile-zhrv6Pzr.js";import{T as $t,a as zt,b as Mt,c as Ot}from"./tooltip-DySBr2SY.js";import{S as Tt,u as vs,a as Ss,b as Ns,c as ws,N as ys,G as at,T as Cs,d as _s,D as ks}from"./thread-history-popover-SCaQRi-L.js";import{u as rt,a as Is}from"./use-organization-settings-DTSCQFPr.js";import{u as Fe,L as ht,P as $s,O as zs}from"./project-context-provider-CUiGxKJp.js";import{n as Ms,I as xt}from"./empty-state-B8LlErgw.js";import{i as ot}from"./use-gateway-B5GGqvj7.js";import{a as Os}from"./Home02-Dax6TXzJ.js";import{C as Ts}from"./create-organization-dialog-Kd2yuwpA.js";import{I as As}from"./input-Chnnz9Uq.js";import{A as ee}from"./avatar-Dtkx4Tl-.js";import{c as Rs}from"./Grid01-CoHgfBeE.js";import{D as Es,a as Ps,b as Ds,c as Ls,u as Bs,d as Hs,e as Us,C as P,f as gt,g as Gs,h as Fs,i as Ws,U as Vs,G as Ks,M as Zs}from"./index-BZk2eMPx.js";import{D as Ys,a as qs,b as Js,c as Xs,d as bt}from"./dropdown-menu-D1uHrxpy.js";import{a as At}from"./Copy01-B7vmVdHF.js";import{n as jt}from"./LinkExternal01-5OOaoko1.js";import{D as Qs,a as en,b as tn,c as sn,d as nn}from"./dialog-CuzZhGeu.js";import{L as an}from"./form-f0_t6ok_.js";import{S as on}from"./switch-CkVmNhCD.js";import{i as ln}from"./Code01-Bu5zpyWd.js";import{u as We,L as Ve}from"./localstorage-keys-CdhAbc7P.js";import{R as Rt,a as rn,b as cn}from"./resizable-S6LzYu6C.js";import{s as dn}from"./Plus-WrA7kzKa.js";import{u as mn}from"./use-connection-BF1UFzlw.js";import{u as fn}from"./use-binding-s4bqKdJA.js";import"./use-gateway-system-prompt-K6FCpGjs.js";import"./ChevronDown-BRxtl0-A.js";import"./Edit01-CGqnOdlK.js";import"./well-known-mcp-D13f-8h2.js";import"./generate-id-Dyweu44Y.js";import"./Clock-BSrN61cb.js";import"./SearchMd-JSFwoON0.js";import"./Trash01-MX6mkM7g.js";import"./useMutation-B64mCwly.js";import"./connection-Mp3hTHGP.js";import"./use-collections-JQXbZBdV.js";import"./alert-dialog-ocEz50Se.js";import"./spinner-BSgPnpsR.js";import"./use-create-gateway-DLr-GNpv.js";import"./AlertCircle-CMyS46jH.js";import"./ArrowUp-CXsDJznS.js";import"./textarea-BgUJNVXI.js";import"./Terminal-BtV_FLPF.js";import"./monaco-editor--HoIUuQe.js";import"./select-BOEg6aAK.js";import"./Image01-D_Oad7Fi.js";import"./InfoCircle-Na8jygcw.js";import"./useQuery-Dr4r_H_i.js";import"./binder-BVHRVoIY.js";const Et=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M9 7H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 7.76 3 8.04 3 8.6v10.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21H9m0 0h6m-6 0V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 3 10.04 3 10.6 3h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 3.76 15 4.04 15 4.6V21m0-10h4.4c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C21 11.76 21 12.04 21 12.6v6.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C20.24 21 19.96 21 19.4 21H15"}));Et.displayName="BarChart10";const Pt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M15 21v-5.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 14 13.96 14 13.4 14h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 14.76 9 15.04 9 15.6V21M3 7a3 3 0 0 0 6 0 3 3 0 1 0 6 0 3 3 0 1 0 6 0M6.2 21h11.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3H6.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21Z"}));Pt.displayName="Building02";const Dt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"}));Dt.displayName="ChevronSelectorVertical";const Lt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M2 12h20M2 12c0 5.523 4.477 10 10 10M2 12C2 6.477 6.477 2 12 2m10 10c0 5.523-4.477 10-10 10m10-10c0-5.523-4.477-10-10-10m0 0a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10m0-20a15.3 15.3 0 0 0-4 10 15.3 15.3 0 0 0 4 10"}));Lt.displayName="Globe01";const Bt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M15 3v18M7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3Z"}));Bt.displayName="LayoutRight";const Ht=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"m16 17 5-5m0 0-5-5m5 5H9m0-9H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21H9"}));Ht.displayName="LogOut01";const Ut=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"m2 7 8.165 5.715c.661.463.992.695 1.351.784a2 2 0 0 0 .968 0c.36-.09.69-.32 1.351-.784L22 7M6.8 20h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 17.72 22 16.88 22 15.2V8.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 4 18.88 4 17.2 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v6.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 20 5.12 20 6.8 20Z"}));Ut.displayName="Mail01";const ct=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}),S.createElement("path",{d:"M18.727 14.727a1.5 1.5 0 0 0 .3 1.655l.055.054a1.816 1.816 0 0 1 0 2.573 1.818 1.818 0 0 1-2.573 0l-.055-.055a1.5 1.5 0 0 0-1.654-.3 1.5 1.5 0 0 0-.91 1.373v.155a1.818 1.818 0 1 1-3.636 0V20.1a1.5 1.5 0 0 0-.981-1.373 1.5 1.5 0 0 0-1.655.3l-.054.055a1.818 1.818 0 0 1-3.106-1.287 1.818 1.818 0 0 1 .533-1.286l.054-.055a1.5 1.5 0 0 0 .3-1.654 1.5 1.5 0 0 0-1.372-.91h-.155a1.818 1.818 0 1 1 0-3.636H3.9a1.5 1.5 0 0 0 1.373-.981 1.5 1.5 0 0 0-.3-1.655l-.055-.054A1.818 1.818 0 1 1 7.491 4.99l.054.054a1.5 1.5 0 0 0 1.655.3h.073a1.5 1.5 0 0 0 .909-1.372v-.155a1.818 1.818 0 0 1 3.636 0V3.9a1.499 1.499 0 0 0 .91 1.373 1.5 1.5 0 0 0 1.654-.3l.054-.055a1.817 1.817 0 0 1 2.573 0 1.819 1.819 0 0 1 0 2.573l-.055.054a1.5 1.5 0 0 0-.3 1.655v.073a1.5 1.5 0 0 0 1.373.909h.155a1.818 1.818 0 0 1 0 3.636H20.1a1.499 1.499 0 0 0-1.373.91Z"}));ct.displayName="Settings01";const Gt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M22 21v-2a4.002 4.002 0 0 0-3-3.874M15.5 3.291a4.001 4.001 0 0 1 0 7.418M17 21c0-1.864 0-2.796-.305-3.53a4 4 0 0 0-2.164-2.165C13.796 15 12.864 15 11 15H8c-1.864 0-2.796 0-3.53.305a4 4 0 0 0-2.166 2.164C2 18.204 2 19.136 2 21M13.5 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}));Gt.displayName="Users01";const Ft=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M13 2 4.093 12.688c-.348.418-.523.628-.525.804a.5.5 0 0 0 .185.397c.138.111.41.111.955.111H12l-1 8 8.907-10.688c.348-.418.523-.628.525-.804a.5.5 0 0 0-.185-.397c-.138-.111-.41-.111-.955-.111H12l1-8Z"}));Ft.displayName="Zap";function un({invitation:t,onStatusChange:e}){const[s,a]=S.useState(!1),[o,i]=S.useState(!1),l=ze(),r=async()=>{a(!0);try{const u=await q.organization.acceptInvitation({invitationId:t.id});if(u.error)Y.error(u.error.message),a(!1);else{e(t.id,"accepted");const x=await q.organization.setActive({organizationId:t.organizationId});x?.data?.slug?(Y.success("Invitation accepted!"),l({to:"/$org",params:{org:x.data.slug}})):(Y.success("Invitation accepted! Redirecting..."),l({to:"/"}))}}catch{Y.error("Failed to accept invitation"),a(!1)}},c=async()=>{i(!0);try{const u=await q.organization.rejectInvitation({invitationId:t.id});u.error?(Y.error(u.error.message),i(!1)):(Y.success("Invitation rejected"),e(t.id,"rejected"),i(!1))}catch{Y.error("Failed to reject invitation"),i(!1)}},d=t.organizationName||t.organizationId,m=t.inviter?.name||t.inviter?.email||t.email||"Someone",f=t.status==="pending",p=t.status==="accepted",b=t.status==="rejected";return n.jsxs("div",{className:`flex items-center gap-3 px-3 py-2 h-12 border-b border-border/50 last:border-b-0 ${f?"":"opacity-50"}`,children:[n.jsx("div",{className:"shrink-0 size-5 flex items-center justify-center",children:n.jsx(Ut,{size:16,className:"text-muted-foreground"})}),n.jsxs("p",{className:"flex-1 text-sm text-foreground min-w-0 whitespace-nowrap overflow-hidden",children:[n.jsx("span",{className:"font-semibold inline-block max-w-[120px] truncate align-bottom",children:m})," invited you to join ",n.jsx("span",{className:"font-semibold inline-block max-w-[200px] truncate align-bottom",children:d})]}),n.jsx("div",{className:"flex items-center gap-1 shrink-0",children:f?n.jsxs(n.Fragment,{children:[n.jsx(J,{variant:"ghost",size:"icon",onClick:c,disabled:s||o,className:"h-8 w-8",children:n.jsx(pt,{size:14})}),n.jsx(J,{variant:"outline",size:"icon",onClick:r,disabled:s||o,className:"h-8 w-8",children:n.jsx(Ge,{size:14})})]}):p?n.jsxs(ft,{variant:"outline",className:"h-6 px-2 text-xs",children:[n.jsx(Ge,{size:12}),"Accepted"]}):b?n.jsxs(ft,{variant:"outline",className:"h-6 px-2 text-xs",children:[n.jsx(pt,{size:12}),"Declined"]}):null})]})}function pn(){const[t,e]=S.useState(!1),s=S.useContext(es),{data:a}=s.hooks.useListUserInvitations(),{data:o}=q.useListOrganizations(),[i,l]=S.useState({}),d=(a??[]).map(u=>{const x=(o??[]).find(g=>g.id===u.organizationId);return{...u,organizationSlug:x?.slug||u.organizationSlug,organizationName:x?.name||u.organizationName}}).map(u=>({...u,status:i[u.id]||u.status})),m=[...d].sort((u,x)=>{const g={pending:0,accepted:1,rejected:2};return(g[u.status]??999)-(g[x.status]??999)}),p=d.filter(u=>u.status==="pending").length>0,b=(u,x)=>{l(g=>({...g,[u]:x}))};return n.jsxs(_t,{open:t,onOpenChange:e,children:[n.jsx(kt,{asChild:!0,children:n.jsxs(J,{variant:"ghost",size:"sm",className:"relative h-7 w-7 p-0","aria-label":"Inbox",children:[n.jsx(ut,{size:18,className:"text-muted-foreground"}),p&&n.jsx("span",{className:"absolute bottom-1 right-0.5 h-2 w-2 rounded-full bg-destructive ring-2 ring-background"})]})}),n.jsxs(It,{align:"end",className:"w-[480px] p-0 overflow-hidden",children:[n.jsx("div",{className:"px-4 py-3 border-b border-border",children:n.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Inbox"})}),n.jsx("div",{className:"max-h-96 overflow-auto",children:m.length>0?m.map(u=>n.jsx(un,{invitation:u,onStatusChange:b},u.id)):n.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[n.jsx(ut,{size:32,className:"text-muted-foreground/40 mb-2"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"No invitations at the moment"})]})})]})]})}function hn(t){const e=h.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n.jsx(ts,{"data-slot":"sheet",...s}),e[2]=s,e[3]=a):a=e[3],a}function xn(t){const e=h.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n.jsx(os,{"data-slot":"sheet-portal",...s}),e[2]=s,e[3]=a):a=e[3],a}function gn(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx(ls,{"data-slot":"sheet-overlay",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}function bn(t){const e=h.c(17);let s,a,o,i;e[0]!==t?({className:a,children:s,side:i,...o}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=i):(s=e[1],a=e[2],o=e[3],i=e[4]);const l=i===void 0?"right":i;let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(gn,{}),e[5]=r):r=e[5];const c=l==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",d=l==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",m=l==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",f=l==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t";let p;e[6]!==a||e[7]!==c||e[8]!==d||e[9]!==m||e[10]!==f?(p=T("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",c,d,m,f,a),e[6]=a,e[7]=c,e[8]=d,e[9]=m,e[10]=f,e[11]=p):p=e[11];let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsxs(is,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[n.jsx($e,{className:"size-4"}),n.jsx("span",{className:"sr-only",children:"Close"})]}),e[12]=b):b=e[12];let u;return e[13]!==s||e[14]!==o||e[15]!==p?(u=n.jsxs(xn,{children:[r,n.jsxs(as,{"data-slot":"sheet-content",className:p,...o,children:[s,b]})]}),e[13]=s,e[14]=o,e[15]=p,e[16]=u):u=e[16],u}function jn(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("flex flex-col gap-1.5 p-4",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx("div",{"data-slot":"sheet-header",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}function vn(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("text-foreground font-semibold",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx(ss,{"data-slot":"sheet-title",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}function Sn(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("text-muted-foreground text-sm",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx(ns,{"data-slot":"sheet-description",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}const Nn="sidebar_state",wn=3600*24*7,yn="16rem",Cn="18rem",_n="3rem",kn="b",Wt=S.createContext(null);function dt(){const t=S.useContext(Wt);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function In(t){const e=h.c(21),{defaultOpen:s,open:a,onOpenChange:o,children:i}=t,l=s===void 0?!0:s,r=Me(),[c,d]=S.useState(!1),[m,f]=S.useState(l),p=a??m;let b;e[0]!==p||e[1]!==o?(b=O=>{const _=typeof O=="function"?O(p):O;o?o(_):f(_),document.cookie=`${Nn}=${_}; path=/; max-age=${wn}`},e[0]=p,e[1]=o,e[2]=b):b=e[2];const u=b;let x;e[3]!==r||e[4]!==u?(x=()=>r?d(zn):u($n),e[3]=r,e[4]=u,e[5]=x):x=e[5];const g=x;let j,v;e[6]!==g?(j=()=>{const O=_=>{if(_.key===kn&&(_.metaKey||_.ctrlKey)){const M=_.target;if(M.tagName==="INPUT"||M.tagName==="TEXTAREA"||M.isContentEditable)return;_.preventDefault(),g()}};return globalThis.addEventListener("keydown",O),()=>globalThis.removeEventListener("keydown",O)},v=[g],e[6]=g,e[7]=j,e[8]=v):(j=e[7],v=e[8]),S.useEffect(j,v);const w=p?"expanded":"collapsed";let $;e[9]!==r||e[10]!==p||e[11]!==c||e[12]!==u||e[13]!==w||e[14]!==g?($={state:w,open:p,setOpen:u,isMobile:r,openMobile:c,setOpenMobile:d,toggleSidebar:g},e[9]=r,e[10]=p,e[11]=c,e[12]=u,e[13]=w,e[14]=g,e[15]=$):$=e[15];const y=$;let N;e[16]!==i?(N=n.jsx(zt,{delayDuration:0,children:i}),e[16]=i,e[17]=N):N=e[17];let C;return e[18]!==y||e[19]!==N?(C=n.jsx(Wt.Provider,{value:y,children:N}),e[18]=y,e[19]=N,e[20]=C):C=e[20],C}function $n(t){return!t}function zn(t){return!t}function Mn(t){const e=h.c(14);let s,a,o,i;e[0]!==t?({className:a,style:i,children:s,...o}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=i):(s=e[1],a=e[2],o=e[3],i=e[4]);let l;e[5]!==i?(l={"--sidebar-width":yn,"--sidebar-width-icon":_n,...i},e[5]=i,e[6]=l):l=e[6];const r=l;let c;e[7]!==a?(c=T("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",a),e[7]=a,e[8]=c):c=e[8];let d;return e[9]!==s||e[10]!==o||e[11]!==r||e[12]!==c?(d=n.jsx("div",{"data-slot":"sidebar-wrapper",style:r,className:c,...o,children:s}),e[9]=s,e[10]=o,e[11]=r,e[12]=c,e[13]=d):d=e[13],d}function On(t){const e=h.c(46);let s,a,o,i,l,r;e[0]!==t?({side:i,variant:l,collapsible:r,className:a,children:s,...o}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=i,e[5]=l,e[6]=r):(s=e[1],a=e[2],o=e[3],i=e[4],l=e[5],r=e[6]);const c=i===void 0?"left":i,d=l===void 0?"sidebar":l,m=r===void 0?"offcanvas":r,{isMobile:f,state:p,openMobile:b,setOpenMobile:u}=dt();if(m==="none"){let _;e[7]!==a?(_=T("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",a),e[7]=a,e[8]=_):_=e[8];let M;return e[9]!==s||e[10]!==o||e[11]!==_?(M=n.jsx("div",{"data-slot":"sidebar",className:_,...o,children:s}),e[9]=s,e[10]=o,e[11]=_,e[12]=M):M=e[12],M}if(f){let _;e[13]===Symbol.for("react.memo_cache_sentinel")?(_={"--sidebar-width":Cn},e[13]=_):_=e[13];let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=n.jsxs(jn,{className:"sr-only",children:[n.jsx(vn,{children:"Sidebar"}),n.jsx(Sn,{children:"Displays the mobile sidebar."})]}),e[14]=M):M=e[14];let k;e[15]!==s?(k=n.jsx("div",{className:"flex h-full w-full flex-col",children:s}),e[15]=s,e[16]=k):k=e[16];let I;e[17]!==c||e[18]!==k?(I=n.jsxs(bn,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:_,side:c,children:[M,k]}),e[17]=c,e[18]=k,e[19]=I):I=e[19];let A;return e[20]!==b||e[21]!==o||e[22]!==u||e[23]!==I?(A=n.jsx(hn,{open:b,onOpenChange:u,...o,children:I}),e[20]=b,e[21]=o,e[22]=u,e[23]=I,e[24]=A):A=e[24],A}const x=p==="collapsed"?m:"",g=d==="floating"||d==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let j;e[25]!==g?(j=T("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",g),e[25]=g,e[26]=j):j=e[26];let v;e[27]!==j?(v=n.jsx("div",{"data-slot":"sidebar-gap",className:j}),e[27]=j,e[28]=v):v=e[28];const w=c==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",$=d==="floating"||d==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let y;e[29]!==a||e[30]!==w||e[31]!==$?(y=T("fixed top-12 bottom-0 z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",w,$,a),e[29]=a,e[30]=w,e[31]=$,e[32]=y):y=e[32];let N;e[33]!==s?(N=n.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border py-2 flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s}),e[33]=s,e[34]=N):N=e[34];let C;e[35]!==o||e[36]!==y||e[37]!==N?(C=n.jsx("div",{"data-slot":"sidebar-container",className:y,...o,children:N}),e[35]=o,e[36]=y,e[37]=N,e[38]=C):C=e[38];let O;return e[39]!==c||e[40]!==p||e[41]!==C||e[42]!==x||e[43]!==v||e[44]!==d?(O=n.jsxs("div",{className:"group peer text-foreground hidden md:block border-r","data-state":p,"data-collapsible":x,"data-variant":d,"data-side":c,"data-slot":"sidebar",children:[v,C]}),e[39]=c,e[40]=p,e[41]=C,e[42]=x,e[43]=v,e[44]=d,e[45]=O):O=e[45],O}function Tn(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx("main",{"data-slot":"sidebar-inset",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}function An(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("h-4 m-0! w-full",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx("div",{"data-sidebar":"separator",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}function Rn(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}function En(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}function Pn(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("w-full text-sm",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}function Dn(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("flex w-full min-w-0 flex-col gap-1",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}function Ke(t){const e=h.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("group/menu-item relative",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}const Ln=rs("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-lg px-2 py-1.5 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding,colors] transition-colors duration-150 ease-out hover:transition-none focus-visible:ring-2 active:bg-sidebar-accent/75 disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent/75 [&>span:last-child]:truncate [&>svg]:size-[18px] [&>svg]:shrink-0 [&>svg]:text-muted-foreground",{variants:{variant:{default:"hover:bg-sidebar-accent text-sidebar-foreground/80 active:text-sidebar-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-7 text-sm font-[450]",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Vt(t){const e=h.c(28);let s,a,o,i,l,r,c;e[0]!==t?({asChild:o,isActive:i,variant:l,size:r,tooltip:c,className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=i,e[5]=l,e[6]=r,e[7]=c):(s=e[1],a=e[2],o=e[3],i=e[4],l=e[5],r=e[6],c=e[7]);const d=o===void 0?!1:o,m=i===void 0?!1:i,f=l===void 0?"default":l,p=r===void 0?"default":r,b=d?cs:"button",{isMobile:u,state:x}=dt();let g;e[8]!==s||e[9]!==p||e[10]!==f?(g=T(Ln({variant:f,size:p}),s),e[8]=s,e[9]=p,e[10]=f,e[11]=g):g=e[11];let j;e[12]!==b||e[13]!==m||e[14]!==a||e[15]!==p||e[16]!==g?(j=n.jsx(b,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":p,"data-active":m,className:g,...a}),e[12]=b,e[13]=m,e[14]=a,e[15]=p,e[16]=g,e[17]=j):j=e[17];const v=j;if(!c)return v;if(typeof c=="string"){let C;e[18]!==c?(C={children:c},e[18]=c,e[19]=C):C=e[19],c=C}let w;e[20]!==v?(w=n.jsx(Mt,{asChild:!0,children:v}),e[20]=v,e[21]=w):w=e[21];const $=x!=="collapsed"||u;let y;e[22]!==$||e[23]!==c?(y=n.jsx($t,{side:"right",align:"center",hidden:$,...c}),e[22]=$,e[23]=c,e[24]=y):y=e[24];let N;return e[25]!==w||e[26]!==y?(N=n.jsxs(Ot,{children:[w,y]}),e[25]=w,e[26]=y,e[27]=N):N=e[27],N}function Bn(t){const e=h.c(26),{item:s}=t,a=ze(),{org:o}=Fe(),i=rt(o.id),l=Is(o.id);let r;e[0]!==l.update||e[1]!==s.url||e[2]!==i?.sidebar_items?(r=async()=>{const $=(i?.sidebar_items||[]).filter(y=>y.url!==s.url);await l.update.mutateAsync({sidebar_items:$})},e[0]=l.update,e[1]=s.url,e[2]=i?.sidebar_items,e[3]=r):r=e[3];const c=r;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=/^https?:\/\/.+/,e[4]=d):d=e[4];let m;e[5]!==s.icon?(m=d.test(s.icon),e[5]=s.icon,e[6]=m):m=e[6];const f=m;let p;e[7]!==s.url||e[8]!==a?(p=()=>{a({to:s.url})},e[7]=s.url,e[8]=a,e[9]=p):p=e[9];const b=s.title;let u;e[10]!==f||e[11]!==s.icon||e[12]!==s.title?(u=n.jsx("div",{className:"flex items-center justify-center shrink-0",children:f?n.jsx("img",{src:s.icon,alt:s.title,className:"h-4 w-4 rounded object-cover"}):n.jsx(js,{size:16,className:"text-muted-foreground group-hover/item:text-foreground transition-colors"})}),e[10]=f,e[11]=s.icon,e[12]=s.title,e[13]=u):u=e[13];let x;e[14]!==s.title?(x=s.title.toLocaleLowerCase(),e[14]=s.title,e[15]=x):x=e[15];let g;e[16]!==x?(g=n.jsx("div",{className:"flex-1 min-w-0 flex flex-col items-start",children:n.jsx("span",{className:"truncate text-sm w-full capitalize",children:x})}),e[16]=x,e[17]=g):g=e[17];let j;e[18]!==c?(j=n.jsx($e,{size:16,className:"text-muted-foreground opacity-0 group-hover/item:opacity-50 hover:opacity-100 cursor-pointer",onClick:w=>{w.preventDefault(),w.stopPropagation(),c()}}),e[18]=c,e[19]=j):j=e[19];let v;return e[20]!==s.title||e[21]!==p||e[22]!==u||e[23]!==g||e[24]!==j?(v=n.jsx(Ke,{children:n.jsxs(Vt,{className:"w-full pr-2 group/item relative cursor-pointer text-foreground/90 hover:text-foreground",onClick:p,tooltip:b,children:[u,g,j]})}),e[20]=s.title,e[21]=p,e[22]=u,e[23]=g,e[24]=j,e[25]=v):v=e[25],v}function Hn(){const t=h.c(4),{org:e}=Fe(),a=rt(e.id)?.sidebar_items;if(!a?.length)return null;let o;t[0]!==a?(o=a.map(Un),t[0]=a,t[1]=o):o=t[1];let i;return t[2]!==o?(i=n.jsx(Kt,{children:o}),t[2]=o,t[3]=i):i=t[3],i}function Un(t){return n.jsx(Bn,{item:t},t.url)}function vt(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Ke,{children:n.jsx("div",{className:"flex items-center gap-2 px-4 py-2",children:n.jsx(Tt,{className:"h-4 flex-1"})})}),t[0]=e):e=t[0],e}function Kt(t){const e=h.c(4),{children:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(An,{className:"my-2 -ml-1"}),e[0]=a):a=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(Ke,{children:n.jsx("div",{className:"group-data-[collapsible=icon]:hidden px-2 py-0 text-xs font-medium h-6 text-muted-foreground flex items-center justify-between",children:n.jsx("span",{className:"whitespace-nowrap",children:"Pinned Views"})})}),e[1]=o):o=e[1];let i;return e[2]!==s?(i=n.jsxs(n.Fragment,{children:[a,o,s]}),e[2]=s,e[3]=i):i=e[3],i}function Gn(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(S.Suspense,{fallback:n.jsxs(Kt,{children:[n.jsx(vt,{}),n.jsx(vt,{})]}),children:n.jsx(Hn,{})}),t[0]=e):e=t[0],e}function Fn(){const t=h.c(14),{locator:e,org:s}=Fe(),a=ze(),o=Nt(),{org:i}=ht.parse(e);let l;t[0]!==e?(l=ht.isOrgAdminProject(e),t[0]=e,t[1]=l):l=t[1];const r=l,c=rt(s.id);let d;t[2]!==c?.enabled_plugins?(d=c?.enabled_plugins??[],t[2]=c?.enabled_plugins,t[3]=d):d=t[3];const m=d;let f;t[4]!==m?(f=C=>m.includes(C.pluginId),t[4]=m,t[5]=f):f=t[5];const p=ds.filter(f),b=o.location.pathname===`/${i}`||o.location.pathname===`/${i}/`;let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Os,{}),t[6]=u):u=t[6];let x;t[7]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(Pt,{}),t[7]=x):x=t[7];let g;t[8]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(Ms,{}),t[8]=g):g=t[8];let j;t[9]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(ot,{}),t[9]=j):j=t[9];let v;t[10]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Ft,{}),t[10]=v):v=t[10];let w;t[11]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(Et,{}),t[11]=w):w=t[11];let $;t[12]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx(Gt,{}),t[12]=$):$=t[12];let y;t[13]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(ct,{}),t[13]=y):y=t[13];const N=[{key:"home",label:"Home",icon:u,onClick:()=>{b?window.dispatchEvent(new CustomEvent("reset-home-view")):a({to:"/$org",params:{org:i}})}},{key:"store",label:"Store",icon:x,onClick:()=>a({to:"/$org/store",params:{org:i}})},...p.map(C=>({key:C.pluginId,label:C.label,icon:C.icon,onClick:()=>a({to:"/$org/$pluginId",params:{org:i,pluginId:C.pluginId}})})),{key:"mcps",label:"Connections",icon:g,onClick:()=>a({to:"/$org/mcps",params:{org:i}})},{key:"gateways",label:"Agents",icon:j,onClick:()=>a({to:"/$org/gateways",params:{org:i}})},{key:"workflow",label:"Workflows",icon:v,onClick:()=>a({to:"/$org/workflows",params:{org:i}})},{key:"monitoring",label:"Monitoring",icon:w,onClick:()=>a({to:"/$org/monitoring",params:{org:i}})},{key:"members",label:"Members",icon:$,onClick:()=>a({to:"/$org/members",params:{org:i}})},{key:"settings",label:"Settings",icon:y,onClick:()=>a({to:"/$org/settings",params:{org:i}})}];return r?N:[]}function Zt(t){const e=h.c(10),{navigationItems:s,footer:a,additionalContent:o,variant:i,collapsible:l}=t,r=i===void 0?"sidebar":i,c=l===void 0?"icon":l;let d;e[0]!==s?(d=s.map(Wn),e[0]=s,e[1]=d):d=e[1];let m;e[2]!==o||e[3]!==d?(m=n.jsx(Rn,{className:"flex-1 overflow-x-hidden",children:n.jsx(En,{className:"font-medium",children:n.jsx(Pn,{children:n.jsxs(Dn,{className:"gap-0.5",children:[d,o]})})})}),e[2]=o,e[3]=d,e[4]=m):m=e[4];let f;return e[5]!==c||e[6]!==a||e[7]!==m||e[8]!==r?(f=n.jsxs(On,{variant:r,collapsible:c,children:[m,a]}),e[5]=c,e[6]=a,e[7]=m,e[8]=r,e[9]=f):f=e[9],f}function Wn(t){return n.jsx(Ke,{children:n.jsxs(Vt,{className:"group/nav-item cursor-pointer text-foreground/90 hover:text-foreground",onClick:t.onClick,isActive:t.isActive,tooltip:t.label,children:[n.jsx("span",{className:"text-muted-foreground group-hover/nav-item:text-foreground transition-colors [&>svg]:size-4",children:t.icon}),n.jsx("span",{className:"truncate",children:t.label})]})},t.key)}Zt.Skeleton=function(){return n.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,s)=>n.jsx("div",{className:"w-full h-8",children:n.jsx(Tt,{className:"h-full bg-sidebar-accent rounded-md"})},s))})};function Vn(){const t=h.c(3),e=Fn();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(n.Fragment,{children:n.jsx(lt,{children:n.jsx(S.Suspense,{fallback:null,children:n.jsx(Gn,{})})})}),t[0]=s):s=t[0];let a;return t[1]!==e?(a=n.jsx(Zt,{navigationItems:e,additionalContent:s}),t[1]=e,t[2]=a):a=t[2],a}function Kn(t){const e=h.c(12);let s,a,o,i;e[0]!==t?({className:s,orientation:o,decorative:i,...a}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=i):(s=e[1],a=e[2],o=e[3],i=e[4]);const l=o===void 0?"horizontal":o,r=i===void 0?!0:i;let c;e[5]!==s?(c=T("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",s),e[5]=s,e[6]=c):c=e[6];let d;return e[7]!==r||e[8]!==l||e[9]!==a||e[10]!==c?(d=n.jsx(ms,{"data-slot":"separator-root",decorative:r,orientation:l,className:c,...a}),e[7]=r,e[8]=l,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}const Yt=S.createContext(null);function Zn(){const t=S.useContext(Yt);if(!t)throw new Error("TopbarSwitcher compound components must be used within TopbarSwitcher.Root");return t}function Yn(t){const e=h.c(10),{children:s,onItemHover:a}=t,[o,i]=S.useState(null);let l;e[0]!==a?(l=f=>{i(f),a?.(f)},e[0]=a,e[1]=l):l=e[1];const r=l;let c;e[2]!==o||e[3]!==r?(c={hoveredItem:o,setHoveredItem:r},e[2]=o,e[3]=r,e[4]=c):c=e[4];let d;e[5]!==s?(d=n.jsx(_t,{children:s}),e[5]=s,e[6]=d):d=e[6];let m;return e[7]!==c||e[8]!==d?(m=n.jsx(Yt.Provider,{value:c,children:d}),e[7]=c,e[8]=d,e[9]=m):m=e[9],m}function qn(t){const e=h.c(6),{children:s,onClick:a}=t;let o;e[0]!==s||e[1]!==a?(o=n.jsx(J,{variant:"link",className:"p-0.5 h-auto",onClick:a,type:"button",children:s}),e[0]=s,e[1]=a,e[2]=o):o=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(kt,{asChild:!0,children:n.jsx(J,{size:"icon",variant:"ghost",className:"w-6 h-6 p-0",children:n.jsx(Dt,{size:16,className:"opacity-50"})})}),e[3]=i):i=e[3];let l;return e[4]!==o?(l=n.jsxs("div",{className:"flex items-center gap-1",children:[o,i]}),e[4]=o,e[5]=l):l=e[5],l}function Jn(t){const e=h.c(8),{item:s,fallback:a}=t,o=a===void 0?"":a,i=s?.avatarUrl??"",l=s?.name??o;let r;e[0]!==i||e[1]!==l?(r=n.jsx(ee,{url:i,fallback:l,size:"xs",objectFit:"contain"}),e[0]=i,e[1]=l,e[2]=r):r=e[2];const c=s?.name??o;let d;e[3]!==c?(d=n.jsx("span",{children:c}),e[3]=c,e[4]=d):d=e[4];let m;return e[5]!==r||e[6]!==d?(m=n.jsxs("div",{className:"flex items-center gap-2",children:[r,d]}),e[5]=r,e[6]=d,e[7]=m):m=e[7],m}function Xn(t){const e=h.c(6),{children:s,align:a}=t,o=a===void 0?"start":a,l=S.Children.toArray(s).filter(Qn).length===1?"280px":"480px";let r;e[0]!==l?(r={width:l},e[0]=l,e[1]=r):r=e[1];let c;return e[2]!==o||e[3]!==s||e[4]!==r?(c=n.jsx(It,{align:o,className:"p-0 flex items-start",style:r,children:s}),e[2]=o,e[3]=s,e[4]=r,e[5]=c):c=e[5],c}function Qn(t){return S.isValidElement(t)&&(t.type===Jt||t.type===qt)}function qt(t){const e=h.c(5),{children:s,className:a}=t;let o;e[0]!==a?(o=T("flex flex-col border-border w-[240px] border-r last:border-r-0 last:w-full",a),e[0]=a,e[1]=o):o=e[1];let i;return e[2]!==s||e[3]!==o?(i=n.jsx("div",{className:o,children:s}),e[2]=s,e[3]=o,e[4]=i):i=e[4],i}const Jt=qt;function ea(t){const e=h.c(6),{placeholder:s,value:a,onChange:o}=t,i=s===void 0?"Search...":s;let l;e[0]!==o?(l=c=>o(c.target.value),e[0]=o,e[1]=l):l=e[1];let r;return e[2]!==i||e[3]!==l||e[4]!==a?(r=n.jsx(As,{placeholder:i,value:a,onChange:l,className:"rounded-none border-t-0 border-x-0 focus-visible:border-border focus-visible:ring-0"}),e[2]=i,e[3]=l,e[4]=a,e[5]=r):r=e[5],r}function ta(t){const e=h.c(6),{children:s,emptyMessage:a}=t,o=a===void 0?"No items found.":a,i=S.Children.count(s)>0;let l;e[0]!==o||e[1]!==i?(l=!i&&n.jsx("div",{className:"text-muted-foreground text-sm px-1 py-8 text-center",children:o}),e[0]=o,e[1]=i,e[2]=l):l=e[2];let r;return e[3]!==s||e[4]!==l?(r=n.jsxs("div",{className:"flex flex-col gap-0.5 p-1 max-h-44 overflow-y-auto",children:[l,s]}),e[3]=s,e[4]=l,e[5]=r):r=e[5],r}function sa(t){const e=h.c(15),{item:s,onClick:a,onHover:o,children:i}=t,l=Zn();let r;e[0]!==l||e[1]!==s||e[2]!==o?(r=()=>{l.setHoveredItem(s.slug),o?.(s)},e[0]=l,e[1]=s,e[2]=o,e[3]=r):r=e[3];const c=r;let d;e[4]!==s||e[5]!==a?(d=()=>a(s),e[4]=s,e[5]=a,e[6]=d):d=e[6];let m;e[7]!==i||e[8]!==s.avatarUrl||e[9]!==s.name?(m=i||n.jsxs(n.Fragment,{children:[n.jsx(ee,{url:s.avatarUrl??"",fallback:s.name,size:"xs",className:"w-[22px]! h-[22px]!",objectFit:"contain"}),n.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:s.name})]}),e[7]=i,e[8]=s.avatarUrl,e[9]=s.name,e[10]=m):m=e[10];let f;return e[11]!==c||e[12]!==d||e[13]!==m?(f=n.jsx(J,{onClick:d,onMouseEnter:c,variant:"ghost",size:"sm",className:"w-full justify-start font-normal",children:m}),e[11]=c,e[12]=d,e[13]=m,e[14]=f):f=e[14],f}function na(t){const e=h.c(2),{children:s}=t;let a;return e[0]!==s?(a=n.jsx("div",{className:"px-1 pb-1 pt-0.5",children:s}),e[0]=s,e[1]=a):a=e[1],a}function aa(t){const e=h.c(11),{onClick:s,icon:a,children:o,variant:i}=t,r=(i===void 0?"default":i)==="muted"&&"text-muted-foreground";let c;e[0]!==r?(c=T("w-full justify-start font-normal",r),e[0]=r,e[1]=c):c=e[1];let d;e[2]!==a?(d=a&&n.jsx("span",{className:"[&>svg]:size-4",children:a}),e[2]=a,e[3]=d):d=e[3];let m;e[4]!==o?(m=n.jsx("span",{children:o}),e[4]=o,e[5]=m):m=e[5];let f;return e[6]!==s||e[7]!==c||e[8]!==d||e[9]!==m?(f=n.jsxs(J,{variant:"ghost",size:"sm",className:c,onClick:s,children:[d,m]}),e[6]=s,e[7]=c,e[8]=d,e[9]=m,e[10]=f):f=e[10],f}function oa(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Kn,{}),t[0]=e):e=t[0],e}function ia(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"h-4 w-16 bg-accent rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const G=Object.assign(Yn,{Trigger:qn,CurrentItem:Jn,Content:Xn,Panel:Jt,Search:ea,Items:ta,Item:sa,Actions:na,Action:aa,Separator:oa,Skeleton:ia});function it(){const t=h.c(59);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:s}=wt(e),{data:a}=q.useListOrganizations(),o=ze();let i;t[1]!==s||t[2]!==a?(i=a?.find(R=>R.slug===s),t[1]=s,t[2]=a,t[3]=i):i=t[3];const l=i,[r,c]=S.useState(""),[d,m]=S.useState(!1);let f,p,b,u,x,g,j,v;if(t[4]!==l||t[5]!==o||t[6]!==s||t[7]!==r||t[8]!==a){const L=(a?(()=>{const D=a.filter(V=>V.name.toLowerCase().includes(r.toLowerCase()));if(s){const V=D.findIndex(X=>X.slug===s);if(V>0){const X=D[V];X&&(D.splice(V,1),D.unshift(X))}}return D})():[]).map(la);let B;t[17]!==l?(B=l?{slug:l.slug,name:l.name,avatarUrl:l.logo}:void 0,t[17]=l,t[18]=B):B=t[18];const z=B;u=G;let U;t[19]!==o||t[20]!==s?(U=()=>o({to:"/$org",params:{org:s??""}}),t[19]=o,t[20]=s,t[21]=U):U=t[21];let E;t[22]!==z?(E=n.jsx(G.CurrentItem,{item:z}),t[22]=z,t[23]=E):E=t[23],t[24]!==U||t[25]!==E?(v=n.jsx(G.Trigger,{onClick:U,children:E}),t[24]=U,t[25]=E,t[26]=v):v=t[26],b=G.Content,p=G.Panel,t[27]!==r?(j=n.jsx(G.Search,{placeholder:"Search organizations...",value:r,onChange:c}),t[27]=r,t[28]=j):j=t[28],f=G.Items,x="No organizations found.";let F;t[29]!==o?(F=D=>n.jsx(G.Item,{item:D,onClick:V=>o({to:"/$org",params:{org:V.slug}})},D.slug),t[29]=o,t[30]=F):F=t[30],g=L.map(F),t[4]=l,t[5]=o,t[6]=s,t[7]=r,t[8]=a,t[9]=f,t[10]=p,t[11]=b,t[12]=u,t[13]=x,t[14]=g,t[15]=j,t[16]=v}else f=t[9],p=t[10],b=t[11],u=t[12],x=t[13],g=t[14],j=t[15],v=t[16];let w;t[31]!==f||t[32]!==x||t[33]!==g?(w=n.jsx(f,{emptyMessage:x,children:g}),t[31]=f,t[32]=x,t[33]=g,t[34]=w):w=t[34];let $,y;t[35]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx(G.Actions,{children:n.jsx(G.Action,{onClick:()=>m(!0),variant:"muted",children:"+ Create organization"})}),y=n.jsx(G.Separator,{}),t[35]=$,t[36]=y):($=t[35],y=t[36]);let N;t[37]!==o?(N=()=>o({to:"/"}),t[37]=o,t[38]=N):N=t[38];let C;t[39]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(Rs,{}),t[39]=C):C=t[39];let O;t[40]!==N?(O=n.jsx(G.Actions,{children:n.jsx(G.Action,{onClick:N,icon:C,children:"See all organizations"})}),t[40]=N,t[41]=O):O=t[41];let _;t[42]!==p||t[43]!==O||t[44]!==j||t[45]!==w?(_=n.jsxs(p,{children:[j,w,$,y,O]}),t[42]=p,t[43]=O,t[44]=j,t[45]=w,t[46]=_):_=t[46];let M;t[47]!==b||t[48]!==_?(M=n.jsx(b,{children:_}),t[47]=b,t[48]=_,t[49]=M):M=t[49];let k;t[50]!==u||t[51]!==M||t[52]!==v?(k=n.jsxs(u,{children:[v,M]}),t[50]=u,t[51]=M,t[52]=v,t[53]=k):k=t[53];let I;t[54]!==d?(I=n.jsx(Ts,{open:d,onOpenChange:m}),t[54]=d,t[55]=I):I=t[55];let A;return t[56]!==k||t[57]!==I?(A=n.jsxs(n.Fragment,{children:[k,I]}),t[56]=k,t[57]=I,t[58]=A):A=t[58],A}function la(t){return{slug:t.slug,name:t.name,avatarUrl:t.logo}}it.Skeleton=G.Skeleton;const Xt=S.createContext({setOpen:()=>{}}),ra=()=>S.useContext(Xt),ca=t=>{const e=h.c(25);let s,a,o,i,l;e[0]!==t?({children:s,defaultOpen:a,open:i,onOpenChange:o,...l}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=i,e[5]=l):(s=e[1],a=e[2],o=e[3],i=e[4],l=e[5]);const r=a??!1;let c;e[6]!==o||e[7]!==i||e[8]!==r?(c={prop:i,defaultProp:r,onChange:o},e[6]=o,e[7]=i,e[8]=r,e[9]=c):c=e[9];const[d,m]=Bs(c);let f;e[10]!==m?(f={setOpen:m},e[10]=m,e[11]=f):f=e[11];let p;e[12]!==s||e[13]!==d||e[14]!==l||e[15]!==m?(p=n.jsx(Hs,{open:d,onOpenChange:m,...l,children:s}),e[12]=s,e[13]=d,e[14]=l,e[15]=m,e[16]=p):p=e[16];let b;e[17]!==d||e[18]!==l||e[19]!==m||e[20]!==p?(b=n.jsx(Js,{open:d,onOpenChange:m,...l,children:p}),e[17]=d,e[18]=l,e[19]=m,e[20]=p,e[21]=b):b=e[21];let u;return e[22]!==f||e[23]!==b?(u=n.jsx(Xt.Provider,{value:f,children:b}),e[22]=f,e[23]=b,e[24]=u):u=e[24],u},da=t=>{const{children:e,title:s,...a}=t,o=Me(),{className:i,...l}=a;return o?n.jsxs(Ps,{...l,children:[n.jsx(Ds,{className:"hidden",children:n.jsx(Ls,{children:s})}),n.jsx("div",{className:T("flex flex-col gap-2 p-2 py-4",i),children:e})]}):n.jsx(qs,{...a,children:e})},ma=t=>{const{children:e,...s}=t,{setOpen:a}=ra(),o=Me(),{className:i,...l}=s;return o?n.jsx("div",{...l,onClick:r=>{a(!1);const{onClick:c}=l;c?.(r)},className:T("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",i),children:e}):n.jsx(Xs,{...s,children:e})},fa=t=>{const e=h.c(7);let s,a;e[0]!==t?({children:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);const o=Me();let i;return e[3]!==s||e[4]!==o||e[5]!==a?(i=o?n.jsx(Es,{asChild:!0,children:s}):n.jsx(Ys,{...a,children:s}),e[3]=s,e[4]=o,e[5]=a,e[6]=i):i=e[6],i},ua=t=>{const e=h.c(7);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);const o=Me();let i;return e[3]!==s||e[4]!==o||e[5]!==a?(i=o?n.jsx(bt,{className:T(s),...a}):n.jsx(bt,{className:T(s),...a}),e[3]=s,e[4]=o,e[5]=a,e[6]=i):i=e[6],i};function pa(t){const e=h.c(11),{user:s,trigger:a,align:o,children:i}=t,l=o===void 0?"start":o;let r;e[0]!==a||e[1]!==s?(r=a(s),e[0]=a,e[1]=s,e[2]=r):r=e[2];let c;e[3]!==r?(c=n.jsx(fa,{asChild:!0,children:n.jsx("div",{children:r})}),e[3]=r,e[4]=c):c=e[4];let d;e[5]!==l||e[6]!==i?(d=n.jsx(da,{side:"top",align:l,className:"md:w-[240px]",children:i}),e[5]=l,e[6]=i,e[7]=d):d=e[7];let m;return e[8]!==c||e[9]!==d?(m=n.jsxs(ca,{children:[c,d]}),e[8]=c,e[9]=d,e[10]=m):m=e[10],m}function ha(t){const e=h.c(8),{children:s,onClick:a,className:o,asChild:i}=t;let l;e[0]!==i||e[1]!==s||e[2]!==a?(l=i?s:n.jsx("button",{type:"button",className:"flex items-center gap-2 text-sm w-full cursor-pointer",onClick:a,children:s}),e[0]=i,e[1]=s,e[2]=a,e[3]=l):l=e[3];let r;return e[4]!==i||e[5]!==o||e[6]!==l?(r=n.jsx(ma,{asChild:i,className:o,children:l}),e[4]=i,e[5]=o,e[6]=l,e[7]=r):r=e[7],r}function xa(t){const e=h.c(2),{className:s}=t;let a;return e[0]!==s?(a=n.jsx(ua,{className:s}),e[0]=s,e[1]=a):a=e[1],a}function ga(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const Z=Object.assign(pa,{Item:ha,Separator:xa,Skeleton:ga});function ba(t){const e=h.c(48),{open:s,onOpenChange:a,user:o,userImage:i}=t,[l,r]=Us(),[c,d]=S.useState(!1);let m;e[0]!==o.id?(m=()=>{navigator.clipboard.writeText(o.id),d(!0),setTimeout(()=>d(!1),2e3)},e[0]=o.id,e[1]=m):m=e[1];const f=m;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(Qs,{className:"text-base",children:"Profile Settings"}),e[2]=p):p=e[2];let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsxs(en,{className:"px-6 pt-6 pb-4 border-b border-border shrink-0 relative",children:[p,n.jsxs(tn,{className:"absolute top-1/2 right-4 -translate-y-1/2 cursor-pointer rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",children:[n.jsx($e,{size:16}),n.jsx("span",{className:"sr-only",children:"Close"})]})]}),e[3]=b):b=e[3];const u=o.name||"U";let x;e[4]!==u||e[5]!==i?(x=n.jsx(ee,{url:i,fallback:u,shape:"circle",size:"xl",className:"h-16 w-16"}),e[4]=u,e[5]=i,e[6]=x):x=e[6];const g=o.name||"User";let j;e[7]!==g?(j=n.jsx("span",{className:"text-base font-medium text-foreground",children:g}),e[7]=g,e[8]=j):j=e[8];let v;e[9]!==o.email?(v=n.jsx("span",{className:"text-sm text-muted-foreground",children:o.email}),e[9]=o.email,e[10]=v):v=e[10];let w;e[11]!==j||e[12]!==v?(w=n.jsxs("div",{className:"flex flex-col gap-1",children:[j,v]}),e[11]=j,e[12]=v,e[13]=w):w=e[13];let $;e[14]!==x||e[15]!==w?($=n.jsxs("div",{className:"flex items-center gap-4",children:[x,w]}),e[14]=x,e[15]=w,e[16]=$):$=e[16];let y;e[17]!==l||e[18]!==r?(y=()=>r(!l),e[17]=l,e[18]=r,e[19]=y):y=e[19];let N;e[20]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsxs("div",{className:"flex flex-col gap-1 flex-1 min-w-0",children:[n.jsxs(an,{className:"text-sm font-medium text-foreground flex items-center gap-2 pointer-events-none",children:[n.jsx(ln,{size:16,className:"text-muted-foreground"}),"Developer Mode"]}),n.jsx("p",{className:"text-xs text-muted-foreground pointer-events-none",children:"Show technical details like JSON input/output for tool calls"})]}),e[20]=N):N=e[20];let C;e[21]!==l||e[22]!==r?(C=n.jsx("div",{onClick:ja,children:n.jsx(on,{checked:l,onCheckedChange:r})}),e[21]=l,e[22]=r,e[23]=C):C=e[23];let O;e[24]!==y||e[25]!==C?(O=n.jsxs("button",{type:"button",onClick:y,className:"flex items-center justify-between gap-4 p-4 rounded-lg border border-border hover:bg-accent/50 transition-colors text-left w-full cursor-pointer",children:[N,C]}),e[24]=y,e[25]=C,e[26]=O):O=e[26];let _;e[27]!==$||e[28]!==O?(_=n.jsxs("div",{className:"p-5 space-y-6 min-h-[225px]",children:[$,O]}),e[27]=$,e[28]=O,e[29]=_):_=e[29];let M;e[30]!==o.id?(M=n.jsx("span",{className:"font-mono text-xs",children:o.id}),e[30]=o.id,e[31]=M):M=e[31];let k;e[32]!==c?(k=c?n.jsx(Ge,{size:14,className:"text-green-600"}):n.jsx(At,{size:14,className:"opacity-0 group-hover:opacity-100 transition-opacity"}),e[32]=c,e[33]=k):k=e[33];let I;e[34]!==f||e[35]!==M||e[36]!==k?(I=n.jsx(Mt,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:f,className:"group flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[M,k]})}),e[34]=f,e[35]=M,e[36]=k,e[37]=I):I=e[37];let A;e[38]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx($t,{side:"top",children:n.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[38]=A):A=e[38];let R;e[39]!==I?(R=n.jsx("div",{className:"border-t border-border px-5 py-4 flex items-center shrink-0",children:n.jsx(zt,{children:n.jsxs(Ot,{children:[I,A]})})}),e[39]=I,e[40]=R):R=e[40];let L;e[41]!==_||e[42]!==R?(L=n.jsxs(sn,{className:"sm:max-w-lg sm:max-h-[85vh] p-0 flex flex-col",closeButtonClassName:"hidden",children:[b,n.jsxs("div",{className:"flex flex-col",children:[_,R]})]}),e[41]=_,e[42]=R,e[43]=L):L=e[43];let B;return e[44]!==a||e[45]!==s||e[46]!==L?(B=n.jsx(nn,{open:s,onOpenChange:a,children:L}),e[44]=a,e[45]=s,e[46]=L,e[47]=B):B=e[47],B}function ja(t){return t.stopPropagation()}function va(t){const e=h.c(47),{user:s,userImage:a}=t,[o,i]=S.useState(!1),[l,r]=S.useState(!1);let c;e[0]!==s.email||e[1]!==s.id||e[2]!==s.name?(c=()=>{const B=`ID: ${s.id}
2
2
  Name: ${s.name||"N/A"}
3
3
  Email: ${s.email}`;navigator.clipboard.writeText(B),r(!0),Y.success("User info copied to clipboard"),setTimeout(()=>r(!1),2e3)},e[0]=s.email,e[1]=s.id,e[2]=s.name,e[3]=c):c=e[3];const d=c;let m;e[4]!==s.email||e[5]!==s.name||e[6]!==a?(m=()=>n.jsx(ee,{url:a,fallback:s.name||s.email||"U",shape:"circle",size:"sm",className:"cursor-pointer hover:ring-2 ring-muted-foreground transition-all h-7 w-7"}),e[4]=s.email,e[5]=s.name,e[6]=a,e[7]=m):m=e[7];const f=s.name||s.email||"U";let p;e[8]!==f||e[9]!==a?(p=n.jsx(ee,{url:a,fallback:f,shape:"circle",size:"sm"}),e[8]=f,e[9]=a,e[10]=p):p=e[10];const b=s.name||"User";let u;e[11]!==b?(u=n.jsx("div",{className:"text-sm font-medium truncate",children:b}),e[11]=b,e[12]=u):u=e[12];let x;e[13]!==s.email?(x=n.jsx("div",{className:"text-xs text-muted-foreground truncate",children:s.email}),e[13]=s.email,e[14]=x):x=e[14];let g;e[15]!==u||e[16]!==x?(g=n.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[u,x]}),e[15]=u,e[16]=x,e[17]=g):g=e[17];let j;e[18]!==l?(j=n.jsx("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:l?n.jsx(Ge,{size:16,className:"text-green-600"}):n.jsx(At,{size:16,className:"text-muted-foreground"})}),e[18]=l,e[19]=j):j=e[19];let v;e[20]!==p||e[21]!==g||e[22]!==j?(v=n.jsxs("div",{className:"group flex items-center gap-3 w-full py-1",children:[p,g,j]}),e[20]=p,e[21]=g,e[22]=j,e[23]=v):v=e[23];let w;e[24]!==d||e[25]!==v?(w=n.jsx(Z.Item,{onClick:d,children:v}),e[24]=d,e[25]=v,e[26]=w):w=e[26];let $;e[27]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx(Z.Separator,{}),e[27]=$):$=e[27];let y,N;e[28]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsxs(Z.Item,{onClick:()=>i(!0),children:[n.jsx(ct,{className:"text-muted-foreground",size:18}),"Profile Settings"]}),N=n.jsx(Z.Separator,{}),e[28]=y,e[29]=N):(y=e[28],N=e[29]);let C;e[30]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(fs,{className:"w-4 h-4 text-muted-foreground"}),e[30]=C):C=e[30];let O;e[31]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx(Z.Item,{asChild:!0,children:n.jsxs("a",{href:"https://github.com/decocms/admin",target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 text-sm cursor-pointer",children:[C,"decocms/admin",n.jsx(jt,{size:18,className:"text-muted-foreground ml-auto"})]})}),e[31]=O):O=e[31];let _;e[32]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(Lt,{className:"text-muted-foreground",size:18}),e[32]=_):_=e[32];let M,k;e[33]===Symbol.for("react.memo_cache_sentinel")?(M=n.jsx(Z.Item,{asChild:!0,children:n.jsxs("a",{href:"https://decocms.com",target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 text-sm cursor-pointer",children:[_,"Homepage",n.jsx(jt,{size:18,className:"ml-auto text-muted-foreground"})]})}),k=n.jsx(Z.Separator,{}),e[33]=M,e[34]=k):(M=e[33],k=e[34]);let I;e[35]===Symbol.for("react.memo_cache_sentinel")?(I=n.jsxs(Z.Item,{onClick:Sa,children:[n.jsx(Ht,{size:18,className:"text-muted-foreground"}),"Log out"]}),e[35]=I):I=e[35];let A;e[36]!==w||e[37]!==m||e[38]!==s?(A=n.jsxs(Z,{user:s,trigger:m,align:"end",children:[w,$,y,N,O,M,k,I]}),e[36]=w,e[37]=m,e[38]=s,e[39]=A):A=e[39];let R;e[40]!==o||e[41]!==s||e[42]!==a?(R=o&&n.jsx(ba,{open:o,onOpenChange:i,user:s,userImage:a}),e[40]=o,e[41]=s,e[42]=a,e[43]=R):R=e[43];let L;return e[44]!==A||e[45]!==R?(L=n.jsxs(n.Fragment,{children:[A,R]}),e[44]=A,e[45]=R,e[46]=L):L=e[46],L}function Sa(){return q.signOut()}function Na(){const t=h.c(7),{data:e}=q.useSession();if(!e?.user){let c;return t[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ee,{url:void 0,fallback:"U",shape:"circle",size:"sm",className:"cursor-pointer h-7 w-7",muted:!0}),t[0]=c):c=t[0],c}const s=e.user,a=s.name??void 0;let o;t[1]!==a||t[2]!==s?(o={...s,name:a},t[1]=a,t[2]=s,t[3]=o):o=t[3];const i=o,l=s.image;let r;return t[4]!==l||t[5]!==i?(r=n.jsx(va,{user:i,userImage:l}),t[4]=l,t[5]=i,t[6]=r):r=t[6],r}function mt(){const t=h.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=Ve.decoChatOpen(),t[0]=e):e=t[0];const[s,a]=We(e,wa);let o;return t[1]!==s||t[2]!==a?(o=[s,a],t[1]=s,t[2]=a,t[3]=o):o=t[3],o}function wa(t){return!!(t??!1)}function ya(t){const e=h.c(6),{children:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(us,{children:n.jsx(yt,{})}),e[0]=a):a=e[0];let o;e[1]!==s?(o=n.jsx(ps,{children:s}),e[1]=s,e[2]=o):o=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(hs,{children:n.jsx(xs,{to:"/login",replace:!0})}),e[3]=i):i=e[3];let l;return e[4]!==o?(l=n.jsxs(n.Fragment,{children:[a,o,i]}),e[4]=o,e[5]=l):l=e[5],l}function Ca(t){const e=h.c(5),{children:s,className:a}=t;let o;e[0]!==a?(o=T("fixed top-0 left-0 right-0 z-20 bg-sidebar flex items-center w-full h-12 border-b border-border",a),e[0]=a,e[1]=o):o=e[1];let i;return e[2]!==s||e[3]!==o?(i=n.jsx("div",{className:o,children:s}),e[2]=s,e[3]=o,e[4]=i):i=e[4],i}function _a(t){const e=h.c(5),{children:s,className:a}=t;let o;e[0]!==a?(o=T("flex items-center justify-center px-2.5 h-full border-r border-border",a),e[0]=a,e[1]=o):o=e[1];let i;return e[2]!==s||e[3]!==o?(i=n.jsx("div",{className:o,children:s}),e[2]=s,e[3]=o,e[4]=i):i=e[4],i}function ka(t){const e=h.c(5),{children:s,className:a}=t;let o;e[0]!==a?(o=T("flex items-center gap-2 px-2 h-full",a),e[0]=a,e[1]=o):o=e[1];let i;return e[2]!==s||e[3]!==o?(i=n.jsx("div",{className:o,children:s}),e[2]=s,e[3]=o,e[4]=i):i=e[4],i}function Ia(t){const e=h.c(5),{children:s,className:a}=t;let o;e[0]!==a?(o=T("flex items-center gap-2 px-2 h-full flex-1",a),e[0]=a,e[1]=o):o=e[1];let i;return e[2]!==s||e[3]!==o?(i=n.jsx("div",{className:o,children:s}),e[2]=s,e[3]=o,e[4]=i):i=e[4],i}function $a(t){const e=h.c(5),{children:s,className:a}=t;let o;e[0]!==a?(o=T("flex items-center gap-2 px-2 h-full ml-auto",a),e[0]=a,e[1]=o):o=e[1];let i;return e[2]!==s||e[3]!==o?(i=n.jsx("div",{className:o,children:s}),e[2]=s,e[3]=o,e[4]=i):i=e[4],i}function za(){const t=h.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex items-center justify-center px-2 h-full border-r border-border",children:n.jsx("div",{className:"w-8 h-8 bg-muted rounded-md animate-pulse"})}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("div",{className:"flex items-center gap-2 px-2 h-full",children:n.jsx("div",{className:"w-32 h-6 bg-muted rounded-md animate-pulse"})}),t[1]=s):s=t[1];let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsxs("div",{className:"fixed top-0 left-0 right-0 z-20 bg-sidebar flex items-center w-full h-12 border-b border-border",children:[e,s,n.jsx("div",{className:"flex items-center gap-2 px-2 h-full ml-auto",children:n.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"})})]}),t[2]=a):a=t[2],a}const Ue=Object.assign(Ca,{Sidebar:_a,Left:ka,Center:Ia,Right:$a,Skeleton:za});function Qt(){const t=h.c(3),{toggleSidebar:e}=dt();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(Bt,{className:"text-muted-foreground/85 group-hover:text-foreground transition-colors",size:18}),t[0]=s):s=t[0];let a;return t[1]!==e?(a=n.jsx(n.Fragment,{children:n.jsx(J,{onClick:e,size:"icon",variant:"ghost",className:"w-7 h-7 rounded-md",children:s})}),t[1]=e,t[2]=a):a=t[2],a}Qt.Skeleton=function(){return n.jsx("div",{className:"w-7 h-7 bg-muted rounded-md animate-pulse"})};const Ma="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png";function Oa(){const t=h.c(147),{org:e,locator:s}=Fe(),{slug:a,id:o}=e,[,i]=mt(),l=ze(),{data:r}=q.useSession(),c=r?.user,{createThread:d,activeThreadId:m,setActiveThreadId:f,hideThread:p}=gt(),{threads:b,refetch:u}=Gs(),x=Fs(),g=Ws(),j=mn();let v;t[0]!==j?(v={connections:j,binding:"LLMS"},t[0]=j,t[1]=v):v=t[1];const[w]=fn(v),$=!!w;let y;t[2]!==s?(y=Ve.chatSelectedModel(s),t[2]=s,t[3]=y):y=t[3];const[N,C]=vs(y,g,Ta),[O,_]=We(`${s}:selected-gateway-id`,null);let M;t[4]!==x||t[5]!==O?(M=O?x.find(H=>H.id===O)??null:null,t[4]=x,t[5]=O,t[6]=M):M=t[6];const k=M,I=k?.id??null,A=Ss(I),R=Ns(),L=I??void 0;let B;t[7]!==m||t[8]!==A||t[9]!==R||t[10]!==L?(B={threadId:m,systemPrompt:A,onToolCall:R,gatewayId:L},t[7]=m,t[8]=A,t[9]=R,t[10]=L,t[11]=B):B=t[11];const z=ws(B),{inputValue:U,setInputValue:E,branchContext:F,clearBranch:D}=gt(),{isEmpty:V}=z,X=!I;let Oe;t[12]!==F||t[13]!==D||t[14]!==f||t[15]!==E?(Oe=()=>{F&&(f(F.originalThreadId),D(),E(""))},t[12]=F,t[13]=D,t[14]=f,t[15]=E,t[16]=Oe):Oe=t[16];const Ze=Oe;let Te;t[17]!==m||t[18]!==z||t[19]!==D||t[20]!==I||t[21]!==N||t[22]!==E||t[23]!==c?.image||t[24]!==c?.name?(Te=async H=>{if(!N){Y.error("No model configured");return}E(""),D();const Q={created_at:new Date().toISOString(),thread_id:m,model:{id:N.id,connectionId:N.connectionId,provider:N.provider??void 0,limits:N.limits??void 0},gateway:{id:I},user:{avatar:c?.image??void 0,name:c?.name??"you"}};await z.sendMessage(H,Q)},t[17]=m,t[18]=z,t[19]=D,t[20]=I,t[21]=N,t[22]=E,t[23]=c?.image,t[24]=c?.name,t[25]=Te):Te=t[25];const W=Te;let Ae;t[26]!==C?(Ae=H=>{C(H)},t[26]=C,t[27]=Ae):Ae=t[27];const Ye=Ae;let Re;t[28]!==_?(Re=H=>{_(H)},t[28]=_,t[29]=Re):Re=t[29];const te=Re,K=z.status==="submitted"||z.status==="streaming";if(!$){let H;t[30]===Symbol.for("react.memo_cache_sentinel")?(H=n.jsxs(P.Header.Left,{children:[n.jsx("img",{src:Ma,alt:"deco chat",className:"size-5 rounded"}),n.jsx("span",{className:"text-sm font-medium",children:"deco chat"})]}),t[30]=H):H=t[30];let Q;t[31]!==i?(Q=()=>i(!1),t[31]=i,t[32]=Q):Q=t[32];let Be;t[33]===Symbol.for("react.memo_cache_sentinel")?(Be=n.jsx($e,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[33]=Be):Be=t[33];let _e;t[34]!==Q?(_e=n.jsxs(P.Header,{children:[H,n.jsx(P.Header.Right,{children:n.jsx("button",{type:"button",onClick:Q,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:Be})})]}),t[34]=Q,t[35]=_e):_e=t[35];const nt=c?.id??"";let ke;t[36]!==l||t[37]!==a?(ke=()=>l({to:"/$org/mcps",params:{org:a},search:{action:"create"}}),t[36]=l,t[37]=a,t[38]=ke):ke=t[38];let Ie;t[39]!==j||t[40]!==o||t[41]!==a||t[42]!==nt||t[43]!==ke?(Ie=n.jsx(P.Main,{className:"flex flex-col items-center",children:n.jsx(P.EmptyState,{children:n.jsx(ys,{title:"No model provider connected",description:"Connect to a model provider to unlock AI-powered features.",orgSlug:a,orgId:o,userId:nt,allConnections:j,onInstallMcpServer:ke})})}),t[39]=j,t[40]=o,t[41]=a,t[42]=nt,t[43]=ke,t[44]=Ie):Ie=t[44];let He;return t[45]!==_e||t[46]!==Ie?(He=n.jsxs(P,{children:[_e,Ie]}),t[45]=_e,t[46]=Ie,t[47]=He):He=t[47],He}const qe=k?.icon??"/favicon.svg",Je=k?.title??"deco chat";let Ee;t[48]===Symbol.for("react.memo_cache_sentinel")?(Ee=n.jsx(ot,{size:12}),t[48]=Ee):Ee=t[48];let se;t[49]!==qe||t[50]!==Je?(se=n.jsx(xt,{icon:qe,name:Je,size:"xs",fallbackIcon:Ee}),t[49]=qe,t[50]=Je,t[51]=se):se=t[51];const Xe=k?.title||"deco chat";let ne;t[52]!==Xe?(ne=n.jsx("span",{className:"text-sm font-medium",children:Xe}),t[52]=Xe,t[53]=ne):ne=t[53];let ae;t[54]!==se||t[55]!==ne?(ae=n.jsxs(P.Header.Left,{children:[se,ne]}),t[54]=se,t[55]=ne,t[56]=ae):ae=t[56];let oe;t[57]!==d?(oe=()=>d(),t[57]=d,t[58]=oe):oe=t[58];let Pe;t[59]===Symbol.for("react.memo_cache_sentinel")?(Pe=n.jsx(dn,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[59]=Pe):Pe=t[59];let ie;t[60]!==oe?(ie=n.jsx("button",{type:"button",onClick:oe,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",title:"New chat",children:Pe}),t[60]=oe,t[61]=ie):ie=t[61];let le;t[62]!==u?(le=()=>u(),t[62]=u,t[63]=le):le=t[63];let re;t[64]!==m||t[65]!==p||t[66]!==f||t[67]!==le||t[68]!==b?(re=n.jsx(Cs,{threads:b,activeThreadId:m,onSelectThread:f,onRemoveThread:p,onOpen:le}),t[64]=m,t[65]=p,t[66]=f,t[67]=le,t[68]=b,t[69]=re):re=t[69];let ce;t[70]!==i?(ce=()=>i(!1),t[70]=i,t[71]=ce):ce=t[71];let De;t[72]===Symbol.for("react.memo_cache_sentinel")?(De=n.jsx($e,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[72]=De):De=t[72];let de;t[73]!==ce?(de=n.jsx("button",{type:"button",onClick:ce,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:De}),t[73]=ce,t[74]=de):de=t[74];let me;t[75]!==ie||t[76]!==re||t[77]!==de?(me=n.jsxs(P.Header.Right,{children:[ie,re,de]}),t[75]=ie,t[76]=re,t[77]=de,t[78]=me):me=t[78];let fe;t[79]!==ae||t[80]!==me?(fe=n.jsxs(P.Header,{children:[ae,me]}),t[79]=ae,t[80]=me,t[81]=fe):fe=t[81];let ue;t[82]!==z.messages||t[83]!==z.status||t[84]!==W||t[85]!==V||t[86]!==k?.description||t[87]!==k?.icon||t[88]!==k?.title||t[89]!==I?(ue=n.jsx(P.Main,{children:V?n.jsx(P.EmptyState,{children:n.jsxs("div",{className:"flex flex-col items-center gap-6 w-full px-4",children:[n.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-0 text-center",children:[n.jsx(xt,{icon:k?.icon??"/favicon.svg",name:k?.title||"deco chat",size:"lg",fallbackIcon:n.jsx(ot,{size:32}),className:"size-[60px]! rounded-[18px]!"}),n.jsx("h3",{className:"text-xl font-medium text-foreground",children:k?.title||"Ask deco chat"}),n.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:k?.description??"Ask anything about configuring model providers or using MCP Mesh."})]}),n.jsx(at.Container,{children:I&&n.jsx(lt,{fallback:null,children:n.jsx(S.Suspense,{fallback:n.jsx(at.Fallback,{}),children:n.jsx(at,{gatewayId:I,onSelect:H=>{W(H.description??H.name)}})})},I)})]})}):n.jsx(P.Messages,{messages:z.messages,status:z.status,minHeightOffset:280})}),t[82]=z.messages,t[83]=z.status,t[84]=W,t[85]=V,t[86]=k?.description,t[87]=k?.icon,t[88]=k?.title,t[89]=I,t[90]=ue):ue=t[90];let pe;t[91]!==z.error||t[92]!==W?(pe=()=>{z.error&&W(`I encountered this error: ${z.error.message}. Can you help me fix it?`)},t[91]=z.error,t[92]=W,t[93]=pe):pe=t[93];let he;t[94]!==z.clearError||t[95]!==z.error||t[96]!==pe?(he=n.jsx(P.ErrorBanner,{error:z.error,onFixInChat:pe,onDismiss:z.clearError}),t[94]=z.clearError,t[95]=z.error,t[96]=pe,t[97]=he):he=t[97];let xe;t[98]!==W?(xe=()=>{W("Please continue.")},t[98]=W,t[99]=xe):xe=t[99];let ge;t[100]!==z.clearFinishReason||t[101]!==z.finishReason||t[102]!==xe?(ge=n.jsx(P.FinishReasonWarning,{finishReason:z.finishReason,onContinue:xe,onDismiss:z.clearFinishReason}),t[100]=z.clearFinishReason,t[101]=z.finishReason,t[102]=xe,t[103]=ge):ge=t[103];let be;t[104]!==F||t[105]!==D||t[106]!==Ze||t[107]!==E?(be=n.jsx(P.BranchPreview,{branchContext:F,clearBranchContext:D,onGoToOriginalMessage:Ze,setInputValue:E}),t[104]=F,t[105]=D,t[106]=Ze,t[107]=E,t[108]=be):be=t[108];const Qe=k??void 0;let je;t[109]!==W||t[110]!==U?(je=async()=>{U.trim()&&await W(U.trim())},t[109]=W,t[110]=U,t[111]=je):je=t[111];const et=!N,tt=N?"Ask anything or @ for context":"Select a model to start chatting";let ve;t[112]!==te||t[113]!==K||t[114]!==I||t[115]!==X?(ve=X&&n.jsx(Ks,{selectedGatewayId:I,onGatewayChange:te,placeholder:"Agent",disabled:K}),t[112]=te,t[113]=K,t[114]=I,t[115]=X,t[116]=ve):ve=t[116];const st=N??void 0;let Se;t[117]!==Ye||t[118]!==st?(Se=n.jsx(Zs,{selectedModel:st,onModelChange:Ye,placeholder:"Model",variant:"borderless"}),t[117]=Ye,t[118]=st,t[119]=Se):Se=t[119];let Ne;t[120]!==z.messages?(Ne=n.jsx(Vs,{messages:z.messages}),t[120]=z.messages,t[121]=Ne):Ne=t[121];let we;t[122]!==z.stop||t[123]!==U||t[124]!==K||t[125]!==E||t[126]!==je||t[127]!==et||t[128]!==tt||t[129]!==ve||t[130]!==Se||t[131]!==Ne?(we=n.jsxs(P.Input,{value:U,onChange:E,onSubmit:je,onStop:z.stop,disabled:et,isStreaming:K,placeholder:tt,children:[ve,Se,Ne]}),t[122]=z.stop,t[123]=U,t[124]=K,t[125]=E,t[126]=je,t[127]=et,t[128]=tt,t[129]=ve,t[130]=Se,t[131]=Ne,t[132]=we):we=t[132];let ye;t[133]!==te||t[134]!==K||t[135]!==Qe||t[136]!==we?(ye=n.jsx(_s,{gateway:Qe,onGatewayChange:te,disabled:K,children:we}),t[133]=te,t[134]=K,t[135]=Qe,t[136]=we,t[137]=ye):ye=t[137];let Ce;t[138]!==he||t[139]!==ge||t[140]!==be||t[141]!==ye?(Ce=n.jsx(P.Footer,{children:n.jsxs("div",{className:"flex flex-col gap-2",children:[he,ge,be,ye]})}),t[138]=he,t[139]=ge,t[140]=be,t[141]=ye,t[142]=Ce):Ce=t[142];let Le;return t[143]!==fe||t[144]!==ue||t[145]!==Ce?(Le=n.jsxs(P,{children:[fe,ue,Ce]}),t[143]=fe,t[144]=ue,t[145]=Ce,t[146]=Le):Le=t[146],Le}function Ta(t,e){return t.id===e.id&&t.connectionId===e.connectionId}function Aa(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(P.Provider,{children:n.jsx(Oa,{})}),t[0]=e):e=t[0],e}const Ra="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png";function St({showSidebarToggle:t=!1,showOrgSwitcher:e=!1,showDecoChat:s=!1,disableDecoChat:a=!1}){const[o,i]=mt(),l=S.useRef(a);a&&o&&l.current!==a&&i(!1),l.current=a;const r=()=>{a||i(c=>!c)};return n.jsxs(Ue,{children:[t&&n.jsx(Ue.Sidebar,{children:n.jsx(Qt,{})}),n.jsx(Ue.Left,{children:e&&n.jsx(S.Suspense,{fallback:n.jsx(it.Skeleton,{}),children:n.jsx(it,{})})}),n.jsxs(Ue.Right,{className:"gap-2",children:[n.jsx(pn,{}),s&&!a&&n.jsxs(J,{size:"sm",variant:"default",onClick:r,className:"h-7",children:[n.jsx(ee,{url:Ra,fallback:"DC",size:"2xs",className:"rounded-sm"}),"deco chat"]}),n.jsx(Na,{})]})]})}function Ea(t){const e=h.c(10),{children:s,className:a}=t,[,o]=S.useTransition();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=Ve.decoChatPanelWidth(),e[0]=i):i=e[0];const[l,r]=We(i,30);let c;e[1]!==r?(c=p=>o(()=>r(p)),e[1]=r,e[2]=c):c=e[2];const d=c;let m;e[3]!==a?(m=T("min-w-0",a),e[3]=a,e[4]=m):m=e[4];let f;return e[5]!==l||e[6]!==s||e[7]!==d||e[8]!==m?(f=n.jsx(Rt,{defaultSize:l,minSize:20,className:m,onResize:d,children:s}),e[5]=l,e[6]=s,e[7]=d,e[8]=m,e[9]=f):f=e[9],f}function Pa(t){const e=h.c(5),{children:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=Ve.sidebarOpen(),e[0]=a):a=e[0];const[o,i]=We(a,!0);let l;return e[1]!==s||e[2]!==i||e[3]!==o?(l=n.jsx(In,{open:o,onOpenChange:i,children:s}),e[1]=s,e[2]=i,e[3]=o,e[4]=l):l=e[4],l}function Da(t){const e=h.c(10),{disableChat:s}=t,a=s===void 0?!1:s,[o]=mt(),i=o&&!a;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Rt,{className:"bg-background",children:n.jsx(Ct,{})}),e[0]=l):l=e[0];let r;e[1]!==a||e[2]!==i?(r=!a&&n.jsx(rn,{withHandle:i}),e[1]=a,e[2]=i,e[3]=r):r=e[3];const c=i?"max-w-none":"max-w-0";let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(lt,{children:n.jsx(S.Suspense,{fallback:n.jsx(ks,{}),children:n.jsx(Aa,{})})}),e[4]=d):d=e[4];let m;e[5]!==c?(m=n.jsx(Ea,{className:c,children:d}),e[5]=c,e[6]=m):m=e[6];let f;return e[7]!==r||e[8]!==m?(f=n.jsxs(cn,{direction:"horizontal",children:[l,r,m]}),e[7]=r,e[8]=m,e[9]=f):f=e[9],f}function La(){const t=h.c(22);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:s}=wt(e),a=Nt(),o=a.location.pathname===`/${s}`||a.location.pathname===`/${s}/`;let i;t[1]!==s?(i=bs.activeOrganization(s),t[1]=s,t[2]=i):i=t[2];let l;t[3]!==s?(l=async()=>{if(!s)return null;const{data:x}=await q.organization.setActive({organizationSlug:s});return{org:x,project:{slug:zs}}},t[3]=s,t[4]=l):l=t[4];let r;t[5]!==i||t[6]!==l?(r={queryKey:i,queryFn:l,gcTime:1/0,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1},t[5]=i,t[6]=l,t[7]=r):r=t[7];const{data:c}=gs(r);if(!c){let x;t[8]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(St,{}),t[8]=x):x=t[8];let g;return t[9]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsxs("div",{className:"min-h-screen bg-background",children:[x,n.jsx("div",{className:"pt-12",children:n.jsx(Ct,{})})]}),t[9]=g):g=t[9],g}let d;t[10]!==o?(d=n.jsx(St,{showSidebarToggle:!0,showOrgSwitcher:!0,showDecoChat:!0,disableDecoChat:o}),t[10]=o,t[11]=d):d=t[11];let m;t[12]===Symbol.for("react.memo_cache_sentinel")?(m={"--sidebar-width":"13rem","--sidebar-width-mobile":"11rem"},t[12]=m):m=t[12];let f;t[13]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Vn,{}),t[13]=f):f=t[13];let p;t[14]!==o?(p=n.jsxs(Mn,{className:"flex-1 bg-sidebar",style:m,children:[f,n.jsx(Tn,{className:"pt-12",children:n.jsx(Da,{disableChat:o})})]}),t[14]=o,t[15]=p):p=t[15];let b;t[16]!==d||t[17]!==p?(b=n.jsx(Pa,{children:n.jsxs("div",{className:"flex flex-col h-screen",children:[d,p]})}),t[16]=d,t[17]=p,t[18]=b):b=t[18];let u;return t[19]!==c||t[20]!==b?(u=n.jsx($s,{...c,children:b}),t[19]=c,t[20]=b,t[21]=u):u=t[21],u}function Vo(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(ya,{children:n.jsx(S.Suspense,{fallback:n.jsx(yt,{}),children:n.jsx(La,{})})}),t[0]=e):e=t[0],e}export{Vo as default};
@@ -1 +1 @@
1
- import{c as C,h as d,j as a}from"./index-Dk3lubBQ.js";import{c as m}from"./button-2azNqzUx.js";const u=d("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",special:"fill-special text-backround"},size:{default:"h-7 w-7",sm:"h-6 w-6",lg:"h-8 w-8",icon:"h-6 w-6",xs:"h-4 w-4"}},defaultVariants:{variant:"default",size:"default"}});function p(f){const e=C.c(10),{variant:c,size:o}=f;let t;e[0]!==o||e[1]!==c?(t=m(u({variant:c,size:o})),e[0]=o,e[1]=c,e[2]=t):t=e[2];let l,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i=a.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"}),e[3]=l,e[4]=i):(l=e[3],i=e[4]);let s;e[5]!==t?(s=a.jsxs("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l,i]}),e[5]=t,e[6]=s):s=e[6];let r;e[7]===Symbol.for("react.memo_cache_sentinel")?(r=a.jsx("span",{className:"sr-only",children:"Loading..."}),e[7]=r):r=e[7];let n;return e[8]!==s?(n=a.jsxs("div",{role:"status",children:[s,r]}),e[8]=s,e[9]=n):n=e[9],n}export{p as S};
1
+ import{c as C,h as d,j as a}from"./index-pvGhQBw9.js";import{c as m}from"./button-CICpj3wE.js";const u=d("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",special:"fill-special text-backround"},size:{default:"h-7 w-7",sm:"h-6 w-6",lg:"h-8 w-8",icon:"h-6 w-6",xs:"h-4 w-4"}},defaultVariants:{variant:"default",size:"default"}});function p(f){const e=C.c(10),{variant:c,size:o}=f;let t;e[0]!==o||e[1]!==c?(t=m(u({variant:c,size:o})),e[0]=o,e[1]=c,e[2]=t):t=e[2];let l,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i=a.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"}),e[3]=l,e[4]=i):(l=e[3],i=e[4]);let s;e[5]!==t?(s=a.jsxs("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l,i]}),e[5]=t,e[6]=s):s=e[6];let r;e[7]===Symbol.for("react.memo_cache_sentinel")?(r=a.jsx("span",{className:"sr-only",children:"Loading..."}),e[7]=r):r=e[7];let n;return e[8]!==s?(n=a.jsxs("div",{role:"status",children:[s,r]}),e[8]=s,e[9]=n):n=e[9],n}export{p as S};
@@ -1 +1 @@
1
- import{r as c,ag as T,j as i,ah as C,ae as y,am as I,aj as M,aR as H,aQ as z,c as A}from"./index-Dk3lubBQ.js";import{c as g}from"./button-2azNqzUx.js";var b="Switch",[U]=T(b),[q,L]=U(b),E=c.forwardRef((s,e)=>{const{__scopeSwitch:t,name:r,checked:a,defaultChecked:n,required:o,disabled:d,value:u="on",onCheckedChange:k,form:l,...w}=s,[p,h]=c.useState(null),v=y(e,m=>h(m)),x=c.useRef(!1),S=p?l||!!p.closest("form"):!0,[f,N]=I({prop:a,defaultProp:n??!1,onChange:k,caller:b});return i.jsxs(q,{scope:t,checked:f,disabled:d,children:[i.jsx(C.button,{type:"button",role:"switch","aria-checked":f,"aria-required":o,"data-state":j(f),"data-disabled":d?"":void 0,disabled:d,value:u,...w,ref:v,onClick:M(s.onClick,m=>{N(B=>!B),S&&(x.current=m.isPropagationStopped(),x.current||m.stopPropagation())})}),S&&i.jsx(_,{control:p,bubbles:!x.current,name:r,value:u,checked:f,required:o,disabled:d,form:l,style:{transform:"translateX(-100%)"}})]})});E.displayName=b;var P="SwitchThumb",R=c.forwardRef((s,e)=>{const{__scopeSwitch:t,...r}=s,a=L(P,t);return i.jsx(C.span,{"data-state":j(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:e})});R.displayName=P;var O="SwitchBubbleInput",_=c.forwardRef(({__scopeSwitch:s,control:e,checked:t,bubbles:r=!0,...a},n)=>{const o=c.useRef(null),d=y(o,n),u=H(t),k=z(e);return c.useEffect(()=>{const l=o.current;if(!l)return;const w=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==t&&h){const v=new Event("click",{bubbles:r});h.call(l,t),l.dispatchEvent(v)}},[u,t,r]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...a,tabIndex:-1,ref:d,style:{...a.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});_.displayName=O;function j(s){return s?"checked":"unchecked"}var $=E,D=R;function W(s){const e=A.c(9);let t,r;e[0]!==s?({className:t,...r}=s,e[0]=s,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let a;e[3]!==t?(a=g("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(D,{"data-slot":"switch-thumb",className:g("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")}),e[5]=n):n=e[5];let o;return e[6]!==r||e[7]!==a?(o=i.jsx($,{"data-slot":"switch",className:a,...r,children:n}),e[6]=r,e[7]=a,e[8]=o):o=e[8],o}export{W as S};
1
+ import{r as c,ag as T,j as i,ah as C,ae as y,am as I,aj as M,aR as H,aQ as z,c as A}from"./index-pvGhQBw9.js";import{c as g}from"./button-CICpj3wE.js";var b="Switch",[U]=T(b),[q,L]=U(b),E=c.forwardRef((s,e)=>{const{__scopeSwitch:t,name:r,checked:a,defaultChecked:n,required:o,disabled:d,value:u="on",onCheckedChange:k,form:l,...w}=s,[p,h]=c.useState(null),v=y(e,m=>h(m)),x=c.useRef(!1),S=p?l||!!p.closest("form"):!0,[f,N]=I({prop:a,defaultProp:n??!1,onChange:k,caller:b});return i.jsxs(q,{scope:t,checked:f,disabled:d,children:[i.jsx(C.button,{type:"button",role:"switch","aria-checked":f,"aria-required":o,"data-state":j(f),"data-disabled":d?"":void 0,disabled:d,value:u,...w,ref:v,onClick:M(s.onClick,m=>{N(B=>!B),S&&(x.current=m.isPropagationStopped(),x.current||m.stopPropagation())})}),S&&i.jsx(_,{control:p,bubbles:!x.current,name:r,value:u,checked:f,required:o,disabled:d,form:l,style:{transform:"translateX(-100%)"}})]})});E.displayName=b;var P="SwitchThumb",R=c.forwardRef((s,e)=>{const{__scopeSwitch:t,...r}=s,a=L(P,t);return i.jsx(C.span,{"data-state":j(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:e})});R.displayName=P;var O="SwitchBubbleInput",_=c.forwardRef(({__scopeSwitch:s,control:e,checked:t,bubbles:r=!0,...a},n)=>{const o=c.useRef(null),d=y(o,n),u=H(t),k=z(e);return c.useEffect(()=>{const l=o.current;if(!l)return;const w=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==t&&h){const v=new Event("click",{bubbles:r});h.call(l,t),l.dispatchEvent(v)}},[u,t,r]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...a,tabIndex:-1,ref:d,style:{...a.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});_.displayName=O;function j(s){return s?"checked":"unchecked"}var $=E,D=R;function W(s){const e=A.c(9);let t,r;e[0]!==s?({className:t,...r}=s,e[0]=s,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let a;e[3]!==t?(a=g("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(D,{"data-slot":"switch-thumb",className:g("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")}),e[5]=n):n=e[5];let o;return e[6]!==r||e[7]!==a?(o=i.jsx($,{"data-slot":"switch",className:a,...r,children:n}),e[6]=r,e[7]=a,e[8]=o):o=e[8],o}export{W as S};
@@ -1 +1 @@
1
- import{c as o,j as n}from"./index-Dk3lubBQ.js";import{c as l}from"./button-2azNqzUx.js";function u(s){const e=o.c(8);let r,i;e[0]!==s?({className:r,...i}=s,e[0]=s,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let t;e[3]!==r?(t=l("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-xl border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),e[3]=r,e[4]=t):t=e[4];let a;return e[5]!==i||e[6]!==t?(a=n.jsx("textarea",{"data-slot":"textarea",className:t,...i}),e[5]=i,e[6]=t,e[7]=a):a=e[7],a}export{u as T};
1
+ import{c as o,j as n}from"./index-pvGhQBw9.js";import{c as l}from"./button-CICpj3wE.js";function u(s){const e=o.c(8);let r,i;e[0]!==s?({className:r,...i}=s,e[0]=s,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let t;e[3]!==r?(t=l("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-xl border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),e[3]=r,e[4]=t):t=e[4];let a;return e[5]!==i||e[6]!==t?(a=n.jsx("textarea",{"data-slot":"textarea",className:t,...i}),e[5]=i,e[6]=t,e[7]=a):a=e[7],a}export{u as T};