@decocms/mesh 1.4.4 → 1.6.0
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-B6rEUVLf.js → AlertCircle-BIlMffS8.js} +1 -1
- package/dist/client/assets/{ArrowLeft-DC_Ebc-m.js → ArrowLeft-CJ-eKoid.js} +1 -1
- package/dist/client/assets/{ChevronDown-rNVX3ifZ.js → ChevronDown-atiP0m-F.js} +1 -1
- package/dist/client/assets/{Clock-DS2iGkSJ.js → Clock-BD2gknBV.js} +1 -1
- package/dist/client/assets/{Code01-CoFYqM8q.js → Code01-BEefaaXC.js} +1 -1
- package/dist/client/assets/{Copy01-CCVZH6f1.js → Copy01-DhXqtugg.js} +1 -1
- package/dist/client/assets/{CpuChip02-DwHhz9CA.js → CpuChip02-BtgBI59l.js} +1 -1
- package/dist/client/assets/{DotsVertical-8kkJJG9R.js → DotsVertical-roys0n6e.js} +1 -1
- package/dist/client/assets/{File06-DxUGl7Wc.js → File06-MlW8n69V.js} +1 -1
- package/dist/client/assets/{FlipBackward-D9qJVjU9.js → FlipBackward-BSnTMMYy.js} +1 -1
- package/dist/client/assets/{GitBranch01-DLNdjhEu.js → GitBranch01-CEvRlFly.js} +1 -1
- package/dist/client/assets/{Grid01-BTunGha4.js → Grid01-CkwdbRed.js} +1 -1
- package/dist/client/assets/{Inbox01-BoV8p7IN.js → Inbox01-D66dNA_K.js} +1 -1
- package/dist/client/assets/{Key01-Bqzm5f6K.js → Key01-BXlD7hmS.js} +1 -1
- package/dist/client/assets/{LinkExternal01-WcFL8RpQ.js → LinkExternal01-O4xnNCff.js} +1 -1
- package/dist/client/assets/{Loading01-B0vdyVbH.js → Loading01-EiDV-2FW.js} +1 -1
- package/dist/client/assets/{Lock01-B0PVK-yI.js → Lock01-DpRDCI3P.js} +1 -1
- package/dist/client/assets/{Play-KfJ8X6ky.js → Play-FKw7EqPO.js} +1 -1
- package/dist/client/assets/{Plus-nu8-Nz8b.js → Plus-CwB-Rc8B.js} +1 -1
- package/dist/client/assets/{SearchMd-BFumDfkS.js → SearchMd-C6P9P1wF.js} +1 -1
- package/dist/client/assets/{Terminal-CDIp_seB.js → Terminal-Dv6w41J8.js} +1 -1
- package/dist/client/assets/{Trash01-1tKgR7uh.js → Trash01-Ctk7srex.js} +1 -1
- package/dist/client/assets/{X-hEo9Za23.js → X-Da4xsL05.js} +1 -1
- package/dist/client/assets/{XClose-BIthQxae.js → XClose-OUZ04LEo.js} +1 -1
- package/dist/client/assets/{alert-dialog-_VCwcCen.js → alert-dialog-D6UjYOUP.js} +1 -1
- package/dist/client/assets/{auth-BpfHzPVh.js → auth-CZR9mNdb.js} +1 -1
- package/dist/client/assets/{auth-catchall-D-D94naG.js → auth-catchall-BZWl_BRK.js} +1 -1
- package/dist/client/assets/{avatar-DHKqC-IM.js → avatar-BHE7lL4M.js} +1 -1
- package/dist/client/assets/{badge-Dkhmn9Qj.js → badge-B-u7R38I.js} +1 -1
- package/dist/client/assets/{button-BSXU4L7C.js → button-B13xcF6W.js} +1 -1
- package/dist/client/assets/{card-CXFRieEW.js → card-7VW-xSd-.js} +1 -1
- package/dist/client/assets/{checkbox-C-t_-9ku.js → checkbox-BMd2Z-WT.js} +1 -1
- package/dist/client/assets/{collection-detail-P20CfY5q.js → collection-detail-7eGCexqR.js} +3 -3
- package/dist/client/assets/{collection-display-button-BAoFTB4b.js → collection-display-button-D4VM0KQx.js} +1 -1
- package/dist/client/assets/{collection-header-B--7sWbR.js → collection-header-od14k6u3.js} +1 -1
- package/dist/client/assets/{collection-page-B71dz4fa.js → collection-page-BNuNM--s.js} +1 -1
- package/dist/client/assets/{collection-search-CrC01K4Z.js → collection-search-LnYLnFH8.js} +1 -1
- package/dist/client/assets/{collection-tab-dwp9LGxi.js → collection-tab-bg_gmLyh.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CFoaxah9.js → collection-table-wrapper-B0AFEn1d.js} +1 -1
- package/dist/client/assets/{connection-card-eAyda1Mu.js → connection-card-r2tH19aR.js} +1 -1
- package/dist/client/assets/{connection-detail-Bn-jl6HG.js → connection-detail-Dm1s8Dj2.js} +1 -1
- package/dist/client/assets/connections-CWHukeOK.js +1 -0
- package/dist/client/assets/constants-CN4QOiqe.js +1 -0
- package/dist/client/assets/{core-C9AbX0ks.js → core-BqWxized.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-DhHOFwW5.js → create-organization-dialog-CjneLhKn.js} +1 -1
- package/dist/client/assets/{dialog-Cj2udzC-.js → dialog-DoN4ORnY.js} +1 -1
- package/dist/client/assets/{dropdown-menu-ClBJUvd8.js → dropdown-menu-uXj8nKiT.js} +1 -1
- package/dist/client/assets/{empty-state-CYnIzDhF.js → empty-state-N07FE0YG.js} +1 -1
- package/dist/client/assets/{env-vars-editor-nU4IPD2j.js → env-vars-editor-B7JL_p-V.js} +1 -1
- package/dist/client/assets/{error-boundary-D5hb-PLt.js → error-boundary-Ce0_dLsG.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BWB54H7f.js → extract-connection-data-CeT4F9gU.js} +1 -1
- package/dist/client/assets/{form-Dn7fy5O5.js → form-BQIYj24w.js} +1 -1
- package/dist/client/assets/{formatDistanceToNow-km7E2wF1.js → formatDistanceToNow-CArtWgcP.js} +1 -1
- package/dist/client/assets/gateway-detail-VCb3jL84.js +1 -0
- package/dist/client/assets/gateways-9p2LLkTK.js +1 -0
- package/dist/client/assets/{home-dep1g9Zf.js → home-DgfprghT.js} +1 -1
- package/dist/client/assets/{index-gqIvEQSH.js → index-CVgkE3Gv.js} +2 -2
- package/dist/client/assets/{index-tz4gB72W.js → index-DEMNtulg.js} +2 -2
- package/dist/client/assets/{index-DX5d9vx1.js → index-DcMa5gDs.js} +1 -1
- package/dist/client/assets/{index-CcNvI65p.js → index-DcvTq0xJ.js} +1 -1
- package/dist/client/assets/{input-Cb7MaM0d.js → input-YdP8mwrf.js} +1 -1
- package/dist/client/assets/json-Bz08jZIq.js +1 -0
- package/dist/client/assets/{json-syntax-highlighter-CCgbux_M.js → json-syntax-highlighter-Bif-CDya.js} +2 -2
- package/dist/client/assets/{layout-DtfNegCp.js → layout-BNxxrCBw.js} +1 -1
- package/dist/client/assets/{lazy-highlighter-CaGtIE-R.js → lazy-highlighter-C0vzyJy5.js} +1 -1
- package/dist/client/assets/{localstorage-keys-DIkWdWYS.js → localstorage-keys-DwKN3_Ky.js} +1 -1
- package/dist/client/assets/{login-DSSk45pi.js → login-UWyl_cxx.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BOAcAnr_.js → mcp-oauth-Dqr97r2H.js} +1 -1
- package/dist/client/assets/{members-D4I8qlnr.js → members-C3UV37Kw.js} +1 -1
- package/dist/client/assets/{monitoring-CvcerPLg.js → monitoring-Ds52TSSS.js} +2 -2
- package/dist/client/assets/{oauth-callback-CY5bCrs6.js → oauth-callback-D4M9mHyH.js} +1 -1
- package/dist/client/assets/{page-Du4118GJ.js → page-B7ia0_lh.js} +2 -2
- package/dist/client/assets/{pin-to-sidebar-button-CwlJToUG.js → pin-to-sidebar-button-BKotT_Nc.js} +1 -1
- package/dist/client/assets/{popover-BPqLZ76M.js → popover-7jr0PuXV.js} +1 -1
- package/dist/client/assets/prism-light-CHE2alug.js +1 -0
- package/dist/client/assets/resizable-qkPSJ31g.js +1 -0
- package/dist/client/assets/{resource-tabs-CmUpRVKA.js → resource-tabs-qR3NhTLd.js} +1 -1
- package/dist/client/assets/{responsive-select-DwsIwS1V.js → responsive-select-CJQwNPPj.js} +1 -1
- package/dist/client/assets/{select-HGITgxwS.js → select-L_OjJ9sW.js} +1 -1
- package/dist/client/assets/{settings-sSoOIGWg.js → settings-BapAo6i2.js} +1 -1
- package/dist/client/assets/shell-layout-DqUuQ9gz.js +19 -0
- package/dist/client/assets/{spinner-BUVePO6d.js → spinner-CAJeeq5B.js} +1 -1
- package/dist/client/assets/{store-H6vucsd1.js → store-DTMoxgob.js} +1 -1
- package/dist/client/assets/{store-app-detail-aULJzMOJ.js → store-app-detail-CbGg2GlI.js} +1 -1
- package/dist/client/assets/{switch-BwTlw9qL.js → switch-DlwEQXd2.js} +1 -1
- package/dist/client/assets/{textarea-BAs6HmBZ.js → textarea-IOVeLZOt.js} +1 -1
- package/dist/client/assets/{thread-history-popover-DbEl1KJu.js → thread-history-popover-COjpShBU.js} +3 -3
- package/dist/client/assets/{tools-list-thZyoBrU.js → tools-list-l6xtSgWR.js} +1 -1
- package/dist/client/assets/{tooltip-Bzy1O5cq.js → tooltip-C7B84lYF.js} +1 -1
- package/dist/client/assets/{types-BVTsq_OW.js → types-BmKCUQAI.js} +1 -1
- package/dist/client/assets/{use-binding-jUI3xZmp.js → use-binding-Ce8NG0MO.js} +1 -1
- package/dist/client/assets/{use-connection-DRZbGk_A.js → use-connection-D-LWel3A.js} +1 -1
- package/dist/client/assets/{use-connection-resources-B3tDNT6E.js → use-connection-resources-CJzk5_Wj.js} +1 -1
- package/dist/client/assets/{use-gateway-CUxuCVmJ.js → use-gateway-eXp_1iQc.js} +1 -1
- package/dist/client/assets/{use-list-state-CkGBL95Z.js → use-list-state-CmxR0QRn.js} +1 -1
- package/dist/client/assets/{use-mcp-CMt9Wy3X.js → use-mcp-Cmlg9h6L.js} +1 -1
- package/dist/client/assets/{use-members-cyA2aC2q.js → use-members-Drex2zGi.js} +1 -1
- package/dist/client/assets/{use-mobile-B8xlavN6.js → use-mobile-B-R7B7Hp.js} +1 -1
- package/dist/client/assets/{use-organization-settings-C7IdFOTo.js → use-organization-settings-B_G_DBCR.js} +1 -1
- package/dist/client/assets/{use-tool-call-CsOSZ1pI.js → use-tool-call-BN3WED_Z.js} +1 -1
- package/dist/client/assets/useQuery-DLJrS2VC.js +1 -0
- package/dist/client/assets/{useSuspenseInfiniteQuery-DqCwXIKB.js → useSuspenseInfiniteQuery-DFaXtjFO.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-COcukfhX.js → view-mode-toggle-BpRlpgBn.js} +1 -1
- package/dist/client/assets/workflow-CBeu3WB4.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +114 -114
- package/dist/server/migrate.js +71 -71
- package/dist/server/server.js +109 -109
- package/package.json +1 -1
- package/dist/client/assets/connections-CDl5cKXc.js +0 -1
- package/dist/client/assets/constants-C-5m3xCJ.js +0 -1
- package/dist/client/assets/gateway-detail-BEimKnAa.js +0 -1
- package/dist/client/assets/gateways-1GR6BIbg.js +0 -1
- package/dist/client/assets/json-CevIphLA.js +0 -1
- package/dist/client/assets/prism-light-bnbWF_0X.js +0 -1
- package/dist/client/assets/resizable-Ck5ltOjh.js +0 -1
- package/dist/client/assets/shell-layout-BCUXUEeW.js +0 -19
- package/dist/client/assets/useQuery-Bl78N6vT.js +0 -1
- package/dist/client/assets/workflow-CaCjE8aO.js +0 -1
package/dist/client/assets/{formatDistanceToNow-km7E2wF1.js → formatDistanceToNow-CArtWgcP.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ba as X,bb as O,bc as j,bd as q,a9 as A,e as Y,be as _,bf as z,r as w,bg as I,bh as L,bi as N,bj as H,bk as k,bl as x,bm as V,bn as J}from"./index-tz4gB72W.js";function F(t,n){const e=new Set(n);return t.filter(s=>!e.has(s))}function B(t,n,e){const s=t.slice(0);return s[n]=e,s}var U=class extends X{#r;#t;#s;#a;#e;#n;#o;#i;#u=[];constructor(t,n,e){super(),this.#r=t,this.#a=e,this.#s=[],this.#e=[],this.#t=[],this.setQueries(n)}onSubscribe(){this.listeners.size===1&&this.#e.forEach(t=>{t.subscribe(n=>{this.#d(t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#e.forEach(t=>{t.destroy()})}setQueries(t,n){this.#s=t,this.#a=n,O.batch(()=>{const e=this.#e,s=this.#l(this.#s);s.forEach(u=>u.observer.setOptions(u.defaultedQueryOptions));const r=s.map(u=>u.observer),i=r.map(u=>u.getCurrentResult()),o=e.length!==r.length,a=r.some((u,f)=>u!==e[f]),c=o||a,d=c?!0:i.some((u,f)=>{const h=this.#t[f];return!h||!j(u,h)});!c&&!d||(c&&(this.#u=s,this.#e=r),this.#t=i,this.hasListeners()&&(c&&(F(e,r).forEach(u=>{u.destroy()}),F(r,e).forEach(u=>{u.subscribe(f=>{this.#d(u,f)})})),this.#f()))})}getCurrentResult(){return this.#t}getQueries(){return this.#e.map(t=>t.getCurrentQuery())}getObservers(){return this.#e}getOptimisticResult(t,n){const e=this.#l(t),s=e.map(r=>r.observer.getOptimisticResult(r.defaultedQueryOptions));return[s,r=>this.#h(r??s,n),()=>this.#c(s,e)]}#c(t,n){return n.map((e,s)=>{const r=t[s];return e.defaultedQueryOptions.notifyOnChangeProps?r:e.observer.trackResult(r,i=>{n.forEach(o=>{o.observer.trackProp(i)})})})}#h(t,n){return n?((!this.#n||this.#t!==this.#i||n!==this.#o)&&(this.#o=n,this.#i=this.#t,this.#n=q(this.#n,n(t))),this.#n):t}#l(t){const n=new Map;this.#e.forEach(s=>{const r=s.options.queryHash;if(!r)return;const i=n.get(r);i?i.push(s):n.set(r,[s])});const e=[];return t.forEach(s=>{const r=this.#r.defaultQueryOptions(s),o=n.get(r.queryHash)?.shift()??new A(this.#r,r);e.push({defaultedQueryOptions:r,observer:o})}),e}#d(t,n){const e=this.#e.indexOf(t);e!==-1&&(this.#t=B(this.#t,e,n),this.#f())}#f(){if(this.hasListeners()){const t=this.#n,n=this.#c(this.#t,this.#u),e=this.#h(n,this.#a?.combine);t!==e&&O.batch(()=>{this.listeners.forEach(s=>{s(this.#t)})})}}};function It({queries:t,...n},e){const s=Y(e),r=_(),i=z(),o=w.useMemo(()=>t.map(l=>{const b=s.defaultQueryOptions(l);return b._optimisticResults=r?"isRestoring":"optimistic",b}),[t,s,r]);o.forEach(l=>{I(l);const b=s.getQueryCache().get(l.queryHash);L(l,i,b)}),N(i);const[a]=w.useState(()=>new U(s,o,n)),[c,d,u]=a.getOptimisticResult(o,n.combine),f=!r&&n.subscribed!==!1;w.useSyncExternalStore(w.useCallback(l=>f?a.subscribe(O.batchCalls(l)):H,[a,f]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),w.useEffect(()=>{a.setQueries(o,n)},[o,n,a]);const g=c.some((l,b)=>k(o[b],l))?c.flatMap((l,b)=>{const y=o[b];if(y){const R=new A(s,y);if(k(y,l))return x(y,R,i);V(l,r)&&x(y,R,i)}return[]}):[];if(g.length>0)throw Promise.all(g);const m=c.find((l,b)=>{const y=o[b];return y&&J({result:l,errorResetBoundary:i,throwOnError:y.throwOnError,query:s.getQueryCache().get(y.queryHash),suspense:y.suspense})});if(m?.error)throw m.error;return d(u())}const D=43200,E=1440,Q=Symbol.for("constructDateFrom");function W(t,n){return typeof t=="function"?t(n):t&&typeof t=="object"&&Q in t?t[Q](n):t instanceof Date?new t.constructor(n):new Date(n)}function p(t,n){return W(t,t)}let K={};function $(){return K}function T(t){const n=p(t),e=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return e.setUTCFullYear(n.getFullYear()),+t-+e}function C(t,...n){const e=W.bind(null,t||n.find(s=>typeof s=="object"));return n.map(e)}function P(t,n){const e=+p(t)-+p(n);return e<0?-1:e>0?1:e}function G(t){return W(t,Date.now())}function Z(t,n,e){const[s,r]=C(e?.in,t,n),i=s.getFullYear()-r.getFullYear(),o=s.getMonth()-r.getMonth();return i*12+o}function tt(t){return n=>{const s=(t?Math[t]:Math.trunc)(n);return s===0?0:s}}function et(t,n){return+p(t)-+p(n)}function nt(t,n){const e=p(t);return e.setHours(23,59,59,999),e}function rt(t,n){const e=p(t),s=e.getMonth();return e.setFullYear(e.getFullYear(),s+1,0),e.setHours(23,59,59,999),e}function st(t,n){const e=p(t);return+nt(e)==+rt(e)}function at(t,n,e){const[s,r,i]=C(e?.in,t,t,n),o=P(r,i),a=Math.abs(Z(r,i));if(a<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-o*a);let c=P(r,i)===-o;st(s)&&a===1&&P(s,i)===1&&(c=!1);const d=o*(a-+c);return d===0?0:d}function ot(t,n,e){const s=et(t,n)/1e3;return tt(e?.roundingMethod)(s)}const it={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ut=(t,n,e)=>{let s;const r=it[t];return typeof r=="string"?s=r:n===1?s=r.one:s=r.other.replace("{{count}}",n.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+s:s+" ago":s};function S(t){return(n={})=>{const e=n.width?String(n.width):t.defaultWidth;return t.formats[e]||t.formats[t.defaultWidth]}}const ct={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ht={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},lt={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},dt={date:S({formats:ct,defaultWidth:"full"}),time:S({formats:ht,defaultWidth:"full"}),dateTime:S({formats:lt,defaultWidth:"full"})},ft={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},mt=(t,n,e,s)=>ft[t];function M(t){return(n,e)=>{const s=e?.context?String(e.context):"standalone";let r;if(s==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,a=e?.width?String(e.width):o;r=t.formattingValues[a]||t.formattingValues[o]}else{const o=t.defaultWidth,a=e?.width?String(e.width):t.defaultWidth;r=t.values[a]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(n):n;return r[i]}}const bt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},yt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},gt={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},pt={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},wt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Mt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},vt=(t,n)=>{const e=Number(t),s=e%100;if(s>20||s<10)switch(s%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},Dt={ordinalNumber:vt,era:M({values:bt,defaultWidth:"wide"}),quarter:M({values:yt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:M({values:gt,defaultWidth:"wide"}),day:M({values:pt,defaultWidth:"wide"}),dayPeriod:M({values:wt,defaultWidth:"wide",formattingValues:Mt,defaultFormattingWidth:"wide"})};function v(t){return(n,e={})=>{const s=e.width,r=s&&t.matchPatterns[s]||t.matchPatterns[t.defaultMatchWidth],i=n.match(r);if(!i)return null;const o=i[0],a=s&&t.parsePatterns[s]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(a)?St(a,f=>f.test(o)):Pt(a,f=>f.test(o));let d;d=t.valueCallback?t.valueCallback(c):c,d=e.valueCallback?e.valueCallback(d):d;const u=n.slice(o.length);return{value:d,rest:u}}}function Pt(t,n){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&n(t[e]))return e}function St(t,n){for(let e=0;e<t.length;e++)if(n(t[e]))return e}function Ot(t){return(n,e={})=>{const s=n.match(t.matchPattern);if(!s)return null;const r=s[0],i=n.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=e.valueCallback?e.valueCallback(o):o;const a=n.slice(r.length);return{value:o,rest:a}}}const Wt=/^(\d+)(th|st|nd|rd)?/i,Ct=/\d+/i,Rt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},kt={any:[/^b/i,/^(a|c)/i]},xt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ft={any:[/1/i,/2/i,/3/i,/4/i]},Et={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Qt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Tt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},At={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Xt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},jt={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},qt={ordinalNumber:Ot({matchPattern:Wt,parsePattern:Ct,valueCallback:t=>parseInt(t,10)}),era:v({matchPatterns:Rt,defaultMatchWidth:"wide",parsePatterns:kt,defaultParseWidth:"any"}),quarter:v({matchPatterns:xt,defaultMatchWidth:"wide",parsePatterns:Ft,defaultParseWidth:"any",valueCallback:t=>t+1}),month:v({matchPatterns:Et,defaultMatchWidth:"wide",parsePatterns:Qt,defaultParseWidth:"any"}),day:v({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:At,defaultParseWidth:"any"}),dayPeriod:v({matchPatterns:Xt,defaultMatchWidth:"any",parsePatterns:jt,defaultParseWidth:"any"})},Yt={code:"en-US",formatDistance:ut,formatLong:dt,formatRelative:mt,localize:Dt,match:qt,options:{weekStartsOn:0,firstWeekContainsDate:1}};function _t(t,n,e){const s=$(),r=e?.locale??s.locale??Yt,i=2520,o=P(t,n);if(isNaN(o))throw new RangeError("Invalid time value");const a=Object.assign({},e,{addSuffix:e?.addSuffix,comparison:o}),[c,d]=C(e?.in,...o>0?[n,t]:[t,n]),u=ot(d,c),f=(T(d)-T(c))/1e3,h=Math.round((u-f)/60);let g;if(h<2)return e?.includeSeconds?u<5?r.formatDistance("lessThanXSeconds",5,a):u<10?r.formatDistance("lessThanXSeconds",10,a):u<20?r.formatDistance("lessThanXSeconds",20,a):u<40?r.formatDistance("halfAMinute",0,a):u<60?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",1,a):h===0?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",h,a);if(h<45)return r.formatDistance("xMinutes",h,a);if(h<90)return r.formatDistance("aboutXHours",1,a);if(h<E){const m=Math.round(h/60);return r.formatDistance("aboutXHours",m,a)}else{if(h<i)return r.formatDistance("xDays",1,a);if(h<D){const m=Math.round(h/E);return r.formatDistance("xDays",m,a)}else if(h<D*2)return g=Math.round(h/D),r.formatDistance("aboutXMonths",g,a)}if(g=at(d,c),g<12){const m=Math.round(h/D);return r.formatDistance("xMonths",m,a)}else{const m=g%12,l=Math.trunc(g/12);return m<3?r.formatDistance("aboutXYears",l,a):m<9?r.formatDistance("overXYears",l,a):r.formatDistance("almostXYears",l+1,a)}}function Lt(t,n){return _t(t,G(t),n)}export{Lt as f,It as u};
|
|
1
|
+
import{ba as X,bb as O,bc as j,bd as q,a9 as A,e as Y,be as _,bf as z,r as w,bg as I,bh as L,bi as N,bj as H,bk as k,bl as x,bm as V,bn as J}from"./index-DEMNtulg.js";function F(t,n){const e=new Set(n);return t.filter(s=>!e.has(s))}function B(t,n,e){const s=t.slice(0);return s[n]=e,s}var U=class extends X{#r;#t;#s;#a;#e;#n;#o;#i;#u=[];constructor(t,n,e){super(),this.#r=t,this.#a=e,this.#s=[],this.#e=[],this.#t=[],this.setQueries(n)}onSubscribe(){this.listeners.size===1&&this.#e.forEach(t=>{t.subscribe(n=>{this.#d(t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#e.forEach(t=>{t.destroy()})}setQueries(t,n){this.#s=t,this.#a=n,O.batch(()=>{const e=this.#e,s=this.#l(this.#s);s.forEach(u=>u.observer.setOptions(u.defaultedQueryOptions));const r=s.map(u=>u.observer),i=r.map(u=>u.getCurrentResult()),o=e.length!==r.length,a=r.some((u,f)=>u!==e[f]),c=o||a,d=c?!0:i.some((u,f)=>{const h=this.#t[f];return!h||!j(u,h)});!c&&!d||(c&&(this.#u=s,this.#e=r),this.#t=i,this.hasListeners()&&(c&&(F(e,r).forEach(u=>{u.destroy()}),F(r,e).forEach(u=>{u.subscribe(f=>{this.#d(u,f)})})),this.#f()))})}getCurrentResult(){return this.#t}getQueries(){return this.#e.map(t=>t.getCurrentQuery())}getObservers(){return this.#e}getOptimisticResult(t,n){const e=this.#l(t),s=e.map(r=>r.observer.getOptimisticResult(r.defaultedQueryOptions));return[s,r=>this.#h(r??s,n),()=>this.#c(s,e)]}#c(t,n){return n.map((e,s)=>{const r=t[s];return e.defaultedQueryOptions.notifyOnChangeProps?r:e.observer.trackResult(r,i=>{n.forEach(o=>{o.observer.trackProp(i)})})})}#h(t,n){return n?((!this.#n||this.#t!==this.#i||n!==this.#o)&&(this.#o=n,this.#i=this.#t,this.#n=q(this.#n,n(t))),this.#n):t}#l(t){const n=new Map;this.#e.forEach(s=>{const r=s.options.queryHash;if(!r)return;const i=n.get(r);i?i.push(s):n.set(r,[s])});const e=[];return t.forEach(s=>{const r=this.#r.defaultQueryOptions(s),o=n.get(r.queryHash)?.shift()??new A(this.#r,r);e.push({defaultedQueryOptions:r,observer:o})}),e}#d(t,n){const e=this.#e.indexOf(t);e!==-1&&(this.#t=B(this.#t,e,n),this.#f())}#f(){if(this.hasListeners()){const t=this.#n,n=this.#c(this.#t,this.#u),e=this.#h(n,this.#a?.combine);t!==e&&O.batch(()=>{this.listeners.forEach(s=>{s(this.#t)})})}}};function It({queries:t,...n},e){const s=Y(e),r=_(),i=z(),o=w.useMemo(()=>t.map(l=>{const b=s.defaultQueryOptions(l);return b._optimisticResults=r?"isRestoring":"optimistic",b}),[t,s,r]);o.forEach(l=>{I(l);const b=s.getQueryCache().get(l.queryHash);L(l,i,b)}),N(i);const[a]=w.useState(()=>new U(s,o,n)),[c,d,u]=a.getOptimisticResult(o,n.combine),f=!r&&n.subscribed!==!1;w.useSyncExternalStore(w.useCallback(l=>f?a.subscribe(O.batchCalls(l)):H,[a,f]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),w.useEffect(()=>{a.setQueries(o,n)},[o,n,a]);const g=c.some((l,b)=>k(o[b],l))?c.flatMap((l,b)=>{const y=o[b];if(y){const R=new A(s,y);if(k(y,l))return x(y,R,i);V(l,r)&&x(y,R,i)}return[]}):[];if(g.length>0)throw Promise.all(g);const m=c.find((l,b)=>{const y=o[b];return y&&J({result:l,errorResetBoundary:i,throwOnError:y.throwOnError,query:s.getQueryCache().get(y.queryHash),suspense:y.suspense})});if(m?.error)throw m.error;return d(u())}const D=43200,E=1440,Q=Symbol.for("constructDateFrom");function W(t,n){return typeof t=="function"?t(n):t&&typeof t=="object"&&Q in t?t[Q](n):t instanceof Date?new t.constructor(n):new Date(n)}function p(t,n){return W(t,t)}let K={};function $(){return K}function T(t){const n=p(t),e=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return e.setUTCFullYear(n.getFullYear()),+t-+e}function C(t,...n){const e=W.bind(null,t||n.find(s=>typeof s=="object"));return n.map(e)}function P(t,n){const e=+p(t)-+p(n);return e<0?-1:e>0?1:e}function G(t){return W(t,Date.now())}function Z(t,n,e){const[s,r]=C(e?.in,t,n),i=s.getFullYear()-r.getFullYear(),o=s.getMonth()-r.getMonth();return i*12+o}function tt(t){return n=>{const s=(t?Math[t]:Math.trunc)(n);return s===0?0:s}}function et(t,n){return+p(t)-+p(n)}function nt(t,n){const e=p(t);return e.setHours(23,59,59,999),e}function rt(t,n){const e=p(t),s=e.getMonth();return e.setFullYear(e.getFullYear(),s+1,0),e.setHours(23,59,59,999),e}function st(t,n){const e=p(t);return+nt(e)==+rt(e)}function at(t,n,e){const[s,r,i]=C(e?.in,t,t,n),o=P(r,i),a=Math.abs(Z(r,i));if(a<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-o*a);let c=P(r,i)===-o;st(s)&&a===1&&P(s,i)===1&&(c=!1);const d=o*(a-+c);return d===0?0:d}function ot(t,n,e){const s=et(t,n)/1e3;return tt(e?.roundingMethod)(s)}const it={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ut=(t,n,e)=>{let s;const r=it[t];return typeof r=="string"?s=r:n===1?s=r.one:s=r.other.replace("{{count}}",n.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+s:s+" ago":s};function S(t){return(n={})=>{const e=n.width?String(n.width):t.defaultWidth;return t.formats[e]||t.formats[t.defaultWidth]}}const ct={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ht={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},lt={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},dt={date:S({formats:ct,defaultWidth:"full"}),time:S({formats:ht,defaultWidth:"full"}),dateTime:S({formats:lt,defaultWidth:"full"})},ft={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},mt=(t,n,e,s)=>ft[t];function M(t){return(n,e)=>{const s=e?.context?String(e.context):"standalone";let r;if(s==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,a=e?.width?String(e.width):o;r=t.formattingValues[a]||t.formattingValues[o]}else{const o=t.defaultWidth,a=e?.width?String(e.width):t.defaultWidth;r=t.values[a]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(n):n;return r[i]}}const bt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},yt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},gt={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},pt={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},wt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Mt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},vt=(t,n)=>{const e=Number(t),s=e%100;if(s>20||s<10)switch(s%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},Dt={ordinalNumber:vt,era:M({values:bt,defaultWidth:"wide"}),quarter:M({values:yt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:M({values:gt,defaultWidth:"wide"}),day:M({values:pt,defaultWidth:"wide"}),dayPeriod:M({values:wt,defaultWidth:"wide",formattingValues:Mt,defaultFormattingWidth:"wide"})};function v(t){return(n,e={})=>{const s=e.width,r=s&&t.matchPatterns[s]||t.matchPatterns[t.defaultMatchWidth],i=n.match(r);if(!i)return null;const o=i[0],a=s&&t.parsePatterns[s]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(a)?St(a,f=>f.test(o)):Pt(a,f=>f.test(o));let d;d=t.valueCallback?t.valueCallback(c):c,d=e.valueCallback?e.valueCallback(d):d;const u=n.slice(o.length);return{value:d,rest:u}}}function Pt(t,n){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&n(t[e]))return e}function St(t,n){for(let e=0;e<t.length;e++)if(n(t[e]))return e}function Ot(t){return(n,e={})=>{const s=n.match(t.matchPattern);if(!s)return null;const r=s[0],i=n.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=e.valueCallback?e.valueCallback(o):o;const a=n.slice(r.length);return{value:o,rest:a}}}const Wt=/^(\d+)(th|st|nd|rd)?/i,Ct=/\d+/i,Rt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},kt={any:[/^b/i,/^(a|c)/i]},xt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ft={any:[/1/i,/2/i,/3/i,/4/i]},Et={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Qt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Tt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},At={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Xt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},jt={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},qt={ordinalNumber:Ot({matchPattern:Wt,parsePattern:Ct,valueCallback:t=>parseInt(t,10)}),era:v({matchPatterns:Rt,defaultMatchWidth:"wide",parsePatterns:kt,defaultParseWidth:"any"}),quarter:v({matchPatterns:xt,defaultMatchWidth:"wide",parsePatterns:Ft,defaultParseWidth:"any",valueCallback:t=>t+1}),month:v({matchPatterns:Et,defaultMatchWidth:"wide",parsePatterns:Qt,defaultParseWidth:"any"}),day:v({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:At,defaultParseWidth:"any"}),dayPeriod:v({matchPatterns:Xt,defaultMatchWidth:"any",parsePatterns:jt,defaultParseWidth:"any"})},Yt={code:"en-US",formatDistance:ut,formatLong:dt,formatRelative:mt,localize:Dt,match:qt,options:{weekStartsOn:0,firstWeekContainsDate:1}};function _t(t,n,e){const s=$(),r=e?.locale??s.locale??Yt,i=2520,o=P(t,n);if(isNaN(o))throw new RangeError("Invalid time value");const a=Object.assign({},e,{addSuffix:e?.addSuffix,comparison:o}),[c,d]=C(e?.in,...o>0?[n,t]:[t,n]),u=ot(d,c),f=(T(d)-T(c))/1e3,h=Math.round((u-f)/60);let g;if(h<2)return e?.includeSeconds?u<5?r.formatDistance("lessThanXSeconds",5,a):u<10?r.formatDistance("lessThanXSeconds",10,a):u<20?r.formatDistance("lessThanXSeconds",20,a):u<40?r.formatDistance("halfAMinute",0,a):u<60?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",1,a):h===0?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",h,a);if(h<45)return r.formatDistance("xMinutes",h,a);if(h<90)return r.formatDistance("aboutXHours",1,a);if(h<E){const m=Math.round(h/60);return r.formatDistance("aboutXHours",m,a)}else{if(h<i)return r.formatDistance("xDays",1,a);if(h<D){const m=Math.round(h/E);return r.formatDistance("xDays",m,a)}else if(h<D*2)return g=Math.round(h/D),r.formatDistance("aboutXMonths",g,a)}if(g=at(d,c),g<12){const m=Math.round(h/D);return r.formatDistance("xMonths",m,a)}else{const m=g%12,l=Math.trunc(g/12);return m<3?r.formatDistance("aboutXYears",l,a):m<9?r.formatDistance("overXYears",l,a):r.formatDistance("almostXYears",l+1,a)}}function Lt(t,n){return _t(t,G(t),n)}export{Lt as f,It as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as $,c as Z,j as t,f as Ye,d as pt,b as gt,v as jt,_ as qe,w as et,g as bt,af as vt,x as yt,y as St,a as Ct,t as Je}from"./index-DEMNtulg.js";import{E as wt}from"./SearchMd-C6P9P1wF.js";import{E as Ke}from"./error-boundary-Ce0_dLsG.js";import{I as Fe,u as Qe}from"./use-connection-D-LWel3A.js";import{T as Nt,S as _t}from"./switch-DlwEQXd2.js";import{C as st}from"./checkbox-BMd2Z-WT.js";import{c as xe,B as te}from"./button-B13xcF6W.js";import{i as It}from"./ArrowLeft-CJ-eKoid.js";import{C as Tt}from"./collection-search-LnYLnFH8.js";import{I as Ze}from"./input-YdP8mwrf.js";import{s as nt}from"./Plus-CwB-Rc8B.js";import{i as kt}from"./X-Da4xsL05.js";import{b as $t,a as Pt}from"./use-gateway-eXp_1iQc.js";import{u as zt,a as Mt}from"./use-connection-resources-CJzk5_Wj.js";import{u as Et}from"./use-binding-Ce8NG0MO.js";import{a as Rt,e as ot,T as At,C as Y,b as Ft,c as Dt,d as Vt,u as Bt,N as Ot,G as Gt,U as Lt,M as Ut}from"./thread-history-popover-COjpShBU.js";import{u as lt,a as pe,c as ge,b as je,T as be,i as tt}from"./tooltip-C7B84lYF.js";import{a as Ht}from"./Copy01-DhXqtugg.js";import{i as Xe}from"./CpuChip02-BtgBI59l.js";import{i as Wt}from"./FlipBackward-BSnTMMYy.js";import{i as it}from"./LinkExternal01-O4xnNCff.js";import{i as Le}from"./Loading01-EiDV-2FW.js";import{F as Re,a as qt,b as De,d as Ve,f as Be,c as rt}from"./form-BQIYj24w.js";import{S as at,a as ct,b as dt,c as mt,d as Ae}from"./select-L_OjJ9sW.js";import{R as Jt}from"./resource-tabs-qR3NhTLd.js";import{s as Yt}from"./slugify-CEUa2lfQ.js";import{P as Kt}from"./pin-to-sidebar-button-BKotT_Nc.js";import{a as Qt,V as Zt,b as Xt}from"./layout-BNxxrCBw.js";import{u as es,L as ut}from"./localstorage-keys-DwKN3_Ky.js";import{f as ts}from"./formatDistanceToNow-CArtWgcP.js";import"./auth-CZR9mNdb.js";import"./AlertCircle-BIlMffS8.js";import"./Grid01-CkwdbRed.js";import"./responsive-select-CJQwNPPj.js";import"./use-mobile-B-R7B7Hp.js";import"./textarea-IOVeLZOt.js";import"./Terminal-Dv6w41J8.js";import"./connection-card-r2tH19aR.js";import"./card-7VW-xSd-.js";import"./json-syntax-highlighter-Bif-CDya.js";import"./alert-dialog-D6UjYOUP.js";import"./File06-MlW8n69V.js";import"./well-known-mcp-VNRT0JrW.js";import"./generate-id-Dyweu44Y.js";import"./popover-7jr0PuXV.js";import"./Clock-BD2gknBV.js";import"./Trash01-Ctk7srex.js";import"./ChevronDown-atiP0m-F.js";import"./badge-B-u7R38I.js";import"./use-organization-settings-B_G_DBCR.js";import"./useQuery-DLJrS2VC.js";const ft=({size:n=24,color:e="currentColor",...s})=>$.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},$.createElement("path",{d:"M12 20h9M3 20h1.675c.489 0 .733 0 .964-.055.204-.05.399-.13.578-.24.201-.123.374-.296.72-.642L19.5 6.5a2.121 2.121 0 0 0-3-3L3.937 16.063c-.346.346-.519.519-.642.72a2 2 0 0 0-.24.578c-.055.23-.055.475-.055.965V20Z"}));ft.displayName="Edit03";const ht=({size:n=24,color:e="currentColor",...s})=>$.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},$.createElement("path",{d:"M7 3v3.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C7.76 8 8.04 8 8.6 8h6.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C17 7.24 17 6.96 17 6.4V4m0 17v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.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.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));ht.displayName="Save01";const ss=$.memo(function(e){const s=Z.c(20),{connection:o,isSelected:f,hasItemsEnabled:r,activeItemsCount:m,totalItemsCount:g,onSelect:c,onToggle:l}=e,d=f?"bg-accent/50":"hover:bg-muted/50";let h;s[0]!==d?(h=xe("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",d),s[0]=d,s[1]=h):h=s[1];let p;s[2]!==o.icon||s[3]!==o.title?(p=t.jsx(Fe,{icon:o.icon,name:o.title,size:"xs"}),s[2]=o.icon,s[3]=o.title,s[4]=p):p=s[4];let b;s[5]!==o.title?(b=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:o.title})}),s[5]=o.title,s[6]=b):b=s[6];let u;s[7]!==c||s[8]!==p||s[9]!==b?(u=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:c,children:[p,b]}),s[7]=c,s[8]=p,s[9]=b,s[10]=u):u=s[10];let x;s[11]!==m||s[12]!==r||s[13]!==l||s[14]!==g?(x=g>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[m,"/",g]}),t.jsx(st,{checked:r,onCheckedChange:l,onClick:os})]}),s[11]=m,s[12]=r,s[13]=l,s[14]=g,s[15]=x):x=s[15];let v;return s[16]!==h||s[17]!==u||s[18]!==x?(v=t.jsxs("div",{className:h,children:[u,x]}),s[16]=h,s[17]=u,s[18]=x,s[19]=v):v=s[19],v}),ns=$.memo(function(e){const s=Z.c(18),{connectionId:o,item:f,isSelected:r,onToggle:m}=e,g=`item-${o}-${f.id}`,c=r?"text-foreground":"text-muted-foreground";let l;s[0]!==c?(l=xe("text-sm font-medium",c),s[0]=c,s[1]=l):l=s[1];let d;s[2]!==f.name||s[3]!==l?(d=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:l,children:f.name})}),s[2]=f.name,s[3]=l,s[4]=d):d=s[4];let h;s[5]!==f.description?(h=f.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:f.description}),s[5]=f.description,s[6]=h):h=s[6];let p;s[7]!==d||s[8]!==h?(p=t.jsxs("div",{className:"flex-1 min-w-0",children:[d,h]}),s[7]=d,s[8]=h,s[9]=p):p=s[9];const b=`item-${o}-${f.id}`;let u;s[10]!==r||s[11]!==m||s[12]!==b?(u=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(st,{id:b,checked:r,onCheckedChange:m,onClick:ls})}),s[10]=r,s[11]=m,s[12]=b,s[13]=u):u=s[13];let x;return s[14]!==g||s[15]!==p||s[16]!==u?(x=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:g,children:[p,u]}),s[14]=g,s[15]=p,s[16]=u,s[17]=x):x=s[17],x});function xt({itemSet:n,onItemSetChange:e,getItems:s,itemLabel:o,emptyItemsMessage:f,extraContent:r}){const[m,g]=$.useState(""),c=$.useDeferredValue(m),[l,d]=$.useState("all"),[h,p]=$.useState(!1),b=$.useRef(new Set(Object.keys(n))),u=Qe({searchTerm:c.trim()||void 0}),x=b.current,v=[...x.values()].map(i=>u.find(w=>w.id===i)).filter(i=>i!==void 0),N=u.filter(i=>!x.has(i.id)),I=[...v,...N],j=i=>{const w=n[i];return w!==void 0&&w.length>0},y=I.filter(i=>{if(l==="all")return!0;const w=j(i.id);return l==="selected"?w:l==="unselected"?!w:!0}),[S,a]=$.useState(I[0]?.id??null),C=S?I.find(i=>i.id===S)??null:null,_=C?s(C):[],E=(i,w)=>n[i]?.includes(w)??!1,R=(i,w)=>{const A=n[i]??[],F=A.includes(w),P={...n};if(F){const B=A.filter(M=>M!==w);B.length===0?delete P[i]:P[i]=B}else P[i]=[...A,w];e(P)},q=i=>{const w=I.find(k=>k.id===i);if(!w)return;const A=s(w);if(A.length===0)return;const F=n[i]??[],P=A.map(k=>k.id),B=F.length>0&&P.every(k=>F.includes(k)),M={...n};B?delete M[i]:(M[i]=P,a(i)),e(M)},U=i=>{a(i),p(!0)},T=()=>{p(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:xe("w-full md:w-80 border-r border-border flex flex-col",h&&"hidden md:flex"),children:[t.jsx(Tt,{value:m,onChange:g,placeholder:"Search Connections..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>d("all"),className:xe("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",l==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>d("selected"),className:xe("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",l==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>d("unselected"),className:xe("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",l==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:y.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:m?"No connections found":l==="selected"?"No servers selected":l==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:y.map(i=>{const A=s(i).length,F=n[i.id]?.length??0;return t.jsx(ss,{connection:i,isSelected:S===i.id,hasItemsEnabled:j(i.id),activeItemsCount:F,totalItemsCount:A,onSelect:()=>U(i.id),onToggle:()=>q(i.id)},i.id)})})})]}),t.jsx("div",{className:xe("flex-1 flex-col",h?"flex":"hidden md:flex"),children:C?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[t.jsx(te,{variant:"ghost",size:"sm",onClick:T,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(It,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx(Fe,{icon:C.icon,name:C.title,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:C.title}),C.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:C.description})]})]})]}),r,t.jsx("div",{className:"flex-1 overflow-auto p-4",children:_.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:f||`This connection has no ${o} available`}):t.jsx("div",{className:"space-y-2",children:_.map(i=>t.jsx(ns,{connectionId:C.id,item:i,isSelected:E(C.id,i.id),onToggle:()=>R(C.id,i.id)},i.id))})})]}):t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Select a connection to view its ",o]})})})]})}function os(n){return n.stopPropagation()}function ls(n){return n.stopPropagation()}function is(n){const e=Z.c(6),{promptSet:s,onPromptSetChange:o,connectionPrompts:f}=n;let r;e[0]!==f?(r=c=>(f.get(c.id)??[]).map(rs),e[0]=f,e[1]=r):r=e[1];const m=r;let g;return e[2]!==m||e[3]!==o||e[4]!==s?(g=t.jsx(xt,{itemSet:s,onItemSetChange:o,getItems:m,itemLabel:"prompts",emptyItemsMessage:"This connection has no prompts available"}),e[2]=m,e[3]=o,e[4]=s,e[5]=g):g=e[5],g}function rs(n){return{id:n.name,name:n.name,description:n.description}}function as(n){return n.includes("*")}function cs(n){const e=Z.c(27),{patterns:s,onAddPattern:o,onRemovePattern:f}=n,[r,m]=$.useState("");let g;e[0]!==r||e[1]!==o||e[2]!==s?(g=()=>{const p=r.trim();p&&!s.includes(p)&&(o(p),m(""))},e[0]=r,e[1]=o,e[2]=s,e[3]=g):g=e[3];const c=g;let l;e[4]!==c?(l=p=>{p.key==="Enter"&&(p.preventDefault(),c())},e[4]=c,e[5]=l):l=e[5];const d=l;let h;if(e[6]!==c||e[7]!==d||e[8]!==r||e[9]!==f||e[10]!==s){const p=s.filter(as);let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("code",{children:"*"}),e[12]=b):b=e[12];let u;e[13]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsxs("div",{className:"text-xs text-muted-foreground",children:["Add URI patterns to match multiple resources. Use ",b," for single segment and ",t.jsx("code",{children:"**"})," for multiple segments."]}),e[13]=u):u=e[13];let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=a=>m(a.target.value),e[14]=x):x=e[14];let v;e[15]!==d||e[16]!==r?(v=t.jsx(Ze,{value:r,onChange:x,onKeyDown:d,placeholder:"e.g., file:///**/*.ts or db://users/*",className:"flex-1 text-sm"}),e[15]=d,e[16]=r,e[17]=v):v=e[17];let N;e[18]!==r?(N=r.trim(),e[18]=r,e[19]=N):N=e[19];const I=!N;let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(nt,{size:16}),e[20]=j):j=e[20];let y;e[21]!==c||e[22]!==I?(y=t.jsx(te,{type:"button",variant:"outline",size:"sm",onClick:c,disabled:I,children:j}),e[21]=c,e[22]=I,e[23]=y):y=e[23];let S;e[24]!==y||e[25]!==v?(S=t.jsxs("div",{className:"flex gap-2",children:[v,y]}),e[24]=y,e[25]=v,e[26]=S):S=e[26],h=t.jsxs("div",{className:"border-b border-border p-4 space-y-3",children:[u,S,p.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2",children:p.map(a=>t.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-muted rounded-md text-xs",children:[t.jsx("code",{className:"text-foreground",children:a}),t.jsx("button",{type:"button",onClick:()=>f(a),className:"text-muted-foreground hover:text-foreground",children:t.jsx(kt,{size:12})})]},a))})]}),e[6]=c,e[7]=d,e[8]=r,e[9]=f,e[10]=s,e[11]=h}else h=e[11];return h}function ds(n){const e=Z.c(23),{resourceSet:s,onResourceSetChange:o,connectionResources:f}=n,[r]=$.useState(null);let m;e[0]!==f?(m=j=>(f.get(j.id)??[]).map(ms),e[0]=f,e[1]=m):m=e[1];const g=m;let c;e[2]!==o||e[3]!==s?(c=(j,y)=>{const S=s[j]??[];S.includes(y)||o({...s,[j]:[...S,y]})},e[2]=o,e[3]=s,e[4]=c):c=e[4];const l=c;let d;e[5]!==o||e[6]!==s?(d=(j,y)=>{const a=(s[j]??[]).filter(C=>C!==y);if(a.length===0){const C={...s};delete C[j],o(C)}else o({...s,[j]:a})},e[5]=o,e[6]=s,e[7]=d):d=e[7];const h=d;let p;e[8]!==o?(p=j=>{o(j)},e[8]=o,e[9]=p):p=e[9];const b=p;let u;e[10]!==s||e[11]!==r?(u=r?s[r]??[]:[],e[10]=s,e[11]=r,e[12]=u):u=e[12];const x=u;let v;e[13]!==l||e[14]!==h||e[15]!==r||e[16]!==x?(v=r?t.jsx(cs,{patterns:x,onAddPattern:j=>l(r,j),onRemovePattern:j=>h(r,j)}):null,e[13]=l,e[14]=h,e[15]=r,e[16]=x,e[17]=v):v=e[17];const N=v;let I;return e[18]!==N||e[19]!==g||e[20]!==b||e[21]!==s?(I=t.jsx("div",{className:"h-full",children:t.jsx(xt,{itemSet:s,onItemSetChange:b,getItems:g,itemLabel:"resources",emptyItemsMessage:"This connection has no resources available",extraContent:N})}),e[18]=N,e[19]=g,e[20]=b,e[21]=s,e[22]=I):I=e[22],I}function ms(n){return{id:n.uri,name:n.name||n.uri,description:n.description||n.uri}}const us="You are a helpful assistant. Please try answering the user's questions using your available tools.";function fs(n){const s=new TextEncoder().encode(n),o=Array.from(s,f=>String.fromCharCode(f)).join("");return btoa(o)}function hs(n){const e=Z.c(52),{serverName:s,gatewayUrl:o}=n,[f,r]=$.useState(!1),[m,g]=$.useState(null),c=Yt(s);let l,d,h,p;if(e[0]!==o||e[1]!==c){const L={type:"http",url:o},se={[c]:L};l=JSON.stringify(se,null,2);const J=K=>JSON.stringify({...L,headers:{"x-mesh-client":K}},null,2),ae=fs(J("Cursor"));d=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(c)}&config=${encodeURIComponent(ae)}`;const ne=J("Claude Code");h=c;let ce;e[6]===Symbol.for("react.memo_cache_sentinel")?(ce=/'/g,e[6]=ce):ce=e[6],p=ne.replace(ce,"'\\''"),e[0]=o,e[1]=c,e[2]=l,e[3]=d,e[4]=h,e[5]=p}else l=e[2],d=e[3],h=e[4],p=e[5];const b=`claude mcp add "${h}" --config '${p}'`;let u;e[7]!==l?(u=async()=>{await navigator.clipboard.writeText(l),r(!0),Je.success("Configuration copied to clipboard"),setTimeout(()=>r(!1),2e3)},e[7]=l,e[8]=u):u=e[8];const x=u;let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=async(L,se)=>{await navigator.clipboard.writeText(L),g(se),Je.success(`${se} command copied`),setTimeout(()=>g(null),2e3)},e[9]=v):v=e[9];const N=v,I=xs;let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"Install in your IDE"})}),e[10]=j):j=e[10];let y;e[11]!==f?(y=f?t.jsx(tt,{size:14}):t.jsx(Ht,{size:14}),e[11]=f,e[12]=y):y=e[12];let S;e[13]!==x||e[14]!==y?(S=t.jsx(je,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:x,children:y})}),e[13]=x,e[14]=y,e[15]=S):S=e[15];let a;e[16]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(be,{children:"Copy configuration"}),e[16]=a):a=e[16];let C;e[17]!==S?(C=t.jsx("div",{className:"absolute top-2 right-2",children:t.jsx(pe,{children:t.jsxs(ge,{children:[S,a]})})}),e[17]=S,e[18]=C):C=e[18];let _;e[19]!==l||e[20]!==x?(_=t.jsx("pre",{className:"text-xs font-mono text-foreground overflow-auto max-h-40 whitespace-pre-wrap wrap-break-word cursor-pointer",onClick:x,children:l}),e[19]=l,e[20]=x,e[21]=_):_=e[21];let E;e[22]!==_||e[23]!==C?(E=t.jsxs("div",{className:"relative flex flex-col gap-2 p-3 bg-muted/50 rounded-lg",children:[C,_]}),e[22]=_,e[23]=C,e[24]=E):E=e[24];let R;e[25]!==d?(R=()=>I(d),e[25]=d,e[26]=R):R=e[26];let q,U;e[27]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),U=t.jsx("span",{className:"text-sm font-medium",children:"Cursor"}),e[27]=q,e[28]=U):(q=e[27],U=e[28]);let T;e[29]!==R?(T=t.jsx(je,{asChild:!0,children:t.jsxs(te,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:R,children:[q,U]})}),e[29]=R,e[30]=T):T=e[30];let i;e[31]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(be,{children:"Add to Cursor"}),e[31]=i):i=e[31];let w;e[32]!==T?(w=t.jsx(pe,{children:t.jsxs(ge,{children:[T,i]})}),e[32]=T,e[33]=w):w=e[33];let A;e[34]!==b?(A=()=>N(b,"Claude"),e[34]=b,e[35]=A):A=e[35];let F,P;e[36]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),P=t.jsx("span",{className:"text-sm font-medium",children:"Claude Code"}),e[36]=F,e[37]=P):(F=e[36],P=e[37]);let B;e[38]!==m?(B=m==="Claude"&&t.jsx(tt,{size:14,className:"ml-2 text-green-500"}),e[38]=m,e[39]=B):B=e[39];let M;e[40]!==A||e[41]!==B?(M=t.jsx(je,{asChild:!0,children:t.jsxs(te,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:A,children:[F,P,B]})}),e[40]=A,e[41]=B,e[42]=M):M=e[42];let k;e[43]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(be,{children:"Add to Claude Code"}),e[43]=k):k=e[43];let X;e[44]!==M?(X=t.jsx(pe,{children:t.jsxs(ge,{children:[M,k]})}),e[44]=M,e[45]=X):X=e[45];let H;e[46]!==w||e[47]!==X?(H=t.jsxs("div",{className:"flex flex-wrap gap-2",children:[w,X]}),e[46]=w,e[47]=X,e[48]=H):H=e[48];let G;return e[49]!==E||e[50]!==H?(G=t.jsxs("div",{className:"flex flex-col gap-4",children:[j,E,H]}),e[49]=E,e[50]=H,e[51]=G):G=e[51],G}function xs(n){window.open(n,"_blank")}const ps=jt({title:et().min(1,"Name is required").max(255),description:et().nullable(),status:qe(["active","inactive"]),tool_selection_mode:qe(["inclusion","exclusion"]),tool_selection_strategy:qe(["passthrough","smart_tool_selection","code_execution"])});function gs(n,e){const s={};for(const o of n.connections)if(o.selected_tools===null){const f=e.get(o.connection_id)??[];f.length>0&&(s[o.connection_id]=f)}else o.selected_tools.length>0&&(s[o.connection_id]=o.selected_tools);return s}function js(n){const e={};for(const s of n.connections)s.selected_resources!==null&&s.selected_resources!==void 0&&s.selected_resources.length>0&&(e[s.connection_id]=s.selected_resources);return e}function bs(n){const e={};for(const s of n.connections)s.selected_prompts!==null&&s.selected_prompts!==void 0&&s.selected_prompts.length>0&&(e[s.connection_id]=s.selected_prompts);return e}function vs(n,e,s,o){const f=new Set([...Object.keys(n),...Object.keys(e),...Object.keys(s)]);return Array.from(f).map(r=>{const m=n[r]??[],g=o.get(r)??[],c=g.length>0&&g.every(l=>m.includes(l));return{connection_id:r,selected_tools:m.length===0||c?null:m,selected_resources:e[r]??null,selected_prompts:s[r]??null}})}function ys(n){const e=Z.c(110),{gateway:s,activeThreadId:o,setActiveThreadId:f}=n,{data:r}=Ct.useSession(),m=r?.user,g=Ft();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={},e[0]=c):c=e[0];const l=Qe(c);let d;e[1]!==l?(d={connections:l,binding:"LLMS"},e[1]=l,e[2]=d):d=e[2];const[h]=Et(d),p=!!h,{locator:b,org:u}=lt(),x=Ye();let v;e[3]!==b?(v=ut.chatSelectedModel(b),e[3]=b,e[4]=v):v=e[4];const[N,I]=Dt(v,g,Ss),j=ot();let y;e[5]!==s||e[6]!==j?(y=D=>{const O={id:D.id,title:D.title,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),hidden:!1,gatewayId:s.id};j.insert.mutate(O)},e[5]=s,e[6]=j,e[7]=y):y=e[7];let S;e[8]!==o||e[9]!==y?(S={threadId:o,systemPrompt:us,onCreateThread:y},e[8]=o,e[9]=y,e[10]=S):S=e[10];const a=Vt(S),{inputValue:C,setInputValue:_,branchContext:E,clearBranch:R}=Bt(),{isEmpty:q}=a,U=!!N;let T;e[11]!==o||e[12]!==a||e[13]!==R||e[14]!==s||e[15]!==U||e[16]!==N||e[17]!==_||e[18]!==m?.image||e[19]!==m?.name?(T=async D=>{if(!U||!N){Je.error("No model configured");return}_(""),R();const O={created_at:new Date().toISOString(),thread_id:o,model:{id:N.id,connectionId:N.connectionId,provider:N.provider??void 0,limits:N.limits??void 0},gateway:{id:s.id},user:{avatar:m?.image??void 0,name:m?.name??"you"}};await a.sendMessage(D,O)},e[11]=o,e[12]=a,e[13]=R,e[14]=s,e[15]=U,e[16]=N,e[17]=_,e[18]=m?.image,e[19]=m?.name,e[20]=T):T=e[20];const i=T;let w;e[21]!==I?(w=D=>{I(D)},e[21]=I,e[22]=w):w=e[22];const A=w;let F;e[23]!==E||e[24]!==R||e[25]!==f||e[26]!==_?(F=()=>{E&&(f(E.originalThreadId),R(),_(""))},e[23]=E,e[24]=R,e[25]=f,e[26]=_,e[27]=F):F=e[27];const P=F;if(!p){const D=m?.id??"";let O;e[28]!==x||e[29]!==u.slug?(O=()=>x({to:"/$org/mcps",params:{org:u.slug},search:{action:"create"}}),e[28]=x,e[29]=u.slug,e[30]=O):O=e[30];let he;e[31]!==l||e[32]!==u.id||e[33]!==u.slug||e[34]!==O||e[35]!==D?(he=t.jsx(Y.Main,{className:"h-full relative overflow-hidden",children:t.jsx(Y.EmptyState,{children:t.jsx(Ot,{description:"Connect to a model provider to unlock AI-powered features in this Hub.",orgSlug:u.slug,orgId:u.id,userId:D,allConnections:l,onInstallMcpServer:O})})}),e[31]=l,e[32]=u.id,e[33]=u.slug,e[34]=O,e[35]=D,e[36]=he):he=e[36];let ie;e[37]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx(Y.Footer,{}),e[37]=ie):ie=e[37];let re;return e[38]!==he?(re=t.jsxs(Y,{children:[he,ie]}),e[38]=he,e[39]=re):re=e[39],re}const B=s.title||"Gateway";let M;e[40]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(Xe,{size:32}),e[40]=M):M=e[40];let k;e[41]!==s.icon||e[42]!==B?(k=t.jsx(Fe,{icon:s.icon,name:B,size:"lg",fallbackIcon:M,className:"size-[60px]! rounded-[18px]!"}),e[41]=s.icon,e[42]=B,e[43]=k):k=e[43];const X=s.title||"Hub Chat";let H;e[44]!==X?(H=t.jsx("h3",{className:"text-xl font-medium text-foreground",children:X}),e[44]=X,e[45]=H):H=e[45];let G;e[46]!==s.description?(G=s.description?t.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:s.description}):null,e[46]=s.description,e[47]=G):G=e[47];let L;e[48]!==k||e[49]!==H||e[50]!==G?(L=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[k,H,G]}),e[48]=k,e[49]=H,e[50]=G,e[51]=L):L=e[51];let se;e[52]===Symbol.for("react.memo_cache_sentinel")?(se=t.jsx("div",{className:"flex justify-center mt-6",children:t.jsx(Le,{size:20,className:"animate-spin text-muted-foreground"})}),e[52]=se):se=e[52];let J;e[53]!==i?(J=D=>{i(D.description??D.name)},e[53]=i,e[54]=J):J=e[54];let ae;e[55]!==s.id||e[56]!==J?(ae=t.jsx(Ke,{fallback:null,children:t.jsx($.Suspense,{fallback:se,children:t.jsx(Gt,{gatewayId:s.id,onSelect:J})})}),e[55]=s.id,e[56]=J,e[57]=ae):ae=e[57];let ne;e[58]!==L||e[59]!==ae?(ne=t.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-4 text-center",children:[L,ae]}),e[58]=L,e[59]=ae,e[60]=ne):ne=e[60];const ce=ne;let K;e[61]!==a.messages||e[62]!==a.status||e[63]!==ce||e[64]!==q?(K=t.jsx(Y.Main,{className:"h-full relative overflow-hidden",children:q?t.jsx(Y.EmptyState,{children:ce}):t.jsx(Y.Messages,{messages:a.messages,status:a.status,minHeightOffset:240})}),e[61]=a.messages,e[62]=a.status,e[63]=ce,e[64]=q,e[65]=K):K=e[65];let de;e[66]!==a.error||e[67]!==i?(de=()=>{a.error&&i(`I encountered this error: ${a.error.message}. Can you help me fix it?`)},e[66]=a.error,e[67]=i,e[68]=de):de=e[68];let me;e[69]!==a.clearError||e[70]!==a.error||e[71]!==de?(me=t.jsx(Y.ErrorBanner,{error:a.error,onFixInChat:de,onDismiss:a.clearError}),e[69]=a.clearError,e[70]=a.error,e[71]=de,e[72]=me):me=e[72];let oe;e[73]!==i?(oe=()=>{i("Please continue.")},e[73]=i,e[74]=oe):oe=e[74];let W;e[75]!==a.clearFinishReason||e[76]!==a.finishReason||e[77]!==oe?(W=t.jsx(Y.FinishReasonWarning,{finishReason:a.finishReason,onContinue:oe,onDismiss:a.clearFinishReason}),e[75]=a.clearFinishReason,e[76]=a.finishReason,e[77]=oe,e[78]=W):W=e[78];let Se;e[79]!==E||e[80]!==R||e[81]!==P||e[82]!==_?(Se=t.jsx(Y.BranchPreview,{branchContext:E,clearBranchContext:R,onGoToOriginalMessage:P,setInputValue:_}),e[79]=E,e[80]=R,e[81]=P,e[82]=_,e[83]=Se):Se=e[83];let ue;e[84]!==i||e[85]!==C?(ue=async()=>{C.trim()&&await i(C.trim())},e[84]=i,e[85]=C,e[86]=ue):ue=e[86];const ve=!U,Ce=a.status==="submitted"||a.status==="streaming",ye=N?"Ask anything or @ for context":"Select a model to start chatting",we=N??void 0;let V;e[87]!==A||e[88]!==we?(V=t.jsx(Ut,{selectedModel:we,onModelChange:A,placeholder:"Model",variant:"borderless"}),e[87]=A,e[88]=we,e[89]=V):V=e[89];let le;e[90]!==a.messages?(le=t.jsx(Lt,{messages:a.messages}),e[90]=a.messages,e[91]=le):le=e[91];let fe;e[92]!==a.stop||e[93]!==C||e[94]!==_||e[95]!==ue||e[96]!==ve||e[97]!==Ce||e[98]!==ye||e[99]!==V||e[100]!==le?(fe=t.jsxs(Y.Input,{value:C,onChange:_,onSubmit:ue,onStop:a.stop,disabled:ve,isStreaming:Ce,placeholder:ye,children:[V,le]}),e[92]=a.stop,e[93]=C,e[94]=_,e[95]=ue,e[96]=ve,e[97]=Ce,e[98]=ye,e[99]=V,e[100]=le,e[101]=fe):fe=e[101];let ee;e[102]!==me||e[103]!==W||e[104]!==Se||e[105]!==fe?(ee=t.jsx(Y.Footer,{children:t.jsxs("div",{className:"max-w-2xl mx-auto w-full min-w-0 flex flex-col gap-2",children:[me,W,Se,fe]})}),e[102]=me,e[103]=W,e[104]=Se,e[105]=fe,e[106]=ee):ee=e[106];let Q;return e[107]!==K||e[108]!==ee?(Q=t.jsxs(Y,{children:[K,ee]}),e[107]=K,e[108]=ee,e[109]=Q):Q=e[109],Q}function Ss(n,e){return n.id===e.id&&n.connectionId===e.connectionId}function Cs(n){const e=Z.c(2);let s;return e[0]!==n?(s=t.jsx(Y.Provider,{children:t.jsx(ys,{...n})}),e[0]=n,e[1]=s):s=e[1],s}function ws(n){const e=Z.c(41),{form:s,gateway:o,icon:f}=n;let r;e[0]!==s?(r=s.watch("title")||"Hub",e[0]=s,e[1]=r):r=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Xe,{}),e[2]=m):m=e[2];let g;e[3]!==f||e[4]!==r?(g=t.jsx(Fe,{icon:f,name:r,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:m}),e[3]=f,e[4]=r,e[5]=g):g=e[5];let c;e[6]!==s.control?(c=t.jsx(Re,{control:s.control,name:"status",render:ks}),e[6]=s.control,e[7]=c):c=e[7];let l;e[8]!==g||e[9]!==c?(l=t.jsxs("div",{className:"flex items-start justify-between",children:[g,c]}),e[8]=g,e[9]=c,e[10]=l):l=e[10];let d;e[11]!==s.control?(d=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(Re,{control:s.control,name:"title",render:Ts}),t.jsx(Re,{control:s.control,name:"description",render:Is})]}),e[11]=s.control,e[12]=d):d=e[12];let h;e[13]!==l||e[14]!==d?(h=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[l,d]}),e[13]=l,e[14]=d,e[15]=h):h=e[15];let p;e[16]!==s.control?(p=t.jsxs("div",{className:"flex flex-col gap-4 p-5",children:[t.jsx(Re,{control:s.control,name:"tool_selection_mode",render:_s}),t.jsx(Re,{control:s.control,name:"tool_selection_strategy",render:Ns})]}),e[16]=s.control,e[17]=p):p=e[17];let b;e[18]!==h||e[19]!==p?(b=t.jsxs("div",{className:"flex flex-col",children:[h,p]}),e[18]=h,e[19]=p,e[20]=b):b=e[20];let u;e[21]!==s||e[22]!==b?(u=t.jsx("div",{className:"lg:border-r border-b lg:border-b-0 border-border overflow-auto",children:t.jsx(qt,{...s,children:b})}),e[21]=s,e[22]=b,e[23]=u):u=e[23];let x;e[24]!==o.id||e[25]!==o.title?(x=o.title||`hub-${o.id.slice(0,8)}`,e[24]=o.id,e[25]=o.title,e[26]=x):x=e[26];const v=`${window.location.origin}/mcp/gateway/${o.id}`;let N;e[27]!==x||e[28]!==v?(N=t.jsx("div",{className:"p-5",children:t.jsx(hs,{serverName:x,gatewayUrl:v})}),e[27]=x,e[28]=v,e[29]=N):N=e[29];let I;e[30]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("span",{className:"flex-1 text-sm text-foreground",children:"Last Updated"}),e[30]=I):I=e[30];let j;e[31]!==o.updated_at?(j=o.updated_at?ts(new Date(o.updated_at),{addSuffix:!1}):"Unknown",e[31]=o.updated_at,e[32]=j):j=e[32];let y;e[33]!==j?(y=t.jsxs("div",{className:"flex items-center gap-4 p-5 border-t border-border",children:[I,t.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:j})]}),e[33]=j,e[34]=y):y=e[34];let S;e[35]!==N||e[36]!==y?(S=t.jsxs("div",{className:"flex flex-col overflow-auto",children:[N,y]}),e[35]=N,e[36]=y,e[37]=S):S=e[37];let a;return e[38]!==u||e[39]!==S?(a=t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] h-full",children:[u,S]}),e[38]=u,e[39]=S,e[40]=a):a=e[40],a}function Ns(n){const{field:e}=n;return t.jsxs(De,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(rt,{className:"mb-0",children:"Gateway Strategy"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(pe,{children:t.jsxs(ge,{children:[t.jsx(je,{asChild:!0,children:t.jsx(te,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Hub strategy help",children:t.jsx(it,{size:14,className:"text-muted-foreground"})})}),t.jsx(be,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Passthrough:"})," Pass tools through as-is (default)."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Smart Tool Selection:"})," ","Intelligent tool selection behavior."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Code Execution:"})," Code execution behavior."]})]})})]})}),t.jsxs(at,{value:e.value,onValueChange:e.onChange,children:[t.jsx(Ve,{children:t.jsx(ct,{className:"w-[180px]",children:t.jsx(dt,{})})}),t.jsxs(mt,{children:[t.jsx(Ae,{value:"passthrough",children:"Passthrough"}),t.jsx(Ae,{value:"smart_tool_selection",children:"Smart Tool Selection"}),t.jsx(Ae,{value:"code_execution",children:"Code Execution"})]})]})]})]}),t.jsx(Be,{})]})}function _s(n){const{field:e}=n;return t.jsxs(De,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(rt,{className:"mb-0",children:"Selection Mode"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(pe,{children:t.jsxs(ge,{children:[t.jsx(je,{asChild:!0,children:t.jsx(te,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Selection mode help",children:t.jsx(it,{size:14,className:"text-muted-foreground"})})}),t.jsx(be,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Include:"})," Only selected items are exposed."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Exclude:"})," All items except selected ones are exposed."]})]})})]})}),t.jsxs(at,{value:e.value,onValueChange:e.onChange,children:[t.jsx(Ve,{children:t.jsx(ct,{className:"w-[180px]",children:t.jsx(dt,{})})}),t.jsxs(mt,{children:[t.jsx(Ae,{value:"inclusion",children:"Include Selected"}),t.jsx(Ae,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),t.jsx(Be,{})]})}function Is(n){const{field:e}=n;return t.jsxs(De,{className:"w-full space-y-0",children:[t.jsx(Ve,{children:t.jsx(Ze,{...e,value:e.value||"",className:"h-auto text-base text-muted-foreground leading-6 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(Be,{})]})}function Ts(n){const{field:e}=n;return t.jsxs(De,{className:"w-full space-y-0",children:[t.jsx(Ve,{children:t.jsx(Ze,{...e,className:"h-auto text-lg! font-medium leading-7 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Hub Name"})}),t.jsx(Be,{})]})}function ks(n){const{field:e}=n;return t.jsxs(De,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:e.value==="active"?"Active":"Inactive"}),t.jsx(Ve,{children:t.jsx(_t,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(Be,{})]})}function $s(n){const e=Z.c(104),{gateway:s,gatewayId:o,requestedTabId:f}=n,m=bt().location.href,g=vt();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={from:"/$org/gateways/$gatewayId"},e[0]=c):c=e[0];const l=Ye(c),d=Pt(),{locator:h}=lt(),[p,b]=$.useState("chat");let u;e[1]!==o||e[2]!==h?(u=ut.gatewayChatActiveThread(h,o),e[1]=o,e[2]=h,e[3]=u):u=e[3];const[x,v]=es(u,Ms);let N;e[4]!==o?(N={gatewayId:o},e[4]=o,e[5]=N):N=e[5];const{threads:I,refetch:j}=Rt(N),y=ot();let S;e[6]!==y.update?(S=async z=>{await y.update.mutateAsync({id:z,updates:{hidden:!0}})},e[6]=y.update,e[7]=S):S=e[7];const a=S;let C;e[8]===Symbol.for("react.memo_cache_sentinel")?(C={},e[8]=C):C=e[8];const _=Qe(C);let E;e[9]!==_?(E=_.map(zs),e[9]=_,e[10]=E):E=e[10];const R=E,{promptsMap:q}=zt(R),{resourcesMap:U}=Mt(R);let T;if(e[11]!==_){T=new Map;for(const z of _)z.tools&&z.tools.length>0&&T.set(z.id,z.tools.map(Ps));e[11]=_,e[12]=T}else T=e[12];let i;e[13]!==T||e[14]!==s?(i=()=>gs(s,T),e[13]=T,e[14]=s,e[15]=i):i=e[15];const[w,A]=$.useState(i);let F;e[16]!==s?(F=()=>js(s),e[16]=s,e[17]=F):F=e[17];const[P,B]=$.useState(F);let M;e[18]!==s?(M=()=>bs(s),e[18]=s,e[19]=M):M=e[19];const[k,X]=$.useState(M),[H,G]=$.useState(!1);let L;e[20]===Symbol.for("react.memo_cache_sentinel")?(L=z=>{A(z),G(!0)},e[20]=L):L=e[20];const se=L;let J;e[21]===Symbol.for("react.memo_cache_sentinel")?(J=z=>{B(z),G(!0)},e[21]=J):J=e[21];const ae=J;let ne;e[22]===Symbol.for("react.memo_cache_sentinel")?(ne=z=>{X(z),G(!0)},e[22]=ne):ne=e[22];const ce=ne;let K;e[23]===Symbol.for("react.memo_cache_sentinel")?(K=yt(ps),e[23]=K):K=e[23];const de=s.tool_selection_mode??"inclusion",me=s.tool_selection_strategy??"passthrough";let oe;e[24]!==s.description||e[25]!==s.status||e[26]!==s.title||e[27]!==de||e[28]!==me?(oe={resolver:K,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:de,tool_selection_strategy:me}},e[24]=s.description,e[25]=s.status,e[26]=s.title,e[27]=de,e[28]=me,e[29]=oe):oe=e[29];const W=St(oe),ue=W.formState.isDirty||H;let ve;e[30]!==d.update||e[31]!==T||e[32]!==W||e[33]!==o||e[34]!==k||e[35]!==P||e[36]!==w?(ve=async()=>{const z=W.getValues(),We=vs(w,P,k,T);await d.update.mutateAsync({id:o,data:{title:z.title,description:z.description,status:z.status,tool_selection_mode:z.tool_selection_mode,tool_selection_strategy:z.tool_selection_strategy,connections:We}}),W.reset(z),G(!1),b("chat")},e[30]=d.update,e[31]=T,e[32]=W,e[33]=o,e[34]=k,e[35]=P,e[36]=w,e[37]=ve):ve=e[37];const Ce=ve;let ye;e[38]===Symbol.for("react.memo_cache_sentinel")?(ye=[{id:"settings",label:"Settings"},{id:"tools",label:"Tools"},{id:"resources",label:"Resources"},{id:"prompts",label:"Prompts"}],e[38]=ye):ye=e[38];const we=ye,V=we.some(z=>z.id===f)?f:"settings";let le;e[39]!==l?(le=z=>{l({search:We=>({...We,tab:z}),replace:!0})},e[39]=l,e[40]=le):le=e[40];const fe=le,ee=d.update.isPending,Q=p==="edit";let D;e[41]!==g.history?(D=()=>g.history.back(),e[41]=g.history,e[42]=D):D=e[42];let O;e[43]!==V||e[44]!==s.description||e[45]!==s.icon||e[46]!==s.title||e[47]!==fe||e[48]!==Q?(O=t.jsx(Qt,{children:Q?t.jsx(Jt,{tabs:we,activeTab:V,onTabChange:fe}):t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[t.jsx(Fe,{icon:s.icon,name:s.title||"Hub",size:"xs",fallbackIcon:t.jsx(Xe,{size:12})}),t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.title}),s.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:s.description})]}):null]})]})}),e[43]=V,e[44]=s.description,e[45]=s.icon,e[46]=s.title,e[47]=fe,e[48]=Q,e[49]=O):O=e[49];const he=s.icon??"cpu_chip";let ie;e[50]!==s.title||e[51]!==he||e[52]!==m?(ie=t.jsx(Kt,{title:s.title,url:m,icon:he}),e[50]=s.title,e[51]=he,e[52]=m,e[53]=ie):ie=e[53];let re;e[54]!==x||e[55]!==a||e[56]!==Ce||e[57]!==ue||e[58]!==Q||e[59]!==ee||e[60]!==j||e[61]!==v||e[62]!==I?(re=Q?t.jsxs(t.Fragment,{children:[t.jsx(pe,{children:t.jsxs(ge,{delayDuration:0,children:[t.jsx(je,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(te,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ee,onClick:()=>b("chat"),"aria-label":"Cancel",children:t.jsx(Wt,{size:14})})})}),t.jsx(be,{side:"bottom",children:"Cancel"})]})}),ue&&t.jsx(pe,{children:t.jsxs(ge,{delayDuration:0,children:[t.jsx(je,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(te,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ee,onClick:Ce,"aria-label":"Save",children:ee?t.jsx(Le,{size:14,className:"animate-spin"}):t.jsx(ht,{size:14})})})}),t.jsx(be,{side:"bottom",children:"Save"})]})})]}):t.jsxs(t.Fragment,{children:[t.jsx(pe,{children:t.jsxs(ge,{children:[t.jsx(je,{asChild:!0,children:t.jsx(te,{type:"button",onClick:()=>v(crypto.randomUUID()),"aria-label":"New thread",variant:"outline",size:"icon",className:"size-7 border border-input",children:t.jsx(nt,{size:16})})}),t.jsx(be,{children:"New thread"})]})}),t.jsx(At,{threads:I,activeThreadId:x,onSelectThread:v,onRemoveThread:a,onOpen:()=>j(),variant:"outline"}),t.jsx(pe,{children:t.jsxs(ge,{children:[t.jsx(je,{asChild:!0,children:t.jsx(te,{type:"button",onClick:()=>b("edit"),"aria-label":"Edit",variant:"outline",size:"icon",className:"size-7 border border-input",children:t.jsx(ft,{size:16})})}),t.jsx(be,{children:"Edit Settings"})]})})]}),e[54]=x,e[55]=a,e[56]=Ce,e[57]=ue,e[58]=Q,e[59]=ee,e[60]=j,e[61]=v,e[62]=I,e[63]=re):re=e[63];let Ne;e[64]!==ie||e[65]!==re?(Ne=t.jsxs(Zt,{children:[ie,re]}),e[64]=ie,e[65]=re,e[66]=Ne):Ne=e[66];const Ue=Q?"opacity-0 pointer-events-none hidden":"opacity-100";let _e;e[67]!==Ue?(_e=xe("h-full transition-opacity duration-200 ease-out",Ue),e[67]=Ue,e[68]=_e):_e=e[68];let Ie;e[69]!==x||e[70]!==s||e[71]!==v?(Ie=t.jsx(Cs,{gateway:s,activeThreadId:x,setActiveThreadId:v}),e[69]=x,e[70]=s,e[71]=v,e[72]=Ie):Ie=e[72];let Te;e[73]!==_e||e[74]!==Ie?(Te=t.jsx("div",{className:_e,children:Ie}),e[73]=_e,e[74]=Ie,e[75]=Te):Te=e[75];const He=Q?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none hidden";let ke;e[76]!==He?(ke=xe("h-full overflow-auto transition-opacity duration-200 ease-out",He),e[76]=He,e[77]=ke):ke=e[77];let Oe;e[78]===Symbol.for("react.memo_cache_sentinel")?(Oe=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Le,{size:32,className:"animate-spin text-muted-foreground"})}),e[78]=Oe):Oe=e[78];let $e;e[79]!==V||e[80]!==q||e[81]!==U||e[82]!==W||e[83]!==s||e[84]!==k||e[85]!==P||e[86]!==w?($e=V==="settings"?t.jsx(ws,{form:W,gateway:s,icon:s.icon}):V==="tools"?t.jsx(Nt,{toolSet:w,onToolSetChange:se}):V==="resources"?t.jsx(ds,{resourceSet:P,onResourceSetChange:ae,connectionResources:U}):V==="prompts"?t.jsx(is,{promptSet:k,onPromptSetChange:ce,connectionPrompts:q}):null,e[79]=V,e[80]=q,e[81]=U,e[82]=W,e[83]=s,e[84]=k,e[85]=P,e[86]=w,e[87]=$e):$e=e[87];let Pe;e[88]!==$e?(Pe=t.jsx($.Suspense,{fallback:Oe,children:$e}),e[88]=$e,e[89]=Pe):Pe=e[89];let ze;e[90]!==V||e[91]!==Pe?(ze=t.jsx(Ke,{children:Pe},V),e[90]=V,e[91]=Pe,e[92]=ze):ze=e[92];let Me;e[93]!==ke||e[94]!==ze?(Me=t.jsx("div",{className:ke,children:ze}),e[93]=ke,e[94]=ze,e[95]=Me):Me=e[95];let Ee;e[96]!==Te||e[97]!==Me?(Ee=t.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:t.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:[Te,Me]})}),e[96]=Te,e[97]=Me,e[98]=Ee):Ee=e[98];let Ge;return e[99]!==D||e[100]!==O||e[101]!==Ne||e[102]!==Ee?(Ge=t.jsxs(Xt,{onBack:D,children:[O,Ne,Ee]}),e[99]=D,e[100]=O,e[101]=Ne,e[102]=Ee,e[103]=Ge):Ge=e[103],Ge}function Ps(n){return n.name}function zs(n){return n.id}function Ms(n){return n||crypto.randomUUID()}function Es(){const n=Z.c(10);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/gateways/$gatewayId"},n[0]=e):e=n[0];const s=Ye(e);let o;n[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/gateways/$gatewayId"},n[1]=o):o=n[1];const{gatewayId:f,org:r}=pt(o);let m;n[2]===Symbol.for("react.memo_cache_sentinel")?(m={from:"/shell/$org/gateways/$gatewayId"},n[2]=m):m=n[2];const c=gt(m).tab||"settings",l=$t(f);if(!l){let h;return n[3]!==s||n[4]!==r?(h=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(wt,{title:"Hub not found",description:"This Hub may have been deleted or you may not have access.",actions:t.jsx(te,{variant:"outline",onClick:()=>s({to:"/$org/gateways",params:{org:r}}),children:"Back to gateways"})})}),n[3]=s,n[4]=r,n[5]=h):h=n[5],h}let d;return n[6]!==l||n[7]!==f||n[8]!==c?(d=t.jsx($s,{gateway:l,gatewayId:f,requestedTabId:c}),n[6]=l,n[7]=f,n[8]=c,n[9]=d):d=n[9],d}function Rs(){const n=Z.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ke,{children:t.jsx($.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Es,{})})}),n[0]=e):e=n[0],e}function En(){const n=Z.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Rs,{}),n[0]=e):e=n[0],e}export{En as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as te,j as t,r as se,f as re,t as ie}from"./index-DEMNtulg.js";import{C as ne}from"./collection-header-od14k6u3.js";import{C as ae}from"./collection-page-BNuNM--s.js";import{C as le}from"./collection-search-LnYLnFH8.js";import{C as ce}from"./collection-table-wrapper-B0AFEn1d.js";import{C as de}from"./connection-card-r2tH19aR.js";import{E as q}from"./SearchMd-C6P9P1wF.js";import{E as me}from"./error-boundary-Ce0_dLsG.js";import{u as ue,I as he}from"./use-connection-D-LWel3A.js";import{a as ge,u as pe}from"./use-gateway-eXp_1iQc.js";import{u as fe,s as Q}from"./use-list-state-CmxR0QRn.js";import{u as xe}from"./tooltip-C7B84lYF.js";import{c as je,b as ye,d as we,A as Ce,e as be,g as Ne,a as De,f as Se}from"./alert-dialog-D6UjYOUP.js";import{B as oe}from"./badge-B-u7R38I.js";import{B as J}from"./button-B13xcF6W.js";import{b as U,D as X,a as Y,c as B}from"./dropdown-menu-uXj8nKiT.js";import{i as j}from"./CpuChip02-BtgBI59l.js";import{i as Z}from"./DotsVertical-roys0n6e.js";import{i as ve}from"./Loading01-EiDV-2FW.js";import{s as ee}from"./Trash01-Ctk7srex.js";import"./collection-display-button-D4VM0KQx.js";import"./Grid01-CkwdbRed.js";import"./view-mode-toggle-BpRlpgBn.js";import"./input-YdP8mwrf.js";import"./card-7VW-xSd-.js";import"./use-mobile-B-R7B7Hp.js";function ke(e,r){switch(r.type){case"delete":return{mode:"deleting",gateway:r.gateway};case"close":return{mode:"idle"}}}function _e(){const e=te.c(68),{org:r}=xe(),i=re();let y;e[0]!==r.slug?(y={namespace:r.slug,resource:"gateways"},e[0]=r.slug,e[1]=y):y=e[1];const s=fe(y),n=ge(),x=pe(s);let w;e[2]===Symbol.for("react.memo_cache_sentinel")?(w={},e[2]=w):w=e[2];const G=ue(w);let C;e[3]===Symbol.for("react.memo_cache_sentinel")?(C={mode:"idle"},e[3]=C):C=e[3];const[a,b]=se.useReducer(ke,C);let N;e[4]!==n.create||e[5]!==G.length||e[6]!==i||e[7]!==r.slug?(N=async()=>{if(G.length===0){ie.error("Create at least one Connection first");return}const o=await n.create.mutateAsync({title:"New Hub",description:"Hubs let you securely expose integrated tools to the outside world.",status:"active",tool_selection_strategy:"passthrough",tool_selection_mode:"inclusion",connections:[]});i({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}})},e[4]=n.create,e[5]=G.length,e[6]=i,e[7]=r.slug,e[8]=N):N=e[8];const R=N;let D;e[9]!==n.delete||e[10]!==a.gateway||e[11]!==a.mode?(D=async()=>{if(a.mode!=="deleting")return;const o=a.gateway.id;b({type:"close"});try{await n.delete.mutateAsync(o)}catch{}},e[9]=n.delete,e[10]=a.gateway,e[11]=a.mode,e[12]=D):D=e[12];const T=D;let S,v,k,_,I,$;e[13]===Symbol.for("react.memo_cache_sentinel")?(v={id:"icon",header:"",render:Be,cellClassName:"w-16 shrink-0",wrap:!0},k={id:"title",header:"Name",render:He,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},_={id:"description",header:"Description",render:Ke,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},I={id:"mode",header:"Mode",accessor:Ee,cellClassName:"w-[100px]"},$={id:"connections",header:"Connections",render:Pe,cellClassName:"w-24 shrink-0"},S={id:"status",header:"Status",render:Ae,cellClassName:"w-24 shrink-0",sortable:!0},e[13]=S,e[14]=v,e[15]=k,e[16]=_,e[17]=I,e[18]=$):(S=e[13],v=e[14],k=e[15],_=e[16],I=e[17],$=e[18]);let M;e[19]!==i||e[20]!==r.slug?(M=[v,k,_,I,$,S,{id:"actions",header:"",render:o=>t.jsxs(U,{children:[t.jsx(X,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ze,children:t.jsx(Z,{size:20})})}),t.jsxs(Y,{align:"end",onClick:Me,children:[t.jsxs(B,{onClick:l=>{l.stopPropagation(),i({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}})},children:[t.jsx(Q,{size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:l=>{l.stopPropagation(),b({type:"delete",gateway:o})},children:[t.jsx(ee,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[19]=i,e[20]=r.slug,e[21]=M):M=e[21];const O=M,V=n.create.isPending?"Creating...":"Create Hub";let z;e[22]!==n.create.isPending||e[23]!==R||e[24]!==V?(z=t.jsx(J,{onClick:R,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:n.create.isPending,children:V}),e[22]=n.create.isPending,e[23]=R,e[24]=V,e[25]=z):z=e[25];const L=z,F=a.mode==="deleting";let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=o=>!o&&b({type:"close"}),e[26]=A):A=e[26];let P;e[27]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(je,{children:"Delete Hub?"}),e[27]=P):P=e[27];const W=a.mode==="deleting"&&a.gateway.title;let c;e[28]!==W?(c=t.jsxs(ye,{children:[P,t.jsxs(we,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:W}),"."]})]}),e[28]=W,e[29]=c):c=e[29];let E;e[30]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Ce,{children:"Cancel"}),e[30]=E):E=e[30];let d;e[31]!==T?(d=t.jsxs(be,{children:[E,t.jsx(Ne,{onClick:T,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[31]=T,e[32]=d):d=e[32];let m;e[33]!==c||e[34]!==d?(m=t.jsxs(De,{children:[c,d]}),e[33]=c,e[34]=d,e[35]=m):m=e[35];let u;e[36]!==F||e[37]!==m?(u=t.jsx(Se,{open:F,onOpenChange:A,children:m}),e[36]=F,e[37]=m,e[38]=u):u=e[38];let K;e[39]===Symbol.for("react.memo_cache_sentinel")?(K=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"status",label:"Status"}],e[39]=K):K=e[39];let h;e[40]!==L||e[41]!==s.handleSort||e[42]!==s.setViewMode||e[43]!==s.sortDirection||e[44]!==s.sortKey||e[45]!==s.viewMode?(h=t.jsx(ne,{title:"Hubs",viewMode:s.viewMode,onViewModeChange:s.setViewMode,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,sortOptions:K,ctaButton:L}),e[40]=L,e[41]=s.handleSort,e[42]=s.setViewMode,e[43]=s.sortDirection,e[44]=s.sortKey,e[45]=s.viewMode,e[46]=h):h=e[46];let g;e[47]!==s?(g=o=>{o.key==="Escape"&&(s.setSearch(""),o.target.blur())},e[47]=s,e[48]=g):g=e[48];let p;e[49]!==s.search||e[50]!==s.setSearch||e[51]!==g?(p=t.jsx(le,{value:s.search,onChange:s.setSearch,placeholder:"Search for a hub...",onKeyDown:g}),e[49]=s.search,e[50]=s.setSearch,e[51]=g,e[52]=p):p=e[52];let f;e[53]!==O||e[54]!==x||e[55]!==s.handleSort||e[56]!==s.search||e[57]!==s.sortDirection||e[58]!==s.sortKey||e[59]!==s.viewMode||e[60]!==i||e[61]!==r.slug?(f=s.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:x.length===0?t.jsx(q,{image:t.jsx(j,{size:36,className:"text-muted-foreground"}),title:s.search?"No hubs found":"No hubs yet",description:s.search?`No hubs match "${s.search}"`:"Create a hub to aggregate tools from multiple Connections."}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:x.map(o=>t.jsx(de,{connection:{id:o.id,title:o.title,description:o.description,icon:o.icon,status:o.status},fallbackIcon:t.jsx(j,{}),onClick:()=>i({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}}),footer:t.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.jsxs("span",{children:[o.connections.length," connection",o.connections.length!==1?"s":""]}),t.jsx("span",{children:"•"}),t.jsx("span",{children:o.tool_selection_mode==="exclusion"?"Exclude":"Include"})]}),headerActions:t.jsxs(U,{children:[t.jsx(X,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:$e,children:t.jsx(Z,{size:20})})}),t.jsxs(Y,{align:"end",onClick:Ie,children:[t.jsxs(B,{onClick:l=>{l.stopPropagation(),i({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}})},children:[t.jsx(Q,{size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:l=>{l.stopPropagation(),b({type:"delete",gateway:o})},children:[t.jsx(ee,{size:16}),"Delete"]})]})]})},o.id))})}):t.jsx(ce,{columns:O,data:x,isLoading:!1,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,onRowClick:o=>i({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}}),emptyState:s.search?t.jsx(q,{image:t.jsx(j,{size:36,className:"text-muted-foreground"}),title:"No hubs found",description:`No hubs match "${s.search}"`}):t.jsx(q,{image:t.jsx(j,{size:36,className:"text-muted-foreground"}),title:"No hubs yet",description:"Create a hub to aggregate tools from multiple Connections."})}),e[53]=O,e[54]=x,e[55]=s.handleSort,e[56]=s.search,e[57]=s.sortDirection,e[58]=s.sortKey,e[59]=s.viewMode,e[60]=i,e[61]=r.slug,e[62]=f):f=e[62];let H;return e[63]!==u||e[64]!==h||e[65]!==p||e[66]!==f?(H=t.jsxs(ae,{children:[u,h,p,f]}),e[63]=u,e[64]=h,e[65]=p,e[66]=f,e[67]=H):H=e[67],H}function Ie(e){return e.stopPropagation()}function $e(e){return e.stopPropagation()}function Me(e){return e.stopPropagation()}function ze(e){return e.stopPropagation()}function Ae(e){return t.jsx(oe,{variant:e.status==="active"?"default":"outline",children:e.status})}function Pe(e){return t.jsx("span",{className:"text-sm text-muted-foreground",children:e.connections.length})}function Ee(e){return t.jsx(oe,{variant:"outline",className:"text-xs",children:e.tool_selection_mode==="exclusion"?"Exclude":"Include"})}function Ke(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function He(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Be(e){return t.jsx(he,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(j,{size:16})})}function mt(){const e=te.c(1);let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(me,{children:t.jsx(se.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ve,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(_e,{})})}),e[0]=r):r=e[0],r}export{mt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u,j as i,a as w,r as C,f as E}from"./index-tz4gB72W.js";import{C as _}from"./card-CXFRieEW.js";import{c as v,B as $}from"./button-BSXU4L7C.js";import{A as k}from"./avatar-DHKqC-IM.js";import{i as A}from"./AlertCircle-B6rEUVLf.js";import{s as O}from"./Plus-nu8-Nz8b.js";import{I as L}from"./input-Cb7MaM0d.js";import{C as D}from"./create-organization-dialog-DhHOFwW5.js";import"./alert-dialog-_VCwcCen.js";import"./form-Dn7fy5O5.js";import"./spinner-BUVePO6d.js";function F(t){const e=u.c(10),{children:n,className:l,onNavigate:s,showHoverRing:r}=t,x=r===void 0?!1:r;let a;e[0]!==s?(a=p=>{s&&s(p)},e[0]=s,e[1]=a):a=e[1];const m=a,d=s&&"cursor-pointer",c=x&&"hover:ring-2 hover:ring-primary";let o;e[2]!==l||e[3]!==d||e[4]!==c?(o=v("group transition-all flex flex-col gap-0",d,c,l),e[2]=l,e[3]=d,e[4]=c,e[5]=o):o=e[5];let g;return e[6]!==n||e[7]!==m||e[8]!==o?(g=i.jsx(_,{className:o,onClick:m,children:n}),e[6]=n,e[7]=m,e[8]=o,e[9]=g):g=e[9],g}function H(t){const e=u.c(7),{url:n,fallback:l,shape:s,size:r,objectFit:x,className:a}=t,m=s===void 0?"square":s,d=r===void 0?"lg":r,c=x===void 0?"contain":x;let o;return e[0]!==a||e[1]!==l||e[2]!==c||e[3]!==m||e[4]!==d||e[5]!==n?(o=i.jsx(k,{url:n,fallback:l,shape:m,size:d,objectFit:c,className:a}),e[0]=a,e[1]=l,e[2]=c,e[3]=m,e[4]=d,e[5]=n,e[6]=o):o=e[6],o}function R(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("p-4 flex flex-col gap-4",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function B(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("font-medium truncate",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("p",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function G(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("text-sm text-muted-foreground truncate",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("h3",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function q(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex flex-col gap-[2px]",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function I(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex justify-between items-start",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function M(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("p-4 border-t border-border flex justify-between items-center",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function Q(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex items-center text-xs text-muted-foreground",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function T(){const t=u.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex justify-between items-start",children:i.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg animate-pulse"})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[e,i.jsxs("div",{className:"flex flex-col gap-[2px]",children:[i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg animate-pulse"}),i.jsx("div",{className:"h-4 w-40 bg-muted rounded-lg animate-pulse"})]})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsxs(_,{className:"group transition-colors flex flex-col",children:[n,i.jsxs("div",{className:"p-4 border-t border-border flex justify-between items-center",children:[i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]}),t[2]=l):l=t[2],l}const b=Object.assign(F,{Avatar:H,AvatarSection:I,Header:R,Title:B,Subtitle:G,Content:q,Footer:M,Badge:Q,Skeleton:T}),P={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8"},V={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8"},X={1:"@min-3xl:grid-cols-1",2:"@min-3xl:grid-cols-2",3:"@min-3xl:grid-cols-3",4:"@min-3xl:grid-cols-4",5:"@min-3xl:grid-cols-5",6:"@min-3xl:grid-cols-6",7:"@min-3xl:grid-cols-7",8:"@min-3xl:grid-cols-8"},J={1:"@min-6xl:grid-cols-1",2:"@min-6xl:grid-cols-2",3:"@min-6xl:grid-cols-3",4:"@min-6xl:grid-cols-4",5:"@min-6xl:grid-cols-5",6:"@min-6xl:grid-cols-6",7:"@min-6xl:grid-cols-7",8:"@min-6xl:grid-cols-8"},K={1:"@min-7xl:grid-cols-1",2:"@min-7xl:grid-cols-2",3:"@min-7xl:grid-cols-3",4:"@min-7xl:grid-cols-4",5:"@min-7xl:grid-cols-5",6:"@min-7xl:grid-cols-6",7:"@min-7xl:grid-cols-7",8:"@min-7xl:grid-cols-8"},U={1:"@min-8xl:grid-cols-1",2:"@min-8xl:grid-cols-2",3:"@min-8xl:grid-cols-3",4:"@min-8xl:grid-cols-4",5:"@min-8xl:grid-cols-5",6:"@min-8xl:grid-cols-6",7:"@min-8xl:grid-cols-7",8:"@min-8xl:grid-cols-8"};function z(t){const e=u.c(13),{children:n,columns:l,gap:s,className:r}=t;let x;e[0]!==l?(x=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=x):x=e[1];const a=x,d=P[s===void 0?4:s],c=a.sm&&V[a.sm],o=a.md&&X[a.md],g=a.lg&&J[a.lg],p=a.xl&&K[a.xl],j=a["2xl"]&&U[a["2xl"]];let h;e[2]!==r||e[3]!==d||e[4]!==c||e[5]!==o||e[6]!==g||e[7]!==p||e[8]!==j?(h=v("w-full grid",d,c,o,g,p,j,r),e[2]=r,e[3]=d,e[4]=c,e[5]=o,e[6]=g,e[7]=p,e[8]=j,e[9]=h):h=e[9];const N=h;let f;return e[10]!==n||e[11]!==N?(f=i.jsx("div",{className:N,children:n}),e[10]=n,e[11]=N,e[12]=f):f=e[12],f}function W(t){const e=u.c(9),{count:n,columns:l,gap:s,className:r}=t,x=n===void 0?8:n;let a;e[0]!==l?(a=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=a):a=e[1];const m=a,d=s===void 0?4:s;let c;e[2]!==x?(c=Array.from({length:x}).map(Y),e[2]=x,e[3]=c):c=e[3];let o;return e[4]!==r||e[5]!==m||e[6]!==d||e[7]!==c?(o=i.jsx(z,{columns:m,gap:d,className:r,children:c}),e[4]=r,e[5]=m,e[6]=d,e[7]=c,e[8]=o):o=e[8],o}function Y(t,e){return i.jsxs("div",{className:"bg-card hover:bg-accent transition-colors flex flex-col rounded-lg animate-pulse",children:[i.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[i.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg"}),i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"}),i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"})]}),i.jsxs("div",{className:"p-4 border-t border-border flex items-center",children:[i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]},e)}const S=Object.assign(z,{Skeleton:W});function Z(t){const e=u.c(14),{query:n}=t,{data:l}=w.useListOrganizations(),s=E();let r;e[0]!==l||e[1]!==n?(r=l?n?(()=>{const c=n.toLowerCase();return l.filter(o=>o.name.toLowerCase().includes(c)||o.slug.toLowerCase().includes(c))})():l:[],e[0]=l,e[1]=n,e[2]=r):r=e[2];const x=r;if(!l||l.length===0){let c;return e[3]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:i.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"No organizations yet. Create your first organization to get started."})}),e[3]=c):c=e[3],c}if(x.length===0){let c;return e[4]!==n?(c=i.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:i.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:['No organizations found matching "',n,'".']})}),e[4]=n,e[5]=c):c=e[5],c}let a;e[6]===Symbol.for("react.memo_cache_sentinel")?(a={sm:2,md:3,lg:4},e[6]=a):a=e[6];let m;if(e[7]!==x||e[8]!==s){let c;e[10]!==s?(c=o=>i.jsxs(b,{onNavigate:()=>s({to:"/$org",params:{org:o.slug}}),children:[i.jsxs(b.Header,{children:[i.jsx(b.AvatarSection,{children:i.jsx(b.Avatar,{url:o.logo||"",fallback:o.name,size:"lg",objectFit:"contain"})}),i.jsxs(b.Content,{children:[i.jsxs(b.Subtitle,{children:["@",o.slug]}),i.jsx(b.Title,{children:o.name})]})]}),i.jsx(b.Footer,{children:i.jsxs("div",{className:"text-xs text-muted-foreground",children:["Created:"," ",new Date(o.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})]})})]},o.id),e[10]=s,e[11]=c):c=e[11],m=x.map(c),e[7]=x,e[8]=s,e[9]=m}else m=e[9];let d;return e[12]!==m?(d=i.jsx(S,{columns:a,children:m}),e[12]=m,e[13]=d):d=e[13],d}function ee(t){const e=u.c(3),{error:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(A,{size:24,className:"text-destructive"}),e[0]=l):l=e[0];let s;return e[1]!==n.message?(s=i.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:[l,i.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Error loading organizations: ",n.message]})]}),e[1]=n.message,e[2]=s):s=e[2],s}function te(){const t=u.c(20),{error:e,isPending:n}=w.useListOrganizations(),[l,s]=C.useState(""),[r,x]=C.useState(!1),a=C.useDeferredValue(l);if(n){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx("div",{className:"flex items-center justify-between mb-8",children:i.jsx("h2",{className:"text-xl font-medium",children:"My organizations"})}),t[0]=f):f=t[0];let y;return t[1]===Symbol.for("react.memo_cache_sentinel")?(y=i.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[f,i.jsx("div",{className:"@container",children:i.jsx(S.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}})})]}),t[1]=y):y=t[1],y}if(e){let f;return t[2]!==e?(f=i.jsx(ee,{error:e}),t[2]=e,t[3]=f):f=t[3],f}let m;t[4]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx("h2",{className:"text-xl font-medium",children:"My organizations"}),t[4]=m):m=t[4];let d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=f=>s(f.target.value),t[5]=d):d=t[5];let c;t[6]!==l?(c=i.jsx(L,{className:"max-w-xs",placeholder:"Search",value:l,onChange:d}),t[6]=l,t[7]=c):c=t[7];let o;t[8]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsxs($,{variant:"default",onClick:()=>x(!0),children:[i.jsx(O,{size:16}),i.jsx("span",{children:"New organization"})]}),t[8]=o):o=t[8];let g;t[9]!==c?(g=i.jsxs("div",{className:"flex items-center justify-between mb-8",children:[m,i.jsxs("div",{className:"flex items-center gap-2",children:[c,o]})]}),t[9]=c,t[10]=g):g=t[10];let p;t[11]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(S.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}}),t[11]=p):p=t[11];let j;t[12]!==a?(j=i.jsx("div",{className:"@container",children:i.jsx(C.Suspense,{fallback:p,children:i.jsx(Z,{query:a})})}),t[12]=a,t[13]=j):j=t[13];let h;t[14]!==r?(h=i.jsx(D,{open:r,onOpenChange:x}),t[14]=r,t[15]=h):h=t[15];let N;return t[16]!==g||t[17]!==j||t[18]!==h?(N=i.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[g,j,h]}),t[16]=g,t[17]=j,t[18]=h,t[19]=N):N=t[19],N}function fe(){const t=u.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"min-h-full",children:i.jsx(te,{})}),t[0]=e):e=t[0],e}export{fe as default};
|
|
1
|
+
import{c as u,j as i,a as w,r as C,f as E}from"./index-DEMNtulg.js";import{C as _}from"./card-7VW-xSd-.js";import{c as v,B as $}from"./button-B13xcF6W.js";import{A as k}from"./avatar-BHE7lL4M.js";import{i as A}from"./AlertCircle-BIlMffS8.js";import{s as O}from"./Plus-CwB-Rc8B.js";import{I as L}from"./input-YdP8mwrf.js";import{C as D}from"./create-organization-dialog-CjneLhKn.js";import"./alert-dialog-D6UjYOUP.js";import"./form-BQIYj24w.js";import"./spinner-CAJeeq5B.js";function F(t){const e=u.c(10),{children:n,className:l,onNavigate:s,showHoverRing:r}=t,x=r===void 0?!1:r;let a;e[0]!==s?(a=p=>{s&&s(p)},e[0]=s,e[1]=a):a=e[1];const m=a,d=s&&"cursor-pointer",c=x&&"hover:ring-2 hover:ring-primary";let o;e[2]!==l||e[3]!==d||e[4]!==c?(o=v("group transition-all flex flex-col gap-0",d,c,l),e[2]=l,e[3]=d,e[4]=c,e[5]=o):o=e[5];let g;return e[6]!==n||e[7]!==m||e[8]!==o?(g=i.jsx(_,{className:o,onClick:m,children:n}),e[6]=n,e[7]=m,e[8]=o,e[9]=g):g=e[9],g}function H(t){const e=u.c(7),{url:n,fallback:l,shape:s,size:r,objectFit:x,className:a}=t,m=s===void 0?"square":s,d=r===void 0?"lg":r,c=x===void 0?"contain":x;let o;return e[0]!==a||e[1]!==l||e[2]!==c||e[3]!==m||e[4]!==d||e[5]!==n?(o=i.jsx(k,{url:n,fallback:l,shape:m,size:d,objectFit:c,className:a}),e[0]=a,e[1]=l,e[2]=c,e[3]=m,e[4]=d,e[5]=n,e[6]=o):o=e[6],o}function R(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("p-4 flex flex-col gap-4",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function B(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("font-medium truncate",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("p",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function G(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("text-sm text-muted-foreground truncate",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("h3",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function q(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex flex-col gap-[2px]",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function I(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex justify-between items-start",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function M(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("p-4 border-t border-border flex justify-between items-center",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function Q(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex items-center text-xs text-muted-foreground",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function T(){const t=u.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex justify-between items-start",children:i.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg animate-pulse"})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[e,i.jsxs("div",{className:"flex flex-col gap-[2px]",children:[i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg animate-pulse"}),i.jsx("div",{className:"h-4 w-40 bg-muted rounded-lg animate-pulse"})]})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsxs(_,{className:"group transition-colors flex flex-col",children:[n,i.jsxs("div",{className:"p-4 border-t border-border flex justify-between items-center",children:[i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]}),t[2]=l):l=t[2],l}const b=Object.assign(F,{Avatar:H,AvatarSection:I,Header:R,Title:B,Subtitle:G,Content:q,Footer:M,Badge:Q,Skeleton:T}),P={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8"},V={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8"},X={1:"@min-3xl:grid-cols-1",2:"@min-3xl:grid-cols-2",3:"@min-3xl:grid-cols-3",4:"@min-3xl:grid-cols-4",5:"@min-3xl:grid-cols-5",6:"@min-3xl:grid-cols-6",7:"@min-3xl:grid-cols-7",8:"@min-3xl:grid-cols-8"},J={1:"@min-6xl:grid-cols-1",2:"@min-6xl:grid-cols-2",3:"@min-6xl:grid-cols-3",4:"@min-6xl:grid-cols-4",5:"@min-6xl:grid-cols-5",6:"@min-6xl:grid-cols-6",7:"@min-6xl:grid-cols-7",8:"@min-6xl:grid-cols-8"},K={1:"@min-7xl:grid-cols-1",2:"@min-7xl:grid-cols-2",3:"@min-7xl:grid-cols-3",4:"@min-7xl:grid-cols-4",5:"@min-7xl:grid-cols-5",6:"@min-7xl:grid-cols-6",7:"@min-7xl:grid-cols-7",8:"@min-7xl:grid-cols-8"},U={1:"@min-8xl:grid-cols-1",2:"@min-8xl:grid-cols-2",3:"@min-8xl:grid-cols-3",4:"@min-8xl:grid-cols-4",5:"@min-8xl:grid-cols-5",6:"@min-8xl:grid-cols-6",7:"@min-8xl:grid-cols-7",8:"@min-8xl:grid-cols-8"};function z(t){const e=u.c(13),{children:n,columns:l,gap:s,className:r}=t;let x;e[0]!==l?(x=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=x):x=e[1];const a=x,d=P[s===void 0?4:s],c=a.sm&&V[a.sm],o=a.md&&X[a.md],g=a.lg&&J[a.lg],p=a.xl&&K[a.xl],j=a["2xl"]&&U[a["2xl"]];let h;e[2]!==r||e[3]!==d||e[4]!==c||e[5]!==o||e[6]!==g||e[7]!==p||e[8]!==j?(h=v("w-full grid",d,c,o,g,p,j,r),e[2]=r,e[3]=d,e[4]=c,e[5]=o,e[6]=g,e[7]=p,e[8]=j,e[9]=h):h=e[9];const N=h;let f;return e[10]!==n||e[11]!==N?(f=i.jsx("div",{className:N,children:n}),e[10]=n,e[11]=N,e[12]=f):f=e[12],f}function W(t){const e=u.c(9),{count:n,columns:l,gap:s,className:r}=t,x=n===void 0?8:n;let a;e[0]!==l?(a=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=a):a=e[1];const m=a,d=s===void 0?4:s;let c;e[2]!==x?(c=Array.from({length:x}).map(Y),e[2]=x,e[3]=c):c=e[3];let o;return e[4]!==r||e[5]!==m||e[6]!==d||e[7]!==c?(o=i.jsx(z,{columns:m,gap:d,className:r,children:c}),e[4]=r,e[5]=m,e[6]=d,e[7]=c,e[8]=o):o=e[8],o}function Y(t,e){return i.jsxs("div",{className:"bg-card hover:bg-accent transition-colors flex flex-col rounded-lg animate-pulse",children:[i.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[i.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg"}),i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"}),i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"})]}),i.jsxs("div",{className:"p-4 border-t border-border flex items-center",children:[i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]},e)}const S=Object.assign(z,{Skeleton:W});function Z(t){const e=u.c(14),{query:n}=t,{data:l}=w.useListOrganizations(),s=E();let r;e[0]!==l||e[1]!==n?(r=l?n?(()=>{const c=n.toLowerCase();return l.filter(o=>o.name.toLowerCase().includes(c)||o.slug.toLowerCase().includes(c))})():l:[],e[0]=l,e[1]=n,e[2]=r):r=e[2];const x=r;if(!l||l.length===0){let c;return e[3]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:i.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"No organizations yet. Create your first organization to get started."})}),e[3]=c):c=e[3],c}if(x.length===0){let c;return e[4]!==n?(c=i.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:i.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:['No organizations found matching "',n,'".']})}),e[4]=n,e[5]=c):c=e[5],c}let a;e[6]===Symbol.for("react.memo_cache_sentinel")?(a={sm:2,md:3,lg:4},e[6]=a):a=e[6];let m;if(e[7]!==x||e[8]!==s){let c;e[10]!==s?(c=o=>i.jsxs(b,{onNavigate:()=>s({to:"/$org",params:{org:o.slug}}),children:[i.jsxs(b.Header,{children:[i.jsx(b.AvatarSection,{children:i.jsx(b.Avatar,{url:o.logo||"",fallback:o.name,size:"lg",objectFit:"contain"})}),i.jsxs(b.Content,{children:[i.jsxs(b.Subtitle,{children:["@",o.slug]}),i.jsx(b.Title,{children:o.name})]})]}),i.jsx(b.Footer,{children:i.jsxs("div",{className:"text-xs text-muted-foreground",children:["Created:"," ",new Date(o.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})]})})]},o.id),e[10]=s,e[11]=c):c=e[11],m=x.map(c),e[7]=x,e[8]=s,e[9]=m}else m=e[9];let d;return e[12]!==m?(d=i.jsx(S,{columns:a,children:m}),e[12]=m,e[13]=d):d=e[13],d}function ee(t){const e=u.c(3),{error:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(A,{size:24,className:"text-destructive"}),e[0]=l):l=e[0];let s;return e[1]!==n.message?(s=i.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:[l,i.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Error loading organizations: ",n.message]})]}),e[1]=n.message,e[2]=s):s=e[2],s}function te(){const t=u.c(20),{error:e,isPending:n}=w.useListOrganizations(),[l,s]=C.useState(""),[r,x]=C.useState(!1),a=C.useDeferredValue(l);if(n){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx("div",{className:"flex items-center justify-between mb-8",children:i.jsx("h2",{className:"text-xl font-medium",children:"My organizations"})}),t[0]=f):f=t[0];let y;return t[1]===Symbol.for("react.memo_cache_sentinel")?(y=i.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[f,i.jsx("div",{className:"@container",children:i.jsx(S.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}})})]}),t[1]=y):y=t[1],y}if(e){let f;return t[2]!==e?(f=i.jsx(ee,{error:e}),t[2]=e,t[3]=f):f=t[3],f}let m;t[4]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx("h2",{className:"text-xl font-medium",children:"My organizations"}),t[4]=m):m=t[4];let d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=f=>s(f.target.value),t[5]=d):d=t[5];let c;t[6]!==l?(c=i.jsx(L,{className:"max-w-xs",placeholder:"Search",value:l,onChange:d}),t[6]=l,t[7]=c):c=t[7];let o;t[8]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsxs($,{variant:"default",onClick:()=>x(!0),children:[i.jsx(O,{size:16}),i.jsx("span",{children:"New organization"})]}),t[8]=o):o=t[8];let g;t[9]!==c?(g=i.jsxs("div",{className:"flex items-center justify-between mb-8",children:[m,i.jsxs("div",{className:"flex items-center gap-2",children:[c,o]})]}),t[9]=c,t[10]=g):g=t[10];let p;t[11]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(S.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}}),t[11]=p):p=t[11];let j;t[12]!==a?(j=i.jsx("div",{className:"@container",children:i.jsx(C.Suspense,{fallback:p,children:i.jsx(Z,{query:a})})}),t[12]=a,t[13]=j):j=t[13];let h;t[14]!==r?(h=i.jsx(D,{open:r,onOpenChange:x}),t[14]=r,t[15]=h):h=t[15];let N;return t[16]!==g||t[17]!==j||t[18]!==h?(N=i.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[g,j,h]}),t[16]=g,t[17]=j,t[18]=h,t[19]=N):N=t[19],N}function fe(){const t=u.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"min-h-full",children:i.jsx(te,{})}),t[0]=e):e=t[0],e}export{fe as default};
|