PageSourceSearch

https://www.007icu.top/assets/workspace-D-pHFvtA.js

js 007icu.top collected 2026-10-09 04:35:57 UTC 15,995 bytes, 48 lines download raw bytes

1import{n as e,o as t}from"./rolldown-runtime-CMxvf4Kt.js";import{F as n,G as r,L as i,U as a}from"../vendor/vendor-data-runtime-nLFaCKB0.js";import{Ao as o,Et as s,g as c,jo as l}from"./app-const-BzFqCjOv.js";import{Do as u,Fn as d,Ln as f,bo as p,go as m,jo as h,to as g,vo as _,wo as v,zn as y}from"./ScrollArea-CdDxdn_v.js";import{Ia as b,Sa as x,ea as ee,ei as te,n as S,oi as ne,qn as C}from"./es-D7HWafs1.js";import{at as re,lt as w,n as T,r as ie,xn as ae}from"./es-D3_QMuVV.js";import{Ti as E,Vc as oe,Vm as se,et as D,hn as ce,lg as O,rd as le,su as ue,tp as de}from"../vendor/vendor-icons-BXJMWD35.js";import{O as k,n as A,v as j,x as fe}from"./base-ui-Bi3Dz7GG.js";import{r as pe}from"./store-DZ_eFvAj.js";import{n as M}from"./file-DreLu7dP.js";import{ir as me,nr as he}from"./index-Doip7UYu.js";import{n as ge,t as _e}from"./useWorkspaceAwareNavigate--pLVtz2A.js";import{n as ve,t as ye}from"./AsyncError-DaHIxwPg.js";import{n as be,t as xe}from"./AvatarUpload-B8jbgwaS.js";import{n as Se,t as Ce}from"./useCommunityWorkspaceProfile-CPSJ04Cm.js";import{n as we,t as Te}from"./NotFound-WL3EhSZt.js";import{n as N,r as Ee}from"./ListLoading-Caxr8pBY.js";import{c as De,d as Oe,p as ke,s as Ae,u as je}from"./UserPluginCard-B6dl35Yr.js";import{a as Me,c as P,i as Ne,l as Pe,n as Fe,o as Ie,r as Le,s as Re,t as ze}from"./WorkspacePluginList-YRrr8oD_.js";import{n as Be,t as Ve}from"./useUserDetail-Cs4Xc3hT.js";import{i as He,n as Ue,o as We,r as Ge,t as Ke}from"./communityWorkspaceProfile-BZAGyu1l.js";var qe,F,I,L,Je=e((()=>{S(),p(),qe=t(l()),F=t(o()),I=v(({css:e,cssVar:t})=>({banner:e`
2    position: absolute;
3    inset-block-start: 0;
4    inset-inline-start: 0;
5
6    width: 100%;
7    height: 160px;
8    padding: 16px;
9
10    ${h.sm} {
11      position: relative;
12
13      width: calc(100% + 32px);
14      height: 120px;
15      margin-block: -16px 0;
16      margin-inline: -16px;
17    }
18
19    @media (width <= 1720px) {
20      height: 144px;
21      padding: 0;
22    }
23  `,bannerAvatar:e`
24    filter: blur(100px);
25  `,bannerInner:e`
26    position: relative;
27
28    overflow: hidden;
29
30    width: 100%;
31    height: 100%;
32    border-radius: ${t.borderRadiusLG};
33
34    background: ${t.colorFillTertiary};
35
36    @media (width <= 1720px) {
37      border-radius: 0;
38    }
39  `,placeholder:e`
40    position: relative;
41    width: 100%;
42    height: 64px;
43    min-height: 64px;
44
45    ${h.sm} {
46      display: none;
47    }
48  `})),L=(0,qe.memo)(({avatar:e,bannerUrl:t})=>{let n=t||e,r=!t&&!!e;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:I.banner,children:(0,F.jsx)(m,{className:I.bannerInner,children:n&&(0,F.jsx)(`div`,{className:r?I.bannerAvatar:void 0,style:{backgroundImage:`url(${n})`,backgroundPosition:`center`,backgroundSize:`cover`,height:`100%`,width:`100%`}})})}),(0,F.jsx)(`div`,{className:I.placeholder})]})})})),R,z,B,Ye,Xe,Ze=e((()=>{S(),A(),p(),D(),R=t(l()),n(),P(),Je(),z=t(o()),B=e=>{if(e)return e.startsWith(`/`)?`${window.location.origin}${e}`:e},Ye=e=>`/community/org/${e}`,Xe=(0,R.memo)(()=>{let{t:e}=i(`discover`),{user:t,onEditWorkspaceProfile:n,isLoading:r}=Pe(),a=t.displayName||t.userName||t.namespace,o=t.userName||t.namespace,s=!o,c=(0,R.useMemo)(()=>B(t.avatarUrl),[t.avatarUrl]),l=(0,R.useMemo)(()=>B(t.bannerUrl),[t.bannerUrl]),p=o?Ye(o):void 0,m=(0,R.useCallback)(()=>{p&&window.open(p,`_blank`,`noopener,noreferrer`)},[p]);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(L,{avatar:c,bannerUrl:l}),(0,z.jsxs)(_,{gap:16,children:[(0,z.jsx)(x,{avatar:c,shape:`square`,size:64,style:{boxShadow:`0 0 0 4px ${u.colorBgContainer}`,flexShrink:0}}),(0,z.jsxs)(_,{horizontal:!0,align:`flex-start`,gap:16,justify:`space-between`,children:[(0,z.jsxs)(_,{gap:4,style:{overflow:`hidden`},children:[(0,z.jsx)(d,{ellipsis:!0,as:`h1`,fontSize:24,style:{margin:0},weight:`bold`,children:a}),o&&(0,z.jsxs)(d,{ellipsis:!0,fontSize:12,type:`secondary`,children:[`@`,o]})]}),r?(0,z.jsx)(C.Button,{active:!0,style:{height:32,width:140}}):(0,z.jsxs)(_,{horizontal:!0,gap:8,children:[p&&(0,z.jsx)(k,{icon:de,shape:`round`,onClick:m,children:e(`user.openWorkspacePublicProfile`)}),n&&(0,z.jsx)(k,{icon:E,shape:`round`,type:`primary`,onClick:n,children:e(s?`user.setupWorkspaceProfile`:`user.editWorksp
48aceProfile`)})]})]}),t.description&&(0,z.jsx)(d,{as:`p`,children:t.description}),(0,z.jsx)(f,{children:(0,z.jsx)(_,{horizontal:!0,align:`center`,gap:8,children:t.socialLinks?.website&&(0,z.jsx)(y,{title:t.socialLinks?.website,children:(0,z.jsx)(`a`,{href:t?.socialLinks?.website,rel:`noopener noreferrer`,target:`_blank`,children:(0,z.jsx)(b,{icon:le,size:20,variant:`outlined`})})})})})]})]})})})),V,H,Qe,$e=e((()=>{S(),A(),D(),V=t(l()),n(),Ee(),De(),Ve(),P(),Ie(),Ne(),Fe(),H=t(o()),Qe=(0,V.memo)(()=>{let{t:e}=i(`discover`),t=Pe(),{canEdit:n,isLoading:r,onEditWorkspaceProfile:a,user:o}=t,{handleStatusChange:s}=Be({onMutate:t.onRefreshProfile}),c=(0,V.useMemo)(()=>({agentCount:t.agentCount,agentGroups:t.agentGroups,agents:t.agents,groupCount:t.groupCount,isOwner:n,mobile:t.mobile,onStatusChange:n?s:void 0,plugins:t.plugins,skills:t.skills,totalInstalls:t.totalInstalls,user:t.user}),[t,n,s]);return!o.namespace&&r?(0,H.jsx)(N,{length:4,rows:4}):o.namespace?(0,H.jsx)(Ae,{config:c,children:(0,H.jsxs)(_,{gap:32,children:[(0,H.jsx)(Me,{}),(0,H.jsx)(Le,{}),(0,H.jsx)(ze,{})]})}):(0,H.jsx)(m,{height:`100%`,style:{minHeight:`42vh`},width:`100%`,children:(0,H.jsxs)(_,{align:`center`,gap:16,style:{maxWidth:420,textAlign:`center`},children:[(0,H.jsx)(g,{icon:O,size:40}),(0,H.jsxs)(_,{gap:8,children:[(0,H.jsx)(d,{as:`h2`,fontSize:24,style:{margin:0},weight:`bold`,children:e(`user.workspaceProfile.setup.empty.title`)}),(0,H.jsx)(d,{type:`secondary`,children:e(`user.workspaceProfile.setup.empty.description`)})]}),n&&a&&(0,H.jsx)(k,{type:`primary`,onClick:a,children:e(`user.workspaceProfile.setup.save`)})]})})})})),U,W,G,K,et,tt,nt,rt,q,it=e((()=>{c(),S(),A(),T(),p(),D(),U=t(l()),n(),Ue(),be(),M(),W=t(o()),G=e=>e?.trim()||void 0,K=2*1024*1024,et=`${s.replace(/^https?:\/\//,``)}/community/org/`,tt=e=>e.trim().toLowerCase().replaceAll(/[^a-z0-9-]/g,`-`).replaceAll(/-+/g,`-`).replaceAll(/^-|-$/g,``).slice(0,32),nt=/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/,rt=e=>e.length>=3&&e.length<=32&&nt.test(e),q=(0,U.memo)(({user:e,onSuccess:t})=>{let{t:n}=i(`discover`),{message:r}=ae.useApp(),{close:a}=fe(),[o]=w.useForm(),s=pe(e=>e.uploadWithProgress),[c,l]=(0,U.useState)(e.avatarUrl??null),[f,p]=(0,U.useState)(!1),[h,v]=(0,U.useState)(e.bannerUrl??null),[b,x]=(0,U.useState)(!1),[S,C]=(0,U.useState)(!1),T=!e.namespace,E=(w.useWatch(`namespace`,o)??``).trim(),[D,O]=(0,U.useState)(`idle`);(0,U.useEffect)(()=>{if(!T||!rt(E)){O(`idle`);return}O(`checking`);let e=!1,t=setTimeout(async()=>{try{let t=await Ke(E);e||O(t?`available`:`taken`)}catch{e||O(`idle`)}},400);return()=>{e=!0,clearTimeout(t)}},[T,E]);let de=(0,U.useMemo)(()=>{if(!T||D===`idle`)return null;let e={available:u.colorSuccess,checking:u.colorTextSecondary,taken:u.colorError}[D];return(0,W.jsxs)(_,{horizontal:!0,align:`center`,gap:6,style:{color:e,fontSize:12},children:[D===`checking`&&(0,W.jsx)(g,{spin:!0,icon:oe,size:13}),n(`user.workspaceProfile.fields.namespace.${D}`)]})},[T,D,n]),A=(0,U.useCallback)(async e=>{if(e.size>K){r.error(n(`user.workspaceProfile.errors.fileTooLarge`));return}p(!0);try{let t=await s({file:e});if(!t?.url){r.error(n(`user.workspaceProfile.errors.uploadFailed`));return}l(t.url.startsWith(`/`)?`${window.location.origin}${t.url}`:t.url)}catch(e){console.error(`[WorkspaceProfileModal] Avatar upload failed:`,e),r.error(n(`user.workspaceProfile.errors.uploadFailed`))}finally{p(!1)}},[r,n,s]),j=(0,U.useCallback)(async e=>{let t=e.file;if(t.size>K){r.error(n(`user.workspaceProfile.errors.fileTooLarge`)),e.onError?.(Error(`File too large`));return}x(!0);try{let i=await s({file:t});if(!i?.url){r.error(n(`user.workspaceProfile.errors.uploadFailed`)),e.onError?.(Error(`Upload failed`));return}v(i.url.startsWith(`/`)?`${window.location.origin}${i.url}`:i.url),e.onSuccess?.(i)}catch(t){console.error(`[WorkspaceProfileModal] Banner upload failed:`,t),r.error(n(`user.workspaceProfile.errors.uploadFailed`)),e.onError?.(t)}finally{x(!1)}},[r,n,s]),M=(0,U.useCallback)(async()=>{if(S)return;let e=await o.validateFields();if(T&&D===`taken`){r.error(n(`user.workspaceProfile.fields.namespace.taken`));return}C(!0);try{let i={avatarUrl:c,bannerUrl:h,description:G(e.description),displayName:e.displayName.trim(),websiteUrl:G(e.websiteUrl)};T?await He({...i,namespace:e.namespace.trim()}):await We(i),r.success(n(T?`user.workspaceProfile.setup.success`:`user.workspaceProfile.success`)),await t?.(),a()}catch(e){console.error(`[WorkspaceProfileModal] Failed to update workspace profile:`,e),T&&Ge(e)?(O(`taken`),r.error(n(`user.w
48orkspaceProfile.fields.namespace.taken`))):r.error(n(T?`user.workspaceProfile.setup.failed`:`user.workspaceProfile.failed`))}finally{C(!1)}},[c,h,a,o,T,S,r,D,t,n]),me=(0,U.useMemo)(()=>[{children:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(w.Item,{label:n(`user.workspaceProfile.fields.websiteUrl`),name:`websiteUrl`,rules:[{message:n(`user.workspaceProfile.errors.url`),type:`url`}],children:(0,W.jsx)(ne,{placeholder:n(`user.workspaceProfile.fields.websiteUrl.placeholder`),prefix:(0,W.jsx)(g,{color:u.colorTextSecondary,icon:le,style:{marginRight:8}})})}),(0,W.jsx)(w.Item,{label:(0,W.jsxs)(_,{horizontal:!0,align:`center`,gap:4,children:[n(`user.workspaceProfile.fields.bannerUrl`),(0,W.jsx)(y,{title:n(`user.workspaceProfile.fields.bannerUrl.tooltip`),children:(0,W.jsx)(se,{size:14,style:{cursor:`help`,opacity:.5}})})]}),children:(0,W.jsxs)(_,{gap:8,width:`100%`,children:[(0,W.jsx)(ie,{accept:`image/*`,customRequest:j,maxCount:1,showUploadList:!1,style:{display:`block`,width:`100%`},children:(0,W.jsx)(`div`,{style:{backgroundColor:h?void 0:u.colorFillTertiary,backgroundImage:h?`url(${h})`:void 0,backgroundPosition:`center`,backgroundSize:`cover`,borderRadius:u.borderRadiusLG,cursor:`pointer`,height:160,overflow:`hidden`,position:`relative`,width:`100%`},children:(0,W.jsx)(m,{style:{background:h?`rgba(0,0,0,0.4)`:`transparent`,height:`100%`,opacity:+!h,transition:`opacity 0.2s`,width:`100%`},onMouseEnter:e=>{e.currentTarget.style.opacity=`1`},onMouseLeave:e=>{h&&(e.currentTarget.style.opacity=`0`)},children:(0,W.jsxs)(_,{align:`center`,gap:8,children:[(0,W.jsx)(ue,{size:24,style:{color:h?`#fff`:u.colorTextSecondary}}),(0,W.jsx)(d,{style:{color:h?`#fff`:u.colorTextSecondary,fontSize:12},children:n(b?`user.workspaceProfile.fields.bannerUrl.uploading`:`user.workspaceProfile.fields.bannerUrl.clickToUpload`)})]})})})}),h&&(0,W.jsx)(_,{horizontal:!0,align:`center`,gap:8,justify:`flex-end`,children:(0,W.jsx)(d,{style:{color:u.colorError,cursor:`pointer`,fontSize:12},onClick:e=>{e.stopPropagation(),v(null)},children:(0,W.jsxs)(_,{horizontal:!0,align:`center`,gap:4,children:[(0,W.jsx)(ce,{size:12}),n(`user.workspaceProfile.fields.bannerUrl.remove`)]})})})]})})]}),key:`optional`,label:n(`user.workspaceProfile.optional.toggle`)}],[b,h,j,n]);return(0,W.jsxs)(_,{gap:20,padding:24,children:[(0,W.jsxs)(w,{form:o,layout:`vertical`,initialValues:{description:e.description??void 0,displayName:e.displayName??e.userName??e.namespace,namespace:e.namespace||tt(e.displayName??e.userName??``),websiteUrl:e.socialLinks?.website},children:[(0,W.jsxs)(_,{horizontal:!0,gap:24,children:[(0,W.jsx)(_,{flex:1,children:(0,W.jsx)(w.Item,{label:n(`user.workspaceProfile.fields.displayName`),name:`displayName`,rules:[{message:n(`user.workspaceProfile.errors.displayName`),required:!0},{max:50,message:n(`user.workspaceProfile.fields.displayName.maxLength`)}],children:(0,W.jsx)(ne,{showCount:!0,maxLength:50,placeholder:n(`user.workspaceProfile.fields.displayName.placeholder`)})})}),(0,W.jsx)(w.Item,{children:(0,W.jsx)(xe,{allowDelete:!!c,loading:f,shape:`square`,size:80,value:c||void 0,onDelete:()=>l(null),onUpload:A})})]}),T&&(0,W.jsx)(w.Item,{extra:de,label:n(`user.workspaceProfile.fields.namespace`),name:`namespace`,rules:[{message:n(`user.workspaceProfile.errors.namespace.required`),required:!0},{max:32,message:n(`user.workspaceProfile.errors.namespace.length`)},{min:3,message:n(`user.workspaceProfile.errors.namespace.length`)},{message:n(`user.workspaceProfile.errors.namespace.pattern`),pattern:/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/}],children:(0,W.jsx)(re,{showCount:!0,addonBefore:et,maxLength:32,placeholder:n(`user.workspaceProfile.fields.namespace.placeholder`)})}),(0,W.jsx)(w.Item,{label:n(`user.workspaceProfile.fields.description`),name:`description`,rules:[{max:200,message:n(`user.workspaceProfile.fields.description.maxLength`)}],children:(0,W.jsx)(te,{showCount:!0,maxLength:200,placeholder:n(`user.workspaceProfile.fields.description.placeholder`),rows:3})}),(0,W.jsx)(ee,{defaultActiveKey:T?void 0:[`optional`],expandIconPlacement:`end`,items:me,size:`small`,variant:`borderless`,styles:{header:{cursor:`pointer`,width:`100%`},title:{cursor:`pointer`,width:`100%`}}})]}),(0,W.jsxs)(_,{horizontal:!0,gap:8,justify:`flex-end`,children:[(0,W.jsx)(k,{disabled:S,onClick:a,children:n(`user.w
48orkspaceProfile.cancel`)}),(0,W.jsx)(k,{disabled:T&&D===`taken`,loading:S,type:`primary`,onClick:M,children:n(T?`user.workspaceProfile.setup.save`:`user.workspaceProfile.save`)})]})]})}),q.displayName=`WorkspaceProfileModalContent`})),J,at,ot=e((()=>{S(),A(),a(),it(),J=t(o()),at=({user:e,onSuccess:t})=>{let n=r(e.namespace?`user.workspaceProfile.title`:`user.workspaceProfile.setup.title`,{ns:`discover`});return j({content:(0,J.jsx)(q,{user:e,onSuccess:t}),footer:null,maskClosable:!0,styles:{content:{padding:0}},title:e.namespace?n:(0,J.jsxs)(_,{gap:8,children:[(0,J.jsx)(`span`,{children:n}),(0,J.jsx)(d,{style:{fontSize:14,fontWeight:400,lineHeight:1.5},type:`secondary`,children:r(`user.workspaceProfile.setup.description`,{ns:`discover`})})]}),width:`min(92vw, 560px)`})}})),st,Y,ct,lt=e((()=>{S(),p(),st=t(l()),Ee(),Je(),Y=t(o()),ct=(0,st.memo)(()=>(0,Y.jsxs)(_,{gap:24,width:`100%`,children:[(0,Y.jsx)(L,{}),(0,Y.jsxs)(_,{gap:16,children:[(0,Y.jsx)(C.Avatar,{shape:`square`,size:64,style:{boxShadow:`0 0 0 4px ${u.colorBgContainer}`,flexShrink:0}}),(0,Y.jsx)(C,{paragraph:{rows:1}})]}),(0,Y.jsx)(N,{length:4,rows:4})]}))})),X,Z,Q,$;e((()=>{S(),X=t(l()),Ce(),ve(),_e(),he(),we(),P(),Ze(),je(),$e(),ot(),lt(),Z=t(o()),Q=(0,X.memo)(({mobile:e})=>
48{let{avatarUrl:t,bannerUrl:n,canEdit:r,description:i,displayName:a,isLoading:o,profile:s,refresh:c,username:l}=Se(),u=ge(),{data:d,error:f,isLoading:p,mutate:h}=me(e=>e.useUserProfile)({username:l??``}),g=(0,X.useMemo)(()=>{let e=a??l;return e?{agentGroups:[],agents:[],favoriteAgentGroups:[],favoriteAgents:[],forkedAgentGroups:[],forkedAgents:[],plugins:[],skills:[],user:{avatarUrl:t??null,bannerUrl:n??null,createdAt:``,description:i??null,displayName:e,followersCount:0,followingCount:0,id:s?.accountId??0,namespace:l??``,socialLinks:null,type:`organization`,userName:null}}:null},[s?.accountId,t,n,i,a,l]),_=(0,X.useMemo)(()=>Oe({fallbackProfile:g,marketProfile:d}),[d,g]),v=(0,X.useCallback)(()=>{if(s){u(`/community/workspace/settings`);return}_?.user&&at({onSuccess:async()=>{await Promise.all([h(),c()])},user:_.user})},[s,h,u,_?.user,c]),y=(0,X.useCallback)(async()=>{await Promise.all([h(),c()])},[h,c]),b=(0,X.useMemo)(()=>{if(!_?.user)return null;let{user:t,agents:n,agentGroups:i,skills:a,plugins:c}=_,l=n.reduce((e,t)=>e+(t.installCount||0),0),u=ke({canEdit:r,marketOrganizationProfile:s,user:t});return{agentCount:n.length,agentGroups:i||[],agents:n,canEdit:u,groupCount:i?.length||0,isLoading:o||p,mobile:e,onEditWorkspaceProfile:u?v:void 0,onRefreshProfile:y,plugins:c||[],skills:a||[],totalInstalls:l,user:t}},[r,v,y,p,o,s,e,_]);return(o||p)&&!g?(0,Z.jsx)(ct,{}):b?(0,Z.jsxs)(Re,{config:b,children:[(0,Z.jsx)(Xe,{}),(0,Z.jsx)(Qe,{})]}):f?(0,Z.jsx)(m,{flex:1,padding:48,width:`100%`,children:(0,Z.jsx)(ye,{error:f,variant:`page`,onRetry:()=>y()})}):(0,Z.jsx)(Te,{})}),$=(0,X.memo)(()=>(0,Z.jsx)(Q,{mobile:!0}))}))();export{$ as MobileWorkspaceDetailPage,Q as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.