@decocms/mesh 1.13.3 → 1.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-C7jPyF1i.js → AlertCircle-CmTLFfTW.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BsEq7RkN.js → ArrowLeft-kUb-nLpp.js} +1 -1
- package/dist/client/assets/{ChevronDown-CTU5QhlY.js → ChevronDown-BIixgdXr.js} +1 -1
- package/dist/client/assets/{ChevronRight-UyghVUW5.js → ChevronRight-XFvS51AW.js} +1 -1
- package/dist/client/assets/{Copy01-2N4PsOoQ.js → Copy01-Bbnq-cRP.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-K1DaKZpH.js → DotsHorizontal-Wp9Jfd-l.js} +1 -1
- package/dist/client/assets/{DotsVertical-7n0u_WMH.js → DotsVertical-BWJddsCE.js} +1 -1
- package/dist/client/assets/{File06-B-4AkckK.js → File06-AO49hgxj.js} +1 -1
- package/dist/client/assets/{FilterLines-3KXsEQsL.js → FilterLines-D_oBG_mT.js} +1 -1
- package/dist/client/assets/{FlipBackward-C2XOXx8C.js → FlipBackward-v3DJy5dX.js} +1 -1
- package/dist/client/assets/{GitBranch01-C5iAlTnG.js → GitBranch01-Bg8OxNYr.js} +1 -1
- package/dist/client/assets/{Grid01-CJPihD4i.js → Grid01-D8szKORD.js} +1 -1
- package/dist/client/assets/{Inbox01-BnO6gOQP.js → Inbox01-DKJqmGhJ.js} +1 -1
- package/dist/client/assets/{InfoCircle-CALL1u00.js → InfoCircle-DQgIwXgE.js} +1 -1
- package/dist/client/assets/{Key01-B0l-5fMc.js → Key01-j8Px8dQ3.js} +1 -1
- package/dist/client/assets/{LinkExternal01--B-xlI11.js → LinkExternal01-DtwuKg3k.js} +1 -1
- package/dist/client/assets/{Loading01-BIZwCiUc.js → Loading01-BFMDuD9f.js} +1 -1
- package/dist/client/assets/{Lock01-DOOxUber.js → Lock01-B2Dlj0_A.js} +1 -1
- package/dist/client/assets/{Play-DtfCRxAy.js → Play-DZwkJO6F.js} +1 -1
- package/dist/client/assets/{Plus-DjZGP-Iq.js → Plus-DCJuRkSA.js} +1 -1
- package/dist/client/assets/{Terminal-CRoqjoNr.js → Terminal-BgBiWCRz.js} +1 -1
- package/dist/client/assets/{Trash01-BSvmxP0N.js → Trash01-DXJjsatW.js} +1 -1
- package/dist/client/assets/{X-PqPoM3vz.js → X-DO5JCiO9.js} +1 -1
- package/dist/client/assets/{XClose-BIM9TZ-N.js → XClose-yLguPztf.js} +1 -1
- package/dist/client/assets/{alert-dialog-BFA_XwNs.js → alert-dialog-BFj8FHOj.js} +1 -1
- package/dist/client/assets/{auth-oN0yIABg.js → auth-CS1Cey1o.js} +1 -1
- package/dist/client/assets/{auth-catchall-DSafll23.js → auth-catchall-BbJfiMLS.js} +1 -1
- package/dist/client/assets/avatar-Cw7f7Fm7.js +1 -0
- package/dist/client/assets/badge-cip1W12x.js +1 -0
- package/dist/client/assets/card-D7kEypvP.js +1 -0
- package/dist/client/assets/checkbox-DWLQD46M.js +1 -0
- package/dist/client/assets/{collection-detail-DKY5TkgR.js → collection-detail-BnPZ4P9Q.js} +2 -2
- package/dist/client/assets/collection-display-button-6se5sKw0.js +1 -0
- package/dist/client/assets/{collection-header-Cq2y0kMK.js → collection-header-BAGohiuL.js} +1 -1
- package/dist/client/assets/{collection-page-DzdXojp0.js → collection-page-BIjUaFrN.js} +1 -1
- package/dist/client/assets/collection-search-Bt7hJb44.js +1 -0
- package/dist/client/assets/collection-tab-DofbhRON.js +1 -0
- package/dist/client/assets/collection-table-wrapper-Nus9WkY9.js +1 -0
- package/dist/client/assets/connection-card-D6p9Apdb.js +1 -0
- package/dist/client/assets/connection-detail-CkpomsVk.js +1 -0
- package/dist/client/assets/connections-X3ifJgj8.js +1 -0
- package/dist/client/assets/constants-B627FiQ3.js +1 -0
- package/dist/client/assets/create-organization-dialog-D4ZZBa08.js +1 -0
- package/dist/client/assets/dialog-BPRbMnap.js +1 -0
- package/dist/client/assets/dropdown-menu-DH78LFXJ.js +1 -0
- package/dist/client/assets/empty-state-ZbNFSrHa.js +1 -0
- package/dist/client/assets/env-vars-editor-HOD_p6bM.js +1 -0
- package/dist/client/assets/error-boundary-CSDpN3IU.js +1 -0
- package/dist/client/assets/{extract-connection-data-u9kLLue9.js → extract-connection-data-BVRaMREC.js} +1 -1
- package/dist/client/assets/form-BWvfCr5W.js +1 -0
- package/dist/client/assets/{formatDistanceToNow-C2AI0RE1.js → formatDistanceToNow-CUtIwGZO.js} +1 -1
- package/dist/client/assets/gateway-detail-BVUnhnv6.js +1 -0
- package/dist/client/assets/gateway-selector-C6BhGNmC.js +1 -0
- package/dist/client/assets/gateways-CUY_RF0g.js +1 -0
- package/dist/client/assets/home-BDMCtoFs.js +1 -0
- package/dist/client/assets/{index-ChqW8s3_.js → index-2YBxks23.js} +2 -2
- package/dist/client/assets/index-B1wnL3pV.css +1 -0
- package/dist/client/assets/{index-CcOnUPVc.js → index-CFqw5CAk.js} +2 -2
- package/dist/client/assets/{index-79P7ggRz.js → index-m-YmB4ph.js} +1 -1
- package/dist/client/assets/{button-Dr2OfS67.js → input-BSDBSyke.js} +1 -1
- package/dist/client/assets/layout-C_WJLL2S.js +1 -0
- package/dist/client/assets/{lazy-highlighter-rbKuYd4Y.js → lazy-highlighter-QHCwZ7Bv.js} +1 -1
- package/dist/client/assets/localstorage-keys-DnYi5wZr.js +1 -0
- package/dist/client/assets/login-unmsX_CR.js +1 -0
- package/dist/client/assets/{mcp-oauth-CLB05bqO.js → mcp-oauth-D1oibR_i.js} +1 -1
- package/dist/client/assets/mcp-server-detail-5ueNKLNi.js +1 -0
- package/dist/client/assets/members-CgDxC8dY.js +3 -0
- package/dist/client/assets/{monaco-editor-BWGnuKvS.js → monaco-editor-18l2E7lk.js} +1 -1
- package/dist/client/assets/{monitoring-Daq8j1mw.js → monitoring-BS_WM-ML.js} +5 -5
- package/dist/client/assets/{oauth-callback-yMv-isiq.js → oauth-callback-tcEVQW2m.js} +1 -1
- package/dist/client/assets/page-Bm0QzKLN.js +1 -0
- package/dist/client/assets/{page-DkLEvKFr.js → page-C_wcQFSa.js} +1 -1
- package/dist/client/assets/pin-to-sidebar-button-rUjoaKt7.js +1 -0
- package/dist/client/assets/popover-DGwJ1U8B.js +1 -0
- package/dist/client/assets/project-context-provider-C7-HmBKu.js +1 -0
- package/dist/client/assets/resizable-BkJdAL7l.js +1 -0
- package/dist/client/assets/resource-tabs-DhNIXHvE.js +1 -0
- package/dist/client/assets/select-DLPmxXDW.js +1 -0
- package/dist/client/assets/settings-Dg4J4piv.js +1 -0
- package/dist/client/assets/shell-layout-CW_3D6wx.js +19 -0
- package/dist/client/assets/spinner-PGFal9m1.js +1 -0
- package/dist/client/assets/switch-Fn7If0Ti.js +1 -0
- package/dist/client/assets/textarea-CbNfP826.js +1 -0
- package/dist/client/assets/{thread-history-popover-BqhOXgTV.js → thread-history-popover-BW6o5miO.js} +45 -45
- package/dist/client/assets/{tools-list-wGfEy4CM.js → tools-list-BMbd7IEa.js} +1 -1
- package/dist/client/assets/{use-binding-DaAdA88g.js → use-binding-D77gExDp.js} +1 -1
- package/dist/client/assets/{use-connection-Dmp9OF3a.js → use-connection-BPzhCo7m.js} +1 -1
- package/dist/client/assets/{use-connection-resources-BB8wUxFy.js → use-connection-resources-CQGT27SN.js} +1 -1
- package/dist/client/assets/{use-gateway-CqHSf00q.js → use-gateway-C8QVevg7.js} +1 -1
- package/dist/client/assets/{use-list-state-OO7JJFHk.js → use-list-state-BzeiRpp0.js} +1 -1
- package/dist/client/assets/{use-mcp-DA1ttZCi.js → use-mcp-D2cijL_p.js} +1 -1
- package/dist/client/assets/{use-members-CU5bDeq-.js → use-members-CTyXRW-K.js} +1 -1
- package/dist/client/assets/{use-mobile-DJYJGOHZ.js → use-mobile-BTxzaR4j.js} +1 -1
- package/dist/client/assets/use-organization-settings-aN8k0KJJ.js +1 -0
- package/dist/client/assets/use-tool-call-C4GcZMyW.js +1 -0
- package/dist/client/assets/useQuery-DV_L-E86.js +1 -0
- package/dist/client/assets/value-DVG0CnkT.js +1 -0
- package/dist/client/assets/view-mode-toggle-DPmK0pgy.js +1 -0
- package/dist/client/assets/workflow-Dkm9OUwf.js +1 -0
- package/dist/client/index.html +2 -2
- package/package.json +1 -1
- package/dist/client/assets/avatar-DWNKzJTz.js +0 -1
- package/dist/client/assets/badge-CMDsV8CJ.js +0 -1
- package/dist/client/assets/card-DGWmxOab.js +0 -1
- package/dist/client/assets/checkbox-CH_lW5sL.js +0 -1
- package/dist/client/assets/collection-display-button-CF5VNEyr.js +0 -1
- package/dist/client/assets/collection-search-5HSGaGGt.js +0 -1
- package/dist/client/assets/collection-tab-DfUfYU59.js +0 -1
- package/dist/client/assets/collection-table-wrapper-BcST91H1.js +0 -1
- package/dist/client/assets/connection-card-BYX60RAK.js +0 -1
- package/dist/client/assets/connection-detail-BIJapkB_.js +0 -1
- package/dist/client/assets/connections-iA0KSF8d.js +0 -1
- package/dist/client/assets/constants-Dj4zd5B9.js +0 -1
- package/dist/client/assets/create-organization-dialog-CrdjEf0i.js +0 -1
- package/dist/client/assets/dialog-Didf1Cm0.js +0 -1
- package/dist/client/assets/dropdown-menu-DW5iGKOq.js +0 -1
- package/dist/client/assets/empty-state-BN60qDU7.js +0 -1
- package/dist/client/assets/env-vars-editor-Bp_8Hwo3.js +0 -1
- package/dist/client/assets/error-boundary-BiqKDyx1.js +0 -1
- package/dist/client/assets/form-BXN-QLni.js +0 -1
- package/dist/client/assets/gateway-detail-B4v6dTjK.js +0 -1
- package/dist/client/assets/gateway-selector-QHaVxB2n.js +0 -1
- package/dist/client/assets/gateways-Cx9ti1Cv.js +0 -1
- package/dist/client/assets/home-CJdYeB-M.js +0 -1
- package/dist/client/assets/index-BjKus4OW.css +0 -1
- package/dist/client/assets/input-DBy5GvSG.js +0 -1
- package/dist/client/assets/layout-C4lOtZCC.js +0 -1
- package/dist/client/assets/localstorage-keys-D9YX3_IT.js +0 -1
- package/dist/client/assets/login-fLYNz1_K.js +0 -1
- package/dist/client/assets/mcp-server-detail-CcpTBZ0r.js +0 -1
- package/dist/client/assets/members-zUvSLEug.js +0 -3
- package/dist/client/assets/page-CqtvajVn.js +0 -1
- package/dist/client/assets/pin-to-sidebar-button-BiLL5QoJ.js +0 -1
- package/dist/client/assets/popover-BD8rPm7n.js +0 -1
- package/dist/client/assets/project-context-provider-CRa6hysF.js +0 -1
- package/dist/client/assets/resizable-CGOknEmg.js +0 -1
- package/dist/client/assets/resource-tabs-BPp4Cr-n.js +0 -1
- package/dist/client/assets/select-Bw9i3g8J.js +0 -1
- package/dist/client/assets/settings-DXlkaFxL.js +0 -1
- package/dist/client/assets/shell-layout-DBkPG18-.js +0 -19
- package/dist/client/assets/spinner-DhLOJDf8.js +0 -1
- package/dist/client/assets/switch-BTv42t3b.js +0 -1
- package/dist/client/assets/textarea-C3UNaEli.js +0 -1
- package/dist/client/assets/use-organization-settings-BGtwqtxs.js +0 -1
- package/dist/client/assets/use-tool-call-xMn-Ysup.js +0 -1
- package/dist/client/assets/useQuery-u2B_27A6.js +0 -1
- package/dist/client/assets/value-IcpA2Nq4.js +0 -1
- package/dist/client/assets/view-mode-toggle-Di5d2VZX.js +0 -1
- package/dist/client/assets/workflow-UoaX4VGc.js +0 -1
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r as U,K as oe,a as X,s as fs,W as He,V as Ms,Q as zs,v as ue,B as qe,x as Es,w as ks,t as J,j as t,c as de,p as Ds}from"./index-CcOnUPVc.js";import{C as Bs}from"./collection-header-Cq2y0kMK.js";import{C as es}from"./collection-page-DzdXojp0.js";import{C as Ze}from"./collection-search-5HSGaGGt.js";import{C as Gs}from"./collection-table-wrapper-BcST91H1.js";import{T as Us,S as Ue}from"./switch-BTv42t3b.js";import{u as Vs,c as $s,E as Je}from"./use-connection-Dmp9OF3a.js";import{u as os}from"./use-members-CU5bDeq-.js";import{W as Fs}from"./well-known-mcp-D13f-8h2.js";import{u as Ce,a as Ne,c as ye,b as Ee,T as Se}from"./project-context-provider-CRa6hysF.js";import{u as Ss}from"./useQuery-u2B_27A6.js";import{A as je}from"./avatar-DWNKzJTz.js";import{B as Ie}from"./badge-CMDsV8CJ.js";import{u as fe,c as re,B as ee}from"./button-Dr2OfS67.js";import{C as Ks}from"./checkbox-CH_lW5sL.js";import{f as we,a as Te,b as Ae,c as Oe,d as Re,e as _e,A as Pe,g as Le}from"./alert-dialog-BFA_XwNs.js";import{d as Is,e as ws,c as Ts,D as Qs,a as qs,f as Zs}from"./dialog-Didf1Cm0.js";import{b as as,D as cs,a as ds,c as Ke,e as Ys,f as Ws,g as Hs,d as Js}from"./dropdown-menu-DW5iGKOq.js";import{i as Xs}from"./DotsHorizontal-K1DaKZpH.js";import{i as As}from"./Loading01-BIZwCiUc.js";import{i as et}from"./Lock01-DOOxUber.js";import{s as ss}from"./Plus-DjZGP-Iq.js";import{s as Os}from"./Trash01-BSvmxP0N.js";import{i as hs}from"./X-PqPoM3vz.js";import{I as st}from"./input-DBy5GvSG.js";import{E as tt}from"./error-boundary-BiqKDyx1.js";import{a as nt,F as gs,b as xs,c as rt,d as ps,f as bs}from"./form-BXN-QLni.js";import{S as ts,a as ns,b as rs,c as is,d as ls}from"./select-Bw9i3g8J.js";import{T as it}from"./textarea-C3UNaEli.js";import{C as js}from"./card-DGWmxOab.js";import{i as Rs}from"./DotsVertical-7n0u_WMH.js";import{i as lt}from"./Key01-B0l-5fMc.js";import{s as ot}from"./XClose-BIM9TZ-N.js";import"./collection-display-button-CF5VNEyr.js";import"./Grid01-CJPihD4i.js";import"./view-mode-toggle-Di5d2VZX.js";import"./ArrowLeft-BsEq7RkN.js";import"./ChevronRight-UyghVUW5.js";import"./ChevronDown-CTU5QhlY.js";const ms=({size:s=24,color:e="currentColor",...n})=>U.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},U.createElement("path",{d:"M11.302 21.615c.221.129.332.194.488.227.122.026.298.026.42 0 .156-.034.267-.098.488-.227C14.646 20.478 20 16.908 20 12V7.217c0-.799 0-1.199-.13-1.542a2 2 0 0 0-.548-.79c-.275-.243-.65-.383-1.398-.664l-5.362-2.01c-.208-.078-.312-.117-.419-.133a1 1 0 0 0-.286 0c-.107.016-.21.055-.419.133L6.076 4.22c-.748.28-1.122.421-1.398.664a2 2 0 0 0-.547.79C4 6.018 4 6.418 4 7.217V12c0 4.908 5.354 8.478 7.302 9.615Z"}));ms.displayName="Shield01";const _s=({size:s=24,color:e="currentColor",...n})=>U.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},U.createElement("path",{d:"M20 17H4m0 0 4-4m-4 4 4 4M4 7h16m0 0-4-4m4 4-4 4"}));_s.displayName="SwitchHorizontal01";const Ps=[{name:"ORGANIZATION_CREATE",description:"Create a new organization",category:"Organizations"},{name:"ORGANIZATION_LIST",description:"List organizations",category:"Organizations"},{name:"ORGANIZATION_GET",description:"View organization details",category:"Organizations"},{name:"ORGANIZATION_UPDATE",description:"Update organization",category:"Organizations"},{name:"ORGANIZATION_DELETE",description:"Delete organization",category:"Organizations",dangerous:!0},{name:"ORGANIZATION_SETTINGS_GET",description:"View organization settings",category:"Organizations"},{name:"ORGANIZATION_SETTINGS_UPDATE",description:"Update organization settings",category:"Organizations"},{name:"ORGANIZATION_MEMBER_ADD",description:"Add members",category:"Organizations"},{name:"ORGANIZATION_MEMBER_REMOVE",description:"Remove members",category:"Organizations",dangerous:!0},{name:"ORGANIZATION_MEMBER_LIST",description:"List members",category:"Organizations"},{name:"ORGANIZATION_MEMBER_UPDATE_ROLE",description:"Update member roles",category:"Organizations"},{name:"COLLECTION_CONNECTIONS_CREATE",description:"Create connections",category:"Connections"},{name:"COLLECTION_CONNECTIONS_LIST",description:"List connections",category:"Connections"},{name:"COLLECTION_CONNECTIONS_GET",description:"View connection details",category:"Connections"},{name:"COLLECTION_CONNECTIONS_UPDATE",description:"Update connections",category:"Connections"},{name:"COLLECTION_CONNECTIONS_DELETE",description:"Delete connections",category:"Connections",dangerous:!0},{name:"CONNECTION_TEST",description:"Test connections",category:"Connections"},{name:"DATABASES_RUN_SQL",description:"Run SQL queries",category:"Connections",dangerous:!0},{name:"COLLECTION_GATEWAY_CREATE",description:"Create gateways",category:"Gateways"},{name:"COLLECTION_GATEWAY_LIST",description:"List gateways",category:"Gateways"},{name:"COLLECTION_GATEWAY_GET",description:"View gateway details",category:"Gateways"},{name:"COLLECTION_GATEWAY_UPDATE",description:"Update gateways",category:"Gateways"},{name:"COLLECTION_GATEWAY_DELETE",description:"Delete gateways",category:"Gateways",dangerous:!0},{name:"MONITORING_LOGS_LIST",description:"List monitoring logs",category:"Monitoring"},{name:"MONITORING_STATS",description:"View monitoring statistics",category:"Monitoring"},{name:"API_KEY_CREATE",description:"Create API key",category:"API Keys"},{name:"API_KEY_LIST",description:"List API keys",category:"API Keys"},{name:"API_KEY_UPDATE",description:"Update API key",category:"API Keys"},{name:"API_KEY_DELETE",description:"Delete API key",category:"API Keys",dangerous:!0},{name:"EVENT_PUBLISH",description:"Publish events",category:"Event Bus"},{name:"EVENT_SUBSCRIBE",description:"Subscribe to events",category:"Event Bus"},{name:"EVENT_UNSUBSCRIBE",description:"Unsubscribe from events",category:"Event Bus"},{name:"EVENT_CANCEL",description:"Cancel recurring events",category:"Event Bus"},{name:"EVENT_ACK",description:"Acknowledge event delivery",category:"Event Bus"},{name:"EVENT_SUBSCRIPTION_LIST",description:"List event subscriptions",category:"Event Bus"},{name:"EVENT_SYNC_SUBSCRIPTIONS",description:"Sync subscriptions to desired state",category:"Event Bus"},{name:"USER_GET",description:"Get a user by id",category:"Users"}],at={ORGANIZATION_CREATE:"Create organization",ORGANIZATION_LIST:"List organizations",ORGANIZATION_GET:"View organization details",ORGANIZATION_UPDATE:"Update organization",ORGANIZATION_DELETE:"Delete organization",ORGANIZATION_SETTINGS_GET:"View organization settings",ORGANIZATION_SETTINGS_UPDATE:"Update organization settings",ORGANIZATION_MEMBER_LIST:"List members",ORGANIZATION_MEMBER_ADD:"Add members",ORGANIZATION_MEMBER_REMOVE:"Remove members",ORGANIZATION_MEMBER_UPDATE_ROLE:"Update member roles",COLLECTION_CONNECTIONS_LIST:"List connections",COLLECTION_CONNECTIONS_GET:"View connection details",COLLECTION_CONNECTIONS_CREATE:"Create connections",COLLECTION_CONNECTIONS_UPDATE:"Update connections",COLLECTION_CONNECTIONS_DELETE:"Delete connections",CONNECTION_TEST:"Test connections",DATABASES_RUN_SQL:"Run SQL queries",COLLECTION_GATEWAY_CREATE:"Create gateways",COLLECTION_GATEWAY_LIST:"List gateways",COLLECTION_GATEWAY_GET:"View gateway details",COLLECTION_GATEWAY_UPDATE:"Update gateways",COLLECTION_GATEWAY_DELETE:"Delete gateways",MONITORING_LOGS_LIST:"List monitoring logs",MONITORING_STATS:"View monitoring statistics",API_KEY_CREATE:"Create API key",API_KEY_LIST:"List API keys",API_KEY_UPDATE:"Update API key",API_KEY_DELETE:"Delete API key",EVENT_PUBLISH:"Publish events",EVENT_SUBSCRIBE:"Subscribe to events",EVENT_UNSUBSCRIBE:"Unsubscribe from events",EVENT_CANCEL:"Cancel recurring events",EVENT_ACK:"Acknowledge event delivery",EVENT_SUBSCRIPTION_LIST:"List event subscriptions",EVENT_SYNC_SUBSCRIPTIONS:"Sync subscriptions to desired state",USER_GET:"Get user by id"};function ct(){const s={Organizations:[],Connections:[],Gateways:[],Monitoring:[],Users:[],"API Keys":[],"Event Bus":[]};for(const e of Ps)s[e.category]?.push(e);return s}function dt(){return Ps.map(s=>({value:s.name,label:at[s.name],dangerous:s.dangerous}))}const Cs=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function mt(s){return s.replace(/-/g," ")}function ut(s){if(!s)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1};const e=[];let n=!1;const l=[];let a=!1;const i=new Set;let h=!1;for(const[o,x]of Object.entries(s)){if(o===Fs.SELF){x.includes("*")?n=!0:e.push(...x);continue}if(o==="*"){if(a=!0,x.includes("*"))h=!0;else for(const y of x)i.add(y);continue}if(l.push(o),x.includes("*"))h=!0;else for(const y of x)i.add(y)}return{staticPermissions:e,allowsAllStaticPermissions:n,connectionIds:l,allowsAllConnections:a,toolNames:Array.from(i),allowsAllTools:h}}function us(){const{locator:s}=Ce(),{data:e,isLoading:n,error:l,refetch:a}=Ss({queryKey:oe.organizationRoles(s),queryFn:async()=>{try{const o=await X.organization.listRoles();return o?.error?(console.error("[useOrganizationRoles] API error:",o.error),[]):o?.data??[]}catch(o){return console.error("[useOrganizationRoles] Fetch error:",o),[]}},staleTime:3e4}),i=Cs.map(o=>({role:o.value,label:o.label,isBuiltin:o.isBuiltin}));if(e&&Array.isArray(e))for(const o of e){const x=o.role;if(!x||Cs.some(j=>j.value===x))continue;const{staticPermissions:y,allowsAllStaticPermissions:f,connectionIds:T,allowsAllConnections:d,toolNames:S,allowsAllTools:u}=ut(o.permission);i.push({id:o.id,role:x,label:mt(x),isBuiltin:!1,permission:o.permission??void 0,staticPermissionCount:f?-1:y.length,allowsAllStaticPermissions:f,connectionCount:d?-1:T.length,allowsAllConnections:d,toolCount:u?-1:S.length,allowsAllTools:u})}const h=i.filter(o=>!o.isBuiltin);return{roles:i,customRoles:h,builtinRoles:i.filter(o=>o.isBuiltin),isLoading:n,error:l,refetch:a}}const ft=fs({role:fs({id:ue().optional(),slug:ue().optional(),label:ue()}),allowAllStaticPermissions:zs(),staticPermissions:He(ue()),toolSet:Ms(ue(),He(ue())),memberIds:He(ue())});function Ls(s){return s?s.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}const ht=[{role:"owner",label:"Owner",color:"bg-red-500"},{role:"admin",label:"Admin",color:"bg-blue-500"},{role:"user",label:"User",color:"bg-green-500"}],Xe=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"];function gt(s){if(!s)return"bg-neutral-400";let e=0;for(let l=0;l<s.length;l++){const a=s.charCodeAt(l);e=(e<<5)-e+a,e=e&e}const n=Math.abs(e)%Xe.length;return Xe[n]??Xe[0]}function Ve(){return{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},memberIds:[]}}function xt(s){const e=de.c(39),{allowAllStaticPermissions:n,staticPermissions:l,onAllowAllChange:a,onPermissionsChange:i,readOnly:h}=s,o=h===void 0?!1:h,[x,y]=U.useState(""),f=U.useDeferredValue(x);let T,d,S,u,j;if(e[0]!==n||e[1]!==f||e[2]!==a||e[3]!==i||e[4]!==o||e[5]!==x||e[6]!==l){const g=ct(),c=dt(),v=c.filter(E=>E.label.toLowerCase().includes(f.toLowerCase())),I=E=>{if(l.includes(E))i(l.filter(_=>_!==E));else{const _=[...l,E];_.length===c.length?(a(!0),i([])):i(_)}};S="flex flex-col h-full",e[12]!==x?(u=t.jsx("div",{className:"border-b border-border",children:t.jsx(Ze,{value:x,onChange:y,placeholder:"Search permissions...",className:"border-b-0"})}),e[12]=x,e[13]=u):u=e[13];const P=!o&&"hover:bg-muted/50 cursor-pointer";let w;e[14]!==P?(w=re("flex items-center justify-between px-4 py-3 rounded-lg",P),e[14]=P,e[15]=w):w=e[15];let O;e[16]!==n||e[17]!==a||e[18]!==i||e[19]!==o?(O=()=>{if(o)return;a(!n),i([])},e[16]=n,e[17]=a,e[18]=i,e[19]=o,e[20]=O):O=e[20];let A;e[21]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx("span",{className:"text-sm font-medium",children:"All organization permissions"}),e[21]=A):A=e[21];let L;e[22]!==n||e[23]!==a||e[24]!==i||e[25]!==o?(L=t.jsx("div",{onClick:vt,children:o?t.jsx(Ne,{children:t.jsxs(ye,{children:[t.jsx(Ee,{asChild:!0,children:t.jsx("div",{children:t.jsx(Ue,{checked:n,disabled:o,onCheckedChange:E=>{o||(a(E),i([]))}})})}),t.jsx(Se,{children:t.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):t.jsx(Ue,{checked:n,disabled:o,onCheckedChange:E=>{o||(a(E),i([]))}})}),e[22]=n,e[23]=a,e[24]=i,e[25]=o,e[26]=L):L=e[26],e[27]!==L||e[28]!==w||e[29]!==O?(j=t.jsx("div",{className:"border-b border-border",children:t.jsxs("div",{className:w,onClick:O,children:[A,L]})}),e[27]=L,e[28]=w,e[29]=O,e[30]=j):j=e[30],T="flex-1 overflow-auto",d=Object.entries(g).map(E=>{const[_,z]=E,N=v.filter(m=>z.some(M=>M.name===m.value));return N.length===0?null:t.jsxs("div",{className:"mb-6 last:mb-0",children:[t.jsx("h4",{className:"text-sm font-medium p-3 pb-1.5 text-muted-foreground/75",children:_}),t.jsx("div",{className:"space-y-1",children:N.map(m=>t.jsxs("div",{className:re("flex items-center justify-between gap-3 px-4 py-3",!o&&"hover:bg-muted/50 cursor-pointer"),onClick:()=>{if(!o)if(n){a(!1);const M=c.map(Ct);i(M.filter(V=>V!==m.value))}else I(m.value)},children:[t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("span",{className:"text-sm",children:m.label})}),t.jsx("div",{onClick:jt,children:o?t.jsx(Ne,{children:t.jsxs(ye,{children:[t.jsx(Ee,{asChild:!0,children:t.jsx("div",{children:t.jsx(Ue,{checked:n||l.includes(m.value),disabled:o,onCheckedChange:()=>{if(!o)if(n){a(!1);const M=c.map(bt);i(M.filter(V=>V!==m.value))}else I(m.value)}})})}),t.jsx(Se,{children:t.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):t.jsx(Ue,{checked:n||l.includes(m.value),disabled:o,onCheckedChange:()=>{if(!o)if(n){a(!1);const M=c.map(pt);i(M.filter(V=>V!==m.value))}else I(m.value)}})})]},m.value))})]},_)}),e[0]=n,e[1]=f,e[2]=a,e[3]=i,e[4]=o,e[5]=x,e[6]=l,e[7]=T,e[8]=d,e[9]=S,e[10]=u,e[11]=j}else T=e[7],d=e[8],S=e[9],u=e[10],j=e[11];let p;e[31]!==T||e[32]!==d?(p=t.jsx("div",{className:T,children:d}),e[31]=T,e[32]=d,e[33]=p):p=e[33];let C;return e[34]!==S||e[35]!==u||e[36]!==j||e[37]!==p?(C=t.jsxs("div",{className:S,children:[u,j,p]}),e[34]=S,e[35]=u,e[36]=j,e[37]=p,e[38]=C):C=e[38],C}function pt(s){return s.value}function bt(s){return s.value}function jt(s){return s.stopPropagation()}function Ct(s){return s.value}function vt(s){return s.stopPropagation()}function Nt(s){const e=de.c(56),{open:n,onOpenChange:l,selectedMemberIds:a,onAddMembers:i}=s,[h,o]=U.useState(""),x=U.useDeferredValue(h);let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],e[0]=y):y=e[0];const[f,T]=U.useState(y),{data:d}=os();let S,u,j,p,C,g,c,v,I,P,w;if(e[1]!==d?.data?.members||e[2]!==x||e[3]!==i||e[4]!==l||e[5]!==n||e[6]!==f||e[7]!==h||e[8]!==a){const M=d?.data?.members??[];let V;e[20]!==x?(V=D=>{const r=x.toLowerCase();return D.user?.name?.toLowerCase().includes(r)||D.user?.email?.toLowerCase().includes(r)},e[20]=x,e[21]=V):V=e[21];const se=M.filter(V),F=yt;let K;e[22]!==a?(K=D=>a.includes(D),e[22]=a,e[23]=K):K=e[23];const Q=K;let Y;e[24]!==f?(Y=D=>{f.includes(D)?T(f.filter(r=>r!==D)):T([...f,D])},e[24]=f,e[25]=Y):Y=e[25];const ne=Y;let te;e[26]!==i||e[27]!==l||e[28]!==f?(te=()=>{i(f),T([]),l(!1)},e[26]=i,e[27]=l,e[28]=f,e[29]=te):te=e[29],j=te,u=we,P=n,w=l,S=Te,v="sm:max-w-md p-0 overflow-hidden",e[30]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsxs(Ae,{className:"px-6 pt-6",children:[t.jsx(Oe,{children:"Add Members to Role"}),t.jsx(Re,{children:"Select members to add to this role."})]}),e[30]=I):I=e[30],g="flex flex-col h-80",e[31]!==h?(c=t.jsx(Ze,{value:h,onChange:o,placeholder:"Search members...",className:"border-b border-t-0 border-x-0 rounded-none"}),e[31]=h,e[32]=c):c=e[32],p="flex-1 overflow-auto",C=se.length===0?t.jsx("div",{className:"flex items-center justify-center h-full px-6",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:h?"No members found":"No members available"})}):t.jsx("div",{className:"px-6 py-2 space-y-1",children:se.map(D=>{const r=F(D),b=Q(D.id),$=f.includes(D.id);return t.jsxs("label",{className:re("flex items-center gap-3 p-2 rounded-lg",!r||b?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[t.jsx(Ks,{checked:$||b,onCheckedChange:()=>{r&&!b&&ne(D.id)},disabled:!r||b}),t.jsx(je,{url:D.user?.image??void 0,fallback:Ls(D.user?.name),shape:"circle",size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:D.user?.name||"Unknown"}),t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.user?.email})]}),!r&&t.jsx(Ie,{variant:"secondary",className:"shrink-0",children:"Owner"}),b&&r&&t.jsx(Ie,{variant:"outline",className:"shrink-0",children:"Added"})]},D.id)})}),e[1]=d?.data?.members,e[2]=x,e[3]=i,e[4]=l,e[5]=n,e[6]=f,e[7]=h,e[8]=a,e[9]=S,e[10]=u,e[11]=j,e[12]=p,e[13]=C,e[14]=g,e[15]=c,e[16]=v,e[17]=I,e[18]=P,e[19]=w}else S=e[9],u=e[10],j=e[11],p=e[12],C=e[13],g=e[14],c=e[15],v=e[16],I=e[17],P=e[18],w=e[19];let O;e[33]!==p||e[34]!==C?(O=t.jsx("div",{className:p,children:C}),e[33]=p,e[34]=C,e[35]=O):O=e[35];let A;e[36]!==O||e[37]!==g||e[38]!==c?(A=t.jsxs("div",{className:g,children:[c,O]}),e[36]=O,e[37]=g,e[38]=c,e[39]=A):A=e[39];let L;e[40]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(Pe,{children:"Cancel"}),e[40]=L):L=e[40];const E=f.length===0,_=f.length>0&&`(${f.length})`;let z;e[41]!==j||e[42]!==E||e[43]!==_?(z=t.jsxs(_e,{className:"px-6 pb-6",children:[L,t.jsxs(Le,{onClick:j,disabled:E,children:["Add ",_]})]}),e[41]=j,e[42]=E,e[43]=_,e[44]=z):z=e[44];let N;e[45]!==S||e[46]!==A||e[47]!==z||e[48]!==v||e[49]!==I?(N=t.jsxs(S,{className:v,children:[I,A,z]}),e[45]=S,e[46]=A,e[47]=z,e[48]=v,e[49]=I,e[50]=N):N=e[50];let m;return e[51]!==u||e[52]!==N||e[53]!==P||e[54]!==w?(m=t.jsx(u,{open:P,onOpenChange:w,children:N}),e[51]=u,e[52]=N,e[53]=P,e[54]=w,e[55]=m):m=e[55],m}function yt(s){return s.role!=="owner"}function Et(s){const e=de.c(40),{memberIds:n,onMemberIdsChange:l,readOnly:a}=s,i=a===void 0?!1:a,[h,o]=U.useState(""),x=U.useDeferredValue(h),[y,f]=U.useState(!1),{data:T}=os();let d,S,u,j,p;if(e[0]!==T?.data?.members||e[1]!==x||e[2]!==n||e[3]!==l||e[4]!==i||e[5]!==h){const v=T?.data?.members??[];let I;e[11]!==n?(I=N=>n.includes(N.id),e[11]=n,e[12]=I):I=e[12];const P=v.filter(I);let w;e[13]!==x?(w=N=>{const m=x.toLowerCase();return N.user?.name?.toLowerCase().includes(m)||N.user?.email?.toLowerCase().includes(m)},e[13]=x,e[14]=w):w=e[14];const O=P.filter(w);let A;e[15]!==n||e[16]!==l?(A=N=>{l(n.filter(m=>m!==N))},e[15]=n,e[16]=l,e[17]=A):A=e[17];const L=A;let E;e[18]!==n||e[19]!==l?(E=N=>{l([...n,...N])},e[18]=n,e[19]=l,e[20]=E):E=e[20],d=E,j="flex flex-col h-full";let _;e[21]!==h?(_=t.jsx(Ze,{value:h,onChange:o,placeholder:"Search members...",className:"flex-1 border-b-0"}),e[21]=h,e[22]=_):_=e[22];let z;e[23]!==i?(z=i?t.jsx("div",{className:"pr-4",children:t.jsx(Ne,{children:t.jsxs(ye,{children:[t.jsx(Ee,{asChild:!0,children:t.jsx("div",{children:t.jsxs(ee,{variant:"outline",size:"sm",disabled:!0,children:[t.jsx(ss,{size:16}),"Add Member"]})})}),t.jsx(Se,{children:t.jsx("p",{children:"Owner membership cannot be changed"})})]})})}):t.jsx("div",{className:"pr-4",children:t.jsxs(ee,{variant:"outline",size:"sm",onClick:()=>f(!0),children:[t.jsx(ss,{size:16}),"Add Member"]})}),e[23]=i,e[24]=z):z=e[24],e[25]!==_||e[26]!==z?(p=t.jsxs("div",{className:"flex items-center border-b border-border",children:[_,z]}),e[25]=_,e[26]=z,e[27]=p):p=e[27],S="flex-1 overflow-auto",u=P.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsxs("div",{className:"text-center",children:[t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No members"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Add members to this role to grant them the configured permissions."})]})}):O.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:['No members match "',h,'"']})}):t.jsx("div",{className:"p-4 space-y-2",children:O.map(N=>t.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[t.jsx(je,{url:N.user?.image??void 0,fallback:Ls(N.user?.name),shape:"circle",size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:N.user?.name||"Unknown"}),t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:N.user?.email})]}),i?t.jsx(Ne,{children:t.jsxs(ye,{children:[t.jsx(Ee,{asChild:!0,children:t.jsx("div",{children:t.jsx(ee,{variant:"ghost",size:"sm",disabled:!0,children:t.jsx(hs,{size:16})})})}),t.jsx(Se,{children:t.jsx("p",{children:"Owner membership cannot be changed"})})]})}):t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>L(N.id),children:t.jsx(hs,{size:16})})]},N.id))}),e[0]=T?.data?.members,e[1]=x,e[2]=n,e[3]=l,e[4]=i,e[5]=h,e[6]=d,e[7]=S,e[8]=u,e[9]=j,e[10]=p}else d=e[6],S=e[7],u=e[8],j=e[9],p=e[10];let C;e[28]!==S||e[29]!==u?(C=t.jsx("div",{className:S,children:u}),e[28]=S,e[29]=u,e[30]=C):C=e[30];let g;e[31]!==y||e[32]!==d||e[33]!==n?(g=t.jsx(Nt,{open:y,onOpenChange:f,selectedMemberIds:n,onAddMembers:d}),e[31]=y,e[32]=d,e[33]=n,e[34]=g):g=e[34];let c;return e[35]!==j||e[36]!==p||e[37]!==C||e[38]!==g?(c=t.jsxs("div",{className:j,children:[p,C,g]}),e[35]=j,e[36]=p,e[37]=C,e[38]=g,e[39]=c):c=e[39],c}function St(s){const e=de.c(3);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx(As,{size:24,className:"animate-spin text-muted-foreground"})}),e[0]=n):n=e[0];let l;return e[1]!==s?(l=t.jsx(U.Suspense,{fallback:n,children:t.jsx(Et,{...s})}),e[1]=s,e[2]=l):l=e[2],l}const It={owner:[],admin:[],user:[]};function $e(s,e){const n=s==="owner"||s==="admin",l=e.filter(a=>a.role===s);return{role:{slug:s,label:s.charAt(0).toUpperCase()+s.slice(1)},allowAllStaticPermissions:n,staticPermissions:It[s],toolSet:{},memberIds:l.map(a=>a.id)}}function wt({trigger:s,onSuccess:e}){const[n,l]=U.useState(!1),[a,i]=U.useState("mcp"),{locator:h}=Ce(),o=qe(),x=Vs()??[],{customRoles:y,refetch:f}=us(),{data:T}=Ss({queryKey:oe.members(h),queryFn:()=>X.organization.listMembers()}),d=Es({resolver:ks(ft),defaultValues:Ve()}),S=d.formState.isValid,u=d.formState.isDirty,[j,p]=U.useState(null),[C,g]=U.useState(null),c=!d.watch("role.id")&&!d.watch("role.slug")&&!C,[v,I]=U.useState(null),[P,w]=U.useState(!1),[O,A]=U.useState(null),L=r=>{const b=r.permission||{},$=b.self||[],le=$.includes("*"),ie=le?[]:$.filter(k=>k!=="*"),W={};for(const[k,B]of Object.entries(b))if(k!=="self")if(k==="*")for(const Z of x)B.includes("*")?W[Z.id]=Z.tools?.map(ae=>ae.name)??[]:W[Z.id]=B;else{const Z=x.find(ae=>ae.id===k);Z&&(B.includes("*")?W[k]=Z.tools?.map(ae=>ae.name)??[]:W[k]=B)}const me=(T?.data?.members??[]).filter(k=>k.role===r.role).map(k=>k.id);return{role:{id:r.id,slug:r.role,label:r.label},allowAllStaticPermissions:le,staticPermissions:ie,toolSet:W,memberIds:me}},E=r=>{const b=L(r);d.reset(b),p(r.id??null),g(null)},_=()=>{d.reset(Ve()),p(null),g(null),i("mcp")},z=r=>{u&&S?(A(()=>()=>E(r)),w(!0)):E(r)},N=async()=>{u&&S&&await Y(),_()},m=r=>{if(u&&S)A(()=>()=>{const b=$e(r,T?.data?.members??[]);d.reset(b),g(r),p(null),i("org")}),w(!0);else{const b=$e(r,T?.data?.members??[]);d.reset(b),g(r),p(null),i("org")}},M=r=>{if(!r&&d.formState.isDirty&&S){A(()=>()=>{l(!1),d.reset(Ve()),g(null)}),w(!0);return}if(l(r),!r)d.reset(Ve()),g(null),p(null);else{const b=y[0];if(b)E(b);else{const $=$e("user",T?.data?.members??[]);d.reset($),g("user"),p(null),i("org")}}},V=()=>{w(!1),O&&(O(),A(null))},se=r=>{const b={};r.allowAllStaticPermissions?b.self=["*"]:r.staticPermissions.length>0&&(b.self=r.staticPermissions);for(const[$,le]of Object.entries(r.toolSet))if(le.length>0){const W=x.find(q=>q.id===$)?.tools?.map(q=>q.name)??[];W.length>0&&W.every(q=>le.includes(q))?b[$]=["*"]:b[$]=le}return b},F=fe({mutationFn:async r=>{const b=se(r),$=r.role.slug||r.role.label.toLowerCase().replace(/\s+/g,"-");if(r.role.slug&&!r.role.id){const W=(T?.data?.members??[]).filter(k=>k.role===r.role.slug).map(k=>k.id),q=r.memberIds.filter(k=>!W.includes(k)),me=W.filter(k=>!r.memberIds.includes(k));for(const k of q){const B=await X.organization.updateMemberRole({memberId:k,role:[r.role.slug]});if(B?.error)throw new Error(B.error.message)}for(const k of me){const B=await X.organization.updateMemberRole({memberId:k,role:["user"]});if(B?.error)throw new Error(B.error.message)}return r}else if(r.role.id){const ie=await X.organization.updateRole({roleId:r.role.id,data:{permission:b}});if(ie?.error)throw new Error(ie.error.message);const q=(T?.data?.members??[]).filter(B=>B.role===r.role.slug).map(B=>B.id),me=r.memberIds.filter(B=>!q.includes(B)),k=q.filter(B=>!r.memberIds.includes(B));for(const B of me){const Z=await X.organization.updateMemberRole({memberId:B,role:[r.role.slug]});if(Z?.error)throw new Error(Z.error.message)}for(const B of k){const Z=await X.organization.updateMemberRole({memberId:B,role:["user"]});if(Z?.error)throw new Error(Z.error.message)}return r}else{const ie=await X.organization.createRole({role:$,permission:b});if(ie?.error)throw new Error(ie.error.message);for(const W of r.memberIds){const q=await X.organization.updateMemberRole({memberId:W,role:[$]});if(q?.error)throw new Error(q.error.message)}return{...r,role:{...r.role,id:ie.data?.roleData?.id,slug:$}}}},onSuccess:(r,b)=>{o.invalidateQueries({queryKey:oe.members(h)}),o.invalidateQueries({queryKey:oe.organizationRoles(h)});const $=!b.role.id&&!b.role.slug,le=b.role.slug&&!b.role.id;J.success(le?"Members updated successfully!":$?"Role created successfully!":"Role updated successfully!"),f(),d.reset(r),r.role.id&&p(r.role.id),e?.()},onError:r=>{J.error(r instanceof Error?r.message:"Failed to save role")}}),K=fe({mutationFn:async r=>{const b=await X.organization.deleteRole({roleId:r});if(b?.error)throw new Error(b.error.message);return b?.data},onSuccess:()=>{if(o.invalidateQueries({queryKey:oe.members(h)}),o.invalidateQueries({queryKey:oe.organizationRoles(h)}),J.success("Role deleted successfully!"),f(),v?.id===j){const r=y.filter(b=>b.id!==v?.id);if(r[0])E(r[0]);else{const b=$e("user",T?.data?.members??[]);d.reset(b),g("user"),p(null),i("org")}}},onError:r=>{J.error(r instanceof Error?r.message:"Failed to delete role")}}),Q=F.isPending||K.isPending,Y=async()=>{const r=d.getValues();if(!r.role.label.trim()){J.error("Role name is required"),d.setFocus("role.label");return}await F.mutateAsync(r)},ne=d.handleSubmit(r=>{if(!r.role.label.trim()){J.error("Role name is required"),d.setFocus("role.label");return}F.mutate(r)}),te=r=>{r.id&&I({id:r.id,label:r.label})},D=()=>{v?.id&&K.mutate(v.id),I(null)};return t.jsxs(Is,{open:n,onOpenChange:M,children:[t.jsx(ws,{asChild:!0,children:s}),t.jsx(Ts,{className:"sm:max-w-5xl h-[80vh] max-h-[80vh] flex flex-col p-0 overflow-hidden w-[95vw]",children:t.jsxs("div",{className:"flex-1 flex overflow-hidden min-h-0 flex-col sm:flex-row",children:[t.jsxs("div",{className:"w-full sm:w-64 sm:border-r border-b sm:border-b-0 border-border flex flex-col bg-background sm:h-full max-h-[40vh] sm:max-h-full",children:[t.jsx("div",{className:"flex-1 overflow-auto px-3.5 py-3.5 pt-3.5",children:t.jsxs("div",{className:"flex flex-col gap-1",children:[ht.map(r=>{const b=C===r.role;return t.jsxs("div",{className:re("flex items-center gap-2 px-2 py-1.5 rounded-lg overflow-hidden cursor-pointer transition-colors",b?"bg-accent":"hover:bg-muted/50"),onClick:()=>m(r.role),children:[t.jsx("div",{className:re("shrink-0 size-3 rounded-full",r.color)}),t.jsx("p",{className:"text-sm font-medium truncate flex-1",children:r.label}),t.jsx(et,{size:14,className:"text-muted-foreground shrink-0"})]},r.role)}),y.map(r=>{const b=j===r.id;return t.jsxs("div",{className:re("group flex items-center gap-2 px-2 py-1.5 rounded-lg overflow-hidden transition-colors cursor-pointer",b?"bg-accent":"hover:bg-muted/50"),onClick:()=>z(r),children:[t.jsx("div",{className:re("shrink-0 size-3 rounded-full",gt(r.label))}),t.jsx("p",{className:"text-sm font-medium truncate flex-1",children:r.label}),t.jsxs(as,{children:[t.jsx(cs,{asChild:!0,children:t.jsx(ee,{variant:"ghost",size:"icon",className:re("size-5 shrink-0 transition-opacity opacity-0 pointer-events-none","group-hover:opacity-100 group-hover:pointer-events-auto",b&&"opacity-100 pointer-events-auto"),onClick:$=>$.stopPropagation(),children:t.jsx(Xs,{size:14})})}),t.jsx(ds,{align:"end",children:t.jsxs(Ke,{className:"text-destructive",onClick:$=>{$.stopPropagation(),te(r)},children:[t.jsx(Os,{size:16}),"Delete"]})})]})]},r.id)}),c&&t.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded-lg overflow-hidden bg-accent",children:[t.jsx("div",{className:"shrink-0 size-3 rounded-full bg-neutral-400"}),t.jsx(st,{...d.register("role.label"),placeholder:"Enter role name",className:"flex-1 text-sm font-medium border-0 shadow-none h-auto px-0 py-0 focus-visible:ring-0 bg-transparent",autoFocus:!0}),t.jsx(Ie,{variant:"secondary",className:"shrink-0 text-xs px-1.5 py-0",children:"New"})]})]})}),t.jsx("div",{className:"px-3.5 pb-3.5",children:t.jsxs(ee,{variant:"outline",size:"default",onClick:N,disabled:Q||u,className:"w-full h-10",children:[t.jsx(ss,{size:16}),"Create new role"]})})]}),t.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[t.jsxs("div",{className:"h-12 border-b border-border px-4 py-3.5 flex items-center gap-2 shrink-0",children:[!C&&t.jsx(ee,{variant:"outline",size:"sm",onClick:()=>i("mcp"),className:re("h-8 rounded-lg px-2 py-1",a==="mcp"?"bg-muted border-input text-foreground":"border-input text-muted-foreground bg-transparent"),children:"MCP Permissions"}),t.jsx(ee,{variant:"outline",size:"sm",onClick:()=>i("org"),className:re("h-8 rounded-lg px-2 py-1",a==="org"?"bg-muted border-input text-foreground":"border-input text-muted-foreground bg-transparent"),children:"Organization Permissions"}),t.jsx(ee,{variant:"outline",size:"sm",onClick:()=>i("members"),className:re("h-8 rounded-lg px-2 py-1",a==="members"?"bg-muted border-input text-foreground":"border-input text-muted-foreground bg-transparent"),children:"Members"})]}),t.jsxs("div",{className:"flex-1 overflow-hidden min-h-0",children:[a==="mcp"&&!C&&t.jsx(Us,{toolSet:d.watch("toolSet"),onToolSetChange:r=>d.setValue("toolSet",r,{shouldDirty:!0})}),a==="org"&&t.jsx(xt,{allowAllStaticPermissions:d.watch("allowAllStaticPermissions"),staticPermissions:d.watch("staticPermissions"),onAllowAllChange:r=>d.setValue("allowAllStaticPermissions",r,{shouldDirty:!0}),onPermissionsChange:r=>d.setValue("staticPermissions",r,{shouldDirty:!0}),readOnly:!!C}),a==="members"&&t.jsx(St,{memberIds:d.watch("memberIds"),onMemberIdsChange:r=>d.setValue("memberIds",r,{shouldDirty:!0}),readOnly:C==="owner"})]}),(!C||C!=="owner")&&t.jsxs("div",{className:"border-t border-border px-5 py-5 flex items-center justify-end gap-2.5 shrink-0",children:[t.jsx(ee,{variant:"outline",onClick:()=>M(!1),disabled:Q,className:"h-10",children:"Cancel"}),t.jsx(ee,{onClick:ne,disabled:Q||!S||!d.formState.isDirty,className:"h-10",children:F.isPending?"Saving...":c?"Create Role":"Save Changes"})]})]})]})}),t.jsx(we,{open:v!==null,onOpenChange:r=>!r&&I(null),children:t.jsxs(Te,{children:[t.jsxs(Ae,{children:[t.jsx(Oe,{children:"Delete Role"}),t.jsxs(Re,{children:['Are you sure you want to delete the "',v?.label,'" role? This action cannot be undone.']})]}),t.jsxs(_e,{children:[t.jsx(Pe,{children:"Cancel"}),t.jsx(Le,{onClick:D,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),t.jsx(we,{open:P,onOpenChange:w,children:t.jsxs(Te,{children:[t.jsxs(Ae,{children:[t.jsx(Oe,{children:"Discard Changes"}),t.jsx(Re,{children:"You have unsaved changes. Are you sure you want to discard them?"})]}),t.jsxs(_e,{children:[t.jsx(Pe,{onClick:()=>A(null),children:"Keep Editing"}),t.jsx(Le,{onClick:V,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Discard"})]})]})})]})}const Tt=ue().email("Invalid email address");function At(s){if(!s.trim())return[];const e=s.split(/[,;\n]/).map(n=>n.trim().toLowerCase()).filter(n=>n.length>0);return Array.from(new Set(e))}function Ot({trigger:s}){const[e,n]=U.useState(!1),{locator:l}=Ce(),a=qe(),{data:i}=X.useSession(),h=i?.user?.email,{roles:o,isLoading:x}=us(),y=o.filter(g=>g.role!=="owner"),f=Es({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),T=f.watch("emailsText"),d=f.watch("role"),u=At(T).filter(g=>{const c=Tt.safeParse(g).success,v=!h||g!==h.toLowerCase();return c&&v}),j=fe({mutationFn:async({emails:g,role:c})=>{if(!c)throw new Error("Please select a role");const v=await Promise.allSettled(g.map(async P=>{const w=await X.organization.inviteMember({email:P,role:c});if(w.error)throw new Error(w.error.message);return w.data})),I=v.filter(P=>P.status==="rejected");if(I.length>0)throw new Error(`Failed to invite ${I.length} member${I.length>1?"s":""}`);return v},onSuccess:(g,{emails:c})=>{a.invalidateQueries({queryKey:oe.members(l)}),a.invalidateQueries({queryKey:oe.invitations(l)}),J.success(c.length===1?"Member invited successfully!":`${c.length} members invited successfully!`),f.reset({emailsText:"",role:"user"}),n(!1)},onError:g=>{J.error(g instanceof Error?g.message:"Failed to invite members")}}),p=g=>{if(u.length===0){J.error("Please enter at least one valid email address");return}if(!g.role){J.error("Please select a role");return}j.mutate({emails:u,role:g.role})},C=u.length>0&&!!d;return t.jsxs(Is,{open:e,onOpenChange:n,children:[t.jsx(ws,{asChild:!0,children:s}),t.jsxs(Ts,{className:"sm:max-w-lg",children:[t.jsx(Qs,{children:t.jsx(qs,{children:"Invite members"})}),t.jsx(nt,{...f,children:t.jsxs("form",{onSubmit:f.handleSubmit(p),className:"space-y-4",children:[t.jsx(gs,{control:f.control,name:"emailsText",render:({field:g})=>t.jsxs(xs,{children:[t.jsx(rt,{children:"Email addresses"}),t.jsx(ps,{children:t.jsx(it,{...g,disabled:j.isPending,placeholder:`Enter email addresses separated by commas or new lines
|
|
2
|
-
e.g. user1@example.com, user2@example.com
|
|
3
|
-
or one per line`,className:"min-h-[120px] resize-none"})}),t.jsx(bs,{})]})}),t.jsx(gs,{control:f.control,name:"role",render:({field:g})=>t.jsxs(xs,{children:[t.jsx(ps,{children:t.jsxs(ts,{value:g.value,onValueChange:g.onChange,disabled:j.isPending||x,children:[t.jsx(ns,{className:"w-full",children:t.jsx(rs,{placeholder:"Select a role"})}),t.jsx(is,{children:y.map(c=>{const v=[];return c.isBuiltin||(c.allowsAllStaticPermissions?v.push("Full org access"):c.staticPermissionCount&&c.staticPermissionCount>0&&v.push(`${c.staticPermissionCount} org perm${c.staticPermissionCount!==1?"s":""}`),c.allowsAllConnections?v.push("All connections"):c.connectionCount&&c.connectionCount>0&&v.push(`${c.connectionCount} connection${c.connectionCount!==1?"s":""}`),(c.connectionCount!==0||c.allowsAllConnections)&&(c.allowsAllTools?v.push("all tools"):c.toolCount&&c.toolCount>0&&v.push(`${c.toolCount} tool${c.toolCount!==1?"s":""}`))),t.jsx(ls,{value:c.role,children:t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:c.label}),!c.isBuiltin&&v.length>0&&t.jsx("span",{className:"text-xs text-muted-foreground",children:v.join(", ")})]})},c.role)})})]})}),t.jsx(bs,{})]})}),t.jsxs(Zs,{children:[t.jsx(ee,{variant:"outline",onClick:()=>{f.reset({emailsText:"",role:"user"}),n(!1)},type:"button",disabled:j.isPending,children:"Cancel"}),t.jsx(ee,{type:"submit",disabled:j.isPending||!C,children:j.isPending?"Inviting...":`Invite ${u.length||0} Member${u.length!==1?"s":""}`})]})]})})]})]})}function Rt(){const s=de.c(6),{locator:e}=Ce();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n=$s(),s[0]=n):n=s[0];const l=n;let a;s[1]!==e?(a=oe.invitations(e),s[1]=e,s[2]=a):a=s[2];let i;s[3]===Symbol.for("react.memo_cache_sentinel")?(i=async()=>(await l("ORGANIZATION_GET",{}))?.invitations??[],s[3]=i):i=s[3];let h;return s[4]!==a?(h={queryKey:a,queryFn:i},s[4]=a,s[5]=h):h=s[5],Ds(h)}function _t(){const s=de.c(5),{locator:e}=Ce(),n=qe();let l;s[0]!==e||s[1]!==n?(l={mutationFn:Lt,onSuccess:()=>{n.invalidateQueries({queryKey:oe.invitations(e)}),J.success("Invitation cancelled")},onError:Pt},s[0]=e,s[1]=n,s[2]=l):l=s[2];const a=fe(l);let i;return s[3]!==a?(i={cancel:a},s[3]=a,s[4]=i):i=s[4],i}function Pt(s){J.error(s instanceof Error?s.message:"Failed to cancel invitation")}async function Lt(s){const e=await X.organization.cancelInvitation({invitationId:s});if(e?.error)throw new Error(e.error.message);return e.data}const vs=["bg-neutral-400","bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500","bg-slate-500"],Mt={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function Qe(s){return s?s.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}function zt(s){const e=new Map;for(const[n,l]of Object.entries(Mt))e.set(n,l);for(let n=0;n<s.length;n++){const l=s[n];l&&!e.has(l.role)&&e.set(l.role,vs[n%vs.length]??"bg-neutral-400")}return e}function kt(s){return new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}function Fe(s){const e=de.c(79),{role:n,memberId:l,isOwner:a,roleColorMap:i,selectableRoles:h,onRoleChange:o,size:x,className:y}=s,f=x===void 0?"xs":x;let T,d,S,u,j,p,C,g,c,v,I;if(e[0]!==y||e[1]!==a||e[2]!==l||e[3]!==o||e[4]!==n||e[5]!==i||e[6]!==h||e[7]!==f){I=Symbol.for("react.early_return_sentinel");e:{const N=i.get(n)??"bg-neutral-400";if(a){let m;e[19]!==l||e[20]!==o?(m=D=>o(l,D),e[19]=l,e[20]=o,e[21]=m):m=e[21];let M;e[22]!==n?(M=t.jsx("span",{className:"capitalize truncate",children:n}),e[22]=n,e[23]=M):M=e[23];const V=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("div",{className:re("size-2 rounded-full shrink-0",N)}),M]});let se;e[24]!==V?(se=t.jsx(rs,{children:V}),e[24]=V,e[25]=se):se=e[25];let F;e[26]!==y||e[27]!==f||e[28]!==se?(F=t.jsx(ns,{size:f,className:y,children:se}),e[26]=y,e[27]=f,e[28]=se,e[29]=F):F=e[29];let K;if(e[30]!==i||e[31]!==h){let D;e[33]!==i?(D=r=>{const b=i.get(r.role)??"bg-neutral-400";return t.jsx(ls,{value:r.role,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:re("size-3 rounded-full",b)}),t.jsx("span",{className:"capitalize",children:r.label})]})},r.role)},e[33]=i,e[34]=D):D=e[34],K=h.map(D),e[30]=i,e[31]=h,e[32]=K}else K=e[32];let Q;e[35]!==K?(Q=t.jsx(is,{children:K}),e[35]=K,e[36]=Q):Q=e[36];let Y;e[37]!==a||e[38]!==n||e[39]!==m||e[40]!==F||e[41]!==Q?(Y=t.jsx(Ee,{asChild:!0,children:t.jsx("div",{className:"w-fit",children:t.jsxs(ts,{value:n,onValueChange:m,disabled:a,children:[F,Q]})})}),e[37]=a,e[38]=n,e[39]=m,e[40]=F,e[41]=Q,e[42]=Y):Y=e[42];let ne;e[43]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx(Se,{children:t.jsx("p",{children:"The owner role cannot be changed"})}),e[43]=ne):ne=e[43];let te;e[44]!==Y?(te=t.jsx(Ne,{children:t.jsxs(ye,{children:[Y,ne]})}),e[44]=Y,e[45]=te):te=e[45],I=te;break e}S=ts,g=n,e[46]!==l||e[47]!==o?(c=m=>o(l,m),e[46]=l,e[47]=o,e[48]=c):c=e[48],v=a,d=ns,p=f,C=y,T=rs,j="flex items-center gap-2 min-w-0",u=re("size-2 rounded-full shrink-0",N)}e[0]=y,e[1]=a,e[2]=l,e[3]=o,e[4]=n,e[5]=i,e[6]=h,e[7]=f,e[8]=T,e[9]=d,e[10]=S,e[11]=u,e[12]=j,e[13]=p,e[14]=C,e[15]=g,e[16]=c,e[17]=v,e[18]=I}else T=e[8],d=e[9],S=e[10],u=e[11],j=e[12],p=e[13],C=e[14],g=e[15],c=e[16],v=e[17],I=e[18];if(I!==Symbol.for("react.early_return_sentinel"))return I;let P;e[49]!==u?(P=t.jsx("div",{className:u}),e[49]=u,e[50]=P):P=e[50];let w;e[51]!==n?(w=t.jsx("span",{className:"capitalize truncate",children:n}),e[51]=n,e[52]=w):w=e[52];let O;e[53]!==P||e[54]!==w||e[55]!==j?(O=t.jsxs("div",{className:j,children:[P,w]}),e[53]=P,e[54]=w,e[55]=j,e[56]=O):O=e[56];let A;e[57]!==T||e[58]!==O?(A=t.jsx(T,{children:O}),e[57]=T,e[58]=O,e[59]=A):A=e[59];let L;e[60]!==d||e[61]!==A||e[62]!==p||e[63]!==C?(L=t.jsx(d,{size:p,className:C,children:A}),e[60]=d,e[61]=A,e[62]=p,e[63]=C,e[64]=L):L=e[64];let E;if(e[65]!==i||e[66]!==h){let N;e[68]!==i?(N=m=>{const M=i.get(m.role)??"bg-neutral-400";return t.jsx(ls,{value:m.role,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:re("size-3 rounded-full",M)}),t.jsx("span",{className:"capitalize",children:m.label})]})},m.role)},e[68]=i,e[69]=N):N=e[69],E=h.map(N),e[65]=i,e[66]=h,e[67]=E}else E=e[67];let _;e[70]!==E?(_=t.jsx(is,{children:E}),e[70]=E,e[71]=_):_=e[71];let z;return e[72]!==S||e[73]!==L||e[74]!==_||e[75]!==g||e[76]!==c||e[77]!==v?(z=t.jsxs(S,{value:g,onValueChange:c,disabled:v,children:[L,_]}),e[72]=S,e[73]=L,e[74]=_,e[75]=g,e[76]=c,e[77]=v,e[78]=z):z=e[78],z}function Ns(s){const e=de.c(51),{member:n,roles:l,onChangeRole:a,onRemove:i,isUpdating:h}=s,o=h===void 0?!1:h,x=n.role==="owner";let y,f,T,d,S,u,j,p,C;if(e[0]!==x||e[1]!==o||e[2]!==n.id||e[3]!==n.role||e[4]!==a||e[5]!==l){let L;e[15]!==n.role?(L=m=>m.role!==n.role&&m.role!=="owner",e[15]=n.role,e[16]=L):L=e[16];const E=l.filter(L);d=as;let _;e[17]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(Rs,{size:20}),e[17]=_):_=e[17],e[18]!==x?(C=t.jsx(cs,{asChild:!0,children:t.jsx(ee,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:x,onClick:Bt,children:_})}),e[18]=x,e[19]=C):C=e[19],T=ds,j="end",p=Dt,f=Ys;let z;e[20]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(_s,{size:16}),e[20]=z):z=e[20],e[21]!==o?(u=t.jsxs(Ws,{disabled:o,children:[z,"Change Role"]}),e[21]=o,e[22]=u):u=e[22],y=Hs;let N;e[23]!==o||e[24]!==n.id||e[25]!==a?(N=m=>{const M=[];return m.isBuiltin||(m.allowsAllStaticPermissions?M.push("Full org access"):m.staticPermissionCount&&m.staticPermissionCount>0&&M.push(`${m.staticPermissionCount} org perm${m.staticPermissionCount!==1?"s":""}`),m.allowsAllConnections?M.push("All connections"):m.connectionCount&&m.connectionCount>0&&M.push(`${m.connectionCount} connection${m.connectionCount!==1?"s":""}`),(m.connectionCount!==0||m.allowsAllConnections)&&(m.allowsAllTools?M.push("all tools"):m.toolCount&&m.toolCount>0&&M.push(`${m.toolCount} tool${m.toolCount!==1?"s":""}`))),t.jsxs(Ke,{onClick:V=>{V.stopPropagation(),a(n.id,m.role)},disabled:o,children:[m.isBuiltin?t.jsx(ms,{size:16}):t.jsx(lt,{size:16}),t.jsxs("span",{className:"flex flex-col",children:[t.jsx("span",{children:m.label}),!m.isBuiltin&&M.length>0&&t.jsx("span",{className:"text-xs text-muted-foreground",children:M.join(", ")})]})]},m.role)},e[23]=o,e[24]=n.id,e[25]=a,e[26]=N):N=e[26],S=E.map(N),e[0]=x,e[1]=o,e[2]=n.id,e[3]=n.role,e[4]=a,e[5]=l,e[6]=y,e[7]=f,e[8]=T,e[9]=d,e[10]=S,e[11]=u,e[12]=j,e[13]=p,e[14]=C}else y=e[6],f=e[7],T=e[8],d=e[9],S=e[10],u=e[11],j=e[12],p=e[13],C=e[14];let g;e[27]!==y||e[28]!==S?(g=t.jsx(y,{children:S}),e[27]=y,e[28]=S,e[29]=g):g=e[29];let c;e[30]!==f||e[31]!==u||e[32]!==g?(c=t.jsxs(f,{children:[u,g]}),e[30]=f,e[31]=u,e[32]=g,e[33]=c):c=e[33];let v;e[34]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Js,{}),e[34]=v):v=e[34];let I;e[35]!==n.id||e[36]!==i?(I=L=>{L.stopPropagation(),i(n.id)},e[35]=n.id,e[36]=i,e[37]=I):I=e[37];let P;e[38]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Os,{size:16}),e[38]=P):P=e[38];let w;e[39]!==I?(w=t.jsxs(Ke,{variant:"destructive",onClick:I,children:[P,"Remove Member"]}),e[39]=I,e[40]=w):w=e[40];let O;e[41]!==T||e[42]!==w||e[43]!==j||e[44]!==p||e[45]!==c?(O=t.jsxs(T,{align:j,onClick:p,children:[c,v,w]}),e[41]=T,e[42]=w,e[43]=j,e[44]=p,e[45]=c,e[46]=O):O=e[46];let A;return e[47]!==d||e[48]!==O||e[49]!==C?(A=t.jsxs(d,{children:[C,O]}),e[47]=d,e[48]=O,e[49]=C,e[50]=A):A=e[50],A}function Dt(s){return s.stopPropagation()}function Bt(s){return s.stopPropagation()}function ys(s){const e=de.c(8),{invitationId:n,onCancel:l,isCancelling:a}=s,i=a===void 0?!1:a;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(cs,{asChild:!0,children:t.jsx(ee,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ut,children:t.jsx(Rs,{size:20})})}),e[0]=h):h=e[0];let o;e[1]!==n||e[2]!==l?(o=f=>{f.stopPropagation(),l(n)},e[1]=n,e[2]=l,e[3]=o):o=e[3];let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(ot,{size:16}),e[4]=x):x=e[4];let y;return e[5]!==i||e[6]!==o?(y=t.jsxs(as,{children:[h,t.jsx(ds,{align:"end",onClick:Gt,children:t.jsxs(Ke,{variant:"destructive",onClick:o,disabled:i,children:[x,"Cancel Invitation"]})})]}),e[5]=i,e[6]=o,e[7]=y):y=e[7],y}function Gt(s){return s.stopPropagation()}function Ut(s){return s.stopPropagation()}function Vt(){const s=de.c(74),{data:e}=os(),{data:n}=Rt(),l=_t(),a=qe(),{locator:i}=Ce(),[h,o]=U.useState(null),[x,y]=U.useState(null),[f,T]=U.useState(""),[d,S]=U.useState("table"),[u,j]=U.useState("member"),[p,C]=U.useState("asc"),g=e?.data?.members;let c;s[0]!==u?(c=R=>{u===R?C(sn):(j(R),C("asc"))},s[0]=u,s[1]=c):c=s[1];const v=c;let I=g??[],P=n??[];if(f){const R=f.toLowerCase();I=I.filter(G=>G.user?.name?.toLowerCase().includes(R)||G.user?.email?.toLowerCase().includes(R)||G.role?.toLowerCase().includes(R)),P=P.filter(G=>G.email?.toLowerCase().includes(R)||G.role?.toLowerCase().includes(R))}if(u&&p){let R;s[2]!==p||s[3]!==u?(R=(G,H)=>{let ce,ve;e:switch(u){case"member":{ce=G.user?.name||"",ve=H.user?.name||"";break e}case"role":{ce=G.role||"",ve=H.role||"";break e}case"joined":{ce=G.createdAt?typeof G.createdAt=="string"?G.createdAt:G.createdAt.toISOString():"",ve=H.createdAt?typeof H.createdAt=="string"?H.createdAt:H.createdAt.toISOString():"";break e}default:return 0}return p==="asc"?ce.localeCompare(ve):ve.localeCompare(ce)},s[2]=p,s[3]=u,s[4]=R):R=s[4],I=[...I].sort(R)}const w=I;let O;s[5]!==i||s[6]!==a?(O={mutationFn:en,onSuccess:()=>{a.invalidateQueries({queryKey:oe.members(i)}),J.success("Member has been removed from the organization"),o(null)},onError:Xt},s[5]=i,s[6]=a,s[7]=O):O=s[7];const A=fe(O);let L;s[8]!==i||s[9]!==a?(L={mutationFn:Jt,onSuccess:()=>{a.invalidateQueries({queryKey:oe.members(i)}),J.success("Member's role has been updated")},onError:Ht},s[8]=i,s[9]=a,s[10]=L):L=s[10];const E=fe(L);let _;s[11]!==i||s[12]!==a?(_={mutationFn:Wt,onSuccess:()=>{a.invalidateQueries({queryKey:oe.invitations(i)}),J.success("Invitation role has been updated")},onError:Yt},s[11]=i,s[12]=a,s[13]=_):_=s[13];const z=fe(_),{roles:N,customRoles:m}=us();let M;s[14]!==m?(M=zt(m),s[14]=m,s[15]=M):M=s[15];const V=M;let se;s[16]!==N?(se=N.filter(Zt),s[16]=N,s[17]=se):se=s[17];const F=se;let K;s[18]===Symbol.for("react.memo_cache_sentinel")?(K={id:"member",header:"Member",render:qt,cellClassName:"flex-1 min-w-0",sortable:!0},s[18]=K):K=s[18];let Q;s[19]!==V||s[20]!==F||s[21]!==z||s[22]!==E?(Q={id:"role",header:"Role",render:R=>R.type==="member"?t.jsx(Fe,{role:R.data.role,memberId:R.data.id,isOwner:R.data.role==="owner",roleColorMap:V,selectableRoles:F,onRoleChange:(G,H)=>E.mutate({memberId:G,role:H}),className:"w-36"}):t.jsx(Fe,{role:R.data.role,memberId:R.data.id,isOwner:!1,roleColorMap:V,selectableRoles:F,onRoleChange:(G,H)=>z.mutate({invitationId:G,role:H,email:R.data.email}),className:"w-36"}),cellClassName:"w-36 shrink-0",sortable:!0},s[19]=V,s[20]=F,s[21]=z,s[22]=E,s[23]=Q):Q=s[23];let Y;s[24]===Symbol.for("react.memo_cache_sentinel")?(Y={id:"joined",header:"Joined",render:Qt,cellClassName:"w-48 shrink-0",sortable:!0},s[24]=Y):Y=s[24];let ne;s[25]!==l.cancel.isPending||s[26]!==N||s[27]!==E?(ne={id:"actions",header:"",render:R=>R.type==="member"?t.jsx(Ns,{member:R.data,roles:N,onChangeRole:(G,H)=>E.mutate({memberId:G,role:H}),onRemove:o,isUpdating:E.isPending}):t.jsx(ys,{invitationId:R.data.id,onCancel:y,isCancelling:l.cancel.isPending}),cellClassName:"w-12 shrink-0"},s[25]=l.cancel.isPending,s[26]=N,s[27]=E,s[28]=ne):ne=s[28];let te;s[29]!==Q||s[30]!==ne?(te=[K,Q,Y,ne],s[29]=Q,s[30]=ne,s[31]=te):te=s[31];const D=te;let r;s[32]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(wt,{trigger:t.jsxs(ee,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:[t.jsx(ms,{size:16}),"Manage Roles"]})}),s[32]=r):r=s[32];let b;s[33]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsxs("div",{className:"flex items-center gap-2",children:[r,t.jsx(Ot,{trigger:t.jsx(ee,{size:"sm",children:"Invite Member"})})]}),s[33]=b):b=s[33];const $=b,le=[...w.map(Kt),...P.filter(Ft).map($t)],ie=es,W=!!x;let q;s[34]===Symbol.for("react.memo_cache_sentinel")?(q=()=>y(null),s[34]=q):q=s[34];let me;s[35]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsxs(Ae,{children:[t.jsx(Oe,{children:"Cancel Invitation"}),t.jsx(Re,{children:"Are you sure you want to cancel this invitation? The invitee will no longer be able to join the organization with this invitation."})]}),s[35]=me):me=s[35];let k;s[36]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Pe,{children:"Keep Invitation"}),s[36]=k):k=s[36];let B;s[37]!==l.cancel||s[38]!==x?(B=()=>{x&&(l.cancel.mutate(x),y(null))},s[37]=l.cancel,s[38]=x,s[39]=B):B=s[39];let Z;s[40]!==l.cancel.isPending||s[41]!==B?(Z=t.jsxs(Te,{children:[me,t.jsxs(_e,{children:[k,t.jsx(Le,{onClick:B,disabled:l.cancel.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Cancel Invitation"})]})]}),s[40]=l.cancel.isPending,s[41]=B,s[42]=Z):Z=s[42];let ae;s[43]!==W||s[44]!==Z?(ae=t.jsx(we,{open:W,onOpenChange:q,children:Z}),s[43]=W,s[44]=Z,s[45]=ae):ae=s[45];const Ye=!!h;let Me;s[46]===Symbol.for("react.memo_cache_sentinel")?(Me=()=>o(null),s[46]=Me):Me=s[46];let ze;s[47]===Symbol.for("react.memo_cache_sentinel")?(ze=t.jsxs(Ae,{children:[t.jsx(Oe,{children:"Remove Member"}),t.jsx(Re,{children:"Are you sure you want to remove this member from the organization? This action cannot be undone."})]}),s[47]=ze):ze=s[47];let ke;s[48]===Symbol.for("react.memo_cache_sentinel")?(ke=t.jsx(Pe,{children:"Cancel"}),s[48]=ke):ke=s[48];let he;s[49]!==h||s[50]!==A?(he=()=>h&&A.mutate(h),s[49]=h,s[50]=A,s[51]=he):he=s[51];let ge;s[52]!==A.isPending||s[53]!==he?(ge=t.jsxs(Te,{children:[ze,t.jsxs(_e,{children:[ke,t.jsx(Le,{onClick:he,disabled:A.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]}),s[52]=A.isPending,s[53]=he,s[54]=ge):ge=s[54];let xe;s[55]!==Ye||s[56]!==ge?(xe=t.jsx(we,{open:Ye,onOpenChange:Me,children:ge}),s[55]=Ye,s[56]=ge,s[57]=xe):xe=s[57];let De;s[58]===Symbol.for("react.memo_cache_sentinel")?(De=[{id:"member",label:"Name"},{id:"role",label:"Role"},{id:"joined",label:"Joined"}],s[58]=De):De=s[58];let pe;s[59]!==v||s[60]!==p||s[61]!==u||s[62]!==d?(pe=t.jsx(Bs,{title:"Members",viewMode:d,onViewModeChange:S,sortKey:u,sortDirection:p,onSort:v,sortOptions:De,ctaButton:$}),s[59]=v,s[60]=p,s[61]=u,s[62]=d,s[63]=pe):pe=s[63];let Be;s[64]===Symbol.for("react.memo_cache_sentinel")?(Be=R=>{R.key==="Escape"&&(T(""),R.target.blur())},s[64]=Be):Be=s[64];let be;s[65]!==f?(be=t.jsx(Ze,{value:f,onChange:T,placeholder:"Search members...",onKeyDown:Be}),s[65]=f,s[66]=be):be=s[66];const We=d==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:le.length===0?t.jsx(Je,{title:"No members found",description:f?`No members match "${f}"`:"Invite members to get started."}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:le.map(R=>{if(R.type==="invitation")return t.jsxs(js,{className:"transition-colors relative opacity-75",children:[t.jsx("div",{className:"absolute top-4 right-4 z-10",children:t.jsx(ys,{invitationId:R.data.id,onCancel:y,isCancelling:l.cancel.isPending})}),t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(je,{fallback:Qe(R.data.email),shape:"circle",size:"lg",className:"shrink-0"}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:R.data.email}),t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(Ie,{variant:"outline",className:"w-fit text-amber-600 border-amber-400",children:"Pending"})}),t.jsx(Fe,{role:R.data.role,memberId:R.data.id,isOwner:!1,roleColorMap:V,selectableRoles:F,onRoleChange:(H,ce)=>z.mutate({invitationId:H,role:ce,email:R.data.email}),className:"w-fit"})]})]})]},`inv-${R.data.id}`);const G=R.data;return t.jsxs(js,{className:"transition-colors relative",children:[t.jsx("div",{className:"absolute top-4 right-4 z-10",children:t.jsx(Ns,{member:G,roles:N,onChangeRole:(H,ce)=>E.mutate({memberId:H,role:ce}),onRemove:o,isUpdating:E.isPending})}),t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(je,{url:G.user?.image??void 0,fallback:Qe(G.user?.name),shape:"circle",size:"lg",className:"shrink-0"}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:G.user?.name||"Unknown"}),t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:G.user?.email}),t.jsx(Fe,{role:G.role,memberId:G.id,isOwner:G.role==="owner",roleColorMap:V,selectableRoles:F,onRoleChange:(H,ce)=>E.mutate({memberId:H,role:ce}),className:"w-fit"})]})]})]},G.id)})})}):t.jsx(Gs,{columns:D,data:le,isLoading:!1,sortKey:u,sortDirection:p,onSort:v,emptyState:f?t.jsx(Je,{title:"No members found",description:`No members match "${f}"`}):t.jsx(Je,{title:"No members found",description:"Invite members to get started."})});let Ge;return s[67]!==ie||s[68]!==ae||s[69]!==xe||s[70]!==pe||s[71]!==be||s[72]!==We?(Ge=t.jsxs(ie,{children:[ae,xe,pe,be,We]}),s[67]=ie,s[68]=ae,s[69]=xe,s[70]=pe,s[71]=be,s[72]=We,s[73]=Ge):Ge=s[73],Ge}function $t(s){return{type:"invitation",data:s}}function Ft(s){return s.status==="pending"}function Kt(s){return{type:"member",data:s}}function Qt(s){return s.type==="member"?t.jsx("span",{className:"text-sm text-foreground",children:s.data.createdAt?kt(s.data.createdAt):"N/A"}):t.jsx(Ie,{variant:"outline",children:"Pending"})}function qt(s){return s.type==="member"?t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(je,{url:s.data.user?.image??void 0,fallback:Qe(s.data.user?.name),shape:"circle",size:"sm"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:s.data.user?.name||"Unknown"}),t.jsx("div",{className:"text-sm text-muted-foreground truncate",children:s.data.user?.email})]})]}):t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(je,{fallback:Qe(s.data.email),shape:"circle",size:"sm"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:s.data.email}),t.jsx("div",{className:"text-sm text-muted-foreground truncate",children:"Invitation sent"})]})]})}function Zt(s){return s.role!=="owner"}function Yt(s){J.error(s instanceof Error?s.message:"Failed to update invitation role")}async function Wt(s){const{invitationId:e,role:n,email:l}=s,a=await X.organization.cancelInvitation({invitationId:e});if(a?.error)throw new Error(a.error.message);const i=await X.organization.inviteMember({email:l,role:n});if(i?.error)throw new Error(i.error.message)}function Ht(s){J.error(s instanceof Error?s.message:"Failed to update role")}async function Jt(s){const{memberId:e,role:n}=s,l=await X.organization.updateMemberRole({memberId:e,role:[n]});if(l?.error)throw new Error(l.error.message)}function Xt(s){J.error(s instanceof Error?s.message:"Failed to remove member")}async function en(s){const e=await X.organization.removeMember({memberIdOrEmail:s});if(e?.error)throw new Error(e.error.message)}function sn(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function Vn(){const s=de.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(es,{children:t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Failed to load members"})})}),s[0]=e):e=s[0];let n;return s[1]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(tt,{fallback:e,children:t.jsx(U.Suspense,{fallback:t.jsx(es,{children:t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx(As,{size:32,className:"animate-spin text-muted-foreground"})})}),children:t.jsx(Vt,{})})}),s[1]=n):n=s[1],n}export{Vn as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a3 as ae,r as K,c as O,p as ce,K as X,ao as me,j as s,h as se,a as de,i as fe,q as ue}from"./index-CcOnUPVc.js";import{b as xe,c as pe}from"./well-known-mcp-D13f-8h2.js";import{C as ge}from"./collection-header-Cq2y0kMK.js";import{I as he,i as le}from"./FilterLines-3KXsEQsL.js";import{n as je}from"./Inbox01-BnO6gOQP.js";import{i as U}from"./Loading01-BIZwCiUc.js";import{c as ve,I as Ne,i as re,d as ye,b as ie,E as Ce,u as be}from"./use-connection-Dmp9OF3a.js";import{f as Se,g as we,a as Te,b as Ie}from"./github-icon-BrF3LMLL.js";import{b as ke,T as Re,c as $e,i as ze,u as Z}from"./project-context-provider-CRa6hysF.js";import{s as Le}from"./slugify-CEUa2lfQ.js";import{C as Pe}from"./collection-search-5HSGaGGt.js";import{i as Fe}from"./Lock01-DOOxUber.js";import{C as Ae}from"./card-DGWmxOab.js";import{e as Ee}from"./app-name-gTETL9So.js";import{B as G}from"./button-Dr2OfS67.js";import{I as De}from"./input-DBy5GvSG.js";import{P as Ke,a as Ve,b as Be}from"./popover-BD8rPm7n.js";import{t as Me}from"./ChevronDown-CTU5QhlY.js";import{s as Q}from"./XClose-BIM9TZ-N.js";import{d as _e,a as Oe,b as We,c as qe,S as Ge}from"./select-Bw9i3g8J.js";import{s as He}from"./Plus-DjZGP-Iq.js";import{a as Qe}from"./use-binding-DaAdA88g.js";import{L as Ue,u as Ye}from"./localstorage-keys-D9YX3_IT.js";import"./collection-display-button-CF5VNEyr.js";import"./dropdown-menu-DW5iGKOq.js";import"./ChevronRight-UyghVUW5.js";import"./Grid01-CJPihD4i.js";import"./view-mode-toggle-Di5d2VZX.js";import"./auth-oN0yIABg.js";import"./useQuery-u2B_27A6.js";function Ze(t,e){return ae(t,he,e)}const ne=({size:t=24,color:e="currentColor",...l})=>K.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},K.createElement("path",{d:"m9 12 2 2 4.5-4.5m2.401-4.501a2.03 2.03 0 0 0 1.1 1.1l1.744.723a2.033 2.033 0 0 1 1.1 2.656l-.722 1.744a2.03 2.03 0 0 0 0 1.556l.722 1.744a2.033 2.033 0 0 1-1.1 2.656L19 17.901A2.033 2.033 0 0 0 17.9 19l-.723 1.745a2.032 2.032 0 0 1-2.656 1.1l-1.744-.722a2.032 2.032 0 0 0-1.555 0l-1.745.723a2.033 2.033 0 0 1-2.654-1.1L6.1 19.001A2.033 2.033 0 0 0 5 17.9l-1.744-.723a2.033 2.033 0 0 1-1.1-2.654l.721-1.744a2.033 2.033 0 0 0 0-1.556l-.722-1.746a2.033 2.033 0 0 1 1.1-2.657L5 6.098A2.03 2.03 0 0 0 6.1 5l.723-1.745a2.033 2.033 0 0 1 2.656-1.1l1.744.722a2.033 2.033 0 0 0 1.555-.001l1.746-.72a2.032 2.032 0 0 1 2.655 1.1l.723 1.746v-.003Z"}));ne.displayName="CheckVerified02";function Je(t,e){const l=O.c(4),[c,o]=K.useState(t),r=K.useRef(null),a=K.useRef(!0);let i,g;return l[0]!==e||l[1]!==t?(i=()=>{if(a.current){a.current=!1;return}return r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{o(t)},e),()=>{r.current&&clearTimeout(r.current)}},g=[t,e],l[0]=e,l[1]=t,l[2]=i,l[3]=g):(i=l[2],g=l[3]),K.useEffect(i,g),c}const Xe=24;function et(t){const e=O.c(52),{registryId:l,listToolName:c,filtersToolName:o,search:r}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=[],e[0]=a):a=e[0];const[i,g]=K.useState(a);let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u=[],e[1]=u):u=e[1];const[m,n]=K.useState(u);let x;e[2]!==l?(x=ve(l),e[2]=l,e[3]=x):x=e[3];const d=x,p=!!o;let j;e[4]!==o||e[5]!==l?(j=X.toolCall(l,o||"no-filters","{}"),e[4]=o,e[5]=l,e[6]=j):j=e[6];let y;e[7]!==o||e[8]!==d?(y=async()=>o?await d(o,{}):{tags:[],categories:[]},e[7]=o,e[8]=d,e[9]=y):y=e[9];let k;e[10]!==j||e[11]!==y?(k={queryKey:j,queryFn:y,staleTime:36e5},e[10]=j,e[11]=y,e[12]=k):k=e[12];const{data:T}=ce(k);let S,C,I;if(e[13]!==c||e[14]!==l||e[15]!==r||e[16]!==m||e[17]!==i){const M=r?.trim()?{operator:"or",conditions:[{field:["name"],operator:"contains",value:r},{field:["title"],operator:"contains",value:r},{field:["description"],operator:"contains",value:r}]}:void 0;S={limit:Xe,...i.length>0&&{tags:i},...m.length>0&&{categories:m},...M&&{where:M}},I=Ze,C=X.toolCall(l,c,JSON.stringify(S)),e[13]=c,e[14]=l,e[15]=r,e[16]=m,e[17]=i,e[18]=S,e[19]=C,e[20]=I}else S=e[18],C=e[19],I=e[20];let N;e[21]!==S||e[22]!==c||e[23]!==d?(N=async M=>{const{pageParam:J}=M,oe=J?{...S,cursor:J}:S;return await d(c,oe)},e[21]=S,e[22]=c,e[23]=d,e[24]=N):N=e[24];let b;e[25]!==C||e[26]!==N?(b={queryKey:C,queryFn:N,initialPageParam:void 0,getNextPageParam:tt,staleTime:36e5,placeholderData:me},e[25]=C,e[26]=N,e[27]=b):b=e[27];const{data:R,fetchNextPage:$,hasNextPage:L,isFetchingNextPage:P,isFetching:f,isLoading:h}=I(b);let w;e:{if(!R?.pages||R.pages.length===0){w=null;break e}const M=R.pages[0];if(typeof M=="object"&&M!==null&&"totalCount"in M&&typeof M.totalCount=="number"){w=M.totalCount;break e}w=null}const z=w,F=R?.pages;let v;e[28]!==F?(v=Se(F),e[28]=F,e[29]=v):v=e[29];const E=v;let A;e[30]!==r||e[31]!==m.length||e[32]!==i.length?(A=i.length>0||m.length>0||!!r?.trim(),e[30]=r,e[31]=m.length,e[32]=i.length,e[33]=A):A=e[33];const D=A,_=f&&!P&&!h&&D;let W;e[34]!==$||e[35]!==L||e[36]!==P?(W=()=>{L&&!P&&$()},e[34]=$,e[35]=L,e[36]=P,e[37]=W):W=e[37];const V=W,B=L??!1,q=p?T?.tags:void 0,Y=p?T?.categories:void 0;let H;return e[38]!==D||e[39]!==f||e[40]!==P||e[41]!==_||e[42]!==h||e[43]!==E||e[44]!==V||e[45]!==m||e[46]!==i||e[47]!==B||e[48]!==q||e[49]!==Y||e[50]!==z?(H={items:E,totalCount:z,hasMore:B,isLoadingMore:P,isFiltering:_,isInitialLoading:h,isFetching:f,loadMore:V,availableTags:q,availableCategories:Y,selectedTags:i,selectedCategories:m,setSelectedTags:g,setSelectedCategories:n,hasActiveFilters:D},e[38]=D,e[39]=f,e[40]=P,e[41]=_,e[42]=h,e[43]=E,e[44]=V,e[45]=m,e[46]=i,e[47]=B,e[48]=q,e[49]=Y,e[50]=z,e[51]=H):H=e[51],H}function tt(t){if(typeof t=="object"&&t!==null){const e=t.nextCursor||t.cursor;if(e)return e}}function st(t){const e=t.title||t.server.title||t.id||"Unnamed Item",l=t._meta?.["mcp.mesh"],c=l?.short_description||l?.mesh_description||t.server.description||null,o=t.server.icons?.[0]?.src||we(t.server.repository)||null,r=l?.verified??!1,a=t.server.version,g=(t.server.remotes?.length??0)>0;let u=e,m=null;if(e.includes("/")){const n=e.split("/");n.length>=2&&(m=n[0]||null,u=Ee(e))}if(!m){const n=l?.scopeName,x=l?.appName;n&&x?m=`${n}/${x}`:n&&(m=n)}return l?.friendly_name&&(u=l.friendly_name),{icon:o,scopeName:m,displayName:u,description:c,version:a||null,isVerified:r,canInstall:g}}function lt(t){const e=O.c(39),{icon:l,scopeName:c,displayName:o,description:r,isVerified:a,canInstall:i,onClick:g}=t;let u;e[0]!==o||e[1]!==l?(u=s.jsx(Ne,{icon:l,name:o,size:"md",className:"shadow-sm"}),e[0]=o,e[1]=l,e[2]=u):u=e[2];let m;e[3]!==o?(m=s.jsx("span",{className:"truncate",children:o}),e[3]=o,e[4]=m):m=e[4];let n;e[5]!==a?(n=a&&s.jsx(ne,{size:16,className:"text-success shrink-0"}),e[5]=a,e[6]=n):n=e[6];let x;e[7]!==i?(x=!i&&s.jsx(Fe,{size:16,className:"text-muted-foreground shrink-0"}),e[7]=i,e[8]=x):x=e[8];let d;e[9]!==m||e[10]!==n||e[11]!==x?(d=s.jsx(ke,{asChild:!0,children:s.jsxs("div",{className:"flex items-center gap-2 text-base font-medium min-w-0",children:[m,n,x]})}),e[9]=m,e[10]=n,e[11]=x,e[12]=d):d=e[12];let p;e[13]!==o?(p=s.jsx("p",{children:o}),e[13]=o,e[14]=p):p=e[14];let j;e[15]!==i?(j=!i&&s.jsx("p",{className:"text-xs mt-1",children:"No connection available"}),e[15]=i,e[16]=j):j=e[16];let y;e[17]!==p||e[18]!==j?(y=s.jsxs(Re,{children:[p,j]}),e[17]=p,e[18]=j,e[19]=y):y=e[19];let k;e[20]!==d||e[21]!==y?(k=s.jsxs($e,{children:[d,y]}),e[20]=d,e[21]=y,e[22]=k):k=e[22];let T;e[23]!==c?(T=c&&s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:c}),e[23]=c,e[24]=T):T=e[24];let S;e[25]!==T||e[26]!==k?(S=s.jsx("div",{className:"flex gap-2 items-start min-w-0 flex-1",children:s.jsxs("div",{className:"min-w-0 flex-1",children:[k,T]})}),e[25]=T,e[26]=k,e[27]=S):S=e[27];let C;e[28]!==u||e[29]!==S?(C=s.jsxs("div",{className:"flex gap-3",children:[u,S]}),e[28]=u,e[29]=S,e[30]=C):C=e[30];const I=r||"No description available";let N;e[31]!==I?(N=s.jsx("div",{className:"grid grid-cols-1 gap-1 min-w-0",children:s.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:I})}),e[31]=I,e[32]=N):N=e[32];let b;e[33]!==C||e[34]!==N?(b=s.jsxs("div",{className:"flex flex-col gap-4 h-full relative",children:[C,N]}),e[33]=C,e[34]=N,e[35]=b):b=e[35];let R;return e[36]!==g||e[37]!==b?(R=s.jsx(Ae,{className:"p-6 cursor-pointer hover:bg-muted/50 transition-colors",onClick:g,children:b}),e[36]=g,e[37]=b,e[38]=R):R=e[38],R}function ee(t){const e=O.c(12),{items:l,title:c,onItemClick:o}=t;if(l.length===0)return null;let r;e[0]!==c?(r=c&&s.jsx("div",{className:"flex items-center justify-between w-max gap-2",children:s.jsx("h2",{className:"text-lg font-medium",children:c})}),e[0]=c,e[1]=r):r=e[1];let a;if(e[2]!==l||e[3]!==o){let u;e[5]!==o?(u=m=>{const n=st(m);return s.jsx(lt,{...n,onClick:()=>o(m)},m.id)},e[5]=o,e[6]=u):u=e[6],a=l.map(u),e[2]=l,e[3]=o,e[4]=a}else a=e[4];let i;e[7]!==a?(i=s.jsx("div",{className:"grid grid-cols-4 gap-4",children:a}),e[7]=a,e[8]=i):i=e[8];let g;return e[9]!==r||e[10]!==i?(g=s.jsxs("div",{className:"flex flex-col gap-4",children:[r,i]}),e[9]=r,e[10]=i,e[11]=g):g=e[11],g}function rt(t,e){return[...t].sort((l,c)=>c.count-l.count).slice(0,e)}function te(t){const e=O.c(52),{label:l,items:c,selectedItems:o,onToggle:r,onClear:a}=t,[i,g]=K.useState(""),[u,m]=K.useState(!1);let n,x,d,p,j,y,k,T,S,C,I;if(e[0]!==c||e[1]!==l||e[2]!==r||e[3]!==u||e[4]!==i||e[5]!==o){const P=[...i?c.filter(A=>A.value.toLowerCase().includes(i.toLowerCase())):c].sort(it);d=o.length,x=Ke,S=u,C=m;let f;e[17]!==l?(f=s.jsx("span",{children:l}),e[17]=l,e[18]=f):f=e[18];let h;e[19]!==d?(h=d>0&&s.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground px-1.5 py-0.5 text-[10px] font-medium",children:d}),e[19]=d,e[20]=h):h=e[20];let w;e[21]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(Me,{size:14,className:"opacity-50"}),e[21]=w):w=e[21],e[22]!==h||e[23]!==f?(I=s.jsx(Ve,{asChild:!0,children:s.jsxs(G,{variant:"outline",size:"sm",className:"h-7 px-3 gap-1.5 text-xs font-normal flex-1",children:[f,h,w]})}),e[22]=h,e[23]=f,e[24]=I):I=e[24],n=Be,y="w-64 p-0",k="start";let z;e[25]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(re,{size:16,className:"text-muted-foreground shrink-0"}),e[25]=z):z=e[25];let F;e[26]!==l?(F=l.toLowerCase(),e[26]=l,e[27]=F):F=e[27];const v=`Search ${F}...`;let E;e[28]===Symbol.for("react.memo_cache_sentinel")?(E=A=>g(A.target.value),e[28]=E):E=e[28],e[29]!==i||e[30]!==v?(T=s.jsx("div",{className:"shrink-0 w-full border-b border-border h-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-10 px-4 cursor-text",children:[z,s.jsx(De,{type:"text",placeholder:v,value:i,onChange:E,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[29]=i,e[30]=v,e[31]=T):T=e[31],p="max-h-64 overflow-y-auto p-1 flex flex-col gap-1",j=P.length===0?s.jsx("div",{className:"px-2 py-4 text-sm text-muted-foreground text-center",children:"No results found"}):P.map(A=>{const D=o.includes(A.value);return s.jsxs("button",{onClick:()=>r(A.value),className:`w-full flex items-center justify-between px-2 py-1.5 text-sm rounded cursor-pointer transition-colors ${D?"bg-accent/50 text-foreground":"hover:bg-muted text-foreground"}`,children:[s.jsxs("span",{className:"truncate flex items-center gap-2",children:[D&&s.jsx(ze,{size:16,className:"text-muted-foreground shrink-0"}),A.value]}),s.jsx("span",{className:"text-xs text-muted-foreground ml-2 shrink-0",children:A.count})]},A.value)}),e[0]=c,e[1]=l,e[2]=r,e[3]=u,e[4]=i,e[5]=o,e[6]=n,e[7]=x,e[8]=d,e[9]=p,e[10]=j,e[11]=y,e[12]=k,e[13]=T,e[14]=S,e[15]=C,e[16]=I}else n=e[6],x=e[7],d=e[8],p=e[9],j=e[10],y=e[11],k=e[12],T=e[13],S=e[14],C=e[15],I=e[16];let N;e[32]!==p||e[33]!==j?(N=s.jsx("div",{className:p,children:j}),e[32]=p,e[33]=j,e[34]=N):N=e[34];let b;e[35]!==l||e[36]!==a||e[37]!==d?(b=d>0&&s.jsx("div",{className:"p-2 border-t border-border",children:s.jsxs(G,{variant:"ghost",size:"sm",onClick:a,className:"w-full text-xs text-muted-foreground hover:text-foreground",children:["Clear ",l.toLowerCase()]})}),e[35]=l,e[36]=a,e[37]=d,e[38]=b):b=e[38];let R;e[39]!==n||e[40]!==b||e[41]!==y||e[42]!==k||e[43]!==T||e[44]!==N?(R=s.jsxs(n,{className:y,align:k,children:[T,N,b]}),e[39]=n,e[40]=b,e[41]=y,e[42]=k,e[43]=T,e[44]=N,e[45]=R):R=e[45];let $;return e[46]!==x||e[47]!==R||e[48]!==S||e[49]!==C||e[50]!==I?($=s.jsxs(x,{open:S,onOpenChange:C,children:[I,R]}),e[46]=x,e[47]=R,e[48]=S,e[49]=C,e[50]=I,e[51]=$):$=e[51],$}function it(t,e){return e.count-t.count}function nt(t){const e=O.c(67),{availableTags:l,availableCategories:c,selectedTags:o,selectedCategories:r,onTagChange:a,onCategoryChange:i}=t,g=l&&l.length>0||c&&c.length>0,u=o.length>0||r.length>0;if(!g)return null;let m;e[0]!==a||e[1]!==o?(m=f=>{o.includes(f)?a(o.filter(h=>h!==f)):a([...o,f])},e[0]=a,e[1]=o,e[2]=m):m=e[2];const n=m;let x;e[3]!==i||e[4]!==r?(x=f=>{r.includes(f)?i(r.filter(h=>h!==f)):i([...r,f])},e[3]=i,e[4]=r,e[5]=x):x=e[5];const d=x;let p;e[6]!==i||e[7]!==a?(p=()=>{a([]),i([])},e[6]=i,e[7]=a,e[8]=p):p=e[8];const j=p;let y,k,T,S,C,I,N;if(e[9]!==c||e[10]!==l||e[11]!==i||e[12]!==a||e[13]!==r||e[14]!==o||e[15]!==d||e[16]!==n){const f=c?rt(c,6):[];y=r,k=o,N=new Set(f.map(ot)),C="flex items-center border-b border-border";let h;e[24]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("div",{className:"flex items-center gap-2 text-muted-foreground",children:s.jsx(le,{size:16})}),e[24]=h):h=e[24];let w;e[25]!==c||e[26]!==i||e[27]!==r||e[28]!==d?(w=c&&c.length>0&&s.jsx(te,{label:"Categories",items:c,selectedItems:r,onToggle:d,onClear:()=>i([])}),e[25]=c,e[26]=i,e[27]=r,e[28]=d,e[29]=w):w=e[29];let z;e[30]!==l||e[31]!==a||e[32]!==o||e[33]!==n?(z=l&&l.length>0&&s.jsx(te,{label:"Tags",items:l,selectedItems:o,onToggle:n,onClear:()=>a([])}),e[30]=l,e[31]=a,e[32]=o,e[33]=n,e[34]=z):z=e[34],e[35]!==z||e[36]!==w?(I=s.jsxs("div",{className:"flex items-center gap-3 flex-wrap px-5 py-3 border-r border-border",children:[h,w,z]}),e[35]=z,e[36]=w,e[37]=I):I=e[37],T="flex items-center gap-3 flex-wrap px-5 py-3";let F;e[38]!==r||e[39]!==d?(F=v=>{const E=r.includes(v.value);return s.jsxs("div",{onClick:()=>d(v.value),className:`inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer ${E?"bg-primary text-primary-foreground hover:bg-primary/80":"bg-muted hover:bg-accent text-muted-foreground"}`,children:[s.jsx("span",{children:v.value}),E&&s.jsx("span",{onClick:A=>{A.stopPropagation(),d(v.value)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(Q,{size:12})})]},v.value)},e[38]=r,e[39]=d,e[40]=F):F=e[40],S=f.map(F),e[9]=c,e[10]=l,e[11]=i,e[12]=a,e[13]=r,e[14]=o,e[15]=d,e[16]=n,e[17]=y,e[18]=k,e[19]=T,e[20]=S,e[21]=C,e[22]=I,e[23]=N}else y=e[17],k=e[18],T=e[19],S=e[20],C=e[21],I=e[22],N=e[23];let b;if(e[41]!==y||e[42]!==d||e[43]!==N){let f;e[45]!==N?(f=w=>!N.has(w),e[45]=N,e[46]=f):f=e[46];let h;e[47]!==d?(h=w=>s.jsxs("div",{onClick:()=>d(w),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[s.jsx("span",{children:w}),s.jsx("span",{onClick:z=>{z.stopPropagation(),d(w)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(Q,{size:12})})]},`cat-${w}`),e[47]=d,e[48]=h):h=e[48],b=y.filter(f).map(h),e[41]=y,e[42]=d,e[43]=N,e[44]=b}else b=e[44];let R;if(e[49]!==k||e[50]!==n){let f;e[52]!==n?(f=h=>s.jsxs("div",{onClick:()=>n(h),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[s.jsx("span",{children:h}),s.jsx("span",{onClick:w=>{w.stopPropagation(),n(h)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(Q,{size:12})})]},`tag-${h}`),e[52]=n,e[53]=f):f=e[53],R=k.map(f),e[49]=k,e[50]=n,e[51]=R}else R=e[51];let $;e[54]!==j||e[55]!==u?($=u&&s.jsxs(G,{variant:"ghost",size:"sm",onClick:j,className:"h-7 text-xs text-muted-foreground hover:text-foreground gap-1 px-2",children:[s.jsx(Q,{size:14}),"Clear all"]}),e[54]=j,e[55]=u,e[56]=$):$=e[56];let L;e[57]!==$||e[58]!==T||e[59]!==S||e[60]!==b||e[61]!==R?(L=s.jsxs("div",{className:T,children:[S,b,R,$]}),e[57]=$,e[58]=T,e[59]=S,e[60]=b,e[61]=R,e[62]=L):L=e[62];let P;return e[63]!==L||e[64]!==C||e[65]!==I?(P=s.jsxs("div",{className:C,children:[I,L]}),e[63]=L,e[64]=C,e[65]=I,e[66]=P):P=e[66],P}function ot(t){return t.value}function at(t,e){if(!e)return t;const l=e.toLowerCase();return t.filter(c=>(c.name||c.title||"").toLowerCase().includes(l)||(c.description||c.server.description||"").toLowerCase().includes(l))}function ct(t){return t.verified===!0||t._meta?.["mcp.mesh"]?.verified===!0||t.server._meta?.["mcp.mesh"]?.verified===!0}function mt(t){const e=O.c(51),{registryId:l,listToolName:c,filtersToolName:o}=t,[r,a]=K.useState(""),i=Je(r,300),g=se(),{org:u}=Z(),m=K.useRef(null);let n;e[0]!==i||e[1]!==o||e[2]!==c||e[3]!==l?(n={registryId:l,listToolName:c,filtersToolName:o,search:i},e[0]=i,e[1]=o,e[2]=c,e[3]=l,e[4]=n):n=e[4];const{items:x,hasMore:d,isLoadingMore:p,isInitialLoading:j,isFetching:y,loadMore:k,availableTags:T,availableCategories:S,selectedTags:C,selectedCategories:I,setSelectedTags:N,setSelectedCategories:b,hasActiveFilters:R}=et(n);let $,L,P,f;e[5]!==i||e[6]!==y||e[7]!==j||e[8]!==x||e[9]!==r?($=r?at(x,r):x,L=(r!==i||y)&&!j&&!!r,f=$.filter(ct),P=$.filter(V=>!f.find(B=>B.id===V.id)),e[5]=i,e[6]=y,e[7]=j,e[8]=x,e[9]=r,e[10]=$,e[11]=L,e[12]=P,e[13]=f):($=e[10],L=e[11],P=e[12],f=e[13]);const h=P;let w;e[14]!==g||e[15]!==u.slug||e[16]!==l?(w=V=>{const B=Le(V.name||V.title||V.server.title||""),q=V.server.name;g({to:"/$org/store/$appName",params:{org:u.slug,appName:B},search:{registryId:l,serverName:q}})},e[14]=g,e[15]=u.slug,e[16]=l,e[17]=w):w=e[17];const z=w;let F;e[18]!==d||e[19]!==p||e[20]!==k?(F=V=>{if(!d||p)return;const B=V.currentTarget;B.scrollHeight-B.scrollTop-B.clientHeight<200&&k()},e[18]=d,e[19]=p,e[20]=k,e[21]=F):F=e[21];const v=F;let E;e[22]!==L||e[23]!==r?(E=s.jsx(Pe,{value:r,onChange:a,placeholder:"Search for an MCP Server...",isSearching:L}),e[22]=L,e[23]=r,e[24]=E):E=e[24];let A;e[25]!==S||e[26]!==T||e[27]!==I||e[28]!==C||e[29]!==b||e[30]!==N?(A=s.jsx(nt,{availableTags:T,availableCategories:S,selectedTags:C,selectedCategories:I,onTagChange:N,onCategoryChange:b}),e[25]=S,e[26]=T,e[27]=I,e[28]=C,e[29]=b,e[30]=N,e[31]=A):A=e[31];let D;e[32]!==h||e[33]!==$||e[34]!==z||e[35]!==R||e[36]!==d||e[37]!==j||e[38]!==p||e[39]!==L||e[40]!==x||e[41]!==r||e[42]!==f?(D=s.jsx("div",{className:"p-5",children:s.jsx("div",{children:j?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(U,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading items..."})]}):x.length===0&&!R?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(je,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No items available"}),s.jsx("p",{className:"text-muted-foreground",children:"This store doesn't have any available items yet."})]}):x.length===0&&R&&!r?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(le,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No matching items"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your filters to find more results."})]}):r&&$.length===0&&!L?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(re,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No results found"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search terms."})]}):s.jsxs("div",{className:"flex flex-col gap-8",children:[L&&$.length===0&&s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(U,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Searching..."})]}),f.length>0&&s.jsx(ee,{items:f,title:"Verified",onItemClick:z}),h.length>0&&s.jsx(ee,{items:h,title:f.length>0?"All":"",onItemClick:z}),d&&p&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(U,{size:20,className:"animate-spin"}),s.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[32]=h,e[33]=$,e[34]=z,e[35]=R,e[36]=d,e[37]=j,e[38]=p,e[39]=L,e[40]=x,e[41]=r,e[42]=f,e[43]=D):D=e[43];let _;e[44]!==v||e[45]!==D?(_=s.jsx("div",{ref:m,className:"flex-1 overflow-y-auto",onScroll:v,children:D}),e[44]=v,e[45]=D,e[46]=_):_=e[46];let W;return e[47]!==E||e[48]!==A||e[49]!==_?(W=s.jsxs("div",{className:"flex flex-col h-full",children:[E,A,_]}),e[47]=E,e[48]=A,e[49]=_,e[50]=W):W=e[50],W}function dt(t){const e=O.c(8),{registryId:l}=t,c=ye(l),o=c?.tools;let r;e[0]!==o?(r=Te(o),e[0]=o,e[1]=r):r=e[1];const a=r;if(!a)throw new Error("This registry does not support listing store items.");const i=c?.tools;let g;e[2]!==i?(g=Ie(i),e[2]=i,e[3]=g):g=e[3];const m=g||void 0;let n;return e[4]!==a||e[5]!==l||e[6]!==m?(n=s.jsx(mt,{registryId:l,listToolName:a,filtersToolName:m}),e[4]=a,e[5]=l,e[6]=m,e[7]=n):n=e[7],n}function ft(t){const e=O.c(15),{registries:l,value:c,onValueChange:o,onAddWellKnown:r,wellKnownRegistries:a,placeholder:i}=t,g=i===void 0?"Select a registry...":i;let u;e[0]!==g?(u=s.jsx(Oe,{size:"sm",className:"w-auto min-w-[160px]",children:s.jsx(We,{placeholder:g})}),e[0]=g,e[1]=u):u=e[1];let m;e[2]!==l?(m=l.map(ut),e[2]=l,e[3]=m):m=e[3];let n;e[4]!==r||e[5]!==a?(n=a.length>0&&s.jsxs("div",{className:"border-t border-border pt-1",children:[s.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Other known registries"}),a.map(p=>s.jsxs("button",{onClick:j=>{j.preventDefault(),j.stopPropagation(),r(p)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[p.icon?s.jsx("img",{src:p.icon,alt:p.title,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:p.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"flex-1",children:p.title})]}),s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:s.jsx(He,{size:16})})]},p.id??p.title))]}),e[4]=r,e[5]=a,e[6]=n):n=e[6];let x;e[7]!==m||e[8]!==n?(x=s.jsxs(qe,{children:[m,n]}),e[7]=m,e[8]=n,e[9]=x):x=e[9];let d;return e[10]!==o||e[11]!==u||e[12]!==x||e[13]!==c?(d=s.jsxs(Ge,{value:c,onValueChange:o,children:[u,x]}),e[10]=o,e[11]=u,e[12]=x,e[13]=c,e[14]=d):d=e[14],d}function ut(t){return s.jsx(_e,{className:"cursor-pointer",value:t.id??t.name,children:s.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?s.jsx("img",{src:t.icon,alt:t.name,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:t.name.slice(0,1).toUpperCase()}),s.jsx("span",{children:t.name})]})},t.id??t.name)}function xt({registries:t,onConnected:e}){const l=ie(),{org:{slug:c}}=Z(),{data:o}=de.useSession(),r=se(),[a,i]=K.useState(!1),g=t[0],u=async()=>{if(!(!g||!o?.user?.id)){i(!0);try{const n=await l.create.mutateAsync(g);e?.(n.id)}finally{i(!1)}}},m=()=>{r({to:"/$org/mcps",params:{org:c},search:{action:"create"}})};return s.jsx(Ce,{image:s.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:336,height:320,className:"max-w-full h-auto"}),title:"Connect to registry",description:"Connect to discover and use Connections from the community.",actions:s.jsxs(s.Fragment,{children:[s.jsxs(G,{variant:"outline",onClick:u,disabled:a||!g,children:[g?.icon&&s.jsx("img",{src:g.icon,alt:"",className:"size-4"}),a?"Installing...":"Install Registry"]}),s.jsx(G,{variant:"outline",onClick:m,children:"Custom Connection"})]})})}function Ut(){const t=O.c(41),{org:e}=Z(),l=be(),c=ie(),o=fe(),r=o.location.pathname.includes("/store/")&&o.location.pathname.split("/").length>3,a=Qe(l);let i;t[0]!==a?(i=a.map(ht),t[0]=a,t[1]=i):i=t[1];const g=i;let u;t[2]!==e.slug?(u=Ue.selectedRegistry(e.slug),t[2]=e.slug,t[3]=u):u=t[3];const[m,n]=Ye(u,gt);let x;if(t[4]!==a||t[5]!==m){let v;t[7]!==m?(v=E=>E.id===m,t[7]=m,t[8]=v):v=t[8],x=a.find(v),t[4]=a,t[5]=m,t[6]=x}else x=t[6];const p=x?.id||a[0]?.id||"";let j;t[9]!==e.id?(j=xe(e.id),t[9]=e.id,t[10]=j):j=t[10];let y;t[11]!==j?(y=[j],t[11]=j,t[12]=y):y=t[12];const k=y;let T;t[13]===Symbol.for("react.memo_cache_sentinel")?(T=[pe()],t[13]=T):T=t[13];const S=T;let C;t[14]!==c.create||t[15]!==n?(C=async v=>{const E=await c.create.mutateAsync(v);n(E.id)},t[14]=c.create,t[15]=n,t[16]=C):C=t[16];const I=C;let N;t[17]!==a?(N=new Set(a.map(pt)),t[17]=a,t[18]=N):N=t[18];const b=N;let R;t[19]!==b||t[20]!==k?(R=k.filter(v=>v.id&&!b.has(v.id)),t[19]=b,t[20]=k,t[21]=R):R=t[21];const $=R;let L;t[22]!==b?(L=S.filter(v=>v.id&&!b.has(v.id)),t[22]=b,t[23]=L):L=t[23];const P=L;if(r){let v;return t[24]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(ue,{}),t[24]=v):v=t[24],v}let f;t[25]!==I?(f=async v=>I(v),t[25]=I,t[26]=f):f=t[26];let h;t[27]!==$||t[28]!==p||t[29]!==g||t[30]!==n||t[31]!==f?(h=s.jsx(ge,{title:"Store",ctaButton:s.jsx(ft,{wellKnownRegistries:$,registries:g,value:p,onValueChange:n,onAddWellKnown:f,placeholder:"Select store..."})}),t[27]=$,t[28]=p,t[29]=g,t[30]=n,t[31]=f,t[32]=h):h=t[32];let w;t[33]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(U,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),t[33]=w):w=t[33];let z;t[34]!==P||t[35]!==p||t[36]!==n?(z=s.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:s.jsx(K.Suspense,{fallback:w,children:p?s.jsx(dt,{registryId:p}):s.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:s.jsx(xt,{registries:P,onConnected:v=>{n(v)}})})})}),t[34]=P,t[35]=p,t[36]=n,t[37]=z):z=t[37];let F;return t[38]!==h||t[39]!==z?(F=s.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[h,z]}),t[38]=h,t[39]=z,t[40]=F):F=t[40],F}function pt(t){return t.id}function gt(t){return t??""}function ht(t){return{id:t.id,name:t.title,icon:t.icon||void 0}}export{Ut as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as _,c as v,j as n}from"./index-CcOnUPVc.js";import{B as z}from"./button-Dr2OfS67.js";import{u as k,b as y,T as E,a as B,c as S}from"./project-context-provider-CRa6hysF.js";import{u as w,a as A}from"./use-organization-settings-BGtwqtxs.js";const C=({size:c=24,color:e="currentColor",...r})=>_.createElement("svg",{viewBox:"0 0 24 24",width:c,height:c,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},_.createElement("path",{d:"M12 15v7M8 7.308v2.13c0 .209 0 .313-.02.412a1.001 1.001 0 0 1-.09.254c-.045.09-.11.172-.24.334L6.08 12.4c-.666.833-.999 1.249-.999 1.599a1 1 0 0 0 .376.782C5.731 15 6.264 15 7.33 15h9.342c1.066 0 1.599 0 1.873-.219A1 1 0 0 0 18.92 14c0-.35-.333-.766-1-1.599l-1.569-1.962c-.13-.162-.195-.243-.241-.334a1.004 1.004 0 0 1-.09-.254C16 9.75 16 9.647 16 9.44V7.31c0-.116 0-.174.007-.23.006-.05.015-.1.029-.15a2.02 2.02 0 0 1 .079-.215l1.008-2.52c.294-.735.44-1.102.38-1.397a1 1 0 0 0-.427-.63C16.825 2 16.429 2 15.637 2H8.364c-.792 0-1.188 0-1.44.167a1 1 0 0 0-.426.63c-.06.295.086.662.38 1.397l1.008 2.52c.043.107.064.16.08.215a1 1 0 0 1 .028.15c.006.056.006.114.006.23Z"}));C.displayName="Pin01";function O(c){const e=v.c(19),{title:r,url:t,icon:f}=c,{org:P}=k(),i=w(P.id),h=A(P.id);let l;e[0]!==i?.sidebar_items||e[1]!==t?(l=i?.sidebar_items?.some(p=>p.url===t),e[0]=i?.sidebar_items,e[1]=t,e[2]=l):l=e[2];const a=!!l;let d;e[3]!==h.update||e[4]!==f||e[5]!==a||e[6]!==i?.sidebar_items||e[7]!==r||e[8]!==t?(d=async()=>{const p=i?.sidebar_items||[];let j;a?j=p.filter(T=>T.url!==t):j=[...p,{title:r,url:t,icon:f}],await h.update.mutateAsync({sidebar_items:j})},e[3]=h.update,e[4]=f,e[5]=a,e[6]=i?.sidebar_items,e[7]=r,e[8]=t,e[9]=d):d=e[9];const b=d,x=a?"secondary":"outline";let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(C,{size:16}),e[10]=m):m=e[10];let s;e[11]!==b||e[12]!==x?(s=n.jsx(y,{asChild:!0,children:n.jsx(z,{onClick:b,size:"icon",variant:x,className:"size-7 border border-input",children:m})}),e[11]=b,e[12]=x,e[13]=s):s=e[13];const g=a?"Pinned":"Pin to sidebar";let o;e[14]!==g?(o=n.jsx(E,{children:g}),e[14]=g,e[15]=o):o=e[15];let u;return e[16]!==s||e[17]!==o?(u=n.jsx(B,{children:n.jsxs(S,{children:[s,o]})}),e[16]=s,e[17]=o,e[18]=u):u=e[18],u}export{O as P};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,at as O,ak as $,j as c,au as z,ae as L,av as G,ac as _,af as w,ah as g,aw as E,ag as j,ax as H,ay as K,az as B,aA as U,aB as V,aC as W,aD as Z,aE as q,aF as J,c as R}from"./index-CcOnUPVc.js";import{c as Q}from"./button-Dr2OfS67.js";var m="Popover",[b]=L(m,[O]),P=O(),[X,d]=b(m),N=t=>{const{__scopePopover:e,children:o,open:r,defaultOpen:n,onOpenChange:a,modal:s=!1}=t,p=P(e),l=i.useRef(null),[u,h]=i.useState(!1),[x,f]=$({prop:r,defaultProp:n??!1,onChange:a,caller:m});return c.jsx(z,{...p,children:c.jsx(X,{scope:e,contentId:G(),triggerRef:l,open:x,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(C=>!C),[f]),hasCustomAnchor:u,onCustomAnchorAdd:i.useCallback(()=>h(!0),[]),onCustomAnchorRemove:i.useCallback(()=>h(!1),[]),modal:s,children:o})})};N.displayName=m;var F="PopoverAnchor",Y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(F,o),a=P(o),{onCustomAnchorAdd:s,onCustomAnchorRemove:p}=n;return i.useEffect(()=>(s(),()=>p()),[s,p]),c.jsx(E,{...a,...r,ref:e})});Y.displayName=F;var y="PopoverTrigger",S=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(y,o),a=P(o),s=_(e,n.triggerRef),p=c.jsx(w.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":I(n.open),...r,ref:s,onClick:g(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:c.jsx(E,{asChild:!0,...a,children:p})});S.displayName=y;var A="PopoverPortal",[ee,oe]=b(A,{forceMount:void 0}),D=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,a=d(A,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(j,{present:o||a.open,children:c.jsx(H,{asChild:!0,container:n,children:r})})})};D.displayName=A;var v="PopoverContent",M=i.forwardRef((t,e)=>{const o=oe(v,t.__scopePopover),{forceMount:r=o.forceMount,...n}=t,a=d(v,t.__scopePopover);return c.jsx(j,{present:r||a.open,children:a.modal?c.jsx(re,{...n,ref:e}):c.jsx(ne,{...n,ref:e})})});M.displayName=v;var te=U("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(null),n=_(e,r),a=i.useRef(!1);return i.useEffect(()=>{const s=r.current;if(s)return K(s)},[]),c.jsx(B,{as:te,allowPinchZoom:!0,children:c.jsx(k,{...t,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(t.onCloseAutoFocus,s=>{s.preventDefault(),a.current||o.triggerRef.current?.focus()}),onPointerDownOutside:g(t.onPointerDownOutside,s=>{const p=s.detail.originalEvent,l=p.button===0&&p.ctrlKey===!0,u=p.button===2||l;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:g(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(!1),n=i.useRef(!1);return c.jsx(k,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||o.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const s=a.target;o.triggerRef.current?.contains(s)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&n.current&&a.preventDefault()}})}),k=i.forwardRef((t,e)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:h,...x}=t,f=d(v,o),C=P(o);return V(),c.jsx(W,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:a,children:c.jsx(Z,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(q,{"data-state":I(f.open),role:"dialog",id:f.contentId,...C,...x,ref:e,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),T="PopoverClose",ae=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(T,o);return c.jsx(w.button,{type:"button",...r,ref:e,onClick:g(t.onClick,()=>n.onOpenChange(!1))})});ae.displayName=T;var se="PopoverArrow",ce=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=P(o);return c.jsx(J,{...n,...r,ref:e})});ce.displayName=se;function I(t){return t?"open":"closed"}var ie=N,pe=S,le=D,ue=M;function ve(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(ie,{"data-slot":"popover",...o}),e[2]=o,e[3]=r):r=e[3],r}function ge(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(pe,{"data-slot":"popover-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function Pe(t){const e=R.c(12);let o,r,n,a;e[0]!==t?({className:o,align:n,sideOffset:a,...r}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=a):(o=e[1],r=e[2],n=e[3],a=e[4]);const s=n===void 0?"center":n,p=a===void 0?4:a;let l;e[5]!==o?(l=Q("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-lg overflow-hidden border p-4 shadow-md outline-hidden",o),e[5]=o,e[6]=l):l=e[6];let u;return e[7]!==s||e[8]!==r||e[9]!==p||e[10]!==l?(u=c.jsx(le,{children:c.jsx(ue,{"data-slot":"popover-content",align:s,sideOffset:p,className:l,...r})}),e[7]=s,e[8]=r,e[9]=p,e[10]=l,e[11]=u):u=e[11],u}export{ve as P,ge as a,Pe as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,j as d,af as H,ae as Z,at as $,av as ee,ak as te,au as oe,ac as G,aw as re,ah as C,ag as z,ax as ne,aD as se,aE as ae,bz as ie,aF as le,c as j}from"./index-CcOnUPVc.js";import{c as ce}from"./button-Dr2OfS67.js";var ue=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),de="VisuallyHidden",F=a.forwardRef((o,e)=>d.jsx(H.span,{...o,ref:e,style:{...ue,...o.style}}));F.displayName=de;var pe=F;const fe=({size:o=24,color:e="currentColor",...t})=>a.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},a.createElement("path",{d:"M20 6 9 17l-5-5"}));fe.displayName="Check";var[O]=Z("Tooltip",[$]),L=$(),V="TooltipProvider",ve=700,D="tooltip.open",[he,A]=O(V),B=o=>{const{__scopeTooltip:e,delayDuration:t=ve,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:s}=o,l=a.useRef(!0),c=a.useRef(!1),i=a.useRef(0);return a.useEffect(()=>{const u=i.current;return()=>window.clearTimeout(u)},[]),d.jsx(he,{scope:e,isOpenDelayedRef:l,delayDuration:t,onOpen:a.useCallback(()=>{window.clearTimeout(i.current),l.current=!1},[]),onClose:a.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:a.useCallback(u=>{c.current=u},[]),disableHoverableContent:n,children:s})};B.displayName=V;var R="Tooltip",[xe,_]=O(R),U=o=>{const{__scopeTooltip:e,children:t,open:r,defaultOpen:n,onOpenChange:s,disableHoverableContent:l,delayDuration:c}=o,i=A(R,o.__scopeTooltip),u=L(e),[p,v]=a.useState(null),h=ee(),f=a.useRef(0),x=l??i.disableHoverableContent,m=c??i.delayDuration,g=a.useRef(!1),[y,T]=te({prop:r,defaultProp:n??!1,onChange:M=>{M?(i.onOpen(),document.dispatchEvent(new CustomEvent(D))):i.onClose(),s?.(M)},caller:R}),b=a.useMemo(()=>y?g.current?"delayed-open":"instant-open":"closed",[y]),P=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,g.current=!1,T(!0)},[T]),E=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,T(!1)},[T]),I=a.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{g.current=!0,T(!0),f.current=0},m)},[m,T]);return a.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),d.jsx(oe,{...u,children:d.jsx(xe,{scope:e,contentId:h,open:y,stateAttribute:b,trigger:p,onTriggerChange:v,onTriggerEnter:a.useCallback(()=>{i.isOpenDelayedRef.current?I():P()},[i.isOpenDelayedRef,I,P]),onTriggerLeave:a.useCallback(()=>{x?E():(window.clearTimeout(f.current),f.current=0)},[E,x]),onOpen:P,onClose:E,disableHoverableContent:x,children:t})})};U.displayName=R;var k="TooltipTrigger",Y=a.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=_(k,t),s=A(k,t),l=L(t),c=a.useRef(null),i=G(e,c,n.onTriggerChange),u=a.useRef(!1),p=a.useRef(!1),v=a.useCallback(()=>u.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),d.jsx(re,{asChild:!0,...l,children:d.jsx(H.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:i,onPointerMove:C(o.onPointerMove,h=>{h.pointerType!=="touch"&&!p.current&&!s.isPointerInTransitRef.current&&(n.onTriggerEnter(),p.current=!0)}),onPointerLeave:C(o.onPointerLeave,()=>{n.onTriggerLeave(),p.current=!1}),onPointerDown:C(o.onPointerDown,()=>{n.open&&n.onClose(),u.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:C(o.onFocus,()=>{u.current||n.onOpen()}),onBlur:C(o.onBlur,n.onClose),onClick:C(o.onClick,n.onClose)})})});Y.displayName=k;var N="TooltipPortal",[ge,me]=O(N,{forceMount:void 0}),W=o=>{const{__scopeTooltip:e,forceMount:t,children:r,container:n}=o,s=_(N,e);return d.jsx(ge,{scope:e,forceMount:t,children:d.jsx(z,{present:t||s.open,children:d.jsx(ne,{asChild:!0,container:n,children:r})})})};W.displayName=N;var w="TooltipContent",q=a.forwardRef((o,e)=>{const t=me(w,o.__scopeTooltip),{forceMount:r=t.forceMount,side:n="top",...s}=o,l=_(w,o.__scopeTooltip);return d.jsx(z,{present:r||l.open,children:l.disableHoverableContent?d.jsx(X,{side:n,...s,ref:e}):d.jsx(Te,{side:n,...s,ref:e})})}),Te=a.forwardRef((o,e)=>{const t=_(w,o.__scopeTooltip),r=A(w,o.__scopeTooltip),n=a.useRef(null),s=G(e,n),[l,c]=a.useState(null),{trigger:i,onClose:u}=t,p=n.current,{onPointerInTransitChange:v}=r,h=a.useCallback(()=>{c(null),v(!1)},[v]),f=a.useCallback((x,m)=>{const g=x.currentTarget,y={x:x.clientX,y:x.clientY},T=be(y,g.getBoundingClientRect()),b=Pe(y,T),P=Ee(m.getBoundingClientRect()),E=je([...b,...P]);c(E),v(!0)},[v]);return a.useEffect(()=>()=>h(),[h]),a.useEffect(()=>{if(i&&p){const x=g=>f(g,p),m=g=>f(g,i);return i.addEventListener("pointerleave",x),p.addEventListener("pointerleave",m),()=>{i.removeEventListener("pointerleave",x),p.removeEventListener("pointerleave",m)}}},[i,p,f,h]),a.useEffect(()=>{if(l){const x=m=>{const g=m.target,y={x:m.clientX,y:m.clientY},T=i?.contains(g)||p?.contains(g),b=!Re(y,l);T?h():b&&(h(),u())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[i,p,l,u,h]),d.jsx(X,{...o,ref:s})}),[ye,Ce]=O(R,{isInside:!1}),we=ie("TooltipContent"),X=a.forwardRef((o,e)=>{const{__scopeTooltip:t,children:r,"aria-label":n,onEscapeKeyDown:s,onPointerDownOutside:l,...c}=o,i=_(w,t),u=L(t),{onClose:p}=i;return a.useEffect(()=>(document.addEventListener(D,p),()=>document.removeEventListener(D,p)),[p]),a.useEffect(()=>{if(i.trigger){const v=h=>{h.target?.contains(i.trigger)&&p()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[i.trigger,p]),d.jsx(se,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:v=>v.preventDefault(),onDismiss:p,children:d.jsxs(ae,{"data-state":i.stateAttribute,...u,...c,ref:e,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[d.jsx(we,{children:r}),d.jsx(ye,{scope:t,isInside:!0,children:d.jsx(pe,{id:i.contentId,role:"tooltip",children:n||r})})]})})});q.displayName=w;var J="TooltipArrow",K=a.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=L(t);return Ce(J,t).isInside?null:d.jsx(le,{...n,...r,ref:e})});K.displayName=J;function be(o,e){const t=Math.abs(e.top-o.y),r=Math.abs(e.bottom-o.y),n=Math.abs(e.right-o.x),s=Math.abs(e.left-o.x);switch(Math.min(t,r,n,s)){case s:return"left";case n:return"right";case t:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Pe(o,e,t=5){const r=[];switch(e){case"top":r.push({x:o.x-t,y:o.y+t},{x:o.x+t,y:o.y+t});break;case"bottom":r.push({x:o.x-t,y:o.y-t},{x:o.x+t,y:o.y-t});break;case"left":r.push({x:o.x+t,y:o.y-t},{x:o.x+t,y:o.y+t});break;case"right":r.push({x:o.x-t,y:o.y-t},{x:o.x-t,y:o.y+t});break}return r}function Ee(o){const{top:e,right:t,bottom:r,left:n}=o;return[{x:n,y:e},{x:t,y:e},{x:t,y:r},{x:n,y:r}]}function Re(o,e){const{x:t,y:r}=o;let n=!1;for(let s=0,l=e.length-1;s<e.length;l=s++){const c=e[s],i=e[l],u=c.x,p=c.y,v=i.x,h=i.y;p>r!=h>r&&t<(v-u)*(r-p)/(h-p)+u&&(n=!n)}return n}function je(o){const e=o.slice();return e.sort((t,r)=>t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0),_e(e)}function _e(o){if(o.length<=1)return o.slice();const e=[];for(let r=0;r<o.length;r++){const n=o[r];for(;e.length>=2;){const s=e[e.length-1],l=e[e.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))e.pop();else break}e.push(n)}e.pop();const t=[];for(let r=o.length-1;r>=0;r--){const n=o[r];for(;t.length>=2;){const s=t[t.length-1],l=t[t.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))t.pop();else break}t.push(n)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var Oe=B,Le=U,De=Y,ke=W,Ae=q,Ne=K;function Ie(o){const e=j.c(6);let t,r;e[0]!==o?({delayDuration:r,...t}=o,e[0]=o,e[1]=t,e[2]=r):(t=e[1],r=e[2]);const n=r===void 0?0:r;let s;return e[3]!==n||e[4]!==t?(s=d.jsx(Oe,{"data-slot":"tooltip-provider",delayDuration:n,...t}),e[3]=n,e[4]=t,e[5]=s):s=e[5],s}function $e(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=d.jsx(Ie,{children:d.jsx(Le,{"data-slot":"tooltip",...t})}),e[2]=t,e[3]=r):r=e[3],r}function Ge(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=d.jsx(De,{"data-slot":"tooltip-trigger",...t}),e[2]=t,e[3]=r):r=e[3],r}function ze(o){const e=j.c(13);let t,r,n,s;e[0]!==o?({className:r,sideOffset:s,children:t,...n}=o,e[0]=o,e[1]=t,e[2]=r,e[3]=n,e[4]=s):(t=e[1],r=e[2],n=e[3],s=e[4]);const l=s===void 0?0:s;let c;e[5]!==r?(c=ce("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",r),e[5]=r,e[6]=c):c=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Ne,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"}),e[7]=i):i=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==l||e[11]!==c?(u=d.jsx(ke,{children:d.jsxs(Ae,{"data-slot":"tooltip-content",sideOffset:l,className:c,...n,children:[t,i]})}),e[8]=t,e[9]=n,e[10]=l,e[11]=c,e[12]=u):u=e[12],u}const S="org-admin",Me={from({org:o,project:e}){if(o?.includes("/")||e.includes("/"))throw new Error("Org or project cannot contain slashes");return`${o}/${e}`},parse(o){o.startsWith("/")&&(o=o.slice(1));const[e,t]=o.split("/");if(!e||!t)throw new Error("Invalid locator");return{org:e,project:t}},isOrgAdminProject(o){return o.split("/")[1]===S},adminProject(o){return`${o}/${S}`}},Q=a.createContext(void 0),Fe=()=>{const o=a.useContext(Q);if(!o)throw new Error("useProjectContext must be used within a ProjectContextProvider");return o},Ve=o=>{const e=j.c(10),{children:t,org:r,project:n}=o;let s;e[0]!==r.slug||e[1]!==n.slug?(s=Me.from({org:r.slug,project:n.slug}),e[0]=r.slug,e[1]=n.slug,e[2]=s):s=e[2];const l=s;let c;e[3]!==l||e[4]!==r||e[5]!==n?(c={org:r,project:n,locator:l},e[3]=l,e[4]=r,e[5]=n,e[6]=c):c=e[6];const i=c;let u;return e[7]!==t||e[8]!==i?(u=d.jsx(Q.Provider,{value:i,children:t}),e[7]=t,e[8]=i,e[9]=u):u=e[9],u};export{Me as L,S as O,Ve as P,ze as T,ue as V,Ie as a,Ge as b,$e as c,fe as i,Fe as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as f,a9 as Pn,c as He,j as he}from"./index-CcOnUPVc.js";import{c as Je}from"./button-Dr2OfS67.js";const Ye=({size:n=24,color:e="currentColor",...t})=>f.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},f.createElement("path",{d:"M12 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm7-14a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM5 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"}));Ye.displayName="DotsGrid";const Ee=f.createContext(null);Ee.displayName="PanelGroupContext";const A={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},_e=10,ne=f.useLayoutEffect,Fe=Pn.useId,wn=typeof Fe=="function"?Fe:()=>null;let En=0;function Ge(n=null){const e=wn(),t=f.useRef(n||e||null);return t.current===null&&(t.current=""+En++),n??t.current}function Qe({children:n,className:e="",collapsedSize:t,collapsible:r,defaultSize:i,forwardedRef:o,id:l,maxSize:a,minSize:s,onCollapse:h,onExpand:w,onResize:p,order:u,style:v,tagName:z="div",...C}){const E=f.useContext(Ee);if(E===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:S,expandPanel:L,getPanelSize:N,getPanelStyle:D,groupId:V,isPanelCollapsed:R,reevaluatePanelConstraints:P,registerPanel:F,resizePanel:q,unregisterPanel:W}=E,G=Ge(l),M=f.useRef({callbacks:{onCollapse:h,onExpand:w,onResize:p},constraints:{collapsedSize:t,collapsible:r,defaultSize:i,maxSize:a,minSize:s},id:G,idIsFromProps:l!==void 0,order:u});f.useRef({didLogMissingDefaultSizeWarning:!1}),ne(()=>{const{callbacks:_,constraints:H}=M.current,B={...H};M.current.id=G,M.current.idIsFromProps=l!==void 0,M.current.order=u,_.onCollapse=h,_.onExpand=w,_.onResize=p,H.collapsedSize=t,H.collapsible=r,H.defaultSize=i,H.maxSize=a,H.minSize=s,(B.collapsedSize!==H.collapsedSize||B.collapsible!==H.collapsible||B.maxSize!==H.maxSize||B.minSize!==H.minSize)&&P(M.current,B)}),ne(()=>{const _=M.current;return F(_),()=>{W(_)}},[u,G,F,W]),f.useImperativeHandle(o,()=>({collapse:()=>{S(M.current)},expand:_=>{L(M.current,_)},getId(){return G},getSize(){return N(M.current)},isCollapsed(){return R(M.current)},isExpanded(){return!R(M.current)},resize:_=>{q(M.current,_)}}),[S,L,N,R,G,q]);const Y=D(M.current,i);return f.createElement(z,{...C,children:n,className:e,id:G,style:{...Y,...v},[A.groupId]:V,[A.panel]:"",[A.panelCollapsible]:r||void 0,[A.panelId]:G,[A.panelSize]:parseFloat(""+Y.flexGrow).toFixed(1)})}const en=f.forwardRef((n,e)=>f.createElement(Qe,{...n,forwardedRef:e}));Qe.displayName="Panel";en.displayName="forwardRef(Panel)";let De=null,Se=-1,J=null;function Cn(n,e){if(e){const t=(e&ln)!==0,r=(e&an)!==0,i=(e&sn)!==0,o=(e&un)!==0;if(t)return i?"se-resize":o?"ne-resize":"e-resize";if(r)return i?"sw-resize":o?"nw-resize":"w-resize";if(i)return"s-resize";if(o)return"n-resize"}switch(n){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function In(){J!==null&&(document.head.removeChild(J),De=null,J=null,Se=-1)}function ke(n,e){var t,r;const i=Cn(n,e);if(De!==i){if(De=i,J===null&&(J=document.createElement("style"),document.head.appendChild(J)),Se>=0){var o;(o=J.sheet)===null||o===void 0||o.removeRule(Se)}Se=(t=(r=J.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${i} !important;}`))!==null&&t!==void 0?t:-1}}function nn(n){return n.type==="keydown"}function tn(n){return n.type.startsWith("pointer")}function rn(n){return n.type.startsWith("mouse")}function Ce(n){if(tn(n)){if(n.isPrimary)return{x:n.clientX,y:n.clientY}}else if(rn(n))return{x:n.clientX,y:n.clientY};return{x:1/0,y:1/0}}function Rn(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Ln(n,e,t){return n.x<e.x+e.width&&n.x+n.width>e.x&&n.y<e.y+e.height&&n.y+n.height>e.y}function kn(n,e){if(n===e)throw new Error("Cannot compare node with itself");const t={a:Ve(n),b:Ve(e)};let r;for(;t.a.at(-1)===t.b.at(-1);)n=t.a.pop(),e=t.b.pop(),r=n;x(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:Ue(Ke(t.a)),b:Ue(Ke(t.b))};if(i.a===i.b){const o=r.childNodes,l={a:t.a.at(-1),b:t.b.at(-1)};let a=o.length;for(;a--;){const s=o[a];if(s===l.a)return 1;if(s===l.b)return-1}}return Math.sign(i.a-i.b)}const An=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Mn(n){var e;const t=getComputedStyle((e=on(n))!==null&&e!==void 0?e:n).display;return t==="flex"||t==="inline-flex"}function Nn(n){const e=getComputedStyle(n);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||Mn(n))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||An.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function Ke(n){let e=n.length;for(;e--;){const t=n[e];if(x(t,"Missing node"),Nn(t))return t}return null}function Ue(n){return n&&Number(getComputedStyle(n).zIndex)||0}function Ve(n){const e=[];for(;n;)e.push(n),n=on(n);return e}function on(n){const{parentNode:e}=n;return e&&e instanceof ShadowRoot?e.host:e}const ln=1,an=2,sn=4,un=8,$n=Rn()==="coarse";let U=[],ae=!1,ee=new Map,Ie=new Map;const ze=new Set;function Dn(n,e,t,r,i){var o;const{ownerDocument:l}=e,a={direction:t,element:e,hitAreaMargins:r,setResizeHandlerState:i},s=(o=ee.get(l))!==null&&o!==void 0?o:0;return ee.set(l,s+1),ze.add(a),Pe(),function(){var w;Ie.delete(n),ze.delete(a);const p=(w=ee.get(l))!==null&&w!==void 0?w:1;if(ee.set(l,p-1),Pe(),p===1&&ee.delete(l),U.includes(a)){const u=U.indexOf(a);u>=0&&U.splice(u,1),Te(),i("up",!0,null)}}}function Hn(n){const{target:e}=n,{x:t,y:r}=Ce(n);ae=!0,Be({target:e,x:t,y:r}),Pe(),U.length>0&&(we("down",n),n.preventDefault(),cn(e)||n.stopImmediatePropagation())}function Ae(n){const{x:e,y:t}=Ce(n);if(ae&&n.buttons===0&&(ae=!1,we("up",n)),!ae){const{target:r}=n;Be({target:r,x:e,y:t})}we("move",n),Te(),U.length>0&&n.preventDefault()}function Me(n){const{target:e}=n,{x:t,y:r}=Ce(n);Ie.clear(),ae=!1,U.length>0&&(n.preventDefault(),cn(e)||n.stopImmediatePropagation()),we("up",n),Be({target:e,x:t,y:r}),Te(),Pe()}function cn(n){let e=n;for(;e;){if(e.hasAttribute(A.resizeHandle))return!0;e=e.parentElement}return!1}function Be({target:n,x:e,y:t}){U.splice(0);let r=null;(n instanceof HTMLElement||n instanceof SVGElement)&&(r=n),ze.forEach(i=>{const{element:o,hitAreaMargins:l}=i,a=o.getBoundingClientRect(),{bottom:s,left:h,right:w,top:p}=a,u=$n?l.coarse:l.fine;if(e>=h-u&&e<=w+u&&t>=p-u&&t<=s+u){if(r!==null&&document.contains(r)&&o!==r&&!o.contains(r)&&!r.contains(o)&&kn(r,o)>0){let z=r,C=!1;for(;z&&!z.contains(o);){if(Ln(z.getBoundingClientRect(),a)){C=!0;break}z=z.parentElement}if(C)return}U.push(i)}})}function Ne(n,e){Ie.set(n,e)}function Te(){let n=!1,e=!1;U.forEach(r=>{const{direction:i}=r;i==="horizontal"?n=!0:e=!0});let t=0;Ie.forEach(r=>{t|=r}),n&&e?ke("intersection",t):n?ke("horizontal",t):e?ke("vertical",t):In()}let $e=new AbortController;function Pe(){$e.abort(),$e=new AbortController;const n={capture:!0,signal:$e.signal};ze.size&&(ae?(U.length>0&&ee.forEach((e,t)=>{const{body:r}=t;e>0&&(r.addEventListener("contextmenu",Me,n),r.addEventListener("pointerleave",Ae,n),r.addEventListener("pointermove",Ae,n))}),window.addEventListener("pointerup",Me,n),window.addEventListener("pointercancel",Me,n)):ee.forEach((e,t)=>{const{body:r}=t;e>0&&(r.addEventListener("pointerdown",Hn,n),r.addEventListener("pointermove",Ae,n))}))}function we(n,e){ze.forEach(t=>{const{setResizeHandlerState:r}=t,i=U.includes(t);r(n,i,e)})}function _n(){const[n,e]=f.useState(0);return f.useCallback(()=>e(t=>t+1),[])}function x(n,e){if(!n)throw console.error(e),Error(e)}function te(n,e,t=_e){return n.toFixed(t)===e.toFixed(t)?0:n>e?1:-1}function X(n,e,t=_e){return te(n,e,t)===0}function j(n,e,t){return te(n,e,t)===0}function Gn(n,e,t){if(n.length!==e.length)return!1;for(let r=0;r<n.length;r++){const i=n[r],o=e[r];if(!j(i,o,t))return!1}return!0}function le({panelConstraints:n,panelIndex:e,size:t}){const r=n[e];x(r!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:i=0,collapsible:o,maxSize:l=100,minSize:a=0}=r;if(te(t,a)<0)if(o){const s=(i+a)/2;te(t,s)<0?t=i:t=a}else t=a;return t=Math.min(l,t),t=parseFloat(t.toFixed(_e)),t}function ge({delta:n,initialLayout:e,panelConstraints:t,pivotIndices:r,prevLayout:i,trigger:o}){if(j(n,0))return e;const l=[...e],[a,s]=r;x(a!=null,"Invalid first pivot index"),x(s!=null,"Invalid second pivot index");let h=0;if(o==="keyboard"){{const p=n<0?s:a,u=t[p];x(u,`Panel constraints not found for index ${p}`);const{collapsedSize:v=0,collapsible:z,minSize:C=0}=u;if(z){const E=e[p];if(x(E!=null,`Previous layout not found for panel index ${p}`),j(E,v)){const S=C-E;te(S,Math.abs(n))>0&&(n=n<0?0-S:S)}}}{const p=n<0?a:s,u=t[p];x(u,`No panel constraints found for index ${p}`);const{collapsedSize:v=0,collapsible:z,minSize:C=0}=u;if(z){const E=e[p];if(x(E!=null,`Previous layout not found for panel index ${p}`),j(E,C)){const S=E-v;te(S,Math.abs(n))>0&&(n=n<0?0-S:S)}}}}{const p=n<0?1:-1;let u=n<0?s:a,v=0;for(;;){const C=e[u];x(C!=null,`Previous layout not found for panel index ${u}`);const S=le({panelConstraints:t,panelIndex:u,size:100})-C;if(v+=S,u+=p,u<0||u>=t.length)break}const z=Math.min(Math.abs(n),Math.abs(v));n=n<0?0-z:z}{let u=n<0?a:s;for(;u>=0&&u<t.length;){const v=Math.abs(n)-Math.abs(h),z=e[u];x(z!=null,`Previous layout not found for panel index ${u}`);const C=z-v,E=le({panelConstraints:t,panelIndex:u,size:C});if(!j(z,E)&&(h+=z-E,l[u]=E,h.toPrecision(3).localeCompare(Math.abs(n).toPrecision(3),void 0,{numeric:!0})>=0))break;n<0?u--:u++}}if(Gn(i,l))return i;{const p=n<0?s:a,u=e[p];x(u!=null,`Previous layout not found for panel index ${p}`);const v=u+h,z=le({panelConstraints:t,panelIndex:p,size:v});if(l[p]=z,!j(z,v)){let C=v-z,S=n<0?s:a;for(;S>=0&&S<t.length;){const L=l[S];x(L!=null,`Previous layout not found for panel index ${S}`);const N=L+C,D=le({panelConstraints:t,panelIndex:S,size:N});if(j(L,D)||(C-=D-L,l[S]=D),j(C,0))break;n>0?S--:S++}}}const w=l.reduce((p,u)=>u+p,0);return j(w,100)?l:i}function Bn({layout:n,panelsArray:e,pivotIndices:t}){let r=0,i=100,o=0,l=0;const a=t[0];x(a!=null,"No pivot index found"),e.forEach((p,u)=>{const{constraints:v}=p,{maxSize:z=100,minSize:C=0}=v;u===a?(r=C,i=z):(o+=C,l+=z)});const s=Math.min(i,100-o),h=Math.max(r,100-l),w=n[a];return{valueMax:s,valueMin:h,valueNow:w}}function ye(n,e=document){return Array.from(e.querySelectorAll(`[${A.resizeHandleId}][data-panel-group-id="${n}"]`))}function fn(n,e,t=document){const i=ye(n,t).findIndex(o=>o.getAttribute(A.resizeHandleId)===e);return i??null}function dn(n,e,t){const r=fn(n,e,t);return r!=null?[r,r+1]:[-1,-1]}function pn(n,e=document){var t;if(e instanceof HTMLElement&&(e==null||(t=e.dataset)===null||t===void 0?void 0:t.panelGroupId)==n)return e;const r=e.querySelector(`[data-panel-group][data-panel-group-id="${n}"]`);return r||null}function Re(n,e=document){const t=e.querySelector(`[${A.resizeHandleId}="${n}"]`);return t||null}function Tn(n,e,t,r=document){var i,o,l,a;const s=Re(e,r),h=ye(n,r),w=s?h.indexOf(s):-1,p=(i=(o=t[w])===null||o===void 0?void 0:o.id)!==null&&i!==void 0?i:null,u=(l=(a=t[w+1])===null||a===void 0?void 0:a.id)!==null&&l!==void 0?l:null;return[p,u]}function Wn({committedValuesRef:n,eagerValuesRef:e,groupId:t,layout:r,panelDataArray:i,panelGroupElement:o,setLayout:l}){f.useRef({didWarnAboutMissingResizeHandle:!1}),ne(()=>{if(!o)return;const a=ye(t,o);for(let s=0;s<i.length-1;s++){const{valueMax:h,valueMin:w,valueNow:p}=Bn({layout:r,panelsArray:i,pivotIndices:[s,s+1]}),u=a[s];if(u!=null){const v=i[s];x(v,`No panel data found for index "${s}"`),u.setAttribute("aria-controls",v.id),u.setAttribute("aria-valuemax",""+Math.round(h)),u.setAttribute("aria-valuemin",""+Math.round(w)),u.setAttribute("aria-valuenow",p!=null?""+Math.round(p):"")}}return()=>{a.forEach((s,h)=>{s.removeAttribute("aria-controls"),s.removeAttribute("aria-valuemax"),s.removeAttribute("aria-valuemin"),s.removeAttribute("aria-valuenow")})}},[t,r,i,o]),f.useEffect(()=>{if(!o)return;const a=e.current;x(a,"Eager values not found");const{panelDataArray:s}=a,h=pn(t,o);x(h!=null,`No group found for id "${t}"`);const w=ye(t,o);x(w,`No resize handles found for group id "${t}"`);const p=w.map(u=>{const v=u.getAttribute(A.resizeHandleId);x(v,"Resize handle element has no handle id attribute");const[z,C]=Tn(t,v,s,o);if(z==null||C==null)return()=>{};const E=S=>{if(!S.defaultPrevented)switch(S.key){case"Enter":{S.preventDefault();const L=s.findIndex(N=>N.id===z);if(L>=0){const N=s[L];x(N,`No panel data found for index ${L}`);const D=r[L],{collapsedSize:V=0,collapsible:R,minSize:P=0}=N.constraints;if(D!=null&&R){const F=ge({delta:j(D,V)?P-V:V-D,initialLayout:r,panelConstraints:s.map(q=>q.constraints),pivotIndices:dn(t,v,o),prevLayout:r,trigger:"keyboard"});r!==F&&l(F)}}break}}};return u.addEventListener("keydown",E),()=>{u.removeEventListener("keydown",E)}});return()=>{p.forEach(u=>u())}},[o,n,e,t,r,i,l])}function Ze(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function gn(n,e){const t=n==="horizontal",{x:r,y:i}=Ce(e);return t?r:i}function jn(n,e,t,r,i){const o=t==="horizontal",l=Re(e,i);x(l,`No resize handle element found for id "${e}"`);const a=l.getAttribute(A.groupId);x(a,"Resize handle element has no group id attribute");let{initialCursorPosition:s}=r;const h=gn(t,n),w=pn(a,i);x(w,`No group element found for id "${a}"`);const p=w.getBoundingClientRect(),u=o?p.width:p.height;return(h-s)/u*100}function Fn(n,e,t,r,i,o){if(nn(n)){const l=t==="horizontal";let a=0;n.shiftKey?a=100:i!=null?a=i:a=10;let s=0;switch(n.key){case"ArrowDown":s=l?0:a;break;case"ArrowLeft":s=l?-a:0;break;case"ArrowRight":s=l?a:0;break;case"ArrowUp":s=l?0:-a;break;case"End":s=100;break;case"Home":s=-100;break}return s}else return r==null?0:jn(n,e,t,r,o)}function Kn({panelDataArray:n}){const e=Array(n.length),t=n.map(o=>o.constraints);let r=0,i=100;for(let o=0;o<n.length;o++){const l=t[o];x(l,`Panel constraints not found for index ${o}`);const{defaultSize:a}=l;a!=null&&(r++,e[o]=a,i-=a)}for(let o=0;o<n.length;o++){const l=t[o];x(l,`Panel constraints not found for index ${o}`);const{defaultSize:a}=l;if(a!=null)continue;const s=n.length-r,h=i/s;r++,e[o]=h,i-=h}return e}function oe(n,e,t){e.forEach((r,i)=>{const o=n[i];x(o,`Panel data not found for index ${i}`);const{callbacks:l,constraints:a,id:s}=o,{collapsedSize:h=0,collapsible:w}=a,p=t[s];if(p==null||r!==p){t[s]=r;const{onCollapse:u,onExpand:v,onResize:z}=l;z&&z(r,p),w&&(u||v)&&(v&&(p==null||X(p,h))&&!X(r,h)&&v(),u&&(p==null||!X(p,h))&&X(r,h)&&u())}})}function be(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t])return!1;return!0}function Un({defaultSize:n,dragState:e,layout:t,panelData:r,panelIndex:i,precision:o=3}){const l=t[i];let a;return l==null?a=n!=null?n.toPrecision(o):"1":r.length===1?a="1":a=l.toPrecision(o),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function Vn(n,e=10){let t=null;return(...i)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{n(...i)},e)}}function Oe(n){try{if(typeof localStorage<"u")n.getItem=e=>localStorage.getItem(e),n.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),n.getItem=()=>null,n.setItem=()=>{}}}function mn(n){return`react-resizable-panels:${n}`}function hn(n){return n.map(e=>{const{constraints:t,id:r,idIsFromProps:i,order:o}=e;return i?r:o?`${o}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(",")}function zn(n,e){try{const t=mn(n),r=e.getItem(t);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function Zn(n,e,t){var r,i;const o=(r=zn(n,t))!==null&&r!==void 0?r:{},l=hn(e);return(i=o[l])!==null&&i!==void 0?i:null}function On(n,e,t,r,i){var o;const l=mn(n),a=hn(e),s=(o=zn(n,i))!==null&&o!==void 0?o:{};s[a]={expandToSizes:Object.fromEntries(t.entries()),layout:r};try{i.setItem(l,JSON.stringify(s))}catch(h){console.error(h)}}function qe({layout:n,panelConstraints:e}){const t=[...n],r=t.reduce((o,l)=>o+l,0);if(t.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${t.map(o=>`${o}%`).join(", ")}`);if(!j(r,100)&&t.length>0)for(let o=0;o<e.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const a=100/r*l;t[o]=a}let i=0;for(let o=0;o<e.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const a=le({panelConstraints:e,panelIndex:o,size:l});l!=a&&(i+=l-a,t[o]=a)}if(!j(i,0))for(let o=0;o<e.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const a=l+i,s=le({panelConstraints:e,panelIndex:o,size:a});if(l!==s&&(i-=s-l,t[o]=s,j(i,0)))break}return t}const qn=100,me={getItem:n=>(Oe(me),me.getItem(n)),setItem:(n,e)=>{Oe(me),me.setItem(n,e)}},Xe={};function yn({autoSaveId:n=null,children:e,className:t="",direction:r,forwardedRef:i,id:o=null,onLayout:l=null,keyboardResizeBy:a=null,storage:s=me,style:h,tagName:w="div",...p}){const u=Ge(o),v=f.useRef(null),[z,C]=f.useState(null),[E,S]=f.useState([]),L=_n(),N=f.useRef({}),D=f.useRef(new Map),V=f.useRef(0),R=f.useRef({autoSaveId:n,direction:r,dragState:z,id:u,keyboardResizeBy:a,onLayout:l,storage:s}),P=f.useRef({layout:E,panelDataArray:[],panelDataArrayChanged:!1});f.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),f.useImperativeHandle(i,()=>({getId:()=>R.current.id,getLayout:()=>{const{layout:c}=P.current;return c},setLayout:c=>{const{onLayout:m}=R.current,{layout:b,panelDataArray:g}=P.current,d=qe({layout:c,panelConstraints:g.map(y=>y.constraints)});Ze(b,d)||(S(d),P.current.layout=d,m&&m(d),oe(g,d,N.current))}}),[]),ne(()=>{R.current.autoSaveId=n,R.current.direction=r,R.current.dragState=z,R.current.id=u,R.current.onLayout=l,R.current.storage=s}),Wn({committedValuesRef:R,eagerValuesRef:P,groupId:u,layout:E,panelDataArray:P.current.panelDataArray,setLayout:S,panelGroupElement:v.current}),f.useEffect(()=>{const{panelDataArray:c}=P.current;if(n){if(E.length===0||E.length!==c.length)return;let m=Xe[n];m==null&&(m=Vn(On,qn),Xe[n]=m);const b=[...c],g=new Map(D.current);m(n,b,g,E,s)}},[n,E,s]),f.useEffect(()=>{});const F=f.useCallback(c=>{const{onLayout:m}=R.current,{layout:b,panelDataArray:g}=P.current;if(c.constraints.collapsible){const d=g.map(Z=>Z.constraints),{collapsedSize:y=0,panelSize:I,pivotIndices:$}=Q(g,c,b);if(x(I!=null,`Panel size not found for panel "${c.id}"`),!X(I,y)){D.current.set(c.id,I);const O=ie(g,c)===g.length-1?I-y:y-I,k=ge({delta:O,initialLayout:b,panelConstraints:d,pivotIndices:$,prevLayout:b,trigger:"imperative-api"});be(b,k)||(S(k),P.current.layout=k,m&&m(k),oe(g,k,N.current))}}},[]),q=f.useCallback((c,m)=>{const{onLayout:b}=R.current,{layout:g,panelDataArray:d}=P.current;if(c.constraints.collapsible){const y=d.map(K=>K.constraints),{collapsedSize:I=0,panelSize:$=0,minSize:Z=0,pivotIndices:O}=Q(d,c,g),k=m??Z;if(X($,I)){const K=D.current.get(c.id),de=K!=null&&K>=k?K:k,Le=ie(d,c)===d.length-1?$-de:de-$,T=ge({delta:Le,initialLayout:g,panelConstraints:y,pivotIndices:O,prevLayout:g,trigger:"imperative-api"});be(g,T)||(S(T),P.current.layout=T,b&&b(T),oe(d,T,N.current))}}},[]),W=f.useCallback(c=>{const{layout:m,panelDataArray:b}=P.current,{panelSize:g}=Q(b,c,m);return x(g!=null,`Panel size not found for panel "${c.id}"`),g},[]),G=f.useCallback((c,m)=>{const{panelDataArray:b}=P.current,g=ie(b,c);return Un({defaultSize:m,dragState:z,layout:E,panelData:b,panelIndex:g})},[z,E]),M=f.useCallback(c=>{const{layout:m,panelDataArray:b}=P.current,{collapsedSize:g=0,collapsible:d,panelSize:y}=Q(b,c,m);return x(y!=null,`Panel size not found for panel "${c.id}"`),d===!0&&X(y,g)},[]),Y=f.useCallback(c=>{const{layout:m,panelDataArray:b}=P.current,{collapsedSize:g=0,collapsible:d,panelSize:y}=Q(b,c,m);return x(y!=null,`Panel size not found for panel "${c.id}"`),!d||te(y,g)>0},[]),_=f.useCallback(c=>{const{panelDataArray:m}=P.current;m.push(c),m.sort((b,g)=>{const d=b.order,y=g.order;return d==null&&y==null?0:d==null?-1:y==null?1:d-y}),P.current.panelDataArrayChanged=!0,L()},[L]);ne(()=>{if(P.current.panelDataArrayChanged){P.current.panelDataArrayChanged=!1;const{autoSaveId:c,onLayout:m,storage:b}=R.current,{layout:g,panelDataArray:d}=P.current;let y=null;if(c){const $=Zn(c,d,b);$&&(D.current=new Map(Object.entries($.expandToSizes)),y=$.layout)}y==null&&(y=Kn({panelDataArray:d}));const I=qe({layout:y,panelConstraints:d.map($=>$.constraints)});Ze(g,I)||(S(I),P.current.layout=I,m&&m(I),oe(d,I,N.current))}}),ne(()=>{const c=P.current;return()=>{c.layout=[]}},[]);const H=f.useCallback(c=>{let m=!1;const b=v.current;return b&&window.getComputedStyle(b,null).getPropertyValue("direction")==="rtl"&&(m=!0),function(d){d.preventDefault();const y=v.current;if(!y)return()=>null;const{direction:I,dragState:$,id:Z,keyboardResizeBy:O,onLayout:k}=R.current,{layout:K,panelDataArray:de}=P.current,{initialLayout:ve}=$??{},Le=dn(Z,c,y);let T=Fn(d,c,I,$,O,y);const We=I==="horizontal";We&&m&&(T=-T);const bn=de.map(Sn=>Sn.constraints),pe=ge({delta:T,initialLayout:ve??K,panelConstraints:bn,pivotIndices:Le,prevLayout:K,trigger:nn(d)?"keyboard":"mouse-or-touch"}),je=!be(K,pe);(tn(d)||rn(d))&&V.current!=T&&(V.current=T,!je&&T!==0?We?Ne(c,T<0?ln:an):Ne(c,T<0?sn:un):Ne(c,0)),je&&(S(pe),P.current.layout=pe,k&&k(pe),oe(de,pe,N.current))}},[]),B=f.useCallback((c,m)=>{const{onLayout:b}=R.current,{layout:g,panelDataArray:d}=P.current,y=d.map(K=>K.constraints),{panelSize:I,pivotIndices:$}=Q(d,c,g);x(I!=null,`Panel size not found for panel "${c.id}"`);const O=ie(d,c)===d.length-1?I-m:m-I,k=ge({delta:O,initialLayout:g,panelConstraints:y,pivotIndices:$,prevLayout:g,trigger:"imperative-api"});be(g,k)||(S(k),P.current.layout=k,b&&b(k),oe(d,k,N.current))},[]),se=f.useCallback((c,m)=>{const{layout:b,panelDataArray:g}=P.current,{collapsedSize:d=0,collapsible:y}=m,{collapsedSize:I=0,collapsible:$,maxSize:Z=100,minSize:O=0}=c.constraints,{panelSize:k}=Q(g,c,b);k!=null&&(y&&$&&X(k,d)?X(d,I)||B(c,I):k<O?B(c,O):k>Z&&B(c,Z))},[B]),ue=f.useCallback((c,m)=>{const{direction:b}=R.current,{layout:g}=P.current;if(!v.current)return;const d=Re(c,v.current);x(d,`Drag handle element not found for id "${c}"`);const y=gn(b,m);C({dragHandleId:c,dragHandleRect:d.getBoundingClientRect(),initialCursorPosition:y,initialLayout:g})},[]),ce=f.useCallback(()=>{C(null)},[]),xe=f.useCallback(c=>{const{panelDataArray:m}=P.current,b=ie(m,c);b>=0&&(m.splice(b,1),delete N.current[c.id],P.current.panelDataArrayChanged=!0,L())},[L]),re=f.useMemo(()=>({collapsePanel:F,direction:r,dragState:z,expandPanel:q,getPanelSize:W,getPanelStyle:G,groupId:u,isPanelCollapsed:M,isPanelExpanded:Y,reevaluatePanelConstraints:se,registerPanel:_,registerResizeHandle:H,resizePanel:B,startDragging:ue,stopDragging:ce,unregisterPanel:xe,panelGroupElement:v.current}),[F,z,r,q,W,G,u,M,Y,se,_,H,B,ue,ce,xe]),fe={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return f.createElement(Ee.Provider,{value:re},f.createElement(w,{...p,children:e,className:t,id:o,ref:v,style:{...fe,...h},[A.group]:"",[A.groupDirection]:r,[A.groupId]:u}))}const xn=f.forwardRef((n,e)=>f.createElement(yn,{...n,forwardedRef:e}));yn.displayName="PanelGroup";xn.displayName="forwardRef(PanelGroup)";function ie(n,e){return n.findIndex(t=>t===e||t.id===e.id)}function Q(n,e,t){const r=ie(n,e),o=r===n.length-1?[r-1,r]:[r,r+1],l=t[r];return{...e.constraints,panelSize:l,pivotIndices:o}}function Xn({disabled:n,handleId:e,resizeHandler:t,panelGroupElement:r}){f.useEffect(()=>{if(n||t==null||r==null)return;const i=Re(e,r);if(i==null)return;const o=l=>{if(!l.defaultPrevented)switch(l.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{l.preventDefault(),t(l);break}case"F6":{l.preventDefault();const a=i.getAttribute(A.groupId);x(a,`No group element found for id "${a}"`);const s=ye(a,r),h=fn(a,e,r);x(h!==null,`No resize element found for id "${e}"`);const w=l.shiftKey?h>0?h-1:s.length-1:h+1<s.length?h+1:0;s[w].focus();break}}};return i.addEventListener("keydown",o),()=>{i.removeEventListener("keydown",o)}},[r,n,e,t])}function vn({children:n=null,className:e="",disabled:t=!1,hitAreaMargins:r,id:i,onBlur:o,onClick:l,onDragging:a,onFocus:s,onPointerDown:h,onPointerUp:w,style:p={},tabIndex:u=0,tagName:v="div",...z}){var C,E;const S=f.useRef(null),L=f.useRef({onClick:l,onDragging:a,onPointerDown:h,onPointerUp:w});f.useEffect(()=>{L.current.onClick=l,L.current.onDragging=a,L.current.onPointerDown=h,L.current.onPointerUp=w});const N=f.useContext(Ee);if(N===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:D,groupId:V,registerResizeHandle:R,startDragging:P,stopDragging:F,panelGroupElement:q}=N,W=Ge(i),[G,M]=f.useState("inactive"),[Y,_]=f.useState(!1),[H,B]=f.useState(null),se=f.useRef({state:G});ne(()=>{se.current.state=G}),f.useEffect(()=>{if(t)B(null);else{const re=R(W);B(()=>re)}},[t,W,R]);const ue=(C=r?.coarse)!==null&&C!==void 0?C:15,ce=(E=r?.fine)!==null&&E!==void 0?E:5;f.useEffect(()=>{if(t||H==null)return;const re=S.current;x(re,"Element ref not attached");let fe=!1;return Dn(W,re,D,{coarse:ue,fine:ce},(m,b,g)=>{if(!b){M("inactive");return}switch(m){case"down":{M("drag"),fe=!1,x(g,'Expected event to be defined for "down" action'),P(W,g);const{onDragging:d,onPointerDown:y}=L.current;d?.(!0),y?.();break}case"move":{const{state:d}=se.current;fe=!0,d!=="drag"&&M("hover"),x(g,'Expected event to be defined for "move" action'),H(g);break}case"up":{M("hover"),F();const{onClick:d,onDragging:y,onPointerUp:I}=L.current;y?.(!1),I?.(),fe||d?.();break}}})},[ue,D,t,ce,R,W,H,P,F]),Xn({disabled:t,handleId:W,resizeHandler:H,panelGroupElement:q});const xe={touchAction:"none",userSelect:"none"};return f.createElement(v,{...z,children:n,className:e,id:i,onBlur:()=>{_(!1),o?.()},onFocus:()=>{_(!0),s?.()},ref:S,role:"separator",style:{...xe,...p},tabIndex:u,[A.groupDirection]:D,[A.groupId]:V,[A.resizeHandle]:"",[A.resizeHandleActive]:G==="drag"?"pointer":Y?"keyboard":void 0,[A.resizeHandleEnabled]:!t,[A.resizeHandleId]:W,[A.resizeHandleState]:G})}vn.displayName="PanelResizeHandle";function Qn(n){const e=He.c(8);let t,r;e[0]!==n?({className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let i;e[3]!==t?(i=Je("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),e[3]=t,e[4]=i):i=e[4];let o;return e[5]!==r||e[6]!==i?(o=he.jsx(xn,{"data-slot":"resizable-panel-group",className:i,...r}),e[5]=r,e[6]=i,e[7]=o):o=e[7],o}function et(n){const e=He.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let r;return e[2]!==t?(r=he.jsx(en,{"data-slot":"resizable-panel",...t}),e[2]=t,e[3]=r):r=e[3],r}function nt(n){const e=He.c(12);let t,r,i;e[0]!==n?({withHandle:i,className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=i):(t=e[1],r=e[2],i=e[3]);let o;e[4]!==t?(o=Je("bg-border focus-visible:ring-ring relative flex w-[0.5px] items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),e[4]=t,e[5]=o):o=e[5];let l;e[6]!==i?(l=i&&he.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:he.jsx(Ye,{className:"size-2.5"})}),e[6]=i,e[7]=l):l=e[7];let a;return e[8]!==r||e[9]!==o||e[10]!==l?(a=he.jsx(vn,{"data-slot":"resizable-handle",className:o,...r,children:l}),e[8]=r,e[9]=o,e[10]=l,e[11]=a):a=e[11],a}export{et as R,nt as a,Qn as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as x,j as u}from"./index-CcOnUPVc.js";import{c,B as p}from"./button-Dr2OfS67.js";import{B as g}from"./badge-CMDsV8CJ.js";function j(f){const e=x.c(12),{tabs:d,activeTab:n,onTabChange:s,className:l}=f;let t;e[0]!==l?(t=c("flex items-center gap-2 overflow-x-auto no-scrollbar",l),e[0]=l,e[1]=t):t=e[1];let o;if(e[2]!==n||e[3]!==s||e[4]!==d){let i;e[6]!==n||e[7]!==s?(i=r=>{const m=n===r.id;return u.jsxs(p,{variant:"outline",size:"sm",onClick:()=>s(r.id),className:c("h-8 rounded-lg border border-transparent bg-transparent px-3 py-1 hover:bg-muted",m&&"bg-muted border-input text-foreground font-medium",!m&&"text-muted-foreground font-normal"),children:[r.label,r.count!==void 0&&u.jsx(g,{variant:"secondary",className:c("ml-2 h-5 min-w-5 px-1 rounded-full text-[10px] font-mono",m?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:r.count})]},r.id)},e[6]=n,e[7]=s,e[8]=i):i=e[8],o=d.map(i),e[2]=n,e[3]=s,e[4]=d,e[5]=o}else o=e[5];let a;return e[9]!==t||e[10]!==o?(a=u.jsx("div",{className:t,children:o}),e[9]=t,e[10]=o,e[11]=a):a=e[11],a}export{j as R};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as c,at as Pe,ad as rt,ak as _e,j as d,au as st,ae as lt,av as be,aM as at,ac as k,aw as it,af as j,ah as N,aj as $,ax as ct,a8 as Ee,aW as dt,ai as ut,ay as pt,aB as ft,az as mt,aA as ht,aC as vt,aD as gt,aE as xt,aF as St,c as ee}from"./index-CcOnUPVc.js";import{V as wt,i as yt}from"./project-context-provider-CRa6hysF.js";import{t as Re}from"./ChevronDown-CTU5QhlY.js";import{c as oe}from"./button-Dr2OfS67.js";function Ne(n,[e,t]){return Math.min(t,Math.max(e,n))}var Ct=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,bt]=at(J),[ne]=lt(J,[bt,Pe]),pe=Pe(),[Tt,G]=ne(J),[_t,Nt]=ne(J),je=n=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:r,onOpenChange:i,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:w,required:y,form:S}=n,p=pe(e),[v,C]=c.useState(null),[m,x]=c.useState(null),[F,M]=c.useState(!1),re=rt(u),[P,O]=_e({prop:o,defaultProp:r??!1,onChange:i,caller:J}),[U,q]=_e({prop:s,defaultProp:l,onChange:a,caller:J}),L=c.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=c.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(st,{...p,children:d.jsxs(Tt,{required:y,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:be(),value:U,onValueChange:q,open:P,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:w,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(_t,{scope:n.__scopeSelect,onNativeOptionAdd:c.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:c.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Qe,{"aria-hidden":!0,required:y,tabIndex:-1,name:h,autoComplete:g,value:U,onChange:E=>q(E.target.value),disabled:w,form:S,children:[U===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=J;var Me="SelectTrigger",Ae=c.forwardRef((n,e)=>{const{__scopeSelect:t,disabled:o=!1,...r}=n,i=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=c.useRef("touch"),[g,w,y]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),y()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(it,{asChild:!0,...i,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...r,ref:a,onClick:N(r.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:N(r.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:N(r.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(v&&p.key===" ")&&Ct.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=c.forwardRef((n,e)=>{const{__scopeSelect:t,className:o,style:r,children:i,placeholder:s="",...l}=n,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=i!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):i})});De.displayName=Oe;var Pt="SelectIcon",ke=c.forwardRef((n,e)=>{const{__scopeSelect:t,children:o,...r}=n;return d.jsx(j.span,{"aria-hidden":!0,...r,ref:e,children:o||"▼"})});ke.displayName=Pt;var Et="SelectPortal",Le=n=>d.jsx(ct,{asChild:!0,...n});Le.displayName=Et;var Q="SelectContent",Be=c.forwardRef((n,e)=>{const t=G(Q,n.__scopeSelect),[o,r]=c.useState();if($(()=>{r(new DocumentFragment)},[]),!t.open){const i=o;return i?Ee.createPortal(d.jsx(Ve,{scope:n.__scopeSelect,children:d.jsx(de.Slot,{scope:n.__scopeSelect,children:d.jsx("div",{children:n.children})})}),i):null}return d.jsx(He,{...n,ref:e})});Be.displayName=Q;var A=10,[Ve,Y]=ne(Q),Rt="SelectContentImpl",jt=ht("SelectContent.RemoveScroll"),He=c.forwardRef((n,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=n,m=G(Q,t),[x,F]=c.useState(null),[M,re]=c.useState(null),P=k(e,f=>F(f)),[O,U]=c.useState(null),[q,L]=c.useState(null),B=ue(t),[W,V]=c.useState(!1),H=c.useRef(!1);c.useEffect(()=>{if(x)return pt(x)},[x]),ft();const E=c.useCallback(f=>{const[T,...R]=B().map(_=>_.ref.current),[I]=R.slice(-1),b=document.activeElement;for(const _ of f)if(_===b||(_?.scrollIntoView({block:"nearest"}),_===T&&M&&(M.scrollTop=0),_===I&&M&&(M.scrollTop=M.scrollHeight),_?.focus(),document.activeElement!==b))return},[B,M]),D=c.useCallback(()=>E([O,x]),[E,O,x]);c.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;c.useEffect(()=>{if(x){let f={x:0,y:0};const T=I=>{f={x:Math.abs(Math.round(I.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(I.pageY)-(K.current?.y??0))}},R=I=>{f.x<=10&&f.y<=10?I.preventDefault():x.contains(I.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),c.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(b=>!b.disabled),R=T.find(b=>b.ref.current===document.activeElement),I=ot(T,f,R);I&&setTimeout(()=>I.ref.current.focus())}),me=c.useCallback((f,T,R)=>{const I=!H.current&&!R;(m.value!==void 0&&m.value===T||I)&&(U(f),I&&(H.current=!0))},[m.value]),he=c.useCallback(()=>x?.focus(),[x]),te=c.useCallback((f,T,R)=>{const I=!H.current&&!R;(m.value!==void 0&&m.value===T||I)&&L(f)},[m.value]),ie=o==="popper"?Se:ze,se=ie===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(mt,{as:jt,allowPinchZoom:!0,children:d.jsx(vt,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:N(r,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(gt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ie,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:N(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let I=B().filter(b=>!b.disabled).map(b=>b.ref.current);if(["ArrowUp","End"].includes(f.key)&&(I=I.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const b=f.target,_=I.indexOf(b);I=I.slice(_+1)}setTimeout(()=>E(I)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=c.forwardRef((n,e)=>{const{__scopeSelect:t,onPlaced:o,...r}=n,i=G(Q,t),s=Y(Q,t),[l,a]=c.useState(null),[u,h]=c.useState(null),g=k(e,P=>h(P)),w=ue(t),y=c.useRef(!1),S=c.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=c.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&p&&v&&C){const P=i.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=i.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(i.dir!=="rtl"){const b=q.left-O.left,_=U.left-b,X=P.left-_,Z=P.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(_,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const b=O.right-q.right,_=window.innerWidth-U.right-b,X=window.innerWidth-P.right-_,Z=P.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(_,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=w(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=P.top+P.height/2-A,ie=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const b=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const _=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,se+(b?he:0)+_+D),Z=T+X;l.style.height=Z+"px"}else{const b=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(b?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>y.current=!0)}},[w,i.trigger,i.valueNode,l,u,p,v,C,i.dir,o]);$(()=>x(),[x]);const[F,M]=c.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=c.useCallback(P=>{P&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:d.jsx(j.div,{...r,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=c.forwardRef((n,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:r=A,...i}=n,s=pe(t);return d.jsx(xt,{...s,...i,ref:e,align:o,collisionPadding:r,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(Q,{}),we="SelectViewport",Fe=c.forwardRef((n,e)=>{const{__scopeSelect:t,nonce:o,...r}=n,i=Y(we,t),s=Te(we,t),l=k(e,i.onViewportChange),a=c.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:N(r.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:w}=s;if(w?.current&&g){const y=Math.abs(a.current-h.scrollTop);if(y>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+y,x=Math.min(S,m),F=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=F>0?F:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Fe.displayName=we;var Ue="SelectGroup",[Dt,kt]=ne(Ue),Lt=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n,r=be();return d.jsx(Dt,{scope:t,id:r,children:d.jsx(j.div,{role:"group","aria-labelledby":r,...o,ref:e})})});Lt.displayName=Ue;var We="SelectLabel",Bt=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n,r=kt(We,t);return d.jsx(j.div,{id:r.id,...o,ref:e})});Bt.displayName=We;var ce="SelectItem",[Vt,Ke]=ne(ce),$e=c.forwardRef((n,e)=>{const{__scopeSelect:t,value:o,disabled:r=!1,textValue:i,...s}=n,l=G(ce,t),a=Y(ce,t),u=l.value===o,[h,g]=c.useState(i??""),[w,y]=c.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,r)),p=be(),v=c.useRef("touch"),C=()=>{r||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:r,textId:p,isSelected:u,onItemTextChange:c.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:r,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...s,ref:S,onFocus:N(s.onFocus,()=>y(!0)),onBlur:N(s.onBlur,()=>y(!1)),onClick:N(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:N(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:N(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:N(s.onPointerMove,m=>{v.current=m.pointerType,r?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ce;var le="SelectItemText",Ge=c.forwardRef((n,e)=>{const{__scopeSelect:t,className:o,style:r,...i}=n,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=Nt(le,t),[h,g]=c.useState(null),w=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),y=h?.textContent,S=c.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:y},a.value),[a.disabled,a.value,y]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...i,ref:w}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ee.createPortal(i.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var ye="SelectScrollUpButton",Xe=c.forwardRef((n,e)=>{const t=Y(ye,n.__scopeSelect),o=Te(ye,n.__scopeSelect),[r,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;i(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),r?d.jsx(Je,{...n,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=ye;var Ce="SelectScrollDownButton",Ze=c.forwardRef((n,e)=>{const t=Y(Ce,n.__scopeSelect),o=Te(Ce,n.__scopeSelect),[r,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;i(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),r?d.jsx(Je,{...n,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=Ce;var Je=c.forwardRef((n,e)=>{const{__scopeSelect:t,onAutoScroll:o,...r}=n,i=Y("SelectScrollButton",t),s=c.useRef(null),l=ue(t),a=c.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return c.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...r,ref:e,style:{flexShrink:0,...r.style},onPointerDown:N(r.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(r.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(r.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ft=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n,r=pe(t),i=G(Ie,t),s=Y(Ie,t);return i.open&&s.position==="popper"?d.jsx(St,{...r,...o,ref:e}):null});Ft.displayName=Ie;var Ut="SelectBubbleInput",Qe=c.forwardRef(({__scopeSelect:n,value:e,...t},o)=>{const r=c.useRef(null),i=k(o,r),s=dt(e);return c.useEffect(()=>{const l=r.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...wt,...t.style},ref:i,defaultValue:e})});Qe.displayName=Ut;function et(n){return n===""||n===void 0}function tt(n){const e=ut(n),t=c.useRef(""),o=c.useRef(0),r=c.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),i=c.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,r,i]}function ot(n,e,t){const r=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=t?n.indexOf(t):-1;let s=Wt(n,Math.max(i,0));r.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return a!==t?a:void 0}function Wt(n,e){return n.map((t,o)=>n[(e+o)%n.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Fe,Jt=$e,Qt=Ge,eo=qe,to=Xe,oo=Ze;const nt=({size:n=24,color:e="currentColor",...t})=>c.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},c.createElement("path",{d:"m18 15-6-6-6 6"}));nt.displayName="ChevronUp";function co(n){const e=ee.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(n){const e=ee.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(n){const e=ee.c(13);let t,o,r,i;e[0]!==n?({className:o,size:i,children:t,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=r,e[4]=i):(t=e[1],o=e[2],r=e[3],i=e[4]);const s=i===void 0?"default":i;let l;e[5]!==o?(l=oe("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]: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 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg border bg-transparent px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-10 data-[size=sm]:h-7 data-[size=xs]:h-7 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...r,children:[t,a]}),e[8]=t,e[9]=r,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function fo(n){const e=ee.c(20);let t,o,r,i;e[0]!==n?({className:o,children:t,position:i,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=r,e[4]=i):(t=e[1],o=e[2],r=e[3],i=e[4]);const s=i===void 0?"popper":i,l=s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let a;e[5]!==o||e[6]!==l?(a=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",l,o),e[5]=o,e[6]=l,e[7]=a):a=e[7];let u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=d.jsx(no,{}),e[8]=u):u=e[8];const h=s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let g;e[9]!==h?(g=oe("p-1",h),e[9]=h,e[10]=g):g=e[10];let w;e[11]!==t||e[12]!==g?(w=d.jsx(Zt,{className:g,children:t}),e[11]=t,e[12]=g,e[13]=w):w=e[13];let y;e[14]===Symbol.for("react.memo_cache_sentinel")?(y=d.jsx(ro,{}),e[14]=y):y=e[14];let S;return e[15]!==s||e[16]!==r||e[17]!==a||e[18]!==w?(S=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",className:a,position:s,...r,children:[u,w,y]})}),e[15]=s,e[16]=r,e[17]=a,e[18]=w,e[19]=S):S=e[19],S}function mo(n){const e=ee.c(16);let t,o,r,i;e[0]!==n?({className:o,children:t,hideCheck:i,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=r,e[4]=i):(t=e[1],o=e[2],r=e[3],i=e[4]);const s=i===void 0?!1:i;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(yt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Qt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==r||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Jt,{"data-slot":"select-item",className:l,...r,children:[a,u]}),e[11]=r,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(n){const e=ee.c(9);let t,o;e[0]!==n?({className:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let r;e[3]!==t?(r=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=r):r=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(nt,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==r?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:r,...o,children:i}),e[6]=o,e[7]=r,e[8]=s):s=e[8],s}function ro(n){const e=ee.c(9);let t,o;e[0]!==n?({className:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let r;e[3]!==t?(r=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=r):r=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Re,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==r?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:r,...o,children:i}),e[6]=o,e[7]=r,e[8]=s):s=e[8],s}export{co as S,po as a,uo as b,fo as c,mo as d,Ne as e};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as C,h as B,B as D,x as K,w as P,j as s,s as $,c as Q,t as N,K as U,a as H,v as R}from"./index-CcOnUPVc.js";import{C as A}from"./collection-header-Cq2y0kMK.js";import{C as V}from"./collection-page-DzdXojp0.js";import{u as W}from"./project-context-provider-CRa6hysF.js";import{u as Y,B as S}from"./button-Dr2OfS67.js";import{a as G,F as k,b as L,c as O,d as E,f as M,e as J}from"./form-BXN-QLni.js";import{I}from"./input-DBy5GvSG.js";import{i as T}from"./X-PqPoM3vz.js";import"./collection-display-button-CF5VNEyr.js";import"./dropdown-menu-DW5iGKOq.js";import"./ChevronRight-UyghVUW5.js";import"./Grid01-CJPihD4i.js";import"./view-mode-toggle-Di5d2VZX.js";const q=({size:d=24,color:e="currentColor",...a})=>C.createElement("svg",{viewBox:"0 0 24 24",width:d,height:d,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},C.createElement("path",{d:"M21 15v1.2c0 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.2V15m14-7-5-5m0 0L7 8m5-5v12"}));q.displayName="Upload01";const X=$({name:R().min(1,"Name is required").max(255,"Name is too long"),slug:R().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:R().optional()});function Z(d){const e=Q.c(24),{value:a,onChange:r,name:m}=d,o=C.useRef(null);let u;e[0]!==r?(u=z=>{const F=z.target.files?.[0];if(F){if(F.size>2097152){N.error("Image must be smaller than 2MB");return}const c=new FileReader;c.onerror=()=>{const y=c.error;console.error("FileReader error:",y),N.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;r(y)}},c.readAsDataURL(F)}},e[0]=r,e[1]=u):u=e[1];const j=u;let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{o.current?.click()},e[2]=i):i=e[2];const t=i;let l;e[3]!==r?(l=z=>{z.stopPropagation(),r("")},e[3]=r,e[4]=l):l=e[4];const n=l;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 h;e[7]!==n||e[8]!==m||e[9]!==a?(h=a?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:a,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(T,{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(q,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),e[7]=n,e[8]=m,e[9]=a,e[10]=h):h=e[10];const w=a?"Change Logo":"Upload Logo";let x;e[11]!==w?(x=s.jsx(S,{type:"button",variant:"outline",size:"sm",onClick:t,className:"mb-2",children:w}),e[11]=w,e[12]=x):x=e[12];let f;e[13]!==n||e[14]!==a?(f=a&&s.jsx(S,{type:"button",variant:"ghost",size:"sm",onClick:n,className:"ml-2",children:"Remove"}),e[13]=n,e[14]=a,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]!==x||e[18]!==f?(p=s.jsxs("div",{className:"flex-1",children:[x,f,v]}),e[17]=x,e[18]=f,e[19]=p):p=e[19];let b;return e[20]!==p||e[21]!==g||e[22]!==h?(b=s.jsxs("div",{className:"flex items-start gap-4",children:[g,h,p]}),e[20]=p,e[21]=g,e[22]=h,e[23]=b):b=e[23],b}function ue(){const d=B(),{org:e}=W(),a=D(),[r,m]=C.useState(!1),o=K({resolver:P(X),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),u=Y({mutationFn:async t=>{const l={name:t.name,slug:t.slug};t.logo&&(l.logo=t.logo);const n=await H.organization.update({organizationId:e.id,data:l});if(n?.error)throw new Error(n.error.message||"Failed to update organization");return n},onSuccess:t=>{a.invalidateQueries({queryKey:U.organizations()}),a.invalidateQueries({queryKey:U.activeOrganization(e.slug)}),N.success("Organization settings updated successfully"),t?.data?.slug&&t.data.slug!==e.slug&&d({to:"/$org/settings",params:{org:t.data.slug}})},onError:t=>{N.error(t instanceof Error?t.message:"Failed to update organization")},onSettled:()=>{m(!1)}}),j=t=>{m(!0),u.mutate(t)},i=o.formState.isDirty;return s.jsxs(V,{children:[s.jsx(A,{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(G,{...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(L,{children:[s.jsx(O,{children:"Organization Name"}),s.jsx(E,{children:s.jsx(I,{placeholder:"My Organization",...t,disabled:r})}),s.jsx(M,{})]})}),s.jsx(k,{control:o.control,name:"slug",render:({field:t})=>s.jsxs(L,{children:[s.jsx(O,{children:"Organization Slug"}),s.jsx(E,{children:s.jsx(I,{placeholder:"my-organization",...t,disabled:r,onChange:l=>{const n=l.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");t.onChange(n)}})}),s.jsx(J,{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(L,{children:[s.jsx(O,{children:"Logo"}),s.jsx(E,{children:s.jsx(Z,{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(S,{type:"submit",disabled:!i||r,className:"min-w-24",children:r?"Saving...":"Save Changes"}),i&&s.jsx(S,{type:"button",variant:"outline",onClick:()=>o.reset(),disabled:r,children:"Cancel"})]})]})})]})})})})})]})}export{ue as default};
|