From 46a98c8220dc73e23de8bb0670db335524c71c09 Mon Sep 17 00:00:00 2001 From: Nicolas Borromeo Date: Thu, 5 Dec 2024 13:12:01 -0300 Subject: [PATCH] new card button back inside linear gradient --- .DS_Store | Bin 10244 -> 10244 bytes .../{index-be3c9202.js => index-ba250299.js} | 2 +- frontend/dist/index.html | 2 +- frontend/src/components/Card/Card.jsx | 12 ++++++------ 4 files changed, 8 insertions(+), 8 deletions(-) rename frontend/dist/assets/{index-be3c9202.js => index-ba250299.js} (93%) diff --git a/.DS_Store b/.DS_Store index 15382958245be6852c85d6f0a49d033e25889b14..2f0d77c2a41af830982a1fd510eb997687728b47 100644 GIT binary patch delta 126 zcmZn(XbIS$DiD|ZW)}kk0}F#5LpnnyLrHGFi%U{YeiBfO!=$%JYi`3aM^yO~yz&JZ qhQZ1CxdlKy3=HQtOl}s~#Jol3)Z_#~vB`ddQA{FCn^y@&i2(qX(IWH! delta 126 zcmZn(XbIS$DiD`#8PCALz`~%%kj{|FP?DSP;*yk;p9B=+@YY&+aZbZAM^yO~yz&JZ phQZ1CxdlKy3=C%)CN~RgVqW9MJvl*8Y_gwV6qE3;&8q~X!~kMYBP{>` diff --git a/frontend/dist/assets/index-be3c9202.js b/frontend/dist/assets/index-ba250299.js similarity index 93% rename from frontend/dist/assets/index-be3c9202.js rename to frontend/dist/assets/index-ba250299.js index c800fa5..ab93324 100644 --- a/frontend/dist/assets/index-be3c9202.js +++ b/frontend/dist/assets/index-ba250299.js @@ -250,7 +250,7 @@ PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */function P0(e,t){const[r,n]=x.useState(null),i=x.useMemo(()=>Object.entries(t).flat(),[t]);return x.useEffect(()=>{if(!e.current)return;const a=Bc.create(Object.assign(Object.assign({},t),{container:e.current}));return n(a),()=>{a.destroy()}},[e,...i]),r}const j0=/^on([A-Z])/,GC=e=>j0.test(e);function KC(e,t){const r=x.useMemo(()=>Object.entries(t).flat(),[t]);x.useEffect(()=>{if(!e)return;const n=Object.entries(t);if(!n.length)return;const i=n.map(([a,o])=>{const l=a.replace(j0,(s,u)=>u.toLowerCase());return e.on(l,(...s)=>o(e,...s))});return()=>{i.forEach(a=>a())}},[e,...r])}x.memo(e=>{const t=x.useRef(null),[r,n]=function(i){return x.useMemo(()=>{const a=Object.assign({},i),o=Object.assign({},i);for(const l in a)GC(l)?delete a[l]:delete o[l];return[a,o]},[i])}(e);return KC(P0(t,r),n),c.jsx("div",{ref:t})});function R0(e){var{container:t}=e;const r=P0(t,function(i,a){var o={};for(var l in i)Object.prototype.hasOwnProperty.call(i,l)&&a.indexOf(l)<0&&(o[l]=i[l]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function"){var s=0;for(l=Object.getOwnPropertySymbols(i);s{if(!i)return;const d=[i.on("load",()=>{o(!1),s(!1),f(0)}),i.on("ready",()=>{o(!0),s(!1),f(0)}),i.on("play",()=>{s(!0)}),i.on("pause",()=>{s(!1)}),i.on("timeupdate",()=>{f(i.getCurrentTime())}),i.on("destroy",()=>{o(!1),s(!1)})];return()=>{d.forEach(p=>p())}},[i]),x.useMemo(()=>({isReady:a,isPlaying:l,currentTime:u}),[l,u,a])}(r);return x.useMemo(()=>Object.assign(Object.assign({},n),{wavesurfer:r}),[n,r])}let YC=class{constructor(){this.listeners={}}on(t,r,n){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(r),n==null?void 0:n.once){const i=()=>{this.un(t,i),this.un(t,r)};return this.on(t,i),i}return()=>this.un(t,r)}un(t,r){var n;(n=this.listeners[t])===null||n===void 0||n.delete(r)}once(t,r){return this.on(t,r,{once:!0})}unAll(){this.listeners={}}emit(t,...r){this.listeners[t]&&this.listeners[t].forEach(n=>n(...r))}},qC=class extends YC{constructor(t){super(),this.subscriptions=[],this.options=t}onInit(){}_init(t){this.wavesurfer=t,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(t=>t())}};function T0(e,t){const r=t.xmlns?document.createElementNS(t.xmlns,e):document.createElement(e);for(const[n,i]of Object.entries(t))if(n==="children")for(const[a,o]of Object.entries(t))typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(T0(a,o));else n==="style"?Object.assign(r.style,i):n==="textContent"?r.textContent=i:r.setAttribute(n,i.toString());return r}function bu(e,t,r){return T0(e,t||{})}const QC={height:20,formatTimeCallback:e=>e/60>1?`${Math.floor(e/60)}:${`${(e=Math.round(e%60))<10?"0":""}${e}`}`:`${Math.round(1e3*e)/1e3}`};let XC=class I0 extends qC{constructor(t){super(t||{}),this.options=Object.assign({},QC,t),this.timelineWrapper=this.initTimelineWrapper()}static create(t){return new I0(t)}onInit(){var t;if(!this.wavesurfer)throw Error("WaveSurfer is not initialized");let r=this.wavesurfer.getWrapper();if(this.options.container instanceof HTMLElement)r=this.options.container;else if(typeof this.options.container=="string"){const n=document.querySelector(this.options.container);if(!n)throw Error(`No Timeline container found matching ${this.options.container}`);r=n}this.options.insertPosition?(r.firstElementChild||r).insertAdjacentElement(this.options.insertPosition,this.timelineWrapper):r.appendChild(this.timelineWrapper),this.subscriptions.push(this.wavesurfer.on("redraw",()=>this.initTimeline())),(!((t=this.wavesurfer)===null||t===void 0)&&t.getDuration()||this.options.duration)&&this.initTimeline()}destroy(){this.timelineWrapper.remove(),super.destroy()}initTimelineWrapper(){return bu("div",{part:"timeline-wrapper",style:{pointerEvents:"none"}})}defaultTimeInterval(t){return t>=25?1:5*t>=25?5:15*t>=25?15:60*Math.ceil(.5/t)}defaultPrimaryLabelInterval(t){return t>=25?10:5*t>=25?6:4}defaultSecondaryLabelInterval(t){return t>=25?5:2}virtualAppend(t,r,n){let i=!1;const a=(o,l)=>{if(!this.wavesurfer)return;const s=n.clientWidth,u=t>o&&t+s{var o;this.wavesurfer&&(a(0,((o=this.wavesurfer)===null||o===void 0?void 0:o.getWidth())||0),this.subscriptions.push(this.wavesurfer.on("scroll",(l,s,u,f)=>{a(u,f)})))},0)}initTimeline(){var t,r,n,i,a,o,l,s;const u=(n=(r=(t=this.wavesurfer)===null||t===void 0?void 0:t.getDuration())!==null&&r!==void 0?r:this.options.duration)!==null&&n!==void 0?n:0,f=(((i=this.wavesurfer)===null||i===void 0?void 0:i.getWrapper().scrollWidth)||this.timelineWrapper.scrollWidth)/u,d=(a=this.options.timeInterval)!==null&&a!==void 0?a:this.defaultTimeInterval(f),p=(o=this.options.primaryLabelInterval)!==null&&o!==void 0?o:this.defaultPrimaryLabelInterval(f),h=this.options.primaryLabelSpacing,v=(l=this.options.secondaryLabelInterval)!==null&&l!==void 0?l:this.defaultSecondaryLabelInterval(f),b=this.options.secondaryLabelSpacing,w=this.options.insertPosition==="beforebegin",y=bu("div",{style:Object.assign({height:`${this.options.height}px`,overflow:"hidden",fontSize:this.options.height/2+"px",whiteSpace:"nowrap"},w?{position:"absolute",top:"0",left:"0",right:"0",zIndex:"2"}:{position:"relative"})});y.setAttribute("part","timeline"),typeof this.options.style=="string"?y.setAttribute("style",y.getAttribute("style")+this.options.style):typeof this.options.style=="object"&&Object.assign(y.style,this.options.style);const g=bu("div",{style:{width:"0",height:"50%",display:"flex",flexDirection:"column",justifyContent:w?"flex-start":"flex-end",top:w?"0":"auto",bottom:w?"auto":"0",overflow:"visible",borderLeft:"1px solid currentColor",opacity:`${(s=this.options.secondaryLabelOpacity)!==null&&s!==void 0?s:.25}`,position:"absolute",zIndex:"1"}});for(let m=0,C=0;m{const t=x.useRef(),[r,n]=x.useState(),[i,a]=x.useState(),{wavesurfer:o,isReady:l,isPlaying:s,currentTime:u}=R0({container:t,height:60,autoplay:!1,waveColor:"#BD1792",progressColor:"rgb(100, 0, 100)",url:e,plugins:x.useMemo(()=>[XC.create()],[])}),f=x.useCallback(()=>{o&&o.playPause()},[o]);return x.useEffect(()=>{o&&l&&n(o.getDuration())},[o,l]),x.useEffect(()=>{o&&o.on("loading",d=>{a(d)})},[o,i]),c.jsxs(c.Fragment,{children:[i<100&&c.jsxs("div",{className:"loading-bar-container",style:{width:"50%",backgroundColor:"#030712",height:"25px",display:"flex",alignItems:"center",margin:"50px auto",borderRadius:"20px"},children:[c.jsx("div",{style:{position:"absolute",display:"flex",justifyContent:"center",padding:"0 10px",fontSize:"0.8rem",color:"black"}}),c.jsx("div",{className:"loading-bar",style:{width:`${i}%`,backgroundColor:"#BD1792",height:"76%",borderRadius:"20px",transition:"width 0.2s"}}),c.jsx("span",{style:{position:"absolute",padding:"4px 10px",fontSize:"0.8rem",fontWeight:"bold"},children:"Loading..."})]}),c.jsx("div",{id:"waveform",className:l?"":"hidden",ref:t}),c.jsx("div",{className:"player-controls",children:l&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"play-background",children:c.jsx("span",{id:"player-playpause",onClick:f,className:"clickable",children:s?c.jsx(wC,{size:30}):c.jsx(m0,{size:30})})}),c.jsxs("span",{id:"player-timeline",children:[Rl(u)," / ",Rl(r)]})]})})]})},N0="images/setUserImages",M0="images/updateImageName",A0="images/deleteImage",L0="images/receiveImages",ZC=e=>({type:N0,userImages:e}),e4=(e,t)=>({type:M0,payload:{imageId:e,name:t}}),t4=e=>({type:A0,imageId:e}),r4=e=>({type:L0,newlyUploadedImages:e}),sf=()=>async e=>{const r=await(await he("/api/images/current")).json();return e(ZC(r)),r},n4=(e,t)=>async r=>{const n=await he(`/api/images/${e}`,{method:"PUT",body:JSON.stringify({name:t})});if(n.ok){const i=await n.json();r(e4(e,i.newName))}else return await n.json()},i4=e=>async t=>{(await he(`/api/images/${e}`,{method:"DELETE"})).ok&&t(t4(e))},O0=e=>async t=>{const r=new FormData;Array.from(e).forEach(i=>r.append("images",i));const n=await he("/api/images/",{method:"POST",body:r});if(n.ok){const i=await n.json();t(r4(i))}return n},a4={},o4=(e=a4,t)=>{switch(t.type){case N0:return{...e,userImages:[...t.userImages.userImages]};case L0:return{...e,userImages:[...e.userImages,...t.newlyUploadedImages]};case A0:{let r={...e},n=r.userImages.filter(i=>i.id!==t.imageId);return delete r.userImages,r.userImages=n,r}case M0:{let r={...e},n=r.userImages.map(i=>(i.id===t.payload.imageId&&(i.name=t.payload.name),i));return delete r.userImages,r.userImages=n,r}default:return e}};function B0({id:e,title:t,type:r,closeModal:n}){const[i,a]=x.useState(t),[o,l]=x.useState(),s=ze();x.useEffect(()=>{i.length>2?l(!1):l(!0)},[i]);const u=async f=>{i!==""&&(r==="Track"&&s(BC(f,i)).then(()=>n()),r==="Image"&&s(n4(f,i)).then(()=>n()))};return c.jsxs("div",{id:"title-modal-content",children:[c.jsxs("h4",{children:["Rename ",`${r}`]}),c.jsxs("fieldset",{children:[c.jsxs("legend",{children:[`${r}`," name"]}),c.jsx("input",{type:"text",value:i,onChange:f=>a(f.target.value)})]}),c.jsxs("div",{className:"title-modal-buttons",children:[c.jsx("button",{id:"title-modal-cancel-button",onClick:n,children:"CANCEL"}),c.jsx("button",{id:"ok-button",onClick:()=>u(e),disabled:o,children:"RENAME"})]})]})}function l4(e){return le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256z"},child:[]}]})(e)}function s4(e){return le({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zM21.3 229.2H21c.1-.1.2-.3.3-.4zM97 319.8H64V192h33zm113.2 0h-28.7v-86.4l-11.6 86.4h-20.6l-12.2-84.5v84.5h-29V192h42.8c3.3 19.8 6 39.9 8.7 59.9l7.6-59.9h43zm11.4 0V192h24.6c17.6 0 44.7-1.6 49 20.9 1.7 7.6 1.4 16.3 1.4 24.4 0 88.5 11.1 82.6-75 82.5zm160.9-29.2c0 15.7-2.4 30.9-22.2 30.9-9 0-15.2-3-20.9-9.8l-1.9 8.1h-29.8V192h31.7v41.7c6-6.5 12-9.2 20.9-9.2 21.4 0 22.2 12.8 22.2 30.1zM265 229.9c0-9.7 1.6-16-10.3-16v83.7c12.2.3 10.3-8.7 10.3-18.4zm85.5 26.1c0-5.4 1.1-12.7-6.2-12.7-6 0-4.9 8.9-4.9 12.7 0 .6-1.1 39.6 1.1 44.7.8 1.6 2.2 2.4 3.8 2.4 7.8 0 6.2-9 6.2-14.4z"},child:[]}]})(e)}function u4(e){return le({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"},child:[]}]})(e)}function c4(e){return le({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"},child:[]}]})(e)}function d4(e){return le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"},child:[]}]})(e)}function On(e){return le({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4zM393.4 288H328v112c0 8.8-7.2 16-16 16h-48c-8.8 0-16-7.2-16-16V288h-65.4c-14.3 0-21.4-17.2-11.3-27.3l105.4-105.4c6.2-6.2 16.4-6.2 22.6 0l105.4 105.4c10.1 10.1 2.9 27.3-11.3 27.3z"},child:[]}]})(e)}function f4(e){return le({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z"},child:[]}]})(e)}function p4(e){return le({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm64 236c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12v8zm0-64c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12v8zm0-72v8c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12zm96-114.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"},child:[]}]})(e)}function h4(e){return le({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M480 416v16c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V176c0-26.51 21.49-48 48-48h16v208c0 44.112 35.888 80 80 80h336zm96-80V80c0-26.51-21.49-48-48-48H144c-26.51 0-48 21.49-48 48v256c0 26.51 21.49 48 48 48h384c26.51 0 48-21.49 48-48zM256 128c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-96 144l55.515-55.515c4.686-4.686 12.284-4.686 16.971 0L272 256l135.515-135.515c4.686-4.686 12.284-4.686 16.971 0L512 208v112H160v-48z"},child:[]}]})(e)}function v4(e){return le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M470.38 1.51L150.41 96A32 32 0 0 0 128 126.51v261.41A139 139 0 0 0 96 384c-53 0-96 28.66-96 64s43 64 96 64 96-28.66 96-64V214.32l256-75v184.61a138.4 138.4 0 0 0-32-3.93c-53 0-96 28.66-96 64s43 64 96 64 96-28.65 96-64V32a32 32 0 0 0-41.62-30.49z"},child:[]}]})(e)}function js(e){return le({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M7 4V2H17V4H22V6H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V6H2V4H7ZM6 6V20H18V6H6ZM9 9H11V17H9V9ZM13 9H15V17H13V9Z"},child:[]}]})(e)}function Rs(e){return le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 0 0-94.3-139.9 437.71 437.71 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"},child:[]}]})(e)}function sa(e){return le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Edit"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M3.548,20.938h16.9a.5.5,0,0,0,0-1H3.548a.5.5,0,0,0,0,1Z"},child:[]},{tag:"path",attr:{d:"M9.71,17.18a2.587,2.587,0,0,0,1.12-.65l9.54-9.54a1.75,1.75,0,0,0,0-2.47l-.94-.93a1.788,1.788,0,0,0-2.47,0L7.42,13.12a2.473,2.473,0,0,0-.64,1.12L6.04,17a.737.737,0,0,0,.19.72.767.767,0,0,0,.53.22Zm.41-1.36a1.468,1.468,0,0,1-.67.39l-.97.26-1-1,.26-.97a1.521,1.521,0,0,1,.39-.67l.38-.37,1.99,1.99Zm1.09-1.08L9.22,12.75l6.73-6.73,1.99,1.99Zm8.45-8.45L18.65,7.3,16.66,5.31l1.01-1.02a.748.748,0,0,1,1.06,0l.93.94A.754.754,0,0,1,19.66,6.29Z"},child:[]}]}]}]})(e)}function Fc(e){return le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Menu_Kebab"},child:[{tag:"path",attr:{d:"M14.5,12c0,1.38 -1.12,2.5 -2.5,2.5c-1.38,-0 -2.5,-1.12 -2.5,-2.5c0,-1.38 1.12,-2.5 2.5,-2.5c1.38,-0 2.5,1.12 2.5,2.5Zm-1,-0c0,-0.828 -0.672,-1.5 -1.5,-1.5c-0.828,-0 -1.5,0.672 -1.5,1.5c0,0.828 0.672,1.5 1.5,1.5c0.828,-0 1.5,-0.672 1.5,-1.5Z"},child:[]},{tag:"path",attr:{d:"M14.5,4.563c0,1.38 -1.12,2.5 -2.5,2.5c-1.38,-0 -2.5,-1.12 -2.5,-2.5c0,-1.38 1.12,-2.5 2.5,-2.5c1.38,-0 2.5,1.12 2.5,2.5Zm-1,-0c0,-0.828 -0.672,-1.5 -1.5,-1.5c-0.828,-0 -1.5,0.672 -1.5,1.5c0,0.828 0.672,1.5 1.5,1.5c0.828,-0 1.5,-0.672 1.5,-1.5Z"},child:[]},{tag:"path",attr:{d:"M14.5,19.437c0,1.38 -1.12,2.5 -2.5,2.5c-1.38,0 -2.5,-1.12 -2.5,-2.5c0,-1.38 1.12,-2.5 2.5,-2.5c1.38,0 2.5,1.12 2.5,2.5Zm-1,0c0,-0.828 -0.672,-1.5 -1.5,-1.5c-0.828,0 -1.5,0.672 -1.5,1.5c0,0.828 0.672,1.5 1.5,1.5c0.828,0 1.5,-0.672 1.5,-1.5Z"},child:[]}]}]})(e)}function g4(e){return le({tag:"svg",attr:{version:"1.1",id:"search",x:"0px",y:"0px",viewBox:"0 0 24 24",style:"enable-background:new 0 0 24 24;"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:`M20.031,20.79c0.46,0.46,1.17-0.25,0.71-0.7l-3.75-3.76c1.27-1.41,2.04-3.27,2.04-5.31 c0-4.39-3.57-7.96-7.96-7.96s-7.96,3.57-7.96,7.96c0,4.39,3.57,7.96,7.96,7.96c1.98,0,3.81-0.73,5.21-1.94L20.031,20.79z M4.11,11.02c0-3.84,3.13-6.96,6.96-6.96c3.84,0,6.96,3.12,6.96,6.96c0,3.84-3.12,6.96-6.96,6.96C7.24,17.98,4.11,14.86,4.11,11.02 - z`},child:[]}]}]})(e)}function uf(e){return le({tag:"svg",attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M4.5 1C4.22386 1 4 1.22386 4 1.5C4 1.77614 4.22386 2 4.5 2C5.42215 2 6.0399 2.23054 6.42075 2.56379C6.79286 2.88939 7 3.36626 7 4V7H5.75C5.47386 7 5.25 7.22386 5.25 7.5C5.25 7.77614 5.47386 8 5.75 8H7V11C7 11.6337 6.79286 12.1106 6.42075 12.4362C6.0399 12.7695 5.42215 13 4.5 13C4.22386 13 4 13.2239 4 13.5C4 13.7761 4.22386 14 4.5 14C5.57785 14 6.4601 13.7305 7.07925 13.1888C7.24168 13.0467 7.38169 12.8896 7.5 12.7198C7.61832 12.8896 7.75832 13.0467 7.92075 13.1888C8.5399 13.7305 9.42215 14 10.5 14C10.7761 14 11 13.7761 11 13.5C11 13.2239 10.7761 13 10.5 13C9.57785 13 8.9601 12.7695 8.57925 12.4362C8.20714 12.1106 8 11.6337 8 11V8H9.25C9.52614 8 9.75 7.77614 9.75 7.5C9.75 7.22386 9.52614 7 9.25 7H8V4C8 3.36626 8.20714 2.88939 8.57925 2.56379C8.9601 2.23054 9.57785 2 10.5 2C10.7761 2 11 1.77614 11 1.5C11 1.22386 10.7761 1 10.5 1C9.42215 1 8.5399 1.26946 7.92075 1.81121C7.75832 1.95333 7.61832 2.11043 7.5 2.28023C7.38168 2.11043 7.24168 1.95333 7.07925 1.81121C6.4601 1.26946 5.57785 1 4.5 1Z",fill:"currentColor"},child:[]}]})(e)}function m4(){const e=Ie($=>$.session.user),t=Ie($=>$.catalog.userTracks),r=ze(),[n,i]=x.useState(),[a,o]=x.useState(),[l,s]=x.useState(),[u,f]=x.useState(),[d,p]=x.useState(),[h,v]=x.useState(!1),b=x.useRef(),[w,y]=x.useState(),[g,m]=x.useState(),[C,D]=x.useState(!1),[P,j]=x.useState(),[S,T]=x.useState(),{addToast:I}=Ps();x.useEffect(()=>{r(lf()).then(()=>{y(!0)})},[e,r]);const L=async $=>{const ae=$.target.files,A=[...ae].map(F=>F.name);ae.length>=1&&(T(A),j(!0),r(C0(ae,e.id)).then(()=>{I("Upload successful!"),j(!1)}).catch(async F=>{const H=await F.json();I(H.error||"Error: There was an error while uploading","error"),j(!1)}))},K=$=>{r(OC($)).then(()=>I("Successfully deleted.")),v(!1)},Q=($,ae)=>{s(ae),m($),D(!0)},X=()=>{C?(D(!1),i(null)):D(!0)},se=($,ae,A)=>{$.stopPropagation(),f($.clientX-80),p($.clientY),o(ae),s(A),v(!0)};return x.useEffect(()=>{const $=ae=>{b.current.contains(ae.target)||v(!1)};return h&&document.addEventListener("click",$),()=>document.removeEventListener("click",$)},[h]),c.jsxs("div",{id:"catalog-container",children:[c.jsx("div",{className:"page-title-container",children:c.jsxs("div",{className:"page-title-content",children:[c.jsx("p",{id:"page-title",children:"Catalog"}),c.jsx("div",{className:"gradient-button-background",children:c.jsx(y4,{handleUploadTracks:L,uploading:P})})]})}),c.jsxs("div",{className:"table-and-player-container",children:[c.jsxs("table",{className:"tracks-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Name"}),c.jsx("th",{}),c.jsx("th",{children:"Duration"}),c.jsx("th",{children:"Uploaded"}),c.jsx("th",{})]})}),t&&Array.isArray(t)&&c.jsxs("tbody",{id:"tracks-tbody",children:[!t.length&&!P&&c.jsx("tr",{children:c.jsx("td",{colSpan:4,style:{textAlign:"center",fontSize:"1.1em"},children:c.jsxs("p",{className:"no-items-message-container",children:[" You don't have any Tracks uploaded yet.",c.jsxs("span",{children:[" Click the icon ",c.jsx(On,{})," to start building your catalog"]})]})})}),P&&S.map($=>c.jsxs("tr",{children:[c.jsx("td",{id:"track-row-play-icon",children:c.jsx("div",{className:"play-background",children:c.jsx(Rs,{className:"loading-icon",size:16})})}),c.jsx("td",{style:{fontStyle:"italic"},children:$}),c.jsx("td",{}),c.jsx("td",{}),c.jsx("td",{children:c.jsx(Fc,{id:"menu-icon",color:"#545b69"})})]},$)),w&&t.toReversed().map($=>c.jsxs("tr",{className:`catalog-track-row ${n==$.id?"active-track":""}`,id:$.id,children:[c.jsx("td",{id:"track-row-play-icon",children:c.jsx("div",{className:"play-background",children:c.jsx(m0,{size:16,onClick:()=>{Q($.filePath,$.title),i($.id)}})})}),c.jsx("td",{children:$.title}),c.jsx("td",{children:E0($.duration)}),c.jsx("td",{children:Ac($.createdAt)}),c.jsx("td",{children:c.jsx(Fc,{id:"menu-icon",color:"#545b69",onClick:ae=>se(ae,$.id,$.title)})})]},$.id))]})]}),C&&c.jsxs("div",{className:"audio-player-container",children:[c.jsxs("div",{className:"title-x-container",children:[c.jsx("span",{id:"audio-player-track-title",children:l}),c.jsx("span",{className:"close-audio-player-x",onClick:X,children:c.jsx(y0,{size:20})})]}),c.jsx("div",{id:"audio-player",style:{display:C?"block":"none"},children:c.jsx(JC,{audioUrl:g})})]})]}),c.jsx(x4,{handleDeleteTrack:K,trackId:a,trackTitle:l,showMenu:h,menuRef:b,x:u,y:d})]})}function y4({handleUploadTracks:e,uploading:t}){const r=x.useRef(null),n=()=>{r.current&&r.current.click()};if(!t)return c.jsxs("div",{children:[c.jsx("input",{type:"file",accept:".wav,.mp3",multiple:!0,onChange:e,ref:r,style:{display:"none"}}),c.jsxs("button",{onClick:n,className:"upload-icon",children:[c.jsx("span",{children:"UPLOAD TRACKS"}),c.jsx("span",{children:c.jsx(On,{size:20})})]})]})}function x4({trackId:e,trackTitle:t,x:r,y:n,menuRef:i,showMenu:a,handleDeleteTrack:o}){const{setModalContent:l,closeModal:s}=fr();return c.jsxs("div",{className:"options-container",style:{display:a?"flex":"none",position:"absolute",top:n,left:r},ref:i,children:[c.jsxs("div",{style:{cursor:"pointer"},onClick:()=>l(c.jsx(B0,{id:e,title:t,type:"Track",closeModal:s})),children:[c.jsx(uf,{}),"Rename"]}),c.jsxs("div",{style:{color:"#e22847",cursor:"pointer"},onClick:()=>o(e),children:[c.jsx(js,{}),"Delete"]})]})}const F0="displayInfo/setDisplayInfo",z0="displayInfo/updateInfo",b4=e=>({type:F0,displayInfo:e}),w4=e=>({type:z0,updatedInfo:e}),$0=()=>async e=>{const t=await he("/api/displayinfo/current");if(t.ok){const r=await t.json();e(b4(r))}},S4=e=>async t=>{const r=await he("/api/displayinfo/current",{method:"POST",body:JSON.stringify({data:e})});if(r.ok){const n=await r.json();t(w4(n))}},C4={},E4=(e=C4,t)=>{switch(t.type){case F0:return{...e,...t.displayInfo};case z0:return{...t.updatedInfo};default:return e}};function D4(e){return le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M272 64h-16c-4.4 0-8 3.6-8 8v72c0 4.4 7.6 8 12 8h12c4.4 0 8-3.6 8-8V72c0-4.4-3.6-8-8-8z"},child:[]},{tag:"path",attr:{d:"M433.9 130.1L382 78.2c-9-9-21.3-14.2-34.1-14.2h-28c-8.8 0-16 7.3-16 16.2v80c0 8.8-7.2 16-16 16H160c-8.8 0-16-7.2-16-16v-80c0-8.8-7.2-16.2-16-16.2H96c-17.6 0-32 14.4-32 32v320c0 17.6 14.4 32 32 32h320c17.6 0 32-14.4 32-32V164c0-12.7-5.1-24.9-14.1-33.9zM322 400.1c0 8.8-8 16-17.8 16H143.8c-9.8 0-17.8-7.2-17.8-16v-96c0-8.8 8-16 17.8-16h160.4c9.8 0 17.8 7.2 17.8 16v96z"},child:[]}]})(e)}function k4(e){return le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M401.4 224h-214l83-79.4c11.9-12.5 11.9-32.7 0-45.2s-31.2-12.5-43.2 0L89 233.4c-6 5.8-9 13.7-9 22.4v.4c0 8.7 3 16.6 9 22.4l138.1 134c12 12.5 31.3 12.5 43.2 0 11.9-12.5 11.9-32.7 0-45.2l-83-79.4h214c16.9 0 30.6-14.3 30.6-32 .1-18-13.6-32-30.5-32z"},child:[]}]})(e)}function P4(e){return le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M168.531 215.469l-29.864 29.864 96 96L448 128l-29.864-29.864-183.469 182.395-66.136-65.062zm236.802 189.864H106.667V106.667H320V64H106.667C83.198 64 64 83.198 64 106.667v298.666C64 428.802 83.198 448 106.667 448h298.666C428.802 448 448 428.802 448 405.333V234.667h-42.667v170.666z"},child:[]}]})(e)}function j4(e){return le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M403.002 217.001C388.998 148.002 328.998 96 256 96c-57.998 0-107.998 32.998-132.998 81.001C63.002 183.002 16 233.998 16 296c0 65.996 53.999 120 120 120h260c55 0 100-45 100-100 0-52.998-40.996-96.001-92.998-98.999zM213.333 362.667L138.667 288l29.864-29.864 44.802 44.802L324.271 192l29.865 29.864-140.803 140.803z"},child:[]}]})(e)}function R4(){const{closeModal:e,setModalContent:t}=fr(),r=ze(),n=Ie(D=>D.displayInfo),[i,a]=x.useState(""),[o,l]=x.useState(""),[s,u]=x.useState(""),[f,d]=x.useState(""),[p,h]=x.useState(""),[v,b]=x.useState(""),[w,y]=x.useState(!1),[g,m]=x.useState(!1);x.useEffect(()=>{r($0()).then(()=>y(!0))},[r]),x.useEffect(()=>{if(n&&w){const{name:D,jobTitle:P,email:j,website:S,phone:T,bio:I}=n;D&&a(D||""),P&&l(P||""),j&&u(j||""),S&&d(S||""),T&&h(T||""),I&&b(I||"")}},[n,w]);const C=D=>{D.preventDefault(),r(S4({name:i,jobTitle:o,email:s,website:f,phone:p,bio:v})).then(()=>e()).then(()=>m(!1))};return x.useEffect(()=>{},[i,o,s,p,v]),c.jsxs("div",{id:"display-information-container",children:[c.jsx("h3",{children:"Display Information"}),c.jsxs("div",{className:"text-and-button",children:[c.jsx("p",{children:"Below are your personal details that will appear by default in all the cards. Any changes made here will affect all other cards (existing and future), unless you've modified the field directly in the card. The modifiable fields are: Job Title and Biographhy."}),c.jsx("span",{children:c.jsx(D4,{id:"save-button",className:g?"active-button":"grayed",size:40,onClick:()=>t(c.jsx(T4,{handleSaveDisplayInfo:C,closeModal:e}))})})]}),c.jsx("div",{className:"personal-info-from-container",children:c.jsxs("form",{children:[c.jsxs("div",{children:[c.jsxs("fieldset",{children:[c.jsx("legend",{children:"Name"}),c.jsx("input",{type:"text",value:i,onChange:D=>{a(D.target.value),m(!0)}})]}),c.jsxs("fieldset",{children:[c.jsx("legend",{children:"Job Title"}),c.jsx("input",{type:"text",value:o,onChange:D=>{l(D.target.value),m(!0)}})]}),c.jsxs("fieldset",{children:[c.jsx("legend",{children:"Email Address"}),c.jsx("input",{type:"text",value:s,onChange:D=>{u(D.target.value),m(!0)}})]}),c.jsxs("fieldset",{children:[c.jsx("legend",{children:"Website Url"}),c.jsx("input",{type:"text",value:f,onChange:D=>{d(D.target.value),m(!0)}})]}),c.jsxs("fieldset",{children:[c.jsx("legend",{children:"Phone"}),c.jsx("input",{type:"text",value:p,onChange:D=>{h(D.target.value),m(!0)}})]})]}),c.jsx("div",{children:c.jsxs("fieldset",{id:"bio-fieldset",children:[c.jsx("legend",{children:"Biography"}),c.jsx("textarea",{rows:"15",value:v,onChange:D=>{b(D.target.value),m(!0)}})]})})]})})]})}function T4({handleSaveDisplayInfo:e,closeModal:t}){return c.jsxs("div",{className:"are-you-sure-container",children:[c.jsx("h3",{children:"Warning:"}),c.jsx("p",{children:"This change will affect all your cards that have this information displayed."}),c.jsx("p",{children:"Are you sure you want to continue?"}),c.jsxs("div",{className:"are-you-sure-buttons",children:[c.jsx("button",{id:"cancel-button",onClick:()=>t(),children:"CANCEL"}),c.jsx("button",{id:"ok-button",onClick:e,children:"SAVE"})]})]})}function wu({a:e,b:t}){const r=e/t*100,n=40,i=2*Math.PI*n,a=i-r/100*i;return c.jsxs("svg",{className:"progress-circle",width:100,height:100,children:[c.jsx("circle",{className:"progress-circle-background",cx:"50",cy:"50",r:n,strokeWidth:"4"}),c.jsx("circle",{className:"progress-circle-progress",cx:"50",cy:"50",r:n,strokeWidth:"4",strokeDasharray:i,strokeDashoffset:a}),c.jsxs("text",{x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle",className:"progress-text",children:[e,"/",t]})]})}const _0="cards/setUserCards",U0="cards/setCurrentCard",H0="card/deleteCard",W0="cards/updateCard",V0="cards/updateCardImage",G0="cards/removeCardTrack",K0="cards/addTracksToCard",Y0="cards/renameCard",q0="cards/updateCardStyles",I4="cards/updateTracklistOrder",Q0="cards/unpublishCard",X0="cards/publishCard",N4=e=>({type:_0,payload:e}),Ts=e=>({type:U0,card:e}),M4=e=>({type:W0,updatedCard:e}),A4=(e,t)=>({type:V0,newImage:e,imgType:t}),L4=e=>({type:G0,trackId:e}),O4=e=>({type:K0,selectedTracks:e}),B4=e=>({type:H0,cardId:e}),F4=(e,t)=>({type:Y0,payload:{cardId:e,title:t}}),z4=(e,t)=>({type:q0,colors:e,font:t}),$4=e=>({type:Q0,cardId:e}),_4=e=>({type:X0,cardId:e}),J0=()=>async e=>{const r=await(await he("/api/cards/current")).json();return e(N4(r)),r},U4=e=>async t=>{const r=await he(`/api/cards/card/${e}`);if(r.ok){const n=await r.json();return t(Ts(n)),n}},H4=(e,t)=>async()=>{const r=await he(`/api/cards/tracklist/${e}`,{method:"PUT",body:JSON.stringify({tracklist:t})});if(!r.ok){const n=await r.json();console.error(n)}},W4=(e,t,r)=>async n=>{const i={column:t,editValue:r},a=await he(`/api/cards/card/${e}`,{method:"PUT",body:JSON.stringify(i)});if(a.ok){const o=await a.json();n(M4(o))}},V4=(e,t,r)=>async n=>{const i=await he(`/api/cards/${e}/images`,{method:"PUT",body:JSON.stringify({imgType:t,imgId:r})});if(i.ok){const a=await i.json(),{newImage:o,imgType:l}=a;n(A4(o,l))}},G4=(e,t)=>async r=>{const i=await(await he(`/api/cards/${e}/${t}`,{method:"DELETE"})).json();r(L4(i.trackId))},K4=(e,t)=>async r=>{(await he(`/api/cards/${e}/tracklist`,{method:"POST",body:JSON.stringify({selectedTracks:t})})).ok&&r(O4(t))},Y4=e=>async t=>{const r=await he("/api/cards",{method:"POST",body:JSON.stringify({title:e})});if(r.ok){const n=await r.json();return t(Ts(n)),n}},q4=e=>async t=>{(await he(`/api/cards/${e}`,{method:"DELETE"})).ok&&t(B4(e))},Q4=(e,t)=>async r=>{(await he(`/api/cards/${e}/rename`,{method:"PUT",body:JSON.stringify({title:t})})).ok&&r(F4(e,t))},X4=(e,t,r)=>async n=>{(await he(`/api/cardstyles/${e}`,{method:"PUT",body:JSON.stringify({colors:t,font:r})})).ok&&n(z4(t,r))},J4=e=>async t=>{const r=await he(`/api/cards/preview/${e}`);if(r.ok){const n=await r.json();return t(Ts(n)),n}},Z0=(e,t)=>async r=>{const n=await he(`/api/cards/publish/${e}`,{method:"PUT",body:JSON.stringify({privateToken:t})});if(n.ok){const i=await n.json();return r(_4(e)),i}},Z4=e=>async t=>{const r=await he(`/api/cards/${e}`);if(r.ok){const n=await r.json();return t(Ts(n)),n}},e3=e=>async t=>{const r=await he(`/api/cards/unpublish/${e}`,{method:"PUT"});if(r.ok){const n=await r.json();return t($4(e)),n}},t3={userCards:[]},r3=(e=t3,t)=>{switch(t.type){case _0:return{...e,userCards:t.payload.userCards};case U0:return{...e,currentCard:t.card};case W0:{const{updatedCard:r}=t;let n={...e},i={...n.currentCard,...r};return delete n.currentCard,n.currentCard=i,n}case V0:{const{imgType:r,newImage:n}=t;let i={...e};return r==="banner"&&(delete i.currentCard.Banner,i.currentCard.Banner=n),r==="headshot"&&(delete i.currentCard.Headshot,i.currentCard.Headshot=n),r==="profile"&&(delete i.currentCard.ProfilePic,i.currentCard.ProfilePic=n),i}case G0:{const{trackId:r}=t;let n={...e},i=n.currentCard.Tracks.filter(a=>a.id!==Number(r));return delete n.currentCard.Tracks,n.currentCard.Tracks=i,n}case K0:{const{selectedTracks:r}=t,n=Object.values(r);return{...e,currentCard:{...e.currentCard,Tracks:[...e.currentCard.Tracks,...n]}}}case H0:{const{cardId:r}=t;return{...e,userCards:e.userCards.filter(n=>n.id!==Number(r))}}case Y0:{const{cardId:r,title:n}=t.payload;return{...e,userCards:e.userCards.map(i=>(i.id===r&&(i.title=n),i))}}case q0:{const{colors:r,font:n}=t;return{...e,currentCard:{...e.currentCard,CardColor:r,CardFont:n}}}case I4:{const{tracklist:r}=t;return{...e,currentCard:{...e.currentCard,Tracks:[...r]}}}case Q0:{const{cardId:r}=t;return{...e,userCards:e.userCards.map(n=>(n.id===r&&(n.isActive=!1,n.updatedAt=new Date().toISOString()),n))}}case X0:{const{cardId:r}=t;return{...e,userCards:e.userCards.map(n=>(n.id===r&&(n.isActive=!0,n.updatedAt=new Date().toISOString()),n))}}default:return e}};function n3(){const e=dr(),t=ze(),r=Ie(w=>w.session.user),n=Ie(w=>w.catalog.userTracks),i=Ie(w=>w.images.userImages),a=Ie(w=>w.cards.userCards),[o,l]=x.useState(!1),[s,u]=x.useState(),[f,d]=x.useState(),[p,h]=x.useState(),[v,b]=x.useState();if(x.useEffect(()=>{t(sf()),t(J0()),t(lf()).then(()=>{l(!0)})},[r,t]),x.useEffect(()=>{if(n&&Array.isArray(n)&&h(n.length),i&&Array.isArray(i)&&b(i.length),a&&Array.isArray(a)){u(a.length);let w=a.reduce((y,g)=>g.isActive?y+=1:y,0);d(w)}},[n,i,a]),o)return c.jsxs("div",{className:"dashboard-grid",children:[c.jsxs("div",{className:"dashboard-card",onClick:()=>e("/cards"),children:[c.jsx(wu,{a:f,b:s}),c.jsxs("div",{className:"card-content",children:[c.jsx(p4,{size:40,className:"icon"}),c.jsx("p",{children:"Active Cards"})]})]}),c.jsxs("div",{className:"dashboard-card",onClick:()=>e("/catalog"),children:[c.jsx(wu,{a:p,b:100}),c.jsxs("div",{className:"card-content",children:[c.jsx(v4,{size:40,className:"icon"}),c.jsx("p",{children:"Tracks"})]})]}),c.jsxs("div",{className:"dashboard-card",onClick:()=>e("/images"),children:[c.jsx(wu,{a:v,b:100}),c.jsxs("div",{className:"card-content",children:[c.jsx(h4,{size:40,className:"icon"}),c.jsx("p",{children:"Images"})]})]})]})}const e1="externalLinks/setExternalLinks",t1="externalLinks/addExternalLink",r1="externalLinks/deleteExternalLink",i3=e=>({type:e1,links:e}),a3=e=>({type:t1,newLink:e}),o3=e=>({type:r1,linkId:e}),l3=()=>async e=>{const t=await he("/api/links");if(t.ok){const r=await t.json();e(i3(r))}},s3=e=>async t=>{const r=await he("/api/links/",{method:"POST",body:JSON.stringify({url:e})});if(r.ok){const n=await r.json();t(a3(n.newExternalLink))}else return r.json()},u3=e=>async t=>{const r=await he(`/api/links/${e}`,{method:"DELETE"});if(r.ok)t(o3(e));else return r.json()},c3={},d3=(e=c3,t)=>{switch(t.type){case e1:return{...e,linksArray:[...t.links]};case t1:return{...e,linksArray:[...e.linksArray,t.newLink]};case r1:return{...e,linksArray:e.linksArray.filter(r=>r.id!==t.linkId)};default:return e}};function f3(e){return le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z"},child:[]}]})(e)}function p3(e){return le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM224 192V320c0 17.7-14.3 32-32 32s-32-14.3-32-32V192c0-17.7 14.3-32 32-32s32 14.3 32 32zm128 0V320c0 17.7-14.3 32-32 32s-32-14.3-32-32V192c0-17.7 14.3-32 32-32s32 14.3 32 32z"},child:[]}]})(e)}function h3(e){return le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM188.3 147.1c-7.6 4.2-12.3 12.3-12.3 20.9V344c0 8.7 4.7 16.7 12.3 20.9s16.8 4.1 24.3-.5l144-88c7.1-4.4 11.5-12.1 11.5-20.5s-4.4-16.1-11.5-20.5l-144-88c-7.4-4.5-16.7-4.7-24.3-.5z"},child:[]}]})(e)}function v3(e){return le({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M73 39c-14.8-9.1-33.4-9.4-48.5-.9S0 62.6 0 80V432c0 17.4 9.4 33.4 24.5 41.9s33.7 8.1 48.5-.9L361 297c14.3-8.7 23-24.2 23-41s-8.7-32.2-23-41L73 39z"},child:[]}]})(e)}function n1({externalLinks:e,waveformColor:t}){return c.jsx("div",{id:"external-links-bar",children:e==null?void 0:e.map(r=>c.jsx(i1,{url:r.url,waveformColor:t},r.id))})}const i1=({url:e,waveformColor:t})=>{if(e.includes("imdb"))return c.jsx(yt,{to:e,className:"external-link-icon",target:"_blank",rel:"noopener noreferrer external",children:c.jsx(s4,{color:t})});if(e.includes("instagram"))return c.jsx(yt,{to:e,className:"external-link-icon",target:"_blank",rel:"noopener noreferrer external",children:c.jsx(u4,{color:t})});if(e.includes("facebook"))return c.jsx(yt,{to:e,className:"external-link-icon",target:"_blank",rel:"noopener noreferrer external",children:c.jsx(l4,{color:t})});if(e.includes("linkedin"))return c.jsx(yt,{to:e,className:"external-link-icon",target:"_blank",rel:"noopener noreferrer external",children:c.jsx(c4,{color:t})});if(e.includes("x"))return c.jsx(yt,{to:e,className:"external-link-icon",target:"_blank",rel:"noopener noreferrer external",children:c.jsx(f3,{color:t})})};function g3(){const e=Ie(s=>s.links.linksArray),t=ze(),[r,n]=x.useState(""),[i,a]=x.useState({});x.useEffect(()=>{t(l3())},[t]);const o=()=>{t(s3(r)).then(()=>n("")).catch(async s=>{a({});const u=await s.json();a({...u.errors})})},l=s=>{t(u3(s)).then(()=>n("")).then(a({}))};return c.jsxs("div",{className:"external-links-form-container",children:[c.jsx("h3",{children:"Social Media Links"}),c.jsx("div",{className:"subtitle-text",children:c.jsx("p",{children:"Add your socials to be displayed by default in all the cards. Currently supported links: Instagram, Imdb, Facebook, Twitter, and Linkedin"})}),c.jsxs("div",{className:"form-and-button-container",children:[c.jsxs("form",{children:[c.jsxs("fieldset",{children:[c.jsx("legend",{children:"External Url"}),c.jsx("label",{htmlFor:"external-url",children:c.jsx("input",{type:"url",value:r,onChange:s=>n(s.target.value)})})]}),i.url&&c.jsx("p",{className:"error-p",children:i.url})]}),c.jsx(Mc,{onClick:o})]}),c.jsx("div",{className:"external-links-list",children:(e==null?void 0:e.length)>0&&(e==null?void 0:e.map(s=>c.jsxs("div",{className:"external-link-row",children:[c.jsxs("div",{children:[c.jsx(i1,{url:s.url,waveformColor:"#BD1792"}),c.jsx("p",{children:s.url})]}),c.jsx(EC,{size:15,style:{cursor:"pointer",color:"red",filter:"grayscale(50%)"},onClick:()=>l(s.id)})]},s.id)))}),!(e!=null&&e.length)&&c.jsx("div",{className:"no-items-message-container",children:c.jsx("p",{className:"no-items-message",children:"You don't have any links yet"})})]})}function m3(){return c.jsxs("div",{id:"dashboard-container",children:[c.jsx("div",{className:"page-title-content",children:c.jsx("div",{className:"page-title-container",children:c.jsx("p",{children:"Dashboard"})})}),c.jsxs("div",{className:"dashboard-row-layout",children:[c.jsx(n3,{}),c.jsx(g3,{})]}),c.jsx("div",{children:c.jsx(R4,{})})]})}function y3({img:e,closeModal:t}){return c.jsxs("div",{className:"expanded-image-container",children:[c.jsx("span",{className:"expanded-image-close",onClick:()=>t(),children:c.jsx(y0,{})}),c.jsx("img",{src:e.url,alt:e.name})]})}function x3(){const{setModalContent:e,closeModal:t}=fr(),r=Ie(j=>j.session.user),n=Ie(j=>j.images.userImages),i=ze(),[a,o]=x.useState(!1),[l,s]=x.useState();x.useEffect(()=>{i(sf()).then(()=>{o(!0)})},[r,i]);const u=j=>{i(i4(j)),C(!1)},f=async j=>{const S=j.target.files;S.length>=1&&(s(!0),(await i(O0(S,r.id))).ok&&s(!1))},[d,p]=x.useState(),[h,v]=x.useState(),[b,w]=x.useState(),[y,g]=x.useState(),[m,C]=x.useState(!1),D=x.useRef(),P=(j,S,T)=>{j.stopPropagation(),w(j.clientX),g(j.clientY+15),p(S),v(T),C(!0)};return x.useEffect(()=>{const j=S=>{D.current.contains(S.target)||C(!1)};return m&&document.addEventListener("click",j),()=>document.removeEventListener("click",j)},[m]),c.jsxs("div",{id:"images-container",children:[c.jsx("div",{className:"page-title-container",children:c.jsxs("div",{className:"page-title-content",children:[c.jsx("p",{id:"page-title",children:"Images"}),c.jsx("div",{className:"gradient-button-background",children:c.jsx(b3,{handleUploadImages:f,uploading:l})})]})}),(n==null?void 0:n.length)>=1&&c.jsxs("div",{className:"image-grid",children:[a&&(n==null?void 0:n.map(j=>c.jsxs("div",{className:"image-item",onClick:()=>e(c.jsx(y3,{img:j,closeModal:t})),children:[c.jsx("img",{src:j.url,alt:j.name}),c.jsxs("div",{id:"name-options-container",children:[c.jsx("p",{children:j.name.split(".")[0]}),c.jsx("span",{children:c.jsx(bC,{size:18,id:"menu-icon",onClick:S=>P(S,j.id,j.name)})})]})]},j.id))),l&&c.jsx("div",{style:{textAlign:"center",margin:"1em",display:"flex",justifyContent:"center",alignItems:"center",gap:"1em"},children:c.jsx(Rs,{size:50,className:"colored"})})]}),!(n!=null&&n.length)&&c.jsx("div",{style:{padding:"64px"},children:c.jsxs("p",{className:"no-items-message-container",children:["You don't have any Images yet. ",c.jsxs("span",{children:["Click the icon ",c.jsx(On,{})," to upload images and customize your cards"]})]})}),c.jsx(w3,{handleDeleteImage:u,imageId:d,imageName:h,showMenu:m,menuRef:D,x:b,y})]})}function b3({handleUploadImages:e,uploading:t}){const r=x.useRef(null),n=()=>{r.current&&r.current.click()};if(!t)return c.jsxs("div",{children:[c.jsx("input",{type:"file",accept:".jpg,.png,.webp",multiple:!0,onChange:e,ref:r,style:{display:"none"}}),c.jsxs("button",{onClick:n,className:"upload-icon",children:[c.jsx("span",{children:"UPLOAD IMAGES"}),c.jsx("span",{children:c.jsx(On,{size:20,className:"colored"})})]})]})}function w3({imageId:e,imageName:t,x:r,y:n,menuRef:i,showMenu:a,handleDeleteImage:o}){const{setModalContent:l,closeModal:s}=fr();return c.jsxs("div",{className:"options-container",style:{display:a?"flex":"none",position:"fixed",top:n,left:r},ref:i,children:[c.jsxs("div",{style:{cursor:"pointer"},onClick:()=>l(c.jsx(B0,{id:e,title:t,type:"Image",closeModal:s})),children:[c.jsx(uf,{}),"Rename"]}),c.jsxs("div",{style:{color:"#e22847",cursor:"pointer"},onClick:()=>o(e),children:[c.jsx(js,{}),"Delete"]})]})}function a1({navigate:e,action:t,cardTitle:r="",cardId:n}){const{closeModal:i}=fr(),[a,o]=x.useState(r),[l,s]=x.useState(!0),u=ze();x.useEffect(()=>{a.length>2?s(!1):s(!0)},[a]);const f=()=>{u(Y4(a)).then(p=>{e(`/cards/${p.id}`)}).then(()=>i())},d=()=>{u(Q4(n,a)).then(()=>i())};return c.jsxs("div",{id:"title-modal-content",children:[c.jsx("h4",{children:"Enter a title for your Card "}),c.jsxs("fieldset",{children:[c.jsx("legend",{children:"Card title: "}),c.jsx("input",{type:"text",value:a,onChange:p=>o(p.target.value)})]}),c.jsxs("div",{className:"title-modal-buttons",children:[c.jsx("button",{id:"title-modal-cancel-button",onClick:i,children:"CANCEL"}),t==="create"&&c.jsx("button",{id:"ok-button",onClick:f,disabled:l,style:l?{cursor:"not-allowed"}:{cursor:"pointer"},children:"CREATE"}),t==="rename"&&c.jsx("button",{id:"ok-button",onClick:d,disabled:l,style:l?{cursor:"not-allowed"}:{cursor:"pointer"},children:"RENAME"})]})]})}function S3(e){return le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M17.77 3.77 16 2 6 12l10 10 1.77-1.77L9.54 12z"},child:[]}]})(e)}function C3(e){return le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M18.6 19.5H21v2h-6v-6h2v2.73c1.83-1.47 3-3.71 3-6.23 0-4.07-3.06-7.44-7-7.93V2.05c5.05.5 9 4.76 9 9.95 0 2.99-1.32 5.67-3.4 7.5zM4 12c0-2.52 1.17-4.77 3-6.23V8.5h2v-6H3v2h2.4A9.966 9.966 0 0 0 2 12c0 5.19 3.95 9.45 9 9.95v-2.02c-3.94-.49-7-3.86-7-7.93zm12.24-3.89-5.66 5.66-2.83-2.83-1.41 1.41 4.24 4.24 7.07-7.07-1.41-1.41z"},child:[]}]})(e)}function E3(e){return le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M7.94 5.12 6.49 3.66A9.91 9.91 0 0 1 12 2c5.52 0 10 4.48 10 10 0 2.04-.61 3.93-1.66 5.51l-1.46-1.46A7.869 7.869 0 0 0 20 12c0-4.41-3.59-8-8-8-1.48 0-2.86.41-4.06 1.12zm9.72 4.41-1.41-1.41-2.65 2.65 1.41 1.41 2.65-2.65zm2.12 13.08-2.27-2.27A9.91 9.91 0 0 1 12 22C6.48 22 2 17.52 2 12c0-2.04.61-3.93 1.66-5.51L1.39 4.22 2.8 2.81l18.38 18.38-1.4 1.42zm-3.72-3.73L12.18 15l-1.59 1.59-4.24-4.24 1.41-1.41 2.83 2.83.18-.18-5.65-5.65A7.932 7.932 0 0 0 4 12c0 4.41 3.59 8 8 8 1.48 0 2.86-.41 4.06-1.12z"},child:[]}]})(e)}function o1(e){return le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M14 10H3v2h11v-2zm0-4H3v2h11V6zm4 8v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zM3 16h7v-2H3v2z"},child:[]}]})(e)}function D3(e){return le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M24 15c0-2.64-2.05-4.78-4.65-4.96A7.49 7.49 0 0 0 12 4c-1.33 0-2.57.36-3.65.97l1.49 1.49C10.51 6.17 11.23 6 12 6c3.04 0 5.5 2.46 5.5 5.5v.5H19a2.996 2.996 0 0 1 1.79 5.4l1.41 1.41c1.09-.92 1.8-2.27 1.8-3.81zM4.41 3.86 3 5.27l2.77 2.77h-.42A5.994 5.994 0 0 0 0 14c0 3.31 2.69 6 6 6h11.73l2 2 1.41-1.41L4.41 3.86zM6 18c-2.21 0-4-1.79-4-4s1.79-4 4-4h1.73l8 8H6z"},child:[]}]})(e)}function k3({cardId:e,cardTitle:t,isActive:r,x:n,y:i,menuRef:a,showMenu:o,setShowMenu:l}){const s=dr(),u=ze(),{addToast:f}=Ps(),{setModalContent:d,closeModal:p}=fr(),h=b=>{u(q4(b)).then(()=>l(!1))},v=b=>{r&&u(e3(b)).then(()=>l(!1)).then(()=>f("Your card is now private")),r||u(Z0(b)).then(()=>l(!1)).then(()=>f("Your card is now public"))};return c.jsxs("div",{className:"options-container",style:{display:o?"flex":"none",position:"absolute",top:i,left:n},ref:a,children:[c.jsxs("div",{style:{cursor:"pointer"},onClick:()=>d(c.jsx(a1,{action:"rename",cardTitle:t,cardId:e,closeModal:p})),children:[c.jsx(uf,{}),"Rename"]}),c.jsxs("div",{style:{color:"#e22847",cursor:"pointer"},onClick:()=>h(e),children:[c.jsx(js,{}),"Delete"]}),c.jsxs("div",{style:{color:"lightgray",cursor:"pointer"},onClick:()=>s(`/cards/${e}`),children:[c.jsx(sa,{}),"Edit"]}),r?c.jsxs("div",{style:{color:"lightgray",cursor:"pointer"},onClick:()=>v(e),children:[c.jsx(E3,{}),"UnPublish"]}):c.jsxs("div",{style:{color:"lightgray",cursor:"pointer"},onClick:()=>v(e),children:[c.jsx(C3,{}),"Publish"]})]})}function P3({cards:e}){const t=dr();return c.jsxs("div",{className:"card-preview-row-container",children:[c.jsx("p",{id:"card-preview-row-title",children:"Active Cards:"}),c.jsx("div",{className:"card-preview-row",children:e.filter(r=>r.isActive).slice(0,6).map(r=>c.jsx("div",{className:"card-preview-container",onClick:()=>t(`/cards/${r.id}`),children:c.jsx("iframe",{src:`${r.publicUrl}`,title:`Preview of ${r.title}`,className:"card-preview-iframe"})},r.id))})]})}function j3(e){return le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M14.78 3.653a3.936 3.936 0 1 1 5.567 5.567l-3.627 3.627a3.936 3.936 0 0 1-5.88-.353.75.75 0 0 0-1.18.928 5.436 5.436 0 0 0 8.12.486l3.628-3.628a5.436 5.436 0 1 0-7.688-7.688l-3 3a.75.75 0 0 0 1.06 1.061l3-3Z"},child:[]},{tag:"path",attr:{d:"M7.28 11.153a3.936 3.936 0 0 1 5.88.353.75.75 0 0 0 1.18-.928 5.436 5.436 0 0 0-8.12-.486L2.592 13.72a5.436 5.436 0 1 0 7.688 7.688l3-3a.75.75 0 1 0-1.06-1.06l-3 3a3.936 3.936 0 0 1-5.567-5.568l3.627-3.627Z"},child:[]}]})(e)}function R3(e){return le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M7.75 6.5a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5Z"},child:[]},{tag:"path",attr:{d:"M2.5 1h8.44a1.5 1.5 0 0 1 1.06.44l10.25 10.25a1.5 1.5 0 0 1 0 2.12l-8.44 8.44a1.5 1.5 0 0 1-2.12 0L1.44 12A1.497 1.497 0 0 1 1 10.94V2.5A1.5 1.5 0 0 1 2.5 1Zm0 1.5v8.44l10.25 10.25 8.44-8.44L10.94 2.5Z"},child:[]}]})(e)}function T3(){const e=dr(),{setModalContent:t,closeModal:r}=fr(),n=Ie(S=>S.session.user),i=Ie(S=>S.cards.userCards),a=Ie(S=>S.displayInfo),o=ze(),[l,s]=x.useState(),[u,f]=x.useState(),[d,p]=x.useState(),[h,v]=x.useState(),[b,w]=x.useState(),[y,g]=x.useState(),[m,C]=x.useState(!1),D=x.useRef(),P=(S,T,I,L)=>{S.stopPropagation(),w(S.clientX-80),g(S.clientY),f(T),p(I),v(L),C(!0)};x.useEffect(()=>{const S=T=>{D.current.contains(T.target)||C(!1)};return m&&document.addEventListener("click",S),()=>document.removeEventListener("click",S)},[m]),x.useEffect(()=>{o(J0()).then(o($0())).then(()=>{s(!0)})},[n,o]);const j=async()=>{a!=null&&a.name?t(c.jsx(a1,{navigate:e,action:"create"})):t(c.jsx(I3,{navigate:e,closeModal:r}))};return c.jsxs("div",{id:"cards-container",children:[c.jsx("div",{className:"page-title-container",children:c.jsxs("div",{className:"page-title-content",children:[c.jsx("p",{id:"page-title",children:"Cards"}),c.jsxs("button",{className:"upload-icon",onClick:j,children:[c.jsx(Mc,{}),c.jsx("span",{children:"NEW CARD"})]}),c.jsx("div",{className:"gradient-button-background"})]})}),c.jsxs("div",{className:"table-card-previews-container",children:[c.jsxs("div",{children:[c.jsxs("table",{className:"cards-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Active"}),c.jsx("th",{children:"Title"}),c.jsx("th",{children:"Live Link"}),c.jsx("th",{children:"Created"}),c.jsx("th",{children:"Updated"}),c.jsx("th",{})]})}),(i==null?void 0:i.length)>=1&&Array.isArray(i)&&c.jsx("tbody",{children:l&&i.map(S=>c.jsxs("tr",{children:[c.jsx("td",{children:S.isActive?c.jsx(j4,{}):c.jsx(D3,{})}),c.jsx("td",{children:c.jsx(Un,{className:"card-link",id:"navlink-to-card-details",to:`/cards/${S.id}`,children:S.title||"Untitled"})}),c.jsx("td",{children:c.jsx("a",{className:"card-link",id:"navlink-to-public-url",href:S.publicUrl,target:"_blank",rel:"noopener noreferrer",children:c.jsx(j3,{})})}),c.jsx("td",{children:Ac(S.createdAt)}),c.jsx("td",{children:Ac(S.updatedAt)}),c.jsx("td",{children:c.jsx(Fc,{id:"track-menu-icon",onClick:T=>P(T,S.id,S.title,S.isActive)})})]},S.id))})]}),!i.length&&c.jsx(c.Fragment,{children:c.jsxs("p",{className:"no-items-message-container",children:["You don't have any Cards created yet. ",c.jsxs("span",{children:["Click the icon ",c.jsx(Mc,{})," to start creating."]})]})})]}),c.jsx(P3,{cards:i})]}),c.jsx(k3,{cardId:u,cardTitle:d,isActive:h,setShowMenu:C,showMenu:m,menuRef:D,x:b,y})]})}function I3({navigate:e,closeModal:t}){const r=()=>{e("/dashboard"),t()};return c.jsxs("p",{style:{color:"white",textAlign:"center",padding:"20px",filter:"grayscale(20%)"},children:["Please complete your ",c.jsx("br",{}),c.jsx("em",{children:"Display Information "}),c.jsx("br",{}),"on the ",c.jsx("span",{onClick:r,style:{cursor:"pointer"},children:c.jsx("u",{children:c.jsx("strong",{children:"Dashboard"})})})," first"]})}class N3{constructor(){this.listeners={}}on(t,r,n){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(r),n==null?void 0:n.once){const i=()=>{this.un(t,i),this.un(t,r)};return this.on(t,i),i}return()=>this.un(t,r)}un(t,r){var n;(n=this.listeners[t])===null||n===void 0||n.delete(r)}once(t,r){return this.on(t,r,{once:!0})}unAll(){this.listeners={}}emit(t,...r){this.listeners[t]&&this.listeners[t].forEach(n=>n(...r))}}let M3=class extends N3{constructor(t){super(),this.subscriptions=[],this.options=t}onInit(){}_init(t){this.wavesurfer=t,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(t=>t())}};function l1(e,t){const r=t.xmlns?document.createElementNS(t.xmlns,e):document.createElement(e);for(const[n,i]of Object.entries(t))if(n==="children")for(const[a,o]of Object.entries(t))typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(l1(a,o));else n==="style"?Object.assign(r.style,i):n==="textContent"?r.textContent=i:r.setAttribute(n,i.toString());return r}function Mh(e,t,r){const n=l1(e,t||{});return r==null||r.appendChild(n),n}const A3={lineWidth:1,labelSize:11,formatTimeCallback:e=>`${Math.floor(e/60)}:${`0${Math.floor(e)%60}`.slice(-2)}`};let L3=class s1 extends M3{constructor(t){super(t||{}),this.unsubscribe=()=>{},this.onPointerMove=r=>{if(!this.wavesurfer)return;const n=this.wavesurfer.getWrapper().getBoundingClientRect(),{width:i}=n,a=r.clientX-n.left,o=Math.min(1,Math.max(0,a/i)),l=Math.min(i-this.options.lineWidth-1,a);this.wrapper.style.transform=`translateX(${l}px)`,this.wrapper.style.opacity="1";const s=this.wavesurfer.getDuration()||0;this.label.textContent=this.options.formatTimeCallback(s*o);const u=this.label.offsetWidth;this.label.style.transform=l+u>i?`translateX(-${u+this.options.lineWidth}px)`:"",this.emit("hover",o)},this.onPointerLeave=()=>{this.wrapper.style.opacity="0"},this.options=Object.assign({},A3,t),this.wrapper=Mh("div",{part:"hover"}),this.label=Mh("span",{part:"hover-label"},this.wrapper)}static create(t){return new s1(t)}addUnits(t){return`${t}${typeof t=="number"?"px":""}`}onInit(){if(!this.wavesurfer)throw Error("WaveSurfer is not initialized");const t=this.wavesurfer.options,r=this.options.lineColor||t.cursorColor||t.progressColor;Object.assign(this.wrapper.style,{position:"absolute",zIndex:10,left:0,top:0,height:"100%",pointerEvents:"none",borderLeft:`${this.addUnits(this.options.lineWidth)} solid ${r}`,opacity:"0",transition:"opacity .1s ease-in"}),Object.assign(this.label.style,{display:"block",backgroundColor:this.options.labelBackground,color:this.options.labelColor,fontSize:`${this.addUnits(this.options.labelSize)}`,transition:"transform .1s ease-in",padding:"2px 3px"});const n=this.wavesurfer.getWrapper();n.appendChild(this.wrapper),n.addEventListener("pointermove",this.onPointerMove),n.addEventListener("pointerleave",this.onPointerLeave),n.addEventListener("wheel",this.onPointerMove),this.unsubscribe=()=>{n.removeEventListener("pointermove",this.onPointerMove),n.removeEventListener("pointerleave",this.onPointerLeave),n.removeEventListener("wheel",this.onPointerLeave)}}destroy(){super.destroy(),this.unsubscribe(),this.wrapper.remove()}};function Tl(e){"@babel/helpers - typeof";return Tl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tl(e)}var O3=/^\s+/,B3=/\s+$/;function G(e,t){if(e=e||"",t=t||{},e instanceof G)return e;if(!(this instanceof G))return new G(e,t);var r=F3(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}G.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),r,n,i,a,o,l;return r=t.r/255,n=t.g/255,i=t.b/255,r<=.03928?a=r/12.92:a=Math.pow((r+.055)/1.055,2.4),n<=.03928?o=n/12.92:o=Math.pow((n+.055)/1.055,2.4),i<=.03928?l=i/12.92:l=Math.pow((i+.055)/1.055,2.4),.2126*a+.7152*o+.0722*l},setAlpha:function(t){return this._a=u1(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=Lh(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=Lh(this._r,this._g,this._b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.v*100);return this._a==1?"hsv("+r+", "+n+"%, "+i+"%)":"hsva("+r+", "+n+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var t=Ah(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=Ah(this._r,this._g,this._b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.l*100);return this._a==1?"hsl("+r+", "+n+"%, "+i+"%)":"hsla("+r+", "+n+"%, "+i+"%, "+this._roundA+")"},toHex:function(t){return Oh(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return U3(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(Re(this._r,255)*100)+"%",g:Math.round(Re(this._g,255)*100)+"%",b:Math.round(Re(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(Re(this._r,255)*100)+"%, "+Math.round(Re(this._g,255)*100)+"%, "+Math.round(Re(this._b,255)*100)+"%)":"rgba("+Math.round(Re(this._r,255)*100)+"%, "+Math.round(Re(this._g,255)*100)+"%, "+Math.round(Re(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:eE[Oh(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var r="#"+Bh(this._r,this._g,this._b,this._a),n=r,i=this._gradientType?"GradientType = 1, ":"";if(t){var a=G(t);n="#"+Bh(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+r+",endColorstr="+n+")"},toString:function(t){var r=!!t;t=t||this._format;var n=!1,i=this._a<1&&this._a>=0,a=!r&&i&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return a?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(n=this.toRgbString()),t==="prgb"&&(n=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(n=this.toHexString()),t==="hex3"&&(n=this.toHexString(!0)),t==="hex4"&&(n=this.toHex8String(!0)),t==="hex8"&&(n=this.toHex8String()),t==="name"&&(n=this.toName()),t==="hsl"&&(n=this.toHslString()),t==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return G(this.toString())},_applyModification:function(t,r){var n=t.apply(null,[this].concat([].slice.call(r)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(G3,arguments)},brighten:function(){return this._applyModification(K3,arguments)},darken:function(){return this._applyModification(Y3,arguments)},desaturate:function(){return this._applyModification(H3,arguments)},saturate:function(){return this._applyModification(W3,arguments)},greyscale:function(){return this._applyModification(V3,arguments)},spin:function(){return this._applyModification(q3,arguments)},_applyCombination:function(t,r){return t.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(J3,arguments)},complement:function(){return this._applyCombination(Q3,arguments)},monochromatic:function(){return this._applyCombination(Z3,arguments)},splitcomplement:function(){return this._applyCombination(X3,arguments)},triad:function(){return this._applyCombination(Fh,[3])},tetrad:function(){return this._applyCombination(Fh,[4])}};G.fromRatio=function(e,t){if(Tl(e)=="object"){var r={};for(var n in e)e.hasOwnProperty(n)&&(n==="a"?r[n]=e[n]:r[n]=Ji(e[n]));e=r}return G(e,t)};function F3(e){var t={r:0,g:0,b:0},r=1,n=null,i=null,a=null,o=!1,l=!1;return typeof e=="string"&&(e=iE(e)),Tl(e)=="object"&&(xr(e.r)&&xr(e.g)&&xr(e.b)?(t=z3(e.r,e.g,e.b),o=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):xr(e.h)&&xr(e.s)&&xr(e.v)?(n=Ji(e.s),i=Ji(e.v),t=_3(e.h,n,i),o=!0,l="hsv"):xr(e.h)&&xr(e.s)&&xr(e.l)&&(n=Ji(e.s),a=Ji(e.l),t=$3(e.h,n,a),o=!0,l="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=u1(r),{ok:o,format:e.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}function z3(e,t,r){return{r:Re(e,255)*255,g:Re(t,255)*255,b:Re(r,255)*255}}function Ah(e,t,r){e=Re(e,255),t=Re(t,255),r=Re(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),a,o,l=(n+i)/2;if(n==i)a=o=0;else{var s=n-i;switch(o=l>.5?s/(2-n-i):s/(n+i),n){case e:a=(t-r)/s+(t1&&(d-=1),d<1/6?u+(f-u)*6*d:d<1/2?f:d<2/3?u+(f-u)*(2/3-d)*6:u}if(t===0)n=i=a=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),i=o(s,l,e),a=o(s,l,e-1/3)}return{r:n*255,g:i*255,b:a*255}}function Lh(e,t,r){e=Re(e,255),t=Re(t,255),r=Re(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),a,o,l=n,s=n-i;if(o=n===0?0:s/n,n==i)a=0;else{switch(n){case e:a=(t-r)/s+(t>1)+720)%360;--t;)n.h=(n.h+i)%360,a.push(G(n));return a}function Z3(e,t){t=t||6;for(var r=G(e).toHsv(),n=r.h,i=r.s,a=r.v,o=[],l=1/t;t--;)o.push(G({h:n,s:i,v:a})),a=(a+l)%1;return o}G.mix=function(e,t,r){r=r===0?0:r||50;var n=G(e).toRgb(),i=G(t).toRgb(),a=r/100,o={r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a};return G(o)};G.readability=function(e,t){var r=G(e),n=G(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)};G.isReadable=function(e,t,r){var n=G.readability(e,t),i,a;switch(a=!1,i=aE(r),i.level+i.size){case"AAsmall":case"AAAlarge":a=n>=4.5;break;case"AAlarge":a=n>=3;break;case"AAAsmall":a=n>=7;break}return a};G.mostReadable=function(e,t,r){var n=null,i=0,a,o,l,s;r=r||{},o=r.includeFallbackColors,l=r.level,s=r.size;for(var u=0;ui&&(i=a,n=G(t[u]));return G.isReadable(e,n,{level:l,size:s})||!o?n:(r.includeFallbackColors=!1,G.mostReadable(e,["#fff","#000"],r))};var zc=G.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},eE=G.hexNames=tE(zc);function tE(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}function u1(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Re(e,t){rE(e)&&(e="100%");var r=nE(e);return e=Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function Is(e){return Math.min(1,Math.max(0,e))}function Et(e){return parseInt(e,16)}function rE(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function nE(e){return typeof e=="string"&&e.indexOf("%")!=-1}function er(e){return e.length==1?"0"+e:""+e}function Ji(e){return e<=1&&(e=e*100+"%"),e}function c1(e){return Math.round(parseFloat(e)*255).toString(16)}function zh(e){return Et(e)/255}var qt=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",r="(?:"+t+")|(?:"+e+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function xr(e){return!!qt.CSS_UNIT.exec(e)}function iE(e){e=e.replace(O3,"").replace(B3,"").toLowerCase();var t=!1;if(zc[e])e=zc[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=qt.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=qt.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=qt.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=qt.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=qt.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=qt.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=qt.hex8.exec(e))?{r:Et(r[1]),g:Et(r[2]),b:Et(r[3]),a:zh(r[4]),format:t?"name":"hex8"}:(r=qt.hex6.exec(e))?{r:Et(r[1]),g:Et(r[2]),b:Et(r[3]),format:t?"name":"hex"}:(r=qt.hex4.exec(e))?{r:Et(r[1]+""+r[1]),g:Et(r[2]+""+r[2]),b:Et(r[3]+""+r[3]),a:zh(r[4]+""+r[4]),format:t?"name":"hex8"}:(r=qt.hex3.exec(e))?{r:Et(r[1]+""+r[1]),g:Et(r[2]+""+r[2]),b:Et(r[3]+""+r[3]),format:t?"name":"hex"}:!1}function aE(e){var t,r;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:t,size:r}}const d1=({audioUrl:e,waveformColor:t})=>{const r=x.useRef(),[n,i]=x.useState(),[a,o]=x.useState(),{wavesurfer:l,isReady:s,isPlaying:u,currentTime:f}=R0({container:r,height:100,autoplay:!1,waveColor:t||"#EB3678",progressColor:G(t).darken(10).toString()||"rgb(100, 0, 100)",url:e,plugins:x.useMemo(()=>[L3.create({lineColor:G(t).lighten(20).toString()||"rgb(100, 0, 100)",lineWidth:2,labelBackground:"#555",labelColor:"#fff",labelSize:"11px"})],[t])});x.useEffect(()=>{l&&l.on("interaction",()=>{l.play()})},[l]);const d=x.useCallback(()=>{l&&l.playPause()},[l]);return x.useEffect(()=>{l&&s&&i(l.getDuration())},[l,s]),x.useEffect(()=>{l&&l.on("loading",p=>{o(p)})},[l,a]),c.jsxs(c.Fragment,{children:[a<100&&c.jsxs("div",{className:"card-loading-bar-container",style:{width:"50%",backgroundColor:"lightgray",height:"20px",display:"flex",alignItems:"center",margin:"50px auto",borderRadius:"20px"},children:[c.jsx("div",{style:{position:"absolute",display:"flex",justifyContent:"center",padding:"0 10px",fontSize:"0.8rem",color:"black"}}),c.jsx("div",{className:"card-loading-bar",style:{width:`${a}%`,backgroundColor:t||"#EB3678",filter:"grayscale(20%) brightness(1.2)",height:"60%",borderRadius:"20px",transition:"width 0.2s"}})]}),c.jsx("div",{id:"card-details-waveform-container",children:c.jsx("div",{id:"card-waveform",className:s?"":"hidden",ref:r})}),s&&c.jsxs("div",{className:"card-player-controls",style:{color:t},children:[c.jsx("span",{id:"card-player-playpause",onClick:d,children:u?c.jsx(p3,{size:40}):c.jsx(h3,{size:40})}),c.jsxs("span",{id:"card-player-timeline",children:[Rl(f)," / ",Rl(n)]})]})]})};function $c(e,t){return $c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},$c(e,t)}function f1(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,$c(e,t)}function Ia(e){"@babel/helpers - typeof";return Ia=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ia(e)}function oE(e,t){if(Ia(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ia(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lE(e){var t=oE(e,"string");return Ia(t)=="symbol"?t:t+""}function sE(e,t,r){return(t=lE(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _h(e){for(var t=1;t"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(rt(1));return r(cf)(e,t)}if(typeof e!="function")throw new Error(rt(2));var i=e,a=t,o=[],l=o,s=!1;function u(){l===o&&(l=o.slice())}function f(){if(s)throw new Error(rt(3));return a}function d(b){if(typeof b!="function")throw new Error(rt(4));if(s)throw new Error(rt(5));var w=!0;return u(),l.push(b),function(){if(w){if(s)throw new Error(rt(6));w=!1,u();var g=l.indexOf(b);l.splice(g,1),o=null}}}function p(b){if(!uE(b))throw new Error(rt(7));if(typeof b.type>"u")throw new Error(rt(8));if(s)throw new Error(rt(9));try{s=!0,a=i(a,b)}finally{s=!1}for(var w=o=l,y=0;y"u")throw new Error(rt(12));if(typeof r(void 0,{type:Il.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(rt(13))})}function dE(e){for(var t=Object.keys(e),r={},n=0;n"u")throw u&&u.type,new Error(rt(14));d[h]=w,f=f||w!==b}return f=f||a.length!==Object.keys(s).length,f?d:s}}function Hh(e,t){return function(){return t(e.apply(this,arguments))}}function Wh(e,t){if(typeof e=="function")return Hh(e,t);if(typeof e!="object"||e===null)throw new Error(rt(16));var r={};for(var n in e){var i=e[n];typeof i=="function"&&(r[n]=Hh(i,t))}return r}function p1(){for(var e=arguments.length,t=new Array(e),r=0;r$.session.user),t=Ie($=>$.catalog.userTracks),r=ze(),[n,i]=x.useState(),[a,o]=x.useState(),[l,s]=x.useState(),[u,f]=x.useState(),[d,p]=x.useState(),[h,v]=x.useState(!1),b=x.useRef(),[w,y]=x.useState(),[g,m]=x.useState(),[C,D]=x.useState(!1),[P,j]=x.useState(),[S,T]=x.useState(),{addToast:I}=Ps();x.useEffect(()=>{r(lf()).then(()=>{y(!0)})},[e,r]);const L=async $=>{const ae=$.target.files,A=[...ae].map(F=>F.name);ae.length>=1&&(T(A),j(!0),r(C0(ae,e.id)).then(()=>{I("Upload successful!"),j(!1)}).catch(async F=>{const H=await F.json();I(H.error||"Error: There was an error while uploading","error"),j(!1)}))},K=$=>{r(OC($)).then(()=>I("Successfully deleted.")),v(!1)},Q=($,ae)=>{s(ae),m($),D(!0)},X=()=>{C?(D(!1),i(null)):D(!0)},se=($,ae,A)=>{$.stopPropagation(),f($.clientX-80),p($.clientY),o(ae),s(A),v(!0)};return x.useEffect(()=>{const $=ae=>{b.current.contains(ae.target)||v(!1)};return h&&document.addEventListener("click",$),()=>document.removeEventListener("click",$)},[h]),c.jsxs("div",{id:"catalog-container",children:[c.jsx("div",{className:"page-title-container",children:c.jsxs("div",{className:"page-title-content",children:[c.jsx("p",{id:"page-title",children:"Catalog"}),c.jsx("div",{className:"gradient-button-background",children:c.jsx(y4,{handleUploadTracks:L,uploading:P})})]})}),c.jsxs("div",{className:"table-and-player-container",children:[c.jsxs("table",{className:"tracks-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Name"}),c.jsx("th",{}),c.jsx("th",{children:"Duration"}),c.jsx("th",{children:"Uploaded"}),c.jsx("th",{})]})}),t&&Array.isArray(t)&&c.jsxs("tbody",{id:"tracks-tbody",children:[!t.length&&!P&&c.jsx("tr",{children:c.jsx("td",{colSpan:4,style:{textAlign:"center",fontSize:"1.1em"},children:c.jsxs("p",{className:"no-items-message-container",children:[" You don't have any Tracks uploaded yet.",c.jsxs("span",{children:[" Click the icon ",c.jsx(On,{})," to start building your catalog"]})]})})}),P&&S.map($=>c.jsxs("tr",{children:[c.jsx("td",{id:"track-row-play-icon",children:c.jsx("div",{className:"play-background",children:c.jsx(Rs,{className:"loading-icon",size:16})})}),c.jsx("td",{style:{fontStyle:"italic"},children:$}),c.jsx("td",{}),c.jsx("td",{}),c.jsx("td",{children:c.jsx(Fc,{id:"menu-icon",color:"#545b69"})})]},$)),w&&t.toReversed().map($=>c.jsxs("tr",{className:`catalog-track-row ${n==$.id?"active-track":""}`,id:$.id,children:[c.jsx("td",{id:"track-row-play-icon",children:c.jsx("div",{className:"play-background",children:c.jsx(m0,{size:16,onClick:()=>{Q($.filePath,$.title),i($.id)}})})}),c.jsx("td",{children:$.title}),c.jsx("td",{children:E0($.duration)}),c.jsx("td",{children:Ac($.createdAt)}),c.jsx("td",{children:c.jsx(Fc,{id:"menu-icon",color:"#545b69",onClick:ae=>se(ae,$.id,$.title)})})]},$.id))]})]}),C&&c.jsxs("div",{className:"audio-player-container",children:[c.jsxs("div",{className:"title-x-container",children:[c.jsx("span",{id:"audio-player-track-title",children:l}),c.jsx("span",{className:"close-audio-player-x",onClick:X,children:c.jsx(y0,{size:20})})]}),c.jsx("div",{id:"audio-player",style:{display:C?"block":"none"},children:c.jsx(JC,{audioUrl:g})})]})]}),c.jsx(x4,{handleDeleteTrack:K,trackId:a,trackTitle:l,showMenu:h,menuRef:b,x:u,y:d})]})}function y4({handleUploadTracks:e,uploading:t}){const r=x.useRef(null),n=()=>{r.current&&r.current.click()};if(!t)return c.jsxs("div",{children:[c.jsx("input",{type:"file",accept:".wav,.mp3",multiple:!0,onChange:e,ref:r,style:{display:"none"}}),c.jsxs("button",{onClick:n,className:"upload-icon",children:[c.jsx("span",{children:"UPLOAD TRACKS"}),c.jsx("span",{children:c.jsx(On,{size:20})})]})]})}function x4({trackId:e,trackTitle:t,x:r,y:n,menuRef:i,showMenu:a,handleDeleteTrack:o}){const{setModalContent:l,closeModal:s}=fr();return c.jsxs("div",{className:"options-container",style:{display:a?"flex":"none",position:"absolute",top:n,left:r},ref:i,children:[c.jsxs("div",{style:{cursor:"pointer"},onClick:()=>l(c.jsx(B0,{id:e,title:t,type:"Track",closeModal:s})),children:[c.jsx(uf,{}),"Rename"]}),c.jsxs("div",{style:{color:"#e22847",cursor:"pointer"},onClick:()=>o(e),children:[c.jsx(js,{}),"Delete"]})]})}const F0="displayInfo/setDisplayInfo",z0="displayInfo/updateInfo",b4=e=>({type:F0,displayInfo:e}),w4=e=>({type:z0,updatedInfo:e}),$0=()=>async e=>{const t=await he("/api/displayinfo/current");if(t.ok){const r=await t.json();e(b4(r))}},S4=e=>async t=>{const r=await he("/api/displayinfo/current",{method:"POST",body:JSON.stringify({data:e})});if(r.ok){const n=await r.json();t(w4(n))}},C4={},E4=(e=C4,t)=>{switch(t.type){case F0:return{...e,...t.displayInfo};case z0:return{...t.updatedInfo};default:return e}};function D4(e){return le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M272 64h-16c-4.4 0-8 3.6-8 8v72c0 4.4 7.6 8 12 8h12c4.4 0 8-3.6 8-8V72c0-4.4-3.6-8-8-8z"},child:[]},{tag:"path",attr:{d:"M433.9 130.1L382 78.2c-9-9-21.3-14.2-34.1-14.2h-28c-8.8 0-16 7.3-16 16.2v80c0 8.8-7.2 16-16 16H160c-8.8 0-16-7.2-16-16v-80c0-8.8-7.2-16.2-16-16.2H96c-17.6 0-32 14.4-32 32v320c0 17.6 14.4 32 32 32h320c17.6 0 32-14.4 32-32V164c0-12.7-5.1-24.9-14.1-33.9zM322 400.1c0 8.8-8 16-17.8 16H143.8c-9.8 0-17.8-7.2-17.8-16v-96c0-8.8 8-16 17.8-16h160.4c9.8 0 17.8 7.2 17.8 16v96z"},child:[]}]})(e)}function k4(e){return le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M401.4 224h-214l83-79.4c11.9-12.5 11.9-32.7 0-45.2s-31.2-12.5-43.2 0L89 233.4c-6 5.8-9 13.7-9 22.4v.4c0 8.7 3 16.6 9 22.4l138.1 134c12 12.5 31.3 12.5 43.2 0 11.9-12.5 11.9-32.7 0-45.2l-83-79.4h214c16.9 0 30.6-14.3 30.6-32 .1-18-13.6-32-30.5-32z"},child:[]}]})(e)}function P4(e){return le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M168.531 215.469l-29.864 29.864 96 96L448 128l-29.864-29.864-183.469 182.395-66.136-65.062zm236.802 189.864H106.667V106.667H320V64H106.667C83.198 64 64 83.198 64 106.667v298.666C64 428.802 83.198 448 106.667 448h298.666C428.802 448 448 428.802 448 405.333V234.667h-42.667v170.666z"},child:[]}]})(e)}function j4(e){return le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M403.002 217.001C388.998 148.002 328.998 96 256 96c-57.998 0-107.998 32.998-132.998 81.001C63.002 183.002 16 233.998 16 296c0 65.996 53.999 120 120 120h260c55 0 100-45 100-100 0-52.998-40.996-96.001-92.998-98.999zM213.333 362.667L138.667 288l29.864-29.864 44.802 44.802L324.271 192l29.865 29.864-140.803 140.803z"},child:[]}]})(e)}function R4(){const{closeModal:e,setModalContent:t}=fr(),r=ze(),n=Ie(D=>D.displayInfo),[i,a]=x.useState(""),[o,l]=x.useState(""),[s,u]=x.useState(""),[f,d]=x.useState(""),[p,h]=x.useState(""),[v,b]=x.useState(""),[w,y]=x.useState(!1),[g,m]=x.useState(!1);x.useEffect(()=>{r($0()).then(()=>y(!0))},[r]),x.useEffect(()=>{if(n&&w){const{name:D,jobTitle:P,email:j,website:S,phone:T,bio:I}=n;D&&a(D||""),P&&l(P||""),j&&u(j||""),S&&d(S||""),T&&h(T||""),I&&b(I||"")}},[n,w]);const C=D=>{D.preventDefault(),r(S4({name:i,jobTitle:o,email:s,website:f,phone:p,bio:v})).then(()=>e()).then(()=>m(!1))};return x.useEffect(()=>{},[i,o,s,p,v]),c.jsxs("div",{id:"display-information-container",children:[c.jsx("h3",{children:"Display Information"}),c.jsxs("div",{className:"text-and-button",children:[c.jsx("p",{children:"Below are your personal details that will appear by default in all the cards. Any changes made here will affect all other cards (existing and future), unless you've modified the field directly in the card. The modifiable fields are: Job Title and Biographhy."}),c.jsx("span",{children:c.jsx(D4,{id:"save-button",className:g?"active-button":"grayed",size:40,onClick:()=>t(c.jsx(T4,{handleSaveDisplayInfo:C,closeModal:e}))})})]}),c.jsx("div",{className:"personal-info-from-container",children:c.jsxs("form",{children:[c.jsxs("div",{children:[c.jsxs("fieldset",{children:[c.jsx("legend",{children:"Name"}),c.jsx("input",{type:"text",value:i,onChange:D=>{a(D.target.value),m(!0)}})]}),c.jsxs("fieldset",{children:[c.jsx("legend",{children:"Job Title"}),c.jsx("input",{type:"text",value:o,onChange:D=>{l(D.target.value),m(!0)}})]}),c.jsxs("fieldset",{children:[c.jsx("legend",{children:"Email Address"}),c.jsx("input",{type:"text",value:s,onChange:D=>{u(D.target.value),m(!0)}})]}),c.jsxs("fieldset",{children:[c.jsx("legend",{children:"Website Url"}),c.jsx("input",{type:"text",value:f,onChange:D=>{d(D.target.value),m(!0)}})]}),c.jsxs("fieldset",{children:[c.jsx("legend",{children:"Phone"}),c.jsx("input",{type:"text",value:p,onChange:D=>{h(D.target.value),m(!0)}})]})]}),c.jsx("div",{children:c.jsxs("fieldset",{id:"bio-fieldset",children:[c.jsx("legend",{children:"Biography"}),c.jsx("textarea",{rows:"15",value:v,onChange:D=>{b(D.target.value),m(!0)}})]})})]})})]})}function T4({handleSaveDisplayInfo:e,closeModal:t}){return c.jsxs("div",{className:"are-you-sure-container",children:[c.jsx("h3",{children:"Warning:"}),c.jsx("p",{children:"This change will affect all your cards that have this information displayed."}),c.jsx("p",{children:"Are you sure you want to continue?"}),c.jsxs("div",{className:"are-you-sure-buttons",children:[c.jsx("button",{id:"cancel-button",onClick:()=>t(),children:"CANCEL"}),c.jsx("button",{id:"ok-button",onClick:e,children:"SAVE"})]})]})}function wu({a:e,b:t}){const r=e/t*100,n=40,i=2*Math.PI*n,a=i-r/100*i;return c.jsxs("svg",{className:"progress-circle",width:100,height:100,children:[c.jsx("circle",{className:"progress-circle-background",cx:"50",cy:"50",r:n,strokeWidth:"4"}),c.jsx("circle",{className:"progress-circle-progress",cx:"50",cy:"50",r:n,strokeWidth:"4",strokeDasharray:i,strokeDashoffset:a}),c.jsxs("text",{x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle",className:"progress-text",children:[e,"/",t]})]})}const _0="cards/setUserCards",U0="cards/setCurrentCard",H0="card/deleteCard",W0="cards/updateCard",V0="cards/updateCardImage",G0="cards/removeCardTrack",K0="cards/addTracksToCard",Y0="cards/renameCard",q0="cards/updateCardStyles",I4="cards/updateTracklistOrder",Q0="cards/unpublishCard",X0="cards/publishCard",N4=e=>({type:_0,payload:e}),Ts=e=>({type:U0,card:e}),M4=e=>({type:W0,updatedCard:e}),A4=(e,t)=>({type:V0,newImage:e,imgType:t}),L4=e=>({type:G0,trackId:e}),O4=e=>({type:K0,selectedTracks:e}),B4=e=>({type:H0,cardId:e}),F4=(e,t)=>({type:Y0,payload:{cardId:e,title:t}}),z4=(e,t)=>({type:q0,colors:e,font:t}),$4=e=>({type:Q0,cardId:e}),_4=e=>({type:X0,cardId:e}),J0=()=>async e=>{const r=await(await he("/api/cards/current")).json();return e(N4(r)),r},U4=e=>async t=>{const r=await he(`/api/cards/card/${e}`);if(r.ok){const n=await r.json();return t(Ts(n)),n}},H4=(e,t)=>async()=>{const r=await he(`/api/cards/tracklist/${e}`,{method:"PUT",body:JSON.stringify({tracklist:t})});if(!r.ok){const n=await r.json();console.error(n)}},W4=(e,t,r)=>async n=>{const i={column:t,editValue:r},a=await he(`/api/cards/card/${e}`,{method:"PUT",body:JSON.stringify(i)});if(a.ok){const o=await a.json();n(M4(o))}},V4=(e,t,r)=>async n=>{const i=await he(`/api/cards/${e}/images`,{method:"PUT",body:JSON.stringify({imgType:t,imgId:r})});if(i.ok){const a=await i.json(),{newImage:o,imgType:l}=a;n(A4(o,l))}},G4=(e,t)=>async r=>{const i=await(await he(`/api/cards/${e}/${t}`,{method:"DELETE"})).json();r(L4(i.trackId))},K4=(e,t)=>async r=>{(await he(`/api/cards/${e}/tracklist`,{method:"POST",body:JSON.stringify({selectedTracks:t})})).ok&&r(O4(t))},Y4=e=>async t=>{const r=await he("/api/cards",{method:"POST",body:JSON.stringify({title:e})});if(r.ok){const n=await r.json();return t(Ts(n)),n}},q4=e=>async t=>{(await he(`/api/cards/${e}`,{method:"DELETE"})).ok&&t(B4(e))},Q4=(e,t)=>async r=>{(await he(`/api/cards/${e}/rename`,{method:"PUT",body:JSON.stringify({title:t})})).ok&&r(F4(e,t))},X4=(e,t,r)=>async n=>{(await he(`/api/cardstyles/${e}`,{method:"PUT",body:JSON.stringify({colors:t,font:r})})).ok&&n(z4(t,r))},J4=e=>async t=>{const r=await he(`/api/cards/preview/${e}`);if(r.ok){const n=await r.json();return t(Ts(n)),n}},Z0=(e,t)=>async r=>{const n=await he(`/api/cards/publish/${e}`,{method:"PUT",body:JSON.stringify({privateToken:t})});if(n.ok){const i=await n.json();return r(_4(e)),i}},Z4=e=>async t=>{const r=await he(`/api/cards/${e}`);if(r.ok){const n=await r.json();return t(Ts(n)),n}},e3=e=>async t=>{const r=await he(`/api/cards/unpublish/${e}`,{method:"PUT"});if(r.ok){const n=await r.json();return t($4(e)),n}},t3={userCards:[]},r3=(e=t3,t)=>{switch(t.type){case _0:return{...e,userCards:t.payload.userCards};case U0:return{...e,currentCard:t.card};case W0:{const{updatedCard:r}=t;let n={...e},i={...n.currentCard,...r};return delete n.currentCard,n.currentCard=i,n}case V0:{const{imgType:r,newImage:n}=t;let i={...e};return r==="banner"&&(delete i.currentCard.Banner,i.currentCard.Banner=n),r==="headshot"&&(delete i.currentCard.Headshot,i.currentCard.Headshot=n),r==="profile"&&(delete i.currentCard.ProfilePic,i.currentCard.ProfilePic=n),i}case G0:{const{trackId:r}=t;let n={...e},i=n.currentCard.Tracks.filter(a=>a.id!==Number(r));return delete n.currentCard.Tracks,n.currentCard.Tracks=i,n}case K0:{const{selectedTracks:r}=t,n=Object.values(r);return{...e,currentCard:{...e.currentCard,Tracks:[...e.currentCard.Tracks,...n]}}}case H0:{const{cardId:r}=t;return{...e,userCards:e.userCards.filter(n=>n.id!==Number(r))}}case Y0:{const{cardId:r,title:n}=t.payload;return{...e,userCards:e.userCards.map(i=>(i.id===r&&(i.title=n),i))}}case q0:{const{colors:r,font:n}=t;return{...e,currentCard:{...e.currentCard,CardColor:r,CardFont:n}}}case I4:{const{tracklist:r}=t;return{...e,currentCard:{...e.currentCard,Tracks:[...r]}}}case Q0:{const{cardId:r}=t;return{...e,userCards:e.userCards.map(n=>(n.id===r&&(n.isActive=!1,n.updatedAt=new Date().toISOString()),n))}}case X0:{const{cardId:r}=t;return{...e,userCards:e.userCards.map(n=>(n.id===r&&(n.isActive=!0,n.updatedAt=new Date().toISOString()),n))}}default:return e}};function n3(){const e=dr(),t=ze(),r=Ie(w=>w.session.user),n=Ie(w=>w.catalog.userTracks),i=Ie(w=>w.images.userImages),a=Ie(w=>w.cards.userCards),[o,l]=x.useState(!1),[s,u]=x.useState(),[f,d]=x.useState(),[p,h]=x.useState(),[v,b]=x.useState();if(x.useEffect(()=>{t(sf()),t(J0()),t(lf()).then(()=>{l(!0)})},[r,t]),x.useEffect(()=>{if(n&&Array.isArray(n)&&h(n.length),i&&Array.isArray(i)&&b(i.length),a&&Array.isArray(a)){u(a.length);let w=a.reduce((y,g)=>g.isActive?y+=1:y,0);d(w)}},[n,i,a]),o)return c.jsxs("div",{className:"dashboard-grid",children:[c.jsxs("div",{className:"dashboard-card",onClick:()=>e("/cards"),children:[c.jsx(wu,{a:f,b:s}),c.jsxs("div",{className:"card-content",children:[c.jsx(p4,{size:40,className:"icon"}),c.jsx("p",{children:"Active Cards"})]})]}),c.jsxs("div",{className:"dashboard-card",onClick:()=>e("/catalog"),children:[c.jsx(wu,{a:p,b:100}),c.jsxs("div",{className:"card-content",children:[c.jsx(v4,{size:40,className:"icon"}),c.jsx("p",{children:"Tracks"})]})]}),c.jsxs("div",{className:"dashboard-card",onClick:()=>e("/images"),children:[c.jsx(wu,{a:v,b:100}),c.jsxs("div",{className:"card-content",children:[c.jsx(h4,{size:40,className:"icon"}),c.jsx("p",{children:"Images"})]})]})]})}const e1="externalLinks/setExternalLinks",t1="externalLinks/addExternalLink",r1="externalLinks/deleteExternalLink",i3=e=>({type:e1,links:e}),a3=e=>({type:t1,newLink:e}),o3=e=>({type:r1,linkId:e}),l3=()=>async e=>{const t=await he("/api/links");if(t.ok){const r=await t.json();e(i3(r))}},s3=e=>async t=>{const r=await he("/api/links/",{method:"POST",body:JSON.stringify({url:e})});if(r.ok){const n=await r.json();t(a3(n.newExternalLink))}else return r.json()},u3=e=>async t=>{const r=await he(`/api/links/${e}`,{method:"DELETE"});if(r.ok)t(o3(e));else return r.json()},c3={},d3=(e=c3,t)=>{switch(t.type){case e1:return{...e,linksArray:[...t.links]};case t1:return{...e,linksArray:[...e.linksArray,t.newLink]};case r1:return{...e,linksArray:e.linksArray.filter(r=>r.id!==t.linkId)};default:return e}};function f3(e){return le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z"},child:[]}]})(e)}function p3(e){return le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM224 192V320c0 17.7-14.3 32-32 32s-32-14.3-32-32V192c0-17.7 14.3-32 32-32s32 14.3 32 32zm128 0V320c0 17.7-14.3 32-32 32s-32-14.3-32-32V192c0-17.7 14.3-32 32-32s32 14.3 32 32z"},child:[]}]})(e)}function h3(e){return le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM188.3 147.1c-7.6 4.2-12.3 12.3-12.3 20.9V344c0 8.7 4.7 16.7 12.3 20.9s16.8 4.1 24.3-.5l144-88c7.1-4.4 11.5-12.1 11.5-20.5s-4.4-16.1-11.5-20.5l-144-88c-7.4-4.5-16.7-4.7-24.3-.5z"},child:[]}]})(e)}function v3(e){return le({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M73 39c-14.8-9.1-33.4-9.4-48.5-.9S0 62.6 0 80V432c0 17.4 9.4 33.4 24.5 41.9s33.7 8.1 48.5-.9L361 297c14.3-8.7 23-24.2 23-41s-8.7-32.2-23-41L73 39z"},child:[]}]})(e)}function n1({externalLinks:e,waveformColor:t}){return c.jsx("div",{id:"external-links-bar",children:e==null?void 0:e.map(r=>c.jsx(i1,{url:r.url,waveformColor:t},r.id))})}const i1=({url:e,waveformColor:t})=>{if(e.includes("imdb"))return c.jsx(yt,{to:e,className:"external-link-icon",target:"_blank",rel:"noopener noreferrer external",children:c.jsx(s4,{color:t})});if(e.includes("instagram"))return c.jsx(yt,{to:e,className:"external-link-icon",target:"_blank",rel:"noopener noreferrer external",children:c.jsx(u4,{color:t})});if(e.includes("facebook"))return c.jsx(yt,{to:e,className:"external-link-icon",target:"_blank",rel:"noopener noreferrer external",children:c.jsx(l4,{color:t})});if(e.includes("linkedin"))return c.jsx(yt,{to:e,className:"external-link-icon",target:"_blank",rel:"noopener noreferrer external",children:c.jsx(c4,{color:t})});if(e.includes("x"))return c.jsx(yt,{to:e,className:"external-link-icon",target:"_blank",rel:"noopener noreferrer external",children:c.jsx(f3,{color:t})})};function g3(){const e=Ie(s=>s.links.linksArray),t=ze(),[r,n]=x.useState(""),[i,a]=x.useState({});x.useEffect(()=>{t(l3())},[t]);const o=()=>{t(s3(r)).then(()=>n("")).catch(async s=>{a({});const u=await s.json();a({...u.errors})})},l=s=>{t(u3(s)).then(()=>n("")).then(a({}))};return c.jsxs("div",{className:"external-links-form-container",children:[c.jsx("h3",{children:"Social Media Links"}),c.jsx("div",{className:"subtitle-text",children:c.jsx("p",{children:"Add your socials to be displayed by default in all the cards. Currently supported links: Instagram, Imdb, Facebook, Twitter, and Linkedin"})}),c.jsxs("div",{className:"form-and-button-container",children:[c.jsxs("form",{children:[c.jsxs("fieldset",{children:[c.jsx("legend",{children:"External Url"}),c.jsx("label",{htmlFor:"external-url",children:c.jsx("input",{type:"url",value:r,onChange:s=>n(s.target.value)})})]}),i.url&&c.jsx("p",{className:"error-p",children:i.url})]}),c.jsx(Mc,{onClick:o})]}),c.jsx("div",{className:"external-links-list",children:(e==null?void 0:e.length)>0&&(e==null?void 0:e.map(s=>c.jsxs("div",{className:"external-link-row",children:[c.jsxs("div",{children:[c.jsx(i1,{url:s.url,waveformColor:"#BD1792"}),c.jsx("p",{children:s.url})]}),c.jsx(EC,{size:15,style:{cursor:"pointer",color:"red",filter:"grayscale(50%)"},onClick:()=>l(s.id)})]},s.id)))}),!(e!=null&&e.length)&&c.jsx("div",{className:"no-items-message-container",children:c.jsx("p",{className:"no-items-message",children:"You don't have any links yet"})})]})}function m3(){return c.jsxs("div",{id:"dashboard-container",children:[c.jsx("div",{className:"page-title-content",children:c.jsx("div",{className:"page-title-container",children:c.jsx("p",{children:"Dashboard"})})}),c.jsxs("div",{className:"dashboard-row-layout",children:[c.jsx(n3,{}),c.jsx(g3,{})]}),c.jsx("div",{children:c.jsx(R4,{})})]})}function y3({img:e,closeModal:t}){return c.jsxs("div",{className:"expanded-image-container",children:[c.jsx("span",{className:"expanded-image-close",onClick:()=>t(),children:c.jsx(y0,{})}),c.jsx("img",{src:e.url,alt:e.name})]})}function x3(){const{setModalContent:e,closeModal:t}=fr(),r=Ie(j=>j.session.user),n=Ie(j=>j.images.userImages),i=ze(),[a,o]=x.useState(!1),[l,s]=x.useState();x.useEffect(()=>{i(sf()).then(()=>{o(!0)})},[r,i]);const u=j=>{i(i4(j)),C(!1)},f=async j=>{const S=j.target.files;S.length>=1&&(s(!0),(await i(O0(S,r.id))).ok&&s(!1))},[d,p]=x.useState(),[h,v]=x.useState(),[b,w]=x.useState(),[y,g]=x.useState(),[m,C]=x.useState(!1),D=x.useRef(),P=(j,S,T)=>{j.stopPropagation(),w(j.clientX),g(j.clientY+15),p(S),v(T),C(!0)};return x.useEffect(()=>{const j=S=>{D.current.contains(S.target)||C(!1)};return m&&document.addEventListener("click",j),()=>document.removeEventListener("click",j)},[m]),c.jsxs("div",{id:"images-container",children:[c.jsx("div",{className:"page-title-container",children:c.jsxs("div",{className:"page-title-content",children:[c.jsx("p",{id:"page-title",children:"Images"}),c.jsx("div",{className:"gradient-button-background",children:c.jsx(b3,{handleUploadImages:f,uploading:l})})]})}),(n==null?void 0:n.length)>=1&&c.jsxs("div",{className:"image-grid",children:[a&&(n==null?void 0:n.map(j=>c.jsxs("div",{className:"image-item",onClick:()=>e(c.jsx(y3,{img:j,closeModal:t})),children:[c.jsx("img",{src:j.url,alt:j.name}),c.jsxs("div",{id:"name-options-container",children:[c.jsx("p",{children:j.name.split(".")[0]}),c.jsx("span",{children:c.jsx(bC,{size:18,id:"menu-icon",onClick:S=>P(S,j.id,j.name)})})]})]},j.id))),l&&c.jsx("div",{style:{textAlign:"center",margin:"1em",display:"flex",justifyContent:"center",alignItems:"center",gap:"1em"},children:c.jsx(Rs,{size:50,className:"colored"})})]}),!(n!=null&&n.length)&&c.jsx("div",{style:{padding:"64px"},children:c.jsxs("p",{className:"no-items-message-container",children:["You don't have any Images yet. ",c.jsxs("span",{children:["Click the icon ",c.jsx(On,{})," to upload images and customize your cards"]})]})}),c.jsx(w3,{handleDeleteImage:u,imageId:d,imageName:h,showMenu:m,menuRef:D,x:b,y})]})}function b3({handleUploadImages:e,uploading:t}){const r=x.useRef(null),n=()=>{r.current&&r.current.click()};if(!t)return c.jsxs("div",{children:[c.jsx("input",{type:"file",accept:".jpg,.png,.webp",multiple:!0,onChange:e,ref:r,style:{display:"none"}}),c.jsxs("button",{onClick:n,className:"upload-icon",children:[c.jsx("span",{children:"UPLOAD IMAGES"}),c.jsx("span",{children:c.jsx(On,{size:20,className:"colored"})})]})]})}function w3({imageId:e,imageName:t,x:r,y:n,menuRef:i,showMenu:a,handleDeleteImage:o}){const{setModalContent:l,closeModal:s}=fr();return c.jsxs("div",{className:"options-container",style:{display:a?"flex":"none",position:"fixed",top:n,left:r},ref:i,children:[c.jsxs("div",{style:{cursor:"pointer"},onClick:()=>l(c.jsx(B0,{id:e,title:t,type:"Image",closeModal:s})),children:[c.jsx(uf,{}),"Rename"]}),c.jsxs("div",{style:{color:"#e22847",cursor:"pointer"},onClick:()=>o(e),children:[c.jsx(js,{}),"Delete"]})]})}function a1({navigate:e,action:t,cardTitle:r="",cardId:n}){const{closeModal:i}=fr(),[a,o]=x.useState(r),[l,s]=x.useState(!0),u=ze();x.useEffect(()=>{a.length>2?s(!1):s(!0)},[a]);const f=()=>{u(Y4(a)).then(p=>{e(`/cards/${p.id}`)}).then(()=>i())},d=()=>{u(Q4(n,a)).then(()=>i())};return c.jsxs("div",{id:"title-modal-content",children:[c.jsx("h4",{children:"Enter a title for your Card "}),c.jsxs("fieldset",{children:[c.jsx("legend",{children:"Card title: "}),c.jsx("input",{type:"text",value:a,onChange:p=>o(p.target.value)})]}),c.jsxs("div",{className:"title-modal-buttons",children:[c.jsx("button",{id:"title-modal-cancel-button",onClick:i,children:"CANCEL"}),t==="create"&&c.jsx("button",{id:"ok-button",onClick:f,disabled:l,style:l?{cursor:"not-allowed"}:{cursor:"pointer"},children:"CREATE"}),t==="rename"&&c.jsx("button",{id:"ok-button",onClick:d,disabled:l,style:l?{cursor:"not-allowed"}:{cursor:"pointer"},children:"RENAME"})]})]})}function S3(e){return le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M17.77 3.77 16 2 6 12l10 10 1.77-1.77L9.54 12z"},child:[]}]})(e)}function C3(e){return le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M18.6 19.5H21v2h-6v-6h2v2.73c1.83-1.47 3-3.71 3-6.23 0-4.07-3.06-7.44-7-7.93V2.05c5.05.5 9 4.76 9 9.95 0 2.99-1.32 5.67-3.4 7.5zM4 12c0-2.52 1.17-4.77 3-6.23V8.5h2v-6H3v2h2.4A9.966 9.966 0 0 0 2 12c0 5.19 3.95 9.45 9 9.95v-2.02c-3.94-.49-7-3.86-7-7.93zm12.24-3.89-5.66 5.66-2.83-2.83-1.41 1.41 4.24 4.24 7.07-7.07-1.41-1.41z"},child:[]}]})(e)}function E3(e){return le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M7.94 5.12 6.49 3.66A9.91 9.91 0 0 1 12 2c5.52 0 10 4.48 10 10 0 2.04-.61 3.93-1.66 5.51l-1.46-1.46A7.869 7.869 0 0 0 20 12c0-4.41-3.59-8-8-8-1.48 0-2.86.41-4.06 1.12zm9.72 4.41-1.41-1.41-2.65 2.65 1.41 1.41 2.65-2.65zm2.12 13.08-2.27-2.27A9.91 9.91 0 0 1 12 22C6.48 22 2 17.52 2 12c0-2.04.61-3.93 1.66-5.51L1.39 4.22 2.8 2.81l18.38 18.38-1.4 1.42zm-3.72-3.73L12.18 15l-1.59 1.59-4.24-4.24 1.41-1.41 2.83 2.83.18-.18-5.65-5.65A7.932 7.932 0 0 0 4 12c0 4.41 3.59 8 8 8 1.48 0 2.86-.41 4.06-1.12z"},child:[]}]})(e)}function o1(e){return le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M14 10H3v2h11v-2zm0-4H3v2h11V6zm4 8v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zM3 16h7v-2H3v2z"},child:[]}]})(e)}function D3(e){return le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M24 15c0-2.64-2.05-4.78-4.65-4.96A7.49 7.49 0 0 0 12 4c-1.33 0-2.57.36-3.65.97l1.49 1.49C10.51 6.17 11.23 6 12 6c3.04 0 5.5 2.46 5.5 5.5v.5H19a2.996 2.996 0 0 1 1.79 5.4l1.41 1.41c1.09-.92 1.8-2.27 1.8-3.81zM4.41 3.86 3 5.27l2.77 2.77h-.42A5.994 5.994 0 0 0 0 14c0 3.31 2.69 6 6 6h11.73l2 2 1.41-1.41L4.41 3.86zM6 18c-2.21 0-4-1.79-4-4s1.79-4 4-4h1.73l8 8H6z"},child:[]}]})(e)}function k3({cardId:e,cardTitle:t,isActive:r,x:n,y:i,menuRef:a,showMenu:o,setShowMenu:l}){const s=dr(),u=ze(),{addToast:f}=Ps(),{setModalContent:d,closeModal:p}=fr(),h=b=>{u(q4(b)).then(()=>l(!1))},v=b=>{r&&u(e3(b)).then(()=>l(!1)).then(()=>f("Your card is now private")),r||u(Z0(b)).then(()=>l(!1)).then(()=>f("Your card is now public"))};return c.jsxs("div",{className:"options-container",style:{display:o?"flex":"none",position:"absolute",top:i,left:n},ref:a,children:[c.jsxs("div",{style:{cursor:"pointer"},onClick:()=>d(c.jsx(a1,{action:"rename",cardTitle:t,cardId:e,closeModal:p})),children:[c.jsx(uf,{}),"Rename"]}),c.jsxs("div",{style:{color:"#e22847",cursor:"pointer"},onClick:()=>h(e),children:[c.jsx(js,{}),"Delete"]}),c.jsxs("div",{style:{color:"lightgray",cursor:"pointer"},onClick:()=>s(`/cards/${e}`),children:[c.jsx(sa,{}),"Edit"]}),r?c.jsxs("div",{style:{color:"lightgray",cursor:"pointer"},onClick:()=>v(e),children:[c.jsx(E3,{}),"UnPublish"]}):c.jsxs("div",{style:{color:"lightgray",cursor:"pointer"},onClick:()=>v(e),children:[c.jsx(C3,{}),"Publish"]})]})}function P3({cards:e}){const t=dr();return c.jsxs("div",{className:"card-preview-row-container",children:[c.jsx("p",{id:"card-preview-row-title",children:"Active Cards:"}),c.jsx("div",{className:"card-preview-row",children:e.filter(r=>r.isActive).slice(0,6).map(r=>c.jsx("div",{className:"card-preview-container",onClick:()=>t(`/cards/${r.id}`),children:c.jsx("iframe",{src:`${r.publicUrl}`,title:`Preview of ${r.title}`,className:"card-preview-iframe"})},r.id))})]})}function j3(e){return le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M14.78 3.653a3.936 3.936 0 1 1 5.567 5.567l-3.627 3.627a3.936 3.936 0 0 1-5.88-.353.75.75 0 0 0-1.18.928 5.436 5.436 0 0 0 8.12.486l3.628-3.628a5.436 5.436 0 1 0-7.688-7.688l-3 3a.75.75 0 0 0 1.06 1.061l3-3Z"},child:[]},{tag:"path",attr:{d:"M7.28 11.153a3.936 3.936 0 0 1 5.88.353.75.75 0 0 0 1.18-.928 5.436 5.436 0 0 0-8.12-.486L2.592 13.72a5.436 5.436 0 1 0 7.688 7.688l3-3a.75.75 0 1 0-1.06-1.06l-3 3a3.936 3.936 0 0 1-5.567-5.568l3.627-3.627Z"},child:[]}]})(e)}function R3(e){return le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M7.75 6.5a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5Z"},child:[]},{tag:"path",attr:{d:"M2.5 1h8.44a1.5 1.5 0 0 1 1.06.44l10.25 10.25a1.5 1.5 0 0 1 0 2.12l-8.44 8.44a1.5 1.5 0 0 1-2.12 0L1.44 12A1.497 1.497 0 0 1 1 10.94V2.5A1.5 1.5 0 0 1 2.5 1Zm0 1.5v8.44l10.25 10.25 8.44-8.44L10.94 2.5Z"},child:[]}]})(e)}function T3(){const e=dr(),{setModalContent:t,closeModal:r}=fr(),n=Ie(S=>S.session.user),i=Ie(S=>S.cards.userCards),a=Ie(S=>S.displayInfo),o=ze(),[l,s]=x.useState(),[u,f]=x.useState(),[d,p]=x.useState(),[h,v]=x.useState(),[b,w]=x.useState(),[y,g]=x.useState(),[m,C]=x.useState(!1),D=x.useRef(),P=(S,T,I,L)=>{S.stopPropagation(),w(S.clientX-80),g(S.clientY),f(T),p(I),v(L),C(!0)};x.useEffect(()=>{const S=T=>{D.current.contains(T.target)||C(!1)};return m&&document.addEventListener("click",S),()=>document.removeEventListener("click",S)},[m]),x.useEffect(()=>{o(J0()).then(o($0())).then(()=>{s(!0)})},[n,o]);const j=async()=>{a!=null&&a.name?t(c.jsx(a1,{navigate:e,action:"create"})):t(c.jsx(I3,{navigate:e,closeModal:r}))};return c.jsxs("div",{id:"cards-container",children:[c.jsx("div",{className:"page-title-container",children:c.jsxs("div",{className:"page-title-content",children:[c.jsx("p",{id:"page-title",children:"Cards"}),c.jsx("div",{className:"gradient-button-background",children:c.jsxs("button",{className:"upload-icon",onClick:j,children:[c.jsx(Mc,{}),c.jsx("span",{children:"NEW CARD"})]})})]})}),c.jsxs("div",{className:"table-card-previews-container",children:[c.jsxs("div",{children:[c.jsxs("table",{className:"cards-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Active"}),c.jsx("th",{children:"Title"}),c.jsx("th",{children:"Live Link"}),c.jsx("th",{children:"Created"}),c.jsx("th",{children:"Updated"}),c.jsx("th",{})]})}),(i==null?void 0:i.length)>=1&&Array.isArray(i)&&c.jsx("tbody",{children:l&&i.map(S=>c.jsxs("tr",{children:[c.jsx("td",{children:S.isActive?c.jsx(j4,{}):c.jsx(D3,{})}),c.jsx("td",{children:c.jsx(Un,{className:"card-link",id:"navlink-to-card-details",to:`/cards/${S.id}`,children:S.title||"Untitled"})}),c.jsx("td",{children:c.jsx("a",{className:"card-link",id:"navlink-to-public-url",href:S.publicUrl,target:"_blank",rel:"noopener noreferrer",children:c.jsx(j3,{})})}),c.jsx("td",{children:Ac(S.createdAt)}),c.jsx("td",{children:Ac(S.updatedAt)}),c.jsx("td",{children:c.jsx(Fc,{id:"track-menu-icon",onClick:T=>P(T,S.id,S.title,S.isActive)})})]},S.id))})]}),!i.length&&c.jsx(c.Fragment,{children:c.jsxs("p",{className:"no-items-message-container",children:["You don't have any Cards created yet. ",c.jsxs("span",{children:["Click the icon ",c.jsx(Mc,{})," to start creating."]})]})})]}),c.jsx(P3,{cards:i})]}),c.jsx(k3,{cardId:u,cardTitle:d,isActive:h,setShowMenu:C,showMenu:m,menuRef:D,x:b,y})]})}function I3({navigate:e,closeModal:t}){const r=()=>{e("/dashboard"),t()};return c.jsxs("p",{style:{color:"white",textAlign:"center",padding:"20px",filter:"grayscale(20%)"},children:["Please complete your ",c.jsx("br",{}),c.jsx("em",{children:"Display Information "}),c.jsx("br",{}),"on the ",c.jsx("span",{onClick:r,style:{cursor:"pointer"},children:c.jsx("u",{children:c.jsx("strong",{children:"Dashboard"})})})," first"]})}class N3{constructor(){this.listeners={}}on(t,r,n){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(r),n==null?void 0:n.once){const i=()=>{this.un(t,i),this.un(t,r)};return this.on(t,i),i}return()=>this.un(t,r)}un(t,r){var n;(n=this.listeners[t])===null||n===void 0||n.delete(r)}once(t,r){return this.on(t,r,{once:!0})}unAll(){this.listeners={}}emit(t,...r){this.listeners[t]&&this.listeners[t].forEach(n=>n(...r))}}let M3=class extends N3{constructor(t){super(),this.subscriptions=[],this.options=t}onInit(){}_init(t){this.wavesurfer=t,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(t=>t())}};function l1(e,t){const r=t.xmlns?document.createElementNS(t.xmlns,e):document.createElement(e);for(const[n,i]of Object.entries(t))if(n==="children")for(const[a,o]of Object.entries(t))typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(l1(a,o));else n==="style"?Object.assign(r.style,i):n==="textContent"?r.textContent=i:r.setAttribute(n,i.toString());return r}function Mh(e,t,r){const n=l1(e,t||{});return r==null||r.appendChild(n),n}const A3={lineWidth:1,labelSize:11,formatTimeCallback:e=>`${Math.floor(e/60)}:${`0${Math.floor(e)%60}`.slice(-2)}`};let L3=class s1 extends M3{constructor(t){super(t||{}),this.unsubscribe=()=>{},this.onPointerMove=r=>{if(!this.wavesurfer)return;const n=this.wavesurfer.getWrapper().getBoundingClientRect(),{width:i}=n,a=r.clientX-n.left,o=Math.min(1,Math.max(0,a/i)),l=Math.min(i-this.options.lineWidth-1,a);this.wrapper.style.transform=`translateX(${l}px)`,this.wrapper.style.opacity="1";const s=this.wavesurfer.getDuration()||0;this.label.textContent=this.options.formatTimeCallback(s*o);const u=this.label.offsetWidth;this.label.style.transform=l+u>i?`translateX(-${u+this.options.lineWidth}px)`:"",this.emit("hover",o)},this.onPointerLeave=()=>{this.wrapper.style.opacity="0"},this.options=Object.assign({},A3,t),this.wrapper=Mh("div",{part:"hover"}),this.label=Mh("span",{part:"hover-label"},this.wrapper)}static create(t){return new s1(t)}addUnits(t){return`${t}${typeof t=="number"?"px":""}`}onInit(){if(!this.wavesurfer)throw Error("WaveSurfer is not initialized");const t=this.wavesurfer.options,r=this.options.lineColor||t.cursorColor||t.progressColor;Object.assign(this.wrapper.style,{position:"absolute",zIndex:10,left:0,top:0,height:"100%",pointerEvents:"none",borderLeft:`${this.addUnits(this.options.lineWidth)} solid ${r}`,opacity:"0",transition:"opacity .1s ease-in"}),Object.assign(this.label.style,{display:"block",backgroundColor:this.options.labelBackground,color:this.options.labelColor,fontSize:`${this.addUnits(this.options.labelSize)}`,transition:"transform .1s ease-in",padding:"2px 3px"});const n=this.wavesurfer.getWrapper();n.appendChild(this.wrapper),n.addEventListener("pointermove",this.onPointerMove),n.addEventListener("pointerleave",this.onPointerLeave),n.addEventListener("wheel",this.onPointerMove),this.unsubscribe=()=>{n.removeEventListener("pointermove",this.onPointerMove),n.removeEventListener("pointerleave",this.onPointerLeave),n.removeEventListener("wheel",this.onPointerLeave)}}destroy(){super.destroy(),this.unsubscribe(),this.wrapper.remove()}};function Tl(e){"@babel/helpers - typeof";return Tl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tl(e)}var O3=/^\s+/,B3=/\s+$/;function G(e,t){if(e=e||"",t=t||{},e instanceof G)return e;if(!(this instanceof G))return new G(e,t);var r=F3(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}G.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),r,n,i,a,o,l;return r=t.r/255,n=t.g/255,i=t.b/255,r<=.03928?a=r/12.92:a=Math.pow((r+.055)/1.055,2.4),n<=.03928?o=n/12.92:o=Math.pow((n+.055)/1.055,2.4),i<=.03928?l=i/12.92:l=Math.pow((i+.055)/1.055,2.4),.2126*a+.7152*o+.0722*l},setAlpha:function(t){return this._a=u1(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=Lh(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=Lh(this._r,this._g,this._b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.v*100);return this._a==1?"hsv("+r+", "+n+"%, "+i+"%)":"hsva("+r+", "+n+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var t=Ah(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=Ah(this._r,this._g,this._b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.l*100);return this._a==1?"hsl("+r+", "+n+"%, "+i+"%)":"hsla("+r+", "+n+"%, "+i+"%, "+this._roundA+")"},toHex:function(t){return Oh(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return U3(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(Re(this._r,255)*100)+"%",g:Math.round(Re(this._g,255)*100)+"%",b:Math.round(Re(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(Re(this._r,255)*100)+"%, "+Math.round(Re(this._g,255)*100)+"%, "+Math.round(Re(this._b,255)*100)+"%)":"rgba("+Math.round(Re(this._r,255)*100)+"%, "+Math.round(Re(this._g,255)*100)+"%, "+Math.round(Re(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:eE[Oh(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var r="#"+Bh(this._r,this._g,this._b,this._a),n=r,i=this._gradientType?"GradientType = 1, ":"";if(t){var a=G(t);n="#"+Bh(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+r+",endColorstr="+n+")"},toString:function(t){var r=!!t;t=t||this._format;var n=!1,i=this._a<1&&this._a>=0,a=!r&&i&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return a?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(n=this.toRgbString()),t==="prgb"&&(n=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(n=this.toHexString()),t==="hex3"&&(n=this.toHexString(!0)),t==="hex4"&&(n=this.toHex8String(!0)),t==="hex8"&&(n=this.toHex8String()),t==="name"&&(n=this.toName()),t==="hsl"&&(n=this.toHslString()),t==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return G(this.toString())},_applyModification:function(t,r){var n=t.apply(null,[this].concat([].slice.call(r)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(G3,arguments)},brighten:function(){return this._applyModification(K3,arguments)},darken:function(){return this._applyModification(Y3,arguments)},desaturate:function(){return this._applyModification(H3,arguments)},saturate:function(){return this._applyModification(W3,arguments)},greyscale:function(){return this._applyModification(V3,arguments)},spin:function(){return this._applyModification(q3,arguments)},_applyCombination:function(t,r){return t.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(J3,arguments)},complement:function(){return this._applyCombination(Q3,arguments)},monochromatic:function(){return this._applyCombination(Z3,arguments)},splitcomplement:function(){return this._applyCombination(X3,arguments)},triad:function(){return this._applyCombination(Fh,[3])},tetrad:function(){return this._applyCombination(Fh,[4])}};G.fromRatio=function(e,t){if(Tl(e)=="object"){var r={};for(var n in e)e.hasOwnProperty(n)&&(n==="a"?r[n]=e[n]:r[n]=Ji(e[n]));e=r}return G(e,t)};function F3(e){var t={r:0,g:0,b:0},r=1,n=null,i=null,a=null,o=!1,l=!1;return typeof e=="string"&&(e=iE(e)),Tl(e)=="object"&&(xr(e.r)&&xr(e.g)&&xr(e.b)?(t=z3(e.r,e.g,e.b),o=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):xr(e.h)&&xr(e.s)&&xr(e.v)?(n=Ji(e.s),i=Ji(e.v),t=_3(e.h,n,i),o=!0,l="hsv"):xr(e.h)&&xr(e.s)&&xr(e.l)&&(n=Ji(e.s),a=Ji(e.l),t=$3(e.h,n,a),o=!0,l="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=u1(r),{ok:o,format:e.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}function z3(e,t,r){return{r:Re(e,255)*255,g:Re(t,255)*255,b:Re(r,255)*255}}function Ah(e,t,r){e=Re(e,255),t=Re(t,255),r=Re(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),a,o,l=(n+i)/2;if(n==i)a=o=0;else{var s=n-i;switch(o=l>.5?s/(2-n-i):s/(n+i),n){case e:a=(t-r)/s+(t1&&(d-=1),d<1/6?u+(f-u)*6*d:d<1/2?f:d<2/3?u+(f-u)*(2/3-d)*6:u}if(t===0)n=i=a=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),i=o(s,l,e),a=o(s,l,e-1/3)}return{r:n*255,g:i*255,b:a*255}}function Lh(e,t,r){e=Re(e,255),t=Re(t,255),r=Re(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),a,o,l=n,s=n-i;if(o=n===0?0:s/n,n==i)a=0;else{switch(n){case e:a=(t-r)/s+(t>1)+720)%360;--t;)n.h=(n.h+i)%360,a.push(G(n));return a}function Z3(e,t){t=t||6;for(var r=G(e).toHsv(),n=r.h,i=r.s,a=r.v,o=[],l=1/t;t--;)o.push(G({h:n,s:i,v:a})),a=(a+l)%1;return o}G.mix=function(e,t,r){r=r===0?0:r||50;var n=G(e).toRgb(),i=G(t).toRgb(),a=r/100,o={r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a};return G(o)};G.readability=function(e,t){var r=G(e),n=G(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)};G.isReadable=function(e,t,r){var n=G.readability(e,t),i,a;switch(a=!1,i=aE(r),i.level+i.size){case"AAsmall":case"AAAlarge":a=n>=4.5;break;case"AAlarge":a=n>=3;break;case"AAAsmall":a=n>=7;break}return a};G.mostReadable=function(e,t,r){var n=null,i=0,a,o,l,s;r=r||{},o=r.includeFallbackColors,l=r.level,s=r.size;for(var u=0;ui&&(i=a,n=G(t[u]));return G.isReadable(e,n,{level:l,size:s})||!o?n:(r.includeFallbackColors=!1,G.mostReadable(e,["#fff","#000"],r))};var zc=G.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},eE=G.hexNames=tE(zc);function tE(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}function u1(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Re(e,t){rE(e)&&(e="100%");var r=nE(e);return e=Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function Is(e){return Math.min(1,Math.max(0,e))}function Et(e){return parseInt(e,16)}function rE(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function nE(e){return typeof e=="string"&&e.indexOf("%")!=-1}function er(e){return e.length==1?"0"+e:""+e}function Ji(e){return e<=1&&(e=e*100+"%"),e}function c1(e){return Math.round(parseFloat(e)*255).toString(16)}function zh(e){return Et(e)/255}var qt=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",r="(?:"+t+")|(?:"+e+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function xr(e){return!!qt.CSS_UNIT.exec(e)}function iE(e){e=e.replace(O3,"").replace(B3,"").toLowerCase();var t=!1;if(zc[e])e=zc[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=qt.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=qt.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=qt.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=qt.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=qt.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=qt.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=qt.hex8.exec(e))?{r:Et(r[1]),g:Et(r[2]),b:Et(r[3]),a:zh(r[4]),format:t?"name":"hex8"}:(r=qt.hex6.exec(e))?{r:Et(r[1]),g:Et(r[2]),b:Et(r[3]),format:t?"name":"hex"}:(r=qt.hex4.exec(e))?{r:Et(r[1]+""+r[1]),g:Et(r[2]+""+r[2]),b:Et(r[3]+""+r[3]),a:zh(r[4]+""+r[4]),format:t?"name":"hex8"}:(r=qt.hex3.exec(e))?{r:Et(r[1]+""+r[1]),g:Et(r[2]+""+r[2]),b:Et(r[3]+""+r[3]),format:t?"name":"hex"}:!1}function aE(e){var t,r;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:t,size:r}}const d1=({audioUrl:e,waveformColor:t})=>{const r=x.useRef(),[n,i]=x.useState(),[a,o]=x.useState(),{wavesurfer:l,isReady:s,isPlaying:u,currentTime:f}=R0({container:r,height:100,autoplay:!1,waveColor:t||"#EB3678",progressColor:G(t).darken(10).toString()||"rgb(100, 0, 100)",url:e,plugins:x.useMemo(()=>[L3.create({lineColor:G(t).lighten(20).toString()||"rgb(100, 0, 100)",lineWidth:2,labelBackground:"#555",labelColor:"#fff",labelSize:"11px"})],[t])});x.useEffect(()=>{l&&l.on("interaction",()=>{l.play()})},[l]);const d=x.useCallback(()=>{l&&l.playPause()},[l]);return x.useEffect(()=>{l&&s&&i(l.getDuration())},[l,s]),x.useEffect(()=>{l&&l.on("loading",p=>{o(p)})},[l,a]),c.jsxs(c.Fragment,{children:[a<100&&c.jsxs("div",{className:"card-loading-bar-container",style:{width:"50%",backgroundColor:"lightgray",height:"20px",display:"flex",alignItems:"center",margin:"50px auto",borderRadius:"20px"},children:[c.jsx("div",{style:{position:"absolute",display:"flex",justifyContent:"center",padding:"0 10px",fontSize:"0.8rem",color:"black"}}),c.jsx("div",{className:"card-loading-bar",style:{width:`${a}%`,backgroundColor:t||"#EB3678",filter:"grayscale(20%) brightness(1.2)",height:"60%",borderRadius:"20px",transition:"width 0.2s"}})]}),c.jsx("div",{id:"card-details-waveform-container",children:c.jsx("div",{id:"card-waveform",className:s?"":"hidden",ref:r})}),s&&c.jsxs("div",{className:"card-player-controls",style:{color:t},children:[c.jsx("span",{id:"card-player-playpause",onClick:d,children:u?c.jsx(p3,{size:40}):c.jsx(h3,{size:40})}),c.jsxs("span",{id:"card-player-timeline",children:[Rl(f)," / ",Rl(n)]})]})]})};function $c(e,t){return $c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},$c(e,t)}function f1(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,$c(e,t)}function Ia(e){"@babel/helpers - typeof";return Ia=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ia(e)}function oE(e,t){if(Ia(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ia(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lE(e){var t=oE(e,"string");return Ia(t)=="symbol"?t:t+""}function sE(e,t,r){return(t=lE(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _h(e){for(var t=1;t"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(rt(1));return r(cf)(e,t)}if(typeof e!="function")throw new Error(rt(2));var i=e,a=t,o=[],l=o,s=!1;function u(){l===o&&(l=o.slice())}function f(){if(s)throw new Error(rt(3));return a}function d(b){if(typeof b!="function")throw new Error(rt(4));if(s)throw new Error(rt(5));var w=!0;return u(),l.push(b),function(){if(w){if(s)throw new Error(rt(6));w=!1,u();var g=l.indexOf(b);l.splice(g,1),o=null}}}function p(b){if(!uE(b))throw new Error(rt(7));if(typeof b.type>"u")throw new Error(rt(8));if(s)throw new Error(rt(9));try{s=!0,a=i(a,b)}finally{s=!1}for(var w=o=l,y=0;y"u")throw new Error(rt(12));if(typeof r(void 0,{type:Il.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(rt(13))})}function dE(e){for(var t=Object.keys(e),r={},n=0;n"u")throw u&&u.type,new Error(rt(14));d[h]=w,f=f||w!==b}return f=f||a.length!==Object.keys(s).length,f?d:s}}function Hh(e,t){return function(){return t(e.apply(this,arguments))}}function Wh(e,t){if(typeof e=="function")return Hh(e,t);if(typeof e!="object"||e===null)throw new Error(rt(16));var r={};for(var n in e){var i=e[n];typeof i=="function"&&(r[n]=Hh(i,t))}return r}function p1(){for(var e=arguments.length,t=new Array(e),r=0;r Score Sync - + diff --git a/frontend/src/components/Card/Card.jsx b/frontend/src/components/Card/Card.jsx index 9049c4b..ac8fffe 100644 --- a/frontend/src/components/Card/Card.jsx +++ b/frontend/src/components/Card/Card.jsx @@ -84,12 +84,12 @@ export default function Card() {

Cards

- -
-
+
+ +