PageSourceSearch

https://lexpi.ai/assets/LibraryPage-Cqa7AXTo.js

js lexpi.ai collected 2026-10-05 15:37:42 UTC 9,097 bytes, 6 lines download raw bytes

1import{t as X,u as Z,f as J,$ as Y,r,x as K,j as e,L as S,U as R,a0 as ee,p as v,D as M,d as te,X as se,a1 as D,a2 as ae,a3 as le,a4 as re}from"./index-CgM5GqGv.js";import{u as ne}from"./useMutation-B1MPB0xp.js";import{t as ie}from"./download-DKOUVyOG.js";import{M as T}from"./music-Dtz1f48-.js";/**
2 * @license lucide-react v0.460.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const oe=X("FileChartColumnIncreasing",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["path",{d:"M12 18v-4",key:"q1q25u"}],["path",{d:"M16 18v-6",key:"15y0np"}]]);function me(){const{t:s,i18n:c}=Z(),{getToken:n}=J(),L=Y(),[h,A]=r.useState(""),[b,q]=r.useState("recent"),I=c.language==="en"?"en-GB":"fr-FR",{data:d,isLoading:U}=K({queryKey:["library",h,b],queryFn:async()=>{const t=await n();if(!t)throw new Error(s("libraryPage.notAuthenticated"));return re(t,{search:h,sort:b})}}),[x,i]=r.useState(null),[u,p]=r.useState(null),[g,f]=r.useState(null),[N,$]=r.useState(""),[E,o]=r.useState(null),[F,k]=r.useState(null),z=ne({mutationFn:async t=>{const a=await n();if(!a)throw new Error(s("libraryPage.notAuthenticated"));return D(a,t.fileId,t.checked)},onMutate:({fileId:t})=>k(t),onSettled:()=>{k(null),L.invalidateQueries({queryKey:["library"]})}}),V=async(t,a)=>{const l=await n();if(!l)return null;const{urls:j}=await D(l,t,a);return j},w=async(t,a,l,j)=>{i(t),p(null);try{const y=await V(t,a),C=y==null?void 0:y[l];if(!C)return;const H=await n(),O=l==="master_mp3_320"?"mp3":"wav",B=l==="master_24bit"?"lexpiMASTER_24bit":l==="master_16bit"?"lexpiMASTER_16bit":"lexpiMASTER_320kbps",G=`${j.replace(/\.[^.]+$/,"")}_${B}.${O}`;await ie(C,G,H)}finally{i(null)}},_=(t,a,l)=>w(t,a,"master_24bit",l),P=async t=>{const a=await n();if(!a)return null;try{const{url:l}=await ae(a,t);return l}catch(l){if(l instanceof le&&l.status===404)return null;throw l}},Q=async(t,a)=>{i(t),p(null),o(null);try{const l=await P(t);l?(f(l),$(a)):(o(t),setTimeout(()=>o(null),4e3))}finally{i(null)}},W=async t=>{i(t),p(null),o(null);try{const a=await P(t);a?window.open(a,"_blank"):(o(t),setTimeout(()=>o(null),4e3))}finally{i(null)}};return e.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-12 sm:px-10",children:[e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:s("libraryPage.title")}),e.jsx("p",{className:"mt-1 text-lexpi-text-muted",children:s("libraryPage.subtitle")})]}),e.jsxs(S,{to:"/upload",className:"btn-secondary self-start whitespace-nowrap text-sm sm:self-auto",children:[e.jsx(R,{className:"h-4 w-4"}),s("libraryPage.masterCta")]})]}),e.jsxs("div",{className:"mt-8 flex flex-col gap-3 sm:flex-row sm:gap-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(ee,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-lexpi-text-dim"}),e.jsx("input",{type:"text",value:h,onChange:t=>A(t.target.value),placeholder:s("libraryPage.searchPlaceholder"),className:"w-full rounded-xl border border-white/[0.08] bg-white/[0.04] py-2.5 pl-10 pr-4 text-sm text-lexpi-text backdrop-blur-md transition-all duration-200 placeholder:text-lexpi-text-dim focus:border-lexpi-accent/60 focus:outline-none focus:ring-2 focus:ring-lexpi-accent/20"})]}),e.jsxs("select",{value:b,onChange:t=>q(t.target.value),className:"rounded-xl border border-white/[0.08] bg-lexpi-surface px-4 py-2.5 text-sm text-lexpi-text transition-all duration-200 focus:border-lexpi-accent/60 focus:outline-none",children:[e.jsx("option",{value:"recent",className:"bg-lexpi-surface text-lexpi-text",children:s("libraryPage.sortRecent")}),e.jsx("option",{value:"name",className:"bg-lexpi-surface text-lexpi-text",children:s("libraryPage.sortName")}),e.jsx("option",{value:"duration",className:"bg-lexpi-surface text-lexpi-text",children:s("libraryPage.sortDuration")})]})]}),U?e.jsx("div",{className:"mt-16 flex justify-center",children:e.jsx(v,{className:"h-8 w-8 animate-spin text-lexpi-accent"})}):d!=null&&d.items.length?e.jsx("div",{className:"mt-6 space-y-2",children:d.items.map(t=>e.jsxs("div",{className:u===t.id?"relative z-30":"relative",children:[e.jsxs("div",{className:`card card-interactive flex flex-col gap-3 py-4 sm:flex-row sm:items-center sm:justify-between ${u===t.id?"!overflow-visible":""}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-4",children:[e.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-lexpi-accent/10",children:e.jsx(T,{className:"h-5 w-5 text-lexpi-accent"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate font-medium",children:t.name}),e.jsxs("div",{className:"text-xs text-lexpi-text-muted",children:[ce(t.duration_seconds)," ·"," ",t.output_lufs.toFixed(1)," LU
6FS ·"," ",new Date(t.purchased_at).toLocaleDateString(I)]}),e.jsxs("label",{className:"mt-1 flex cursor-pointer items-center gap-1.5 text-xs text-lexpi-text-dim hover:text-lexpi-text-muted",children:[e.jsx("input",{type:"checkbox",checked:t.preserve_silence_on_export,onChange:a=>z.mutate({fileId:t.id,checked:a.target.checked}),disabled:F===t.id,className:"h-3 w-3 cursor-pointer accent-lexpi-accent"}),s("libraryPage.preserveSilence")]})]})]}),e.jsxs("div",{className:"relative flex shrink-0 items-center justify-end gap-2",children:[e.jsxs("button",{onClick:()=>Q(t.id,t.name),disabled:x===t.id,className:"btn-secondary text-xs",title:s("libraryPage.viewReport"),children:[x===t.id?e.jsx(v,{className:"h-4 w-4 animate-spin"}):e.jsx(oe,{className:"h-4 w-4"}),s("libraryPage.report")]}),e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"flex",children:[e.jsxs("button",{onClick:()=>_(t.id,t.preserve_silence_on_export,t.name),disabled:x===t.id,className:"btn-secondary rounded-r-none border-r-0 text-xs",children:[x===t.id?e.jsx(v,{className:"h-4 w-4 animate-spin"}):e.jsx(M,{className:"h-4 w-4"}),"WAV 24-bit"]}),e.jsx("button",{onClick:()=>p(u===t.id?null:t.id),disabled:x===t.id,className:"btn-secondary rounded-l-none border-l-white/[0.04] px-2 text-xs",children:e.jsx(te,{className:"h-3.5 w-3.5"})})]}),u===t.id&&e.jsxs("div",{className:"absolute right-0 top-full z-50 mt-1 min-w-[180px] rounded-xl border border-white/[0.08] bg-lexpi-surface p-1 shadow-glass",children:[e.jsx(m,{onClick:()=>_(t.id,t.preserve_silence_on_export,t.name),label:"WAV 24-bit"}),e.jsx(m,{onClick:()=>w(t.id,t.preserve_silence_on_export,"master_16bit",t.name),label:"WAV 16-bit"}),e.jsx(m,{onClick:()=>w(t.id,t.preserve_silence_on_export,"master_mp3_320",t.name),label:"MP3 320 kbps"}),e.jsx("div",{className:"my-1 border-t border-white/[0.06]"}),e.jsx(m,{onClick:()=>W(t.id),label:s("libraryPage.probeReportPng")})]})]})]})]}),E===t.id&&e.jsx("div",{className:"mt-1 rounded-lg border border-lexpi-warning/20 bg-lexpi-warning/5 px-4 py-2 text-xs text-lexpi-warning",children:s("libraryPage.noReport")})]},t.id))}):e.jsxs("div",{className:"mt-16 text-center",children:[e.jsx(T,{className:"mx-auto h-12 w-12 text-lexpi-text-dim"}),e.jsx("p",{className:"mt-4 text-lexpi-text-muted",children:s("libraryPage.emptyTitle")}),e.jsx("p",{className:"mt-1 text-sm text-lexpi-text-dim",children:s("libraryPage.emptyHint")}),e.jsxs(S,{to:"/upload",className:"btn-primary mt-6 inline-flex",children:[e.jsx(R,{className:"h-4 w-4"}),s("libraryPage.masterCta")]})]}),g&&e.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/70 backdrop-blur-sm",onClick:()=>f(null),children:e.jsxs("div",{className:"relative mx-4 flex max-h-[90vh] w-full max-w-3xl flex-col overflow-hidden rounded-2xl border border-white/[0.08] bg-lexpi-surface shadow-glass-lg",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-white/[0.06] px-6 py-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-semibold",children:s("libraryPage.probeReport")}),e.jsx("p",{className:"text-xs text-lexpi-text-muted",children:N})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("a",{href:g,target:"_blank",rel:"noopener noreferrer",className:"btn-secondary text-xs",children:[e.jsx(M,{className:"h-3.5 w-3.5"}),s("libraryPage.download")]}),e.jsx("button",{onClick:()=>f(null),className:"rounded-lg p-1.5 text-lexpi-text-muted transition-colors hover:bg-white/[0.06] hover:text-lexpi-text",children:e.jsx(se,{className:"h-4 w-4"})})]})]}),e.jsx("div",{className:"overflow-auto p-4",children:e.jsx("img",{src:g,alt:`Probe report - ${N}`,className:"w-full rounded-lg"})})]})})]})}function m({onClick:s,label:c}){return e.jsx("button",{onClick:s,className:"w-full rounded-lg px-3 py-2 text-left text-xs text-lexpi-text transition-colors hover:bg-white/[0.06]",children:c})}function ce(s){const c=Math.floor(s/60),n=Math.floor(s%60);return`${c}:${n.toString().padStart(2,"0")}`}export{me as LibraryPage};

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.