📄 181.e8c5933d.chunk.js
/home/palash/git/site/build/static/js/181.e8c5933d.chunk.js
Language: js • Lines: 2
"use strict";(self.webpackChunknew_site=self.webpackChunknew_site||[]).push([[181],{9889(e,t,n){n.d(t,{A:()=>S});var s=n(9379),r=n(45),o=n(5544),a=n(5809),i=n(8602),c=n(3519),l=n(3637),d=n(1072),u=n(5043),p=n(3859),h=n(3596),x=n(4993),m=n(578),f=n(285),g=(n(119),n(1616),n(8320)),b=n(579);const j=["children"],y={javascript:["async","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","function","if","import","in","instanceof","let","new","null","of","return","super","switch","this","throw","true","try","typeof","undefined","var","void","while","with","yield"],python:["False","None","True","and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"],java:["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","false","final","finally","float","for","goto","if","implements","import","instanceof","int","interface","long","native","new","null","package","private","protected","public","return","short","static","strictfp","super","switch","synchronized","this","throw","throws","transient","true","try","void","volatile","while"],cpp:["auto","bool","break","case","catch","char","class","const","constexpr","continue","default","delete","do","double","else","enum","explicit","export","extern","false","float","for","friend","goto","if","inline","int","long","mutable","namespace","new","noexcept","nullptr","operator","override","private","protected","public","register","return","short","signed","sizeof","static","struct","switch","template","this","throw","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","while"],typescript:["abstract","any","as","asserts","async","await","boolean","break","case","catch","class","const","constructor","continue","debugger","declare","default","delete","do","else","enum","export","extends","false","finally","for","from","function","get","if","implements","import","in","infer","instanceof","interface","is","keyof","let","module","namespace","never","new","null","number","of","package","private","protected","public","readonly","return","require","set","static","string","super","switch","symbol","this","throw","true","try","type","typeof","undefined","unique","unknown","var","void","while","with","yield"],rust:["as","async","await","break","const","continue","crate","dyn","else","enum","extern","false","fn","for","if","impl","in","let","loop","match","mod","move","mut","pub","ref","return","self","Self","static","struct","super","trait","true","type","union","unsafe","use","where","while"],go:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],bash:["if","then","else","elif","fi","for","while","do","done","case","esac","function","return","exit","export","local","declare","echo","read","set","unset","trap","source"]};function w(e){let t=e.className,n=e.children,s=e.inline;const r=function(e){return(e||"").replace(/^language-/,"")||""}(t),o=String(n).replace(/\n$/,""),a=o.includes("\n"),i=t&&/language-\w+/.test(t);if(!0===s||!a&&!i)return(0,b.jsx)("code",{style:{background:"#3c3c3c",color:"#81ecec",padding:"2px 6px",borderRadius:"3px",fontSize:"0.9em"},children:o});const c=o.split("\n"),l=function(e,t){const n=e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").split("\n"),s=new Set(y[t]||y.javascript);return n.map(e=>{const t=[];let n=0;for(;n<e.length;)if(" "===e[n]||"\t"===e[n]){let s="";for(;n<e.length&&(" "===e[n]||"\t"===e[n]);)s+=e[n],n++;t.push(s)}else{if("/"===e[n]&&"/"===e[n+1]){t.push('<span style="color:#6a9955">'.concat(e.slice(n),"</span>"));break}if("/"===e[n]&&"*"===e[n+1]){let s=e.indexOf("*/",n+2);if(-1===s){t.push('<span style="color:#6a9955">'.concat(e.slice(n),"</span>"));break}t.push('<span style="color:#6a9955">'.concat(e.slice(n,s+2),"</span>")),n=s+2}else if('"'===e[n]||"'"===e[n]||"`"===e[n]){const s=e[n];let r=n+1;for(;r<e.length&&e[r]!==s;)"\\"===e[r]&&r++,r++;r>=e.length&&(r=e.length),t.push('<span style="color:#ce9178">'.concat(e.slice(n,r+(e[r]===s?1:0)),"</span>")),n=r+(e[r]===s?1:0)}else if(/[0-9]/.test(e[n])&&(0===n||/[\s(){}[\];,:+\-*/%]/.test(e[n-1]))){let s="";for(;n<e.length&&/[0-9.]/.test(e[n]);)s+=e[n],n++;t.push('<span style="color:#4ec9b0">'.concat(s,"</span>"))}else if(/[a-zA-Z_$]/.test(e[n])){let r="";for(;n<e.length&&/[a-zA-Z0-9_$]/.test(e[n]);)r+=e[n],n++;s.has(r)?t.push('<span style="color:#569cd6">'.concat(r,"</span>")):n<e.length&&"("===e[n]?t.push('<span style="color:#dcdcaa">'.concat(r,"</span>")):t.push(r)}else{const s=e[n],r={"#":"#608b4e","@":"#d7ba7d"};t.push(r[s]?'<span style="color:'.concat(r[s],'">').concat(s,"</span>"):s),n++}}return t.join("")}).join("\n")}(o,r);return(0,b.jsxs)("div",{style:{position:"relative",margin:"1.5em 0",borderRadius:"6px",overflow:"hidden",background:"#1e1e1e",borderLeft:"4px solid #e3f988"},children:[r&&(0,b.jsx)("div",{style:{position:"absolute",top:0,right:0,padding:"4px 10px",fontSize:"11px",color:"#22d3ee",background:"#2d2d2d",borderBottomLeftRadius:"6px",textTransform:"uppercase",letterSpacing:"1px",zIndex:3,fontWeight:600},children:r}),(0,b.jsx)("div",{style:{maxHeight:"500px",overflowY:"auto"},children:(0,b.jsxs)("div",{style:{display:"flex",overflowX:"auto",paddingTop:r?"28px":0},children:[(0,b.jsx)("div",{style:{flex:"0 0 auto",textAlign:"right",color:"#858585",userSelect:"none",fontFamily:"'Fira Code', 'Cascadia Code', 'JetBrains Mono', Consolas, monospace",fontSize:"13px",lineHeight:1.5,padding:"12px 0",minWidth:"44px"},children:c.map((e,t)=>(0,b.jsx)("div",{style:{padding:"0 12px"},children:t+1},t))}),(0,b.jsx)("pre",{style:{margin:0,padding:"12px 16px",flex:1,fontFamily:"'Fira Code', 'Cascadia Code', 'JetBrains Mono', Consolas, monospace",fontSize:"13px",lineHeight:1.5,color:"#d4d4d4",whiteSpace:"pre",tabSize:2,border:"none",background:"transparent",boxShadow:"none",borderRadius:0},dangerouslySetInnerHTML:{__html:l}})]})}),(0,b.jsx)("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:"40px",background:"linear-gradient(transparent, #1e1e1e)",pointerEvents:"none",zIndex:2}})]})}function v(e){var t;return"string"===typeof e?e:Array.isArray(e)?e.map(v).join(""):null!==e&&void 0!==e&&null!==(t=e.props)&&void 0!==t&&t.children?v(e.props.children):""}let A=0;function S(e){const t=(0,u.useState)(null),n=(0,o.A)(t,2),y=n[0],S=n[1],k=(0,u.useState)(null),N=(0,o.A)(k,2),C=N[0],I=N[1],z=(0,u.useState)(null),T=(0,o.A)(z,2),F=T[0],R=T[1];var L;switch(e.contentType){case"swe":L=window.findProp("pages.contents.techBlogClass");break;case"music":L=window.findProp("pages.contents.musicBlogClass");break;default:L=window.findProp("pages.contents.genericBlogClass")}const M=e=>{const t=t=>{let n=t.children,o=(0,r.A)(t,j);const a=function(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}(v(n))||"h-".concat(A++);return(0,b.jsx)(e,(0,s.A)((0,s.A)({id:a},o),{},{children:n}))};return t.displayName="Heading".concat(e),t},U={h1:M("h1"),h2:M("h2"),h3:M("h3"),h4:M("h4"),h5:M("h5"),h6:M("h6"),img:e=>(0,b.jsx)("span",{style:{display:"flex",justifyContent:"center",margin:"1.5em 0"},children:(0,b.jsx)("span",{style:{display:"inline-flex",borderRadius:"6px",overflow:"hidden",border:"1px solid #333",boxShadow:"0 2px 8px rgba(0,0,0,0.4)",background:"#1e1e1e",padding:"8px"},children:(0,b.jsx)(l.A,{fluid:!0,loading:"lazy",src:e.src,alt:e.alt||"",style:{borderRadius:"4px",display:"block"}})})}),pre:e=>{let t=e.children;return(0,b.jsx)(b.Fragment,{children:t})},code:e=>(0,b.jsx)(w,(0,s.A)({},e))};return(0,u.useEffect)(()=>{A=0,(0,g.ZF)(e.mdUrl).then(t=>{S(t),I(!1),e.onMdLoaded&&e.onMdLoaded(t)}).catch(e=>{R(e),I(!1)})},[e.mdUrl]),C?(0,b.jsx)("p",{children:"Loading..."}):F?(0,b.jsxs)("p",{children:["Error: ",F.message]}):(0,b.jsxs)(c.A,{className:L,fluid:!0,children:[(0,b.jsxs)(d.A,{children:[e.publishDate?(0,b.jsxs)(i.A,{children:[(0,b.jsx)("b",{children:window.findProp("labels.publishedOn")}),e.publishDate]}):(0,b.jsx)(b.Fragment,{}),e.lastUpdated?(0,b.jsxs)(i.A,{children:[(0,b.jsx)("b",{children:window.findProp("labels.lastUpdated")}),e.lastUpdated]}):(0,b.jsx)(b.Fragment,{})]}),(0,b.jsx)("br",{}),(0,b.jsx)(d.A,{children:(0,b.jsx)(i.A,{children:(0,b.jsx)(a.oz,{remarkPlugins:[p.A,h.A,f.A],components:U,rehypePlugins:[x.A,m.A],children:y})})})]})}},1760(e,t,n){n.r(t),n.d(t,{default:()=>$});var s=n(9379),r=n(5544),o=n(5043),a=n(6322),i=n(3604),c=n(791),l=n(5016),d=n(2729),u=n(4451),p=n(9889),h=n(3519),x=n(1072),m=n(8602),f=n(579);const g=function(e){return(0,f.jsx)(h.A,{fluid:!0,children:(0,f.jsx)(x.A,{className:"justify-content-md-center",children:(0,f.jsx)(m.A,{style:{border:"1px solid",width:"100vw",height:"70vh"},children:(0,f.jsx)("iframe",{width:"100%",height:"100%",src:"https://www.youtube.com/embed/".concat(e.ytId,"?autoplay=1"),allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,title:"Embedded youtube"})})})})};var b=n(184),j=n(8320);function y(e){const t=(0,o.useState)(null),n=(0,r.A)(t,2),s=n[0],a=n[1],i=(0,o.useState)(!0),c=(0,r.A)(i,2),l=c[0],p=c[1],h=(0,o.useState)(null),x=(0,r.A)(h,2),m=x[0],g=x[1];if((0,o.useEffect)(()=>{p(!0),g(null),(0,j.ZF)(e.tab).then(e=>{const t=(0,d.S)(e),n=t.scores,s=t.errors;s.length>0&&console.warn("Score validation errors:",s),a(n[0]),p(!1)}).catch(e=>{g(e),p(!1)})},[e.tab]),l)return(0,f.jsx)("p",{className:"text-slate-400 p-6 font-mono text-xs",children:"Loading context elements..."});if(m)return(0,f.jsxs)("p",{className:"text-rose-500 p-6 font-mono text-xs",children:["Error loading score structure: ",m.message]});console.log(s);const y="undefined"!==typeof window?window.location.href:"",w=null!==s&&void 0!==s&&s.title?"Check out this score: ".concat(s.title):"Check out this score";"https://www.facebook.com/sharer/sharer.php?u=".concat(encodeURIComponent(y)),"https://x.com/intent/tweet?text=".concat(encodeURIComponent(w),"&url=").concat(encodeURIComponent(y)),"https://www.reddit.com/submit?url=".concat(encodeURIComponent(y),"&title=").concat(encodeURIComponent(w)),"https://wa.me/?text=".concat(encodeURIComponent(w+" "+y)),"https://t.me/share/url?url=".concat(encodeURIComponent(y),"&text=").concat(encodeURIComponent(w));return e.tab&&s?(0,f.jsx)("div",{className:"bg-slate-950 min-h-screen text-slate-100 px-2 pt-3 pb-2 flex flex-col gap-2",children:(0,f.jsxs)("div",{className:"mt-0",children:[(0,f.jsxs)("h3",{className:"text-sm font-bold tracking-tight text-slate-300 mb-1",style:{lineHeight:"1.2"},children:["Score Viewer - ",s.title,(0,f.jsx)("a",{href:"/content/guitalele-tab-quick-view",target:"_blank",rel:"noopener noreferrer",className:"ms-1 text-decoration-none",style:{opacity:.4,verticalAlign:"middle"},title:"Tab reading guide",children:(0,f.jsx)(b.__w,{size:11})})]}),(0,f.jsx)(u.A,{scoreData:s,editorMode:!1})]})}):(0,f.jsx)(f.Fragment,{})}function w(e){return(0,f.jsxs)(h.A,{fluid:!0,children:[(0,f.jsx)(x.A,{children:(0,f.jsx)(m.A,{children:(0,f.jsx)(g,{ytId:e.ytId})})}),(0,f.jsx)(x.A,{children:(0,f.jsx)(m.A,{children:(0,f.jsx)("br",{})})}),e.tab?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(x.A,{style:{borderTop:"1px solid"},children:(0,f.jsx)(m.A,{children:(0,f.jsx)("br",{})})}),(0,f.jsx)(x.A,{children:(0,f.jsx)(m.A,{children:(0,f.jsx)(y,{tab:e.tab})})})]}):(0,f.jsx)(f.Fragment,{}),(0,f.jsx)(x.A,{style:{borderTop:"1px solid"},children:(0,f.jsx)(m.A,{children:(0,f.jsx)("br",{})})}),(0,f.jsx)(x.A,{children:(0,f.jsx)(m.A,{children:(0,f.jsx)(p.A,(0,s.A)({},e))})})]})}var v=n(8770),A=n(4282),S=n(7417),k=n(1719),N=n(677),C=n(1800);function I(e){let t=e.contentId;const n=(0,l.A)(),d=n.user,u=n.profile,p=n.signInWithGoogle,h=(0,a.Zp)(),x=(0,a.ok)(),m=(0,r.A)(x,1)[0],g=(0,o.useState)([]),j=(0,r.A)(g,2),y=j[0],w=j[1],I=(0,o.useState)(!0),z=(0,r.A)(I,2),T=z[0],F=z[1],R=(0,o.useState)(""),L=(0,r.A)(R,2),M=L[0],U=L[1],D=(0,o.useState)(""),B=(0,r.A)(D,2),_=B[0],P=B[1],W=(0,o.useState)(null),H=(0,r.A)(W,2),E=H[0],O=H[1],$=(0,o.useState)(!1),q=(0,r.A)($,2),Z=q[0],G=q[1],V=(0,o.useState)(""),X=(0,r.A)(V,2),Y=X[0],J=X[1],Q=(0,o.useState)(0),K=(0,r.A)(Q,2),ee=K[0],te=K[1],ne=(0,o.useState)(!1),se=(0,r.A)(ne,2),re=se[0],oe=se[1],ae=(0,o.useState)(!1),ie=(0,r.A)(ae,2),ce=ie[0],le=ie[1],de="moderator"===(null===u||void 0===u?void 0:u.role),ue=(0,o.useCallback)(async()=>{if(t)try{const e=(0,i.P)((0,i.rJ)(c.db,(0,C.n)("comments")),(0,i._M)("contentId","==",t),(0,i.My)("createdAt","asc")),n=await(0,i.GG)(e);w(n.docs.map(e=>(0,s.A)({id:e.id},e.data())))}catch(e){console.error("Failed to load comments",e)}finally{F(!1)}},[t,de]),pe=(0,o.useCallback)(async()=>{if(t)try{const n=await(0,i.x7)((0,i.H9)(c.db,(0,C.n)("claps"),t));if(n.exists()){var e;const t=n.data();te(t.count||0),d&&oe((null===(e=t.userIds)||void 0===e?void 0:e.includes(d.uid))||!1)}}catch(n){console.error("Failed to load claps",n)}},[t,d]);(0,o.useEffect)(()=>{ue(),pe()},[ue,pe]),(0,o.useEffect)(()=>{if(d&&"1"===m.get("like")){const e=new URL(window.location);e.searchParams.delete("like"),window.history.replaceState({},"",e),he()}},[d,m]);const he=async()=>{le(!0);try{const n=(0,i.H9)(c.db,(0,C.n)("claps"),t),s=await(0,i.x7)(n);if(s.exists()){var e;const t=s.data();if(null!==(e=t.userIds)&&void 0!==e&&e.includes(d.uid))return;await(0,i.BN)(n,{userIds:(0,i.hq)(d.uid),count:(t.count||0)+1},{merge:!0}),oe(!0),te(e=>e+1)}else await(0,i.BN)(n,{userIds:[d.uid],count:1}),oe(!0),te(1)}catch(n){console.error("Failed to clap",n)}finally{le(!1)}},xe=async()=>{le(!0);try{const n=(0,i.H9)(c.db,(0,C.n)("claps"),t),s=await(0,i.x7)(n);if(s.exists()){var e;const t=s.data();null!==(e=t.userIds)&&void 0!==e&&e.includes(d.uid)?(await(0,i.BN)(n,{userIds:(0,i.C3)(d.uid),count:Math.max(0,(t.count||1)-1)},{merge:!0}),oe(!1),te(e=>Math.max(0,e-1))):(await(0,i.BN)(n,{userIds:(0,i.hq)(d.uid),count:(t.count||0)+1},{merge:!0}),oe(!0),te(e=>e+1))}else await(0,i.BN)(n,{userIds:[d.uid],count:1}),oe(!0),te(1)}catch(n){console.error("Failed to clap",n)}finally{le(!1)}},me=async(e,n)=>{e.preventDefault();const s=n?_:M;if(s.trim()){G(!0),J("");try{var r;await(0,i.gS)((0,i.rJ)(c.db,(0,C.n)("comments")),{contentId:t,parentId:n||null,userId:d.uid,userName:d.displayName||(null===(r=d.email)||void 0===r?void 0:r.split("@")[0])||"Anonymous",userPhoto:d.photoURL||(0,N.A)(d.email)||null,text:s.trim(),status:"pending",createdAt:(0,i.O5)()}),n?(P(""),O(null)):U(""),await ue()}catch(e){console.error("Failed to post comment",e.code,e.message),"permission-denied"===e.code?J("Please verify your email before posting comments."):J("Failed to post comment.")}finally{G(!1)}}},fe=e=>d&&e.userId===d.uid,ge=e=>{if(de)return!0;if(d&&e.userId===d.uid)return!0;if("approved"===e.status||!e.status)return!0;if("rejected"===e.status||"deleted"===e.status)return!0;if(e.parentId){const t=y.find(t=>t.id===e.parentId);if("rejected"===(null===t||void 0===t?void 0:t.status)||"deleted"===(null===t||void 0===t?void 0:t.status))return!0}return!1},be=y.filter(e=>!e.parentId&&ge(e)),je=function(e){var t,n,s;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!ge(e))return null;const o="deleted"===e.status||"rejected"===e.status,l="deleted"===e.status?"[removed by the author]":"[removed by a moderator]";return(0,f.jsxs)("div",{className:"d-flex gap-2 mb-2",style:{marginLeft:r>0?"".concat(24*r,"px"):0},children:[(0,f.jsx)(a.N_,{to:"/profile/".concat(e.userId),className:"text-decoration-none flex-shrink-0",style:{marginTop:"2px"},children:o?(0,f.jsx)(b.NBi,{size:r>0?24:36,className:"text-secondary",style:{opacity:.4}}):e.userPhoto?(0,f.jsx)("img",{src:e.userPhoto,alt:"",width:r>0?24:36,height:r>0?24:36,className:"rounded-circle"}):(0,f.jsx)(b.NBi,{size:r>0?24:36,className:"text-secondary"})}),(0,f.jsxs)("div",{className:"flex-grow-1 p-2 rounded",style:{background:r>0?"#252525":"#1e1e1e"},children:[o?(0,f.jsx)("p",{className:"small mb-0",style:{color:"#6c757d",fontStyle:"italic"},children:l}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"d-flex gap-2 align-items-baseline flex-wrap",children:[(0,f.jsx)(a.N_,{to:"/profile/".concat(e.userId),className:"text-decoration-none",children:(0,f.jsx)("strong",{className:"small text-light",children:e.userName})}),(0,f.jsx)("span",{className:"text-secondary",style:{fontSize:"11px"},children:(null===(t=e.createdAt)||void 0===t||null===(n=t.toDate)||void 0===n||null===(s=n.call(t))||void 0===s?void 0:s.toLocaleDateString())||""}),"pending"===e.status?(0,f.jsx)("span",{className:"badge bg-warning text-dark",style:{fontSize:"9px"},children:"Pending"}):"rejected"===e.status?(0,f.jsx)("span",{className:"badge bg-danger",style:{fontSize:"9px"},children:"Rejected"}):null]}),(0,f.jsx)("p",{className:"mb-0 small mt-1",style:{whiteSpace:"pre-wrap"},children:e.text}),(0,f.jsxs)("div",{className:"d-flex gap-2 mt-1 align-items-center",children:[d&&(d.emailVerified||de)&&(0,f.jsx)("button",{className:"btn btn-sm btn-link text-secondary p-0 text-decoration-none",style:{fontSize:"11px"},onClick:()=>{O(E===e.id?null:e.id)},title:"Reply",children:(0,f.jsx)(b.w1Z,{})}),fe(e)&&(0,f.jsx)("button",{className:"btn btn-sm btn-link text-danger p-0 text-decoration-none",style:{fontSize:"11px",lineHeight:1},onClick:()=>(async e=>{if(window.confirm("Remove this comment?"))try{await(0,i.mZ)((0,i.H9)(c.db,(0,C.n)("comments"),e),{status:"deleted",text:""}),await ue()}catch(t){console.error(t)}})(e.id),title:"Delete",children:(0,f.jsx)(b.qbC,{})}),de&&"approved"!==e.status&&(0,f.jsx)("button",{className:"btn btn-sm btn-link text-success p-0 text-decoration-none",style:{fontSize:"11px"},onClick:()=>(async e=>{try{await(0,i.mZ)((0,i.H9)(c.db,(0,C.n)("comments"),e),{status:"approved"}),await ue()}catch(t){console.error(t)}})(e.id),title:"Approve",children:(0,f.jsx)(b.CMH,{})}),de&&"rejected"!==e.status&&(0,f.jsx)("button",{className:"btn btn-sm btn-link text-warning p-0 text-decoration-none",style:{fontSize:"11px"},onClick:()=>(async e=>{try{await(0,i.mZ)((0,i.H9)(c.db,(0,C.n)("comments"),e),{status:"rejected"}),await ue()}catch(t){console.error(t)}})(e.id),title:"Reject",children:(0,f.jsx)(b.Rqy,{})})]}),E===e.id&&(0,f.jsxs)(v.A,{onSubmit:t=>me(t,e.id),className:"mt-2",children:[(0,f.jsx)("div",{className:"d-flex gap-2",children:(0,f.jsx)(v.A.Group,{className:"flex-grow-1",children:(0,f.jsx)(v.A.Control,{as:"textarea",rows:2,placeholder:"Reply to ".concat(e.userName,"..."),value:_,onChange:e=>P(e.target.value),className:"text-light border-secondary",style:{background:"#2a2a2a",borderRadius:"6px",fontSize:"13px"},required:!0})})}),(0,f.jsx)("div",{className:"text-end mt-1",children:(0,f.jsx)(A.A,{type:"submit",size:"sm",disabled:Z||!_.trim(),style:{fontSize:"12px"},children:Z?"Posting...":"Reply"})})]})]}),(u=e.id,y.filter(e=>e.parentId===u&&ge(e))).map(e=>je(e,r+1))]})]},e.id);var u};return(0,f.jsxs)("div",{className:"mt-5",style:{borderTop:"1px solid #333",paddingTop:"2rem"},children:[(0,f.jsxs)("div",{className:"d-flex align-items-center justify-content-between mb-4",children:[(0,f.jsx)("h5",{className:"mb-0",children:"Comments"}),(0,f.jsxs)("div",{className:"d-flex align-items-center gap-3",children:[de&&(0,f.jsxs)("span",{className:"badge bg-warning text-dark",style:{fontSize:"10px"},children:[y.filter(e=>"pending"===e.status).length," pending"]}),(0,f.jsxs)("button",{className:"btn btn-sm ".concat(re?"btn-warning":"btn-outline-secondary"),onClick:()=>{d?xe():h("/login?redirect="+encodeURIComponent(window.location.pathname)+"&like=1")},disabled:ce,title:d?"Like this article":"Sign in to like",children:[re?(0,f.jsx)(b.gb0,{className:"me-1"}):(0,f.jsx)(b.U2A,{className:"me-1"}),ee>0&&(0,f.jsx)("span",{children:ee})]})]})]}),T?(0,f.jsx)("div",{className:"text-center py-4",children:(0,f.jsx)(S.A,{animation:"border",variant:"light",size:"sm"})}):0===be.length?(0,f.jsx)("p",{className:"text-secondary small mb-4",children:"No comments yet."}):(0,f.jsx)("div",{className:"mb-4",children:be.map(e=>je(e))}),d?d.emailVerified?(0,f.jsxs)(v.A,{onSubmit:e=>me(e,null),children:[(0,f.jsxs)("div",{className:"d-flex gap-2",children:[(0,f.jsx)(a.N_,{to:"/profile/".concat(d.uid),className:"text-decoration-none flex-shrink-0",children:d.photoURL?(0,f.jsx)("img",{src:d.photoURL||(0,N.A)(d.email),alt:"",width:32,height:32,className:"rounded-circle"}):(0,f.jsx)(b.NBi,{size:32,className:"text-secondary"})}),(0,f.jsx)(v.A.Group,{className:"flex-grow-1 mb-2",children:(0,f.jsx)(v.A.Control,{as:"textarea",rows:3,placeholder:"Write a comment...",value:M,onChange:e=>U(e.target.value),className:"text-light border-secondary",style:{background:"#2a2a2a",borderRadius:"6px"},required:!0})})]}),Y&&(0,f.jsx)(k.A,{variant:"danger",className:"py-1 small",children:Y}),(0,f.jsx)("div",{className:"text-end",children:(0,f.jsx)(A.A,{type:"submit",disabled:Z||!M.trim(),children:Z?"Posting...":"Post Comment"})})]}):(0,f.jsx)(k.A,{variant:"warning",className:"py-2 small mb-0",children:"Please verify your email before posting comments."}):(0,f.jsxs)("div",{className:"d-flex align-items-center gap-2 text-secondary small",children:[(0,f.jsx)(b.DSS,{})," ",(0,f.jsx)(A.A,{variant:"link",size:"sm",onClick:p,className:"p-0",children:"Sign in with Google"})," to leave a comment."]})]})}var z=n(5754);const T={position:"sticky",top:"60px",maxHeight:"calc(100vh - 80px)",overflowY:"auto",padding:"1rem 0.5rem",fontSize:"13px",borderRight:"1px solid rgba(255,255,255,0.06)"},F={color:"#8892b0",textDecoration:"none",display:"block",padding:"3px 8px",borderRadius:"4px",transition:"all 0.15s"};function R(e){let t=e.content,n=e.seriesArticles,r=e.headings;if(e.error)return null;if(null!==t&&void 0!==t&&t.series){const e=[...n].sort((e,t)=>e.seriesOrder-t.seriesOrder);return(0,f.jsxs)("div",{style:T,children:[(0,f.jsxs)("div",{style:{fontSize:"11px",textTransform:"uppercase",letterSpacing:"1px",color:"#6c757d",marginBottom:"12px"},children:["Series: ",t.series]}),(0,f.jsxs)("div",{style:{fontSize:"10px",color:"#6c757d",marginBottom:"8px"},children:[e.length," parts"]}),e.map(e=>{const n=e.id===t.id;return(0,f.jsxs)(a.N_,{to:"/content/".concat(e.id),style:(0,s.A)((0,s.A)({},F),{},{background:n?"rgba(34,211,238,0.1)":"transparent",color:n?"#22d3ee":"#8892b0",fontWeight:n?600:400,borderLeft:n?"2px solid #22d3ee":"2px solid transparent",marginBottom:"2px"}),children:[(0,f.jsxs)("span",{style:{color:"#6c757d",marginRight:"6px"},children:["#",e.seriesOrder]}),e.title.length>45?e.title.slice(0,45)+"\u2026":e.title]},e.id)})]})}return r&&r.length>0?(0,f.jsxs)("div",{style:T,children:[(0,f.jsx)("div",{style:{fontSize:"11px",textTransform:"uppercase",letterSpacing:"1px",color:"#6c757d",marginBottom:"12px"},children:"On This Page"}),r.map((e,t)=>(0,f.jsx)("a",{href:"#".concat((0,z.Yv)(e.text)),style:(0,s.A)((0,s.A)({},F),{},{paddingLeft:"".concat(8+16*(e.level-1),"px"),fontSize:1===e.level?"13px":2===e.level?"12px":"11px"}),children:e.text},t))]}):null!==t&&void 0!==t&&t.title?(0,f.jsxs)("div",{style:T,children:[(0,f.jsx)("div",{style:{fontSize:"11px",textTransform:"uppercase",letterSpacing:"1px",color:"#6c757d",marginBottom:"12px"},children:"Article"}),(0,f.jsx)("div",{style:{color:"#e2e8f0",fontWeight:600,fontSize:"14px",lineHeight:1.4},children:t.title}),t.publishDate&&(0,f.jsx)("div",{style:{color:"#6c757d",fontSize:"11px",marginTop:"8px"},children:t.publishDate})]}):null}const L={position:"sticky",top:"60px",maxHeight:"calc(100vh - 80px)",overflowY:"auto",padding:"1rem 0.5rem",fontSize:"13px",borderLeft:"1px solid rgba(255,255,255,0.06)"},M={marginBottom:"1.25rem"},U={fontSize:"11px",textTransform:"uppercase",letterSpacing:"1px",color:"#6c757d",marginBottom:"8px"},D={padding:"8px 10px",borderRadius:"6px",background:"rgba(255,255,255,0.03)",marginBottom:"6px",border:"1px solid rgba(255,255,255,0.06)",cursor:"pointer",transition:"background 0.15s",display:"block",textDecoration:"none",color:"inherit"},B={display:"block",padding:"4px 8px",color:"#8892b0",textDecoration:"none",borderRadius:"4px",fontSize:"12px",lineHeight:1.4,transition:"background 0.15s"};function _(e){return e.sortBy?new Date(e.sortBy).getTime():e.publishDate?new Date(e.publishDate).getTime():0}function P(e){let t=e.allContents;e.contentType;const n={},s=[];for(const r of t)r.series?(n[r.series]||(n[r.series]=[]),n[r.series].push(r)):s.push(r);const o=Object.entries(n).map(e=>{let t=(0,r.A)(e,2),n=t[0],s=t[1];return{name:n,articles:s.sort((e,t)=>e.seriesOrder-t.seriesOrder),latestDate:Math.max(...s.map(e=>_(e))),count:s.length}}).sort((e,t)=>t.latestDate-e.latestDate),i=s.filter(e=>_(e)>0).sort((e,t)=>_(t)-_(e));return(0,f.jsx)("div",{style:L,children:(0,f.jsxs)("div",{style:M,children:[(0,f.jsx)("div",{style:U,children:"Latest on This Space"}),o.map(e=>(0,f.jsxs)(a.N_,{to:"/content/".concat(e.articles[0].id),style:D,onMouseEnter:e=>e.currentTarget.style.background="rgba(255,255,255,0.06)",onMouseLeave:e=>e.currentTarget.style.background="rgba(255,255,255,0.03)",children:[(0,f.jsx)("div",{style:{color:"#38bdf8",fontWeight:600,fontSize:"12px",marginBottom:"2px"},children:e.name}),(0,f.jsxs)("div",{style:{color:"#6c757d",fontSize:"10px"},children:[e.count," ",1===e.count?"part":"parts"]})]},e.name)),i.slice(0,8).map(e=>(0,f.jsx)(a.N_,{to:"/content/".concat(e.id),style:B,onMouseEnter:e=>e.currentTarget.style.background="rgba(255,255,255,0.03)",onMouseLeave:e=>e.currentTarget.style.background="transparent",children:e.title},e.id))]})})}var W=n(266);const H={facebook:(0,f.jsx)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"currentColor",children:(0,f.jsx)("path",{d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"})}),x:(0,f.jsx)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"currentColor",children:(0,f.jsx)("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})}),reddit:(0,f.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",children:[(0,f.jsx)("circle",{cx:"12",cy:"12",r:"11",stroke:"currentColor",strokeWidth:"1.2"}),(0,f.jsx)("circle",{cx:"9.2",cy:"11.8",r:"1.3",stroke:"currentColor",strokeWidth:"0.8",fill:"none"}),(0,f.jsx)("circle",{cx:"14.8",cy:"11.8",r:"1.3",stroke:"currentColor",strokeWidth:"0.8",fill:"none"}),(0,f.jsx)("path",{d:"M8.5 15.5c.8.8 2 1.3 3.5 1.3s2.7-.5 3.5-1.3",stroke:"currentColor",strokeWidth:"0.8",strokeLinecap:"round",fill:"none"}),(0,f.jsx)("path",{d:"M12 3.5l-1.5 4",stroke:"currentColor",strokeWidth:"0.8",strokeLinecap:"round",fill:"none"}),(0,f.jsx)("circle",{cx:"16.5",cy:"6",r:"0.6",fill:"currentColor"}),(0,f.jsx)("path",{d:"M16.5 6L14 7.5",stroke:"currentColor",strokeWidth:"0.5",fill:"none"})]}),whatsapp:(0,f.jsx)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"currentColor",children:(0,f.jsx)("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"})}),telegram:(0,f.jsx)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"currentColor",children:(0,f.jsx)("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})})},E=[{name:"Facebook",color:"#1877F2",svg:"facebook"},{name:"X",color:"#aaa",svg:"x"},{name:"Reddit",color:"#FF4500",svg:"reddit"},{name:"WhatsApp",color:"#25D366",svg:"whatsapp"},{name:"Telegram",color:"#0088cc",svg:"telegram"}];function O(e){let t=e.url,n=e.title;const s=encodeURIComponent(t||("undefined"!==typeof window?window.location.href:"")),r=encodeURIComponent(n||"Check out this score"),o={Facebook:"https://www.facebook.com/sharer/sharer.php?u=".concat(s),X:"https://x.com/intent/tweet?text=".concat(r,"&url=").concat(s),Reddit:"https://www.reddit.com/submit?url=".concat(s,"&title=").concat(r),WhatsApp:"https://wa.me/?text=".concat(encodeURIComponent((n||"Check out this score")+" "+(t||("undefined"!==typeof window?window.location.href:"")))),Telegram:"https://t.me/share/url?url=".concat(s,"&text=").concat(r)};return(0,f.jsxs)("div",{className:"d-flex gap-1 align-items-center flex-wrap",children:[(0,f.jsx)("style",{children:'.create-score-btn{position:relative;overflow:hidden}.create-score-btn::after{content:"";position:absolute;inset:0;background:linear-gradient(105deg,transparent 30%,rgba(255,255,255,0.35) 50%,transparent 70%);animation:shimmer 2.5s infinite}@keyframes shimmer{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}'}),E.map(e=>(0,f.jsx)("button",{onClick:()=>window.open(o[e.name],"_blank","noopener,noreferrer,width=600,height=500"),title:"Share on ".concat(e.name),style:{width:"22px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",background:"transparent",border:"1px solid ".concat(e.color),borderRadius:"3px",color:e.color,cursor:"pointer",opacity:.7},onMouseEnter:e=>e.currentTarget.style.opacity="1",onMouseLeave:e=>e.currentTarget.style.opacity="0.7",children:H[e.svg]},e.name)),(0,f.jsx)("a",{href:"/tab-parser",className:"create-score-btn fw-bold text-decoration-none d-inline-flex align-items-center justify-content-center",style:{height:"20px",fontSize:"10px",padding:"0 8px",borderRadius:"3px",background:"linear-gradient(90deg, #22d3ee, #10b981)",color:"#fff",border:"none",cursor:"pointer",boxShadow:"0 0 10px rgba(34,197,94,0.4)",transition:"transform 0.15s, boxShadow 0.15s"},onMouseEnter:e=>{e.currentTarget.style.transform="scale(1.08)",e.currentTarget.style.boxShadow="0 0 16px rgba(34,197,94,0.6)"},onMouseLeave:e=>{e.currentTarget.style.transform="scale(1)",e.currentTarget.style.boxShadow="0 0 10px rgba(34,197,94,0.4)"},children:"+ Create"})]})}function $(){const e=(0,o.useState)(null),t=(0,r.A)(e,2),n=t[0],b=t[1],v=(0,o.useState)(null),A=(0,r.A)(v,2),N=A[0],T=A[1],F=(0,o.useState)(null),L=(0,r.A)(F,2),M=L[0],U=L[1],D=(0,o.useState)(null),B=(0,r.A)(D,2),_=B[0],H=B[1],E=(0,o.useState)(null),$=(0,r.A)(E,2),q=$[0],Z=$[1],G=(0,o.useState)(null),V=(0,r.A)(G,2),X=V[0],Y=V[1],J=(0,o.useState)(null),Q=(0,r.A)(J,2),K=Q[0],ee=Q[1],te=(0,o.useState)(null),ne=(0,r.A)(te,2),se=ne[0],re=ne[1],oe=(0,o.useState)(null),ae=(0,r.A)(oe,2),ie=ae[0],ce=ae[1],le=(0,o.useState)(null),de=(0,r.A)(le,2),ue=de[0],pe=de[1],he=(0,o.useState)(null),xe=(0,r.A)(he,2),me=xe[0],fe=xe[1],ge=(0,o.useState)(!1),be=(0,r.A)(ge,2),je=be[0],ye=be[1],we=(0,o.useState)(null),ve=(0,r.A)(we,2),Ae=ve[0],Se=ve[1],ke=(0,o.useState)([]),Ne=(0,r.A)(ke,2),Ce=Ne[0],Ie=Ne[1],ze=(0,o.useState)([]),Te=(0,r.A)(ze,2),Fe=Te[0],Re=Te[1],Le=(0,o.useState)(""),Me=(0,r.A)(Le,2),Ue=(Me[0],Me[1]);let De=(0,a.g)();const Be=(0,l.A)().user,_e=async e=>{Y(null),ye(!0);try{const t="score_"+e;let n=(0,j.Z2)(t);if(!n){const r=await(0,i.x7)((0,i.H9)(c.db,(0,C.n)("scores"),e));if(!r.exists())return console.error("Score doc not found:",e),void Y({message:"Score not found."});n=(0,s.A)({id:r.id},r.data()),(0,j.fb)(t,n)}if(!n.published&&n.userId!==(null===Be||void 0===Be?void 0:Be.uid))return console.error("Score unpublished:",{owner:n.userId,viewer:null===Be||void 0===Be?void 0:Be.uid}),void Y({message:"Score not found."});const r=e=>e?new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):null,o=r(n.createdAt),a=r(n.updatedAt);o&&o===a?(ee(o),re(null)):(ee(o),re(a)),ce(n.username||n.userId||null),pe(n.instrument||null),T("music");const l="=".repeat(80)+"\nScore: "+n.name+"\nTime Signature: "+n.timeSignature+"\nInstrument: "+n.instrument+"\nCapo: "+(n.capo||0)+"\nDescription: "+(n.desc||"")+"\n"+"=".repeat(80)+"\n"+n.rawShorthand,u=(0,d.S)(l),p=u.scores,h=u.errors;h.length>0&&console.warn("Score validation errors:",h),fe(p&&p.length>0?p[0]:null),b("user-score")}catch(t){console.error("Failed to load score",t.code,t.message),Y({message:"Failed to load score."})}finally{ye(!1)}};(0,o.useEffect)(()=>{const e=De.contentId,t=De.username,n=De.instrument,s=De.titleSlug;if(t&&n&&s){const e="".concat(t,":").concat(n,":").concat(s);return void _e(e)}if(e&&e.startsWith("u-")){const t=e.slice(2);return void _e(t)}fe(null);const r=(0,z.y9)();Ie(r);var o=r.find(t=>t.id===e);if(o)Se(o),o.mdUrl&&o.videoId?b("both"):o.mdUrl&&!o.videoId?b("markdown"):!o.mdUrl&&o.videoId?b("video"):b(void 0),re(o.lastUpdated),ee(o.publishDate),T(o.contentType),H(o.mdUrl),U(o.videoId),Z(o.tab);else{const e=(0,W.P$)(),t=0===r.length&&e?function(e){if(!e)return"Content data failed to load.";const t=e.toLowerCase();return t.includes("cors")?"The site is not allowed to fetch content.":t.includes("failed to fetch")||t.includes("networkerror")?"Content blocked by browser.":t.includes("http 404")||t.includes("not found")?"Content not found (404).":t.includes("http 403")||t.includes("forbidden")?"Access forbidden (403).":t.includes("http 500")||t.includes("internal server")?"Server error (500).":"Content data failed to load: ".concat(e)}(e):window.findProp("labels.contentNotExists");Y({message:t})}},[De.contentId,De.username,De.instrument,De.titleSlug,Be]);const Pe=e=>{Ue(e),Re((0,z.HV)(e))};if(X)return(0,f.jsx)(h.A,{className:"mt-4",children:(0,f.jsx)(k.A,{variant:"danger",children:X.message})});if(je)return(0,f.jsx)(h.A,{className:"text-center mt-5",children:(0,f.jsx)(S.A,{animation:"border",variant:"light"})});if("user-score"===n)return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(h.A,{fluid:!0,children:[(0,f.jsxs)(x.A,{className:"mt-3 align-items-center",children:[(0,f.jsxs)(m.A,{xs:"auto",children:[(0,f.jsx)("b",{children:"Created: "}),K]}),se?(0,f.jsxs)(m.A,{xs:"auto",children:[(0,f.jsx)("b",{children:"Last updated: "}),se]}):(0,f.jsx)(f.Fragment,{}),ue?(0,f.jsxs)(m.A,{xs:"auto",children:[(0,f.jsx)("b",{children:"Instrument: "}),ue]}):(0,f.jsx)(f.Fragment,{}),ie?(0,f.jsxs)(m.A,{xs:"auto",children:[(0,f.jsx)("b",{children:"By: "}),(0,f.jsx)("a",{href:"/profile/".concat(ie.startsWith("@")?ie:"@"+ie),className:"text-info text-decoration-none",children:ie})]}):(0,f.jsx)(f.Fragment,{}),(0,f.jsx)(m.A,{}),(0,f.jsx)(m.A,{xs:"auto",children:(0,f.jsx)(O,{})})]}),(0,f.jsx)(u.A,{scoreData:me})]}),(0,f.jsx)(I,{contentId:De.contentId})]});const We=(()=>{switch(n){case"markdown":return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(p.A,{lastUpdated:se,publishDate:K,contentType:N,mdUrl:_,onMdLoaded:Pe}),q?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("br",{}),(0,f.jsx)(x.A,{style:{borderTop:"1px solid"},children:(0,f.jsx)(m.A,{children:(0,f.jsx)("br",{})})}),(0,f.jsx)(y,{tab:q})]}):(0,f.jsx)(f.Fragment,{})]});case"video":return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(g,{ytId:M,tab:q}),q?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("br",{}),(0,f.jsx)(x.A,{style:{borderTop:"1px solid"},children:(0,f.jsx)(m.A,{children:(0,f.jsx)("br",{})})}),(0,f.jsx)(y,{tab:q})]}):(0,f.jsx)(f.Fragment,{})]});case"both":return(0,f.jsx)(w,{lastUpdated:se,publishDate:K,contentType:N,ytId:M,mdUrl:_,tab:q,onMdLoaded:Pe});default:return q?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(x.A,{className:"align-items-center",children:[K?(0,f.jsxs)(m.A,{xs:"auto",children:[(0,f.jsx)("b",{children:window.findProp("labels.publishedOn")}),K]}):(0,f.jsx)(f.Fragment,{}),se?(0,f.jsxs)(m.A,{xs:"auto",children:[(0,f.jsx)("b",{children:window.findProp("labels.lastUpdated")}),se]}):(0,f.jsx)(f.Fragment,{}),(0,f.jsx)(m.A,{}),(0,f.jsx)(m.A,{xs:"auto",children:(0,f.jsx)(O,{})})]}),(0,f.jsx)(y,{tab:q})]}):(0,f.jsx)("div",{children:"Unknown Content Type"})}})(),He=Ce.filter(e=>e.contentType===(null===Ae||void 0===Ae?void 0:Ae.contentType)),Ee=null!==Ae&&void 0!==Ae&&Ae.series?He.filter(e=>e.series===Ae.series):[];return(0,f.jsx)(h.A,{fluid:!0,children:(0,f.jsxs)(x.A,{children:[(0,f.jsx)(m.A,{md:3,className:"d-none d-md-block",children:(0,f.jsx)(R,{content:Ae,seriesArticles:Ee,headings:Fe,error:X})}),(0,f.jsxs)(m.A,{md:6,children:[We,(0,f.jsx)(I,{contentId:De.contentId})]}),(0,f.jsx)(m.A,{md:3,className:"d-none d-md-block",children:(0,f.jsx)(P,{allContents:He,contentType:N})})]})})}},1616(e,t,n){n.d(t,{A:()=>c});var s=n(184),r=n(7196),o=n(8602),a=n(1072),i=n(579);function c(){return(0,i.jsx)(a.A,{children:(0,i.jsxs)(o.A,{children:[(0,i.jsx)("a",{className:"m-3 ms-0",href:"https://linkedin.com/in/palash90",target:"_blank",rel:"noreferrer",children:(0,i.jsx)(s.QEs,{})}),(0,i.jsx)("a",{className:"m-3 ms-0",href:"https://www.youtube.com/@GuitaleleTutorials",target:"_blank",rel:"noreferrer",children:(0,i.jsx)(s.Vk6,{})}),(0,i.jsx)("a",{className:"m-3 ms-0",href:"https://github.com/palash90",target:"_blank",rel:"noreferrer",children:(0,i.jsx)(s.hL4,{})}),(0,i.jsx)("a",{className:"button m-3 ms-0",href:"mailto:connect@palashkantikundu.in",target:"_blank",rel:"noreferrer",children:(0,i.jsx)(r.YDm,{})})]})})}},2729(e,t,n){n.d(t,{S:()=>i});const s=e=>{if(!e)return null;const t=e.trim().toUpperCase();return"O"===t?0:"X"===t?null:parseInt(t,10)},r={s:.25,e:.5,"e.":.75,q:1,"q.":1.5,h:2,"h.":3,w:4,"w.":6},o=e=>{if(!e)return 4;const t=e.split("/"),n=parseInt(t[0],10),s=parseInt(t[1],10);return isNaN(n)||isNaN(s)?4:n*(4/s)},a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n={duration:1};let o=e.trim();const a=o.indexOf("d:");-1!==a&&(n.description=o.substring(a+2),o=o.substring(0,a)),o.includes("t")&&(n.tie=!0,o=o.replace("t",""));const i=o.match(/v(\d+)/);i&&(n.voice=parseInt(i[1],10),o=o.replace(/v\d+/,""));const c=o.match(/^(\d+|[OXox])f(\d+)s([whqes]\.?)$/i);if(c){const e=s(c[1]);n.fret=null!==e?e+t:null,n.string=parseInt(c[2],10);const o=c[3].toLowerCase();return n.duration=r[o]||1,n}const l=o.match(/@([whqes]\.?)/);if(l){const e=l[1];n.duration=r[e]||parseFloat(e),o=o.split("@")[0]}if(o.startsWith("-")){const e=o.match(/^-([whqes]\.?)/i);if(e){const t=e[1].toLowerCase();n.duration=r[t]||n.duration}return n.isRest=!0,n}if(o.startsWith("[")){const e=o.lastIndexOf("]"),t=o.substring(e+1).toLowerCase();t&&r[t]&&(n.duration=r[t]);const a=o.slice(1,e).split(/[\s|]+/).filter(Boolean);return n.pitches=a.map(e=>{const t=e.match(/^(\d+|[OXox])f(\d+)s?$/i);if(t)return{fret:s(t[1]),string:parseInt(t[2],10)};const n=e.split(":");return{fret:s(n[0]),string:parseInt(n[1],10)}}),n}if(o.includes(":")){const e=o.split(":");n.string=parseInt(e[1],10);const r=s(e[0].trim());return n.fret=null!==r?r+t:null,n}return n},i=e=>{const t=e.split("\n"),n=[],s=[];let r=null;for(let i=0;i<t.length;i++){const e=t[i].trim();if(e&&!e.startsWith("==")&&!e.startsWith("GUITALELE TAB"))if(e.startsWith("Score:"))r&&n.push(r),r={id:"",title:e.replace("Score:","").trim(),instrument:"",timeSignature:"4/4",measures:[],capo:0};else if(r){if(e.startsWith("ID:")){r.id=e.replace("ID:","").trim();continue}if(e.startsWith("Instrument:")){r.instrument=e.replace("Instrument:","").trim();continue}if(e.startsWith("Time Signature:")){r.timeSignature=e.replace("Time Signature:","").trim();continue}if(e.startsWith("Description:")){r.description=e.replace("Description:","").trim();continue}if(e.startsWith("Capo:")){const t=e.replace("Capo:","").trim();r.capo=parseInt(t,10)||0;continue}let t,n;const i=e.match(/^(?:Measure|M)\s*(\d+):\s*(.*)$/i);if(i)t=parseInt(i[1],10),n=i[2];else{t=(r.measures.length>0?r.measures[r.measures.length-1].measureNumber:0)+1,n=e}const c=n.match(/\[[^\]]+\][^\s]*|[^\s|]+/g)||[],l=[];let d=0;for(const e of c){e.startsWith("[")&&!e.includes("]")&&s.push("Measure ".concat(t,': missing closing bracket in "').concat(e,'".'));const n=a(e,r.capo);if(void 0!==n.fret||n.isRest||n.pitches||s.push("Measure ".concat(t,': unrecognized token "').concat(e,'".')),void 0!==n.string&&(isNaN(n.string)||n.string<1||n.string>6)&&s.push("Measure ".concat(t,": string ").concat(n.string,' in "').concat(e,'" is out of range (1-6).')),n.pitches)for(const r of n.pitches)void 0!==r.string&&(isNaN(r.string)||r.string<1||r.string>6)&&s.push("Measure ".concat(t,": string ").concat(r.string,' in chord "').concat(e,'" is out of range (1-6).'));l.push(n),d+=n.duration}if(l.length>0){const e=o(r.timeSignature);Math.abs(d-e)>.01&&s.push("Measure ".concat(t,": expected ").concat(e," beat(s) but got ").concat(d,". Check your durations."))}r.measures.push({measureNumber:t,notes:l})}}if(r&&n.push(r),0===n.length)throw new Error("No valid scores could be processed. Verify format headers.");return{scores:n,errors:s}}},8320(e,t,n){n.d(t,{Z2:()=>o,ZF:()=>i,fb:()=>a});const s="content_",r=864e5;function o(e){try{const t=localStorage.getItem(s+e);if(!t)return null;const n=JSON.parse(t),r=n.data,o=n.expiry;return Date.now()>o?(localStorage.removeItem(s+e),null):r}catch(t){return null}}function a(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r;try{localStorage.setItem(s+e,JSON.stringify({data:t,expiry:Date.now()+n}))}catch(o){}}async function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r;const n=o(e);if(null!==n)return n;const s=function(e){const t=e.match(/^https:\/\/([^.]+)\.github\.io\/([^/]+)\/(.+)$/);return t?"https://raw.githubusercontent.com/".concat(t[1],"/").concat(t[2],"/main/").concat(t[3]):null}(e);try{const n=await fetch(e);if(!n.ok)throw new Error("Failed to fetch ".concat(e," (").concat(n.status," ").concat(n.statusText,")"));const s=await n.text();return a(e,s,t),s}catch(i){if(s)try{const n=await fetch(s);if(!n.ok)throw new Error("Failed to fetch ".concat(s," (").concat(n.status," ").concat(n.statusText,")"));const r=await n.text();return a(e,r,t),r}catch(c){throw new Error("Primary: ".concat(i.message," | Fallback: ").concat(c.message))}throw i}}},5754(e,t,n){n.d(t,{HV:()=>i,Yv:()=>c,aY:()=>r,az:()=>o,y9:()=>a});var s=n(9379);function r(){return(window.findProp("contents.swe")||[]).map(e=>(0,s.A)((0,s.A)({},e),{},{contentType:"swe"}))}function o(){return(window.findProp("contents.music")||[]).map(e=>(0,s.A)((0,s.A)({},e),{},{contentType:"music"}))}function a(){return[...r(),...o(),...(window.findProp("contents.drafts")||[]).map(e=>(0,s.A)((0,s.A)({},e),{},{contentType:e.contentType||"swe"}))]}function i(e){if(!e)return[];const t=e.split("\n"),n=[];for(const s of t){const e=s.match(/^(#{1,6})\s+(.+)$/);if(e){const t=e[2].trim().replace(/\*\*([^*]+)\*\*/g,"$1").replace(/\*([^*]+)\*/g,"$1").replace(/__([^_]+)__/g,"$1").replace(/_([^_]+)_/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1");n.push({level:e[1].length,text:t})}}return n}function c(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}},4196(e,t,n){n.d(t,{A:()=>p});var s=n(9379),r=n(45),o=n(8139),a=n.n(o),i=n(5043),c=n(7852),l=n(579);const d=["bsPrefix","className","striped","bordered","borderless","hover","size","variant","responsive"],u=i.forwardRef((e,t)=>{let n=e.bsPrefix,o=e.className,i=e.striped,u=e.bordered,p=e.borderless,h=e.hover,x=e.size,m=e.variant,f=e.responsive,g=(0,r.A)(e,d);const b=(0,c.oU)(n,"table"),j=a()(o,b,m&&"".concat(b,"-").concat(m),x&&"".concat(b,"-").concat(x),i&&"".concat(b,"-").concat("string"===typeof i?"striped-".concat(i):"striped"),u&&"".concat(b,"-bordered"),p&&"".concat(b,"-borderless"),h&&"".concat(b,"-hover")),y=(0,l.jsx)("table",(0,s.A)((0,s.A)({},g),{},{className:j,ref:t}));if(f){let e="".concat(b,"-responsive");return"string"===typeof f&&(e="".concat(e,"-").concat(f)),(0,l.jsx)("div",{className:e,children:y})}return y});u.displayName="Table";const p=u}}]);
//# sourceMappingURL=181.e8c5933d.chunk.js.map