PageSourceSearch

https://beforevibe.com/assets/Workspace-Dc-cbS5G.js

js beforevibe.com collected 2026-10-02 01:24:16 UTC 13,155 bytes, 1 lines download raw bytes

1import{r as l,j as e}from"./vendor-clerk-MwDNJv5P.js";import{a as te,b as re,u as ae,z as le,t as y,C as oe,k as x,X as ne,l as ie,j as de}from"./index-BE7kE0xl.js";import{C as p,R as w}from"./Kinetic-D6QIzA5r.js";import{M as ce}from"./MagneticButton-HYNDKOJe.js";import{a as n,W as I}from"./Wordmark-0tSWuUUW.js";import{S as me,V as xe}from"./VerifiedBadge-CRPb40a8.js";import{B as pe}from"./BuilderBadge-CSHYEzTC.js";import{D as K,a as W,b as ue,i as M,S as be,c as fe}from"./DenseProjectRow-CmaZrZst.js";import{S as ge}from"./shield-check-C4DMLqjP.js";import{K as he,P as z}from"./plus-CeR89s_5.js";import{T as je}from"./trash-2-BbIAiIpg.js";import"./vendor-pdf-DfO2iUf6.js";import"./vendor-motion-Ca9LltCM.js";import"./badge-check-BBj7wTsW.js";import"./check-D17JMznP.js";import"./link-2-C2w6ZcHb.js";const ke="/assets/empty-workspace-cover-Cg-vyNxv.jpg";function Ie(){const{t:s,lang:U}=te(),{email:v,domain:u,workspace:d,isSuperAdmin:N,highestTier:b,nextTier:V,profile:S}=re(),f=ae(),[o,C]=l.useState([]),[g,O]=l.useState([]),[X,D]=l.useState(!0),[L,T]=l.useState(null),[q,G]=l.useState(()=>localStorage.getItem("byok-banner-dismissed")==="1"),H=()=>{localStorage.setItem("byok-banner-dismissed","1"),G(!0)},h=V||null,[ye,j]=l.useState(!0);l.useEffect(()=>{if(!h){j(!0);return}try{j(localStorage.getItem(`worktools-levelup-dismissed-${h}`)==="1")}catch{j(!1)}},[h]);const B=l.useCallback(async()=>{D(!0);const t=await le();if(D(!1),!t.ok){y.error(s("workspace.loadError"));return}C(t.projects),oe().then(r=>{r.ok&&O(r.items)})},[s]);l.useEffect(()=>{B()},[B]);const J=async t=>{if(!window.confirm(s("workspace.confirmDelete")))return;T(t);const r=await de(t);if(T(null),!r.ok){y.error(s("workspace.deleteFailed"));return}C(a=>a.filter(i=>i.id!==t)),y.success(s("workspace.deleted"))},Q=t=>{if(!t)return"";try{return new Date(t).toLocaleDateString(U,{day:"numeric",month:"short",year:"numeric"})}catch{return""}},Y=d?.personal&&S?.displayName||d&&d.name||u||s("workspace.eyebrow"),k=o.filter(t=>t.status==="ready").length,P=o.length-k;return e.jsxs("div",{"data-testid":n.page,className:"min-h-screen bg-background text-foreground antialiased",children:[e.jsx("header",{className:"sticky top-0 z-40 border-b border-border bg-background/85 backdrop-blur-md",children:e.jsxs("div",{className:"flex h-16 items-center justify-between gap-4 px-4 sm:px-8",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(I,{}),e.jsx("span",{className:"hidden h-4 w-px bg-border sm:block"}),e.jsx("span",{className:"hidden text-[11px] font-bold uppercase tracking-[0.18em] text-[hsl(var(--brand))] sm:inline",children:s("workspace.eyebrow")})]}),e.jsxs("div",{className:"flex items-center gap-3 sm:gap-4",children:[N&&e.jsxs(x,{to:"/admin","data-testid":n.adminLink,className:"hidden items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-sm font-semibold text-foreground/60 hover:bg-foreground
1/[0.04] hover:text-foreground sm:inline-flex",children:[e.jsx(ge,{className:"h-4 w-4"})," ",s("workspace.adminConsole")]}),e.jsx(me,{triggerTestId:"workspace-menu-trigger"})]})]})}),e.jsxs("main",{children:[null,e.jsxs("section",{className:"relative overflow-hidden noise-overlay",children:[e.jsx("div",{className:"pointer-events-none absolute inset-0 hero-radial"}),e.jsx(p,{className:"relative pb-12 pt-14 sm:pt-20",children:e.jsx("div",{className:"flex flex-col gap-10 lg:flex-row lg:items-end lg:justify-between",children:e.jsxs("div",{children:[e.jsx(w,{y:10,children:e.jsxs("div",{className:"flex items-center gap-4 text-[10px] font-bold uppercase tracking-[0.25em] text-muted-foreground",children:[e.jsx("span",{className:"h-px w-8 bg-muted-foreground/50"}),s("workspace.eyebrow")]})}),e.jsxs("div",{className:"mt-6 flex flex-wrap items-center gap-x-4 gap-y-2",children:[e.jsx("h1",{className:"max-w-[18ch] text-[clamp(2rem,6vw,4.5rem)] font-bold uppercase leading-[0.9] tracking-tighter text-foreground",style:{fontFamily:"'Archivo Black', sans-serif"},children:Y}),b?e.jsx(x,{to:"/license/status","aria-label":s("license.viewAllBadges"),className:"transition-transform hover:-translate-y-0.5",children:e.jsx(pe,{tier:b,label:s(`license.${b}Name`),size:"md"})}):null,S?.verified?e.jsx(x,{to:"/profile","data-testid":"workspace-verified-badge","aria-label":s("profile.verifiedTag"),className:"transition-transform hover:-translate-y-0.5",children:e.jsx(xe,{size:"lg",label:s("profile.verifiedTag")})}):null]}),e.jsx(w,{delay:.12,children:e.jsx("p",{className:"mt-3 max-w-[46ch] text-sm leading-relaxed text-muted-foreground",children:s("workspace.intro")})}),e.jsx(w,{delay:.18,children:e.jsxs("div",{className:"mt-5 flex flex-wrap items-center gap-x-5 gap-y-2 text-xs",children:[e.jsxs("span",{className:"font-semibold text-foreground",children:[o.length," ",s("workspace.statTools")]}),e.jsxs("span",{className:"inline-flex items-center gap-2 text-foreground/55",children:[e.jsx("span",{className:"h-2 w-2 rounded-full bg-[hsl(var(--brand))]"})," ",k," ",s("workspace.statReady")]}),e.jsxs("span",{className:"inline-flex items-center gap-2 text-foreground/55",children:[e.jsx("span",{className:"h-2 w-2 rounded-full border border-foreground
1/30"})," ",P," ",s("workspace.statDrafts")]}),d?.personal?e.jsx("span",{className:"text-foreground/45",children:s("workspace.membersPrivate")}):u?e.jsxs("span",{className:"text-foreground/45",children:[s("workspace.membersPrefix")," ",e.jsxs("span",{className:"font-semibold text-[hsl(var(--brand))]",children:["@",u]})," ",s("workspace.membersSuffix")]}):null]})})]})})})]}),q?null:e.jsx("div",{"data-testid":"byok-banner",className:"border-t border-border/50",children:e.jsx(p,{className:"py-3",children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("p",{className:"text-[11px] font-semibold uppercase tracking-[0.12em] text-foreground/40",children:[e.jsx(he,{className:"mr-1.5 inline-block h-3 w-3 shrink-0 align-middle"}),s("apiKeys.bannerText")," ",e.jsxs(x,{to:"/profile#api-keys","data-testid":"byok-banner-link",className:"text-foreground/65 underline underline-offset-2 hover:text-foreground/90 transition-colors",children:[s("apiKeys.bannerLink")," →"]})]}),e.jsx("button",{type:"button","aria-label":"Dismiss","data-testid":"byok-banner-dismiss",onClick:H,className:"shrink-0 text-foreground/30 transition-colors hover:text-foreground/60",children:e.jsx(ne,{className:"h-3.5 w-3.5"})})]})})}),e.jsx("section",{className:"border-t border-border",children:e.jsx(p,{className:"py-12 sm:py-16",children:X?e.jsx("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 xl:grid-cols-3",children:[0,1,2].map(t=>e.jsx("div",{className:"h-[26rem] animate-pulse rounded-[24px] border border-border bg-muted/40"},t))}):e.jsxs("div",{"data-testid":n.list,children:[o.length===0?e.jsxs("div",{"data-testid":n.empty,className:"relative overflow-hidden rounded-3xl border border-border",children:[e.jsx("img",{src:ke,alt:"",className:"absolute inset-0 h-full w-full object-cover",style:{objectPosition:"center 22%"}}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/90 via-black/40 to-black/10"}),e.jsxs("div",{className:"relative flex min-h-[22rem] flex-col items-start justify-end p-8 sm:min-h-[26rem] sm:p-12",children:[e.jsx("p",{className:"text-2xl font-black tracking-tight text-white sm:text-3xl",children:s("workspace.emptyTitle")}),e.jsxs(ce,{type:"button",onClick:()=>f("/",{state:{newTool:!0}}),"data-testid":n.emptyCta,className:"mt-6 h-11 rounded-xl bg-white px-5 font-semibold text-black shadow-[0_18px_40px_-24px_rgba(0,0,0,0.6)] hover:bg-white/90",children:[e.jsx(z,{className:"h-4 w-4"})," ",s("workspace.emptyCta")]})]})]}):null,o.length>0?e.jsxs("div",{className:"max-w-4xl",children:[e.jsx("div",{className:"mb-8 flex items-end justify-between border-b-2 border-foreground pb-4",children:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("h2",{className:"text-2xl font-bold uppercase tracking-tight text-foreground sm:text-3xl",style:{fontFamily:"'Archivo Black', sans-serif"},children:s("workspace.eyebrow")}),e.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-[0.25em] text-muted-foreground",children:[o.length," ",s("workspace.statTools")," · ",k," ",s("workspace.statReady")," · ",P," ",s("workspace.statDrafts")]})]})}),e.jsxs(K,{children:[e.jsxs("button",{type:"button",onClick:()=>f("/",{state:{newTool:!0}}),"data-testid":n.createNew,className:"group flex w-full items-stretch border-b border-border/80 text-left transition-colors hover:bg-muted/40",children:[e.jsx("div",{className:"flex items-center py-2.5 pr-1",children:e.jsx("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-lg border border-dashed border-foreground
1/30 bg-transparent transition-all group-hover:bg-foreground",children:e.jsx(z,{className:"h-5 w-5 text-muted-foreground transition-colors group-hover:text-background"})})}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col justify-center py-2.5 px-4",children:[e.jsx("h3",{className:"uppercase text-sm leading-none text-foreground",style:{fontFamily:"'Archivo Black', sans-serif"},children:s("workspace.createNew")}),e.jsx("p",{className:"mt-1.5 truncate text-[10px] font-medium uppercase tracking-[0.15em] text-muted-foreground",children:s("workspace.intro")})]})]}),[{key:"public",label:s("workspace.catPublic"),items:o.filter(t=>t.publishedAt)},{key:"private",label:s("workspace.catPrivate"),items:o.filter(t=>!t.publishedAt&&t.status==="ready")},{key:"drafts",label:s("workspace.catDrafts"),items:o.filter(t=>t.status!=="ready")}].map(t=>t.items.length===0?null:e.jsxs(l.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-border/40 pt-6 pb-2 first:pt-2",children:[e.jsx("h3",{className:"text-[10px] font-bold uppercase tracking-[0.25em] text-muted-foreground",children:t.label}),e.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/60",children:t.items.length})]}),e.jsx("div",{...t.items.length>5?{"data-lenis-prevent":""}:{},className:t.items.length>5?"max-h-[352px] overflow-y-auto overscroll-contain":void 0,children:t.items.map(r=>{const a=r.meta||{},i=r.name&&r.name.trim()||a.project_name||s("workspace.untitled"),A=!!v&&r.creatorEmail===v||N,_=!!r.publishedAt,Z=a.app_format||null,c=a.product_type||a.library_category||null,$=`library.cats.${c}`,E=c?s($):"",ee=c?E===$?c:E:"",se=Array.isArray(r.nodes)?r.nodes.filter(m=>m?.data?.type==="screen").length:0,F=r.status==="ready"?{label:s("workspace.statusReady"),kind:"outline"}:{label:s("workspace.statusDraft"),kind:"dashed"};return e.jsxs("div",{"data-testid":`${n.cardPrefix}-${r.id}`,className:"group relative",children:[e.jsx(W,{name:i,subtitle:a.goal||null,logoUrl:a.logo_url||a.logo_gen_url||a.live_logo_url||null,formatLabel:M(Z)?s("builder.canvas.params.web"):s("builder.canvas.params.mobile"),categoryLabel:ee||null,badge:F,onClick:()=>f(`/builder/${r.id}`),right:e.jsx(ue,{updatedLabel:Q(r.updatedAt),screenCount:se})}),e.jsx("span",{"data-testid":`${n.cardStatusPrefix}-${r.id}`,className:"sr-only",children:F.label}),_||A?e.jsxs("div",{className:"absolute right-2 top-1/2 flex -translate-y-1/2 items-center gap-0.5 rounded-full border border-border bg-background px-1 py-0.5 shadow-sm opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100",children:[_?e.jsx(be,{url:`https://beforevibe.com/library/${r.id}`,title:i,testId:`workspace-share-${r.id}`,triggerClassName:"rounded-full p-1.5 text-foreground/60 transition-colors hover:text-foreground",iconClassName:"h-3.5 w-3.5"}):null,A?e.jsx("button",{type:"button",onClick:m=>{m.preventDefault(),m.stopPropagation(),J(r.id)},disabled:L===r.id,"aria-label":s("workspace.delete"),className:"rounded-full p-1.5 text-foreground/60 transition-colors hover:text-foreground",children:L===r.id?e.jsx(ie,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(je,{className:"h-3.5 w-3.5"})}):null]}):null]},r.id)})})]},t.key))]})]}):null,g.length===0?null:e.jsxs("div",{className:"mt-14 max-w-4xl",children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2 border-b border-border/40 pb-2",children:[e.jsx("h2",{className:"text-[10px] font-bold uppercase tracking-[0.25em] text-muted-foreground",children:s("workspace.savedSection")}),e.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/60",children:g.length})]}),e.jsx(K,{children:g.map(t=>{const r=t.productType||null,a=`library.cats.${r}`,i=r?s(a):"",R=r?i===a?r:i:"";return e.jsx(W,{name:t.name||s("workspace.untitled"),subtitle:t.goal||null,logoUrl:t.brandLogoUrl||t.liveLogoUrl||null,formatLabel:M(t.appFormat)?s("builder.canvas.params.web"):s("builder.canvas.params.mobile"),categoryLabel:R||null,to:`/library/${t.id}`,right:e.jsx(fe,{likes:t.likes,bookmarks:t.bookmarks,liked:t.viewer?.liked,bookmarked:t.viewer?.bookmarked})},t.id)})})]})]})})})]}),e.jsx("footer",{className:"border-t border-border",children:e.jsxs(p,{className:"flex flex-col items-center justify-between gap-4 py-8 sm:flex-row",children:[e.jsx(I,{}),e.jsx("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:e.jsx("span",{children:"© 2026 BEFOREVIBE"})})]})})]})}export{Ie 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.