1import{e as x,r as c,j as e,an as m,B as u,d as v,F as h,J as f}from"./index-_aijvlUq.js";import{h as j}from"./helpRequests-Bol7uyz2.js";import{d as g}from"./helpWanted-C0itiuLN.js";import{P as b}from"./PrintSheet-BwuplKw5.js";function p({children:t}){return e.jsxs(e.Fragment,{children:[e.jsx(m,{}),e.jsx("div",{className:"min-h-[80vh] flex items-center justify-center text-gray-500 text-base px-6 text-center",children:t})]})}const N=` 2 #volunteer-sheet .vs-lead { font-size: 13px; margin: 0 0 6px; } 3 #volunteer-sheet .vs-job { margin-top: 16px; break-inside: avoid; page-break-inside: avoid; } 4 #volunteer-sheet .vs-job h2 { font-size: 15px; color: #163d55; margin: 0; font-weight: 700; } 5 #volunteer-sheet .vs-count { font-weight: 400; color: #555; font-size: 13px; margin-left: 8px; } 6 #volunteer-sheet .vs-when, #volunteer-sheet .vs-note { font-size: 12px; color: #444; margin: 2px 0 0; } 7 #volunteer-sheet table.vs-spots { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 13px; } 8 #volunteer-sheet .vs-spots th { text-align: left; border-bottom: 1.5px solid #163d55; color: #163d55; padding: 3px 6px 3px 0; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; } 9 #volunteer-sheet .vs-spots td { border-bottom: 1px solid #99a3ab; padding: 0 6px 0 0; height: 30px; vertical-align: middle; } 10 #volunteer-sheet .vs-spots tr.vs-open td { height: 36px; } 11 #volunteer-sheet .vs-num { width: 22px; color: #555; } 12 #volunteer-sheet .vs-contact { width: 38%; } 13 #volunteer-sheet .vs-came { width: 44px; text-align: center; } 14 #volunteer-sheet .vs-box { display: inline-block; width: 16px; height: 16px; border: 1.5px solid #163d55; } 15 #volunteer-sheet .vs-who { color: #555; } 16 #volunteer-sheet .vs-onfile { color: #888; font-size: 12px; } 17`;function w({sheet:t,screen:a=!1}){const l=[t.date?v(t.date):null,t.time?h(t.time):null,t.venue].filter(Boolean).join(" · ");return e.jsx(b,{id:"volunteer-sheet",sheetName:"Volunteer sign-up",concert:{title:t.title,performanceDate:t.date},subtitle:l,css:N,screen:a,orgName:t.orgName,children:e.jsxs("div",{"data-testid":"volunteer-sheet",children:[e.jsxs("p",{className:"vs-lead",children:["Can you help? Write your name and a phone or email in an open spot. On the day, tick ",e.jsx("strong",{children:"Came"})," beside each person."]}),t.jobs.length===0&&e.jsx("p",{className:"vs-lead",children:"No jobs yet."}),t.jobs.map(s=>{const i=[s.neededOn?f(s.neededOn):null,s.startTime?h(s.startTime):null,g(s.hoursEach)].filter(Boolean).join(" · "),r=Math.max(0,s.spots-s.people.length);return e.jsxs("section",{className:"vs-job","data-testid":`sheet-job-${s.id}`,children:[e.jsxs("h2",{children:[s.title,e.jsx("span",{className:"vs-count",children:r===0?`All ${s.spots} filled`:`${r} of ${s.spots} open`})]}),i&&e.jsx("p",{className:"vs-when",children:i}),s.description&&e.jsx("p",{className:"vs-note",children:s.description}),e.jsxs("table",{className:"vs-spots",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"vs-num",children:"#"}),e.jsx("th",{children:"Name"}),e.jsx("th",{className:"vs-contact",children:"Phone or email"}),e.jsx("th",{className:"vs-came",children:"Came"})]})}),e.jsxs("tbody",{children:[s.people.map((o,n)=>e.jsxs("tr",{children:[e.jsx("td",{className:"vs-num",children:n+1}),e.jsxs("td",{children:[e.jsx("strong",{children:o.name}),o.note&&e.jsxs("span",{className:"vs-who",children:[" (",o.note,")"]})]}),e.jsx("td",{className:"vs-contact",children:e.jsx("span",{className:"vs-onfile",children:"On file"})}),e.jsx("td",{className:"vs-came",children:e.jsx("span",{className:"vs-box","aria-hidden":"true"})})]},`p${n}`)),Array.from({length:r}).map((o,n)=>e.jsxs("tr",{className:"vs-open","data-testid":"sheet-open-spot",children:[e.jsx("td",{className:"vs-num",children:s.people.length+n+1}),e.jsx("td",{children:e.jsx("span",{className:"sr-only",children:"Open spot: write a name"})}),e.jsx("td",{className:"vs-contact"}),e.jsx("td",{className:"vs-came",children:e.jsx("span",{className:"vs-box","aria-hidden":"true"})})]},`b${n}`))]})]})]},s.id)}),e.jsx("p",{className:"vs-note",style:{marginTop:16},children:"Names written here are added to the list by your volunteer coordinator."})]})})}function z(){const[t]=x(),a=t.get("performanceId")||null,l=t.get("orgEventId")||null,[s,i]=c.useState(null),[r,o]=c.useState(null);return c.useEffect(()=>{let n=!1;return j.sheet({performanceId:a,orgEventId:l}).then(d=>{n||i(d)}).catch(d=>{n||o(d?.message||"Could not load")}),()=>{n=!0}},[a,l]),c.useEffect(()=>{if(!s)return;const n=setTimeout(()=>{try{window.print()}catch{}},500);return()=>clearTimeout(n)},[s]),r?e.jsxs(p,{children:["Couldnât load the sign-up sheet: ",r]}):s?e.jsxs(e.Fragment,{children:[e.jsx(m,{children:e.jsx(u,{variant:"primary",size:"md",onClick:()=>window.print(),children:"Print"})}),e.jsx(w,{sheet:s,screen:!0})]}):e.jsx(p,{children:"Preparing the sign-up sheetâ¦"})}export{z as PrintVolunteerSheetPage,w as VolunteerSheet};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.