PageSourceSearch

https://mana.ai/assets/FrameworkDetailLandingPage-FOl3ndIq.js?dpl=27a70693-48ce-4eff-ba3d-7c367d82390c

js mana.ai collected 2026-10-05 12:15:05 UTC 13,713 bytes, 1 lines download raw bytes

1import{a as xe,b as he,c as H,d as fe,e as pe,f as be,r as m,s as ge,g as D,h as je,p as we,i as Ne,j as e,A as ke,k as Ae,l as Ee,m as I,t as g,n as j,o as L,q as A,L as U,P as ve,v as ye,w as Se,x as Fe,B as k,y as R,F as Ce,z as Ie,D as Te,E as _e,G as Pe,H as De,M as Le,I as Re,J as V,S as p,K as Oe,N as Me,R as Be,O as ze,Q as Qe,T as Ge,U as $e,V as Ke,W as Ue,X as qe,Y as We,Z as He,$ as Ve}from"./main-qTUrSfJn.js?dpl=27a70693-48ce-4eff-ba3d-7c367d82390c";import{A as Ye}from"./AdjacentEntityPager-UFNa4ckD.js?dpl=27a70693-48ce-4eff-ba3d-7c367d82390c";import{A as Je}from"./AppPageHeader-BpZ4jVVO.js?dpl=27a70693-48ce-4eff-ba3d-7c367d82390c";import{E as Xe}from"./EntityProjectsSection-BFX_rpP6.js?dpl=27a70693-48ce-4eff-ba3d-7c367d82390c";import{P as Ze,a as es}from"./PageListShell-BlXDihwz.js?dpl=27a70693-48ce-4eff-ba3d-7c367d82390c";import{P as ss}from"./PageToolbar-D4wYfpez.js?dpl=27a70693-48ce-4eff-ba3d-7c367d82390c";import{P as as}from"./PageToolbarActions-B4nVW4WU.js?dpl=27a70693-48ce-4eff-ba3d-7c367d82390c";try{let a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="981d8770-70d1-4500-bcfc-d1d7c6209e3e",a._sentryDebugIdIdentifier="sentry-dbid-981d8770-70d1-4500-bcfc-d1d7c6209e3e")}catch{}const rs=new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}),ts=/\s+/;function q(a){if(!a)return"-";const t=new Date(a);return Number.isNaN(t.getTime())?"-":rs.format(t)}function is(a){return a.split(ts).find(Boolean)??a}function ns(a,t){var o;const n=(o=a.ownerName)==null?void 0:o.trim();return n||a.ownerImage?{label:n||"Someone",image:a.ownerImage??null}:t&&a.userId===t.id?{label:`${t.firstName} ${t.lastName}`.trim()||"You",image:t.image}:{image:a.ownerImage??null,label:"Someone"}}const v="inline-flex shrink-0 items-center gap-1 rounded-full border border-sidebar bg-transparent px-1.5 py-0.5 font-450 text-xs text-prose-base",ls=({skill:a})=>e.jsxs("span",{className:A(v,"font-medium font-sans text-focus-ring"),children:["/",a.slug]}),os=({skill:a})=>a.isSubscribed?e.jsxs("span",{className:v,children:[e.jsx(Be,{"aria-hidden":!0,className:"shrink-0",size:11,weight:"bold"}),"Subscribed"]}):a.sharedWithOrg?e.jsxs("span",{className:v,children:[e.jsx(ze,{"aria-hidden":!0,className:"shrink-0",size:11,weight:"bold"}),"Org shared"]}):a.exposed?e.jsxs("span",{className:v,children:[e.jsx(Qe,{"aria-hidden":!0,className:"shrink-0",size:11,weight:"bold"}),"Discoverable"]}):e.jsxs("span",{className:A(v,"bg-medium text-prose-base"),children:[e.jsx(Ge,{"aria-hidden":!0,className:"shrink-0",size:11,weight:"bold"}),"Private"]}),cs="grid grid-cols-1 gap-x-[60px] gap-y-8 lg:grid-cols-12",T="mb-4 text-lg font-semibold text-prose-base",O=10,ds=({description:a,details:t,isLoading:n,isUpdatingProjects:o,onProjectIdsChange:d,projectIds:l})=>e.jsxs("aside",{className:"flex flex-col gap-10 lg:col-span-4",children:[e.jsxs("section",{children:[e.jsx("h2",{className:T,children:"Overview"}),n?e.jsx(p,{className:"h-16 w-full bg-light"}):e.jsx(He,{content:a,emptyText:"No description provided.",id:"framework-description"})]}),e.jsxs("section",{children:[e.jsx("h2",{className:Ve,children:"Details"}),n?e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(p,{className:"h-10 w-full bg-light"}),e.jsx(p,{className:"h-10 w-5/6 bg-light"}),e.jsx(p,{className:"h-10 w-full bg-light"})]}):e.jsx("dl",{className:"flex flex-col gap-4",children:t.map(h=>e.jsxs("div",{children:[e.jsx("dt",{className:"font-semibold text-prose-base text-sm",children:h.label}),e.jsx("dd",{className:"mt-1 break-words text-prose-base text-sm",children:h.valueNode??h.value})]},h.label))})]}),e.jsx(Xe,{isLoading:n,isUpdatingProjects:o,onProjectIdsChange:d,projectIds:l})]}),ms=({frameworkId:a})=>{const t=H(),{conversations:n,isLoading:o}=$e(a),[d,l]=m.useState(O),h=m.useMemo(()=>[...n].sort((x,b)=>new Date(b.updatedAt??0).getTime()-new Date(x.updatedAt??0).getTime()),[n]),w=h.slice(0,d),f=d<h.length;m.useEffect(()=>{l(O)},[a]);let u;return o?u=e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(p,{className:"h-10 w-full bg-light"}),e.jsx(p,{className:"h-10 w-5/6 bg-light"})]}):h.length===0?u=e.jsx("div",{className:A("rounded-lg border border-dashed bg-sunken px-4 py-8 text-center",V),children:e.jsx("p",{className:"text-prose-secondary text-sm",children:"No conversations"})}):u=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex w-full min-w-0 flex-col divide-y divide-light border-light border-b",children:w.map(x=>{var E;const b=t(Ke(x.id));return e.jsxs(Ue,{className:"flex min-w-0 items-center gap-2.5 py-2.5 text-sm transition-colors hover:bg-medium",to:b,children:[e.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-prose-base text-sm",children:((E=x.title)==null?void 0:E.trim())||qe}),x.updatedAt?e.jsx("span",{className:"shrink-0 text-prose-tertiary text-sm tabular-nums",children:We(new Date(x.updatedAt))}):null]},x.id)})}),f?e.jsx("div",{className:"flex justify-center pt-4",children:e.jsx(k,{className:"!font-normal border-default text-prose-base hover:border-medium",onClick:()=>l(x=>x+O),size:"sm",type:"button",variant:"outline",children:"Load more"})}):null]}),e.jsxs("section",{children:[e.jsx("h2",{className:T,children:"Conversations"}),u]})},us=({onBack:a})=>e.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-4 py-20",children:[e.jsx(Me,{className:"text-prose-tertiary",size:32}),e.jsx("p",{className:"text-prose-secondary",children:"Framework not found"}),e.jsx(k,{onClick:a,size:"sm",type:"button",variant:"ghost",children:"Back to frameworks"})]}),Y=Se,W=({scrollRef:a,testId:t,children:n,headerTitle:o,trailingActions:d})=>e.jsxs("main",{className:"flex h-full w-full flex-col","data-testid":t,children:[e.jsx(ss,{className:"border-light border-b",headerTitle:o??e.jsx("h1",{className:Y,children:"Frameworks"}),horizontalPaddingClass:"px-5",showGlobalSearch:!1,trailingActions:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex items-center",children:e.jsx(as,{})}),d]}),trailingActionsFlush:!0}),e.jsx("div",{className:A("flex min-h-0 flex-1 flex-col overflow-y-auto overflow-x-hidden",es),ref:a,children:e.jsx(Ze,{className:"px-5 md:px-5 lg:px-5",children:n})})]});function ws(){const{skillId:a}=xe(),t=he(),n=H(),{authHeaders:o,user:d}
1=fe(),l=pe(),h=be(),{setScrollContainer:w,setHeaderHidden:f,setShellPageToolbarSuppressed:u}=h??{},[x,b]=m.useState(!1),E=m.useCallback(r=>{w==null||w(r??null)},[w]);m.useLayoutEffect(()=>{ge({title:"Framework | Mana",description:"View framework details",robots:"noindex, nofollow"})},[]),m.useLayoutEffect(()=>(f==null||f(!0),u==null||u(!0),()=>{f==null||f(!1),u==null||u(!1)}),[f,u]);const{data:s,isLoading:J}=D({queryKey:["skills","detail",a],queryFn:()=>{if(!a)throw new Error("Framework not found.");return j(`/skills/${a}`,o)},enabled:!!o&&!!a,retry:!1}),X=je(J,s),{data:M=[]}=D({queryKey:["skills","my"],queryFn:()=>j("/skills/available",o),enabled:!!o}),{data:B=[]}=D({queryKey:["skills","shared"],queryFn:()=>j("/skills/shared",o),enabled:!!o}),y=m.useMemo(()=>{const r=new Map;for(const i of[...M,...B])r.has(i.id)||r.set(i.id,i);return[...r.values()].sort((i,c)=>new Date(c.updatedAt).getTime()-new Date(i.updatedAt).getTime()).map(i=>i.id)},[M,B]);let N=-1;s!=null&&s.id?N=y.indexOf(s.id):a&&(N=y.indexOf(a));const S=N>0?y.at(N-1):void 0,F=N>=0?y.at(N+1):void 0,Z=m.useCallback(()=>{S&&t(n(`/frameworks/${S}`))},[t,S,n]),ee=m.useCallback(()=>{F&&t(n(`/frameworks/${F}`))},[t,F,n]),C=m.useMemo(()=>s?we(Ne(s.prompt),s.name):"",[s]),se=m.useMemo(()=>e.jsx("p",{className:"whitespace-pre-wrap break-words text-sm",children:C}),[C]),ae=m.useMemo(()=>{var c;if(!s)return[];const r=ns(s,d??null),i=is(r.label);return[{label:"Framework ID",value:s.id},{label:"Owner",value:r.label,valueNode:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsxs(ke,{className:"!rounded-md size-5 shrink-0",children:[e.jsx(Ae,{alt:r.label,className:"!rounded-md",src:r.image??void 0}),e.jsx(Ee,{className:"!rounded-md text-[10px]",children:((c=i[0])==null?void 0:c.toUpperCase())??"?"})]}),e.jsx("span",{className:"min-w-0 break-words",children:r.label})]})},{label:"Created",value:q(s.createdAt)},{label:"Updated",value:q(s.updatedAt)}]},[s,d]),_=!!(s&&d&&s.userId===d.id&&!s.isSubscribed),re=_,te=_,ie=!!(s&&d&&s.userId!==d.id&&s.sharedWithOrg&&!s.isSubscribed),ne=!!(s&&d&&s.userId!==d.id&&s.isSubscribed),z=m.useCallback(r=>{a&&(l.setQueryData(["skills","detail",a],i=>i&&{...i,projectIds:r}),l.setQueryData(["skills","my"],i=>(i??[]).map(c=>c.id===a?{...c,projectIds:r}:c)))},[l,a]),{mutate:Q,isPending:le}=I({mutationFn:r=>{if(!(s!=null&&s.id))throw new Error("Framework not found.");return j(`/skills/${s.id}`,o,{method:"PATCH",body:JSON.stringify({projectIds:r})})},onMutate:async r=>{await Promise.all([l.cancelQueries({queryKey:["skills","detail",a]}),l.cancelQueries({queryKey:["skills","my"]})]);const i=l.getQueryData(["skills","detail",a]),c=l.getQueryData(["skills","my"]);return z(r),{previousDetail:i,previousMySkills:c}},onSuccess:(r,i)=>{l.setQueryData(["skills","detail",r.id],{...r,projectIds:i}),z(i)},onError:(r,i,c)=>{l.setQueryData(["skills","detail",a],c==null?void 0:c.previousDetail),l.setQueryData(["skills","my"],c==null?void 0:c.previousMySkills),g.error("Failed to update framework projects",r instanceof Error?r.message:"An unexpected error occurred")}}),oe=m.useCallback(r=>{Q(r)},[Q]),{mutate:ce,isPending:P}=I({mutationFn:async()=>{if(!(s!=null&&s.id))throw new Error("Framework not found.");await j(`/skills/${s.id}`,o,{method:"DELETE"})},onSuccess:async()=>{await L(l),b(!1),t(n("/frameworks")),g.success("Framework archived")},onError:r=>{g.error("Failed to archive framework",r instanceof Error?r.message:"An unexpected error occurred")}}),{mutate:de,isPending:G}=I({mutationFn:()=>{if(!(s!=null&&s.id))throw new Error("Framework not found.");return j(`/skills/${s.id}/subscribe`,o,{method:"POST"})},onSuccess:async r=>{l.setQueryData(["skills","detail",r.id],r),await L(l),g.success("Framework subscribed")},onError:r=>{g.error("Failed to subscribe to framework",r instanceof Error?r.message:"An unexpected error occurred")}}),{mutate:me,isPending:$}=I({mutationFn:async()=>{if(!(s!=null&&s.id))throw new Error("Framework not found.");await j(`/skills/${s.id}/subscribe`,o,{method:"DELETE"})},onSuccess:async()=>{s!=null&&s.id&&l.setQueryData(["skills","detail",s.id],r=>r&&{...r,isSubscribed:!1}),await L(l),g.success("Framework unsubscribed")},onError:r=>{g.error("Failed to unsubscribe from framework",r instanceof Error?r.message:"An unexpected error occurred")}}),K=e.jsxs("h1",{className:A(Y,"flex min-w-0 items-center"),children:[e.jsx(U,{className:ve,href:n("/frameworks"),children:"Frameworks"}),s!=null&&s.name?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:ye,children:" / "}),e.jsx("span",{className:"min-w-0 truncate",children:s.name})]}):null]}),ue=s?e.jsxs("div",{className:Fe,children:[re?e.jsx(k,{asChild:!0,size:"bare",variant:"ghost",children:e.jsx(U,{className:R,href:n(`/frameworks/${s.id}/edit`),children:"Edit"})}):null,ie?e.jsx(k,{className:R,disabled:G,isLoading:G,onClick:()=>de(),size:"bare",type:"button",variant:"ghost",children:"Subscribe"}):null,ne?e.jsx(k,{className:R,disabled:$,isLoading:$,onClick:()=>me(),size:"bare",type:"button",variant:"ghost",children:"Unsubscribe"}):null,_?e.jsxs(Ce,{children:[e.jsx(Ie,{asChild:!0,children:e.jsx(k,{"aria-label":"Framework actions",className:Te,disabled:P,size:"bare",type:"button",variant:"ghost",children:e.jsx(_e,{size:16,weight:"bold"})})}),e.jsx(Pe,{align:"end",side:"bottom",sideOffset:4,children:e.jsx(De,{disabled:P,onClick:()=>b(!0),variant:"danger",children:"Archive framework"})})]}):null,e.jsx(Ye,{className:"max-md:hidden",compact:!0,hasNext:!!F,hasPrevious:!!S,nextLabel:"Next framework",onNext:ee,onPrevious:Z,previousLabel:"Previous framework"})]}):null;return X||s?e.jsxs(e.Fragment,{children:[e.jsx(W,{headerTitle:K,scrollRef:E,testId:"framework-detail-page",trailingActions:ue,children:s?e.jsxs("div",{className:"mt-[3px] flex flex-col gap-5 pb-10",children:[e.jsx(Je,{description:e.jsxs(e.Fragment,{children:[e.jsx(ls,{skill:s}),e.jsx(os,{skill:s})]}),title:s.name}),e.jsxs("div",{className:cs,children:[e.jsxs("div",{className:"flex flex-col gap-10 lg:col-span-8",children:[e.jsxs("section",{children:[e.jsx("h2",{className:T,children:"Prompt"}),C?e.jsx(Le,{content:C,errorFallback:se,id:`framework-prompt-${s.id}`,proseClassName:Re,variant:"no-margin"}):e.jsx("p",{className:"text-prose-secondary text-sm",children:"No prompt provided."})]}),e.jsxs("section",{children:[e.jsx("h2",{className:T,children:"Files"}),s.files.length>0?e.jsx("ul",{className:"list-disc space-y-1 pl-5 text-prose-base text-sm",children:s.files.map(r=>e.jsx("li",{children:r.displayName},r.id))}):e.jsx("div",{className:A("rounded-xl border border-dashed px-4 py-10 text-center",V),children:e.jsx("p",{className:"text-prose-secondary text-sm",children:"No files attached to this framework."})})]}),e.jsx(ms,{frameworkId:s.id})]}),e.jsx(ds,{description:s.description,details:ae,isLoading:!1,isUpdatingProjects:le,onProjectIdsChange:te?oe:void 0,projectIds:s.projectIds})]})]}):e.jsxs("div",{className:"flex flex-col gap-4 pt-7",children:[e.jsx(p,{className:"h-8 w-64 bg-light"}),e.jsx(p,{className:"h-32 w-full bg-light"}),e.jsx(p,{className:"h-44 w-full bg-light"})]})}),e.jsx(Oe,{entityLabel:"Framework",isPending:P,onClose:()=>b(!1),onConfirm:()=>ce(),open:x})]}):e.jsx(W,{headerTitle:K,scrollRef:E,children:e.jsx(us,{onBack:()=>t(n("/frameworks"))})})}export{ws 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.