js • Lines: 2"use strict";(self.webpackChunknew_site=self.webpackChunknew_site||[]).push([[296],{2296(e,s,t){t.r(s),t.d(s,{default:()=>N});var a=t(9379),n=t(5544),c=t(5043),l=t(6322),r=t(3604),o=t(791),i=t(5016),d=t(8602),m=t(3519),u=t(1072),x=t(7417),f=t(184),h=t(9082),p=t(1800),b=t(579);function N(){const e=(0,l.g)().identifier,s=(0,i.A)().user,t=(0,c.useState)(null),N=(0,n.A)(t,2),j=N[0],A=N[1],g=(0,c.useState)(null),y=(0,n.A)(g,2),w=y[0],v=y[1],P=(0,c.useState)([]),S=(0,n.A)(P,2),_=S[0],k=S[1],C=(0,c.useState)(!0),L=(0,n.A)(C,2),R=L[0],U=L[1],z=(0,c.useCallback)(async()=>{U(!0);const s=e.startsWith("@")?e.slice(1):e;let t=await(0,r.x7)((0,r.H9)(o.db,(0,p.n)("profiles"),s)),n=s;if(!t.exists()){const e=await(0,r.x7)((0,r.H9)(o.db,(0,p.n)("usernames"),s.toLowerCase()));if(!e.exists())return void U(!1);if(n=e.data().uid,t=await(0,r.x7)((0,r.H9)(o.db,(0,p.n)("profiles"),n)),!t.exists())return void U(!1)}A((0,a.A)({id:n},t.data())),v(n);const c=(0,r.P)((0,r.rJ)(o.db,(0,p.n)("scores")),(0,r._M)("userId","==",n),(0,r._M)("published","==",!0),(0,r.My)("updatedAt","desc")),l=(await(0,r.GG)(c)).docs.map(e=>{const s=e.data(),t=s.username&&s.slug&&s.instrument;return(0,a.A)({id:t?"".concat(s.username,"/").concat((0,h.A)(s.instrument),"/").concat(s.slug):"u-"+e.id},s)});k(l),U(!1)},[e]);return(0,c.useEffect)(()=>{z()},[z]),R?(0,b.jsx)("div",{className:"text-center py-5",children:(0,b.jsx)(x.A,{animation:"border",variant:"light"})}):j?(0,b.jsxs)(m.A,{className:"py-4",style:{maxWidth:600},children:[(0,b.jsxs)("div",{className:"d-flex align-items-center gap-4 mb-4",children:[j.photoURL?(0,b.jsx)("img",{src:j.photoURL,alt:"",width:72,height:72,className:"rounded-circle",style:{objectFit:"cover"}}):(0,b.jsx)(f.NBi,{size:72,className:"text-secondary"}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h4",{className:"mb-0",children:j.displayName}),j.username&&(0,b.jsxs)("span",{className:"text-secondary small",children:["@",j.username]}),j.website&&(0,b.jsxs)("a",{href:j.website,target:"_blank",rel:"noopener noreferrer",className:"text-info small d-flex align-items-center gap-1",children:[(0,b.jsx)(f.f35,{size:12})," ",j.website.replace(/^https?:\/\//,"")]}),j.birthday&&(0,b.jsxs)("span",{className:"text-secondary small d-flex align-items-center gap-1 mt-1",children:[(0,b.jsx)(f.V4G,{size:12})," ",new Date(j.birthday+"T00:00:00").toLocaleDateString("en-US",{month:"long",day:"numeric"})]})]}),s&&s.uid===w&&(0,b.jsxs)("div",{className:"d-flex gap-2 ms-auto",children:[(0,b.jsx)(l.N_,{to:"/tab-parser",className:"btn btn-outline-info btn-sm",children:"+ New"}),(0,b.jsxs)(l.N_,{to:"/profile/edit",className:"btn btn-outline-light btn-sm",children:[(0,b.jsx)(f.uO9,{className:"me-1"})," Edit"]})]})]}),(0,b.jsx)("h5",{className:"mb-3",children:"Published Scores"}),0===_.length?(0,b.jsx)("p",{className:"text-secondary small",children:"No published scores yet."}):(0,b.jsx)(u.A,{children:_.map(e=>{var s,t,a;return(0,b.jsx)(d.A,{xs:12,className:"mb-2",children:(0,b.jsxs)(l.N_,{to:"/content/".concat(e.id),className:"text-decoration-none d-flex justify-content-between align-items-center p-3 rounded",style:{background:"#1e1e1e"},children:[(0,b.jsx)("span",{className:"fw-bold small",children:e.name}),(0,b.jsx)("span",{className:"text-secondary",style:{fontSize:"11px"},children:(null===(s=e.updatedAt)||void 0===s||null===(t=s.toDate)||void 0===t||null===(a=t.call(s))||void 0===a?void 0:a.toLocaleDateString())||""})]})},e.id)})})]}):(0,b.jsx)(m.A,{className:"py-5",children:(0,b.jsx)("p",{className:"text-secondary text-center",children:"Profile not found."})})}},9082(e,s,t){function a(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_]+/g,"-").replace(/^-+|-+$/g,"")}t.d(s,{A:()=>a})},8602(e,s,t){t.d(s,{A:()=>f});var a=t(5544),n=t(9379),c=t(45),l=t(8139),r=t.n(l),o=t(5043),i=t(7852),d=t(579);const m=["as","bsPrefix","className"],u=["className"];const x=o.forwardRef((e,s)=>{const t=function(e){let s=e.as,t=e.bsPrefix,a=e.className,l=(0,c.A)(e,m);t=(0,i.oU)(t,"col");const o=(0,i.gy)(),d=(0,i.Jm)(),u=[],x=[];return o.forEach(e=>{const s=l[e];let a,n,c;delete l[e],"object"===typeof s&&null!=s?(a=s.span,n=s.offset,c=s.order):a=s;const r=e!==d?"-".concat(e):"";a&&u.push(!0===a?"".concat(t).concat(r):"".concat(t).concat(r,"-").concat(a)),null!=c&&x.push("order".concat(r,"-").concat(c)),null!=n&&x.push("offset".concat(r,"-").concat(n))}),[(0,n.A)((0,n.A)({},l),{},{className:r()(a,...u,...x)}),{as:s,bsPrefix:t,spans:u}]}(e),l=(0,a.A)(t,2),o=l[0],x=o.className,f=(0,c.A)(o,u),h=l[1],p=h.as,b=void 0===p?"div":p,N=h.bsPrefix,j=h.spans;return(0,d.jsx)(b,(0,n.A)((0,n.A)({},f),{},{ref:s,className:r()(x,!j.length&&N)}))});x.displayName="Col";const f=x},1072(e,s,t){t.d(s,{A:()=>u});var a=t(9379),n=t(45),c=t(8139),l=t.n(c),r=t(5043),o=t(7852),i=t(579);const d=["bsPrefix","className","as"],m=r.forwardRef((e,s)=>{let t=e.bsPrefix,c=e.className,r=e.as,m=void 0===r?"div":r,u=(0,n.A)(e,d);const x=(0,o.oU)(t,"row"),f=(0,o.gy)(),h=(0,o.Jm)(),p="".concat(x,"-cols"),b=[];return f.forEach(e=>{const s=u[e];let t;delete u[e],t=null!=s&&"object"===typeof s?s.cols:s;const a=e!==h?"-".concat(e):"";null!=t&&b.push("".concat(p).concat(a,"-").concat(t))}),(0,i.jsx)(m,(0,a.A)((0,a.A)({ref:s},u),{},{className:l()(c,x,...b)}))});m.displayName="Row";const u=m}}]);
//# sourceMappingURL=296.8d9e2590.chunk.js.map