pdf-factory 0.4.1 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/parser.cjs +1 -1
- package/dist/parser.cjs.map +1 -1
- package/dist/parser.js +89 -83
- package/dist/parser.js.map +1 -1
- package/dist/pdf-factory.cjs +1 -1
- package/dist/pdf-factory.cjs.map +1 -1
- package/dist/pdf-factory.js +170 -170
- package/dist/pdf-factory.js.map +1 -1
- package/dist/src/generators/report.d.ts.map +1 -1
- package/package.json +10 -10
package/dist/pdf-factory.cjs
CHANGED
|
@@ -2,5 +2,5 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
2
2
|
`)}function Fn(e){return e.replace(/^Court\s*/i,`Ct `)}function In(e,r={}){let{header:i,includeRanking:a=!0,includeEvents:o=!0}=r,s=new t.default({orientation:`portrait`,format:`a4`}),c=15;i&&(c=q(s,{...i,subtitle:i.subtitle||`Player List`}));let l=[{header:`#`,dataKey:`index`},{header:`Name`,dataKey:`name`},{header:`Nat.`,dataKey:`nationality`}];a&&l.push({header:`Rank`,dataKey:`ranking`}),l.push({header:`Seed`,dataKey:`seed`}),l.push({header:`Entry`,dataKey:`entryStatus`}),o&&l.push({header:`Events`,dataKey:`events`});let u=e.map((e,t)=>({index:t+1,name:e.name,nationality:e.nationality,ranking:e.ranking||``,seed:e.seedValue?.toString()||``,entryStatus:e.entryStatus,events:e.events.join(`, `)}));return(0,n.default)(s,{...Cn.playerList,startY:c,columns:l,body:u,columnStyles:{index:{cellWidth:10,halign:`center`},name:{cellWidth:`auto`,fontStyle:`bold`},nationality:{cellWidth:15,halign:`center`},ranking:{cellWidth:15,halign:`center`},seed:{cellWidth:12,halign:`center`},entryStatus:{cellWidth:15,halign:`center`},events:{cellWidth:`auto`}},didDrawPage:e=>{J(s,`Generated ${new Date().toLocaleDateString()}`,e.pageNumber)}}),s}function Ln(e,n={}){let{tournamentName:r=``,pageSize:i=`a5`,cardsPerPage:a=1}=n,o=new t.default({orientation:`landscape`,format:i});return e.forEach((e,t)=>{t>0&&o.addPage(),Rn(o,e,r,a)}),o}function Rn(e,t,r,i){let a=e.internal.pageSize.getWidth(),o=a/2,s=15;if(r&&(L(e,I.BODY,F.NORMAL),e.setTextColor(100),e.text(r,o,s,{align:`center`}),e.setTextColor(0),s+=8),L(e,28,F.BOLD),e.text(t.courtName,o,s,{align:`center`}),s+=5,t.venueName&&(L(e,I.HEADING,F.NORMAL),e.setTextColor(100),e.text(t.venueName,o,s,{align:`center`}),e.setTextColor(0)),s+=8,e.setDrawColor(0),e.setLineWidth(1),e.line(30,s,a-30,s),s+=8,t.currentMatch&&(L(e,I.HEADING,F.BOLD),e.setTextColor(30,60,120),e.text(`NOW PLAYING`,o,s,{align:`center`}),e.setTextColor(0),s+=6,L(e,I.BODY,F.ITALIC),e.text(`${t.currentMatch.eventName} - ${t.currentMatch.roundName}`,o,s,{align:`center`}),s+=8,(0,n.default)(e,{startY:s,margin:{left:25,right:25},theme:`plain`,styles:{halign:`center`,fontSize:16,cellPadding:4},body:[[{content:`${t.currentMatch.side1.name} (${t.currentMatch.side1.nationality})`,styles:{fontStyle:`bold`}}],[{content:`vs.`,styles:{fontSize:12,textColor:[120,120,120]}}],[{content:`${t.currentMatch.side2.name} (${t.currentMatch.side2.nationality})`,styles:{fontStyle:`bold`}}]]}),s=e.lastAutoTable?.finalY||s+40,s+=8),t.nextMatch){e.setDrawColor(180),e.setLineWidth(.3),e.line(50,s,a-50,s),s+=6,L(e,I.BODY,F.BOLD),e.setTextColor(100);let n=t.nextMatch.scheduledTime?`UP NEXT (${t.nextMatch.scheduledTime})`:`UP NEXT`;e.text(n,o,s,{align:`center`}),e.setTextColor(0),s+=5,L(e,I.BODY,F.NORMAL),e.text(`${t.nextMatch.eventName} - ${t.nextMatch.roundName}`,o,s,{align:`center`}),s+=5,L(e,I.HEADING,F.NORMAL),e.text(`${t.nextMatch.side1.name} vs. ${t.nextMatch.side2.name}`,o,s,{align:`center`})}}function zn(e,r={}){let{header:i,eventName:a,signInDate:o,signInTime:s}=r,c=new t.default({orientation:`portrait`,format:`a4`}),l=15;if(i&&(l=q(c,{...i,subtitle:i.subtitle||`Player Sign-In Sheet`})),a||o){L(c,I.BODY,F.NORMAL);let e=[];a&&e.push(`Event: ${a}`),o&&e.push(`Date: ${o}`),s&&e.push(`Time: ${s}`),c.text(e.join(` | `),15,l),l+=6}let u=[{header:`#`,dataKey:`index`},{header:`Player Name`,dataKey:`name`},{header:`Nat.`,dataKey:`nationality`},{header:`Rank`,dataKey:`ranking`},{header:`Seed`,dataKey:`seed`},{header:`Entry`,dataKey:`entry`},{header:`Signature`,dataKey:`signature`},{header:`Time`,dataKey:`time`}],d=e.map((e,t)=>({index:t+1,name:e.name,nationality:e.nationality,ranking:e.ranking||``,seed:e.seedValue?.toString()||``,entry:e.entryStatus,signature:``,time:``}));return(0,n.default)(c,{startY:l,columns:u,body:d,styles:{fontSize:8,cellPadding:1.5,lineWidth:.2,lineColor:[150,150,150]},headStyles:{fillColor:[40,60,100],textColor:[255,255,255],fontStyle:`bold`,fontSize:7,cellPadding:2},alternateRowStyles:{fillColor:[245,247,250]},columnStyles:{index:{cellWidth:10,halign:`center`},name:{cellWidth:`auto`,fontStyle:`bold`},nationality:{cellWidth:14,halign:`center`},ranking:{cellWidth:14,halign:`center`},seed:{cellWidth:14,halign:`center`},entry:{cellWidth:14,halign:`center`},signature:{cellWidth:35},time:{cellWidth:15}}}),c}function Bn(e,t={}){let n=e.courts.length>=4,r={pageSize:t.page?.pageSize||`a4`,orientation:t.page?.orientation||(n?`landscape`:`portrait`),margins:t.page?.margins||{top:12,right:8,bottom:10,left:8}},i=pe(r),a=t.footer||{layout:`standard`,showTimestamp:!0,showPageNumbers:!0},o=z(a)+(t.notes?.length?t.notes.length*3:0),s=r.margins.top;if(t.header){let e=R(i,t.header,r);s=r.margins.top+e}t.alertBanner&&(s=Vn(i,t.alertBanner,r,s)),Hn(i,e,r,s,t);let c=i.internal.pageSize.getHeight();if(t.notes?.length){let e=c-r.margins.bottom-o+2;L(i,I.TINY,F.ITALIC),i.setTextColor(80);for(let n of t.notes)i.text(n,r.margins.left,e),e+=3;i.setTextColor(0)}if(t.officials?.length){let e=c-r.margins.bottom-6;Kn(i,t.officials,r,e)}return Me(i,a,r,1),i}function Vn(e,t,n,r){let{margins:i}=n,a=e.internal.pageSize.getWidth(),o=a-i.left-i.right;return e.setFillColor(200,30,30),e.rect(i.left,r,o,7,`F`),L(e,I.SMALL,F.BOLD),e.setTextColor(255,255,255),e.text(t,a/2,r+4.5,{align:`center`}),e.setTextColor(0),r+9}function Hn(e,t,r,i,a){let{margins:o}=r,s=t.courts,c=a.cellStyle===`compact`,l=[{header:``,dataKey:`slot`}];for(let e of s)l.push({header:e,dataKey:e});let u=[];t.timeSlots.forEach((e,t)=>{let n=[],r=Un(e,t);n.push({content:r,styles:{fontStyle:`bold`,valign:`top`,cellWidth:12}});for(let t of s){let r=e.matches.filter(e=>e.courtName===t),i=r.length>0?r.map(e=>Wn(e,c)).join(`
|
|
3
3
|
---
|
|
4
4
|
`):``;n.push(i)}u.push(n)}),(0,n.default)(e,{startY:i,head:[l.map(e=>e.header)],body:u,styles:{fontSize:c?6:6.5,cellPadding:c?1.5:2,lineWidth:.3,lineColor:[80,80,80],valign:`top`,overflow:`linebreak`},headStyles:{fillColor:[255,255,255],textColor:[0,0,0],fontStyle:`bold`,fontSize:7,halign:`center`,lineWidth:.5,lineColor:[0,0,0]},columnStyles:{0:{cellWidth:14,fontStyle:`bold`}},alternateRowStyles:{fillColor:[252,252,252]},margin:{left:o.left,right:o.right},tableWidth:`auto`,didParseCell:t=>{if(t.column.index>0&&t.section===`body`){let n=e.internal.pageSize.getWidth()-o.left-o.right-14;t.cell.styles.cellWidth=n/s.length,t.cell.styles.halign=`center`,t.cell.styles.valign=`middle`}}})}function Un(e,t){return`${t+1}`}function Wn(e,t){let n=[];e.notBeforeTime?n.push(`NB ${e.notBeforeTime}`):e.scheduledTime&&n.push(e.scheduledTime),(e.eventAbbr||e.roundName)&&n.push(`${e.eventAbbr} ${e.roundName}`.trim());let r=Gn(e.side1,t);r&&n.push(r),n.push(`vs.`);let i=Gn(e.side2,t);return i&&n.push(i),e.score?n.push(e.score):e.matchUpStatus===`IN_PROGRESS`&&n.push(`In progress`),n.join(`
|
|
5
|
-
`)}function Gn(e,t){return e.name?t||e.nationality?`${e.name} (${e.nationality})`:e.name:`TBD`}function Kn(e,t,n,r){let{margins:i}=n,a=e.internal.pageSize.getWidth();e.setDrawColor(120),e.setLineWidth(.2),e.line(i.left,r-2,a-i.right,r-2),L(e,I.TINY,F.NORMAL);let o=(a-i.left-i.right)/t.length;t.forEach((t,n)=>{let a=i.left+n*o;L(e,I.TINY,F.ITALIC),e.setTextColor(100),e.text(t.role,a,r),L(e,I.TINY,F.BOLD),e.setTextColor(0),e.text(t.name,a,r+3)})}var qn=[120,50,140];function Jn(e,t={}){let n={pageSize:t.page?.pageSize||`a4`,orientation:t.page?.orientation||`portrait`,margins:t.page?.margins||{top:12,right:15,bottom:12,left:15}},r=pe(n),{margins:i}=n,a=r.internal.pageSize.getWidth(),o=r.internal.pageSize.getHeight(),s=a-i.left-i.right,c=t.accentColor||qn,l=t.footer||{layout:`none`},u=z(l),d=i.top;t.header&&(d=i.top+R(r,t.header,n)+3);let f=$n(e);for(let[e,a]of f){d+30>o-i.bottom-u&&(er(r,t,n,l),r.addPage(),d=i.top),d=Yn(r,e,i.left,d,s);let f=``;for(let e of a){let a=e.scheduledTime||e.notBeforeTime||``;a&&a!==f&&(d+25>o-i.bottom-u&&(er(r,t,n,l),r.addPage(),d=i.top),d=Xn(r,a,!!e.notBeforeTime,i.left,d,s,c),f=a),d+22>o-i.bottom-u&&(er(r,t,n,l),r.addPage(),d=i.top),d=Zn(r,e,i.left,d,s)}d+=4}return t.disclaimer&&(d+=2,L(r,I.TINY,F.ITALIC),r.setTextColor(100),r.text(t.disclaimer,a/2,d,{align:`center`}),r.setTextColor(0)),er(r,t,n,l),r}function Yn(e,t,n,r,i){return L(e,I.HEADING,F.BOLD),e.setTextColor(40),e.text(t.toUpperCase(),n+i/2,r,{align:`center`}),e.setTextColor(0),r+7}function Xn(e,t,n,r,i,a,o){let s=n?`Not before ${t}`:`Starting at ${t}`;return e.setFillColor(o[0],o[1],o[2]),e.rect(r+20,i,a-40,5,`F`),L(e,I.SMALL,F.ITALIC),e.setTextColor(255,255,255),e.text(s,r+a/2,i+3.5,{align:`center`}),e.setTextColor(0),i+7}function Zn(e,t,n,r,i){let a=n+15,o=i-30,s=r;L(e,I.TINY,F.ITALIC),e.setTextColor(100);let c=t.eventAbbr?`${t.eventAbbr} ${t.roundName}`:t.roundName;e.text(c,a+o-2,r+3,{align:`right`}),e.setTextColor(0),t.score&&(L(e,I.SMALL,F.BOLD),e.setTextColor(120,50,140),e.text(t.score,a+o/2,r+3,{align:`center`}),e.setTextColor(0),r+=4),r+=2,r=Qn(e,t.side1,a,r,o),L(e,I.TINY,F.ITALIC),e.setTextColor(120),e.text(`vs`,a+o/2,r+2.5,{align:`center`}),e.setTextColor(0),r+=4,r=Qn(e,t.side2,a,r,o),r+=2;let l=r-s;return e.setDrawColor(180),e.setLineWidth(.3),e.rect(a,s,o,l),r+2}function Qn(e,t,n,r,i){if(!t.name||t.name===`TBD`)return L(e,I.BODY,F.ITALIC),e.setTextColor(150),e.text(`TBD`,n+10,r+3),e.setTextColor(0),r+4;L(e,I.BODY,F.NORMAL);let a=t.nationality?`${t.name} ${t.nationality}`:t.name;return e.text(a,n+10,r+3),r+4}function $n(e){let t=new Map;for(let n of e.courts)t.set(n,[]);for(let n of e.timeSlots)for(let e of n.matches)t.has(e.courtName)||t.set(e.courtName,[]),t.get(e.courtName).push(e);for(let[e,n]of t)n.length===0&&t.delete(e);return t}function er(e,t,n,r){let{margins:i}=n,a=e.internal.pageSize.getWidth(),o=e.internal.pageSize.getHeight();if(t.officials?.length){let n=o-i.bottom-10;e.setDrawColor(120),e.setLineWidth(.2),e.line(i.left,n-2,a-i.right,n-2);let r=(a-i.left-i.right)/t.officials.length;t.officials.forEach((t,a)=>{let o=i.left+a*r;L(e,I.TINY,F.BOLD),e.text(t.role,o,n),L(e,I.TINY,F.NORMAL),e.text(t.name,o,n+3)})}Me(e,r,n)}function tr(e,n={}){let{cardsPerPage:r=2,includeScoreBoxes:i=!0}=n,a=new t.default({orientation:`landscape`,format:`a5`});return e.forEach((e,t)=>{t>0&&(r===1||t%r===0)&&a.addPage(),nr(a,e,r===2&&t%2==1?a.internal.pageSize.getHeight()/2:5,i)}),a}function nr(e,t,n,r){let i=e.internal.pageSize.getWidth(),a=i/2,o=n;if(t.tournamentName&&(L(e,I.BODY,F.NORMAL),e.setTextColor(100),e.text(t.tournamentName,a,o,{align:`center`}),e.setTextColor(0),o+=5),L(e,I.HEADING,F.BOLD),e.text(`${t.eventName} - ${t.roundName}`,a,o,{align:`center`}),o+=5,t.courtName||t.scheduledTime){L(e,I.BODY,F.NORMAL);let n=[];t.courtName&&n.push(`Court: ${t.courtName}`),t.scheduledTime&&n.push(`Time: ${t.scheduledTime}`),e.text(n.join(` `),a,o,{align:`center`}),o+=5}if(e.setDrawColor(0),e.setLineWidth(.5),e.line(10,o,i-10,o),o+=6,rr(e,t.side1,10,o,i),o+=8,L(e,I.BODY,F.ITALIC),e.setTextColor(120),e.text(`vs.`,a,o,{align:`center`}),e.setTextColor(0),o+=6,rr(e,t.side2,10,o,i),o+=8,r){e.setDrawColor(0),e.setLineWidth(.5),e.line(10,o,i-10,o),o+=4,L(e,I.SMALL,F.BOLD),e.text(`Score:`,10,o);for(let t=0;t<5;t++){let n=28+t*15;e.rect(n,o-4,12,8),L(e,I.TINY,F.NORMAL),e.setTextColor(150),e.text(`Set ${t+1}`,n+12/2,o-5,{align:`center`}),e.setTextColor(0)}o+=14,L(e,I.SMALL,F.NORMAL),e.text(`Umpire:`,10,o),e.setDrawColor(150),e.setLineWidth(.3),e.line(30,o,90,o),e.text(`Signature:`,i-10-70,o),e.line(i-10-40,o,i-10,o)}}function rr(e,t,n,r,i){L(e,14,F.BOLD);let a=t.seedValue?`[${t.seedValue}] `:``;e.text(`${a}${t.name}`,n,r),L(e,I.HEADING,F.NORMAL),e.setTextColor(80),e.text(t.nationality,i-n,r,{align:`right`}),e.setTextColor(0)}function ir(e,r,i={}){let a=new t.default({orientation:i.orientation||`portrait`,format:`a4`}),o=15;i.header?o=q(a,{...i.header,subtitle:i.header.subtitle||i.title}):i.title&&(L(a,I.SUBTITLE,F.BOLD),a.text(i.title,15,o),o+=8);let s=e.map(e=>({header:e.title,dataKey:e.key})),c=r.map(t=>{let n={};for(let r of e){let e=t[r.key];n[r.key]=e==null?``:String(e)}return n}),l={};for(let t of e)t.type===`number`&&(l[t.key]={halign:`right`}),t.width&&(l[t.key]={...l[t.key],cellWidth:t.width});return(0,n.default)(a,{...Cn.report,startY:o,columns:s,body:c,columnStyles:l,didDrawPage:e=>{J(a,`Generated ${new Date().toLocaleDateString()}`,e.pageNumber)}}),a}var Y=15;function ar(e){if(typeof document<`u`){let t=document.createElement(`div`);return t.innerHTML=e,t.textContent||``}let t=``,n=!1;for(let r of e){if(r===`<`){n=!0;continue}if(r===`>`){n=!1;continue}n||(t+=r)}return t.trim()}function X(e,t,n){return L(e,I.HEADING,F.BOLD),e.setTextColor(40),e.text(t.toUpperCase(),Y,n),e.setTextColor(0),n+=1.5,e.setDrawColor(180),e.setLineWidth(.2),e.line(Y,n,e.internal.pageSize.getWidth()-Y,n),n+=4,n}function or(e,t,n,r){L(e,I.BODY,F.NORMAL);let i=r||e.internal.pageSize.getWidth()-Y*2,a=e.splitTextToSize(t,i);return e.text(a,Y,n),n+a.length*3.2}function Z(e,t,n){let r=e.internal.pageSize.getHeight();return t+n>r-20?(e.addPage(),20):t}function sr(e,t,n){let r={pageSize:`a4`,orientation:`portrait`,margins:{top:n,right:Y,bottom:15,left:Y}};return n+R(e,Ae(t,{layout:`itf`}),r)}function cr(e,t,r){let i=(t.participants||[]).filter(e=>e.participantRole&&e.participantRole!==`COMPETITOR`);if(!i.length)return r;r=Z(e,r,20),r=X(e,`Tournament Contacts`,r);let a=i.map(e=>{let t=e.person||{},n=[t.standardGivenName,t.standardFamilyName].filter(Boolean).join(` `)||e.participantName||``,r=e.participantRoleResponsibilities?.[0]||e.participantRole||``,i=t.contacts?.[0]||{};return[n,r,[i.emailAddress,i.telephone||i.mobileTelephone].filter(Boolean).join(` | `)]});return(0,n.default)(e,{startY:r,head:[[`Name`,`Role`,`Contact`]],body:a,margin:{left:Y,right:Y},styles:{fontSize:7,cellPadding:1.5},headStyles:{fillColor:[60,60,60],textColor:255,fontStyle:`bold`},theme:`grid`}),e.lastAutoTable.finalY+6}function lr(e,t,r){let i=t.events||[];if(!i.length)return r;r=Z(e,r,20),r=X(e,`Events`,r);let a=i.map(e=>{let t=e.drawDefinitions?.[0]?.drawSize||``;return[e.eventName||``,e.eventType||``,e.matchUpFormat||``,String(t)]});return(0,n.default)(e,{startY:r,head:[[`Event`,`Type`,`Format`,`Draw Size`]],body:a,margin:{left:Y,right:Y},styles:{fontSize:7,cellPadding:1.5},headStyles:{fillColor:[60,60,60],textColor:255,fontStyle:`bold`},theme:`grid`}),e.lastAutoTable.finalY+6}function ur(e,t,n){let r=t.registrationProfile;if(!r)return n;let i=[];if(r.entriesOpen&&i.push(`Entries Open: `+r.entriesOpen),r.entriesClose&&i.push(`Entries Close: `+r.entriesClose),r.withdrawalDeadline&&i.push(`Withdrawal Deadline: `+r.withdrawalDeadline),r.entryMethod&&i.push(`Entry Method: `+r.entryMethod),r.entryUrl&&i.push(`Entry URL: `+r.entryUrl),r.eligibilityNotes&&i.push(`Eligibility: `+r.eligibilityNotes),r.entryFees?.length){let e=r.entryFees.map(e=>(e.eventType?e.eventType+`: `:``)+e.currencyCode+` `+e.amount).join(`, `);i.push(`Entry Fees: `+e)}if(!i.length)return n;n=Z(e,n,10+i.length*3.5),n=X(e,`Entry Information`,n),L(e,I.BODY,F.NORMAL);for(let t of i)e.text(t,Y,n),n+=3.5;return n+3}function dr(e,t,n){let r=t.venues||[];if(!r.length)return n;n=Z(e,n,15),n=X(e,`Venue`,n),L(e,I.BODY,F.NORMAL);for(let t of r){L(e,I.BODY,F.BOLD),e.text(t.venueName||`Venue`,Y,n),n+=3.5,L(e,I.BODY,F.NORMAL);let r=t.addresses?.[0];if(r){let t=[r.street,r.city,r.state,r.postalCode,r.countryCode].filter(Boolean);t.length&&(e.text(t.join(`, `),Y,n),n+=3.5)}let i=t.courts?.length;i&&(e.text(`Courts: `+i,Y,n),n+=3.5)}return n+3}function fr(e,t,r,i){if(!r)return i;let a=r.options?.length,o=r.notes&&ar(r.notes);if(!a&&!o)return i;if(i=Z(e,i,15),i=X(e,t,i),a){let t=r.options.map(e=>{let t=[e.phone,e.email,e.priceRange].filter(Boolean).join(` | `);return[e.name,e.address||``,t]});(0,n.default)(e,{startY:i,head:[[`Name`,`Address`,`Details`]],body:t,margin:{left:Y,right:Y},styles:{fontSize:7,cellPadding:1.5},headStyles:{fillColor:[60,60,60],textColor:255,fontStyle:`bold`},theme:`grid`}),i=e.lastAutoTable.finalY+3}return o&&(i=or(e,ar(r.notes),i)),i+3}function pr(e,t,n){let r=t.totalPrizeMoney;if(!r?.length)return n;n=Z(e,n,10),n=X(e,`Prize Money`,n),L(e,I.BODY,F.NORMAL);for(let t of r)e.text(t.currencyCode+` `+t.amount.toLocaleString(),Y,n),n+=3.5;return n+3}function mr(e,t,r){let i=(t.participants||[]).filter(e=>e.participantRole===`OFFICIAL`||e.participantRole===`DIRECTOR`);if(!i.length)return r;r=Z(e,r,15),r=X(e,`Officials`,r);let a=i.map(e=>{let t=e.person||{};return[[t.standardGivenName,t.standardFamilyName].filter(Boolean).join(` `)||e.participantName||``,e.participantRoleResponsibilities?.[0]||e.participantRole||``]});return(0,n.default)(e,{startY:r,head:[[`Name`,`Role`]],body:a,margin:{left:Y,right:Y},styles:{fontSize:7,cellPadding:1.5},headStyles:{fillColor:[60,60,60],textColor:255,fontStyle:`bold`},theme:`grid`}),e.lastAutoTable.finalY+6}function hr(e,t,n){let r=t.registrationProfile;if(!r)return n;let i=[];if(r.codeOfConduct){let e=r.codeOfConduct;i.push(`Code of Conduct: `+(e.name||``)+(e.url?` — `+e.url:``))}if(r.regulations?.length)for(let e of r.regulations)i.push((e.name||`Regulation`)+(e.url?` — `+e.url:``));if(r.dressCode&&i.push(`Dress Code: `+r.dressCode),r.contingencyPlan&&i.push(`Contingency: `+r.contingencyPlan),!i.length)return n;n=Z(e,n,10+i.length*3.5),n=X(e,`Regulations`,n),L(e,I.BODY,F.NORMAL);for(let t of i)e.text(t,Y,n),n+=3.5;return n+3}function gr(e,t,n){let r=t.registrationProfile?.sponsors;if(!r?.length)return n;n=Z(e,n,10),n=X(e,`Sponsors`,n),L(e,I.BODY,F.NORMAL);for(let t of r){let r=t.tier?` [`+t.tier+`]`:``;e.text(t.name+r,Y,n),n+=3.5}return n+3}function _r(e,t,n){let r=t.registrationProfile?.socialEvents;if(!r?.length)return n;let i=t.registrationProfile;n=Z(e,n,15),n=X(e,`Social Events & Ceremonies`,n),L(e,I.BODY,F.NORMAL),i?.drawCeremonyDate&&(e.text(`Draw Ceremony: `+i.drawCeremonyDate,Y,n),n+=3.5),i?.awardsCeremonyDate&&(e.text(`Awards Ceremony: `+i.awardsCeremonyDate,Y,n),n+=3.5);for(let t of r){L(e,I.BODY,F.BOLD),e.text(t.name,Y,n),n+=3.5,L(e,I.BODY,F.NORMAL);let r=[t.date,t.time,t.location].filter(Boolean).join(` | `);r&&(e.text(r,Y,n),n+=3.5),t.description&&(e.text(t.description,Y,n),n+=3.5)}return n+3}function vr(e,t,n){let r=t.notes;if(!r)return n;let i=ar(r);return i?(n=Z(e,n,15),n=X(e,`Additional Information`,n),n=or(e,i,n),n+3):n}var yr={"tournament-header":sr,contacts:cr,events:lr,"entry-info":ur,"venue-info":dr,accommodation:(e,t,n)=>fr(e,`Accommodation`,t.registrationProfile?.accommodation,n),transportation:(e,t,n)=>fr(e,`Transportation`,t.registrationProfile?.transportation,n),hospitality:(e,t,n)=>fr(e,`Hospitality`,t.registrationProfile?.hospitality,n),medical:(e,t,n)=>fr(e,`Medical`,t.registrationProfile?.medicalInfo,n),regulations:hr,"prize-money":pr,officials:mr,sponsors:gr,"social-events":_r,"custom-notes":vr};function br(e,n={}){let{templateId:r=`itf-junior`}=n,i=le(r)?.sections||le(`itf-junior`).sections,a=n.enabledSections?new Set(n.enabledSections):null,o=new t.default({orientation:`portrait`,format:`a4`}),s=Y;for(let t of i){if(!t.enabled||a&&!a.has(t.type))continue;let n=yr[t.type];n&&(s=n(o,e,s))}let c=o.getNumberOfPages();for(let e=1;e<=c;e++)o.setPage(e),J(o,`Generated `+new Date().toLocaleDateString(),e);return o}function xr(e,t,n,r){let i=n.page.margins,a=r.contentY+9,o=r.contentHeight-9,s=t.drawSize/2,c=Math.log2(s),l=r.contentWidth,u=Math.min(30,l*.08),d=(l-u)/2,f=i.left+d,p=o/s,m=p<3.5,h=m?.8:1.5,g=Math.min(m?30:50,d*.22),_=c,v=d-g-h*(_+1),y=Math.max(8,v/Math.max(1,_)),b=I.SMALL;p<2.5?b=5:m&&(b=I.TINY);let x=m?5:I.TINY,S={lineHeight:p,roundColumnWidth:y,firstRoundWidth:g,connectorGap:h,fontSize:b,scoreFontSize:x},C=t.slots.filter(e=>e.drawPosition<=s),ee=t.slots.filter(e=>e.drawPosition>s),w=t.matchUps.filter(e=>e.drawPositions.every(e=>e<=s)),T=t.matchUps.filter(e=>e.drawPositions.every(e=>e>s)),E=ee.map(e=>({...e,drawPosition:e.drawPosition-s})),D=new Map;for(let e of T)D.has(e.roundNumber)||D.set(e.roundNumber,[]),D.get(e.roundNumber).push(e);let O=[];for(let[,e]of D)e.sort((e,t)=>e.roundPosition-t.roundPosition),e.forEach((e,t)=>{O.push({...e,drawPositions:e.drawPositions.map(e=>e-s),roundPosition:t+1})});let k=new Map;for(let e of w)k.has(e.roundNumber)||k.set(e.roundNumber,[]),k.get(e.roundNumber).push(e);let A=[];for(let[,e]of k)e.sort((e,t)=>e.roundPosition-t.roundPosition),e.forEach((e,t)=>{A.push({...e,roundPosition:t+1})});wr(e,c,t.totalRounds,S,n,i.left,i.left+l,r.contentY+2,t.roundLabelMap),L(e,m?5.5:I.SMALL,F.BOLD),e.setTextColor(40),e.text(`Winner`,f+u/2,r.contentY+2,{align:`center`}),e.setDrawColor(160),e.setLineWidth(.15),e.line(f+2,r.contentY+3.5,f+u-2,r.contentY+3.5),e.setTextColor(0),Sr(e,C,A,c,S,n,i.left,a,t.totalRounds),Cr(e,E,O,c,S,n,i.left+l,a,t.totalRounds);let j=t.matchUps.find(e=>e.roundNumber===t.totalRounds);if(j){let r=a+o/2;if(e.setDrawColor(40),e.setLineWidth(.25),e.line(f+2,r,f+u-2,r),j.winningSide){let i=j.drawPositions[j.winningSide-1],a=t.slots.find(e=>e.drawPosition===i);if(a){let{name:t}=U(a,n);L(e,b+1,F.BOLD),e.text(t,f+u/2,r-1,{align:`center`})}}j.score&&(L(e,x,F.NORMAL),e.setTextColor(60,60,160),e.text(W(j.score,n),f+u/2,r+x*.4,{align:`center`}),e.setTextColor(0))}}function Sr(e,t,n,r,i,a,o,s,c){let l=new Map(t.map(e=>[e.drawPosition,e])),u=t.length;for(let t=0;t<r;t++){let c=u/2**(t+1),d=i.lineHeight*2**t,f=(2**t-1)*i.lineHeight/2,p=2**(t+1)*i.lineHeight,m=Tr(t,i,o),h=t===0?i.firstRoundWidth:i.roundColumnWidth;for(let u=0;u<c;u++){let c=s+f+u*p,g=c+d,_=(c+g)/2;if(t===0){let t=u*2+1,n=u*2+2;Dr(e,l.get(t),i,m,c,h,`ltr`),Dr(e,l.get(n),i,m,g,h,`ltr`)}else e.setDrawColor(40),e.setLineWidth(.25),e.line(m,c,m+h,c),e.line(m,g,m+h,g);let v=m+h,y=Tr(t+1,i,o);e.setDrawColor(40),e.setLineWidth(.25),e.line(v+i.connectorGap,c,v+i.connectorGap,g),e.line(v,c,v+i.connectorGap,c),e.line(v,g,v+i.connectorGap,g),e.line(v+i.connectorGap,_,y,_);let b=kr(n,t+1,u+1);if(t<r-1&&b?.winningSide){let t=b.drawPositions[b.winningSide-1],n=l.get(t);if(n){L(e,i.fontSize,F.BOLD);let t=n.participantName;e.getTextWidth(t)>i.roundColumnWidth-2&&(t=Or(t)),e.text(t,y+1,_-.5)}}b?.score&&t<r-1&&(L(e,i.scoreFontSize,F.NORMAL),e.setTextColor(60,60,160),e.text(W(b.score,a),y+1,_-.5+i.scoreFontSize*.4),e.setTextColor(0))}}}function Cr(e,t,n,r,i,a,o,s,c){let l=new Map(t.map(e=>[e.drawPosition,e])),u=t.length;for(let t=0;t<r;t++){let c=u/2**(t+1),d=i.lineHeight*2**t,f=(2**t-1)*i.lineHeight/2,p=2**(t+1)*i.lineHeight,m=Er(t,i,o),h=t===0?i.firstRoundWidth:i.roundColumnWidth;for(let u=0;u<c;u++){let c=s+f+u*p,g=c+d,_=(c+g)/2;if(t===0){let t=u*2+1,n=u*2+2;Dr(e,l.get(t),i,m,c,h,`rtl`),Dr(e,l.get(n),i,m,g,h,`rtl`)}else e.setDrawColor(40),e.setLineWidth(.25),e.line(m,c,m+h,c),e.line(m,g,m+h,g);let v=m,y=Er(t+1,i,o);e.setDrawColor(40),e.setLineWidth(.25),e.line(v-i.connectorGap,c,v-i.connectorGap,g),e.line(v,c,v-i.connectorGap,c),e.line(v,g,v-i.connectorGap,g),e.line(v-i.connectorGap,_,y+i.roundColumnWidth,_);let b=kr(n,t+1,u+1);if(t<r-1&&b?.winningSide){let t=b.drawPositions[b.winningSide-1],n=l.get(t);if(n){L(e,i.fontSize,F.BOLD);let t=n.participantName;e.getTextWidth(t)>i.roundColumnWidth-2&&(t=Or(t));let r=y;e.text(t,r+i.roundColumnWidth-1,_-.5,{align:`right`})}}if(b?.score&&t<r-1){let t=y;L(e,i.scoreFontSize,F.NORMAL),e.setTextColor(60,60,160),e.text(W(b.score,a),t+i.roundColumnWidth-1,_-.5+i.scoreFontSize*.4,{align:`right`}),e.setTextColor(0)}}}}function wr(e,t,n,r,i,a,o,s,c){L(e,r.fontSize<=I.TINY?5.5:I.SMALL,F.BOLD),e.setTextColor(40);for(let l=0;l<t;l++){let u=n-t+l+1,d=H(u,n),f=c?.[u]||i.roundLabels[d]||d,p=l===0?r.firstRoundWidth:r.roundColumnWidth,m=Tr(l,r,a);e.text(f,m+p/2,s,{align:`center`}),e.setDrawColor(160),e.setLineWidth(.15),e.line(m+2,s+1.5,m+p-2,s+1.5);let h=Er(l,r,o);e.text(f,h+p/2,s,{align:`center`}),e.line(h+2,s+1.5,h+p-2,s+1.5)}e.setTextColor(0)}function Tr(e,t,n){return e===0?n:n+t.firstRoundWidth+t.connectorGap+(e-1)*(t.roundColumnWidth+t.connectorGap)}function Er(e,t,n){return e===0?n-t.firstRoundWidth:n-t.firstRoundWidth-t.connectorGap-(e-1)*(t.roundColumnWidth+t.connectorGap)-t.roundColumnWidth}function Dr(e,t,n,r,i,a,o){if(e.setDrawColor(40),e.setLineWidth(.25),e.line(r,i,r+a,i),!t||t.isBye){t?.isBye&&(L(e,n.fontSize,F.ITALIC),e.setTextColor(150),o===`ltr`?e.text(`Bye`,r+1,i-.3):e.text(`Bye`,r+a-1,i-.3,{align:`right`}),e.setTextColor(0));return}let s=t.seedValue?`[${t.seedValue}]`:``;L(e,n.fontSize,F.NORMAL);let c=t.participantName,l=s?`${s} ${c}`:c;e.getTextWidth(l)>a-2&&(c=Or(t.participantName),l=s?`${s} ${c}`:c),o===`ltr`?e.text(l,r+1,i-.3):e.text(l,r+a-1,i-.3,{align:`right`})}function Or(e){let t=e.match(/^([^,]+),\s*(.+)/);if(t)return`${t[2][0]}. ${t[1]}`;let n=e.match(/^(\S+)\s+(.+)/);return n?`${n[1][0]}. ${n[2]}`:e}function kr(e,t,n){return e.find(e=>e.roundNumber===t&&e.roundPosition===n)}function Ar(e,t,n,r){let i=n.page.margins,a=r.contentY+9,o=r.contentHeight-9,s=r.contentWidth,c=t.mainDraw.matchUps,l=t.mainDraw.slots,u=t.consolation.matchUps,d=t.consolation.slots,f=new Map(l.map(e=>[e.drawPosition,e])),p=new Map(d.map(e=>[e.drawPosition,e])),m=c.filter(e=>e.roundNumber===1).sort((e,t)=>e.roundPosition-t.roundPosition),h=m.length,g=h*2,_=Math.max(...c.map(e=>e.roundNumber)),v=_-1,y=u.length>0?Math.max(...u.map(e=>e.roundNumber)):0,b=1.5,x=s-28-b*4,S=v+1,C=Math.max(y+1,1),ee=x*(S/(S+C)),w=x-ee,T=i.left+w+b,E=S>0?(ee-b*S)/S:0,D=T+28+b,O=C>0?(w-b*C)/C:0,k=i.left+w,A=o/g,j=A<3.5,M=I.SMALL;A<2.5?M=5:j&&(M=I.TINY);let te=j?5:I.TINY;zr(e,_,y,t,n,T,28,D,E,k,O,b,r.contentY+2,M),jr(e,m,h,f,T,28,b,D,k,a,A,M,y),Nr(e,c,f,_,h,D,E,b,a,A,M,te,n,t.mainDraw.roundLabelMap),Pr(e,u,p,y,k,O,b,a,A,h,M,te,n,t.consolation.roundLabelMap)}function jr(e,t,n,r,i,a,o,s,c,l,u,d,f){for(let p=0;p<n;p++){let n=t[p],m=l+p*u*2,h=m+u,g=(m+h)/2,_=n.drawPositions[0],v=n.drawPositions[1],y=u*.9;e.setDrawColor(40),e.setLineWidth(.3),e.rect(i,m,a,y),e.rect(i,h,a,y);let b=_?r.get(_):void 0,x=v?r.get(v):void 0;L(e,d,F.NORMAL),_&&Mr(e,_,b,n.winningSide===1,i,m,y,a,d),v&&Mr(e,v,x,n.winningSide===2,i,h,y,a,d),e.setDrawColor(40),e.setLineWidth(.25),e.line(i+a,m+y/2,i+a+o,m+y/2),e.line(i+a,h+y/2,i+a+o,h+y/2),e.line(i+a+o,m+y/2,i+a+o,h+y/2),e.line(i+a+o,g,s,g),f>0&&(e.line(i,m+y/2,i-o,m+y/2),e.line(i,h+y/2,i-o,h+y/2),e.line(i-o,m+y/2,i-o,h+y/2),e.line(i-o,g,c,g))}}function Mr(e,t,n,r,i,a,o,s,c){if(e.setTextColor(120),L(e,c,F.NORMAL),e.text(`${t}`,i+1,a+o/2+c*.12),e.setTextColor(0),n?.participantName){let t=Br(n.participantName);L(e,c,r?F.BOLD:F.NORMAL),e.text(t,i+5,a+o/2+c*.12,{maxWidth:s-6})}}function Nr(e,t,n,r,i,a,o,s,c,l,u,d,f,p){for(let i=0;i<r-1;i++){let p=i+2,m=t.filter(e=>e.roundNumber===p).sort((e,t)=>e.roundPosition-t.roundPosition),h=l*2**(i+1),g=(2**(i+1)-1)*l/2,_=a+i*(o+s);for(let t=0;t<m.length;t++){let l=m[t],p=c+g+t*h*2,v=p+h,y=(p+v)/2;if(e.setDrawColor(40),e.setLineWidth(.25),e.line(_,p,_+o,p),e.line(_,v,_+o,v),Rr(e,l,n,_,p,v,o,u,f),i<r-2){let t=_+o;e.line(t+s,p,t+s,v),e.line(t,p,t+s,p),e.line(t,v,t+s,v),e.line(t+s,y,_+o+s+o+s>0?a+(i+1)*(o+s):t+s+5,y)}l.score&&(L(e,d,F.NORMAL),e.setTextColor(60,60,160),e.text(W(l.score,f),_+o-1,y+d*.12,{align:`right`}),e.setTextColor(0))}}let m=a+(r-2)*(o+s)+o+s,h=c+(2**(r-1)-1)*l/2+l*2**(r-2);e.setDrawColor(40),e.setLineWidth(.25),e.line(m,h,m+o,h);let g=t.find(e=>e.roundNumber===r);if(g?.winningSide){let t=n.get(g.drawPositions[g.winningSide-1]);if(t){let{name:n}=U(t,f);L(e,u+1,F.BOLD),e.text(n,m+1,h-.5)}}}function Pr(e,t,n,r,i,a,o,s,c,l,u,d,f,p){for(let l=0;l<r;l++)Fr(e,t,n,l,r,i,a,o,s,c,u,d,f);Lr(e,t,n,r,i,a,o,s,c,u,f)}function Fr(e,t,n,r,i,a,o,s,c,l,u,d,f){let p=r+1,m=t.filter(e=>e.roundNumber===p).sort((e,t)=>e.roundPosition-t.roundPosition),h=l*2**(r+1),g=(2**(r+1)-1)*l/2,_=a-(r+1)*(o+s);for(let t=0;t<m.length;t++){let l=m[t],p=c+g+t*h*2,v=p+h,y=(p+v)/2;if(e.setDrawColor(40),e.setLineWidth(.25),e.line(_,p,_+o,p),e.line(_,v,_+o,v),Ir(e,l.drawPositions[0],n,u,_,o,p),Ir(e,l.drawPositions[1],n,u,_,o,v),r<i-1){e.line(_-s,p,_-s,v),e.line(_,p,_-s,p),e.line(_,v,_-s,v);let t=a-(r+2)*(o+s);e.line(_-s,y,t+o,y)}l.score&&(L(e,d,F.NORMAL),e.setTextColor(60,60,160),e.text(W(l.score,f),_+1,y+d*.12),e.setTextColor(0))}}function Ir(e,t,n,r,i,a,o){if(!t)return;let s=n.get(t);if(!s?.participantName)return;L(e,r,F.BOLD);let c=s.participantName;e.getTextWidth(c)>a-2&&(c=Br(c)),e.text(c,i+a-1,o-.3,{align:`right`})}function Lr(e,t,n,r,i,a,o,s,c,l,u){if(r<=0)return;let d=i-(r+1)*(a+o),f=s+(2**r-1)*c/2+c*2**(r-1);e.setDrawColor(40),e.setLineWidth(.25),e.line(d,f,d+a,f);let p=t.find(e=>e.roundNumber===r);if(p?.winningSide){let t=n.get(p.drawPositions[p.winningSide-1]);if(t){let{name:n}=U(t,u);L(e,l+1,F.BOLD),e.text(n,d+a-1,f-.5,{align:`right`})}}}function Rr(e,t,n,r,i,a,o,s,c){if(t.drawPositions[0]){let a=n.get(t.drawPositions[0]);if(a?.participantName){L(e,s,F.BOLD);let t=a.participantName;e.getTextWidth(t)>o-2&&(t=Br(t)),e.text(t,r+1,i-.3)}}if(t.drawPositions[1]){let i=n.get(t.drawPositions[1]);if(i?.participantName){L(e,s,F.BOLD);let t=i.participantName;e.getTextWidth(t)>o-2&&(t=Br(t)),e.text(t,r+1,a-.3)}}}function zr(e,t,n,r,i,a,o,s,c,l,u,d,f,p){L(e,p<=I.TINY?5.5:I.SMALL,F.BOLD),e.setTextColor(40);let m=r.mainDraw.roundLabelMap?.[1]||`R1`;e.text(m,a+o/2,f,{align:`center`});for(let n=0;n<t-1;n++){let t=n+2,i=r.mainDraw.roundLabelMap?.[t]||`R${t}`,a=s+n*(c+d);e.text(i,a+c/2,f,{align:`center`})}for(let t=0;t<n;t++){let n=t+1,i=r.consolation.roundLabelMap?.[n]||`C-R${n}`,a=l-(t+1)*(u+d);e.text(i,a+u/2,f,{align:`center`})}e.setTextColor(0)}function Br(e){let t=e.match(/^([^,]+),\s*(.+)/);if(t)return`${t[2][0]}. ${t[1]}`;let n=e.match(/^(\S+)\s+(.+)/);return n?`${n[1][0]}. ${n[2]}`:e}function Vr(e,t={}){return Hr(e.matchUps)?Gr(e,t):Ur(e,t)}function Hr(e){let t=new Map;for(let n of e)t.set(n.roundNumber,(t.get(n.roundNumber)||0)+1);let n=[...t.keys()].sort((e,t)=>e-t);for(let e=1;e<n.length;e++){let r=t.get(n[e-1])||0;if((t.get(n[e])||0)>=r)return!0}return!1}function Ur(e,t={}){if(e.drawSize>=256)return Wr(e,{...t,maxPositionsPerPage:64});let n=Q(e.drawSize,t),r=P(n.doc,n.pageConfig,n.headerH,n.footerH);return G(n.doc,e,n.format,r),$(n),n.doc}function Wr(e,t={}){let n=Q(e.drawSize,t),r=cn(e,{maxPositionsPerPage:t.maxPositionsPerPage||32,includeOverlapRounds:!0,summaryPage:!0});for(let t=0;t<r.length;t++){t>0&&n.doc.addPage();let i=R(n.doc,{...n.headerConfig,subtitle:r[t].label},n.pageConfig),a=P(n.doc,n.pageConfig,i,n.footerH);if(r[t].slots.length>0||r[t].matchUps.length>0){let i=r[t],o=i.endPosition-i.startPosition+1,s={...e,slots:i.slots,matchUps:i.matchUps,noWinnerColumn:i.noWinnerColumn,roundLabelMap:i.roundLabelMap||e.roundLabelMap,drawSize:o,totalRounds:i.segmentRounds};G(n.doc,s,n.format,a,i.startPosition-1,o)}}return $(n),n.doc}function Gr(e,t={}){let n=e.totalRounds>=5||e.slots.length>=12,r=Q(e.drawSize,t,n),i=P(r.doc,r.pageConfig,r.headerH,r.footerH);return G(r.doc,e,r.format,i),$(r),r.doc}function Kr(e,t={}){let n=Q(Math.max(...e.map(e=>e.drawData.drawSize),8),t),r=P(n.doc,n.pageConfig,n.headerH,n.footerH);return vn(n.doc,e,n.format,r),Qr(n,1),$(n),n.doc}function qr(e,t={}){let n=Q(e.mainStructure?.drawSize||8,t),r=P(n.doc,n.pageConfig,n.headerH,n.footerH);return mn(n.doc,e,n.format,r),Qr(n,1),$(n),n.doc}function Jr(e,t={}){let n=Q(e.drawSize,t,!0),r=P(n.doc,n.pageConfig,n.headerH,n.footerH);return xr(n.doc,e,n.format,r),$(n),n.doc}function Yr(e,t={}){let n=Q(e.mainDraw.drawSize,t,!0),r=P(n.doc,n.pageConfig,n.headerH,n.footerH);return Ar(n.doc,e,n.format,r),$(n),n.doc}function Xr(e,t={}){let n=Q(Math.max(e.winnersBracket.drawSize,e.losersBracket.drawSize,8),t,!0),r=P(n.doc,n.pageConfig,n.headerH,n.footerH);return yn(n.doc,e,n.format,r),$(n),n.doc}function Zr(e,t={}){let n=Q(e.drawSize,t),r=P(n.doc,n.pageConfig,n.headerH,n.footerH);return an(n.doc,e,n.format,r),$(n),n.doc}function Q(e,t,n){let r=t.format||h(t.preset||`itfJunior`),i={...r.page,...t.page,orientation:n?`landscape`:t.page?.orientation||r.page.orientation},a=t.header||{layout:`none`,tournamentName:``},o=t.footer||{layout:`standard`,showPageNumbers:!0,showTimestamp:!0},s=pe(i,e),c=z(o);return{doc:s,pageConfig:i,headerConfig:a,footerConfig:o,format:r,headerH:R(s,a,i),footerH:c}}function Qr(e,t){let n=e.doc.getNumberOfPages();for(let r=t+1;r<=n;r++)e.doc.setPage(r),R(e.doc,e.headerConfig,e.pageConfig)}function $(e){let t=e.doc.getNumberOfPages();for(let n=1;n<=t;n++)e.doc.setPage(n),Me(e.doc,e.footerConfig,e.pageConfig,n);e.doc.setPage(t)}function $r(e,t={}){let n=e?.drawsData||[],r=e?.tournamentInfo||{},i=e?.eventInfo||{},a=S(t.catalogPreset||`club-basic`),o=h(a?.drawFormatPreset||`itfJunior`),s={layout:`itf`,tournamentName:r.tournamentName||`Tournament`,...a?.header,subtitle:i.eventName||a?.header?.subtitle,startDate:r.startDate,endDate:r.endDate,location:r.venues?.[0]?.venueName,city:r.venues?.[0]?.city,country:r.hostCountryCode,surface:i.surfaceCategory,...t.headerOverrides},c={layout:`standard`,showPageNumbers:!0,showTimestamp:!0,...a?.footer,...t.footerOverrides},l=n?.[0]?.structures||[],u=l.some(e=>e.stage===`CONSOLATION`),d=l.some(e=>e.stage===`PLAY_OFF`),f=l.find(e=>e.stage===`MAIN`),p={header:s,footer:c,format:o};if(u&&d)return Xr({winnersBracket:f?de(f):ei(),losersBracket:fe(n,`CONSOLATION`)?de(fe(n,`CONSOLATION`)):ei(),deciderMatch:fe(n,`PLAY_OFF`)?de(fe(n,`PLAY_OFF`)):void 0},p);if(u)return Kr(l.map(e=>({name:e.structureName,stage:e.stage,drawData:de(e)})),p);let m=t.structureId&&l.find(e=>e.structureId===t.structureId)||f;if(!m)return pe({pageSize:`a4`,orientation:`portrait`,margins:{top:12,right:15,bottom:12,left:15}});let g=de(m);return t.mirrored?Jr(g,p):t.splitPages||g.drawSize>=256?Wr(g,{...p,maxPositionsPerPage:t.maxPositionsPerPage||32}):Ur(g,p)}function ei(){return{drawName:``,drawSize:0,drawType:``,totalRounds:0,slots:[],matchUps:[],seedAssignments:[]}}exports.COMPOSITION_CATALOG=x,exports.DRAW_MODAL_TABS=Ze,exports.FACT_SHEET_CATALOG=ce,exports.FONT=he,exports.FOOTER_LAYOUT_OPTIONS=qe,exports.HEADER_LAYOUT_OPTIONS=Ke,exports.ORIENTATION_OPTIONS=Ye,exports.PAGE_SIZE_OPTIONS=Je,exports.PRESETS=m,exports.SCHEDULE_MODAL_TABS=Qe,exports.SIZE=I,exports.SPLIT_STRATEGY_OPTIONS=Xe,exports.STYLE=F,exports.TABLE_STYLES=Cn,exports.buildFooterFromTournament=je,exports.buildHeaderFromTournament=Ae,exports.calculateBracketPositions=Tn,exports.createDoc=pe,exports.drawBracketConnectors=Dn,exports.drawBracketSlot=En,exports.drawPageFooter=J,exports.drawTournamentHeader=q,exports.entryStatusDisplay=et,exports.eventAbbreviation=it,exports.executePrint=We,exports.extractCompassData=Sn,exports.extractConsolationStructures=_n,exports.extractCourtCardData=ft,exports.extractDrawData=ot,exports.extractParticipantData=dt,exports.extractRoundRobinData=ht,exports.extractScheduleData=lt,exports.findStructure=fe,exports.formatDate=nt,exports.formatMatchScore=W,exports.formatPlayerEntry=gt,exports.formatScore=tt,exports.formatTime=rt,exports.generateBackdrawPDF=Yr,exports.generateCompassDrawPDF=qr,exports.generateConsolationDrawPDF=Kr,exports.generateCourtCardPDF=Ln,exports.generateDoubleEliminationPDF=Xr,exports.generateDrawPDF=Vr,exports.generateDrawSheetPDF=kn,exports.generateFactSheet=br,exports.generateFeedInDrawPDF=Gr,exports.generateFromEventData=$r,exports.generateLuckyDrawPDF=Zr,exports.generateMatchCardPDF=tr,exports.generateMirroredDrawPDF=Jr,exports.generatePlayerListPDF=In,exports.generateReportPDF=ir,exports.generateSchedulePDF=Nn,exports.generateScheduleV2PDF=Bn,exports.generateSequentialOOP=Jn,exports.generateSignInSheetPDF=zn,exports.generateSplitDrawPDF=Wr,exports.generateTraditionalDrawPDF=Ur,exports.getCatalogPreset=S,exports.getDefaultPageConfig=me,exports.getFactSheetTemplate=le,exports.getPageRegions=P,exports.getPreset=h,exports.getRoundLabel=H,exports.listCatalogPresets=C,exports.listFactSheetTemplates=ue,exports.measureFooterHeight=z,exports.measureSeedingsHeight=Ue,exports.mergeCatalogPreset=ee,exports.mergePreset=g,exports.nationality=V,exports.participantName=B,exports.renderCompassDraw=mn,exports.renderConsolationDraw=vn,exports.renderDoubleEliminationDraw=yn,exports.renderFooter=Me,exports.renderHeader=R,exports.renderLuckyDraw=an,exports.renderRoundRobinGroup=Qt,exports.renderSeedingsFooter=Ve,exports.renderTraditionalDraw=G,exports.roundName=at,exports.seedDisplay=$e,exports.setFont=L,exports.splitDraw=cn,exports.structureToDrawData=de;
|
|
5
|
+
`)}function Gn(e,t){return e.name?t||e.nationality?`${e.name} (${e.nationality})`:e.name:`TBD`}function Kn(e,t,n,r){let{margins:i}=n,a=e.internal.pageSize.getWidth();e.setDrawColor(120),e.setLineWidth(.2),e.line(i.left,r-2,a-i.right,r-2),L(e,I.TINY,F.NORMAL);let o=(a-i.left-i.right)/t.length;t.forEach((t,n)=>{let a=i.left+n*o;L(e,I.TINY,F.ITALIC),e.setTextColor(100),e.text(t.role,a,r),L(e,I.TINY,F.BOLD),e.setTextColor(0),e.text(t.name,a,r+3)})}var qn=[120,50,140];function Jn(e,t={}){let n={pageSize:t.page?.pageSize||`a4`,orientation:t.page?.orientation||`portrait`,margins:t.page?.margins||{top:12,right:15,bottom:12,left:15}},r=pe(n),{margins:i}=n,a=r.internal.pageSize.getWidth(),o=r.internal.pageSize.getHeight(),s=a-i.left-i.right,c=t.accentColor||qn,l=t.footer||{layout:`none`},u=z(l),d=i.top;t.header&&(d=i.top+R(r,t.header,n)+3);let f=$n(e);for(let[e,a]of f){d+30>o-i.bottom-u&&(er(r,t,n,l),r.addPage(),d=i.top),d=Yn(r,e,i.left,d,s);let f=``;for(let e of a){let a=e.scheduledTime||e.notBeforeTime||``;a&&a!==f&&(d+25>o-i.bottom-u&&(er(r,t,n,l),r.addPage(),d=i.top),d=Xn(r,a,!!e.notBeforeTime,i.left,d,s,c),f=a),d+22>o-i.bottom-u&&(er(r,t,n,l),r.addPage(),d=i.top),d=Zn(r,e,i.left,d,s)}d+=4}return t.disclaimer&&(d+=2,L(r,I.TINY,F.ITALIC),r.setTextColor(100),r.text(t.disclaimer,a/2,d,{align:`center`}),r.setTextColor(0)),er(r,t,n,l),r}function Yn(e,t,n,r,i){return L(e,I.HEADING,F.BOLD),e.setTextColor(40),e.text(t.toUpperCase(),n+i/2,r,{align:`center`}),e.setTextColor(0),r+7}function Xn(e,t,n,r,i,a,o){let s=n?`Not before ${t}`:`Starting at ${t}`;return e.setFillColor(o[0],o[1],o[2]),e.rect(r+20,i,a-40,5,`F`),L(e,I.SMALL,F.ITALIC),e.setTextColor(255,255,255),e.text(s,r+a/2,i+3.5,{align:`center`}),e.setTextColor(0),i+7}function Zn(e,t,n,r,i){let a=n+15,o=i-30,s=r;L(e,I.TINY,F.ITALIC),e.setTextColor(100);let c=t.eventAbbr?`${t.eventAbbr} ${t.roundName}`:t.roundName;e.text(c,a+o-2,r+3,{align:`right`}),e.setTextColor(0),t.score&&(L(e,I.SMALL,F.BOLD),e.setTextColor(120,50,140),e.text(t.score,a+o/2,r+3,{align:`center`}),e.setTextColor(0),r+=4),r+=2,r=Qn(e,t.side1,a,r,o),L(e,I.TINY,F.ITALIC),e.setTextColor(120),e.text(`vs`,a+o/2,r+2.5,{align:`center`}),e.setTextColor(0),r+=4,r=Qn(e,t.side2,a,r,o),r+=2;let l=r-s;return e.setDrawColor(180),e.setLineWidth(.3),e.rect(a,s,o,l),r+2}function Qn(e,t,n,r,i){if(!t.name||t.name===`TBD`)return L(e,I.BODY,F.ITALIC),e.setTextColor(150),e.text(`TBD`,n+10,r+3),e.setTextColor(0),r+4;L(e,I.BODY,F.NORMAL);let a=t.nationality?`${t.name} ${t.nationality}`:t.name;return e.text(a,n+10,r+3),r+4}function $n(e){let t=new Map;for(let n of e.courts)t.set(n,[]);for(let n of e.timeSlots)for(let e of n.matches)t.has(e.courtName)||t.set(e.courtName,[]),t.get(e.courtName).push(e);for(let[e,n]of t)n.length===0&&t.delete(e);return t}function er(e,t,n,r){let{margins:i}=n,a=e.internal.pageSize.getWidth(),o=e.internal.pageSize.getHeight();if(t.officials?.length){let n=o-i.bottom-10;e.setDrawColor(120),e.setLineWidth(.2),e.line(i.left,n-2,a-i.right,n-2);let r=(a-i.left-i.right)/t.officials.length;t.officials.forEach((t,a)=>{let o=i.left+a*r;L(e,I.TINY,F.BOLD),e.text(t.role,o,n),L(e,I.TINY,F.NORMAL),e.text(t.name,o,n+3)})}Me(e,r,n)}function tr(e,n={}){let{cardsPerPage:r=2,includeScoreBoxes:i=!0}=n,a=new t.default({orientation:`landscape`,format:`a5`});return e.forEach((e,t)=>{t>0&&(r===1||t%r===0)&&a.addPage(),nr(a,e,r===2&&t%2==1?a.internal.pageSize.getHeight()/2:5,i)}),a}function nr(e,t,n,r){let i=e.internal.pageSize.getWidth(),a=i/2,o=n;if(t.tournamentName&&(L(e,I.BODY,F.NORMAL),e.setTextColor(100),e.text(t.tournamentName,a,o,{align:`center`}),e.setTextColor(0),o+=5),L(e,I.HEADING,F.BOLD),e.text(`${t.eventName} - ${t.roundName}`,a,o,{align:`center`}),o+=5,t.courtName||t.scheduledTime){L(e,I.BODY,F.NORMAL);let n=[];t.courtName&&n.push(`Court: ${t.courtName}`),t.scheduledTime&&n.push(`Time: ${t.scheduledTime}`),e.text(n.join(` `),a,o,{align:`center`}),o+=5}if(e.setDrawColor(0),e.setLineWidth(.5),e.line(10,o,i-10,o),o+=6,rr(e,t.side1,10,o,i),o+=8,L(e,I.BODY,F.ITALIC),e.setTextColor(120),e.text(`vs.`,a,o,{align:`center`}),e.setTextColor(0),o+=6,rr(e,t.side2,10,o,i),o+=8,r){e.setDrawColor(0),e.setLineWidth(.5),e.line(10,o,i-10,o),o+=4,L(e,I.SMALL,F.BOLD),e.text(`Score:`,10,o);for(let t=0;t<5;t++){let n=28+t*15;e.rect(n,o-4,12,8),L(e,I.TINY,F.NORMAL),e.setTextColor(150),e.text(`Set ${t+1}`,n+12/2,o-5,{align:`center`}),e.setTextColor(0)}o+=14,L(e,I.SMALL,F.NORMAL),e.text(`Umpire:`,10,o),e.setDrawColor(150),e.setLineWidth(.3),e.line(30,o,90,o),e.text(`Signature:`,i-10-70,o),e.line(i-10-40,o,i-10,o)}}function rr(e,t,n,r,i){L(e,14,F.BOLD);let a=t.seedValue?`[${t.seedValue}] `:``;e.text(`${a}${t.name}`,n,r),L(e,I.HEADING,F.NORMAL),e.setTextColor(80),e.text(t.nationality,i-n,r,{align:`right`}),e.setTextColor(0)}function ir(e,r,i={}){let a=new t.default({orientation:i.orientation||`portrait`,format:`a4`}),o=15;if(i.header?o=q(a,{...i.header,subtitle:i.header.subtitle||i.title}):i.title&&(L(a,I.SUBTITLE,F.BOLD),a.text(i.title,15,o),o+=8),e.length===0)return L(a,I.BODY,F.ITALIC),a.text(`No columns defined`,15,o),J(a,`Generated ${new Date().toLocaleDateString()}`,1),a;let s=e.map(e=>({header:e.title,dataKey:e.key})),c=r.map(t=>{let n={};for(let r of e){let e=t[r.key];n[r.key]=e==null?``:String(e)}return n}),l={};for(let t of e)t.type===`number`&&(l[t.key]={halign:`right`}),t.width&&(l[t.key]={...l[t.key],cellWidth:t.width});return(0,n.default)(a,{...Cn.report,startY:o,columns:s,body:c,columnStyles:l,didDrawPage:e=>{J(a,`Generated ${new Date().toLocaleDateString()}`,e.pageNumber)}}),a}var Y=15;function ar(e){if(typeof document<`u`){let t=document.createElement(`div`);return t.innerHTML=e,t.textContent||``}let t=``,n=!1;for(let r of e){if(r===`<`){n=!0;continue}if(r===`>`){n=!1;continue}n||(t+=r)}return t.trim()}function X(e,t,n){return L(e,I.HEADING,F.BOLD),e.setTextColor(40),e.text(t.toUpperCase(),Y,n),e.setTextColor(0),n+=1.5,e.setDrawColor(180),e.setLineWidth(.2),e.line(Y,n,e.internal.pageSize.getWidth()-Y,n),n+=4,n}function or(e,t,n,r){L(e,I.BODY,F.NORMAL);let i=r||e.internal.pageSize.getWidth()-Y*2,a=e.splitTextToSize(t,i);return e.text(a,Y,n),n+a.length*3.2}function Z(e,t,n){let r=e.internal.pageSize.getHeight();return t+n>r-20?(e.addPage(),20):t}function sr(e,t,n){let r={pageSize:`a4`,orientation:`portrait`,margins:{top:n,right:Y,bottom:15,left:Y}};return n+R(e,Ae(t,{layout:`itf`}),r)}function cr(e,t,r){let i=(t.participants||[]).filter(e=>e.participantRole&&e.participantRole!==`COMPETITOR`);if(!i.length)return r;r=Z(e,r,20),r=X(e,`Tournament Contacts`,r);let a=i.map(e=>{let t=e.person||{},n=[t.standardGivenName,t.standardFamilyName].filter(Boolean).join(` `)||e.participantName||``,r=e.participantRoleResponsibilities?.[0]||e.participantRole||``,i=t.contacts?.[0]||{};return[n,r,[i.emailAddress,i.telephone||i.mobileTelephone].filter(Boolean).join(` | `)]});return(0,n.default)(e,{startY:r,head:[[`Name`,`Role`,`Contact`]],body:a,margin:{left:Y,right:Y},styles:{fontSize:7,cellPadding:1.5},headStyles:{fillColor:[60,60,60],textColor:255,fontStyle:`bold`},theme:`grid`}),e.lastAutoTable.finalY+6}function lr(e,t,r){let i=t.events||[];if(!i.length)return r;r=Z(e,r,20),r=X(e,`Events`,r);let a=i.map(e=>{let t=e.drawDefinitions?.[0]?.drawSize||``;return[e.eventName||``,e.eventType||``,e.matchUpFormat||``,String(t)]});return(0,n.default)(e,{startY:r,head:[[`Event`,`Type`,`Format`,`Draw Size`]],body:a,margin:{left:Y,right:Y},styles:{fontSize:7,cellPadding:1.5},headStyles:{fillColor:[60,60,60],textColor:255,fontStyle:`bold`},theme:`grid`}),e.lastAutoTable.finalY+6}function ur(e,t,n){let r=t.registrationProfile;if(!r)return n;let i=[];if(r.entriesOpen&&i.push(`Entries Open: `+r.entriesOpen),r.entriesClose&&i.push(`Entries Close: `+r.entriesClose),r.withdrawalDeadline&&i.push(`Withdrawal Deadline: `+r.withdrawalDeadline),r.entryMethod&&i.push(`Entry Method: `+r.entryMethod),r.entryUrl&&i.push(`Entry URL: `+r.entryUrl),r.eligibilityNotes&&i.push(`Eligibility: `+r.eligibilityNotes),r.entryFees?.length){let e=r.entryFees.map(e=>(e.eventType?e.eventType+`: `:``)+e.currencyCode+` `+e.amount).join(`, `);i.push(`Entry Fees: `+e)}if(!i.length)return n;n=Z(e,n,10+i.length*3.5),n=X(e,`Entry Information`,n),L(e,I.BODY,F.NORMAL);for(let t of i)e.text(t,Y,n),n+=3.5;return n+3}function dr(e,t,n){let r=t.venues||[];if(!r.length)return n;n=Z(e,n,15),n=X(e,`Venue`,n),L(e,I.BODY,F.NORMAL);for(let t of r){L(e,I.BODY,F.BOLD),e.text(t.venueName||`Venue`,Y,n),n+=3.5,L(e,I.BODY,F.NORMAL);let r=t.addresses?.[0];if(r){let t=[r.street,r.city,r.state,r.postalCode,r.countryCode].filter(Boolean);t.length&&(e.text(t.join(`, `),Y,n),n+=3.5)}let i=t.courts?.length;i&&(e.text(`Courts: `+i,Y,n),n+=3.5)}return n+3}function fr(e,t,r,i){if(!r)return i;let a=r.options?.length,o=r.notes&&ar(r.notes);if(!a&&!o)return i;if(i=Z(e,i,15),i=X(e,t,i),a){let t=r.options.map(e=>{let t=[e.phone,e.email,e.priceRange].filter(Boolean).join(` | `);return[e.name,e.address||``,t]});(0,n.default)(e,{startY:i,head:[[`Name`,`Address`,`Details`]],body:t,margin:{left:Y,right:Y},styles:{fontSize:7,cellPadding:1.5},headStyles:{fillColor:[60,60,60],textColor:255,fontStyle:`bold`},theme:`grid`}),i=e.lastAutoTable.finalY+3}return o&&(i=or(e,ar(r.notes),i)),i+3}function pr(e,t,n){let r=t.totalPrizeMoney;if(!r?.length)return n;n=Z(e,n,10),n=X(e,`Prize Money`,n),L(e,I.BODY,F.NORMAL);for(let t of r)e.text(t.currencyCode+` `+t.amount.toLocaleString(),Y,n),n+=3.5;return n+3}function mr(e,t,r){let i=(t.participants||[]).filter(e=>e.participantRole===`OFFICIAL`||e.participantRole===`DIRECTOR`);if(!i.length)return r;r=Z(e,r,15),r=X(e,`Officials`,r);let a=i.map(e=>{let t=e.person||{};return[[t.standardGivenName,t.standardFamilyName].filter(Boolean).join(` `)||e.participantName||``,e.participantRoleResponsibilities?.[0]||e.participantRole||``]});return(0,n.default)(e,{startY:r,head:[[`Name`,`Role`]],body:a,margin:{left:Y,right:Y},styles:{fontSize:7,cellPadding:1.5},headStyles:{fillColor:[60,60,60],textColor:255,fontStyle:`bold`},theme:`grid`}),e.lastAutoTable.finalY+6}function hr(e,t,n){let r=t.registrationProfile;if(!r)return n;let i=[];if(r.codeOfConduct){let e=r.codeOfConduct;i.push(`Code of Conduct: `+(e.name||``)+(e.url?` — `+e.url:``))}if(r.regulations?.length)for(let e of r.regulations)i.push((e.name||`Regulation`)+(e.url?` — `+e.url:``));if(r.dressCode&&i.push(`Dress Code: `+r.dressCode),r.contingencyPlan&&i.push(`Contingency: `+r.contingencyPlan),!i.length)return n;n=Z(e,n,10+i.length*3.5),n=X(e,`Regulations`,n),L(e,I.BODY,F.NORMAL);for(let t of i)e.text(t,Y,n),n+=3.5;return n+3}function gr(e,t,n){let r=t.registrationProfile?.sponsors;if(!r?.length)return n;n=Z(e,n,10),n=X(e,`Sponsors`,n),L(e,I.BODY,F.NORMAL);for(let t of r){let r=t.tier?` [`+t.tier+`]`:``;e.text(t.name+r,Y,n),n+=3.5}return n+3}function _r(e,t,n){let r=t.registrationProfile?.socialEvents;if(!r?.length)return n;let i=t.registrationProfile;n=Z(e,n,15),n=X(e,`Social Events & Ceremonies`,n),L(e,I.BODY,F.NORMAL),i?.drawCeremonyDate&&(e.text(`Draw Ceremony: `+i.drawCeremonyDate,Y,n),n+=3.5),i?.awardsCeremonyDate&&(e.text(`Awards Ceremony: `+i.awardsCeremonyDate,Y,n),n+=3.5);for(let t of r){L(e,I.BODY,F.BOLD),e.text(t.name,Y,n),n+=3.5,L(e,I.BODY,F.NORMAL);let r=[t.date,t.time,t.location].filter(Boolean).join(` | `);r&&(e.text(r,Y,n),n+=3.5),t.description&&(e.text(t.description,Y,n),n+=3.5)}return n+3}function vr(e,t,n){let r=t.notes;if(!r)return n;let i=ar(r);return i?(n=Z(e,n,15),n=X(e,`Additional Information`,n),n=or(e,i,n),n+3):n}var yr={"tournament-header":sr,contacts:cr,events:lr,"entry-info":ur,"venue-info":dr,accommodation:(e,t,n)=>fr(e,`Accommodation`,t.registrationProfile?.accommodation,n),transportation:(e,t,n)=>fr(e,`Transportation`,t.registrationProfile?.transportation,n),hospitality:(e,t,n)=>fr(e,`Hospitality`,t.registrationProfile?.hospitality,n),medical:(e,t,n)=>fr(e,`Medical`,t.registrationProfile?.medicalInfo,n),regulations:hr,"prize-money":pr,officials:mr,sponsors:gr,"social-events":_r,"custom-notes":vr};function br(e,n={}){let{templateId:r=`itf-junior`}=n,i=le(r)?.sections||le(`itf-junior`).sections,a=n.enabledSections?new Set(n.enabledSections):null,o=new t.default({orientation:`portrait`,format:`a4`}),s=Y;for(let t of i){if(!t.enabled||a&&!a.has(t.type))continue;let n=yr[t.type];n&&(s=n(o,e,s))}let c=o.getNumberOfPages();for(let e=1;e<=c;e++)o.setPage(e),J(o,`Generated `+new Date().toLocaleDateString(),e);return o}function xr(e,t,n,r){let i=n.page.margins,a=r.contentY+9,o=r.contentHeight-9,s=t.drawSize/2,c=Math.log2(s),l=r.contentWidth,u=Math.min(30,l*.08),d=(l-u)/2,f=i.left+d,p=o/s,m=p<3.5,h=m?.8:1.5,g=Math.min(m?30:50,d*.22),_=c,v=d-g-h*(_+1),y=Math.max(8,v/Math.max(1,_)),b=I.SMALL;p<2.5?b=5:m&&(b=I.TINY);let x=m?5:I.TINY,S={lineHeight:p,roundColumnWidth:y,firstRoundWidth:g,connectorGap:h,fontSize:b,scoreFontSize:x},C=t.slots.filter(e=>e.drawPosition<=s),ee=t.slots.filter(e=>e.drawPosition>s),w=t.matchUps.filter(e=>e.drawPositions.every(e=>e<=s)),T=t.matchUps.filter(e=>e.drawPositions.every(e=>e>s)),E=ee.map(e=>({...e,drawPosition:e.drawPosition-s})),D=new Map;for(let e of T)D.has(e.roundNumber)||D.set(e.roundNumber,[]),D.get(e.roundNumber).push(e);let O=[];for(let[,e]of D)e.sort((e,t)=>e.roundPosition-t.roundPosition),e.forEach((e,t)=>{O.push({...e,drawPositions:e.drawPositions.map(e=>e-s),roundPosition:t+1})});let k=new Map;for(let e of w)k.has(e.roundNumber)||k.set(e.roundNumber,[]),k.get(e.roundNumber).push(e);let A=[];for(let[,e]of k)e.sort((e,t)=>e.roundPosition-t.roundPosition),e.forEach((e,t)=>{A.push({...e,roundPosition:t+1})});wr(e,c,t.totalRounds,S,n,i.left,i.left+l,r.contentY+2,t.roundLabelMap),L(e,m?5.5:I.SMALL,F.BOLD),e.setTextColor(40),e.text(`Winner`,f+u/2,r.contentY+2,{align:`center`}),e.setDrawColor(160),e.setLineWidth(.15),e.line(f+2,r.contentY+3.5,f+u-2,r.contentY+3.5),e.setTextColor(0),Sr(e,C,A,c,S,n,i.left,a,t.totalRounds),Cr(e,E,O,c,S,n,i.left+l,a,t.totalRounds);let j=t.matchUps.find(e=>e.roundNumber===t.totalRounds);if(j){let r=a+o/2;if(e.setDrawColor(40),e.setLineWidth(.25),e.line(f+2,r,f+u-2,r),j.winningSide){let i=j.drawPositions[j.winningSide-1],a=t.slots.find(e=>e.drawPosition===i);if(a){let{name:t}=U(a,n);L(e,b+1,F.BOLD),e.text(t,f+u/2,r-1,{align:`center`})}}j.score&&(L(e,x,F.NORMAL),e.setTextColor(60,60,160),e.text(W(j.score,n),f+u/2,r+x*.4,{align:`center`}),e.setTextColor(0))}}function Sr(e,t,n,r,i,a,o,s,c){let l=new Map(t.map(e=>[e.drawPosition,e])),u=t.length;for(let t=0;t<r;t++){let c=u/2**(t+1),d=i.lineHeight*2**t,f=(2**t-1)*i.lineHeight/2,p=2**(t+1)*i.lineHeight,m=Tr(t,i,o),h=t===0?i.firstRoundWidth:i.roundColumnWidth;for(let u=0;u<c;u++){let c=s+f+u*p,g=c+d,_=(c+g)/2;if(t===0){let t=u*2+1,n=u*2+2;Dr(e,l.get(t),i,m,c,h,`ltr`),Dr(e,l.get(n),i,m,g,h,`ltr`)}else e.setDrawColor(40),e.setLineWidth(.25),e.line(m,c,m+h,c),e.line(m,g,m+h,g);let v=m+h,y=Tr(t+1,i,o);e.setDrawColor(40),e.setLineWidth(.25),e.line(v+i.connectorGap,c,v+i.connectorGap,g),e.line(v,c,v+i.connectorGap,c),e.line(v,g,v+i.connectorGap,g),e.line(v+i.connectorGap,_,y,_);let b=kr(n,t+1,u+1);if(t<r-1&&b?.winningSide){let t=b.drawPositions[b.winningSide-1],n=l.get(t);if(n){L(e,i.fontSize,F.BOLD);let t=n.participantName;e.getTextWidth(t)>i.roundColumnWidth-2&&(t=Or(t)),e.text(t,y+1,_-.5)}}b?.score&&t<r-1&&(L(e,i.scoreFontSize,F.NORMAL),e.setTextColor(60,60,160),e.text(W(b.score,a),y+1,_-.5+i.scoreFontSize*.4),e.setTextColor(0))}}}function Cr(e,t,n,r,i,a,o,s,c){let l=new Map(t.map(e=>[e.drawPosition,e])),u=t.length;for(let t=0;t<r;t++){let c=u/2**(t+1),d=i.lineHeight*2**t,f=(2**t-1)*i.lineHeight/2,p=2**(t+1)*i.lineHeight,m=Er(t,i,o),h=t===0?i.firstRoundWidth:i.roundColumnWidth;for(let u=0;u<c;u++){let c=s+f+u*p,g=c+d,_=(c+g)/2;if(t===0){let t=u*2+1,n=u*2+2;Dr(e,l.get(t),i,m,c,h,`rtl`),Dr(e,l.get(n),i,m,g,h,`rtl`)}else e.setDrawColor(40),e.setLineWidth(.25),e.line(m,c,m+h,c),e.line(m,g,m+h,g);let v=m,y=Er(t+1,i,o);e.setDrawColor(40),e.setLineWidth(.25),e.line(v-i.connectorGap,c,v-i.connectorGap,g),e.line(v,c,v-i.connectorGap,c),e.line(v,g,v-i.connectorGap,g),e.line(v-i.connectorGap,_,y+i.roundColumnWidth,_);let b=kr(n,t+1,u+1);if(t<r-1&&b?.winningSide){let t=b.drawPositions[b.winningSide-1],n=l.get(t);if(n){L(e,i.fontSize,F.BOLD);let t=n.participantName;e.getTextWidth(t)>i.roundColumnWidth-2&&(t=Or(t));let r=y;e.text(t,r+i.roundColumnWidth-1,_-.5,{align:`right`})}}if(b?.score&&t<r-1){let t=y;L(e,i.scoreFontSize,F.NORMAL),e.setTextColor(60,60,160),e.text(W(b.score,a),t+i.roundColumnWidth-1,_-.5+i.scoreFontSize*.4,{align:`right`}),e.setTextColor(0)}}}}function wr(e,t,n,r,i,a,o,s,c){L(e,r.fontSize<=I.TINY?5.5:I.SMALL,F.BOLD),e.setTextColor(40);for(let l=0;l<t;l++){let u=n-t+l+1,d=H(u,n),f=c?.[u]||i.roundLabels[d]||d,p=l===0?r.firstRoundWidth:r.roundColumnWidth,m=Tr(l,r,a);e.text(f,m+p/2,s,{align:`center`}),e.setDrawColor(160),e.setLineWidth(.15),e.line(m+2,s+1.5,m+p-2,s+1.5);let h=Er(l,r,o);e.text(f,h+p/2,s,{align:`center`}),e.line(h+2,s+1.5,h+p-2,s+1.5)}e.setTextColor(0)}function Tr(e,t,n){return e===0?n:n+t.firstRoundWidth+t.connectorGap+(e-1)*(t.roundColumnWidth+t.connectorGap)}function Er(e,t,n){return e===0?n-t.firstRoundWidth:n-t.firstRoundWidth-t.connectorGap-(e-1)*(t.roundColumnWidth+t.connectorGap)-t.roundColumnWidth}function Dr(e,t,n,r,i,a,o){if(e.setDrawColor(40),e.setLineWidth(.25),e.line(r,i,r+a,i),!t||t.isBye){t?.isBye&&(L(e,n.fontSize,F.ITALIC),e.setTextColor(150),o===`ltr`?e.text(`Bye`,r+1,i-.3):e.text(`Bye`,r+a-1,i-.3,{align:`right`}),e.setTextColor(0));return}let s=t.seedValue?`[${t.seedValue}]`:``;L(e,n.fontSize,F.NORMAL);let c=t.participantName,l=s?`${s} ${c}`:c;e.getTextWidth(l)>a-2&&(c=Or(t.participantName),l=s?`${s} ${c}`:c),o===`ltr`?e.text(l,r+1,i-.3):e.text(l,r+a-1,i-.3,{align:`right`})}function Or(e){let t=e.match(/^([^,]+),\s*(.+)/);if(t)return`${t[2][0]}. ${t[1]}`;let n=e.match(/^(\S+)\s+(.+)/);return n?`${n[1][0]}. ${n[2]}`:e}function kr(e,t,n){return e.find(e=>e.roundNumber===t&&e.roundPosition===n)}function Ar(e,t,n,r){let i=n.page.margins,a=r.contentY+9,o=r.contentHeight-9,s=r.contentWidth,c=t.mainDraw.matchUps,l=t.mainDraw.slots,u=t.consolation.matchUps,d=t.consolation.slots,f=new Map(l.map(e=>[e.drawPosition,e])),p=new Map(d.map(e=>[e.drawPosition,e])),m=c.filter(e=>e.roundNumber===1).sort((e,t)=>e.roundPosition-t.roundPosition),h=m.length,g=h*2,_=Math.max(...c.map(e=>e.roundNumber)),v=_-1,y=u.length>0?Math.max(...u.map(e=>e.roundNumber)):0,b=1.5,x=s-28-b*4,S=v+1,C=Math.max(y+1,1),ee=x*(S/(S+C)),w=x-ee,T=i.left+w+b,E=S>0?(ee-b*S)/S:0,D=T+28+b,O=C>0?(w-b*C)/C:0,k=i.left+w,A=o/g,j=A<3.5,M=I.SMALL;A<2.5?M=5:j&&(M=I.TINY);let te=j?5:I.TINY;zr(e,_,y,t,n,T,28,D,E,k,O,b,r.contentY+2,M),jr(e,m,h,f,T,28,b,D,k,a,A,M,y),Nr(e,c,f,_,h,D,E,b,a,A,M,te,n,t.mainDraw.roundLabelMap),Pr(e,u,p,y,k,O,b,a,A,h,M,te,n,t.consolation.roundLabelMap)}function jr(e,t,n,r,i,a,o,s,c,l,u,d,f){for(let p=0;p<n;p++){let n=t[p],m=l+p*u*2,h=m+u,g=(m+h)/2,_=n.drawPositions[0],v=n.drawPositions[1],y=u*.9;e.setDrawColor(40),e.setLineWidth(.3),e.rect(i,m,a,y),e.rect(i,h,a,y);let b=_?r.get(_):void 0,x=v?r.get(v):void 0;L(e,d,F.NORMAL),_&&Mr(e,_,b,n.winningSide===1,i,m,y,a,d),v&&Mr(e,v,x,n.winningSide===2,i,h,y,a,d),e.setDrawColor(40),e.setLineWidth(.25),e.line(i+a,m+y/2,i+a+o,m+y/2),e.line(i+a,h+y/2,i+a+o,h+y/2),e.line(i+a+o,m+y/2,i+a+o,h+y/2),e.line(i+a+o,g,s,g),f>0&&(e.line(i,m+y/2,i-o,m+y/2),e.line(i,h+y/2,i-o,h+y/2),e.line(i-o,m+y/2,i-o,h+y/2),e.line(i-o,g,c,g))}}function Mr(e,t,n,r,i,a,o,s,c){if(e.setTextColor(120),L(e,c,F.NORMAL),e.text(`${t}`,i+1,a+o/2+c*.12),e.setTextColor(0),n?.participantName){let t=Br(n.participantName);L(e,c,r?F.BOLD:F.NORMAL),e.text(t,i+5,a+o/2+c*.12,{maxWidth:s-6})}}function Nr(e,t,n,r,i,a,o,s,c,l,u,d,f,p){for(let i=0;i<r-1;i++){let p=i+2,m=t.filter(e=>e.roundNumber===p).sort((e,t)=>e.roundPosition-t.roundPosition),h=l*2**(i+1),g=(2**(i+1)-1)*l/2,_=a+i*(o+s);for(let t=0;t<m.length;t++){let l=m[t],p=c+g+t*h*2,v=p+h,y=(p+v)/2;if(e.setDrawColor(40),e.setLineWidth(.25),e.line(_,p,_+o,p),e.line(_,v,_+o,v),Rr(e,l,n,_,p,v,o,u,f),i<r-2){let t=_+o;e.line(t+s,p,t+s,v),e.line(t,p,t+s,p),e.line(t,v,t+s,v),e.line(t+s,y,_+o+s+o+s>0?a+(i+1)*(o+s):t+s+5,y)}l.score&&(L(e,d,F.NORMAL),e.setTextColor(60,60,160),e.text(W(l.score,f),_+o-1,y+d*.12,{align:`right`}),e.setTextColor(0))}}let m=a+(r-2)*(o+s)+o+s,h=c+(2**(r-1)-1)*l/2+l*2**(r-2);e.setDrawColor(40),e.setLineWidth(.25),e.line(m,h,m+o,h);let g=t.find(e=>e.roundNumber===r);if(g?.winningSide){let t=n.get(g.drawPositions[g.winningSide-1]);if(t){let{name:n}=U(t,f);L(e,u+1,F.BOLD),e.text(n,m+1,h-.5)}}}function Pr(e,t,n,r,i,a,o,s,c,l,u,d,f,p){for(let l=0;l<r;l++)Fr(e,t,n,l,r,i,a,o,s,c,u,d,f);Lr(e,t,n,r,i,a,o,s,c,u,f)}function Fr(e,t,n,r,i,a,o,s,c,l,u,d,f){let p=r+1,m=t.filter(e=>e.roundNumber===p).sort((e,t)=>e.roundPosition-t.roundPosition),h=l*2**(r+1),g=(2**(r+1)-1)*l/2,_=a-(r+1)*(o+s);for(let t=0;t<m.length;t++){let l=m[t],p=c+g+t*h*2,v=p+h,y=(p+v)/2;if(e.setDrawColor(40),e.setLineWidth(.25),e.line(_,p,_+o,p),e.line(_,v,_+o,v),Ir(e,l.drawPositions[0],n,u,_,o,p),Ir(e,l.drawPositions[1],n,u,_,o,v),r<i-1){e.line(_-s,p,_-s,v),e.line(_,p,_-s,p),e.line(_,v,_-s,v);let t=a-(r+2)*(o+s);e.line(_-s,y,t+o,y)}l.score&&(L(e,d,F.NORMAL),e.setTextColor(60,60,160),e.text(W(l.score,f),_+1,y+d*.12),e.setTextColor(0))}}function Ir(e,t,n,r,i,a,o){if(!t)return;let s=n.get(t);if(!s?.participantName)return;L(e,r,F.BOLD);let c=s.participantName;e.getTextWidth(c)>a-2&&(c=Br(c)),e.text(c,i+a-1,o-.3,{align:`right`})}function Lr(e,t,n,r,i,a,o,s,c,l,u){if(r<=0)return;let d=i-(r+1)*(a+o),f=s+(2**r-1)*c/2+c*2**(r-1);e.setDrawColor(40),e.setLineWidth(.25),e.line(d,f,d+a,f);let p=t.find(e=>e.roundNumber===r);if(p?.winningSide){let t=n.get(p.drawPositions[p.winningSide-1]);if(t){let{name:n}=U(t,u);L(e,l+1,F.BOLD),e.text(n,d+a-1,f-.5,{align:`right`})}}}function Rr(e,t,n,r,i,a,o,s,c){if(t.drawPositions[0]){let a=n.get(t.drawPositions[0]);if(a?.participantName){L(e,s,F.BOLD);let t=a.participantName;e.getTextWidth(t)>o-2&&(t=Br(t)),e.text(t,r+1,i-.3)}}if(t.drawPositions[1]){let i=n.get(t.drawPositions[1]);if(i?.participantName){L(e,s,F.BOLD);let t=i.participantName;e.getTextWidth(t)>o-2&&(t=Br(t)),e.text(t,r+1,a-.3)}}}function zr(e,t,n,r,i,a,o,s,c,l,u,d,f,p){L(e,p<=I.TINY?5.5:I.SMALL,F.BOLD),e.setTextColor(40);let m=r.mainDraw.roundLabelMap?.[1]||`R1`;e.text(m,a+o/2,f,{align:`center`});for(let n=0;n<t-1;n++){let t=n+2,i=r.mainDraw.roundLabelMap?.[t]||`R${t}`,a=s+n*(c+d);e.text(i,a+c/2,f,{align:`center`})}for(let t=0;t<n;t++){let n=t+1,i=r.consolation.roundLabelMap?.[n]||`C-R${n}`,a=l-(t+1)*(u+d);e.text(i,a+u/2,f,{align:`center`})}e.setTextColor(0)}function Br(e){let t=e.match(/^([^,]+),\s*(.+)/);if(t)return`${t[2][0]}. ${t[1]}`;let n=e.match(/^(\S+)\s+(.+)/);return n?`${n[1][0]}. ${n[2]}`:e}function Vr(e,t={}){return Hr(e.matchUps)?Gr(e,t):Ur(e,t)}function Hr(e){let t=new Map;for(let n of e)t.set(n.roundNumber,(t.get(n.roundNumber)||0)+1);let n=[...t.keys()].sort((e,t)=>e-t);for(let e=1;e<n.length;e++){let r=t.get(n[e-1])||0;if((t.get(n[e])||0)>=r)return!0}return!1}function Ur(e,t={}){if(e.drawSize>=256)return Wr(e,{...t,maxPositionsPerPage:64});let n=Q(e.drawSize,t),r=P(n.doc,n.pageConfig,n.headerH,n.footerH);return G(n.doc,e,n.format,r),$(n),n.doc}function Wr(e,t={}){let n=Q(e.drawSize,t),r=cn(e,{maxPositionsPerPage:t.maxPositionsPerPage||32,includeOverlapRounds:!0,summaryPage:!0});for(let t=0;t<r.length;t++){t>0&&n.doc.addPage();let i=R(n.doc,{...n.headerConfig,subtitle:r[t].label},n.pageConfig),a=P(n.doc,n.pageConfig,i,n.footerH);if(r[t].slots.length>0||r[t].matchUps.length>0){let i=r[t],o=i.endPosition-i.startPosition+1,s={...e,slots:i.slots,matchUps:i.matchUps,noWinnerColumn:i.noWinnerColumn,roundLabelMap:i.roundLabelMap||e.roundLabelMap,drawSize:o,totalRounds:i.segmentRounds};G(n.doc,s,n.format,a,i.startPosition-1,o)}}return $(n),n.doc}function Gr(e,t={}){let n=e.totalRounds>=5||e.slots.length>=12,r=Q(e.drawSize,t,n),i=P(r.doc,r.pageConfig,r.headerH,r.footerH);return G(r.doc,e,r.format,i),$(r),r.doc}function Kr(e,t={}){let n=Q(Math.max(...e.map(e=>e.drawData.drawSize),8),t),r=P(n.doc,n.pageConfig,n.headerH,n.footerH);return vn(n.doc,e,n.format,r),Qr(n,1),$(n),n.doc}function qr(e,t={}){let n=Q(e.mainStructure?.drawSize||8,t),r=P(n.doc,n.pageConfig,n.headerH,n.footerH);return mn(n.doc,e,n.format,r),Qr(n,1),$(n),n.doc}function Jr(e,t={}){let n=Q(e.drawSize,t,!0),r=P(n.doc,n.pageConfig,n.headerH,n.footerH);return xr(n.doc,e,n.format,r),$(n),n.doc}function Yr(e,t={}){let n=Q(e.mainDraw.drawSize,t,!0),r=P(n.doc,n.pageConfig,n.headerH,n.footerH);return Ar(n.doc,e,n.format,r),$(n),n.doc}function Xr(e,t={}){let n=Q(Math.max(e.winnersBracket.drawSize,e.losersBracket.drawSize,8),t,!0),r=P(n.doc,n.pageConfig,n.headerH,n.footerH);return yn(n.doc,e,n.format,r),$(n),n.doc}function Zr(e,t={}){let n=Q(e.drawSize,t),r=P(n.doc,n.pageConfig,n.headerH,n.footerH);return an(n.doc,e,n.format,r),$(n),n.doc}function Q(e,t,n){let r=t.format||h(t.preset||`itfJunior`),i={...r.page,...t.page,orientation:n?`landscape`:t.page?.orientation||r.page.orientation},a=t.header||{layout:`none`,tournamentName:``},o=t.footer||{layout:`standard`,showPageNumbers:!0,showTimestamp:!0},s=pe(i,e),c=z(o);return{doc:s,pageConfig:i,headerConfig:a,footerConfig:o,format:r,headerH:R(s,a,i),footerH:c}}function Qr(e,t){let n=e.doc.getNumberOfPages();for(let r=t+1;r<=n;r++)e.doc.setPage(r),R(e.doc,e.headerConfig,e.pageConfig)}function $(e){let t=e.doc.getNumberOfPages();for(let n=1;n<=t;n++)e.doc.setPage(n),Me(e.doc,e.footerConfig,e.pageConfig,n);e.doc.setPage(t)}function $r(e,t={}){let n=e?.drawsData||[],r=e?.tournamentInfo||{},i=e?.eventInfo||{},a=S(t.catalogPreset||`club-basic`),o=h(a?.drawFormatPreset||`itfJunior`),s={layout:`itf`,tournamentName:r.tournamentName||`Tournament`,...a?.header,subtitle:i.eventName||a?.header?.subtitle,startDate:r.startDate,endDate:r.endDate,location:r.venues?.[0]?.venueName,city:r.venues?.[0]?.city,country:r.hostCountryCode,surface:i.surfaceCategory,...t.headerOverrides},c={layout:`standard`,showPageNumbers:!0,showTimestamp:!0,...a?.footer,...t.footerOverrides},l=n?.[0]?.structures||[],u=l.some(e=>e.stage===`CONSOLATION`),d=l.some(e=>e.stage===`PLAY_OFF`),f=l.find(e=>e.stage===`MAIN`),p={header:s,footer:c,format:o};if(u&&d)return Xr({winnersBracket:f?de(f):ei(),losersBracket:fe(n,`CONSOLATION`)?de(fe(n,`CONSOLATION`)):ei(),deciderMatch:fe(n,`PLAY_OFF`)?de(fe(n,`PLAY_OFF`)):void 0},p);if(u)return Kr(l.map(e=>({name:e.structureName,stage:e.stage,drawData:de(e)})),p);let m=t.structureId&&l.find(e=>e.structureId===t.structureId)||f;if(!m)return pe({pageSize:`a4`,orientation:`portrait`,margins:{top:12,right:15,bottom:12,left:15}});let g=de(m);return t.mirrored?Jr(g,p):t.splitPages||g.drawSize>=256?Wr(g,{...p,maxPositionsPerPage:t.maxPositionsPerPage||32}):Ur(g,p)}function ei(){return{drawName:``,drawSize:0,drawType:``,totalRounds:0,slots:[],matchUps:[],seedAssignments:[]}}exports.COMPOSITION_CATALOG=x,exports.DRAW_MODAL_TABS=Ze,exports.FACT_SHEET_CATALOG=ce,exports.FONT=he,exports.FOOTER_LAYOUT_OPTIONS=qe,exports.HEADER_LAYOUT_OPTIONS=Ke,exports.ORIENTATION_OPTIONS=Ye,exports.PAGE_SIZE_OPTIONS=Je,exports.PRESETS=m,exports.SCHEDULE_MODAL_TABS=Qe,exports.SIZE=I,exports.SPLIT_STRATEGY_OPTIONS=Xe,exports.STYLE=F,exports.TABLE_STYLES=Cn,exports.buildFooterFromTournament=je,exports.buildHeaderFromTournament=Ae,exports.calculateBracketPositions=Tn,exports.createDoc=pe,exports.drawBracketConnectors=Dn,exports.drawBracketSlot=En,exports.drawPageFooter=J,exports.drawTournamentHeader=q,exports.entryStatusDisplay=et,exports.eventAbbreviation=it,exports.executePrint=We,exports.extractCompassData=Sn,exports.extractConsolationStructures=_n,exports.extractCourtCardData=ft,exports.extractDrawData=ot,exports.extractParticipantData=dt,exports.extractRoundRobinData=ht,exports.extractScheduleData=lt,exports.findStructure=fe,exports.formatDate=nt,exports.formatMatchScore=W,exports.formatPlayerEntry=gt,exports.formatScore=tt,exports.formatTime=rt,exports.generateBackdrawPDF=Yr,exports.generateCompassDrawPDF=qr,exports.generateConsolationDrawPDF=Kr,exports.generateCourtCardPDF=Ln,exports.generateDoubleEliminationPDF=Xr,exports.generateDrawPDF=Vr,exports.generateDrawSheetPDF=kn,exports.generateFactSheet=br,exports.generateFeedInDrawPDF=Gr,exports.generateFromEventData=$r,exports.generateLuckyDrawPDF=Zr,exports.generateMatchCardPDF=tr,exports.generateMirroredDrawPDF=Jr,exports.generatePlayerListPDF=In,exports.generateReportPDF=ir,exports.generateSchedulePDF=Nn,exports.generateScheduleV2PDF=Bn,exports.generateSequentialOOP=Jn,exports.generateSignInSheetPDF=zn,exports.generateSplitDrawPDF=Wr,exports.generateTraditionalDrawPDF=Ur,exports.getCatalogPreset=S,exports.getDefaultPageConfig=me,exports.getFactSheetTemplate=le,exports.getPageRegions=P,exports.getPreset=h,exports.getRoundLabel=H,exports.listCatalogPresets=C,exports.listFactSheetTemplates=ue,exports.measureFooterHeight=z,exports.measureSeedingsHeight=Ue,exports.mergeCatalogPreset=ee,exports.mergePreset=g,exports.nationality=V,exports.participantName=B,exports.renderCompassDraw=mn,exports.renderConsolationDraw=vn,exports.renderDoubleEliminationDraw=yn,exports.renderFooter=Me,exports.renderHeader=R,exports.renderLuckyDraw=an,exports.renderRoundRobinGroup=Qt,exports.renderSeedingsFooter=Ve,exports.renderTraditionalDraw=G,exports.roundName=at,exports.seedDisplay=$e,exports.setFont=L,exports.splitDraw=cn,exports.structureToDrawData=de;
|
|
6
6
|
//# sourceMappingURL=pdf-factory.cjs.map
|