1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[82,3935],{178:(e,t,s)=>{s.r(t),s.d(t,{default:()=>O});var n=s(95155),a=s(12115),r=s(19146),i=s(80642),o=s(86435),l=s(20130),d=s(39923),c=s(89239),u=s(60529),m=s(42763),x=s(96909),p=s(21628);function f({open:e,onOpenChange:t,profileLimit:s}){let a=(0,r.Zp)();return(0,n.jsx)(m.lG,{open:e,onOpenChange:t,children:(0,n.jsx)(m.Cf,{className:"sm:max-w-[420px] overflow-hidden",children:(0,n.jsxs)("div",{className:"flex flex-col items-center text-center pt-2",children:[(0,n.jsx)("div",{className:"w-14 h-14 rounded-full bg-orange-500/15 flex items-center justify-center mb-4 border border-orange-500/30",children:(0,n.jsx)(x.A,{className:"size-7 text-orange-500"})}),(0,n.jsxs)(m.c7,{children:[(0,n.jsx)(m.L3,{className:"text-xl font-bold text-foreground",children:"Voice Profile Limit Reached"}),(0,n.jsx)(m.rr,{className:"mt-2 leading-relaxed",children:null!=s&&s>1?(0,n.jsxs)(n.Fragment,{children:["You have reached your plan limit of ",s," voice profiles. Upgrade to add more and get the full power of text-to-speech in your own voice."]}):(0,n.jsx)(n.Fragment,{children:"You have reached the voice profile limit for your current plan. Upgrade to add more profiles and unlock text-to-speech in your own voice."})})]}),(0,n.jsxs)("div",{className:"w-full space-y-2 mt-6",children:[(0,n.jsx)(c.$n,{variant:"primary",size:"lg",onClick:()=>{t(!1),a("/pricing")},className:"w-full",rightIcon:(0,n.jsx)(p.A,{className:"size-4"}),children:"View Upgrade Plans"}),(0,n.jsx)(c.$n,{variant:"ghost",size:"sm",onClick:()=>t(!1),className:"w-full text-muted-foreground hover:text-foreground",children:"Maybe later"})]})]})})})}var h=s(60102),g=s(44130),j=s(39721),v=s(30320),b=s(51914),N=s(6430),y=s(57420),w=s(48368),_=s(6296),k=s(60285),C=s(49387),A=s(6962),S=s(94514),z=s(68459),E=s(33210),T=s(35625),P=s(73544),I=s(46500),$=s(86846),U=s(52637);function M(e){if(!e)return"0s";let t=e.match(/(\d+)/);return t?`${t[1]}s`:e}function R(e){if(!e)return"";let t=new Date(e);return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.getMonth()]} ${t.getDate()}, ${t.getFullYear()}`}function O(){let{token:e,profile:t}=(0,l.As)(),s=(0,r.Zp)(),p=(0,T.jE)(),{data:O,isLoading:F,isError:L,refetch:W}=(0,P.YD)(e),V=(0,P.O7)(),Y=(0,I.l2)(),q=(0,I.QE)(),G=()=>{p.invalidateQueries({queryKey:["voiceProfiles"]})},Q=O?.data??[],[K,H]=(0,a.useState)(!1),[J,B]=(0,a.useState)(!1),[Z,X]=(0,a.useState)(null),[ee,et]=(0,a.useState)(null),[es,en]=(0,a.useState)({open:!1}),[ea,er]=(0,a.useState)({open:!1}),[ei,eo]=(0,a.useState)(""),[el,ed]=(0,a.useState)(!1),ec=Q.length>0,eu=t=>{V.mutate({sessionId:t.session_id,tok:e},{onSuccess:()=>et(null)})},em=e=>{eo(e.name),en({open:!0,profile:e}),et(null)},ex=e=>{er({open:!0,profile:e}),et(null)},ep=async()=>{ea.profile&&(ed(!0),q.mutate({tok:e,session_id:ea.profile.session_id},{onSuccess:()=>{G(),er({open:!1}),B(!1),X(null)},onSettled:()=>ed(!1)}))},ef=e=>{e.voice_clone_audio_url&&window.open(e.voice_clone_audio_url,"_blank"),et(null)},eh=()=>{let e=(0,h.jc)(t),n=Q.filter(P.Q9).length;null!==e&&n>=e?H(!0):s("/dashboard/tts/create-profile")};return F?(0,n.jsxs)(d.LN,{className:"pb-12",children:[(0,n.jsxs)("div",{className:"mb-8",children:[(0,n.jsx)($.E,{className:"h-8 w-48 mb-2"}),(0,n.jsx)($.E,{className:"h-4 w-72 mb-4"}),(0,n.jsx)($.E,{className:"h-10 w-32 rounded-full"})]}),(0,n.jsxs)("div",{className:"flex flex-col gap-3",children:[[1,2,3].map(e=>(0,n.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-4 p-4 rounded-2xl border border-border bg-card",children:[(0,n.jsxs)("div",{className:"flex items-center gap-4 min-w-0 flex-1",children:[(0,n.jsx)($.E,{className:"w-[52px] h-[52px] rounded-full shrink-0"}),(0,n.jsxs)("div",{className:"flex-1 space-y-2 min-w-0",children:[(0,n.jsx)($.E,{className:"h-4 w-1/3"}),(0,n.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,n.jsx)($.E,{className:"h-3 w-24"}),(0,n.jsx)($.E,{className:"h-3 w-20"}),(0,n.jsx)($.E,{className:"h-3 w-28"})]})]}),(0,n.jsx)($.E,{className:"w-8 h-8 rounded-lg shrink-0"})]}),(0,n.jsx)("div",{className:"w-full sm:w-[280px] sm:shrink-0 h-12 rounded-lg bg-muted/50"})]},e)),(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center py-7 px-6 rounded-xl border-2 border-dashed border-border bg-muted/30",children:[(0,n.jsx)($.E,{className:"w-11 h-11 rounded-full mb-2"}),(0,n.jsx)($.E,{className:"h-4 w-40 mb-1"}),(0,n.jsx)($.E,{className:"h-3 w-56"})]})]})]}):L&&!O?(0,n.jsx)("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:(0,n.jsx)(U.IU,{onRetry:()=>W()})}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(d.LN,{className:"pb-12",children:[(0,n.jsx)(d.zY,{title:"Voice Profiles",description:"Manage the voices used for text-to-speech generation",actions:(0,n.jsx)(c.$n,{variant:"primary",size:"md",leftIcon:(0,n.jsx)(b.A,{className:"size-4",strokeWidth:2.5}),onClick:eh,children:"New Profile"})}),ec?(0,n.jsxs)("div",{className:"flex flex-col gap-3",children:[Q.map(e=>(0,n.jsx)(g.vS,{leftSlot:(0,n.jsx)(g.sS,{children:(0,n.jsx)(N.A,{className:"w-6 h-6"})}),title:e.name,metadata:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("span",{className:"flex items-center gap-1 shrink-0",children:[(0,n.jsx)(y.A,{className:"w-3.5 h-3.5"}),"Created ",R(e.created_at).split(" ")[0]," ",R(e.created_at).split(" ")[1]?.replace(",","")??""]}
1),(0,n.jsx)("span",{className:"w-1 h-1 rounded-full bg-border shrink-0 hidden sm:block"}),(0,n.jsxs)("span",{className:"flex items-center gap-1 shrink-0",children:[(0,n.jsx)(w.A,{className:"w-3.5 h-3.5"}),e.tts_projects," TTS projects"]}),(0,n.jsx)("span",{className:"w-1 h-1 rounded-full bg-border shrink-0 hidden sm:block"}),(0,n.jsxs)("span",{className:"shrink-0",children:[M(e.duration)," sample"]})]}),badge:(0,n.jsxs)(n.Fragment,{children:["analyzing"===e.voice_profile_status&&(0,n.jsxs)("span",{className:`flex items-center gap-1.5 ${g.Iq.pending}`,children:[(0,n.jsx)(_.A,{className:"w-3 h-3 animate-spin"}),"Analyzing"]}),"pending_selection"===e.voice_profile_status&&(0,n.jsx)("span",{className:g.Iq.pending,children:"Select clip"}),e.is_default&&"analyzing"!==e.voice_profile_status&&"pending_selection"!==e.voice_profile_status&&(0,n.jsx)("span",{className:"px-2.5 py-0.5 rounded-full text-[10px] font-bold uppercase tracking-wider shrink-0 bg-orange-500/15 text-orange-600 dark:text-orange-400",children:"Default"})]}),actions:(0,n.jsxs)("div",{className:"relative shrink-0",onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("button",{onClick:t=>{t.stopPropagation(),et(ee===e.session_id?null:e.session_id)},className:"w-8 h-8 rounded-lg flex items-center justify-center hover:bg-muted transition-colors text-muted-foreground",children:(0,n.jsx)(k.A,{className:"w-4 h-4"})}),(0,n.jsx)(i.N,{children:ee===e.session_id&&(0,n.jsxs)(o.P.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},onClick:e=>e.stopPropagation(),className:"absolute top-full right-0 mt-1 py-1.5 rounded-lg border shadow-lg z-50 min-w-[180px] bg-card border-border",children:[(0,n.jsx)(D,{icon:C.A,onClick:()=>em(e),children:"Rename"}),(0,n.jsx)(D,{icon:A.A,onClick:()=>ef(e),children:"Download Sample"}),!e.is_default&&(0,n.jsx)(D,{icon:S.A,onClick:()=>eu(e),children:"Set as Default"}),(0,n.jsx)(D,{icon:w.A,onClick:()=>{s(`/dashboard/tts?voice_profile=${encodeURIComponent(e.session_id)}`),et(null)},children:"Text to Speech"}),(0,n.jsx)("div",{className:"h-px my-1 bg-border"}),(0,n.jsx)(D,{icon:z.A,danger:!0,onClick:()=>ex(e),children:"Delete Profile"})]})})]}),trailingSlot:"analyzing"===e.voice_profile_status?(0,n.jsxs)("div",{className:"flex items-center gap-2 py-2 text-muted-foreground text-xs",children:[(0,n.jsx)(_.A,{className:"w-4 h-4 animate-spin shrink-0"}),(0,n.jsx)("span",{children:"Analyzing your audio..."})]}):"pending_selection"===e.voice_profile_status?(0,n.jsxs)("div",{className:"flex items-center gap-2 py-2 text-amber-600 dark:text-amber-400 text-sm font-medium cursor-pointer",onClick:()=>s(`/dashboard/tts/create-profile?session_id=${encodeURIComponent(e.session_id)}&status=pending_selection`),children:[(0,n.jsx)(S.A,{className:"w-4 h-4 shrink-0"}),(0,n.jsx)("span",{children:"Clips ready â tap to select"})]}):e.voice_clone_audio_url?(0,n.jsx)(j.K,{mode:"audio",mediaBlobUrl:e.voice_clone_audio_url,mediaFileName:e.name,inline:!0}):(0,n.jsxs)("div",{className:"flex items-center gap-2 py-2 text-muted-foreground text-xs",children:[(0,n.jsx)("span",{children:"No sample"}),(0,n.jsx)("span",{children:M(e.duration)})]}),onClick:()=>{ee!==e.session_id&&("pending_selection"===e.voice_profile_status?s(`/dashboard/tts/create-profile?session_id=${encodeURIComponent(e.session_id)}&status=pending_selection`):"analyzing"===e.voice_profile_status?s(`/dashboard/tts/create-profile?session_id=${encodeURIComponent(e.session_id)}`):(X(e),B(!0),et(null)))},isSelected:e.is_default&&"analyzing"!==e.voice_profile_status&&"pending_selection"!==e.voice_profile_status,className:"analyzing"===e.voice_profile_status||"pending_selection"===e.voice_profile_status?" hover:!border-amber-500/50":e.is_default?void 0:"!border-border",animate:!0},e.session_id)),(0,n.jsxs)(o.P.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:.15,duration:.4},onClick:eh,className:"flex flex-col items-center justify-center py-7 px-6 rounded-xl border-2 border-dashed cursor-pointer transition-all hover:border-orange-500/40 hover:bg-orange-500/5 bg-muted border-border",children:[(0,n.jsx)("div",{className:"w-11 h-11 rounded-full flex items-center justify-center mb-2 transition-all bg-card border border-border",children:(0,n.jsx)(b.A,{className:"w-5 h-5 text-muted-foreground"})}),(0,n.jsx)("h4",{className:"text-sm font-semibold mb-1 text-muted-foreground",children:"Create a new voice profile"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Record or upload an audio clip"})]})]}):L?(0,n.jsx)(U.IU,{onRetry:()=>W()}):(0,n.jsxs)(o.P.div,{initial:{opacity:0,y:8}
1,animate:{opacity:1,y:0},className:"text-center py-16 px-5",children:[(0,n.jsx)("div",{className:"w-18 h-18 rounded-full flex items-center justify-center mx-auto mb-5 bg-orange-500/10",children:(0,n.jsx)(x.A,{className:"w-8 h-8 text-orange-600 dark:text-orange-400"})}),(0,n.jsx)("h3",{className:"text-xl font-semibold mb-1.5 text-foreground",children:"No voice profiles yet"}),(0,n.jsx)("p",{className:"text-sm max-w-[360px] mx-auto mb-5 leading-relaxed text-muted-foreground",children:"Create your first voice profile by recording 12 seconds of audio or uploading an existing clip. Your voice profile is used to generate speech from text in your own voice."}),(0,n.jsx)(r.N_,{to:"/dashboard/tts/create-profile",children:(0,n.jsx)(c.$n,{variant:"primary",size:"md",leftIcon:(0,n.jsx)(b.A,{className:"size-4",strokeWidth:2.5}),children:"Create Your First Profile"})})]})]}),(0,n.jsx)(i.N,{children:J&&Z&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.P.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[300] bg-black/15 backdrop-blur-[2px]",onClick:()=>B(!1)}),(0,n.jsxs)(o.P.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"tween",duration:.3,ease:[.4,0,.2,1]},className:"fixed top-0 right-0 bottom-0 w-[440px] z-[301] flex flex-col border-l shadow-2xl bg-card border-border",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between p-5 border-b border-border",children:[(0,n.jsx)("h3",{className:"text-base font-semibold",children:"Profile Details"}),(0,n.jsx)("button",{onClick:()=>B(!1),className:"w-8 h-8 rounded-lg flex items-center justify-center hover:bg-muted transition-colors text-muted-foreground",children:(0,n.jsx)(E.A,{className:"w-4.5 h-4.5"})})]}),(0,n.jsxs)("div",{className:"flex-1 overflow-y-auto p-6",children:[(0,n.jsxs)("div",{className:"text-center mb-7",children:[(0,n.jsx)("div",{className:"w-[72px] h-[72px] rounded-full flex items-center justify-center mx-auto mb-3 bg-orange-500/15 text-orange-600 dark:text-orange-400",children:(0,n.jsx)(N.A,{className:"w-8 h-8"})}),(0,n.jsx)("div",{className:"text-lg font-semibold mb-0.5",children:Z.name}),(0,n.jsxs)("div",{className:"text-sm text-muted-foreground",children:["Created ",R(Z.created_at)]})]}),(0,n.jsxs)("div",{className:"rounded-lg p-4 mb-6 bg-muted",children:[(0,n.jsx)("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-2.5 text-muted-foreground",children:"Voice Sample"}),Z.voice_clone_audio_url?(0,n.jsx)(v.G,{audioUrl:Z.voice_clone_audio_url,height:88,showHover:!1}):(0,n.jsx)("div",{className:"flex items-center gap-3 py-4 text-muted-foreground text-sm",children:"No sample available"})]}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-2.5 mb-6",children:[(0,n.jsxs)(r.N_,{to:`/dashboard/tts?voice_profile=${encodeURIComponent(Z.session_id)}`,onClick:()=>B(!1),className:"rounded-lg p-4 bg-muted hover:bg-muted/80 transition-colors cursor-pointer block",children:[(0,n.jsx)("div",{className:"text-lg font-bold mb-0.5 text-orange-600 dark:text-orange-400",children:Z.tts_projects}),(0,n.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:"TTS projects used in"})]}),(0,n.jsxs)(r.N_,{to:`/dashboard/tts?voice_profile=${encodeURIComponent(Z.session_id)}`,onClick:()=>B(!1),className:"rounded-lg p-4 bg-muted hover:bg-muted/80 transition-colors cursor-pointer block",children:[(0,n.jsx)("div",{className:"text-lg font-bold mb-0.5 text-orange-600 dark:text-orange-400",children:null!=Z.tts_audio_minutes?`${Z.tts_audio_minutes} min`:"â"}),(0,n.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:"Audio generated via TTS"})]})]}),(0,n.jsxs)("div",{className:"pt-5 border-t border-border flex flex-col gap-2",children:[(0,n.jsx)(r.N_,{to:`/dashboard/tts?voice_profile=${encodeURIComponent(Z.session_id)}`,className:"w-full",children:(0,n.jsx)(c.$n,{variant:"primary",fullWidth:!0,leftIcon:(0,n.jsx)(w.A,{className:"size-4"}),children:"Text to Speech"})}),!Z.is_default&&(0,n.jsx)(c.$n,{variant:"outline",fullWidth:!0,leftIcon:(0,n.jsx)(S.A,{className:"size-4"}),onClick:()=>eu(Z),children:"Set as Default"}),(0,n.jsx)(c.$n,{variant:"outline",fullWidth:!0,leftIcon:(0,n.jsx)(C.A,{className:"size-4"}),onClick:()=>em(Z),children:"Rename Profile"}),(0,n.jsx)(c.$n,{variant:"outline",fullWidth:!0,leftIcon:(0,n.jsx)(A.A,{className:"size-4"}),onClick:()=>ef(Z),children:"Download Sample"}),(0,n.jsx)(c.$n,{variant:"destructive",fullWidth:!0,leftIcon:(0,n.jsx)(z.A,{className:"size-4"}),onClick:()=>ex(Z),children:"Delete This Profile"})]})]})]})]})}),ee&&(0,n.jsx)("div",{className:"fixed inset-0 z-40",onClick:()=>et(null)}),(0,n.jsx)(m.lG,{open:es.open,onOpenChange:e=>{e||eo(""),en({open:e})},children:(0,n.jsxs)(m.Cf,{className:"sm:max-w-md z-[400]",children:[(0,n.jsx)(m.c7,{children:(0,n.jsx)(m.L3,{children:"Rename voice profile"})}),(0,n.jsxs)("div",{className:"space-y-4 py-4",children:[(0,n.jsx)(u.pd,{value:ei,onChange:e=>eo(e.target.value),placeholder:"Enter new name",autoFocus:!0}),(0,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)(c.$n,{variant:"ghost",onClick:()=>en({open:!1}),children:"Cancel"}),(0,n.jsx)(c.$n,{variant:"primary",onClick:()=>{es.profile&&ei.trim()&&(ed(!0),Y.mutate({tok:e,session_id:es.profile.session_id,name:ei.trim()},{onSuccess:()=>{G(),en({open:!1}),B(!1),X(e=>e&&e.session_id===es.profile?.session_id?{...e,name:ei.trim()}:e)},onSettled:()=>ed(!1)}))},disabled:el||!ei.trim(),children:el?(0,n.jsx)(_.A,{className:"size-4 animate-spin"}):"Save"})]})]})]})}),(0,n.jsx)(m.lG,{open:ea.open,onOpenChange:e=>er({open:e}),children:(0,n.jsxs)(m.Cf,{className:"sm:max-w-md z-[400]",children:[(0,n.jsx)(m.c7,{children:(0,n.jsx)(m.L3,{children:"Delete voice profile"})}),(0,n.jsxs)("div",{className:"space-y-4 py-4",children:[(0,n.jsxs)("p",{className:"text-muted-foreground",children:['Are you sure you want to delete "',ea.profile?.name,'"? This action cannot be undone.']}),(0,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)(c.$n,{variant:"ghost",onClick:()=>er({open:!1}),children:"Cancel"}),(0,n.jsx)(c.$n,{variant:"destructive",onClick:ep,disabled:el,children:el?(0,n.jsx)(_.A,{className:"size-4 animate-spin"}):"Delete"})]})]})]})}),(0,n.jsx)(f,{open:K,onOpenChange:H,profileLimit:(0,h.jc)(t)??void 0})]})}function D({icon:e,children:t,danger:s,onClick:a}){return(0,n.jsxs)("button",{type:"button",onClick:e=>{e.stopPropagation(),a?.()},className:`w-full flex items-center gap-2 px-3 py-2 text-[13px] font-medium rounded-md transition-colors ${s?"text-muted-foreground hover:text-destructive hover:bg-destructive/10":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,children:[(0,n.jsx)(e,{className:"w-4 h-4 shrink-0"}),t]})}},6430:(e,t,s)=>{s.d(t,{A:()=>n});let n=(0,s(78340).A)("AudioLines",[["path",{d:"M2 10v3",key:"1fnikh"}],["path",{d:"M6 6v11",key:"11sgs0"}],["path",{d:"M10 3v18",key:"yhl04a"}],["path",{d:"M14 8v7",key:"3a1oy3"}],["path",{d:"M18 5v13",key:"123xd1"}],["path",{d:"M22 10v3",key:"154ddg"}]])},39721:(e,t,s)=>{s.d(t,{K:()=>r});var n=s(95155),a=s(91259);let r=({mode:e,mediaBlobUrl:t,mediaFileName:s,onTimeUpdate:r,inline:i=!1,badge:o,waveformHeight:l="md"})=>"video"===e&&t?(0,n.jsx)("video",{id:"videoplayer",src:t,controls:!0,className:"w-full rounded",onTimeUpdate:e=>{r?.(e.currentTarget.currentTime)}}):"audio"===e&&t?(0,n.jsx)(a.A,{stream:null,audioUrl:t,title:s||void 0,setOriginalTimer:r,inline:i,badge:o,waveformHeight:l}):null},40562:(e,t,s)=>{s.d(t,{Qg:()=>i,bL:()=>l});var n=s(12115),a=s(99354),r=s(95155),i=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),o=n.forwardRef((e,t)=>
1(0,r.jsx)(a.sG.span,{...e,ref:t,style:{...i,...e.style}}));o.displayName="VisuallyHidden";var l=o},42763:(e,t,s)=>{s.d(t,{Cf:()=>c,Es:()=>m,L3:()=>x,c7:()=>u,lG:()=>o,rr:()=>p});var n=s(95155);s(12115);var a=s(29483),r=s(33210),i=s(40980);function o({...e}){return(0,n.jsx)(a.bL,{"data-slot":"dialog",...e})}function l({...e}){return(0,n.jsx)(a.ZL,{"data-slot":"dialog-portal",...e})}function d({className:e,...t}){return(0,n.jsx)(a.hJ,{"data-slot":"dialog-overlay",className:(0,i.cn)("data-[state=open]:animate-in z-[110] data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 bg-black/80",e),...t})}function c({className:e,children:t,...s}){return(0,n.jsxs)(l,{"data-slot":"dialog-portal",children:[(0,n.jsx)(d,{}),(0,n.jsxs)(a.UC,{"data-slot":"dialog-content",className:(0,i.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-[120] grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...s,children:[t,(0,n.jsxs)(a.bm,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,n.jsx)(r.A,{}),(0,n.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function u({className:e,...t}){return(0,n.jsx)("div",{"data-slot":"dialog-header",className:(0,i.cn)("flex flex-col gap-2 text-center sm:text-left",e),...t})}function m({className:e,...t}){return(0,n.jsx)("div",{"data-slot":"dialog-footer",className:(0,i.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function x({className:e,...t}){return(0,n.jsx)(a.hE,{"data-slot":"dialog-title",className:(0,i.cn)("text-lg leading-none font-semibold",e),...t})}function p({className:e,...t}){return(0,n.jsx)(a.VY,{"data-slot":"dialog-description",className:(0,i.cn)("text-muted-foreground text-sm",e),...t})}},44130:(e,t,s)=>{s.d(t,{Iq:()=>l,sS:()=>o,vS:()=>i});var n=s(95155);s(12115);var a=s(86435),r=s(40980);function i({leftSlot:e,title:t,metadata:s,badge:o,actions:l,actionsOnHover:d=!1,onClick:c,isSelected:u=!1,animate:m=!0,trailingSlot:x,className:p}){let f=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"shrink-0",children:e}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("h3",{className:"font-semibold text-foreground truncate",children:t}),s&&(0,n.jsx)("div",{className:"flex items-center gap-2 sm:gap-3 text-sm font-medium text-muted-foreground flex-wrap mt-0.5",children:s})]}),(0,n.jsx)("div",{className:"shrink-0",children:o}),l&&(0,n.jsx)("div",{className:(0,r.cn)("flex items-center gap-1 shrink-0",d&&"opacity-0 group-hover:opacity-100 transition-opacity"),onClick:e=>e.stopPropagation(),children:l})]}),h=x?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"flex items-center gap-4 min-w-0 flex-1 w-full sm:w-auto",children:f}),(0,n.jsx)("div",{className:"w-full sm:w-[280px] sm:shrink-0 min-w-0",onClick:e=>e.stopPropagation(),children:x})]}):f,g=(0,r.cn)("group flex items-center gap-4 p-4 rounded-2xl border border-orange-900/10 bg-card hover:shadow-sm transition-all cursor-pointer",x&&"flex-col sm:flex-row sm:items-center",u&&"border-orange-500/40 border-[1.5px] bg-orange-500/5",p);return m?(0,n.jsx)(a.P.div,{layout:!0,initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:g,onClick:c,children:h}):(0,n.jsx)("div",{className:g,onClick:c,children:h})}function o({children:e}){return(0,n.jsx)("div",{className:"w-[52px] h-[52px] rounded-full flex items-center justify-center shrink-0 bg-orange-500/15 text-orange-600 dark:text-orange-400",children:e})}let l={success:"px-2.5 py-0.5 rounded-full text-[10px] font-bold uppercase tracking-wider shrink-0 bg-emerald-100 text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-400",pending:"px-2.5 py-0.5 rounded-full text-[10px] font-bold uppercase tracking-wider shrink-0 bg-amber-500/15 text-amber-600 dar
1k:text-amber-400",error:"px-2.5 py-0.5 rounded-full text-[10px] font-bold uppercase tracking-wider shrink-0 bg-red-500/15 text-red-600 dark:text-red-400",info:"px-2.5 py-0.5 rounded-full text-[10px] font-bold uppercase tracking-wider shrink-0 bg-blue-500/15 text-blue-600 dark:text-blue-400"}},51914:(e,t,s)=>{s.d(t,{A:()=>n});let n=(0,s(78340).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},57420:(e,t,s)=>{s.d(t,{A:()=>n});let n=(0,s(78340).A)("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]])},73544:(e,t,s)=>{s.d(t,{O7:()=>m,Q9:()=>l,YD:()=>u});var n=s(4109),a=s(35625),r=s(48934),i=s(55873);let o=async()=>{let{auth:e}=await Promise.resolve().then(s.bind(s,89674));if(e.currentUser)try{return await e.currentUser.getIdToken()}catch(e){console.error("[API] Error getting fresh token:",e)}return null};function l(e){return"analyzing"!==e.voice_profile_status||!!(e.voice_clone_audio_url&&String(e.voice_clone_audio_url).trim())}let d=async e=>{let t=e;if(t||(t=await o()),!t)throw Error("No authentication token available");let s=`${i.A.SERVER_URL}/recordings/voice-profiles`,n=await fetch(s,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!n.ok)throw Error(`HTTP error! status: ${n.status}`);return n.json()},c=async(e,t)=>{let s=t;if(s||(s=await o()),!s)throw Error("No authentication token available");let n=`${i.A.SERVER_URL}/recordings/voice-profiles/${e}/set-default`,a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`}});if(!a.ok)throw Error((await a.json().catch(()=>({}))).detail||`HTTP error! status: ${a.status}`);return a.json()},u=(e,t=!0)=>(0,n.I)({queryKey:["voiceProfiles"],queryFn:()=>d(e),staleTime:12e4,gcTime:3e5,enabled:t,refetchInterval:e=>{let t=e.state.data;return!!(t?.data??[]).some(e=>"analyzing"===e.voice_profile_status||"pending_selection"===e.voice_profile_status)&&4e3},refetchOnWindowFocus:!0}),m=()=>{let e=(0,a.jE)();return(0,r.n)({mutationFn:({sessionId:e,tok:t})=>c(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:["voiceProfiles"]}),e.invalidateQueries({queryKey:["profile"]})}})}},83935:(e,t,s)=>{s.d(t,{C:()=>i});var n=s(12115),a=s(47527),r=s(66294),i=e=>{var t;let s,i,{present:l,children:d}=e,c=function(e){var t,s;let[a,i]=n.useState(),l=n.useRef(null),d=n.useRef(e),c=n.useRef("none"),[u,m]=(t=e?"mounted":"unmounted",s={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},n.useReducer((e,t)=>s[e][t]??e,t));return n.useEffect(()=>{let e=o(l.current);c.current="mounted"===u?e:"none"},[u]),(0,r.N)(()=>{let t=l.current,s=d.current;if(s!==e){let n=c.current,a=o(t);e?m("MOUNT"):"none"===a||t?.display==="none"?m("UNMOUNT"):s&&n!==a?m("ANIMATION_OUT"):m("UNMOUNT"),d.current=e}},[e,m]),(0,r.N)(()=>{if(a){let e,t=a.ownerDocument.defaultView??window,s=s=>{let n=o(l.current).includes(CSS.escape(s.animationName));if(s.target===a&&n&&(m("ANIMATION_END"),!d.current)){let s=a.style.animationFillMode;a.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===a.style.animationFillMode&&(a.style.animationFillMode=s)})}},n=e=>{e.target===a&&(c.current=o(l.current))};return a.addEventListener("animationstart",n),a.addEventListener("animationcancel",s),a.addEventListener("animationend",s),()=>{t.clearTimeout(e),a.removeEventListener("animationstart",n),a.removeEventListener("animationcancel",s),a.removeEventListener("animationend",s)}}m("ANIMATION_END")},[a,m]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:n.useCallback(e=>{l.current=e?getComputedStyle(e):null,i(e)},[])}}(l),u="function"==typeof d?d({present:c.isPresent}):n.Children.only(d),m=(0,a.s)(c.ref,(t=u,(i=(s=Object.getOwnPropertyDescriptor(t.props,"ref")?.get)&&"isReactWarning"in s&&s.isReactWarning)?t.ref:(i=(s=Object.getOwnPropertyDescriptor(t,"ref")?.get)&&"isReactWarning"in s&&s.isReactWarning)?t.props.ref:t.props.ref||t.ref));return"function"==typeof d||c.isPresent?n.cloneElement(u,{ref:m}):null};function o(e){return e?.animationName||"none"}i.displayName="Presence"}}]);
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.