1import{l as Ze,n as Ge,j as e,g as K,f as V,r as i,h as R,B as N,A as ee,m as C,X as Se,b as et,o as tt,c as W,p as at,a as st,L as ve}from"./index-DaVPQP0x.js";import{I as b}from"./input-WdUx6-3x.js";import{T as it}from"./textarea-CnxJG0Yo.js";import{P as rt}from"./pencil-Dgbt9TrT.js";import{a as Fe}from"./amazon_1771007599582-tj__hM0S.js";import{R as nt,I as lt}from"./RichTextEditor-C7XykgSi.js";import{T as Ee}from"./trash-2-DYrQxw0J.js";import{A as ot}from"./arrow-left-CTaEgLQE.js";import{C as ct,a as dt}from"./chevron-right-ZofOPzLA.js";import{E as Ce}from"./external-link-_yU4Sg7_.js";import{C as Ie}from"./chevron-down-STVT5rDc.js";import{M as je}from"./message-circle-EAFjEPtn.js";import{L as mt}from"./loader-circle-DxAvfFXT.js";import{D as ht}from"./disc-CjGuOShN.js";import{M as ut}from"./music-BHzHevvg.js";import"./index-C7yKKq-w.js";const xt=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],pt=Ze("send",xt),bt={january:0,february:1,march:2,april:3,may:4,june:5,july:6,august:7,september:8,october:9,november:10,december:11};function Ne(a,r,s){const o=new Date(Date.UTC(a,r,s,12));return o.getUTCFullYear()!==a||o.getUTCMonth()!==r||o.getUTCDate()!==s?null:o}function gt(a,r){const s=a?.trim();if(s){const o=s.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/);if(o)return Ne(Number(o[1]),Number(o[2])-1,Number(o[3]));const h=s.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);if(h)return Ne(Number(h[3]),Number(h[1])-1,Number(h[2]));const d=s.match(/^([A-Za-z]+)\s+(\d{1,2}),\s*(\d{4})$/);if(d){const n=bt[d[1].toLowerCase()];if(n!==void 0)return Ne(Number(d[3]),n,Number(d[2]))}const x=new Date(s);if(!Number.isNaN(x.getTime()))return x}if(r){const o=new Date(r);if(!Number.isNaN(o.getTime()))return o}return null}function ft(a,r){const s=gt(a,r);return s?new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric",timeZone:"UTC"}).format(s):""}function F({onClick:a,label:r}){const{enabled:s}=Ge();return s?e.jsx("button",{onClick:o=>{o.preventDefault(),o.stopPropagation(),a()},title:r||"Edit",className:"inline-flex items-center justify-center w-7 h-7 rounded-full bg-primary/20 border border-primary/40 text-primary hover:bg-primary/40 hover:text-white transition-all cursor-pointer hover:scale-110 hover:shadow-[0_0_12px_rgba(255,0,255,0.4)]","data-testid":`button-contextual-edit-${r?.toLowerCase().replace(/\s+/g,"-")||"generic"}`,children:e.jsx(rt,{className:"w-3.5 h-3.5"})}):null}function te({open:a,onClose:r,title:s,children:o,testId:h}){return e.jsx(ee,{children:a&&e.jsx(C.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm",onClick:r,"data-testid":h,children:e.jsxs(C.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},className:"bg-card border border-white/20 rounded-2xl max-w-2xl w-full max-h-[85vh] overflow-hidden shadow-2xl",onClick:d=>d.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-white/10",children:[e.jsx("h2",{className:"text-lg font-display text-white",children:s}),e.jsx(N,{onClick:r,variant:"ghost",size:"sm",className:"text-white/60 hover:text-white cursor-pointer","data-testid":`button-close-${h}`,children:e.jsx(Se,{className:"w-5 h-5"})})]}),e.jsx("div",{className:"p-6 overflow-y-auto max-h-[calc(85vh-80px)]",children:o})]})})})}function yt({open:a,onClose:r,artist:s,artistId:o}){const h=K(),{toast:d}=V(),[x,n]=i.useState(s.alphaName||""),[u,f]=i.useState(s.realName||""),[y,g]=i.useState(s.origin||""),[v,c]=i.useState(s.wikipediaLink||""),[j,I]=i.useState(s.website||""),[L,T]=i.useState(s.imageUrl||"");i.useEffect(()=>{a&&(n(s.alphaName||""),f(s.realName||""),g(s.origin||""),c(s.wikipediaLink||""),I(s.website||""),T(s.imageUrl||""))},[a,s]);const E=R({mutationFn:async k=>{const S=await fetch(`/api/artists/${o}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)});if(!S.ok)throw new Error("Failed to update artist");return S.json()},onSuccess:()=>{h.invalidateQueries({queryKey:["/api/artists",o]}),h.invalidateQueries({queryKey:["/api/artists"]}),d({title:"Artist header updated successfully"}),r()},onError:()=>{d({title:"Failed to update artist header",variant:"destructive"})}}),z=()=>{E.mutate({alphaName:x,realName:u,origin:y,wikipediaLink:v,website:j,imageUrl:L||null})};return e.jsx(te,{open:a,onClose:r,title:"Edit Artist Header",testId:"modal-edit-artist-header",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Alpha Name"}),e.jsx(b,{value:x,onChange:k=>n(k.target.value),className:"bg-black/30 border-white/20 text-white","data-testid":"input-edit-alpha-name"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Main Image URL"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(b,{value:L,onChange:k=>T(k.target.value),placeholder:"https://...",className:"bg-black/30 border-white/20 text-white flex-1","data-testid":"input-edit-image-url"}),L&&e.jsx(N,{type:"button",variant:"outline",onClick:()=>T(""),className:"border-white/20 text-white/60 hover:bg-red-500/20 hover:text-red-300 hover:border-red-500/40 cursor-pointer shrink-0","data-testid":"button-clear-image-url",children:"Clear"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Real Name"}),e.jsx(b,{value:u,onChange:k=>f(k.target.value),className:"bg-black/30 border-white/20 text-white","data-testid":"input-edit-real-name"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Origin"}),e.jsx(b,{value:y,onChange:k=>g(k.target.value),className:"bg-black/30 border-white/20 text-white","data-testid":"input-edit-origin"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Wikipedia Link"}),e.jsx(b,{value:v,onChange:k=>c(k.target.value),className:"bg-black/30 border-white/20 text-white","data-testid":"input-edit-wikipedia-link"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Website"}),e.jsx(b,{value:j,onChange:k=>I(k.target.value),className:"bg-black/30 border-white/20 text-white","data-testid":"input-edit-website"})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[e.jsx(N,{variant:"outline",onClick:r,className:"border-white/20 text-white hover:bg-white/10 cursor-pointer","data-testid":"button-cancel-edit-header",children:"Cancel"}),e.jsx(N,{onClick:z,disabled:E.isPending,className:"bg-primary hover:bg-primary/80 text-white cursor-pointer","data-testid":"button-save-edit-header",children:E.isPending?"Saving...":"Save"})]})]})})}function wt({open:a,onClose:r,artist:s,artistId:o}){const h=K(),{toast:d}=V(),[x,n]=i.useState(s.description||"");i.useEffect(()=>{a&&n(s.description||"")},[a,s]);const u=R({mutationFn:async y=>{const g=await fetch(`/api/artists/${o}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(y)});if(!g.ok)throw new Error("Failed to update description");return g.json()},onSuccess:()=>{h.invalidateQueries({queryKey:["/api/artists",o]}),d({title:"Description updated successfully"}),r()},onError:()=>{d({title:"Failed to update description",variant:"destructive"})}}),f=()=>{u.mutate({description:x})};return e.jsx(te,{open:a,onClose:r,title:"Edit Description",testId:"modal-edit-description",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(nt,{content:x,onChange:n}),e.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[e.jsx(N,{variant:"outline",onClick:r,className:"border-white/20 text-white hover:bg-white/10 cursor-pointer","data-testid":"button-cancel-edit-description",children:"Cancel"}),e.jsx(N,{onClick:f,disabled:u.isPending,className:"bg-primary hover:bg-primary/80 text-white cursor-pointer","data-testid":"button-save-edit-description",children:u.isPending?"Saving...":"Save"})]})]})})}function vt({open:a,onClose:r,artist:s,artistId:o}){const h=K(),{toast:d}=V(),[x,n]=i.useState(s.photoCredit||""),[u,f]=i.useState(s.photoCreditUrl||"");i.useEffect(()=>{a&&(n(s.photoCredit||""),f(s.photoCreditUrl||""))},[a,s]);const y=R({mutationFn:async v=>{const c=await fetch(`/api/artists/${o}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(v)});if(!c.ok)throw new Error("Failed to update photo credit");return c.json()},onSuccess:()=>{h.invalidateQueries({queryKey:["/api/artists",o]}),d({title:"Photo credit updated successfully"}),r()},onError:()=>{d({title:"Failed to update photo credit",variant:"destructive"})}}),g=()=>{y.mutate({photoCredit:x,photoCreditUrl:u})};return e.jsx(te,{open:a,onClose:r,title:"Edit Photo Credit",testId:"modal-edit-photo-credit",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Photo Credit"}),e.jsx(b,{value:x,onChange:v=>n(v.target.value),className:"bg-black/30 border-white/20 text-white",placeholder:"Photographer name","data-testid":"input-edit-photo-credit"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Photo Credit URL"}),e.jsx(b,{value:u,onChange:v=>f(v.target.value),className:"bg-black/30 border-white/20 text-white",placeholder:"https://...","data-testid":"input-edit-photo-credit-url"})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[e.jsx(N,{variant:"outline",onClick:r,className:"border-white/20 text-white hover:bg-white/10 cursor-pointer","data-testid":"button-cancel-edit-photo-credit",children:"Cancel"}),e.jsx(N,{onClick:g,disabled:y.isPending,className:"bg-primary hover:bg-primary/80 text-white cursor-pointer","data-testid":"button-save-edit-photo-credit",children:y.isPending?"Saving...":"Save"})]})]})})}function jt({open:a,onClose:r,youtubeLinks:s,artistId:o}){const h=K(),{toast:d}=V(),[x,n]=i.useState(""),[u,f]=i.useState("");i.useEffect(()=>{a&&(n(""),f(""))},[a]);const y=R({mutationFn:async c=>{const j=await fetch(`/api/artists/${o}/youtube-links`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(!j.ok)throw new Error("Failed to add YouTube link");return j.json()},onSuccess:()=>{h.invalidateQueries({queryKey:["/api/artists",o,"youtube-links"]}),d({title:"YouTube link added successfully"}),n(""),f("")},onError:()=>{d({title:"Failed to add YouTube link",variant:"destructive"})}}),g=R({mutationFn:async c=>{if(!(await fetch(`/api/youtube-links/${c}`,{method:"DELETE"})).ok)throw new Error("Failed to delete YouTube link")},onSuccess:()=>{h.invalidateQueries({queryKey:["/api/artists",o,"youtube-links"]}),d({title:"YouTube link deleted"})},onError:()=>{d({title:"Failed to delete YouTube link",variant:"destructive"})}}),v=()=>{x.trim()&&y.mutate({url:x,title:u})};return e.jsx(te,{open:a,onClose:r,title:"Edit YouTube Links",testId:"modal-edit-youtube-links",children:e.jsxs("div",{className:"space-y-4",children:[s&&s.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-white/80 text-sm",children:"Existing Links"}),s.map(c=>e.jsxs("div",{className:"flex items-center gap-2 bg-black/20 border border-white/10 rounded-lg p-3","data-testid":`youtube-link-item-${c.id}`,children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-white text-sm truncate",children:c.title||c.url}),e.jsx("p",{className:"text-white/40 text-xs truncate",children:c.url})]}),e.jsx(N,{variant:"ghost",size:"sm",onClick:()=>g.mutate(c.id),disabled:g.isPending,className:"text-red-400 hover:text-red-300 hover:bg-red-500/10 cursor-pointer flex-shrink-0","data-testid":`button-delete-youtube-link-${c.id}`,children:e.jsx(Ee,{className:"w-4 h-4"})})]},c.id))]}),e.jsxs("div",{className:"border-t border-white/10 pt-4",children:[e.jsx("label",{className:"block text-white/80 text-sm mb-2",children:"Add New Link"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{value:x,onChange:c=>n(c.target.value),className:"bg-black/30 border-white/20 text-white",placeholder:"YouTube URL","data-testid":"input-new-youtube-url"}),e.jsx(b,{value:u,onChange:c=>f(c.target.value),className:"bg-black/30 border-white/20 text-white",placeholder:"Video title (optional)","data-testid":"input-new-youtube-title"}),e.jsx(N,{onClick:v,disabled:!x.trim()||y.isPending,className:"bg-primary hover:bg-primary/80 text-white cursor-pointer","data-testid":"button-add-youtube-link",children:y.isPending?"Adding...":"Add Link"})]})]}),e.jsx("div",{className:"flex justify-end pt-4",children:e.jsx(N,{variant:"outline",onClick:r,className:"border-white/20 text-white hover:bg-white/10 cursor-pointer","data-testid":"button-close-youtube-links",children:"Done"})})]})})}function Nt({open:a,onClose:r,single:s,artistId:o}){const h=K(),{toast:d}=V(),[x,n]=i.useState(""),[u,f]=i.useState(""),[y,g]=i.useState(""),[v,c]=i.useState(""),[j,I]=i.useState(""),[L,T]=i.useState(""),[E,z]=i.useState(""),[k,S]=i.useState(""),[A,M]=i.useState("");i.useEffect(()=>{a&&(n(s?.title||""),f(s?.imageUrl||""),g(s?.singleLabel||""),c(s?.location||""),I(s?.yearRecorded||""),T(s?.monthRecorded||""),z(s?.amazon||""),S(s?.itunes||""),M(s?.comments||""))},[a,s]);const $=R({mutationFn:async w=>{const B=s?`/api/singles/${s.id}`:`/api/artists/${o}/singles`,Y=await fetch(B,{method:s?"PATCH":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(w)});if(!Y.ok)throw new Error("Failed to save single");return Y.json()},onSuccess:()=>{h.invalidateQueries({queryKey:["/api/artists",o,"singles"]}),d({title:s?"Single updated successfully":"Single added successfully"}),r()},onError:()=>{d({title:"Failed to save single",variant:"destructive"})}}),O=R({mutationFn:async()=>
1{if(!(await fetch(`/api/singles/${s.id}`,{method:"DELETE"})).ok)throw new Error("Failed to delete single")},onSuccess:()=>{h.invalidateQueries({queryKey:["/api/artists",o,"singles"]}),d({title:"Single deleted"}),r()},onError:()=>{d({title:"Failed to delete single",variant:"destructive"})}}),J=()=>{x.trim()&&$.mutate({title:x,imageUrl:u,singleLabel:y,location:v,yearRecorded:j,monthRecorded:L,amazon:E,itunes:k,comments:A})},l=()=>{window.confirm("Are you sure you want to delete this single?")&&O.mutate()};return e.jsx(te,{open:a,onClose:r,title:s?"Edit Single":"Add New Single",testId:"modal-edit-single",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Title *"}),e.jsx(b,{value:x,onChange:w=>n(w.target.value),className:"bg-black/30 border-white/20 text-white","data-testid":"input-edit-single-title"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Image URL"}),e.jsx(b,{value:u,onChange:w=>f(w.target.value),className:"bg-black/30 border-white/20 text-white","data-testid":"input-edit-single-image-url"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Label"}),e.jsx(b,{value:y,onChange:w=>g(w.target.value),className:"bg-black/30 border-white/20 text-white","data-testid":"input-edit-single-label"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Location"}),e.jsx(b,{value:v,onChange:w=>c(w.target.value),className:"bg-black/30 border-white/20 text-white","data-testid":"input-edit-single-location"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Year Recorded"}),e.jsx(b,{value:j,onChange:w=>I(w.target.value),className:"bg-black/30 border-white/20 text-white","data-testid":"input-edit-single-year"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Month Recorded"}),e.jsx(b,{value:L,onChange:w=>T(w.target.value),className:"bg-black/30 border-white/20 text-white","data-testid":"input-edit-single-month"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Amazon"}),e.jsx(b,{value:E,onChange:w=>z(w.target.value),className:"bg-black/30 border-white/20 text-white","data-testid":"input-edit-single-amazon"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"iTunes"}),e.jsx(b,{value:k,onChange:w=>S(w.target.value),className:"bg-black/30 border-white/20 text-white","data-testid":"input-edit-single-itunes"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Comments"}),e.jsx(b,{value:A,onChange:w=>M(w.target.value),className:"bg-black/30 border-white/20 text-white","data-testid":"input-edit-single-comments"})]}),e.jsxs("div",{className:"flex justify-between pt-4",children:[e.jsx("div",{children:s&&e.jsxs(N,{variant:"ghost",onClick:l,disabled:O.isPending,className:"text-red-400 hover:text-red-300 hover:bg-red-500/10 cursor-pointer","data-testid":"button-delete-single",children:[e.jsx(Ee,{className:"w-4 h-4 mr-2"}),"Delete"]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(N,{variant:"outline",onClick:r,className:"border-white/20 text-white hover:bg-white/10 cursor-pointer","data-testid":"button-cancel-edit-single",children:"Cancel"}),e.jsx(N,{onClick:J,disabled:!x.trim()||$.isPending,className:"bg-primary hover:bg-primary/80 text-white cursor-pointer","data-testid":"button-save-edit-single",children:$.isPending?"Saving...":"Save"})]})]})]})})}function kt({open:a,onClose:r,album:s,artistId:o}){const h=K(),{toast:d}=V(),[x,n]=i.useState(""),[u,f]=i.useState(""),[y,g]=i.useState(""),[v,c]=i.useState(""),[j,I]=i.useState(""),[L,T]=i.useState(""),[E,z]=i.useState(""),[k,S]=i.useState(""),[A,M]=i.useState(""),[$,O]=i.useState(""),[J,l]=i.useState(!1),[w,B]=i.useState(!1);i.useEffect(()=>{a&&(n(s?.albumName||""),f(s?.imageUrl||""),g(s?.albumLabel||""),c(s?.location||""),I(s?.yearRecorded||""),T(s?.monthRecorded||""),z(s?.amazon||""),S(s?.sundazed||""),M(s?.itunes||""),O(s?.comments||""),l(s?.artistCompilation||!1),B(s?.generalCompilation||!1))},[a,s]);const Q=R({mutationFn:async p=>{const X=s?`/api/albums/${s.id}`:`/api/artists/${o}/albums`,ne=await fetch(X,{method:s?"PATCH":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)});if(!ne.ok)throw new Error("Failed to save album");return ne.json()},onSuccess:()=>{h.invalidateQueries({queryKey:["/api/artists",o,"albums"]}),d({title:s?"Album updated successfully":"Album added successfully"}),r()},onError:()=>{d({title:"Failed to save album",variant:"destructive"})}}),Y=R({mutationFn:async()=>
1{if(!(await fetch(`/api/albums/${s.id}`,{method:"DELETE"})).ok)throw new Error("Failed to delete album")},onSuccess:()=>{h.invalidateQueries({queryKey:["/api/artists",o,"albums"]}),d({title:"Album deleted"}),r()},onError:()=>{d({title:"Failed to delete album",variant:"destructive"})}}),ae=()=>{x.trim()&&Q.mutate({albumName:x,imageUrl:u,albumLabel:y,location:v,yearRecorded:j,monthRecorded:L,amazon:E,sundazed:k,itunes:A,comments:$,artistCompilation:J,generalCompilation:w})},_=()=>{window.confirm("Are you sure you want to delete this album?")&&Y.mutate()};return e.jsx(te,{open:a,onClose:r,title:s?"Edit Album":"Add New Album",testId:"modal-edit-album",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Album Name *"}),e.jsx(b,{value:x,onChange:p=>n(p.target.value),className:"bg-black/30 border-white/20 text-white","data-testid":"input-edit-album-name"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Image URL"}),e.jsx(b,{value:u,onChange:p=>f(p.target.value),className:"bg-black/30 border-white/20 text-white","data-testid":"input-edit-album-image-url"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Label"}),e.jsx(b,{value:y,onChange:p=>g(p.target.value),className:"bg-black/30 border-white/20 text-white","data-testid":"input-edit-album-label"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Location"}),e.jsx(b,{value:v,onChange:p=>c(p.target.value),className:"bg-black/30 border-white/20 text-white","data-testid":"input-edit-album-location"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Year Recorded"}),e.jsx(b,{value:j,onChange:p=>I(p.target.value),className:"bg-black/30 border-white/20 text-white","data-testid":"input-edit-album-year"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Month Recorded"}),e.jsx(b,{value:L,onChange:p=>T(p.target.value),className:"bg-black/30 border-white/20 text-white","data-testid":"input-edit-album-month"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Amazon"}),e.jsx(b,{value:E,onChange:p=>z(p.target.value),className:"bg-black/30 border-white/20 text-white","data-testid":"input-edit-album-amazon"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Sundazed"}),e.jsx(b,{value:k,onChange:p=>S(p.target.value),className:"bg-black/30 border-white/20 text-white","data-testid":"input-edit-album-sundazed"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"iTunes"}),e.jsx(b,{value:A,onChange:p=>M(p.target.value),className:"bg-black/30 border-white/20 text-white","data-testid":"input-edit-album-itunes"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Comments"}),e.jsx(b,{value:$,onChange:p=>O(p.target.value),className:"bg-black/30 border-white/20 text-white","data-testid":"input-edit-album-comments"})]}),e.jsxs("div",{className:"flex gap-6",children:[e.jsxs("label",{className:"flex items-center gap-2 text-white/80 text-sm cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:J,onChange:p=>l(p.target.checked),className:"rounded border-white/20","data-testid":"checkbox-edit-album-artist-compilation"}),"Artist Compilation"]}),e.jsxs("label",{className:"flex items-center gap-2 text-white/80 text-sm cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:w,onChange:p=>B(p.target.checked),className:"rounded border-white/20","data-testid":"checkbox-edit-album-general-compilation"}),"General Compilation"]})]}),e.jsxs("div",{className:"flex justify-between pt-4",children:[e.jsx("div",{children:s&&e.jsxs(N,{variant:"ghost",onClick:_,disabled:Y.isPending,className:"text-red-400 hover:text-red-300 hover:bg-red-500/10 cursor-pointer","data-testid":"button-delete-album",children:[e.jsx(Ee,{className:"w-4 h-4 mr-2"}),"Delete"]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(N,{variant:"outline",onClick:r,className:"border-white/20 text-white hover:bg-white/10 cursor-pointer","data-testid":"button-cancel-edit-album",children:"Cancel"}),e.jsx(N,{onClick:ae,disabled:!x.trim()||Q.isPending,className:"bg-primary hover:bg-primary/80 text-white cursor-pointer","data-testid":"button-save-edit-album",children:Q.isPending?"Saving...":"Save"})]})]})]})})}const Ct=["January","February","March","April","May","June","July","August","September","October","November","December"];function St(a){let r=a.originalSingleLabel||"";if(r&&a.yearRecorded&&a.monthRecorded){const s=parseInt(a.monthRecorded,10)-1,o=Ct[s];o&&(r+=` - ${o}, ${a.yearRecorded}`)}else r&&a.yearRecorded&&(r+=` - ${a.yearRecorded}`);return r}const Et={1:"January","01":"January",2:"February","02":"February",3:"March","03":"March",4:"April","04":"April",5:"May","05":"May",6:"June","06":"June",7:"July","07":"July",8:"August","08":"August",9:"September","09":"September",10:"October",11:"November",12:"December"};
1function Re(a,r,s){if(!r)return null;const o=s&&s.toLowerCase().includes("originally unreleased")?"Recorded":"Released",h=a?Et[a]:null;return h?`${o}: ${h}, ${r}`:`${o}: ${r}`}function At({single:a,onEdit:r,onImageClick:s}){const o=Re(a.monthRecorded,a.yearRecorded,a.singleLabel),[h,d]=i.useState(!1);return e.jsx(C.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"bg-black border border-white/10 rounded-xl p-4 md:p-6",children:e.jsxs("div",{className:"flex gap-4",children:[e.jsx("img",{src:!h&&a.imageUrl&&!a.imageUrl.endsWith("/")?a.imageUrl:"/images/single-placeholder.png",alt:a.title,onError:()=>d(!0),className:`w-20 h-20 md:w-24 md:h-24 rounded-none object-cover flex-shrink-0 transition-opacity ${!h&&a.imageUrl&&!a.imageUrl.endsWith("/")?"cursor-pointer hover:opacity-80":""}`,onClick:()=>{!h&&a.imageUrl&&!a.imageUrl.endsWith("/")&&s?.(a.imageUrl,a.title)}}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("h3",{className:"text-lg font-display font-light leading-tight text-yellow-400 mb-1",children:a.title}),r&&e.jsx(F,{onClick:r,label:`single-${a.id}`})]}),a.singleLabel&&e.jsxs("p",{className:"text-lime-400 text-sm mb-1",children:[e.jsx("span",{className:"text-lime-400",children:"Label:"})," ",a.singleLabel]}),o&&e.jsx("p",{className:"text-primary font-mono text-sm mb-2",children:o}),e.jsxs("div",{className:"flex flex-wrap gap-3",children:[a.amazon&&e.jsx("a",{href:`https://www.amazon.com/gp/product/${a.amazon}/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=${a.amazon}&linkCode=as2&tag=technicoweb07-20&linkId=c1328bd1da487afe1da3cf1ae1117894`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center",children:e.jsx("img",{src:Fe,alt:"Buy at Amazon",className:"h-7"})}),a.itunes&&e.jsxs("a",{href:a.itunes,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-accent hover:underline text-sm",children:[e.jsx(Ce,{className:"w-3.5 h-3.5"}),"iTunes"]})]})]})]})})}function ke({title:a,albums:r,artistId:s,delay:o,className:h,id:d,onEditAlbum:x,onImageClick:n,titleColor:u="text-lime-400"}){return e.jsxs(C.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:o},className:h,id:d,children:[e.jsx("div",{className:"flex items-baseline justify-between mb-6",children:e.jsx("h2",{className:`text-2xl font-display ${u}`,children:a})}),e.jsx("div",{className:"space-y-4",children:r.map(f=>e.jsx(Tt,{album:f,artistId:s,onEdit:x?()=>x(f):void 0,onImageClick:n},f.id))})]})}function Tt({album:a,artistId:r,onEdit:s,onImageClick:o}){const[h,d]=i.useState(!1),[x,n]=i.useState(!1),u=r==="55"&&a.albumName==="The Beatles",f=c=>!c||!c.trim()?!0:c.replace(/<[^>]*>/g,"").replace(/ /g," ").trim().length===0,y=f(a.moreInfoNew)?f(a.moreInfo)?null:a.moreInfo:a.moreInfoNew;f(a.moreInfoNew)&&f(a.moreInfo);const{data:g}=W({queryKey:["/api/albums",a.id,"tracks"],queryFn:async()=>{const c=await fetch(`/api/albums/${a.id}/tracks`);return c.ok?c.json():[]}}),v=Re(a.monthRecorded,a.yearRecorded);return e.jsxs(e.Fragment,{children:[e.jsx(C.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"bg-card/80 border border-white/10 rounded-xl",children:e.jsxs("div",{className:"flex flex-col lg:flex-row",children:[e.jsxs("div",{className:"lg:w-3/5 p-3 md:p-4 flex gap-4 items-start bg-black",children:[a.imageUrl&&!x?e.jsx("img",{src:a.imageUrl,alt:a.albumName,onError:()=>n(!0),className:"w-[134px] h-[134px] md:w-[178px] md:h-[178px] rounded-none object-cover flex-shrink-0 cursor-pointer hover:opacity-80 transition-opacity",onClick:()=>o?.(a.imageUrl,a.albumName)}):e.jsx("div",{className:"w-[134px] h-[134px] md:w-[178px] md:h-[178px] rounded-none bg-white/10 flex items-center justify-center flex-shrink-0",children:e.jsx(ht,{className:"w-10 h-10 text-white/30"})}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col justify-start gap-0.5",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("h3",{className:`text-lg md:text-xl font-display font-light leading-tight ${u?"text-white":"text-red-500"}`,children:a.albumName}),s&&e.jsx(F,{onClick:s,label:`album-${a.id}`})]}),a.albumLabel&&!a.generalCompilation&&e.jsxs("p",{className:`${u?"text-white/80":"text-lime-400"} text-sm leading-snug`,children:[e.jsx("span",{className:u?"text-white/60":"text-lime-400",children:"Original LP/EP Label:"})," ",a.albumLabel]}),v&&e.jsx("p",{className:`${u?"text-white/80 font-mono":"text-primary font-mono"} text-sm leading-snug`,children:v}),a.amazon&&e.jsx("a",{href:`https://www.amazon.com/gp/product/${a.amazon}/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=${a.amazon}&linkCode=as2&tag=technicoweb07-20&linkId=c1328bd1da487afe1da3cf1ae1117894`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center mt-0.5",children:e.jsx("img",{src:Fe,alt:"Buy at Amazon",className:"h-7"})})]})]}),(g&&g.length>0||y||a.comments)&&e.jsxs("div",{className:"lg:w-2/5 p-3 md:p-4 bg-black border-t lg:border-t-0 lg:border-l border-white/10 flex flex-col",children:[a.comments&&e.jsx("p",{className:`text-xs leading-snug mb-2 ${a.comments.includes("color")||a.comments.includes("style=")?"text-white/50":"text-purple-400"}`,dangerouslySetInnerHTML:{__html:a.comments}}),y&&e.jsx("button",{onClick:()=>d(!0),className:`mb-2 px-4 py-1.5 rounded-full text-xs font-display tracking-wide ${u?"bg-white text-black":"bg-gradient-to-r from-secondary to-primary text-black shadow-[0_0_10px_rgba(0,255,255,0.2)] hover:from-secondary/80 hover:to-primary/80"} transition-all hover:scale-105 cursor-pointer flex-shrink-0 w-fit`,"data-testid":`button-more-info-${a.id}`,children:"Track Listing"}),g&&g.length>0&&e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(ut,{className:`w-4 h-4 ${u?"text-white":"text-purple-400"}`}),e.jsx("span",{className:`${u?"text-white/80":"text-purple-400"} text-sm font-mono`,children:"Songs from this album played on TWOS"})]}),e.jsx("ul",{className:"space-y-1",children:[...g].sort((c,j)=>(c.trackName||"").localeCompare(j.trackName||"")).map(c=>e.jsxs("li",{className:`text-sm flex gap-2 ${u?"text-white":"text-cyan-400"}`,children:[e.jsx("span",{className:"text-white/40 w-5 flex-shrink-0 text-right",children:"â¢"}),e.jsxs("span",{className:"flex flex-col min-w-0 flex-1",children:[e.jsxs("span",{className:"flex items-start gap-1 flex-wrap",children:[e.jsx("span",{className:`${u?"text-white":"text-yellow-400"} font-light break-words`,children:c.trackName}),c.imageUrl&&e.jsx("button",{type:"button",onClick:()=>o?.(c.imageUrl,c.trackName),className:"flex-shrink-0 text-primary/70 hover:text-primary transition-colors cursor-pointer",title:"View track image","data-testid":`button-track-image-${c.id}`,children:e.jsx(lt,{className:"w-3.5 h-3.5"})})]}),c.originalSingleLabel&&e.jsx("span",{className:"text-xs break-words",style:{color:u?"white":"#32CD32",opacity:u?.7:1},children:St(c)})]})]},c.id))})]})]})]})}),e.jsx(ee,{children:h&&y&&e.jsx(C.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm",onClick:()=>d(!1),children:e.jsxs(C.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},className:"bg-card border border-white/20 rounded-2xl max-w-3xl w-full max-h-[80vh] overflow-hidden shadow-2xl",onClick:c=>c.stopPropagation(),children:[e.jsx("div",{className:"flex justify-end p-2",children:e.jsx(N,{onClick:()=>d(!1),variant:"ghost",size:"sm",className:"text-white/60 hover:text-white cursor-pointer",children:e.jsx(Se,{className:"w-5 h-5"})})}),e.jsx("div",{className:"p-6 overflow-y-auto max-h-[calc(80vh-80px)] prose prose-invert max-w-none [&_p]:mb-4 [&_p:last-child]:mb-0 [&_table]:border-collapse [&_table]:border-none [&_table]:!w-full [&_table]:!max-w-full [&_td]:border-none [&_td]:p-1 [&_th]:border-none [&_th]:p-1 [&_a]:text-primary [&_a]:underline [&_img]:max-w-full [&_img]:h-auto",style:{overflowX:"hidden"},ref:c=>{c&&(c.querySelectorAll("table").forEach(j=>{j.removeAttribute("width"),j.removeAttribute("height"),j.style.width="100%"}),c.querySelectorAll("td, th, tr").forEach(j=>{j.removeAttribute("width"),j.removeAttribute("height"),j.style.border="none"}))},dangerouslySetInnerHTML:{__html:y}})]})})})]})}function Me(a){let r=null;try{const s=new URL(a);s.hostname.includes("youtu.be")?r=s.pathname.slice(1):s.hostname.includes("youtube.com")&&(r=s.searchParams.get("v"))}catch{return null}return r?`https://www.youtube.com/embed/${r}?autoplay=1`:null}function Bt(){const[a,r]=et(),[s,o]=i.useState(0),{user:h,isAuthenticated:d}=tt(),x=[h?.firstName,h?.lastName].filter(Boolean).join(" ").trim();i.useEffect(()=>{const t=()=>o(m=>m+1);return window.addEventListener("artist-navigate",t),window.addEventListener("popstate",t),()=>{window.removeEventListener("artist-navigate",t),window.removeEventListener("popstate",t)}},[]);const n=i.useMemo(()=>new URLSearchParams(window.location.search).get("artist"),[a,s]),u=i.useMemo(()=>new URLSearchParams(window.location.search).get("getletter"),[a,s]),f=i.useMemo(()=>!!new URLSearchParams(window.location.search).get("fromzen"),[a,s]),y=i.useMemo(()=>!!new URLSearchParams(window.location.search).get("fromplaylist"),[a,s]),[g,v]=i.useState(null),[c,j]=i.useState(!1),[I,L]=i.useState(!1),[T,E]=i.useState(!1),[z,k]=i.useState(!1);i.useEffect(()=>{k(!1),E(!1),oe(!1),v(null),window.scrollTo(0,0)},[n]);const{data:S=[]}=W({queryKey:["/api/artists"]}),A=i.useMemo(()=>[...S].sort((t,m)=>(t.alphaName||"").localeCompare(m.alphaName||"")),[S]),{prevArtist:M,nextArtist:$}=i.useMemo(()=>{if(!n||A.length===0)return{prevArtist:null,nextArtist:null};const t=A.findIndex(m=>String(m.id)===String(n));return t===-1?{prevArtist:null,nextArtist:null}:{prevArtist:A[(t-1+A.length)%A.length],nextArtist:A[(t+1)%A.length]}},[A,n]),O=i.useCallback(t=>{const m=t.alphaName?.charAt(0).toUpperCase()||"";L(!0),setTimeout(()=>{E(!1),r(`/artist?artist=${t.id}&getletter=${m}`),window.dispatchEvent(new CustomEvent("artist-navigate")),v(null),window.scrollTo(0,0),setTimeout(()=>L(!1),50)},300)},[r]),J=i.useCallback(()=>{if(S.length===0)return;const t=S[Math.floor(Math.random()*S.length)],m=t.alphaName?.charAt(0).toUpperCase()||"";j(!0),setTimeout(()=>{j(!1),r(`/artist?artist=${t.id}&getletter=${m}&fromzen=1`),window.dispatchEvent(new CustomEvent("artist-navigate")),window.scrollTo(0,0)},2500)},[S,r]),{data:l,isLoading:w,error:B}=W({queryKey:["/api/artists",n],queryFn:async()=>{const t=await fetch(`/api/artists/${n}`);if(!t.ok)throw new Error("Artist not found");return t.json()},enabled:!!n});i.useEffect(()=>{if(!l)return;const t=requestAnimationFrame(()=>k(!0));return()=>cancelAnimationFrame(t)},[l]),at({title:l?`${l.realName||l.alphaName} â Psychepedia`:"Psychepedia",description:l?`Read Technicolor Web of Sound's Psychepedia entry for ${l.realName||l.alphaName}${l.origin?` from ${l.origin}`:""}, including history, albums, singles, and related listening links.`:"Explore Technicolor Web of Sound's Psychepedia: a comprehensive encyclopedia of psychedelic rock artists.",canonical:l?`https://techwebsound.com/artist?artist=${n}`:"https://techwebsound.com/psychepedia"}),st({page:"Artist",artistId:l&&n||void 0,artistName:l?.alphaName||void 0});const{data:Q}=W({queryKey:["/api/settings"]}),Y=Q?.artistTitleColor||void 0,{data:ae}=W({queryKey:["/api/artists",n,"singles"],queryFn:async()=>{const t=await fetch(`/api/artists/${n}/singles`);return t.ok?t.json():[]},enabled:!!n}),{data:_}=W({queryKey:["/api/artists",n,"albums"],queryFn:async()=>{const t=await fetch(`/api/artists/${n}/albums`);return t.ok?t.json():[]},enabled:!!n}),{data:p}=W({queryKey:["/api/artists",n,"youtube-links"],queryFn:async()=>{const t=await fetch(`/api/artists/${n}/youtube-links`);return t.ok?t.json():[]},enabled:!!n}),{data:X=[]}=W({queryKey:["/api/artists",n,"comments"],queryFn:async()=>{const t=await fetch(`/api/artists/${n}/comments`);return t.ok?t.json():[]},enabled:!!n}),{toast:Ae}=V(),ne=K(),[le,oe]=i.useState(!1),[he,ce]=i.useState(""),[ue,xe]=i.useState(""),[Lt,Pt]=i.useState(""),[$t,ze]=i.useState(0),[De,Te]=i.useState(!1),[Oe,Le]=i.useState(!1),[qe,pe]=i.useState(!1),[We,be]=i.useState(!1),[Ye,ge]=i.useState(!1),[He,fe]=i.useState(null),[Ke,se]=i.useState(!1),[Ve,ie]=i.useState(null),[ye,q]=i.useState(null),[Je,Z]=i.useState(""),[U,de]=i.useState(1),[G,me]=i.useState({x:0,y:0}),P=i.useRef(null);i.useEffect(()=>{de(1),me({x:0,y:0}),P.current=null},[ye]);function Pe(t){const m=t[0].clientX-t[1].clientX,D=t[0].clientY-t[1].clientY;return Math.sqrt(m*m+D*D)}function Be(t){t.touches.length===2?(t.preventDefault(),P.current={dist:Pe(t.touches),baseScale:U,basePanX:G.x,basePanY:G.y,startX:0,startY:0}):t.touches.length===1&&U>1&&(P.current={dist:0,baseScale:U,basePanX:G.x,basePanY:G.y,startX:t.touches[0].clientX,startY:t.touches[0].clientY})}function Qe(t){if(P.current)if(t.touches.length===2){t.preventDefault();const m=Math.min(5,Math.max(1,P.current.baseScale*(Pe(t.touches)/P.current.dist)));de(m)}else t.touches.length===1&&U>1&&(t.preventDefault(),me({x:P.current.basePanX+(t.touches[0].clientX-P.current.startX),y:P.current.basePanY+(t.touches[0].clientY-P.current.startY)}))}function Xe(){U<=1&&(de(1),me({x:0,y:0})),P.current=null}i.useEffect(()=>{le&&(ze(Date.now()),ce(t=>t||x))},[le,x]);const we=R({mutationFn:async t=>{const m=await fetch(`/api/artists/${n}/comments`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)});if(!m.ok)throw m.status===401?new Error("Please sign in to leave a comment."):new Error("Failed to submit c
1omment");return m.json()},onSuccess:()=>{ne.invalidateQueries({queryKey:["/api/artists",n,"comments"]}),ce(""),xe(""),oe(!1),Ae({title:"Comment submitted! Thanks for sharing your thoughts."})}});if(i.useEffect(()=>{if(window.location.hash==="#albums"){const t=()=>{const m=document.getElementById("albums-section");m&&m.scrollIntoView({behavior:"smooth"})};if(!w&&l){const m=setTimeout(t,500),D=setTimeout(t,1e3),H=setTimeout(t,2e3);return()=>{clearTimeout(m),clearTimeout(D),clearTimeout(H)}}}},[n,l,w]),!n)return e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsx("p",{className:"text-white/60",children:"No artist specified"})});if(w)return e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsx("p",{className:"text-white/60 font-mono",children:"Loading artist..."})});if(B||!l)return e.jsxs("div",{className:"min-h-screen flex items-center justify-center flex-col gap-4",children:[e.jsx("p",{className:"text-white/60",children:"Artist not found"}),e.jsx(ve,{href:"/psychepedia",className:"text-accent hover:underline",children:"Back to Psychepedia"})]});const re=l.realName||l.alphaName;return e.jsxs("div",{className:"min-h-screen pb-12 px-4 relative transition-opacity duration-300 select-none",style:{paddingTop:"74px",opacity:I?0:z?1:0},onCopy:t=>t.preventDefault(),children:[l.imageUrl&&!T&&e.jsx("div",{className:"absolute top-0 left-0 right-0 h-[500px] pointer-events-none",style:{backgroundImage:`url(${l.imageUrl})`,backgroundSize:"cover",backgroundPosition:"center 20%",opacity:.2,maskImage:"linear-gradient(to bottom, black 0%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, transparent 100%)"}}),e.jsxs("div",{className:"container mx-auto max-w-4xl lg:max-w-6xl relative z-10",children:[e.jsxs(C.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},className:`mb-3 ${y?"flex items-center":"flex flex-col md:grid md:grid-cols-3 items-center gap-4 md:gap-0"}`,children:[e.jsx("div",{className:"flex justify-start w-full md:w-auto",children:e.jsxs(ve,{href:y?"/playlist":f?"/psychepedia":u?`/psychepedia?getletter=${u}`:"/psychepedia",className:"inline-flex items-center gap-5 text-white/60 hover:text-accent transition-colors group",children:[e.jsx(ot,{className:"w-6 h-6 shrink-0 text-white/80 group-hover:text-accent transition-colors"}),y?e.jsx("span",{children:"Playlist"}):e.jsxs("div",{className:"relative flex items-center justify-center",children:[e.jsx("img",{src:"/images/globe.png",alt:"",className:"w-[72px] h-[72px] object-contain opacity-70 group-hover:opacity-100 transition-opacity"}),e.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{background:"radial-gradient(ellipse 80% 40% at 50% 50%, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.4) 40%, transparent 70%)"}}),e.jsx("span",{className:"absolute text-2xl rainbow-text mainbox",style:{fontFamily:"'Wes Wilson', cursive",lineHeight:1},children:"Psychepedia"})]})]})}),!y&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-center gap-1 w-full md:w-auto","data-testid":"artist-rolodex",children:[e.jsx("button",{onClick:()=>M&&O(M),disabled:!1,"data-testid":"button-rolodex-prev",className:"group relative w-10 h-10 flex items-center justify-center rounded-full border border-white/20 bg-white/5 backdrop-blur-sm cursor-pointer disabled:opacity-30 disabled:cursor-default transition-all hover:border-primary/60 hover:bg-primary/10 hover:shadow-[0_0_12px_rgba(255,0,255,0.3)]",title:M?M.alphaName||"Previous":"No previous artist",children:e.jsx(ct,{className:"w-5 h-5 text-accent group-hover:text-primary group-hover:drop-shadow-[0_0_6px_rgba(255,0,255,0.6)] transition-all"})}),e.jsxs("div",{className:"relative px-2 flex flex-col items-center",children:[e.jsx("span",{className:"text-4xl rainbow-text mainbox",style:{fontFamily:"'Wes Wilson', cursive",lineHeight:1},children:"Artist"}),e.jsx("span",{className:"text-4xl rainbow-text mainbox",style:{fontFamily:"'Wes Wilson', cursive",lineHeight:1},children:"Rolodex"})]}),e.jsx("button",{onClick:()=>$&&O($),disabled:!1,"data-testid":"button-rolodex-next",className:"group relative w-10 h-10 flex items-center justify-center rounded-full border border-white/20 bg-white/5 backdrop-blur-sm cursor-pointer disabled:opacity-30 disabled:cursor-default transition-all hover:border-primary/60 hover:bg-primary/10 hover:shadow-[0_0_12px_rgba(255,0,255,0.3)]",title:$?$.alphaName||"Next":"No next artist",children:e.jsx(dt,{className:"w-5 h-5 text-accent group-hover:text-primary group-hover:drop-shadow-[0_0_6px_rgba(255,0,255,0.6)] transition-all"})})]}),e.jsx("div",{className:"flex justify-end w-full md:w-auto",children:e.jsx("button",{onClick:J,"data-testid":"link-more-zen",className:"text-secondary hover:text-primary font-mono text-sm cursor-pointer transition-colors hover:drop-shadow-[0_0_8px_rgba(0,255,255,0.5)]",children:"Instant Zen â¦"})})]})]}),e.jsx(C.div,{initial:{opacity:0,y:20}
1,animate:{opacity:1,y:0},className:"pt-4 mb-8",children:e.jsx("div",{className:"flex flex-col lg:flex-row gap-8",children:e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("h1",{className:"text-4xl md:text-5xl font-display mb-0 leading-tight",style:{color:Y||"#a3e635"},children:re}),e.jsx(F,{onClick:()=>Te(!0),label:"artist-header"})]}),l.origin&&e.jsxs("p",{className:"text-primary font-mono text-base",children:["From: ",l.origin]}),l.wikipediaLink&&e.jsx("a",{href:l.wikipediaLink,target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline text-sm mt-2 inline-block",children:"Wikipedia"})]})})}),(l.description||l.imageUrl)&&e.jsxs(C.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:"bg-black border border-white/10 rounded-2xl p-8 mb-8",children:[e.jsx("div",{className:"flex justify-end mb-2",children:e.jsx(F,{onClick:()=>Le(!0),label:"description"})}),e.jsxs("div",{className:"flex flex-col md:flex-row gap-8",children:[l.imageUrl&&!T&&e.jsxs("div",{className:"md:hidden",children:[e.jsx("img",{src:l.imageUrl,alt:re,onError:()=>E(!0),className:"w-full max-w-sm rounded-none object-contain cursor-pointer hover:opacity-80 transition-opacity","data-testid":"img-artist-mobile",onClick:()=>{q(l.imageUrl),Z(re)}}),l.photoCredit&&e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsxs("p",{className:"text-white text-[10px] text-left font-mono opacity-80",children:["Image by: ",l.photoCreditUrl?e.jsx("a",{href:l.photoCreditUrl,target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-accent transition-colors",children:l.photoCredit}):l.photoCredit]}),e.jsx(F,{onClick:()=>pe(!0),label:"photo-credit"})]}),l.website&&e.jsxs("a",{href:l.website,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 mt-4 hover:underline text-base group",style:{color:"#32CD32"},children:["Official Website",e.jsx(Ce,{className:"w-4 h-4 transition-transform group-hover:translate-x-0.5 group-hover:-translate-y-0.5"})]}),p&&p.length>0&&e.jsxs("div",{className:"mt-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("img",{src:"/images/twos-tv-logo.png",alt:"TWOS TV",className:"w-14 h-14 object-contain"}),e.jsx(F,{onClick:()=>be(!0),label:"youtube-links"})]}),e.jsx("div",{className:"space-y-2",children:p.map(t=>e.jsxs("button",{onClick:()=>{window.dispatchEvent(new CustomEvent("stop-radio")),v(t)},className:"flex items-center gap-2 text-sm text-accent hover:text-white transition-colors group w-full text-left",children:[e.jsx("svg",{className:"w-5 h-5 flex-shrink-0 text-red-500",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"})}),e.jsx("span",{className:"truncate group-hover:underline",children:t.title||"Watch Video"})]},t.id))})]}),e.jsxs(N,{onClick:()=>{const t=document.getElementById("comments-section");t&&t.scrollIntoView({behavior:"smooth"})},className:"mt-8 h-8 px-4 rounded-full text-xs font-display tracking-wide bg-gradient-to-r from-secondary to-primary hover:from-secondary/80 hover:to-primary/80 text-black border-0 shadow-[0_0_20px_rgba(0,255,255,0.3)] transition-all hover:scale-105 cursor-pointer","data-testid":"button-scroll-to-comments-mobile",children:["View/Submit Comments",e.jsx(Ie,{className:"w-3.5 h-3.5 ml-1"})]})]}),l.description&&e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx("div",{className:"prose prose-invert max-w-none text-yellow-300 [&_p]:mb-4 [&_p:last-child]:mb-0",dangerouslySetInnerHTML:{__html:l.description},onClick:t=>{const D=t.target.closest("a");if(D){const H=D.getAttribute("href");if(H&&(H.startsWith("?artist=")||H.startsWith("/artist?artist="))){t.preventDefault();const $e=new URLSearchParams(H.includes("?")?H.split("?")[1]:""),_e=$e.get("artist"),Ue=$e.get("getletter")||"";_e&&(r(`/artist?artist=${_e}${Ue?`&getletter=${Ue}`:""}`),window.dispatchEvent(new CustomEvent("artist-navigate")),window.scrollTo(0,0))}}}})}),l.imageUrl&&!T&&e.jsx("div",{className:"hidden md:block md:w-64 lg:w-80 flex-shrink-0",children:e.jsxs("div",{className:"sticky top-8",children:[e.jsx("img",{src:l.imageUrl,alt:re,onError:()=>E(!0),className:"w-full rounded-none object-contain cursor-pointer hover:opacity-80 transition-opacity","data-testid":"img-artist-desktop",onClick:()=>{q(l.imageUrl),Z(re)}}),l.photoCredit&&e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsxs("p",{className:"text-white text-[10px] text-left font-mono opacity-80",children:["Image by: ",l.photoCreditUrl?e.jsx("a",{href:l.photoCreditUrl,target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-accent transition-colors",children:l.photoCredit}):l.photoCredit]}),e.jsx(F,{onClick:()=>pe(!0),label:"photo-credit-desktop"})]}),l.website&&e.jsxs("a",{href:l.website,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 mt-4 hover:underline text-base group",style:{color:"#32CD32"},children:["Official Website",e.jsx(Ce,{className:"w-4 h-4 transition-transform group-hover:translate-x-0.5 group-hover:-translate-y-0.5"})]}),p&&p.length>0&&e.jsxs("div",{className:"mt-4 pt-4 border-t border-white/10",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("img",{src:"/images/twos-tv-logo.png",alt:"TWOS TV",className:"w-14 h-14 object-contain"}),e.jsx(F,{onClick:()=>be(!0),label:"youtube-links-desktop"})]}),e.jsx("div",{className:"space-y-2",children:p.map(t=>e.jsxs("button",{onClick:()=>{window.dispatchEvent(new CustomEvent("stop-radio")),v(t)},className:"flex items-center gap-2 text-sm text-accent hover:text-white transition-colors group w-full text-left",children:[e.jsx("svg",{className:"w-5 h-5 flex-shrink-0 text-red-500",viewBox:"0 0 24 24",fill:"
1currentColor",children:e.jsx("path",{d:"M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"})}),e.jsx("span",{className:"min-w-0 flex-1 whitespace-normal break-words leading-snug group-hover:underline",children:t.title||"Watch Video"})]},t.id))})]}),e.jsxs(N,{onClick:()=>{const t=document.getElementById("comments-section");t&&t.scrollIntoView({behavior:"smooth"})},className:"mt-8 h-8 px-4 rounded-full text-xs font-display tracking-wide bg-gradient-to-r from-secondary to-primary hover:from-secondary/80 hover:to-primary/80 text-black border-0 shadow-[0_0_20px_rgba(0,255,255,0.3)] transition-all hover:scale-105 cursor-pointer","data-testid":"button-scroll-to-comments",children:["View/Submit Comments",e.jsx(Ie,{className:"w-3.5 h-3.5 ml-1"})]})]})})]})]}),ae&&ae.length>0&&e.jsxs(C.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:"mb-8",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h2",{className:"text-2xl font-display text-lime-400",children:"Singles/Unreleased"}),e.jsx(F,{onClick:()=>{fe(null),ge(!0)},label:"add-single"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[...ae].sort((t,m)=>(Number(t.yearRecorded)||9999)-(Number(m.yearRecorded)||9999)).map(t=>e.jsx(At,{single:t,onEdit:()=>{fe(t),ge(!0)},onImageClick:(m,D)=>{q(m),Z(D)}},t.id))})]}),e.jsx("div",{className:"flex justify-end mb-4",children:e.jsx(F,{onClick:()=>{ie(null),se(!0)},label:"add-album"})}),_&&_.filter(t=>!t.artistCompilation&&!t.generalCompilation).length>0&&e.jsx(ke,{title:"Original LPs/EPs",albums:_.filter(t=>!t.artistCompilation&&!t.generalCompilation).sort((t,m)=>(t.yearRecorded||9999)-(m.yearRecorded||9999)),artistId:n,delay:.3,onEditAlbum:t=>{ie(t),se(!0)},onImageClick:(t,m)=>{q(t),Z(m)}}),_&&_.filter(t=>t.artistCompilation).length>0&&e.jsx(ke,{title:"Artist Compilations",titleColor:"text-lime-400",albums:_.filter(t=>t.artistCompilation).sort((t,m)=>(t.yearRecorded||9999)-(m.yearRecorded||9999)),artistId:n,delay:.4,className:"mt-10",id:"albums-section",onEditAlbum:t=>{ie(t),se(!0)},onImageClick:(t,m)=>{q(t),Z(m)}}),_&&_.filter(t=>t.generalCompilation).length>0&&e.jsx(ke,{title:"General Compilations",titleColor:"text-lime-400",albums:_.filter(t=>t.generalCompilation).sort((t,m)=>(t.yearRecorded||9999)-(m.yearRecorded||9999)),artistId:n,delay:.5,className:"mt-10",onEditAlbum:t=>{ie(t),se(!0)},onImageClick:(t,m)=>{q(t),Z(m)}}),e.jsxs(C.div,{id:"comments-section",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.6},className:"mt-10",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("h2",{className:"text-2xl font-display text-cyan-400 flex items-center gap-2",children:[e.jsx(je,{className:"w-6 h-6 text-cyan-400"}),"Comments",d&&X.length>0&&e.jsxs("span",{className:"text-sm text-cyan-400/40 font-mono ml-2",children:["(",X.length,")"]})]}),d&&e.jsxs(N,{onClick:()=>oe(!le),className:"bg-cyan-500/20 hover:bg-cyan-500/30 text-cyan-400 border border-cyan-500/30 cursor-pointer","data-testid":"button-add-comment",children:[e.jsx(je,{className:"w-4 h-4 mr-2"}),"Leave a Comment"]})]}),e.jsx(ee,{children:le&&d&&e.jsx(C.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"overflow-hidden mb-6",children:e.jsxs("div",{className:"bg-black/30 border border-white/10 rounded-lg p-4 space-y-4",children:[e.jsx("p",{className:"text-cyan-400/50 text-xs italic leading-relaxed",children:"Please keep comments respectful and on-topic. No inappropriate language, spam, or personal attacks. We're all here to celebrate the music â keep it groovy!"}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-cyan-400/80 text-sm mb-1",children:"Display Name"}),e.jsx(b,{placeholder:"Enter the name shown with your comment",value:he,onCh
1ange:t=>ce(t.target.value),maxLength:80,className:"bg-black/30 border-white/20 text-cyan-400","data-testid":"input-public-comment-name"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-cyan-400/80 text-sm mb-1",children:"Your Comment"}),e.jsx(it,{placeholder:`Share your thoughts about ${l?.realName||l?.alphaName||"this artist"}...`,value:ue,onChange:t=>xe(t.target.value),className:"bg-black/30 border-white/20 text-cyan-400 min-h-[100px]","data-testid":"input-public-comment-text"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(N,{onClick:()=>we.mutate({name:he.trim(),comments:ue}),disabled:!he.trim()||!ue.trim()||we.isPending,className:"bg-cyan-500 hover:bg-cyan-600 text-white cursor-pointer","data-testid":"button-submit-comment",children:[we.isPending?e.jsx(mt,{className:"w-4 h-4 mr-2 animate-spin"}):e.jsx(pt,{className:"w-4 h-4 mr-2"}),"Submit"]}),e.jsx(N,{variant:"outline",onClick:()=>{oe(!1),ce(""),xe("")},className:"border-cyan-500/20 text-cyan-400 hover:bg-cyan-500/10 cursor-pointer","data-testid":"button-cancel-comment",children:"Cancel"})]})]})})}),d?X.length===0?e.jsx("p",{className:"text-cyan-400/40 text-sm text-center py-6",children:"No comments yet. Be the first to share your thoughts!"}):e.jsx("div",{className:"space-y-3",children:X.map(t=>e.jsxs("div",{className:"bg-black/20 border border-white/5 rounded-lg p-4","data-testid":`public-comment-${t.id}`,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(je,{className:"w-4 h-4 text-cyan-400 shrink-0"}),e.jsx("span",{className:"text-cyan-400 font-semibold text-sm",children:t.name}),e.jsxs("span",{className:"text-cyan-400/30 text-xs font-mono",children:["⢠",ft(t.datePosted,t.createdAt)]})]}),t.comments&&e.jsx("p",{className:"text-cyan-400/70 text-sm whitespace-pre-wrap pl-6",children:t.comments})]},t.id))}):e.jsxs("div",{className:"text-center py-8 bg-black/20 border border-white/5 rounded-lg",children:[e.jsx("p",{className:"text-cyan-400/40 text-sm mb-3",children:"Sign in to view and leave comments"}),e.jsx(ve,{href:"/sign-in",children:e.jsx("span",{className:"inline-flex items-center gap-2 px-4 py-2 text-sm font-mono text-cyan-400 border border-cyan-500/30 rounded-lg hover:bg-cyan-500/10 transition-all cursor-pointer",children:"Sign in"})})]})]})]}),l&&e.jsxs(e.Fragment,{children:[e.jsx(yt,{open:De,onClose:()=>Te(!1),artist:l,artistId:n}),e.jsx(wt,{open:Oe,onClose:()=>Le(!1),artist:l,artistId:n}),e.jsx(vt,{open:qe,onClose:()=>pe(!1),artist:l,artistId:n}),e.jsx(jt,{open:We,onClose:()=>be(!1),youtubeLinks:p||[],artistId:n}),e.jsx(Nt,{open:Ye,onClose:()=>{ge(!1),fe(null)},single:He,artistId:n}),e.jsx(kt,{open:Ke,onClose:()=>{se(!1),ie(null)},album:Ve,artistId:n})]}),e.jsx(ee,{children:g&&e.jsx(C.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/80 backdrop-blur-sm z-50 flex items-center justify-center p-4",onClick:()=>v(null),children:e.jsxs(C.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},className:"relative flex flex-col items-center w-full max-w-5xl -mt-[100px]",onClick:t=>t.stopPropagation(),children:[e.jsx("div",{className:"-mb-10 z-20 cursor-pointer",onClick:()=>v(null),children:e.jsx("img",{src:"/images/twos-tv-logo.png",alt:"Close TWOS TV",className:"w-28 h-28 md:w-36 md:h-36 object-contain drop-shadow-[0_0_15px_rgba(0,255,255,0.5)] hover:scale-110 transition-transform"})}),e.jsx("div",{className:"relative w-full aspect-video bg-black rounded-xl border-[5px] border-cyan-400 mainbox overflow-hidden",children:Me(g.url)?e.jsx("iframe",{src:Me(g.url),className:"w-full h-full",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):e.jsx("div",{className:"w-full h-full flex items-center justify-center text-white/60",children:e.jsx("a",{href:g.url,target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline cursor-pointer",children:"Open video in new tab"})})}),g.title&&e.jsx("p",{className:"text-white font-display text-xl md:text-2xl drop-shadow-[0_2px_4px_rgba(0,0,0,1)] text-center leading-tight mt-4",children:g.title})]})})}),e.jsx(ee,{children:ye&&e.jsx(C.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/85 p-4",onClick:()=>q(null),children:e.jsxs(C.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},transition:{duration:.2},className:"relative",onClick:t=>t.stopPropagation(),onTouchStart:Be,onTouchMove:Qe,onTouchEnd:Xe,style:{touchAction:U>1?"none":"auto",overflow:"hidden"},children:[e.jsx("img",{src:ye,alt:Je,className:"rounded-none object-contain",style:{maxWidth:"90vw",maxHeight:"90vh",width:"100%",transform:`scale(${U}) translate(${G.x/U}px, ${G.y/U}px)`,transition:P.current?"none":"transform 0.15s ease",cursor:U>1?"grab":"default",userSelect:"none"}}),e.jsx("button",{onClick:()=>q(null),className:"absolute -top-3 -right-3 w-8 h-8 rounded-full bg-black/80 border border-white/20 flex items-center justify-center text-white hover:bg-white/20 transition-colors cursor-pointer","data-testid":"button-close-image-modal",children:e.jsx(Se,{className:"w-4 h-4"})}),U>1&&e.jsx("button",{onClick:()=>{de(1),me({x:0,y:0})},className:"md:hidden absolute bottom-2 left-1/2 -translate-x-1/2 px-3 py-1 rounded-full bg-black/70 border border-white/20 text-white text-xs font-mono",children:"Reset zoom"})]})})}),e.jsx(ee,{children:c&&e.jsx(C.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/90",children:e.jsxs("div",{className:"flex flex-col items-center gap-6",children:[e.jsx(C.img,{src:"/images/zen-spinner.png",alt:"Finding your zen...",className:"w-48 h-48",animate:{rotate:360},transition:{duration:2,repeat:1/0,ease:"linear"}}),e.jsx(C.p,{initial:{opacity:0},animate:{opacity:[0,1,.5,1]},transition:{duration:1.5,repeat:1/0},className:"text-primary font-display text-2xl",children:"Finding your zen..."})]})})})]})}export{Bt 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.