1import{j as e,v as b,f as p}from"./index-DU9RET72.js";import{View as d,Text as a,StyleSheet as u,Document as j,Page as _,Image as B}from"./react-pdf.browser-tf9-z9OP.js";const r=u.create({paragraph:{fontSize:10,marginBottom:6,lineHeight:1.5,fontFamily:"Helvetica",textAlign:"justify"},h1:{fontSize:14,fontWeight:"bold",fontFamily:"Helvetica-Bold",marginTop:10,marginBottom:6,lineHeight:1.4},h2:{fontSize:12,fontWeight:"bold",fontFamily:"Helvetica-Bold",marginTop:8,marginBottom:4,lineHeight:1.4},h3:{fontSize:11,fontWeight:"bold",fontFamily:"Helvetica-Bold",marginTop:6,marginBottom:3,lineHeight:1.4},h4:{fontSize:10.5,fontWeight:"bold",fontFamily:"Helvetica-Bold",marginTop:4,marginBottom:2,lineHeight:1.4},listItem:{fontSize:10,marginBottom:4,marginLeft:15,lineHeight:1.5,flexDirection:"row",width:"100%"},bullet:{width:15,fontSize:10,marginRight:5},listContent:{flex:1,fontSize:10,lineHeight:1.5},bold:{fontFamily:"Helvetica-Bold"},italic:{fontFamily:"Helvetica-Oblique"},boldItalic:{fontFamily:"Helvetica-BoldOblique"},normal:{fontFamily:"Helvetica"}});function S(t){const i=[];let s=0,o;const c=/(\*\*\*[^*]+\*\*\*|___[^_]+___|\*\*[^*]+\*\*|__[^_]+__|\*[^*]+\*|_[^_]+_)/g;for(;(o=c.exec(t))!==null;){if(o.index>s){const h=t.slice(s,o.index);h&&i.push({text:h,bold:!1,italic:!1})}const n=o[0];n.startsWith("***")&&n.endsWith("***")||n.startsWith("___")&&n.endsWith("___")?i.push({text:n.slice(3,-3),bold:!0,italic:!0}):n.startsWith("**")&&n.endsWith("**")||n.startsWith("__")&&n.endsWith("__")?i.push({text:n.slice(2,-2),bold:!0,italic:!1}):(n.startsWith("*")&&n.endsWith("*")||n.startsWith("_")&&n.endsWith("_"))&&i.push({text:n.slice(1,-1),bold:!1,italic:!0}),s=c.lastIndex}return s<t.length&&i.push({text:t.slice(s),bold:!1,italic:!1}),i.length===0&&i.push({text:t,bold:!1,italic:!1}),i}function H({part:t}){let i=r.normal;return t.bold&&t.italic?i=r.boldItalic:t.bold?i=r.bold:t.italic&&(i=r.italic),e.jsx(a,{style:i,children:t.text})}function m({text:t,baseStyle:i}){const s=S(t);return e.jsx(a,{style:i,children:s.map((o,c)=>e.jsx(H,{part:o},c))})}function T({content:t}){const i=t.split(/\n\n|\n/g).filter(s=>s.trim());return e.jsx(d,{style:{width:"100%"},children:i.map((s,o)=>{const c=s.trim();if(!c)return null;const n=c.match(/^#\s+(.+)$/),h=c.match(/^##\s+(.+)$/),g=c.match(/^###\s+(.+)$/),x=c.match(/^####\s+(.+)$/),y=c.match(/^[\*\-â¢]\s+(.+)$/),f=c.match(/^(\d+\.)\s*(.+)$/);return n?e.jsx(m,{text:n[1],baseStyle:r.h1},o):h?e.jsx(m,{text:h[1],baseStyle:r.h2},o):g?e.jsx(m,{text:g[1],baseStyle:r.h3},o):x?e.jsx(m,{text:x[1],baseStyle:r.h4},o):y?e.jsxs(d,{style:r.listItem,children:[e.jsx(a,{style:r.bullet,children:"â¢"}),e.jsx(m,{text:y[1],baseStyle:r.listContent})]},o):f?e.jsxs(d,{style:r.listItem,children:[e.jsx(a,{style:r.bullet,children:f[1]}),e.jsx(m,{text:f[2],baseStyle:r.listContent})]},o):e.jsx(m,{text:c,baseStyle:r.paragraph},o)})})}const l=u.create({page:{padding:40,fontFamily:"Helvetica",fontSize:10},header:{flexDirection:"row",alignItems:"center",marginBottom:20,paddingBottom:15,borderBottomWidth:2,borderBottomColor:"#6366f1"},logo:{width:40,height:40,borderRadius:6},headerText:{marginLeft:12,flex:1},brandName:{fontSize:14,fontFamily:"Helvetica-Bold",color:"#6366f1"},brandTagline:{fontSize:9,color:"#64748b",marginTop:2},title:{fontSize:18,fontFamily:"Helvetica-Bold",textAlign:"center",marginBottom:20},metaInfo:{marginBottom:20},metaRow:{fontSize:11,marginBottom:4,fontFamily:"Helvetica"},sectionContainer:{marginTop:15,marginBottom:10},sectionTitle:{fontSize:14,fontFamily:"Helvetica-Bold",marginBottom:8,borderBottomWidth:1,borderBottomColor:"#333",paddingBottom:4,minPresenceAhead:50},sectionContent:{marginTop:5},footer:{position:"absolute",bottom:20,left:40,right:40,flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingTop:10,borderTopWidth:1,borderTopColor:"#e2e8f0"},footerBrand:{fontSize:8,color:"#6366f1",fontFamily:"Helvetica-Bold"},footerTagline:{fontSize:7,color:"#94a3b8"},pageNumber:{fontSize:8,color:"#64748b"}});function w({grant:t,sections:i}){return e.jsx(j,{children:e.jsxs(_,{size:"A4",style:l.page,children:[e.jsxs(d,{style:l.header,children:[e.jsx(B,{src:b,style:l.logo}),e.jsxs(d,{style:l.headerText,children:[e.jsx(a,{style:l.brandName,children:"Velocity"}),e.jsx(a,{style:l.brandTagline,children:"AI-Powered Grant Writing"})]})]}),e.jsx(a,{style:l.title,children:t.title}),e.jsxs(d,{style:l.metaInfo,children:[t.funder_name&&e.jsxs(a,{style:l.metaRow,children:["Funder: ",t.funder_name]}),t.deadline&&e.jsxs(a,{style:l.metaRow,children:["Deadline: ",p(new Date(t.deadline),"MMMM d, yyyy")]}),t.amount_requested&&e.jsxs(a,{style:l.metaRow,children:["Amount Requested: $",t.amount_requested.toLocaleStr
1ing()]})]}),i.map((s,o)=>e.jsxs(d,{style:l.sectionContainer,children:[e.jsx(a,{style:l.sectionTitle,children:s.section_name}),e.jsx(d,{style:l.sectionContent,children:e.jsx(T,{content:s.content})})]},o)),e.jsxs(d,{style:l.footer,fixed:!0,children:[e.jsxs(d,{children:[e.jsx(a,{style:l.footerBrand,children:"Velocity"}),e.jsx(a,{style:l.footerTagline,children:"AI-Powered Grant Writing"})]}),e.jsx(a,{style:l.pageNumber,render:({pageNumber:s,totalPages:o})=>`Page ${s} of ${o}`})]})]})})}export{w as ProposalPDFDocument};
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.