https://neuralsound.org/_next/static/chunks/pages/tools/ai-music-enhancer-editor-6d31f2edfdc955a7.js
1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1941],{2853:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>K});var r=a(37876),s=a(28556),i=a(14232),n=a(89099),l=a(27289),o=a(35739),d=a(75206),c=a(60548),u=a(36414),m=a(16075),h=a(61567),x=a(31829),p=a(54342),b=a(16076),v=a(98746),f=a(74118),g=a(73884),w=a(42298),j=a(41993),y=a(13194);let N=[{id:"clean-balanced",label:"Clean & Balanced"},{id:"vocal-presence",label:"Vocal Presence"},{id:"warm-acoustic",label:"Warm Acoustic"},{id:"live-room",label:"Live Room"}];function k(e){var t;return"custom"===e.preset?"Custom":(null==(t=N.find(t=>t.id===e.preset))?void 0:t.label)||"Cleanup only"}function C(e){let{label:t,value:a,min:s,max:i,step:n,suffix:l="",onChange:o}=e,d=Number.isInteger(n)?Math.round(a):a.toFixed(1);return(0,r.jsxs)("div",{className:"rounded-lg border border-white/8 bg-black/15 px-3 py-2.5",children:[(0,r.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-3 text-xs font-medium text-white/70",children:[(0,r.jsx)("span",{children:t}),(0,r.jsxs)("span",{className:"tabular-nums text-white","aria-hidden":"true",children:[d,l]})]}),(0,r.jsx)(j.A,{min:s,max:i,step:n,value:[a],onValueChange:e=>o(e[0]),"aria-label":"".concat(t,": ").concat(d).concat(l),className:"h-5 cursor-pointer [&_[data-slot=slider-range]]:bg-violet-500 [&_[data-slot=slider-thumb]]:size-4"})]})}function A(e){let{settings:t,activePanel:a,onPanelChange:s,onPreset:i,onSettingsChange:n}=e;return(0,r.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-2",children:[(0,r.jsxs)("section",{className:"shrink-0 rounded-xl border border-white/10 bg-white/[0.04] p-3",children:[(0,r.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[(0,r.jsx)(g.A,{className:"size-4 text-violet-300"}),(0,r.jsx)("h2",{className:"text-sm font-semibold",children:"Studio presets"}),(0,r.jsx)("span",{className:"ml-auto truncate text-xs text-white/45",children:k(t)})]}),(0,r.jsx)("div",{className:"grid grid-cols-2 gap-1.5 sm:grid-cols-4 lg:grid-cols-2 xl:grid-cols-4",children:N.map(e=>(0,r.jsx)(w.$,{size:"sm",className:"h-8 truncate px-2 text-xs",variant:t.preset===e.id?"default":"outline",onClick:()=>i(e.id),children:e.label},e.id))})]}),(0,r.jsxs)(y.tU,{value:a,onValueChange:e=>s(e),className:"min-h-0 flex-1 gap-2",children:[(0,r.jsxs)(y.j7,{className:"grid !h-11 w-full shrink-0 grid-cols-4 overflow-hidden border border-white/10 bg-black/25 p-1",children:[(0,r.jsx)(y.Xi,{value:"eq",className:"h-full min-h-0 py-0 text-xs leading-none sm:text-sm",children:"EQ"}),(0,r.jsx)(y.Xi,{value:"compressor",className:"h-full min-h-0 py-0 text-xs leading-none sm:text-sm",children:"Compressor"}),(0,r.jsx)(y.Xi,{value:"reverb",className:"h-full min-h-0 py-0 text-xs leading-none sm:text-sm",children:"Reverb"}),(0,r.jsx)(y.Xi,{value:"boost",className:"h-full min-h-0 py-0 text-xs leading-none sm:text-sm",children:"Boost"})]}),(0,r.jsxs)(y.av,{value:"eq",className:"min-h-0 rounded-xl border border-white/10 bg-white/[0.04] p-3",children:[(0,r.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[(0,r.jsx)(v.A,{className:"size-4 text-cyan-300"}),(0,r.jsx)("h2",{className:"text-sm font-semibold",children:"Five-band EQ"})]}),(0,r.jsx)("div",{className:"grid grid-cols-2 gap-2",children:[["Low \xb7 80 Hz","low"],["Low-mid \xb7 250 Hz","lowMid"],["Mid \xb7 1 kHz","mid"],["Presence \xb7 4 kHz","presence"],["Air \xb7 12 kHz","air"]].map(e=>{let[a,s]=e;return(0,r.jsx)(C,{label:a,value:t.eq[s],min:-12,max:12,step:.5,suffix:" dB",onChange:e=>n(t=>({...t,eq:{...t.eq,[s]:e}}))},s)})})]}),(0,r.jsxs)(y.av,{value:"compressor",className:"min-h-0 rounded-xl border border-white/10 bg-white/[0.04] p-3",children:[(0,r.jsx)("h2",{className:"mb-2 text-sm font-semibold",children:"Compressor"}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,r.jsx)(C,{label:"Threshold",value:t.compressor.threshold,min:-60,max:0,step:1,suffix:" dB",onChange:e=>n(t=>({...t,compressor:{...t.compressor,threshold:e}}))}),(0,r.jsx)(C,{label:"Ratio",value:t.compressor.ratio,min:1,max:20,step:.5,suffix:":1",onChange:e=>n(t=>({...t,compressor:{...t.compressor,ratio:e}}))}),(0,r.jsx)(C,{label:"Attack",value:t.compressor.attackMs,min:3,max:300,step:1,suffix:" ms",onChange:e=>n(t=>({...t,compressor:{...t.compressor,attackMs:e}}))}),(0,r.jsx)(C,{label:"Release",value:t.compressor.releaseMs,min:50,max:1e3,step:10,suffix:" ms",onChange:e=>n(t=>({...t,compressor:{...t.compressor,releaseMs:e}}))}),(0,r.jsx)(C,{label:"Makeup",value:t.compressor.makeupDb,min:0,max:12,step:.5,suffix:" dB",onChange:e=>n(t=>({...t,compressor:{...t.compressor,makeupDb:e}}))})]})]}),(0,r.jsxs)(y.av,{value:"reverb",className:"min-h-0 rounded-xl border border-white/10 bg-white/[0.04] p-3",children:[(0,r.jsx)("h2",{className:"mb-2 text-sm font-semibold",children:"Reverb"}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,r.jsx)(C,{label:"Amount",value:t.reverb.wet,min:0,max:30,step:1,suffix:"%",onChange:e=>n(t=>
1({...t,reverb:{...t.reverb,wet:e}}))}),(0,r.jsx)(C,{label:"Room size",value:t.reverb.roomSize,min:0,max:100,step:1,suffix:"%",onChange:e=>n(t=>({...t,reverb:{...t.reverb,roomSize:e}}))}),(0,r.jsx)(C,{label:"Pre-delay",value:t.reverb.preDelayMs,min:0,max:100,step:1,suffix:" ms",onChange:e=>n(t=>({...t,reverb:{...t.reverb,preDelayMs:e}}))})]})]}),(0,r.jsxs)(y.av,{value:"boost",className:"min-h-0 rounded-xl border border-white/10 bg-white/[0.04] p-3",children:[(0,r.jsx)("h2",{className:"mb-2 text-sm font-semibold",children:"Volume booster"}),(0,r.jsx)(C,{label:"Output boost",value:t.boostDb,min:0,max:12,step:.5,suffix:" dB",onChange:e=>n(t=>({...t,boostDb:e}))}),(0,r.jsx)("p",{className:"mt-2 text-xs text-white/45",children:"A â1 dB safety limiter stays enabled to reduce clipping."})]})]})]})}var z=a(65734),_=a(56913),T=a(575),P=a(55892),M=a(61681),S=a(3273),E=a(46395),R=a(99598),F=a(47707),V=a(62879);let q="enhancer-settings";async function B(e,t){let a={version:1,settings:(0,F.Xq)(t),updatedAt:Date.now()};await (0,V.oC)(e,q,new Blob([JSON.stringify(a)],{type:"application/json"}))}async function O(e){let t=await (0,V.ve)(e,q);if(!(null==t?void 0:t.blob))return structuredClone(F.p9);try{let e=JSON.parse(await t.blob.text());return 1===e.version?(0,F.Xq)(e.settings):structuredClone(F.p9)}catch(e){return structuredClone(F.p9)}}var D=a(18068),U=a(98044),$=a(97502),I=a(18433);async function L(e,t,a){let r,s={...t},i=R.e.filter(e=>!s[e]);if(0===i.length)return s;let n=window.AudioContext||window.webkitAudioContext;if(!n)throw Error("Web Audio decoding is not available in this browser.");try{r=new n({sampleRate:a})}catch(e){r=new n}try{for(let t of i){let a=e[t];if(!a)throw Error("The enhanced audio is not fully prepared yet.");s[t]=await r.decodeAudioData(await a.arrayBuffer())}}finally{await r.close().catch(()=>void 0)}return s}async function X(e){var t;let a,r,{tracks:s,decodedTracks:i={},settings:n,sampleRate:l=48e3,onProgress:o}=e,d=window.OfflineAudioContext||window.webkitOfflineAudioContext;if(!d)throw Error("Accurate offline audio rendering is not available in this browser.");null==o||o(5);let c=await L(s,i,l),u=R.e.map(e=>c[e]),m=(null==(t=u[0])?void 0:t.sampleRate)||l,h=(0,$.ej)(u.map(e=>e.duration),m);try{a=new d(2,h,m)}catch(e){throw Error("This recording is too large to render accurately in this browser.")}let x=(0,F.Xq)(n),p=(0,U.Zo)(a,a.destination,x);for(let e of R.e){let t=a.createBufferSource();t.buffer=c[e];let r=(0,U.qY)(a,p.input,x);t.connect(r.input),t.start(0)}null==o||o(30);try{r=await a.startRendering()}catch(e){throw Error("The browser could not render this recording accurately. Please close other tabs and retry.")}null==o||o(68);let b=Array.from({length:r.numberOfChannels},(e,t)=>r.getChannelData(t)),v=new Blob([(0,$.If)(b,r.sampleRate)],{type:"audio/wav"});return{audioBuffer:r,wav:v,sampleRate:r.sampleRate,channelCount:r.numberOfChannels,duration:r.duration}}async function W(e){var t;let{format:a,sourceVideo:r,onProgress:s,signal:i}=e;if("mp4"===a&&!r)throw Error("The original video is unavailable. Choose MP3 or WAV instead.");let n=await X(e);if("wav"===a)return null==s||s(100),n.wav;let l=n.wav.size+(null!=(t=null==r?void 0:r.size)?t:0),o=(0,I.f4)(l);if(o)throw new I.I6("memory_limit",o,{recoverable:!1});let d=68,c=s?e=>{s(d=Math.max(d,Math.round(68+28*e)))}:void 0;return(0,I.U2)({operation:"enhancer-export",inputBytes:l,onProgress:c,signal:i},async e=>{let{ffmpeg:t,jobId:l,exec:o,execWithExitCode:d}=e,c=(0,I.vw)(l,"render","wav"),u=(0,I.vw)(l,"output","mp3"),m=(0,I.vw)(l,"output","aac"),h=(0,I.vw)(l,"source-video"),x=(0,I.vw)(l,"output","mp4"),p=[c,u,m,h,x];try{if(await t.writeFile(c,await (0,D.t2)(n.wav),{signal:i}),"mp3"===a){await o(["-i",c,"-c:a","libmp3lame","-b:a","320k",u]);let e=await t.readFile(u,void 0,{signal:i});return null==s||s(100),new Blob([new Uint8Array(e)],{type:"audio/mpeg"})}await o(["-i",c,"-c:a","aac","-b:a","256k",m]),null==s||s(88),await t.writeFile(h,await (0,D.t2)(r),{signal:i});let e=["-i",h,"-i",m,"-map","0:v:0","-map","1:a:0"],l=await d([...e,"-c:v","copy","-c:a","copy","-shortest","-movflags","+faststart",x]);if(0!==l&&(await (0,I.rX)(t,[x]),l=await d([...e,"-c:v","libx264","-preset","ultrafast","-pix_fmt","yuv420p","-c:a","aac","-b:a","256k","-shortest","-movflags","+faststart",x])),0!==l)throw Error("FFmpeg could not create the enhanced video.");let p=await t.readFile(x,void 0,{signal:i});
1return null==s||s(100),new Blob([new Uint8Array(p)],{type:"video/mp4"})}finally{await (0,I.rX)(t,p)}})}var H=a(67565),Q=a(46658),Y=a(68999),J=a(88654);function G(e){let t=Number.isFinite(e)?Math.max(0,e):0,a=Math.floor(t/60),r=Math.floor(t%60);return"".concat(a,":").concat(r.toString().padStart(2,"0"))}function Z(){let e=(0,n.useRouter)(),{user:t,isAuthenticated:a}=(0,P.A)(),{visitorId:s}=(0,M.u)(),g="string"==typeof e.query.requestId?e.query.requestId:"",y="video"===e.query.mediaType?"video":"audio",[N,C]=(0,i.useState)(()=>structuredClone(F.p9)),[V,q]=(0,i.useState)(!1),[D,U]=(0,i.useState)([]),[$,L]=(0,i.useState)([]),[X,Z]=(0,i.useState)("enhanced"),[K,ee]=(0,i.useState)(null),[et,ea]=(0,i.useState)(""),[er,es]=(0,i.useState)("video"===y?"mp4":"mp3"),[ei,en]=(0,i.useState)(!1),[el,eo]=(0,i.useState)(0),[ed,ec]=(0,i.useState)(""),[eu,em]=(0,i.useState)(!1),[eh,ex]=(0,i.useState)("eq"),[ep,eb]=(0,i.useState)(!1),[ev,ef]=(0,i.useState)(0),eg=(0,i.useRef)(null),ew=(0,i.useRef)({}),ej=(0,i.useRef)(null);(0,i.useEffect)(()=>()=>{var e;return null==(e=ej.current)?void 0:e.abort()},[]);let ey=(0,S.f)({requestId:g,type:"MODE_2",mediaType:y,userId:(null==t?void 0:t.id)||"",visitorId:t?"":s,enabled:e.isReady&&!!g,initiallyCompleted:!0,useExternalAudioClock:!0,requiredTrackIds:[...R.e]}),eN="error"===ey.phase||ey.tracks.some(e=>e.active&&"error"===e.cacheStatus),ek=(0,i.useMemo)(()=>ey.tracks.filter(e=>e.active).map(e=>({id:e.id,active:!0,blob:ey.getStemBlob(e.id)})),[ey]),eC=(0,i.useCallback)((e,t)=>{R.e.includes(e)&&(ew.current[e]=t)},[]),eA=(0,i.useCallback)(e=>{ef(e)},[]);(0,E.B)({enabled:ey.exportReady&&"enhanced"===X,tracks:ek,decodeMode:"eager",isPlaying:ey.isPlaying,currentTime:ey.currentTime,duration:ey.duration,isLooping:!1,loopStart:0,loopEnd:ey.duration,masterVolume:ey.masterVolume,trackVolumes:ey.trackVolumes,mutedTracks:ey.mutedTracks,soloedTrack:ey.soloedTrack,syncRevision:ey.syncRevision,enhancementSettings:N,onTimeUpdate:ey.updateCurrentTimeFromClock,onDurationChange:ey.setDurationFromMedia,onEnded:ey.pause,onPlaybackBlocked:ey.pause,onPlaybackFailed:(e,t)=>ec(t instanceof Error?t.message:"Playback failed."),onTrackDecoded:eC,onAudioFormatReady:eA}),(0,i.useEffect)(()=>{if(!g)return;ew.current={},ef(0),q(!1);let e=!0;return Promise.all([O(g),"video"===y?(0,Q.a_)(g):(0,H.kw)(g).then(e=>(null==e?void 0:e.file)||null)]).then(t=>{let[a,r]=t;e&&(C(a),ee(r),q(!0),(0,l.track)("enhancer_editor_ready",{mediaType:y}))}).catch(t=>{e&&ec(t instanceof Error?t.message:"Could not restore this session.")}),()=>{e=!1}},[y,g]),(0,i.useEffect)(()=>{if(!K)return;let e=URL.createObjectURL(K);return ea(e),()=>URL.revokeObjectURL(e)},[K]),(0,i.useEffect)(()=>{if(!V||!g)return;let e=window.setTimeout(()=>{B(g,N)},450);return()=>window.clearTimeout(e)},[g,N,V]),(0,i.useEffect)(()=>{let e=eg.current;if(!e||!et)return;let t=ey.currentTime,a=ey.isPlaying,r=ey.pause;e.muted="enhanced"===X,e.volume=Math.min(1,Math.max(0,ey.masterVolume)),Math.abs(e.currentTime-t)>.25&&(e.currentTime=t),a?e.play().catch(()=>r()):e.pause()},[X,ey,et]);let ez=(0,i.useCallback)(e=>{U(e=>[...e.slice(-49),N]),L([]),C(e)},[N]),e_=(0,i.useCallback)(e=>{ez((0,F.OQ)(e(N)))},[ez,N]),eT=e=>{ez((0,F.Ok)(e)),(0,l.track)("enhancer_preset_applied",{preset:e})},eP=e=>{ey.setCurrentTime(e),ey.requestPlaybackSync(),eg.current&&(eg.current.currentTime=e)},eM=()=>{Z("enhanced"===X?"original":"enhanced"),ey.requestPlaybackSync()},eS=async()=>{if(!a||!(null==t?void 0:t.canDownload)||ei||!ey.exportReady||!V||!ev)return;let e={};for(let t of R.e){let a=ey.getStemBlob(t);if(!a)return void ec("Your audio is still being prepared. Please retry in a moment.");e[t]=a}en(!0);let r=new AbortController;ej.current=r,eo(0),ec("");try{(0,l.track)("enhancer_export_started",{format:er,mediaType:y});let t=await W({tracks:e,decodedTracks:ew.current,settings:N,format:er,sampleRate:ev,sourceVideo:"mp4"===er?K:null,signal:r.signal,onProgress:eo});(0,Y.WN)(t,function(e,t){let a=e.replace(/\.[^.]+$/,"")||"recording";return"".concat(a,"-enhanced.").concat(t)}((null==K?void 0:K.name)||"recording",er)),(0,J.jr)(g),(0,J.dB)("mixed-export-count",g),(0,l.track)("enhancer_export_
1completed",{format:er,mediaType:y}),sessionStorage.setItem("shouldShowReview","true"),em(!1)}catch(e){ec((0,I.kP)(e)),(0,l.track)("enhancer_export_failed",{format:er,mediaType:y})}finally{ej.current=null,en(!1)}};if(!ey.exportReady)return(0,r.jsx)(f.A,{title:"AI Music Enhancer",description:"Studio editor",activeTool:"ai-music-enhancer",viewportWorkspace:!0,children:(0,r.jsx)("div",{className:"mx-auto flex h-full max-w-xl items-center justify-center text-center text-white",children:(0,r.jsx)("div",{className:"rounded-3xl border border-white/10 bg-white/5 p-10",children:eN?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h1",{className:"mb-3 text-2xl font-bold",children:"Your editor could not be restored"}),(0,r.jsx)("p",{className:"mb-6 text-white/60",children:"The saved audio could not be restored. Please retry preparation."}),(0,r.jsx)(w.$,{onClick:()=>void ey.retryStemDownload(),children:"Retry preparation"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.A,{className:"mx-auto mb-4 size-9 animate-spin text-violet-400"}),(0,r.jsx)("p",{children:"Restoring your studio sessionâ¦"})]})})})});let eE="video"===y?["mp4","mp3","wav"]:["mp3","wav"],eR=V&&ev>0,eF=k(N);return(0,r.jsx)(f.A,{title:"AI Music Enhancer",description:"Studio editor",activeTool:"ai-music-enhancer",viewportWorkspace:!0,children:(0,r.jsxs)("div",{className:"relative mx-auto flex h-full min-h-0 max-w-[1500px] flex-col gap-2 overflow-hidden text-white",children:[(0,r.jsx)("header",{className:"relative flex h-0 shrink-0 items-center px-3 md:h-12",children:(0,r.jsxs)("div",{className:"ml-auto flex items-center shrink-0 gap-1",children:[(0,r.jsx)(w.$,{variant:"outline",size:"icon-sm",className:"hidden md:inline-flex",onClick:()=>{let e=D[D.length-1];e&&(U(e=>e.slice(0,-1)),L(e=>[N,...e].slice(0,50)),C(e))},disabled:!D.length,"aria-label":"Undo",children:(0,r.jsx)(d.A,{})}),(0,r.jsx)(w.$,{variant:"outline",size:"icon-sm",className:"hidden md:inline-flex",onClick:()=>{let e=$[0];e&&(U(e=>[...e.slice(-49),N]),L(e=>e.slice(1)),C(e))},disabled:!$.length,"aria-label":"Redo",children:(0,r.jsx)(c.A,{})}),(0,r.jsx)(w.$,{variant:"outline",size:"icon-sm",className:"hidden md:inline-flex",onClick:()=>ez((0,F.Ok)("neutral")),"aria-label":"Reset enhancement settings",children:(0,r.jsx)(u.A,{})}),(0,r.jsxs)(w.$,{className:"fixed right-4 top-4 z-[91] h-10 px-3 shadow-lg md:static md:ml-1 md:h-9",onClick:()=>{ec(""),em(!0)},disabled:ei,children:[(0,r.jsx)(m.A,{})," Export"]})]})}),(0,r.jsxs)("div",{className:"grid min-h-0 flex-1 gap-2 lg:grid-cols-[minmax(0,45fr)_minmax(0,55fr)]",children:[(0,r.jsxs)("section",{className:"flex min-h-0 flex-col overflow-hidden rounded-xl border border-white/10 bg-black/30",children:[(0,r.jsxs)("div",{className:"relative flex min-h-0 flex-1 items-center justify-center overflow-hidden bg-black/40",children:[(0,r.jsxs)("div",{className:"absolute right-3 top-3 z-10 flex rounded-lg border border-white/15 bg-black/65 p-0.5 shadow-lg backdrop-blur-md",role:"group","aria-label":"Preview version",children:[(0,r.jsx)("button",{type:"button","aria-pressed":"original"===X,onClick:()=>{"original"!==X&&eM()},className:"h-8 rounded-md px-3 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-violet-400 ".concat("original"===X?"bg-white/15 text-white shadow-sm":"text-white/55 hover:text-white"),children:"Original"}),(0,r.jsx)("button",{type:"button","aria-pressed":"enhanced"===X,onClick:()=>{"enhanced"!==X&&eM()},className:"h-8 rounded-md px-3 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-violet-400 ".concat("enhanced"===X?"bg-violet-600 text-white shadow-sm":"text-white/55 hover:text-white"),children:"Enhanced"})]}),"video"===y&&et?(0,r.jsx)("video",{ref:e=>{eg.current=e},src:et,playsInline:!0,className:"h-full max-h-full w-full object-contain",onTimeUpdate:e=>{"original"===X&&ey.updateCurrentTimeFromClock(e.currentTarget.currentTime)},onEnded:ey.pause}):et?(0,r.jsx)("audio",{ref:e=>{eg.current=e},src:et,preload:"metadata",onTimeUpdate:e=>{"original"===X&&ey.updateCurrentTimeFromClock(e.currentTarget.currentTime)},onEnded:ey.pause,className:"hidden"}):null,"audio"===y&&(0,r.jsx)("div",{className:"flex h-full min-h-28 w-full items-center justify-center overflow-hidden bg-[radial-gradient(circle_at_center,rgba(139,92,246,.22),transparent_65%)]",children:(0,r.jsx)("div",{className:"flex h-28 max-w-full items-end gap-1 px-4","aria-hidden":"true",children:Array.from({length:42},(e,t)=>(0,r.jsx)("span",{className:"w-1 rounded-full bg-gradient-to-t from-violet-600 to-cyan-300",style:{height:"".concat(18+17*t%70,"px"),opacity:.45+13*t%45/100}},t))})})]}),(0,r.jsxs)("div",{className:"shrink-0 border-t border-white/10 p-2 sm:p-3",children:[(0,r.jsx)("div",{className:"space-y-2.5 sm:hidden",children:(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,r.jsx)(w.$,{size:"icon",className:"size-10 shrink-0 rounded-xl shadow-lg shadow-violet-950/20",onClick:()=>void ey.togglePlay(),"aria-label":ey.isPlaying?"Pause":"Play",children:ey.isPlaying?(0,r.jsx)(h.A,{}):(0,r.jsx)(x.A,{})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("div",{className:"mb-1.5 flex items-center justify-between text-[11px] font-medium tabular-nums text-white/55",children:[(0,r.jsx)("span",{children:G(ey.currentTime)}),(0,r.jsx)("span",{children:G(ey.duration)})]}),(0,r.jsx)(j.A,{min:0,max:ey.duration||0,step:.05,value:[Math.min(ey.currentTime,ey.duration||0)],onValueChange:e=>eP(e[0]),"aria-label":"Playback position",className:"min-w-0 cursor-pointer [&_[data-slot=slider-range]]:bg-violet-500 [&_[data-slot=slider-thumb]]:size-4"})]}),(0,r.jsxs)(_.AM,{children:[(0,r.jsx)(_.Wv,{asChild:!0,children:(0,r.jsx)(w.$,{variant:"outline",size:"icon",className:"size-10 shrink-0 rounded-xl","aria-label":"Master volume ".concat(Math.round(100*ey.masterVolume),"%"),children:(0,r.jsx)(p.A,{className:"size-4"})})}),(0,r.jsxs)(_.hl,{side:"top",align:"end",sideOffset:8,className:"w-14 items-center border-white/15 bg-zinc-950 px-2 py-3 text-white shadow-xl",children:[(0,r.jsxs)("span",{className:"text-[10px] font-medium tabular-nums text-white/65",children:[Math.round(100*ey.masterVolume),"%"]}),(0,r.jsx)("div",{className:"flex h-28 w-8 items-center justify-center py-1",children:(0,r.jsx)(j.A,{orientation:"vertical",min:0,max:1,step:.
101,value:[ey.masterVolume],onValueChange:e=>ey.setMasterVolume(e[0]),"aria-label":"Master playback volume",className:"h-full cursor-pointer [&_[data-slot=slider-range]]:bg-violet-500 [&_[data-slot=slider-thumb]]:size-4 [&_[data-slot=slider-track]]:bg-white/20"})})]})]})]})}),(0,r.jsxs)("div",{className:"hidden items-center gap-2 sm:flex",children:[(0,r.jsx)(w.$,{size:"icon",onClick:()=>void ey.togglePlay(),"aria-label":ey.isPlaying?"Pause":"Play",children:ey.isPlaying?(0,r.jsx)(h.A,{}):(0,r.jsx)(x.A,{})}),(0,r.jsx)("span",{className:"w-10 text-right text-xs tabular-nums text-white/65",children:G(ey.currentTime)}),(0,r.jsx)(j.A,{min:0,max:ey.duration||0,step:.05,value:[Math.min(ey.currentTime,ey.duration||0)],onValueChange:e=>eP(e[0]),"aria-label":"Playback position",className:"min-w-0 flex-1 cursor-pointer [&_[data-slot=slider-range]]:bg-violet-500 [&_[data-slot=slider-thumb]]:size-4"}),(0,r.jsx)("span",{className:"w-10 text-xs tabular-nums text-white/65",children:G(ey.duration)}),(0,r.jsxs)("div",{className:"flex w-28 shrink-0 items-center gap-1.5",title:"Master volume ".concat(Math.round(100*ey.masterVolume),"%"),children:[(0,r.jsx)(p.A,{className:"size-4 shrink-0 text-white/60","aria-hidden":"true"}),(0,r.jsx)(j.A,{min:0,max:1,step:.01,value:[ey.masterVolume],onValueChange:e=>ey.setMasterVolume(e[0]),"aria-label":"Master playback volume",className:"min-w-0 flex-1 cursor-pointer [&_[data-slot=slider-range]]:bg-violet-500 [&_[data-slot=slider-thumb]]:size-3.5"}),(0,r.jsxs)("span",{className:"w-8 text-right text-[10px] tabular-nums text-white/50",children:[Math.round(100*ey.masterVolume),"%"]})]})]})]}),(0,r.jsxs)("div",{className:"relative shrink-0 border-t border-violet-400/15 bg-gradient-to-b from-violet-500/10 via-zinc-950/80 to-zinc-950 px-2 pb-1.5 pt-5 lg:hidden",children:[(0,r.jsx)(w.$,{variant:"outline",size:"icon-sm",className:"absolute left-1/2 top-1 size-7 -translate-x-1/2 rounded-full border-violet-400/30 bg-zinc-900 text-violet-200 shadow-[0_0_18px_rgba(139,92,246,0.25)] hover:bg-violet-500/20",onClick:()=>eb(!0),"aria-label":"Expand studio controls",children:(0,r.jsx)(b.A,{className:"size-4"})}),(0,r.jsxs)(w.$,{variant:"ghost",className:"h-10 w-full justify-start rounded-lg border border-white/10 bg-white/[0.04] px-3 hover:bg-white/[0.08]",onClick:()=>eb(!0),children:[(0,r.jsx)(v.A,{className:"text-violet-300"}),(0,r.jsx)("span",{className:"font-medium",children:"Studio Controls"}),(0,r.jsx)("span",{className:"ml-auto max-w-[42%] truncate text-xs text-violet-300",children:eF})]})]})]}),(0,r.jsx)("aside",{className:"hidden min-h-0 flex-col lg:flex",children:(0,r.jsx)(A,{settings:N,activePanel:eh,onPanelChange:ex,onPreset:eT,onSettingsChange:e_})})]}),(0,r.jsx)(T.cj,{open:ep,onOpenChange:eb,children:(0,r.jsxs)(T.h,{side:"bottom",className:"max-h-[78dvh] overflow-y-auto rounded-t-2xl border-white/15 bg-zinc-950 px-3 pb-[max(0.75rem,env(safe-area-inset-bottom))] pt-1 text-white lg:hidden",children:[(0,r.jsxs)(T.Fm,{className:"px-1 pb-2 pt-3 text-left",children:[(0,r.jsx)(T.qp,{className:"text-white",children:"Studio Controls"}),(0,r.jsx)(T.Qs,{className:"text-xs text-white/50",children:"Choose a preset or fine-tune the enhanced mix."})]}),(0,r.jsx)(A,{settings:N,activePanel:eh,onPanelChange:ex,onPreset:eT,onSettingsChange:e_})]})}),(0,r.jsx)(z.lG,{open:eu,onOpenChange:e=>{ei||em(e)},children:(0,r.jsxs)(z.Cf,{overlayClassName:"bg-black/65 backdrop-blur-sm",className:"w-[calc(100%-2rem)] max-w-md border-white/15 bg-zinc-950 p-5 text-white shadow-2xl sm:p-6",children:[(0,r.jsxs)(z.c7,{className:"text-left",children:[(0,r.jsx)(z.L3,{className:"text-xl font-semibold text-white",children:"Export enhanced recording"}),(0,r.jsx)(z.rr,{className:"text-white/55",children:a&&(null==t?void 0:t.canDownload)?"Choose a file type and download the enhanced mix.":"A paid plan is required to export your enhanced recording."})]}),a?(null==t?void 0:t.canDownload)?(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"mb-2 text-sm font-medium text-white/75",children:"File type"}),(0,r.jsx)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:eE.map(e=>(0,r.jsx)(w.$,{type:"button",className:"h-11",variant:er===e?"default":"outline",onClick:()=>es(e),disabled:ei,children:e.toUpperCase()},e))})]}),ed&&(0,r.jsx)("p",{role:"alert",className:"rounded-lg border border-red-400/25 bg-red-500/10 px-3 py-2 text-sm text-red-200",children:ed}),ei&&(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex justify-between text-xs text-white/55",children:[(0,r.jsx)("span",{children:"Rendering your file"}),(0,r.jsxs)("span",{children:[el,"%"]})]}),(0,r.jsx)("div",{className:"h-2 overflow-hidden rounded-full bg-white/10",children:(0,r.jsx)("div",{className:"h-full bg-gradient-to-r from-violet-500 to-cyan-400 transition-[width]",style:{width:"".concat(el,"%")}})})]}),(0,r.jsx)(w.$,{className:"w-full",variant:ei?"destructive":"default",onClick:ei?()=>{var e;return null==(e=ej.current)?void 0:e.abort()}:()=>void eS(),disabled:!ei&&(!ey.exportReady||!eR),children:ei?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.A,{className:"animate-spin"})," Cancel rendering"]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.A,{})," Download ",er.toUpperCase()]})})]}):(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"rounded-xl border border-violet-400/25 bg-vi
1olet-500/10 p-4",children:[(0,r.jsx)("p",{className:"font-medium text-violet-100",children:"Export is available on paid plans"}),(0,r.jsx)("p",{className:"mt-1 text-sm leading-relaxed text-white/60",children:"Upgrade to download the enhanced recording as a high-quality audio file or video."})]}),(0,r.jsx)(w.$,{className:"w-full",onClick:()=>void e.push("/pricing"),children:"View pricing plans"})]}):(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("div",{className:"rounded-xl border border-amber-400/25 bg-amber-400/10 p-4 text-sm text-amber-100",children:"Log in to check your plan and export this recording."}),(0,r.jsx)(w.$,{className:"w-full",onClick:()=>void e.push("/login?redirect=".concat(encodeURIComponent(e.asPath))),children:"Log in to continue"})]})]})})]})})}function K(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.bV,{title:"Studio Editor - AI Music Enhancer",noindex:!0}),(0,r.jsx)(Z,{})]})}},13194:(e,t,a)=>{"use strict";a.d(t,{Xi:()=>c,av:()=>u,j7:()=>d,tU:()=>l});var r=a(37876);a(14232);var s=a(47137),i=a(90491),n=a(15565);function l(e){let{className:t,orientation:a="horizontal",...s}=e;return(0,r.jsx)(i.bL,{"data-slot":"tabs","data-orientation":a,className:(0,n.cn)("group/tabs flex gap-2 data-horizontal:flex-col",t),...s})}let o=(0,s.F)("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function d(e){let{className:t,variant:a="default",...s}=e;return(0,r.jsx)(i.B8,{"data-slot":"tabs-list","data-variant":a,className:(0,n.cn)(o({variant:a}),t),...s})}function c(e){let{className:t,...a}=e;return(0,r.jsx)(i.l9,{"data-slot":"tabs-trigger",className:(0,n.cn)("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",t),...a})}function u(e){let{className:t,...a}=e;return(0,r.jsx)(i.UC,{"data-slot":"tabs-content",className:(0,n.cn)("flex-1 text-sm outline-none",t),...a})}},25154:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/tools/ai-music-enhancer-editor",function(){return a(2853)}])},46658:(e,t,a)=>{"use strict";a.d(t,{a_:()=>n,dT:()=>i});var r=a(62879);let s="source-video";async function i(e,t){await (0,r.oC)(e,s,t)}async function n(e){let t=await (0,r.ve)(e,s);return(null==t?void 0:t.blob)?t.blob instanceof File?t.blob:new File([t.blob],"".concat(e,".mp4"),{type:t.mimeType}):null}},67565:(e,t,a)=>{"use strict";a.d(t,{h7:()=>i,kw:()=>n,rm:()=>o,t9:()=>l});var r=a(62879);let s="original-file";async function i(e,t,a,i){await (0,r.oC)(e,s,t)}async function n(e){let t=await (0,r.ve)(e,s);if(!(null==t?void 0:t.blob))return null;let a=t.blob instanceof File?t.blob:new File([t.blob],"".concat(e),{type:t.mimeType});return{id:e,file:a,storedAt:t.createdAt,duration:0,mediaType:a.type.startsWith("video/")?"video":"audio"}}async function l(e){await (0,r.Y8)(e,s)}async function o(){await (0,r.MH)()}},99598:(e,t,a)=>{"use strict";a.d(t,{e:()=>r});let r=["vocal","drums","bass","guitar","piano"]}},e=>{e.O(0,[2618,4587,4e3,1598,5982,1293,1737,8433,9170,368,5740,683,636,6593,8792],()=>e(e.s=25154)),_N_E=e.O()}]);
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.