1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/StudioTab-DdBo-sHM.js","assets/vendor-ui-Cp0o_ERz.js","assets/index-U2qI6hth.js","assets/vendor-charts-BTyV52R2.js","assets/vendor-query-Bv5ntzP6.js","assets/vendor-react-DblKtrgV.js","assets/vendor-motion-P7V77m0j.js","assets/vendor-supabase-B0Jha54I.js","assets/index-Br0gyUl-.css","assets/CollapsibleSection-Cn-xubAk.js","assets/useActorFavorites-DLTitzLS.js","assets/useEmailVerification-BQjKZgSy.js","assets/AddCaptionsDialog-uCzQdNAc.js","assets/usePreviewSound-DHm0GOB2.js","assets/VideoThumbnail-DEAuBjaq.js","assets/videoLocalCheck-xBq4jzmV.js","assets/ExportPaywallModal-CvGvgPF1.js","assets/share-2-sIo8QWxu.js","assets/downloadVideo-CcFVfqem.js","assets/wand-sparkles-hf8mXBjZ.js","assets/captions-Jl7uQFwd.js","assets/folder-lwIccgZL.js","assets/ellipsis-vertical-KqAMxaYO.js","assets/folder-minus-BxZgk_N8.js","assets/trash-2-DQl3agPF.js","assets/separator-CFU9jP8U.js","assets/label-CthT-n7x.js","assets/textarea-CJ3wtdnc.js","assets/useSocialConnections-TJHKmiDS.js","assets/coins-4cOuNMfH.js","assets/youtube-PVhoke2O.js","assets/music-Dh-ZwRdO.js","assets/linkedin-DMSC3g_Z.js","assets/crown-lZaTKUKT.js","assets/featureFlags-DhS8K_vw.js","assets/toggle-group-CCbRO1kH.js","assets/toggle-CSwWOykv.js","assets/GatedLink-DTpVqoQr.js","assets/VerificationGateModal-D2QlibYm.js","assets/shopping-bag-jgvWJ9_M.js","assets/history-g6-XtwS1.js","assets/heart-C1or41Sp.js","assets/EmailVerificationBanner-BkstFd6A.js","assets/flame-BqyM9GDw.js","assets/award-CYfVGhrA.js","assets/trophy-Cy8mdtdT.js","assets/eachWeekOfInterval-DntUeDPD.js","assets/endOfWeek-BwrvE8dj.js","assets/parseISO-bFNzwH1g.js","assets/target-D10SEGj3.js","assets/CreditMeterBanner-DyDwCcR2.js","assets/shopping-cart-DmbLlxjT.js","assets/package-DjBA-BtM.js"])))=>i.map(i=>d[i]); 2import{j as e,r as t}from"./vendor-ui-Cp0o_ERz.js";import{u as B,N as G}from"./vendor-react-DblKtrgV.js";import{_ as H,d as v,D as R,e as z,f as V,g as Y,h as E,i as q,P as F,B as N,j as $,A as O,k as A,l as J,m as K,n as Q,o as X,p as Z,q as ee,t as se,s as W,v as te,S as ae,w as re}from"./index-U2qI6hth.js";import{u as ie,W as ne,U as oe}from"./UpgradePromptDialog-BPWOX9wL.js";import{P as le}from"./ProductTour-DOqj1BQt.js";import{G as ce}from"./GatedLink-DTpVqoQr.js";import{u as M,S as I,a as L,D as de}from"./useContentPreferences-CgDJEE7B.js";import{A as me,m as pe}from"./vendor-motion-P7V77m0j.js";import"./vendor-charts-BTyV52R2.js";import"./vendor-query-Bv5ntzP6.js";import"./vendor-supabase-B0Jha54I.js";import"./label-CthT-n7x.js";import"./flame-BqyM9GDw.js";import"./crown-lZaTKUKT.js";import"./VerificationGateModal-D2QlibYm.js";import"./useEmailVerification-BQjKZgSy.js";import"./share-2-sIo8QWxu.js";const ue=t.lazy(()=>H(()=>import("./StudioTab-DdBo-sHM.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52])));function xe(){return e.jsxs("div",{className:"space-y-6 animate-pulse",children:[e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:Array.from({length:4}).map((a,r)=>e.jsx(v,{className:"h-24 rounded-xl"},r))}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-4",children:[e.jsx(v,{className:"h-8 w-48"}),e.jsx(v,{className:"h-64 rounded-xl"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{className:"h-8 w-32"}),e.jsx(v,{className:"h-48 rounded-xl"})]})]})]})}function he(){return e.jsx("div",{"data-tour":"welcome",children:e.jsx(t.Suspense,{fallback:e.jsx(xe,{}),children:e.jsx(ue,{})})})}const g=["styles","situations","demographics","complete"];function ge({isOpen:a,onClose:r,onComplete:f}){const{completeOnboarding:n,skipOnboarding:m,isSaving:i}=M(),[o,l]=t.useState("styles"),[p,j]=t.useState([]),[u,_]=t.useState([]),[h,k]=t.useState([]),c=g.indexOf(o),y=(c+1)/g.length*100,b=(s,x,C)=>{x.includes(s)?C(x.filter(U=>U!==s)):C([...x,s])},S=()=>{const s=c+1;s<g.length&&l(g[s])},T=()=>{const s=c-1;s>=0&&l(g[s])},w=async()=>{try{await n({preferred_styles:p,preferred_situations:u,preferred_demographics:h}),f?.(),r()}catch(s){console.error("Error saving preferences:",s)}},D=async()=>{try{await m(),r()}catch(s){console.error("Error skipping onboarding:",s)}},d=()=>{switch(o){case"styles":return e.jsx(P,{title:"What styles appeal to you?",description:"Select the presentation styles you prefer for your videos",options:I,selected:p,onToggle:s=>b(s,p,j)});case"situations":return e.jsx(P,{title:"What will you create?",description:"Tell us what you'll use Vidacious for",options:L,selected:u,onToggle:s=>b(s,u,_)});case"demographics":return e.jsx(P,{title:"Who's your audience?",description:"Help us show relevant actors for your target audience",options:de,selected:h,onToggle:s=>b(s,h,k)});case"complete":return e.jsxs("div",{className:"text-center py-8",children:[e.jsx("div",{className:"mx-auto mb-6 w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center",children:e.jsx(E,{className:"w-8 h-8 text-primary"})}),e.jsx("h3",{className:"text-xl font-semibold mb-2",children:"You're all set!"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"We'll personalize your Feed based on your preferences. You can always update these in settings."}),e.jsxs("div",{className:"flex flex-wrap justify-center gap-2",children:[p.map(s=>e.jsx(A,{variant:"secondary",children:I.find(x=>x.value===s)?.label},s)),u.map(s=>e.jsx(A,{variant:"secondary",children:L.find(x=>x.value===s)?.label},s))]})]})}};return e.jsx(R,{open:a,onOpenChange:s=>!s&&r(),children:e.jsxs(z,{className:"sm:max-w-lg",children:[e.jsxs(V,{children:[e.jsxs(Y,{className:"flex items-center gap-2",children:[e.jsx(E,{className:"w-5 h-5 text-primary"}),"Personalize Your Experience"]}),e.jsx(q,{children:"Help us show you the best content"})]}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground mb-1",children:[e.jsxs("span",{children:["Step ",c+1," of ",g.length]}),e.jsxs("span",{children:[Math.round(y),"%"]})]}),e.jsx(F,{value:y,className:"h-1.5"})]}),e.jsx(me,{mode:"wait",children:e.jsx(pe.div,{initial:{opacity:0,x:20}
2,animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.2},children:d()},o)}),e.jsxs("div",{className:"flex justify-between pt-4 border-t",children:[e.jsx("div",{children:c>0&&o!=="complete"?e.jsxs(N,{variant:"ghost",onClick:T,children:[e.jsx($,{className:"w-4 h-4 mr-2"}),"Back"]}):e.jsx(N,{variant:"ghost",onClick:D,disabled:i,children:"Skip for now"})}),e.jsx("div",{children:o==="complete"?e.jsxs(N,{onClick:w,disabled:i,children:[i?"Saving...":"Start Exploring",e.jsx(O,{className:"w-4 h-4 ml-2"})]}):e.jsxs(N,{onClick:S,children:["Continue",e.jsx(O,{className:"w-4 h-4 ml-2"})]})})]})]})})}function P({title:a,description:r,options:f,selected:n,onToggle:m}){return e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium mb-1",children:a}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:r}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:f.map(i=>{const o=n.includes(i.value);return e.jsxs("button",{onClick:()=>m(i.value),className:K("relative p-3 rounded-lg border-2 text-left transition-all","hover:border-primary/50 hover:bg-primary/5",o?"border-primary bg-primary/10":"border-border bg-background"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xl",children:i.emoji}),e.jsx("span",{className:"font-medium text-sm",children:i.label})]}),o&&e.jsx("div",{className:"absolute top-2 right-2",children:e.jsx(J,{className:"w-4 h-4 text-primary"})})]},i.value)})}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-3",children:["Select all that apply ⢠",n.length," selected"]})]})}function We(){const{profile:a,user:r}=Q(),[f]=B(),{currentWorkspace:n,isLoading:m}=X(),{showUpgradePrompt:i,setShowUpgradePrompt:o}=ie(),{subscription:l}=Z(),{needsOnboarding:p}=M(),[j,u]=t.useState(!1),[_,h]=t.useState(!1),k=ee(a),c=f.get("activate")==="studio";t.useEffect(()=>{c&&se()},[c]),t.useEffect(()=>{if(p&&!j){const d=setTimeout(()=>h(!0),2e3);return()=>clearTimeout(d)}},[p,j]);const y=t.useMemo(()=>{if(!a?.created_at)return!1;const d=new Date(a.created_at),s=new Date(Date.now()-5*60*1e3);return d>s},[a?.created_at]),b=()=>{const s=a?.display_name?.split(" ")[0];return y?s?`Welcome, ${s}! Let's create your first video.`:"Welcome! Let's create your first video.":s?`Welcome back, ${s}!`:"Welcome back! Ready to create?"},S=()=>n==="admin"?"Support":"Dashboard";t.useEffect(()=>{if(!a||!r||a.name_prompt_dismissed)return;if(localStorage.getItem("welcomeNameCompleted")){W.from("profiles").update({name_prompt_dismissed:!0}).eq("user_id",r.id).then();return}if((a.display_name?.trim()||"").length>0){localStorage.setItem("welcomeNameCompleted","true"),W.from("profiles").update({name_prompt_dismissed:!0}).eq("user_id",r.id).then();return}const s=setTimeout(()=>{u(!0)},1e3);return()=>clearTimeout(s)},[a,r]);const[T,w]=t.useState(!1);if(t.useEffect(()=>{if(m){w(!1);return}const d=setTimeout(()=>w(!0),500);return()=>clearTimeout(d)},[m,n]),t.useEffect(()=>{!m&&n==="studio"&&te("dashboard_viewed",{credits_remaining:l.credits,has_active_subscription:l.subscribed,current_plan:l.plan})},[m,n,l.credits,l.subscribed,l.plan]),k&&!c)return e.jsx(G,{to:"/console/overview",replace:!0});const D=()=>e.jsx(he,{});return e.jsxs(e.Fragment,{children:[e.jsx(ae,{title:S(),description:"Manage your AI video campaigns, track credits, and create professional UGC-style video ads with Vidacious.",url:"https://vidacious.ai/dashboard",noIndex:!0}),e.jsx(ne,{open:j,onOpenChange:u}),e.jsx(oe,{open:i,onOpenChange:o}),e.jsx(le,{}),e.jsx("div",{className:"min-h-screen bg-background",style:{paddingTop:"calc(var(--campaign-banner-height, 0px) + var(--header-height))"},children:e.jsxs("main",{className:"flex-1 lg:ml-64",children:[e.jsx("header",{className:"border-b border-border bg-background/95 backdrop-blur-sm",children:e.jsxs("div",{className:"flex items-center justify-between px-3 sm:px-4 lg:px-6 py-2.5 sm:py-4",children:[e.jsxs("div",{className:"flex flex-col gap-0 min-w-0 flex-1",children:[e.jsx("h1",{className:"text-base sm:text-xl lg:text-2xl font-bold font-display truncate",children:S()}),e.jsx("p",{className:"text-[11px] sm:text-sm text-muted-foreground truncate",children:b()})]}),e.jsx("div",{className:"flex items-center gap-3",children:n==="studio"&&e.jsx(ce,{to:"/create",action:"create_video","data-tour":"new-video-button",className:"hidden sm:block",children:e.jsxs(N,{variant:"hero",size:"sm",className:"sm:h-10 sm:px-4",children:[e.jsx(re,{className:"w-4 h-4"}),e.jsx("span",{className:"hidden sm:inline",children:"New Video"})]})})})]})}),e.jsx("div",{className:"p-3 sm:p-4 lg:p-6 pb-24 sm:pb-4 lg:pb-6 space-y-3 sm:space-y-5",children:D()})]})}),e.jsx(ge,{isOpen:_,onClose:()=>h(!1)})]})}export{We 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.