1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[661],{6183:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/app/create/audio",function(){return r(6562)}])},6562:function(e,t,r){"use strict";r.r(t);var a=r(5893),i=r(7294),s=r(9008),l=r.n(s),o=r(1664),n=r.n(o),d=r(1163),c=r(8713),u=r(7855),m=r(3550),x=r(3193);let h="https://lyricvue-backend-748104763631.us-central1.run.app";function formatClock(e){let t=Math.round(e);return"".concat(Math.floor(t/60),":").concat(String(t%60).padStart(2,"0"))}function formatMinutes(e){let t=Math.round(e/60);return"".concat(t," minute").concat(1===t?"":"s")}function withTimeout(e,t,r){return Promise.race([e,new Promise((e,a)=>setTimeout(()=>a(Error(r)),t))])}async function convertWavToMp3(e,t){let{FFmpeg:a}=await r.e(581).then(r.bind(r,7581)),{fetchFile:i}=await r.e(756).then(r.bind(r,756)),s=new a,l="https://unpkg.com/@ffmpeg/[email protected]/dist/esm",o="".concat(window.location.origin,"/ffmpeg/worker.js");await s.load({coreURL:"".concat(l,"/ffmpeg-core.js"),wasmURL:"".concat(l,"/ffmpeg-core.wasm"),classWorkerURL:o}),t(10),await s.writeFile("input.wav",await i(e)),t(20),s.on("progress",e=>{let{progress:r}=e;return t(20+Math.round(78*r))}),await s.exec(["-i","input.wav","-codec:a","libmp3lame","-b:a","128k","output.mp3"]);let n=await s.readFile("output.mp3");t(99);let d=new Blob([new Uint8Array(n)],{type:"audio/mp3"}),c=e.name.replace(/\.[^/.]+$/,"")+".mp3";return new File([d],c,{type:"audio/mp3"})}let CreateAudioPage=()=>{let e=(0,d.useRouter)(),{user:t,stats:r,recentAudioFiles:s,recentAudioLoading:o,prependRecentAudioFile:c}=(0,u.j)(),p=(0,i.useRef)(null),[f,g]=(0,i.useState)(!1),[v,y]=(0,i.useState)(!1),[b,j]=(0,i.useState)(0),[w,N]=(0,i.useState)(!1),[k,C]=(0,i.useState)(null),[M,L]=(0,i.useState)(null),[S,F]=(0,i.useState)(null),[_,A]=(0,i.useState)(null),[z,T]=(0,i.useState)(null),[B,P]=(0,i.useState)(!1),[I,U]=(0,i.useState)(null),W=(0,i.useRef)(null),[D,R]=(0,i.useState)(null),[E,V]=(0,i.useState)(null),[O,H]=(0,i.useState)({}),[Y,q]=(0,i.useState)(!1),[X,$]=(0,i.useState)(!1);(0,i.useEffect)(()=>{"true"===e.query.useCredit&&P(!0)},[e.query.useCredit]),(0,i.useEffect)(()=>{r&&1===r.planId&&r.activeCredits>0&&r.videosThisMonth>=r.monthlyLimit&&P(!0)},[r]),(0,i.useEffect)(()=>{let e=(0,x.q3)();(null==e?void 0:e.audioFileId)&&(A(e.audioFileId),L(e.audioFileName),F(e.audioDurationSeconds)),(null==e?void 0:e.useCredit)&&P(!0),(0,x.LF)()&&(q(!0),$(!!(null==e?void 0:e.backgroundLockedFromMedia)))},[]),(0,i.useEffect)(()=>()=>{var e;null===(e=W.current)||void 0===e||e.pause()},[]);let togglePreview=async e=>{if(D===e){var r;null===(r=W.current)||void 0===r||r.pause(),R(null);return}let a=O[e];if(!a){V(e);try{let r=(0,m.bW)(),i=await fetch("".concat(h,"/api/v1/videos/files/").concat(e,"/preview-url"),{headers:{Authorization:"Bearer ".concat(r),"x-user-id":t.id}});if(!i.ok)throw Error("preview_failed");let s=await i.json();(a=s.signedUrl)&&H(t=>({...t,[e]:a}))}catch(e){V(null);return}V(null)}a&&(W.current||(W.current=new Audio),W.current.src=a,W.current.onended=()=>R(null),W.current.play().catch(()=>R(null)),R(e))},Z=!!r&&1===r.planId&&r.activeCredits>0,G=r?1===r.planId&&B&&r.activeCredits>0?240:r.maxDuration:30,J=(0,i.useCallback)(e=>{let r=0,poll=async()=>{r+=1;try{let r=(0,m.bW)(),s=await fetch("".concat(h,"/api/v1/videos/files/").concat(e,"/cover-art"),{headers:{Authorization:"Bearer ".concat(r),"x-user-id":(null==t?void 0:t.id)||""}}),l=await s.json();if((null==l?void 0:l.ready)&&l.coverArtFileId){var a,i;let t=(0,x.q3)(),r=!!(null==t?void 0:t.backgroundMode)||(null!==(i=null==t?void 0:null===(a=t.imageSlots)||void 0===a?void 0:a.length)&&void 0!==i?i:0)>0;(null==t?void 0:t.audioFileId)!==e||r||((0,x.Sk)({imageSlots:[{slot:1,fileId:l.coverArtFileId,source:"upload"}]}),(0,x.SD)()),l.coverArtUrl&&T(l.coverArtUrl);return}}catch(e){}r<8&&setTimeout(poll,1500)};setTimeout(poll,1500)},[t]),K=(0,i.useCallback)(async(e,r)=>{if(t){N(!0),C(null),T(null);try{var a;let i=(0,m.bW)(),s=new FormData;s.append("audio",e),null!==r&&s.append("audioDuration",r.toString());let l=B&&Z?"?useCredit=true":"",o=await fetch("".concat(h,"/api/v1/videos/upload-audio").concat(l),{method:"POST",headers:{Authorization:"Bearer ".concat(i),"x-user-id":t.id},body:s}),n=await o.json();if(!o.ok)throw Error(n.error||"Upload failed");A(n.fileId),L(n.originalFilename),F(n.durationSeconds),(0,x.Sk)({audioFileId:n.fileId,audioFileName:n.originalFilename,audioDurationSeconds:n.durationSeconds,useCredit:B,trackName:null,artistName:null,id3Artist:n.id3Artist||null,id3TrackName:n.id3TrackName||null,...n.coverArtFileId?{imageSlots:[{slot:1,fileId:n.coverArtFileId,source:"upload"}]}:{}}),n.coverArtFileId?((0,x.SD)(),n.coverArtUrl&&T(n.coverArtUrl)):n.coverArtPending&&n.fileId&&J(n.fileId),c({id:n.fileId,original_filename:n.originalFilename,size_bytes:e.size,duration_seconds:n.durationSeconds,was_trimmed:!!n.wasTrimmed,original_duration_seconds:null!==(a=n.originalDurationSeconds)&&void 0!==a?a:null,created_at:new Date().toISOString()})}catch(e){C(e instanceof Error?e.message:"Upload failed"),A(null)}finally{N(!1)}}},[t,B,Z,c,J]),Q=(0,i.useCallback)(async e=>{if(A(null),L(e.name),C(null),T(null),0===e.size){C("This audio file appears to be empty (0 bytes). Please upload a valid audio file.");return}if(e.size>115343360){C("File size must be less than 110MB");return}let t="audio/wav"===e.type||e.name.toLowerCase().endsWith(".wav"),a=t&&e.size>10485760,i=e;if(a){y(!0),j(0);try{i=await withTimeout(convertWavToMp3(e,j),45e3,"WAVâMP3 conversion timed out")}
1catch(t){if(console.warn("WAVâMP3 conversion failed:",t),e.size>31457280){C("This WAV file is too large to upload as-is, and we couldn't convert it in your browser. Please convert it to MP3 first, or try a different browser."),y(!1),j(0);return}i=e}finally{y(!1),j(0)}}let s=URL.createObjectURL(i),l=new Audio;l.src=s,l.onloadedmetadata=()=>{let e=l.duration;if(URL.revokeObjectURL(s),e<10){C("Audio file must be at least 10 seconds long.");return}let t=5*G;if(e>t){let e=formatMinutes(t),a=formatMinutes(G);C("This file is too long to upload (over ".concat(e,"). Your ").concat(null==r?void 0:r.plan," plan trims audio to ").concat(a," â please trim your file before uploading."));return}K(i,e)},l.onerror=()=>{URL.revokeObjectURL(s),K(i,null)}},[r,G,K]),handleFileChange=e=>{var t;let r=null===(t=e.target.files)||void 0===t?void 0:t[0];r&&Q(r)},looksSlicedByFreeTier=e=>!!Z&&!!r&&(null!=e.was_trimmed?e.was_trimmed:null!=e.duration_seconds&&.5>Math.abs(e.duration_seconds-r.maxDuration)),handleRecentFileClick=e=>{looksSlicedByFreeTier(e)?U(e):selectRecentFile(e)},selectRecentFile=e=>{A(e.id),L(e.original_filename),F(e.duration_seconds),C(null),T(null),p.current&&(p.current.value=""),(0,x.Sk)({audioFileId:e.id,audioFileName:e.original_filename,audioDurationSeconds:e.duration_seconds,useCredit:B,trackName:null})},ee=!!r&&1===r.planId&&r.videosThisMonth>=r.monthlyLimit&&0===r.activeCredits&&!!r.activeAiCredits,et=!!r&&1===r.planId&&r.videosThisMonth>=r.monthlyLimit&&0===r.activeCredits&&!r.activeAiCredits,er=!!_&&!w&&!v&&!et;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l(),{children:(0,a.jsx)("title",{children:"Upload Audio \xb7 LyricVue"})}),(0,a.jsxs)("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-4 md:p-5",children:[(0,a.jsxs)("h1",{className:"text-lg font-bold mb-3 flex items-center gap-2",children:[(0,a.jsx)("span",{children:"\uD83C\uDFB5"})," Upload Audio"]}),Y&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 mb-3 bg-purple-50 border border-purple-200 rounded-lg text-sm text-purple-800",children:[(0,a.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),X?(0,a.jsx)("span",{children:"Video selected from My Media â pick your audio to continue. Aspect Ratio and Background Type are already set to match your clip, so we'll skip straight to Captions."}
1):(0,a.jsx)("span",{children:"Background selected from My Media â pick your audio to continue, you'll confirm it on the Background step."})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Your File"}),r&&1===r.planId&&r.activeCredits>0&&r.videosThisMonth>=r.monthlyLimit&&(0,a.jsx)("div",{className:"px-3 py-2 mb-2 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-800 font-medium",children:"â¡ You have a credit â upload to use it (4 min, no watermark)"}),Z&&!et&&r.videosThisMonth<r.monthlyLimit&&(0,a.jsxs)("label",{className:"flex items-start gap-2 px-3 py-2 mb-2 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-800 cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox",checked:B,onChange:e=>{P(e.target.checked),(0,x.Sk)({useCredit:e.target.checked})},disabled:w,className:"mt-0.5"}),(0,a.jsxs)("span",{children:[(0,a.jsx)("span",{className:"font-medium",children:"â¡ Use my credit for this video (up to 4 min, no watermark)"}),(0,a.jsx)("span",{className:"block text-xs text-amber-700",children:"Tick this before uploading â it decides how much of your song is kept."})]})]}),ee&&(0,a.jsx)("div",{className:"px-3 py-2 mb-2 bg-purple-50 border border-purple-200 rounded-lg text-sm text-purple-800 font-medium",children:'⨠You\'ve used your 3 free videos, but you have an AI video credit â pick "Use AI" for your background on the next step to use it.'}),(0,a.jsxs)("div",{className:"relative flex-1 min-h-[140px] flex flex-col justify-center items-center px-6 py-8 border-2 border-dashed rounded-lg transition-colors overflow-hidden ".concat(et?"border-red-200 bg-red-50 cursor-not-allowed":"cursor-pointer ".concat(f?"border-primary bg-primary/5":_?"border-green-400 bg-green-50":k&&!_?"border-red-400 bg-red-50":"border-gray-300 hover:border-primary")),onDragOver:et?void 0:e=>{e.preventDefault(),e.stopPropagation()},onDragEnter:et?void 0:e=>{e.preventDefault(),e.stopPropagation(),g(!0)},onDragLeave:et?void 0:e=>{e.preventDefault(),e.stopPropagation(),g(!1)},onDrop:et?void 0:e=>{var t;e.preventDefault(),e.stopPropagation(),g(!1);let r=null===(t=e.dataTransfer.files)||void 0===t?void 0:t[0];if(r){if(!r.type.startsWith("audio/")&&!r.name.match(/\.(mp3|wav|m4a|aac|ogg)$/i)){C("Please drop an audio file (MP3, WAV)");return}Q(r)}},children:[_&&z&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("img",{src:z,alt:"",className:"absolute inset-0 w-full h-full object-cover"}),(0,a.jsx)("div",{className:"absolute inset-0 bg-black/45"})]}),et?(0,a.jsxs)("div",{className:"flex flex-col items-center gap-2 text-center",children:[(0,a.jsx)("svg",{className:"w-8 h-8 text-red-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),(0,a.jsxs)("p",{className:"text-sm font-semibold text-red-700",children:["You've used all ",r.monthlyLimit," free videos"]}),(0,a.jsxs)("p",{className:"text-xs text-red-600",children:[(0,a.jsx)(n(),{href:"/app/credits",className:"underline font-medium hover:text-red-900",children:"Buy a credit"})," ","or"," ",(0,a.jsx)(n(),{href:"/pricing",className:"underline font-medium hover:text-red-900",children:"upgrade"})," ","to keep creating."]})]}):k&&!_?(0,a.jsxs)("div",{className:"flex flex-col items-center gap-2 text-center",children:[(0,a.jsx)("svg",{className:"w-8 h-8 text-red-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),(0,a.jsx)("p",{className:"text-sm font-semibold text-red-600",children:k}),(0,a.jsxs)("label",{className:"mt-1 text-xs text-primary cursor-pointer hover:underline",children:["Try a different file",(0,a.jsx)("input",{ref:p,type:"file",accept:"audio/*",onChange:handleFileChange,className:"sr-only"})]})]}):v?(0,a.jsxs)("div",{className:"flex flex-col items-center gap-2 text-sm text-purple-700",children:[(0,a.jsxs)("svg",{className:"animate-spin h-8 w-8 text-purple-500",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),(0,a.jsx)("span",{children:0===b?"Loading converter...":b<20?"Preparing...":"Optimizing (".concat(b,"%)")})]}):w?(0,a.jsxs)("div",{className:"flex flex-col items-center gap-2 text-sm text-purple-700",children:[(0,a.jsxs)("svg",{className:"animate-spin h-8 w-8 text-purple-500",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),(0,a.jsx)("span",{children:"Uploading..."})]}):_?(0,a.jsxs)("div",{className:"relative z-10 flex flex-col items-center gap-1 text-center ".concat(z?"text-white":""),children:[(0,a.jsx)("svg",{className:"w-8 h-8 ".concat(z?"text-white":"text-green-500"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"})}),(0,a.jsx)("p",{className:"text-sm font-medium truncate max-w-[180px] ".concat(z?"text-white":"text-green-700"),children:M}),null!=S&&(0,a.jsxs)("p",{className:"text-xs ".concat(z?"text-white/80":"text-gray-500"),children:[Math.floor(S/60),":",String(Math.floor(S%60)).padStart(2,"0")]}),(0,a.jsxs)("button",{type:"button",onClick:()=>togglePreview(_),disabled:E===_,className:"mt-1.5 flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-medium transition-colors disabled:opacity-50 ".concat(z?"bg-white/20 text-white hover:bg-white/30":"bg-green-100 text-green-700 hover:bg-green-200"),children:[E===_?(0,a.jsxs)("svg",{className:"animate-spin h-3 w-3",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}
1):D===_?(0,a.jsx)("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M6 4h4v16H6zM14 4h4v16h-4z"})}):(0,a.jsx)("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M8 5v14l11-7z"})}),D===_?"Pause":"Play preview"]}),(0,a.jsxs)("label",{className:"mt-2 text-xs cursor-pointer hover:underline ".concat(z?"text-white":"text-primary"),children:["Change file",(0,a.jsx)("input",{ref:p,type:"file",accept:"audio/*",onChange:handleFileChange,className:"sr-only"})]})]}):(0,a.jsxs)("div",{className:"space-y-2 text-center",children:[(0,a.jsx)("svg",{className:"mx-auto h-10 w-10 ".concat(f?"text-primary":"text-gray-400"),stroke:"currentColor",fill:"none",viewBox:"0 0 48 48",children:(0,a.jsx)("path",{d:"M28 8H12a4 4 0 00-4 4v20m32-12v8m0 0v8a4 4 0 01-4 4H12a4 4 0 01-4-4v-4m32-4l-3.172-3.172a4 4 0 00-5.656 0L28 28M8 32l9.172-9.172a4 4 0 015.656 0L28 28m0 0l4 4m4-24h8m-4-4v8m-12 4h.02",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,a.jsxs)("div",{className:"flex justify-center text-sm text-gray-600",children:[(0,a.jsxs)("label",{className:"relative cursor-pointer rounded-md font-medium text-primary hover:text-primary-dark",children:[(0,a.jsx)("span",{children:"Upload a file"}),(0,a.jsx)("input",{ref:p,type:"file",accept:"audio/*",onChange:handleFileChange,className:"sr-only"})]}),(0,a.jsx)("p",{className:"pl-1",children:"or drag and drop"})]}),(0,a.jsx)("p",{className:"text-xs text-gray-500",children:"MP3, WAV up to 110MB"}),(0,a.jsxs)("p",{className:"text-xs text-gray-400",children:["Trimmed to ",G,"s if longer"]})]})]})]}),(0,a.jsx)("div",{className:"flex flex-col relative",children:(0,a.jsxs)("div",{className:et?"opacity-40 pointer-events-none select-none":"",children:[(0,a.jsxs)("span",{className:"block text-sm font-medium text-gray-700 mb-2",children:["Recent Audio",s.length>0&&(0,a.jsxs)("span",{className:"ml-1.5 text-xs font-normal text-gray-400",children:["(",s.length,")"]})]}),o&&0===s.length?(0,a.jsx)("div",{className:"flex items-center justify-center flex-1 border-2 border-dashed border-gray-200 rounded-lg py-8",children:(0,a.jsx)("div",{className:"w-5 h-5 border-2 border-gray-300 border-t-transparent rounded-full animate-spin"})}):0===s.length?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center flex-1 border-2 border-dashed border-gray-200 rounded-lg text-center px-4 py-8",children:[(0,a.jsx)("svg",{className:"w-8 h-8 text-gray-300 mb-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,a.jsx)("p",{className:"text-sm text-gray-400",children:"No recent files yet"}),(0,a.jsx)("p",{className:"text-xs text-gray-300 mt-1",children:"Your last 10 uploads will appear here"})]}):(0,a.jsx)("div",{className:"border border-gray-200 rounded-lg overflow-y-auto",style:{maxHeight:"260px"},children:s.map((e,t)=>{let r=D===e.id,i=E===e.id;return(0,a.jsxs)("div",{className:"w-full flex items-center gap-2 pr-4 transition-colors ".concat(t>0?"border-t border-gray-100":""," ").concat(_===e.id?"bg-purple-50 text-primary":"hover:bg-gray-50 text-gray-700"),children:[(0,a.jsx)("button",{type:"button",onClick:()=>togglePreview(e.id),disabled:i,"aria-label":r?"Pause ".concat(e.original_filename):"Play ".concat(e.original_filename),className:"m-2 flex-shrink-0 w-7 h-7 rounded-full flex items-center justify-center transition-colors ".concat(_===e.id?"bg-primary text-white hover:bg-primary-dark":"bg-gray-200 text-gray-600 hover:bg-gray-300"),children:i?(0,a.jsxs)("svg",{className:"animate-spin h-3.5 w-3.5",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):r?(0,a.jsx)("svg",{className:"w-3.5 h-3.5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M6 4h4v16H6zM14 4h4v16h-4z"})}):(0,a.jsx)("svg",{className:"w-3.5 h-3.5 ml-0.5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M8 5v14l11-7z"})})}),(0,a.jsxs)("button",{type:"button",onClick:()=>handleRecentFileClick(e),className:"flex-1 min-w-0 flex items-center gap-3 py-2 text-left",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("p",{className:"text-sm truncate flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"truncate",children:e.original_filename}),e.transcriptEdited&&(0,a.jsx)("span",{title:"Transcript has been edited â your correction will be used",className:"flex-shrink-0 w-4 h-4 rounded-full bg-amber-100 text-amber-600 flex items-center justify-center",children:(0,a.jsxs)("svg",{className:"w-2.5 h-2.5",fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24",children:[(0,a.jsx)("path",{d:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"}),(0,a.jsx)("path",{d:"M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"})]})})]}),(0,a.jsxs)("p",{className:"text-xs text-gray-400 mt-0.5 flex items-center gap-1.5",children:[null!=e.duration_seconds&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{children:[Math.floor(e.duration_seconds/60),":",String(Math.floor(e.duration_seconds%60)).padStart(2,"0")]}),(0,a.jsx)("span",{className:"text-gray-300",children:"\xb7"})]}),(0,a.jsxs)("span",{children:[(e.size_bytes/1048576).toFixed(1)," MB"]})]})]}),_===e.id&&(0,a.jsx)("svg",{className:"w-4 h-4 text-primary flex-shrink-0",fill:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"})})]})]},e.id)})})]})})]}),(0,a.jsx)("div",{className:"flex justify-end mt-4",children:(0,a.jsx)("button",{type:"button",disabled:!er,onClick:()=>{var t;(null===(t=(0,x.q3)())||void 0===t?void 0:t.backgroundLockedFromMedia)?((0,x.lP)(),e.push("/app/create/captions")):e.push("/app/create/aspect-ratio")},className:"px-8 py-2.5 bg-gradient-brand text-white font-semibold rounded-full hover:shadow-lg transition-all disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})})]}),I&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4",children:(0,a.jsxs)("div",{className:"bg-white rounded-xl shadow-xl max-w-md w-full p-5",children:[(0,a.jsx)("h2",{className:"text-base font-bold mb-2",children:"â ï¸ This may be a shortened copy"}),(0,a.jsxs)("p",{className:"text-sm text-gray-700 mb-2",children:["â",I.original_filename,"â is ",Math.round(I.duration_seconds||0),"s long â you might be using a free-tier sliced audio, trimmed when it was first uploaded",I.original_duration_seconds?" (your original was ".concat(formatClock(I.original_duration_seconds),")"):"","."]}),(0,a.jsx)("p",{className:"text-sm text-gray-700 mb-4",children:"To get the full song with your credit, re-upload your original file (with âUse my creditâ on). Do you want to continue with this version?"}),(0,a.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:()=>U(null),className:"px-4 py-2 text-sm font-medium rounded-full border border-gray-300 text-gray-700 hover:bg-gray-50",children:"Cancel"}),(0,a.jsx)("button",{type:"button",onClick:()=>{selectRecentFile(I),U(null)},className:"px-4 py-2 text-sm font-semibold rounded-full bg-gradient-brand text-white hover:shadow-lg",children:"Continue anyway"})]})]})})]})};CreateAudioPage.getLayout=e=>(0,a.jsx)(c.Z,{children:e}),t.default=CreateAudioPage}},function(e){e.O(0,[424,530,675,713,774,888,179],function(){return e(e.s=6183)}),_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.