Spaces:
Sleeping
Sleeping
Yogesh commited on
Commit ·
d803eb4
1
Parent(s): edadcea
feat: compile and optimize 120-page pdf and TOC slicer
Browse filesFiles changed (2)
- assets/index-4x_ttUEu.js → assets/index-bJnV20--.jsRenamed+143-114
- index.html+1-1
588 unmodified lines5895905915925935945955965975984 unmodified lines60360460560660760860911 unmodified lines62162262362462562662715 unmodified lines6436446456466476486496 unmodified lines656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685118 unmodified lines8048058068078088098108118128138148158168178183 unmodified lines8228238248258268278288298308318328338348358368378388398408418428438448458468472 unmodified lines8508518528538548558568578588598608615 unmodified lines8678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210833 unmodified lines10871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127588 unmodified lines[DESCRIPTION]Write a high-converting HTML description. Use <h3> for headers and <ul>/<li> for bullet lists. Detail what makes the book unique, what's inside, and print specifications (e.g. 6x9 size, matte cover).Start writing now:`;try{let t=await fetch(`${C}/api/generate-text`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({prompt:e,maxTokens:900})});if(!t.ok)throw Error(`Failed to generate. Make sure your Hugging Face Space is running and HF_API_KEY is configured.`);let r=(await t.json()).text,i=r.match(/\[TITLE\]\n?([\s\S]*?)(?=\[SUBTITLE\])/i),a=r.match(/\[SUBTITLE\]\n?([\s\S]*?)(?=\[KEYWORDS\])/i),o=r.match(/\[KEYWORDS\]\n?([\s\S]*?)(?=\[DESCRIPTION\])/i),s=r.match(/\[DESCRIPTION\]\n?([\s\S]*)/i),c=i?i[1].trim():`${n} Guide`,u=a?a[1].trim():`The Ultimate Guide to Mastering Your Skills - High-Impact Keywords Included`,d=(o?o[1].trim():`kdp book, self education, guide, journal`).split(`,`).map(e=>e.trim()).filter(e=>e.length>0).slice(0,7),f=s?s[1].trim():`<h3>📚 Discover the ultimate guide to ${n}!</h3>`;l({title:c,subtitle:u,keywords:d.length>0?d:[`kdp guide`,`niche planner`,`workbook`],categories:[`Books > Reference > Custom Niche Guide`,`Books > Self-Help > Productivity`],descriptionHtml:f,price:`$9.99`})}catch(e){console.error(e),alert(`Error connecting to Hugging Face backend. Using pre-loaded mock templates instead.`)}finally{a(!1)}},g=c||p[e];return(0,b.jsxs)(`div`,{className:`animate-fade-in`,style:M.container,children:[(0,b.jsxs)(`div`,{style:M.header,children:[(0,b.jsx)(`h1`,{style:M.heading,children:`Amazon KDP Publishing Copilot`}),(0,b.jsx)(`p`,{style:M.subheading,children:`Publish in under 2 minutes. Copy-paste optimized SEO descriptions safely to prevent account bans.`})]}),(0,b.jsxs)(`div`,{style:M.mainGrid,children:[(0,b.jsxs)(`div`,{className:`glass-card`,style:M.leftCard,children:[(0,b.jsxs)(`h2`,{style:M.sectionTitle,children:[(0,b.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`var(--secondary)`,style:{width:`22px`,height:`22px`},children:(0,b.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`})}),`KDP Upload Copilot`]}),(0,b.jsx)(`p`,{style:M.cardDescription,children:`Open Amazon KDP and follow these 4 simple steps to list your book.`}),(0,b.jsxs)(`div`,{style:M.stepsTimeline,children:[(0,b.jsxs)(`div`,{style:M.stepItem,children:[(0,b.jsx)(`div`,{style:M.stepNum,children:`1`}),(0,b.jsxs)(`div`,{style:M.stepContent,children:[(0,b.jsx)(`strong`,{style:M.stepTitle,children:`Enter Title & Subtitle`}),(0,b.jsx)(`p`,{style:M.stepText,children:`Copy the AI-optimized Title and Subtitle from the right panel and paste them into KDP Paperback Details.`})]})]}),(0,b.jsxs)(`div`,{style:M.stepItem,children:[(0,b.jsx)(`div`,{style:M.stepNum,children:`2`}),(0,b.jsxs)(`div`,{style:M.stepContent,children:[(0,b.jsx)(`strong`,{style:M.stepTitle,children:`Paste HTML Description`}),(0,b.jsx)(`p`,{style:M.stepText,children:`KDP description supports HTML. Copy the description text from the right panel to show rich bullet points on Amazon.`})]})]}),(0,b.jsxs)(`div`,{style:M.stepItem,children:[(0,b.jsx)(`div`,{style:M.stepNum,children:`3`}),(0,b.jsxs)(`div`,{style:M.stepContent,children:[(0,b.jsx)(`strong`,{style:M.stepTitle,children:`Fill the 7 Keyword Boxes`}),(0,b.jsx)(`p`,{style:M.stepText,children:`Paste the 7 custom KDP keywords. This is the secret step that allows buyers to find your book organically!`})]})]}),(0,b.jsxs)(`div`,{style:M.stepItem,children:[(0,b.jsx)(`div`,{style:M.stepNum,children:`4`}),(0,b.jsxs)(`div`,{style:M.stepContent,children:[(0,b.jsx)(`strong`,{style:M.stepTitle,children:`Upload PDF Files & Pricing`}),(0,b.jsx)(`p`,{style:M.stepText,children:`Upload your downloaded Interior PDF and Cover PDF. Select "Worldwide Rights" and input the recommended price.`})]})]})]}),(0,b.jsxs)(`a`,{href:`https://kdp.amazon.com`,target:`_blank`,rel:`noopener noreferrer`,className:`btn btn-secondary`,style:{width:`100%`,marginTop:`20px`},children:[`Open Amazon KDP Shelf`,(0,b.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,style:{width:`16px`,height:`16px`},children:(0,b.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25`})})]})]}),(0,b.jsxs)(`div`,{className:`glass-card`,style:M.rightCard,children:[(0,b.jsxs)(`div`,{style:M.titleRow,children:[(0,b.jsxs)(`h2`,{style:M.sectionTitle,children:[(0,b.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`var(--primary)`,style:{width:`22px`,height:`22px`},children:(0,b.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10`})}),`AI SEO Listing Copywriter`]}),c?(0,b.jsxs)(`div`,{style:{display:`flex`,gap:`10px`},children:[(0,b.jsx)(`button`,{onClick:f,disabled:u,className:`btn btn-outline`,style:{padding:`6px 12px`,fontSize:`11px`,color:`var(--success)`,borderColor:`rgba(16,185,129,0.3)`,cursor:`pointer`},children:u?`Saving to DB...`:`Save to KDP Database`}),(0,b.jsx)(`button`,{onClick:()=>l(null),className:`btn btn-outline`,style:{padding:`6px 12px`,fontSize:`11px`,color:`var(--danger)`,borderColor:`rgba(239,68,68,0.2)`,cursor:`pointer`},children:`Reset to Presets`})]}):(0,b.jsxs)(`div`,{style:{display:`flex`,gap:`10px`,alignItems:`center`},children:[(0,b.jsx)(`button`,{onClick:f,disabled:u,className:`btn btn-outline`,style:{padding:`6px 12px`,fontSize:`11px`,color:`var(--success)`,borderColor:`rgba(16,185,129,0.3)`,cursor:`pointer`},children:u?`Saving...`:`Save Preset to DB`}),(0,b.jsxs)(`select`,{value:e,onChange:e=>t(e.target.value),className:`form-select`,style:{width:`180px`,padding:`6px 12px`,fontSize:`12px`},children:[(0,b.jsx)(`option`,{value:`adhd_planner`,children:`ADHD Daily Planner`}),(0,b.jsx)(`option`,{value:`aws_guide`,children:`AWS SAA-C03 Guide`}),(0,b.jsx)(`option`,{value:`puzzle_book`,children:`Large Print Sudoku`})]})]})]}),(0,b.jsx)(`p`,{style:M.cardDescription,children:`Copy-paste these fields directly into Amazon KDP's upload page.`}),(0,b.jsxs)(`div`,{style:M.customGenBox,children:[(0,b.jsx)(`input`,{type:`text`,placeholder:`Enter custom book topic (e.g. 'Dog Training Log Book', 'C++ Interview Q&A')`,value:n,onChange:e=>r(e.target.value),className:`form-input`,style:{flexGrow:1},disabled:i}),(0,b.jsx)(`button`,{onClick:h,disabled:i,className:`btn btn-primary`,style:{flexShrink:0,padding:`12px 20px`},children:i?`Writing...`:`Generate with Llama 3`})]}),(0,b.jsxs)(`div`,{style:M.copilotGrid,children:[(0,b.jsxs)(`div`,{style:M.copyGroup,children:[(0,b.jsxs)(`div`,{style:M.copyLabelRow,children:[(0,b.jsx)(`span`,{style:M.fieldLabel,children:`Book Title (Amazon Page 1 Ranked)`}),(0,b.jsx)(`button`,{onClick:()=>m(g.title,`title`),style:M.copyBtn,children:o===`title`?`COPIED!`:`COPY`})]}),(0,b.jsx)(`div`,{style:M.metaTextBox,children:g.title})]}),(0,b.jsxs)(`div`,{style:M.copyGroup,children:[(0,b.jsxs)(`div`,{style:M.copyLabelRow,children:[(0,b.jsx)(`span`,{style:M.fieldLabel,children:`Book Subtitle (Benefits Focused)`}),(0,b.jsx)(`button`,{onClick:()=>m(g.subtitle,`subtitle`),style:M.copyBtn,children:o===`subtitle`?`COPIED!`:`COPY`})]}),(0,b.jsx)(`div`,{style:M.metaTextBox,children:g.subtitle})]}),(0,b.jsxs)(`div`,{style:M.copyGroup,children:[(0,b.jsxs)(`div`,{style:M.copyLabelRow,children:[(0,b.jsx)(`span`,{style:M.fieldLabel,children:`7 Amazon KDP Search Keywords`}),(0,b.jsx)(`span`,{style:{fontSize:`11px`,color:`var(--text-muted)`},children:`Click individual to copy`})]}),(0,b.jsx)(`div`,{style:M.keywordChipsContainer,children:g.keywords.map((e,t)=>(0,b.jsx)(`button`,{onClick:()=>m(e,`kw-${t}`),style:{...M.kwChip,borderColor:o===`kw-${t}`?`var(--success)`:`var(--border-glow)`,color:o===`kw-${t}`?`var(--success)`:`var(--text-primary)`},children:e},t))})]}),(0,b.jsxs)(`div`,{style:M.copyGroup,children:[(0,b.jsxs)(`div`,{style:M.copyLabelRow,children:[(0,b.jsx)(`span`,{style:M.fieldLabel,children:`HTML Description (Paste to Amazon WYSIWYG)`}),(0,b.jsx)(`button`,{onClick:()=>m(g.descriptionHtml,`description`),style:M.copyBtn,children:o===`description`?`COPIED!`:`COPY`})]}),(0,b.jsx)(`pre`,{style:M.htmlBox,children:g.descriptionHtml})]}),(0,b.jsxs)(`div`,{style:M.metaGridDouble,children:[(0,b.jsxs)(`div`,{style:M.copyGroup,children:[(0,b.jsx)(`span`,{style:M.fieldLabel,children:`Recommended Pricing`}),(0,b.jsxs)(`div`,{style:M.metaTextBox,children:[g.price,` (60% Paperback Royalty)`]})]}),(0,b.jsxs)(`div`,{style:M.copyGroup,children:[(0,b.jsx)(`span`,{style:M.fieldLabel,children:`Target KDP Categories`}),(0,b.jsx)(`div`,{style:{...M.metaTextBox,fontSize:`11px`,lineHeight:`1.4`},children:g.categories.map((e,t)=>(0,b.jsx)(`div`,{children:e},t))})]})]})]})]})]})]})}var M={container:{padding:`30px 40px`},header:{marginBottom:`32px`},heading:{fontSize:`28px`,color:`#fff`},subheading:{color:`var(--text-secondary)`,fontSize:`14px`,marginTop:`4px`},mainGrid:{display:`grid`,gridTemplateColumns:`1fr 1.6fr`,gap:`30px`},leftCard:{height:`fit-content`},rightCard:{display:`flex`,flexDirection:`column`},sectionTitle:{fontSize:`18px`,color:`#fff`,display:`flex`,alignItems:`center`,gap:`8px`},cardDescription:{fontSize:`13px`,color:`var(--text-secondary)`,margin:`6px 0 20px 0`},titleRow:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:`6px`},stepsTimeline:{display:`flex`,flexDirection:`column`,gap:`20px`},stepItem:{display:`flex`,gap:`16px`},stepNum:{width:`28px`,height:`28px`,borderRadius:`50%`,background:`rgba(139,92,246,0.1)`,border:`1.5px solid var(--primary)`,color:`var(--primary-hover)`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:`12px`,fontWeight:`800`,flexShrink:0,boxShadow:`0 0 10px rgba(139,92,246,0.2)`},stepContent:{flexGrow:1},stepTitle:{fontSize:`14px`,color:`#fff`,fontWeight:`700`},stepText:{fontSize:`12px`,color:`var(--text-secondary)`,marginTop:`4px`,lineHeight:`1.4`},customGenBox:{display:`flex`,gap:`12px`,background:`rgba(15, 23, 42, 0.3)`,border:`1px solid var(--border-glow)`,borderRadius:`10px`,padding:`12px`,marginBottom:`24px`,alignItems:`center`},copilotGrid:{display:`flex`,flexDirection:`column`,gap:`20px`},copyGroup:{display:`flex`,flexDirection:`column`,gap:`8px`},copyLabelRow:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},fieldLabel:{fontSize:`11px`,fontWeight:`700`,color:`var(--text-secondary)`,letterSpacing:`0.05em`,textTransform:`uppercase`},copyBtn:{background:`rgba(30,41,59,0.6)`,border:`1px solid var(--border-glow)`,borderRadius:`4px`,color:`var(--text-primary)`,fontSize:`10px`,fontWeight:`800`,padding:`4px 10px`,cursor:`pointer`,letterSpacing:`0.05em`,transition:`all 0.2s ease`},metaTextBox:{background:`rgba(6,9,19,0.5)`,border:`1px solid var(--border-glow)`,borderRadius:`8px`,padding:`12px 16px`,fontSize:`13px`,color:`#fff`,fontWeight:`500`},keywordChipsContainer:{display:`flex`,flexWrap:`wrap`,gap:`8px`},kwChip:{background:`rgba(6,9,19,0.5)`,border:`1px solid var(--border-glow)`,borderRadius:`30px`,padding:`6px 14px`,fontSize:`11px`,fontWeight:`600`,cursor:`pointer`,transition:`all 0.2s ease`},htmlBox:{background:`rgba(6,9,19,0.7)`,border:`1px solid var(--border-glow)`,borderRadius:`8px`,padding:`16px`,fontSize:`11px`,color:`#a78bfa`,fontFamily:`monospace`,whiteSpace:`pre-wrap`,maxHeight:`180px`,overflowY:`auto`},metaGridDouble:{display:`grid`,gridTemplateColumns:`1fr 1.5fr`,gap:`16px`}};function se(){let[e,t]=(0,_.useState)(!1),[n,r]=(0,_.useState)(864e5),[i,a]=(0,_.useState)([]),[o,s]=(0,_.useState)(!0),c=(0,_.useRef)(null),l=async()=>{try{let e=await fetch(`${C}/api/autopilot/status`);if(e.ok){let n=await e.json();t(n.active),a(n.thoughts||[])}}catch(e){console.error(`Error fetching autopilot status:`,e)}finally{s(!1)}};return(0,_.useEffect)(()=>{l();let e=setInterval(l,3e3);return()=>clearInterval(e)},[e]),(0,_.useEffect)(()=>{c.current&&c.current.scrollIntoView({behavior:`smooth`})},[i]),(0,b.jsxs)(`div`,{className:`animate-fade-in`,style:N.container,children:[(0,b.jsxs)(`div`,{style:N.header,children:[(0,b.jsx)(`h1`,{style:N.heading,children:`KDP Autonomous Agent & E-Book Packager`}),(0,b.jsx)(`p`,{style:N.subheading,children:`Configure a daily background worker that researches, writes, and packages premium humanized e-books with covers into downloadable ZIPs.`})]}),(0,b.jsxs)(`div`,{style:N.mainGrid,children:[(0,b.jsxs)(`div`,{className:`glass-card`,style:N.controlCard,children:[(0,b.jsxs)(`h2`,{style:N.sectionTitle,children:[(0,b.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`var(--secondary)`,style:{width:`22px`,height:`22px`},children:[(0,b.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 18a3.75 3.75 0 0 0 .495-7.467 5.99 5.99 0 0 0-1.925 3.546 5.974 5.974 0 0 1-2.133-1A3.75 3.75 0 0 0 12 18Z`}),(0,b.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 1 1 7.072 0l-.548.547A3.374 3.374 0 0 0 14 18.469V19a2 2 0 1 1-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547Z`})]}),`Autopilot Parameters`]}),(0,b.jsxs)(`div`,{style:N.toggleRow,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`strong`,{style:{color:`#fff`,fontSize:`15px`,display:`block`},children:`Agent Ignition`}),(0,b.jsx)(`span`,{style:{fontSize:`12px`,color:`var(--text-secondary)`},children:`Toggle to start autonomous loop`})]}),(0,b.jsx)(`button`,{onClick:async()=>{let r=!e;s(!0);try{let e=await fetch(`${C}/api/autopilot/toggle`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({active:r,intervalMs:n})});e.ok&&(t((await e.json()).active),l())}catch(e){console.error(`Error toggling autopilot:`,e),alert(`Error connecting to the backend Space.`)}finally{s(!1)}},disabled:o,style:{...N.toggleBtn,background:e?`var(--success)`:`rgba(255,255,255,0.05)`,color:e?`#000`:`var(--text-secondary)`,boxShadow:e?`0 0 15px rgba(16,185,129,0.4)`:`none`},children:o?`PENDING...`:e?`AUTOPILOT: ON`:`AUTOPILOT: OFF`})]}),(0,b.jsxs)(`div`,{className:`form-group`,style:{marginTop:`24px`},children:[(0,b.jsx)(`label`,{className:`form-label`,children:`Simulated Loop Frequency`}),(0,b.jsxs)(`select`,{value:n,onChange:e=>r(parseInt(e.target.value)),className:`form-select`,disabled:e,children:[(0,b.jsx)(`option`,{value:`60000`,children:`Every 1 Minute (Optimal Testing)`}),(0,b.jsx)(`option`,{value:`3600000`,children:`Every 1 Hour (Standard Scaling)`}),(0,b.jsx)(`option`,{value:`86400000`,children:`Every 24 Hours (Daily Automation)`})]})]}),(0,b.jsxs)(`div`,{style:N.strategyBox,children:[(0,b.jsxs)(`div`,{style:N.strategyHeader,children:[(0,b.jsx)(`span`,{style:N.pulsePoint}),(0,b.jsx)(`strong`,{children:`Autopilot Strategy Blueprint`})]}),(0,b.jsxs)(`ul`,{style:N.strategyList,children:[(0,b.jsxs)(`li`,{children:[`🔍 `,(0,b.jsx)(`strong`,{children:`Scans Hot KDP Trends`}),`: Focuses on high-yield, high-interest niches.`]}),(0,b.jsxs)(`li`,{children:[`✍️ `,(0,b.jsx)(`strong`,{children:`Groq Llama 3 70B Generation`}),`: Generates beautifully styled and humanized book content.`]}),(0,b.jsxs)(`li`,{children:[`🖼️ `,(0,b.jsx)(`strong`,{children:`SDXL High-Res Cover Art`}),`: Automatically designs matched aesthetic book covers.`]}),(0,b.jsxs)(`li`,{children:[`📦 `,(0,b.jsx)(`strong`,{children:`Automated ZIP Packaging`}),": Packages `book.md`, `cover.jpg`, and complete publishing metadata (`listing.txt`) into a single ZIP for manual publishing."]})]})]})]}),(0,b.jsxs)(`div`,{className:`glass-card`,style:N.terminalCard,children:[(0,b.jsxs)(`div`,{className:`card-header`,children:[(0,b.jsx)(`h2`,{style:N.cardTitle,children:`Agent Thought Stream Terminal`}),e&&(0,b.jsx)(`span`,{style:N.runningBadge,children:`ACTIVE RUNNING`})]}),(0,b.jsx)(`p`,{style:N.cardDescription,children:`Live telemetry stream capturing Llama 3 background creation sequences.`}),(0,b.jsxs)(`div`,{style:N.terminalContainer,children:[i.slice().reverse().map((e,t)=>{let n=e.match(/(https?:\/\/\S+)/i),r=e.includes(`❌`)?`var(--danger)`:e.includes(`✅`)?`var(--success)`:e.includes(`🚀`)?`var(--secondary)`:`#a78bfa`;if(n){let i=n[1],a=e.split(i);return(0,b.jsxs)(`div`,{style:{...N.terminalLine,color:r},children:[a[0],(0,b.jsx)(`a`,{href:i,target:`_blank`,rel:`noreferrer`,style:{color:`#ff90e8`,fontWeight:`800`,textDecoration:`underline`},children:i}),a[1]]},t)}return(0,b.jsx)(`div`,{style:{...N.terminalLine,color:r},children:e},t)}),(0,b.jsx)(`div`,{ref:c})]})]})]})]})}var N={container:{padding:`30px 40px`},header:{marginBottom:`32px`},heading:{fontSize:`28px`,color:`#fff`},subheading:{color:`var(--text-secondary)`,fontSize:`14px`,marginTop:`4px`},mainGrid:{display:`grid`,gridTemplateColumns:`1fr 1.6fr`,gap:`30px`},controlCard:{height:`fit-content`},sectionTitle:{fontSize:`18px`,color:`#fff`,display:`flex`,alignItems:`center`,gap:`8px`,marginBottom:`20px`},toggleRow:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,background:`rgba(15,23,42,0.4)`,border:`1px solid var(--border-glow)`,borderRadius:`12px`,padding:`18px`},toggleBtn:{border:`none`,borderRadius:`8px`,padding:`12px 20px`,fontWeight:`800`,fontSize:`12px`,cursor:`pointer`,letterSpacing:`0.05em`,transition:`all 0.3s cubic-bezier(0.4, 0, 0.2, 1)`},strategyBox:{background:`rgba(6,9,19,0.5)`,border:`1px solid var(--border-glow)`,borderRadius:`10px`,padding:`16px`,marginTop:`24px`},strategyHeader:{display:`flex`,alignItems:`center`,gap:`8px`,fontSize:`13px`,color:`var(--secondary)`,marginBottom:`12px`},pulsePoint:{width:`6px`,height:`6px`,borderRadius:`50%`,background:`var(--secondary)`,boxShadow:`0 0 6px var(--secondary)`},strategyList:{paddingLeft:`18px`,fontSize:`12px`,color:`var(--text-secondary)`,display:`flex`,flexDirection:`column`,gap:`8px`},terminalCard:{display:`flex`,flexDirection:`column`,maxHeight:`600px`},cardTitle:{fontSize:`18px`,color:`#fff`},cardDescription:{fontSize:`13px`,color:`var(--text-secondary)`,marginBottom:`20px`},runningBadge:{fontSize:`10px`,fontWeight:`800`,background:`rgba(16, 185, 129, 0.1)`,color:`var(--success)`,padding:`3px 8px`,borderRadius:`4px`,boxShadow:`0 0 8px rgba(16,185,129,0.2)`},terminalContainer:{flexGrow:1,background:`#040711`,border:`1px solid var(--border-glow)`,borderRadius:`12px`,padding:`20px`,minHeight:`400px`,overflowY:`auto`,display:`flex`,flexDirection:`column`,gap:`10px`,boxShadow:`inset 0 4px 20px rgba(0,0,0,0.8)`,fontFamily:`monospace`,fontSize:`11px`,lineHeight:`1.5`},terminalLine:{whiteSpace:`pre-wrap`,textShadow:`0 0 2px rgba(167, 139, 250, 0.3)`}},ce=[{id:`gumroad`,name:`Gumroad`,emoji:`🟠`,color:`#ff90e8`,hint:`E-books, templates, courses, digital downloads`},{id:`etsy`,name:`Etsy`,emoji:`🟡`,color:`#f1c40f`,hint:`Printable planners, templates, digital art`},{id:`kdp`,name:`Amazon KDP`,emoji:`🔵`,color:`#4a90e2`,hint:`Kindle e-books and paperbacks`},{id:`kofi`,name:`Ko-fi`,emoji:`☕`,color:`#13c3ff`,hint:`Digital products, memberships, donations`},{id:`payhip`,name:`Payhip`,emoji:`💜`,color:`#9b59b6`,hint:`Simple digital downloads store`},{id:`creative`,name:`Creative Market`,emoji:`🎨`,color:`#e74c3c`,hint:`Fonts, graphics, website templates`},{id:`teachable`,name:`Teachable`,emoji:`🎓`,color:`#2ecc71`,hint:`Online courses and memberships`},{id:`envato`,name:`Envato Market`,emoji:`🟢`,color:`#27ae60`,hint:`Themes, code, graphics, audio`}];function P(){let[e,t]=(0,_.useState)(`gumroad`),[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(null),[m,h]=(0,_.useState)(``),[g,v]=(0,_.useState)(null),[y,x]=(0,_.useState)(!1),[S,w]=(0,_.useState)(``),[T,ee]=(0,_.useState)(()=>localStorage.getItem(`gumroad_token`)||``),[E,D]=(0,_.useState)(!1),[te,ne]=(0,_.useState)(``),[re,ie]=(0,_.useState)(``),[O,ae]=(0,_.useState)(!1),[k,A]=(0,_.useState)(``),[j,oe]=(0,_.useState)(``),[M,se]=(0,_.useState)(null),[N,P]=(0,_.useState)(``),le=ce.find(t=>t.id===e),ue=e=>{let t=e.target.value;ee(t),localStorage.setItem(`gumroad_token`,t)},de=async()=>{if(!n.trim()){alert(`Please enter a niche or topic!`);return}a(!0),s(`listing`),d(null),p(null),h(``),w(``),ie(``),ne(``);try{let t=await fetch(`${C}/api/generate-product`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({platform:e,niche:n.trim()})});if(!t.ok)throw Error(`Failed to generate product`);let r=await t.json();if(d(r),r.thumbnailPrompt){s(`cover`);try{let e=await fetch(`${C}/api/generate-cover`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({prompt:r.thumbnailPrompt,title:r.title})});if(e.ok){let t=await e.json();p(t.imageUrl),h(t.coverUrl)}}catch(e){console.warn(`Auto thumbnail generation failed:`,e.message)}}}catch(e){alert(`Error generating product: `+e.message)}finally{a(!1),s(``)}},fe=async()=>{if(!j.trim()){alert(`Please enter a general topic/niche!`);return}ae(!0),A(`optimizing`),se(null),P(``);try{let e=await fetch(`${C}/api/generate-product`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({platform:`kdp`,niche:j.trim()})});if(!e.ok)throw Error(`Failed to generate best-seller content`);let t=await e.json();se(t),A(`zipping`);let n=await fetch(`${C}/api/generate-package`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:t.title,subtitle:t.subtitle,description:t.description,tags:t.tags,cta:t.cta,price:t.price,platform:`kdp`,productContent:t.productContent,thumbnailPrompt:t.thumbnailPrompt})});if(!n.ok)throw Error(`Failed to package ZIP archive`);let r=await n.json();P(r.packageUrl),window.location.href=r.packageUrl;try{await fetch(`${C}/api/catalog`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:t.title,subtitle:t.subtitle,type:`study_guide`,price:t.price,platform:`kdp`,tags:t.tags,thumbnail_url:t.thumbnailUrl||``,sales_copy:t.description,status:`ready_to_publish`,published_url:r.packageUrl})})}catch(e){console.warn(`Silent save to catalog failed:`,e.message)}}catch(e){alert(`Error packaging best-seller book: `+e.message)}finally{ae(!1),A(``)}},pe=()=>{if(!M?.productContent)return;let e=new Blob([M.productContent],{type:`text/markdown`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${M.title.replace(/[^a-zA-Z0-9]/g,`_`).toLowerCase()}_manuscript.md`,n.click(),URL.revokeObjectURL(t)},me=()=>{if(!M?.productContent)return;let e=window.open(``,`_blank`),t=M.productContent,n=[],r=t.split(``),i=-1,a=[];for(r.forEach(e=>{let t=!1;for(let r=0;r<5;r++)if(e.includes(`Chapter ${r+1}`)){a.length>0&&n.push(a.join(``)),i=r,a=[e],t=!0;break}!t&&i!==-1&&a.push(e)}),a.length>0&&n.push(a.join(``));n.length<5;)n.push(`Chapter ${n.length+1} - Details\n\nContent details for chapter ${n.length+1}...`);let o=``;o+=`<div class="page left-page cover-page"><div class="header-brand">BOOKFORGE DIGITAL HUBS</div><div class="cover-interior">4 unmodified lines</div><div class="cover-footer">BOOKFORGE PREMIUM EDITION</div></div>`,o+=`<div class="page right-page copyright-page"><div class="header-brand">BOOKFORGE BINDERY & REGISTRATION</div><div class="interior-content">11 unmodified lines</div><div class="page-number">Page 2</div></div>`,o+=`<div class="page left-page toc-page"><div class="header-brand">CONTENTS INDEX</div><div class="interior-content">15 unmodified lines</div><div class="page-number">Page 3</div></div>`,o+=`<div class="page right-page preface-page"><div class="header-brand">AUTHOR PREFACE</div><div class="interior-content">6 unmodified lines</div><div class="page-number">Page 4</div></div>`;let s=5;for(let e=0;e<5;e++){let t=s%2==0?`right-page`:`left-page`,r=n[e],i=r.split(``)[0].replace(/#+/g,``).trim().toUpperCase(),a=r.split(``).slice(1).join(``).replace(/\n/g,`<br>`).replace(/✓ (.*?)(?=<br>)/g,`<li>✓ $1</li>`);o+=`<div class="page ${t} chapter-cover"><div class="header-brand">CHAPTER DIVISION ${e+1}</div><div class="chapter-cover-interior"><span class="chapter-number">CHAPTER 0${e+1}</span><div class="cover-divider"></div><h2>${i}</h2><p style="font-size: 11px; text-transform:uppercase; color:#666; letter-spacing:1px; margin-top:20px;">Detailed Written Guide & Workbook Interior</p></div><div class="page-number">Page ${s}</div></div>`,s++;let c=s%2==0?`right-page`:`left-page`;o+=`<div class="page ${c} chapter-content"><div class="header-brand">${i}</div><div class="chapter-text-interior"><h3>DEVELOPMENTAL MANUAL OUTLINE</h3><p>${a}</p></div><div class="page-number">Page ${s}</div></div>`,s++;let l=e===4?18:22;for(let t=0;t<l;t++){let n=s%2==0?`right-page`:`left-page`,r=``;r=e===0?t%2==0?`<h2>DAILY FOCUS TRACKER</h2><div class="divider"></div><div class="box">118 unmodified lines<div class="dot-grid">${`<div class="dot">.</div>`.repeat(80)}</div>`,o+=`<div class="page ${n}"><div class="header-brand">BOOKFORGE DIGITAL GOAL PLANNERS</div><div class="page-interior">${r}</div><div class="page-number">Page ${s}</div></div>`,s++}}e.document.write(`<html><head><title>${M.title} - 120 Pages</title>3 unmodified lines.page { page-break-after: always; display: flex !important; }@page { size: 6in 9in; margin: 0; }}* { box-sizing: border-box; }body {font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;color: #111;margin: 0;padding: 0;background: #f0f0f0;}.page {background: #fff;width: 6in;height: 9in;margin: 20px auto;position: relative;display: flex;flex-direction: column;justify-content: space-between;border: 1px solid #ddd;box-shadow: 0 0 10px rgba(0,0,0,0.05);}.left-page {padding: 0.8in 0.75in 0.8in 0.4in;}2 unmodified lines}.header-brand {font-size: 8px;color: #999;letter-spacing: 2px;text-align: center;border-bottom: 1px solid #f0f0f0;padding-bottom: 6px;text-transform: uppercase;}.page-interior {flex-grow: 1;5 unmodified lines.interior-content {padding: 40px 10px 0 10px;}.cover-page {justify-content: space-between;padding: 1.2in 0.6in;text-align: center;}.cover-interior {display: flex;flex-direction: column;align-items: center;}.cover-title {font-family: 'Georgia', serif;font-size: 24px;font-weight: 900;text-transform: uppercase;letter-spacing: 1px;line-height: 1.3;margin: 0 0 15px 0;}.cover-divider {width: 60px;height: 3px;background: #111;margin: 10px 0;}.cover-subtitle {font-family: 'Georgia', serif;font-size: 13px;color: #555;font-style: italic;line-height: 1.5;margin: 15px 0;}.cover-tag {font-size: 9px;font-weight: bold;border: 1px solid #111;border-radius: 4px;padding: 4px 10px;margin-top: 30px;letter-spacing: 1px;}.cover-footer {font-size: 9px;font-weight: bold;letter-spacing: 3px;color: #777;}.copyright-page h3 {font-size: 11px;font-weight: bold;margin-bottom: 8px;}.copyright-page p {font-size: 9px;line-height: 1.5;color: #444;text-align: justify;margin: 0 0 15px 0;}.toc-list {display: flex;flex-direction: column;gap: 12px;margin-top: 20px;}.toc-item {display: flex;justify-content: space-between;font-size: 9px;font-weight: bold;color: #333;}.dots {flex-grow: 1;text-align: center;color: #ccc;overflow: hidden;white-space: nowrap;margin: 0 10px;}.chapter-cover {justify-content: space-between;padding: 1.2in 0.6in;text-align: center;}.chapter-cover-interior {display: flex;flex-direction: column;align-items: center;}.chapter-number {font-size: 11px;font-weight: bold;letter-spacing: 3px;color: #777;}.chapter-cover h2 {font-family: 'Georgia', serif;font-size: 20px;font-weight: 800;margin-top: 15px;}.chapter-content {font-family: 'Georgia', serif;line-height: 1.6;}.chapter-text-interior {padding: 30px 10px;text-align: justify;}.chapter-text-interior h3 {font-size: 12px;font-weight: bold;border-bottom: 2px solid #111;padding-bottom: 6px;margin-bottom: 15px;letter-spacing: 1px;}.chapter-text-interior p {font-size: 11px;line-height: 1.7;color: #222;margin-bottom: 12px;}.chapter-text-interior li {font-size: 11px;margin-left: 10px;list-style-type: none;margin-bottom: 6px;color: #333;}h2 {font-size: 14px;font-weight: 800;text-align: center;margin: 0 0 5px 0;letter-spacing: 1px;}.divider {height: 2px;background: #111;width: 30px;margin: 0 auto 10px auto;}.box {border: 1px solid #222;border-radius: 6px;padding: 10px 14px;display: flex;flex-direction: column;gap: 10px;background: #fff;}.label {font-size: 8px;font-weight: 800;letter-spacing: 1px;color: #444;border-bottom: 1px solid #eee;padding-bottom: 4px;text-transform: uppercase;}.line {border-bottom: 1px dashed #777;height: 20px;width: 100%;}.checkbox-row {display: flex;align-items: center;gap: 10px;}.checkbox {width: 14px;height: 14px;border: 1px solid #111;border-radius: 3px;flex-shrink: 0;}.doodle-placeholder {border: 1px dashed #999;border-radius: 4px;flex-grow: 1;min-height: 60px;background: #fafafa;}.habit-row {display: flex;align-items: center;justify-content: space-between;gap: 10px;}.circles {font-size: 12px;letter-spacing: 3px;color: #444;}.dot-grid {display: grid;grid-template-columns: repeat(8, 1fr);grid-gap: 20px;padding: 20px 30px;opacity: 0.15;flex-grow: 1;}.dot {font-size: 24px;text-align: center;line-height: 0;}.matrix-grid {display: grid;grid-template-columns: 1fr 1fr;3 unmodified linespadding: 10px 0;}.matrix-box {border: 1px solid #222;border-radius: 6px;padding: 10px;display: flex;flex-direction: column;justify-content: space-between;}.budget-table {width: 100%;border-collapse: collapse;margin-top: 10px;}.budget-table th {font-size: 8px;font-weight: 800;text-align: left;padding: 6px;border-bottom: 2px solid #111;}.budget-table td {padding: 8px 6px;border-bottom: 1px solid #eee;font-size: 10px;}.page-number {text-align: center;font-size: 9px;color: #777;border-top: 1px solid #f0f0f0;padding-top: 6px;}</style></head><body>${o}<script>window.onload = function() { window.print(); }<\/script>588 unmodified lines5895905915925935945954 unmodified lines60060160260360460560611 unmodified lines61861962062162262362415 unmodified lines6406416426436446456466 unmodified lines653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682118 unmodified lines8018028038048058068078088098108118128138148153 unmodified lines8198208218228238248258268278288298308318328338348358368378388398408418428438448458468478482 unmodified lines8518528538548558568578588598608618628635 unmodified lines86987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711083 unmodified lines111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156588 unmodified lines[DESCRIPTION]Write a high-converting HTML description. Use <h3> for headers and <ul>/<li> for bullet lists. Detail what makes the book unique, what's inside, and print specifications (e.g. 6x9 size, matte cover).Start writing now:`;try{let t=await fetch(`${C}/api/generate-text`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({prompt:e,maxTokens:900})});if(!t.ok)throw Error(`Failed to generate. Make sure your Hugging Face Space is running and HF_API_KEY is configured.`);let r=(await t.json()).text,i=r.match(/\[TITLE\]\n?([\s\S]*?)(?=\[SUBTITLE\])/i),a=r.match(/\[SUBTITLE\]\n?([\s\S]*?)(?=\[KEYWORDS\])/i),o=r.match(/\[KEYWORDS\]\n?([\s\S]*?)(?=\[DESCRIPTION\])/i),s=r.match(/\[DESCRIPTION\]\n?([\s\S]*)/i),c=i?i[1].trim():`${n} Guide`,u=a?a[1].trim():`The Ultimate Guide to Mastering Your Skills - High-Impact Keywords Included`,d=(o?o[1].trim():`kdp book, self education, guide, journal`).split(`,`).map(e=>e.trim()).filter(e=>e.length>0).slice(0,7),f=s?s[1].trim():`<h3>📚 Discover the ultimate guide to ${n}!</h3>`;l({title:c,subtitle:u,keywords:d.length>0?d:[`kdp guide`,`niche planner`,`workbook`],categories:[`Books > Reference > Custom Niche Guide`,`Books > Self-Help > Productivity`],descriptionHtml:f,price:`$9.99`})}catch(e){console.error(e),alert(`Error connecting to Hugging Face backend. Using pre-loaded mock templates instead.`)}finally{a(!1)}},g=c||p[e];return(0,b.jsxs)(`div`,{className:`animate-fade-in`,style:M.container,children:[(0,b.jsxs)(`div`,{style:M.header,children:[(0,b.jsx)(`h1`,{style:M.heading,children:`Amazon KDP Publishing Copilot`}),(0,b.jsx)(`p`,{style:M.subheading,children:`Publish in under 2 minutes. Copy-paste optimized SEO descriptions safely to prevent account bans.`})]}),(0,b.jsxs)(`div`,{style:M.mainGrid,children:[(0,b.jsxs)(`div`,{className:`glass-card`,style:M.leftCard,children:[(0,b.jsxs)(`h2`,{style:M.sectionTitle,children:[(0,b.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`var(--secondary)`,style:{width:`22px`,height:`22px`},children:(0,b.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`})}),`KDP Upload Copilot`]}),(0,b.jsx)(`p`,{style:M.cardDescription,children:`Open Amazon KDP and follow these 4 simple steps to list your book.`}),(0,b.jsxs)(`div`,{style:M.stepsTimeline,children:[(0,b.jsxs)(`div`,{style:M.stepItem,children:[(0,b.jsx)(`div`,{style:M.stepNum,children:`1`}),(0,b.jsxs)(`div`,{style:M.stepContent,children:[(0,b.jsx)(`strong`,{style:M.stepTitle,children:`Enter Title & Subtitle`}),(0,b.jsx)(`p`,{style:M.stepText,children:`Copy the AI-optimized Title and Subtitle from the right panel and paste them into KDP Paperback Details.`})]})]}),(0,b.jsxs)(`div`,{style:M.stepItem,children:[(0,b.jsx)(`div`,{style:M.stepNum,children:`2`}),(0,b.jsxs)(`div`,{style:M.stepContent,children:[(0,b.jsx)(`strong`,{style:M.stepTitle,children:`Paste HTML Description`}),(0,b.jsx)(`p`,{style:M.stepText,children:`KDP description supports HTML. Copy the description text from the right panel to show rich bullet points on Amazon.`})]})]}),(0,b.jsxs)(`div`,{style:M.stepItem,children:[(0,b.jsx)(`div`,{style:M.stepNum,children:`3`}),(0,b.jsxs)(`div`,{style:M.stepContent,children:[(0,b.jsx)(`strong`,{style:M.stepTitle,children:`Fill the 7 Keyword Boxes`}),(0,b.jsx)(`p`,{style:M.stepText,children:`Paste the 7 custom KDP keywords. This is the secret step that allows buyers to find your book organically!`})]})]}),(0,b.jsxs)(`div`,{style:M.stepItem,children:[(0,b.jsx)(`div`,{style:M.stepNum,children:`4`}),(0,b.jsxs)(`div`,{style:M.stepContent,children:[(0,b.jsx)(`strong`,{style:M.stepTitle,children:`Upload PDF Files & Pricing`}),(0,b.jsx)(`p`,{style:M.stepText,children:`Upload your downloaded Interior PDF and Cover PDF. Select "Worldwide Rights" and input the recommended price.`})]})]})]}),(0,b.jsxs)(`a`,{href:`https://kdp.amazon.com`,target:`_blank`,rel:`noopener noreferrer`,className:`btn btn-secondary`,style:{width:`100%`,marginTop:`20px`},children:[`Open Amazon KDP Shelf`,(0,b.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,style:{width:`16px`,height:`16px`},children:(0,b.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25`})})]})]}),(0,b.jsxs)(`div`,{className:`glass-card`,style:M.rightCard,children:[(0,b.jsxs)(`div`,{style:M.titleRow,children:[(0,b.jsxs)(`h2`,{style:M.sectionTitle,children:[(0,b.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`var(--primary)`,style:{width:`22px`,height:`22px`},children:(0,b.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10`})}),`AI SEO Listing Copywriter`]}),c?(0,b.jsxs)(`div`,{style:{display:`flex`,gap:`10px`},children:[(0,b.jsx)(`button`,{onClick:f,disabled:u,className:`btn btn-outline`,style:{padding:`6px 12px`,fontSize:`11px`,color:`var(--success)`,borderColor:`rgba(16,185,129,0.3)`,cursor:`pointer`},children:u?`Saving to DB...`:`Save to KDP Database`}),(0,b.jsx)(`button`,{onClick:()=>l(null),className:`btn btn-outline`,style:{padding:`6px 12px`,fontSize:`11px`,color:`var(--danger)`,borderColor:`rgba(239,68,68,0.2)`,cursor:`pointer`},children:`Reset to Presets`})]}):(0,b.jsxs)(`div`,{style:{display:`flex`,gap:`10px`,alignItems:`center`},children:[(0,b.jsx)(`button`,{onClick:f,disabled:u,className:`btn btn-outline`,style:{padding:`6px 12px`,fontSize:`11px`,color:`var(--success)`,borderColor:`rgba(16,185,129,0.3)`,cursor:`pointer`},children:u?`Saving...`:`Save Preset to DB`}),(0,b.jsxs)(`select`,{value:e,onChange:e=>t(e.target.value),className:`form-select`,style:{width:`180px`,padding:`6px 12px`,fontSize:`12px`},children:[(0,b.jsx)(`option`,{value:`adhd_planner`,children:`ADHD Daily Planner`}),(0,b.jsx)(`option`,{value:`aws_guide`,children:`AWS SAA-C03 Guide`}),(0,b.jsx)(`option`,{value:`puzzle_book`,children:`Large Print Sudoku`})]})]})]}),(0,b.jsx)(`p`,{style:M.cardDescription,children:`Copy-paste these fields directly into Amazon KDP's upload page.`}),(0,b.jsxs)(`div`,{style:M.customGenBox,children:[(0,b.jsx)(`input`,{type:`text`,placeholder:`Enter custom book topic (e.g. 'Dog Training Log Book', 'C++ Interview Q&A')`,value:n,onChange:e=>r(e.target.value),className:`form-input`,style:{flexGrow:1},disabled:i}),(0,b.jsx)(`button`,{onClick:h,disabled:i,className:`btn btn-primary`,style:{flexShrink:0,padding:`12px 20px`},children:i?`Writing...`:`Generate with Llama 3`})]}),(0,b.jsxs)(`div`,{style:M.copilotGrid,children:[(0,b.jsxs)(`div`,{style:M.copyGroup,children:[(0,b.jsxs)(`div`,{style:M.copyLabelRow,children:[(0,b.jsx)(`span`,{style:M.fieldLabel,children:`Book Title (Amazon Page 1 Ranked)`}),(0,b.jsx)(`button`,{onClick:()=>m(g.title,`title`),style:M.copyBtn,children:o===`title`?`COPIED!`:`COPY`})]}),(0,b.jsx)(`div`,{style:M.metaTextBox,children:g.title})]}),(0,b.jsxs)(`div`,{style:M.copyGroup,children:[(0,b.jsxs)(`div`,{style:M.copyLabelRow,children:[(0,b.jsx)(`span`,{style:M.fieldLabel,children:`Book Subtitle (Benefits Focused)`}),(0,b.jsx)(`button`,{onClick:()=>m(g.subtitle,`subtitle`),style:M.copyBtn,children:o===`subtitle`?`COPIED!`:`COPY`})]}),(0,b.jsx)(`div`,{style:M.metaTextBox,children:g.subtitle})]}),(0,b.jsxs)(`div`,{style:M.copyGroup,children:[(0,b.jsxs)(`div`,{style:M.copyLabelRow,children:[(0,b.jsx)(`span`,{style:M.fieldLabel,children:`7 Amazon KDP Search Keywords`}),(0,b.jsx)(`span`,{style:{fontSize:`11px`,color:`var(--text-muted)`},children:`Click individual to copy`})]}),(0,b.jsx)(`div`,{style:M.keywordChipsContainer,children:g.keywords.map((e,t)=>(0,b.jsx)(`button`,{onClick:()=>m(e,`kw-${t}`),style:{...M.kwChip,borderColor:o===`kw-${t}`?`var(--success)`:`var(--border-glow)`,color:o===`kw-${t}`?`var(--success)`:`var(--text-primary)`},children:e},t))})]}),(0,b.jsxs)(`div`,{style:M.copyGroup,children:[(0,b.jsxs)(`div`,{style:M.copyLabelRow,children:[(0,b.jsx)(`span`,{style:M.fieldLabel,children:`HTML Description (Paste to Amazon WYSIWYG)`}),(0,b.jsx)(`button`,{onClick:()=>m(g.descriptionHtml,`description`),style:M.copyBtn,children:o===`description`?`COPIED!`:`COPY`})]}),(0,b.jsx)(`pre`,{style:M.htmlBox,children:g.descriptionHtml})]}),(0,b.jsxs)(`div`,{style:M.metaGridDouble,children:[(0,b.jsxs)(`div`,{style:M.copyGroup,children:[(0,b.jsx)(`span`,{style:M.fieldLabel,children:`Recommended Pricing`}),(0,b.jsxs)(`div`,{style:M.metaTextBox,children:[g.price,` (60% Paperback Royalty)`]})]}),(0,b.jsxs)(`div`,{style:M.copyGroup,children:[(0,b.jsx)(`span`,{style:M.fieldLabel,children:`Target KDP Categories`}),(0,b.jsx)(`div`,{style:{...M.metaTextBox,fontSize:`11px`,lineHeight:`1.4`},children:g.categories.map((e,t)=>(0,b.jsx)(`div`,{children:e},t))})]})]})]})]})]})]})}var M={container:{padding:`30px 40px`},header:{marginBottom:`32px`},heading:{fontSize:`28px`,color:`#fff`},subheading:{color:`var(--text-secondary)`,fontSize:`14px`,marginTop:`4px`},mainGrid:{display:`grid`,gridTemplateColumns:`1fr 1.6fr`,gap:`30px`},leftCard:{height:`fit-content`},rightCard:{display:`flex`,flexDirection:`column`},sectionTitle:{fontSize:`18px`,color:`#fff`,display:`flex`,alignItems:`center`,gap:`8px`},cardDescription:{fontSize:`13px`,color:`var(--text-secondary)`,margin:`6px 0 20px 0`},titleRow:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:`6px`},stepsTimeline:{display:`flex`,flexDirection:`column`,gap:`20px`},stepItem:{display:`flex`,gap:`16px`},stepNum:{width:`28px`,height:`28px`,borderRadius:`50%`,background:`rgba(139,92,246,0.1)`,border:`1.5px solid var(--primary)`,color:`var(--primary-hover)`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:`12px`,fontWeight:`800`,flexShrink:0,boxShadow:`0 0 10px rgba(139,92,246,0.2)`},stepContent:{flexGrow:1},stepTitle:{fontSize:`14px`,color:`#fff`,fontWeight:`700`},stepText:{fontSize:`12px`,color:`var(--text-secondary)`,marginTop:`4px`,lineHeight:`1.4`},customGenBox:{display:`flex`,gap:`12px`,background:`rgba(15, 23, 42, 0.3)`,border:`1px solid var(--border-glow)`,borderRadius:`10px`,padding:`12px`,marginBottom:`24px`,alignItems:`center`},copilotGrid:{display:`flex`,flexDirection:`column`,gap:`20px`},copyGroup:{display:`flex`,flexDirection:`column`,gap:`8px`},copyLabelRow:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},fieldLabel:{fontSize:`11px`,fontWeight:`700`,color:`var(--text-secondary)`,letterSpacing:`0.05em`,textTransform:`uppercase`},copyBtn:{background:`rgba(30,41,59,0.6)`,border:`1px solid var(--border-glow)`,borderRadius:`4px`,color:`var(--text-primary)`,fontSize:`10px`,fontWeight:`800`,padding:`4px 10px`,cursor:`pointer`,letterSpacing:`0.05em`,transition:`all 0.2s ease`},metaTextBox:{background:`rgba(6,9,19,0.5)`,border:`1px solid var(--border-glow)`,borderRadius:`8px`,padding:`12px 16px`,fontSize:`13px`,color:`#fff`,fontWeight:`500`},keywordChipsContainer:{display:`flex`,flexWrap:`wrap`,gap:`8px`},kwChip:{background:`rgba(6,9,19,0.5)`,border:`1px solid var(--border-glow)`,borderRadius:`30px`,padding:`6px 14px`,fontSize:`11px`,fontWeight:`600`,cursor:`pointer`,transition:`all 0.2s ease`},htmlBox:{background:`rgba(6,9,19,0.7)`,border:`1px solid var(--border-glow)`,borderRadius:`8px`,padding:`16px`,fontSize:`11px`,color:`#a78bfa`,fontFamily:`monospace`,whiteSpace:`pre-wrap`,maxHeight:`180px`,overflowY:`auto`},metaGridDouble:{display:`grid`,gridTemplateColumns:`1fr 1.5fr`,gap:`16px`}};function se(){let[e,t]=(0,_.useState)(!1),[n,r]=(0,_.useState)(864e5),[i,a]=(0,_.useState)([]),[o,s]=(0,_.useState)(!0),c=(0,_.useRef)(null),l=async()=>{try{let e=await fetch(`${C}/api/autopilot/status`);if(e.ok){let n=await e.json();t(n.active),a(n.thoughts||[])}}catch(e){console.error(`Error fetching autopilot status:`,e)}finally{s(!1)}};return(0,_.useEffect)(()=>{l();let e=setInterval(l,3e3);return()=>clearInterval(e)},[e]),(0,_.useEffect)(()=>{c.current&&c.current.scrollIntoView({behavior:`smooth`})},[i]),(0,b.jsxs)(`div`,{className:`animate-fade-in`,style:N.container,children:[(0,b.jsxs)(`div`,{style:N.header,children:[(0,b.jsx)(`h1`,{style:N.heading,children:`KDP Autonomous Agent & E-Book Packager`}),(0,b.jsx)(`p`,{style:N.subheading,children:`Configure a daily background worker that researches, writes, and packages premium humanized e-books with covers into downloadable ZIPs.`})]}),(0,b.jsxs)(`div`,{style:N.mainGrid,children:[(0,b.jsxs)(`div`,{className:`glass-card`,style:N.controlCard,children:[(0,b.jsxs)(`h2`,{style:N.sectionTitle,children:[(0,b.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`var(--secondary)`,style:{width:`22px`,height:`22px`},children:[(0,b.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 18a3.75 3.75 0 0 0 .495-7.467 5.99 5.99 0 0 0-1.925 3.546 5.974 5.974 0 0 1-2.133-1A3.75 3.75 0 0 0 12 18Z`}),(0,b.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 1 1 7.072 0l-.548.547A3.374 3.374 0 0 0 14 18.469V19a2 2 0 1 1-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547Z`})]}),`Autopilot Parameters`]}),(0,b.jsxs)(`div`,{style:N.toggleRow,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`strong`,{style:{color:`#fff`,fontSize:`15px`,display:`block`},children:`Agent Ignition`}),(0,b.jsx)(`span`,{style:{fontSize:`12px`,color:`var(--text-secondary)`},children:`Toggle to start autonomous loop`})]}),(0,b.jsx)(`button`,{onClick:async()=>{let r=!e;s(!0);try{let e=await fetch(`${C}/api/autopilot/toggle`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({active:r,intervalMs:n})});e.ok&&(t((await e.json()).active),l())}catch(e){console.error(`Error toggling autopilot:`,e),alert(`Error connecting to the backend Space.`)}finally{s(!1)}},disabled:o,style:{...N.toggleBtn,background:e?`var(--success)`:`rgba(255,255,255,0.05)`,color:e?`#000`:`var(--text-secondary)`,boxShadow:e?`0 0 15px rgba(16,185,129,0.4)`:`none`},children:o?`PENDING...`:e?`AUTOPILOT: ON`:`AUTOPILOT: OFF`})]}),(0,b.jsxs)(`div`,{className:`form-group`,style:{marginTop:`24px`},children:[(0,b.jsx)(`label`,{className:`form-label`,children:`Simulated Loop Frequency`}),(0,b.jsxs)(`select`,{value:n,onChange:e=>r(parseInt(e.target.value)),className:`form-select`,disabled:e,children:[(0,b.jsx)(`option`,{value:`60000`,children:`Every 1 Minute (Optimal Testing)`}),(0,b.jsx)(`option`,{value:`3600000`,children:`Every 1 Hour (Standard Scaling)`}),(0,b.jsx)(`option`,{value:`86400000`,children:`Every 24 Hours (Daily Automation)`})]})]}),(0,b.jsxs)(`div`,{style:N.strategyBox,children:[(0,b.jsxs)(`div`,{style:N.strategyHeader,children:[(0,b.jsx)(`span`,{style:N.pulsePoint}),(0,b.jsx)(`strong`,{children:`Autopilot Strategy Blueprint`})]}),(0,b.jsxs)(`ul`,{style:N.strategyList,children:[(0,b.jsxs)(`li`,{children:[`🔍 `,(0,b.jsx)(`strong`,{children:`Scans Hot KDP Trends`}),`: Focuses on high-yield, high-interest niches.`]}),(0,b.jsxs)(`li`,{children:[`✍️ `,(0,b.jsx)(`strong`,{children:`Groq Llama 3 70B Generation`}),`: Generates beautifully styled and humanized book content.`]}),(0,b.jsxs)(`li`,{children:[`🖼️ `,(0,b.jsx)(`strong`,{children:`SDXL High-Res Cover Art`}),`: Automatically designs matched aesthetic book covers.`]}),(0,b.jsxs)(`li`,{children:[`📦 `,(0,b.jsx)(`strong`,{children:`Automated ZIP Packaging`}),": Packages `book.md`, `cover.jpg`, and complete publishing metadata (`listing.txt`) into a single ZIP for manual publishing."]})]})]})]}),(0,b.jsxs)(`div`,{className:`glass-card`,style:N.terminalCard,children:[(0,b.jsxs)(`div`,{className:`card-header`,children:[(0,b.jsx)(`h2`,{style:N.cardTitle,children:`Agent Thought Stream Terminal`}),e&&(0,b.jsx)(`span`,{style:N.runningBadge,children:`ACTIVE RUNNING`})]}),(0,b.jsx)(`p`,{style:N.cardDescription,children:`Live telemetry stream capturing Llama 3 background creation sequences.`}),(0,b.jsxs)(`div`,{style:N.terminalContainer,children:[i.slice().reverse().map((e,t)=>{let n=e.match(/(https?:\/\/\S+)/i),r=e.includes(`❌`)?`var(--danger)`:e.includes(`✅`)?`var(--success)`:e.includes(`🚀`)?`var(--secondary)`:`#a78bfa`;if(n){let i=n[1],a=e.split(i);return(0,b.jsxs)(`div`,{style:{...N.terminalLine,color:r},children:[a[0],(0,b.jsx)(`a`,{href:i,target:`_blank`,rel:`noreferrer`,style:{color:`#ff90e8`,fontWeight:`800`,textDecoration:`underline`},children:i}),a[1]]},t)}return(0,b.jsx)(`div`,{style:{...N.terminalLine,color:r},children:e},t)}),(0,b.jsx)(`div`,{ref:c})]})]})]})]})}var N={container:{padding:`30px 40px`},header:{marginBottom:`32px`},heading:{fontSize:`28px`,color:`#fff`},subheading:{color:`var(--text-secondary)`,fontSize:`14px`,marginTop:`4px`},mainGrid:{display:`grid`,gridTemplateColumns:`1fr 1.6fr`,gap:`30px`},controlCard:{height:`fit-content`},sectionTitle:{fontSize:`18px`,color:`#fff`,display:`flex`,alignItems:`center`,gap:`8px`,marginBottom:`20px`},toggleRow:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,background:`rgba(15,23,42,0.4)`,border:`1px solid var(--border-glow)`,borderRadius:`12px`,padding:`18px`},toggleBtn:{border:`none`,borderRadius:`8px`,padding:`12px 20px`,fontWeight:`800`,fontSize:`12px`,cursor:`pointer`,letterSpacing:`0.05em`,transition:`all 0.3s cubic-bezier(0.4, 0, 0.2, 1)`},strategyBox:{background:`rgba(6,9,19,0.5)`,border:`1px solid var(--border-glow)`,borderRadius:`10px`,padding:`16px`,marginTop:`24px`},strategyHeader:{display:`flex`,alignItems:`center`,gap:`8px`,fontSize:`13px`,color:`var(--secondary)`,marginBottom:`12px`},pulsePoint:{width:`6px`,height:`6px`,borderRadius:`50%`,background:`var(--secondary)`,boxShadow:`0 0 6px var(--secondary)`},strategyList:{paddingLeft:`18px`,fontSize:`12px`,color:`var(--text-secondary)`,display:`flex`,flexDirection:`column`,gap:`8px`},terminalCard:{display:`flex`,flexDirection:`column`,maxHeight:`600px`},cardTitle:{fontSize:`18px`,color:`#fff`},cardDescription:{fontSize:`13px`,color:`var(--text-secondary)`,marginBottom:`20px`},runningBadge:{fontSize:`10px`,fontWeight:`800`,background:`rgba(16, 185, 129, 0.1)`,color:`var(--success)`,padding:`3px 8px`,borderRadius:`4px`,boxShadow:`0 0 8px rgba(16,185,129,0.2)`},terminalContainer:{flexGrow:1,background:`#040711`,border:`1px solid var(--border-glow)`,borderRadius:`12px`,padding:`20px`,minHeight:`400px`,overflowY:`auto`,display:`flex`,flexDirection:`column`,gap:`10px`,boxShadow:`inset 0 4px 20px rgba(0,0,0,0.8)`,fontFamily:`monospace`,fontSize:`11px`,lineHeight:`1.5`},terminalLine:{whiteSpace:`pre-wrap`,textShadow:`0 0 2px rgba(167, 139, 250, 0.3)`}},ce=[{id:`gumroad`,name:`Gumroad`,emoji:`🟠`,color:`#ff90e8`,hint:`E-books, templates, courses, digital downloads`},{id:`etsy`,name:`Etsy`,emoji:`🟡`,color:`#f1c40f`,hint:`Printable planners, templates, digital art`},{id:`kdp`,name:`Amazon KDP`,emoji:`🔵`,color:`#4a90e2`,hint:`Kindle e-books and paperbacks`},{id:`kofi`,name:`Ko-fi`,emoji:`☕`,color:`#13c3ff`,hint:`Digital products, memberships, donations`},{id:`payhip`,name:`Payhip`,emoji:`💜`,color:`#9b59b6`,hint:`Simple digital downloads store`},{id:`creative`,name:`Creative Market`,emoji:`🎨`,color:`#e74c3c`,hint:`Fonts, graphics, website templates`},{id:`teachable`,name:`Teachable`,emoji:`🎓`,color:`#2ecc71`,hint:`Online courses and memberships`},{id:`envato`,name:`Envato Market`,emoji:`🟢`,color:`#27ae60`,hint:`Themes, code, graphics, audio`}];function P(){let[e,t]=(0,_.useState)(`gumroad`),[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(null),[m,h]=(0,_.useState)(``),[g,v]=(0,_.useState)(null),[y,x]=(0,_.useState)(!1),[S,w]=(0,_.useState)(``),[T,ee]=(0,_.useState)(()=>localStorage.getItem(`gumroad_token`)||``),[E,D]=(0,_.useState)(!1),[te,ne]=(0,_.useState)(``),[re,ie]=(0,_.useState)(``),[O,ae]=(0,_.useState)(!1),[k,A]=(0,_.useState)(``),[j,oe]=(0,_.useState)(``),[M,se]=(0,_.useState)(null),[N,P]=(0,_.useState)(``),le=ce.find(t=>t.id===e),ue=e=>{let t=e.target.value;ee(t),localStorage.setItem(`gumroad_token`,t)},de=async()=>{if(!n.trim()){alert(`Please enter a niche or topic!`);return}a(!0),s(`listing`),d(null),p(null),h(``),w(``),ie(``),ne(``);try{let t=await fetch(`${C}/api/generate-product`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({platform:e,niche:n.trim()})});if(!t.ok)throw Error(`Failed to generate product`);let r=await t.json();if(d(r),r.thumbnailPrompt){s(`cover`);try{let e=await fetch(`${C}/api/generate-cover`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({prompt:r.thumbnailPrompt,title:r.title})});if(e.ok){let t=await e.json();p(t.imageUrl),h(t.coverUrl)}}catch(e){console.warn(`Auto thumbnail generation failed:`,e.message)}}}catch(e){alert(`Error generating product: `+e.message)}finally{a(!1),s(``)}},fe=async()=>{if(!j.trim()){alert(`Please enter a general topic/niche!`);return}ae(!0),A(`optimizing`),se(null),P(``);try{let e=await fetch(`${C}/api/generate-product`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({platform:`kdp`,niche:j.trim()})});if(!e.ok)throw Error(`Failed to generate best-seller content`);let t=await e.json();se(t),A(`zipping`);let n=await fetch(`${C}/api/generate-package`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:t.title,subtitle:t.subtitle,description:t.description,tags:t.tags,cta:t.cta,price:t.price,platform:`kdp`,productContent:t.productContent,thumbnailPrompt:t.thumbnailPrompt})});if(!n.ok)throw Error(`Failed to package ZIP archive`);let r=await n.json();P(r.packageUrl),window.location.href=r.packageUrl;try{await fetch(`${C}/api/catalog`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:t.title,subtitle:t.subtitle,type:`study_guide`,price:t.price,platform:`kdp`,tags:t.tags,thumbnail_url:t.thumbnailUrl||``,sales_copy:t.description,status:`ready_to_publish`,published_url:r.packageUrl})})}catch(e){console.warn(`Silent save to catalog failed:`,e.message)}}catch(e){alert(`Error packaging best-seller book: `+e.message)}finally{ae(!1),A(``)}},pe=()=>{if(!M?.productContent)return;let e=new Blob([M.productContent],{type:`text/markdown`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${M.title.replace(/[^a-zA-Z0-9]/g,`_`).toLowerCase()}_manuscript.md`,n.click(),URL.revokeObjectURL(t)},me=()=>{if(!M?.productContent)return;let e=window.open(``,`_blank`),t=M.productContent,n=[];for(let e=1;e<=5;e++){let r=`Chapter ${e}`,i=t.indexOf(r),a=-1;if(i!==-1&&(a=t.indexOf(r,i+r.length),a===-1&&(a=i)),a!==-1){let r=t.length;if(e<5){let n=`Chapter ${e+1}`,i=t.indexOf(n),a=-1;i!==-1&&(a=t.indexOf(n,i+n.length),a===-1&&(a=i)),a!==-1&&(r=a)}let i=t.substring(a,r).trim();i.endsWith(`#`)&&(i=i.substring(0,i.lastIndexOf(`#`)).trim()),n.push(i)}else n.push(`Chapter ${e}\n\nContent for chapter ${e} is detailed here.`)}let r=``;r+=`<div class="page left-page cover-page"><div class="header-brand">BOOKFORGE DIGITAL HUBS</div><div class="cover-interior">4 unmodified lines</div><div class="cover-footer">BOOKFORGE PREMIUM EDITION</div></div>`,r+=`<div class="page right-page copyright-page"><div class="header-brand">BOOKFORGE BINDERY & REGISTRATION</div><div class="interior-content">11 unmodified lines</div><div class="page-number">Page 2</div></div>`,r+=`<div class="page left-page toc-page"><div class="header-brand">CONTENTS INDEX</div><div class="interior-content">15 unmodified lines</div><div class="page-number">Page 3</div></div>`,r+=`<div class="page right-page preface-page"><div class="header-brand">AUTHOR PREFACE</div><div class="interior-content">6 unmodified lines</div><div class="page-number">Page 4</div></div>`;let i=5;for(let e=0;e<5;e++){let t=i%2==0?`right-page`:`left-page`,a=n[e],o=a.split(``)[0].replace(/#+/g,``).replace(/:/g,``).trim().toUpperCase(),s=a.split(``).slice(1).join(``).replace(/\n/g,`<br>`).replace(/✓ (.*?)(?=<br>)/g,`<li>✓ $1</li>`);r+=`<div class="page ${t} chapter-cover"><div class="header-brand">CHAPTER DIVISION ${e+1}</div><div class="chapter-cover-interior"><span class="chapter-number">CHAPTER 0${e+1}</span><div class="cover-divider"></div><h2>${o}</h2><p style="font-size: 11px; text-transform:uppercase; color:#333; letter-spacing:1px; margin-top:20px;">Detailed Written Guide & Workbook Interior</p></div><div class="page-number">Page ${i}</div></div>`,i++;let c=i%2==0?`right-page`:`left-page`;r+=`<div class="page ${c} chapter-content"><div class="header-brand">${o}</div><div class="chapter-text-interior"><h3>DEVELOPMENTAL MANUAL OUTLINE</h3><p>${s}</p></div><div class="page-number">Page ${i}</div></div>`,i++;let l=e===4?18:22;for(let t=0;t<l;t++){let n=i%2==0?`right-page`:`left-page`,a=``;a=e===0?t%2==0?`<h2>DAILY FOCUS TRACKER</h2><div class="divider"></div><div class="box">118 unmodified lines<div class="dot-grid">${`<div class="dot">.</div>`.repeat(80)}</div>`,r+=`<div class="page ${n}"><div class="header-brand">BOOKFORGE DIGITAL GOAL PLANNERS</div><div class="page-interior">${a}</div><div class="page-number">Page ${i}</div></div>`,i++}}e.document.write(`<html><head><title>${M.title} - 120 Pages</title>3 unmodified lines.page { page-break-after: always; display: flex !important; }@page { size: 6in 9in; margin: 0; }}* {box-sizing: border-box;-webkit-print-color-adjust: exact !important;print-color-adjust: exact !important;}body {font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;color: #000;margin: 0;padding: 0;background: #fff;}.page {background: #fff;width: 6in;height: 9in;margin: 0 auto;position: relative;display: flex;flex-direction: column;justify-content: space-between;border: none;}/* Gutter Margins Alternating (Perfect Spine Binding) */.left-page {padding: 0.8in 0.75in 0.8in 0.4in;}2 unmodified lines}.header-brand {font-size: 8px;color: #444;letter-spacing: 2px;text-align: center;border-bottom: 2px solid #000;padding-bottom: 6px;text-transform: uppercase;font-weight: 700;}.page-interior {flex-grow: 1;5 unmodified lines.interior-content {padding: 40px 10px 0 10px;}/* Cover page styling */.cover-page {justify-content: space-between;padding: 1.2in 0.6in;text-align: center;border: 3px solid #000;}.cover-interior {display: flex;flex-direction: column;align-items: center;margin-top: 1.5in;}.cover-title {font-family: 'Georgia', serif;font-size: 26px;font-weight: 900;text-transform: uppercase;letter-spacing: 1px;line-height: 1.3;margin: 0 0 15px 0;color: #000;}.cover-divider {width: 80px;height: 4px;background: #000;margin: 15px 0;}.cover-subtitle {font-family: 'Georgia', serif;font-size: 14px;color: #111;font-style: italic;line-height: 1.5;margin: 15px 0;max-width: 4.5in;}.cover-tag {font-size: 10px;font-weight: 900;border: 2px solid #000;border-radius: 4px;padding: 6px 12px;margin-top: 40px;letter-spacing: 2px;display: inline-block;text-transform: uppercase;}.cover-footer {font-size: 10px;font-weight: 900;letter-spacing: 4px;color: #000;margin-bottom: 0.5in;}/* Copyright page styling */.copyright-page h3 {font-size: 12px;font-weight: 800;margin-bottom: 8px;text-transform: uppercase;}.copyright-page p {font-size: 10px;line-height: 1.5;color: #111;text-align: justify;margin: 0 0 18px 0;}/* TOC table */.toc-list {display: flex;flex-direction: column;gap: 12px;margin-top: 30px;}.toc-item {display: flex;justify-content: space-between;font-size: 10px;font-weight: bold;color: #000;}.dots {flex-grow: 1;text-align: center;color: #333;overflow: hidden;white-space: nowrap;margin: 0 10px;}/* Chapter divisions cover */.chapter-cover {justify-content: space-between;padding: 1.2in 0.6in;text-align: center;border: 2px solid #000;}.chapter-cover-interior {display: flex;flex-direction: column;align-items: center;margin-top: 2in;}.chapter-number {font-size: 12px;font-weight: 900;letter-spacing: 4px;color: #000;}.chapter-cover h2 {font-family: 'Georgia', serif;font-size: 22px;font-weight: 900;margin-top: 20px;}/* Chapter text summaries */.chapter-content {font-family: 'Georgia', serif;line-height: 1.7;}.chapter-text-interior {padding: 30px 10px;text-align: justify;}.chapter-text-interior h3 {font-size: 13px;font-weight: 900;border-bottom: 2px solid #000;padding-bottom: 6px;margin-bottom: 18px;letter-spacing: 1px;}.chapter-text-interior p {font-size: 11px;line-height: 1.7;color: #000;margin-bottom: 14px;}.chapter-text-interior li {font-size: 11px;margin-left: 15px;list-style-type: none;margin-bottom: 8px;color: #000;font-weight: 600;}/* High-Contrast Workbook Elements */h2 {font-size: 14px;font-weight: 900;text-align: center;margin: 0 0 5px 0;letter-spacing: 1px;text-transform: uppercase;}.divider {height: 3px;background: #000;width: 40px;margin: 0 auto 10px auto;}.box {border: 2px solid #000;border-radius: 6px;padding: 12px 16px;display: flex;flex-direction: column;gap: 12px;background: #fff;}.label {font-size: 9px;font-weight: 900;letter-spacing: 1.5px;color: #000;border-bottom: 2px solid #000;padding-bottom: 4px;text-transform: uppercase;}.line {border-bottom: 2px dotted #000;height: 20px;width: 100%;}.checkbox-row {display: flex;align-items: center;gap: 12px;}.checkbox {width: 16px;height: 16px;border: 2.5px solid #000;border-radius: 3px;flex-shrink: 0;background: #fff;}.doodle-placeholder {border: 2px dashed #000;border-radius: 4px;flex-grow: 1;min-height: 80px;background: #fff;}.habit-row {display: flex;align-items: center;justify-content: space-between;gap: 12px;}.circles {font-size: 15px;letter-spacing: 4px;color: #000;}/* Dot Grid journaling */.dot-grid {display: grid;grid-template-columns: repeat(8, 1fr);grid-gap: 25px;padding: 30px 40px;opacity: 0.35;flex-grow: 1;}.dot {font-size: 26px;text-align: center;line-height: 0;color: #000;font-weight: 900;}/* Priority Matrix 2x2 grid */.matrix-grid {display: grid;grid-template-columns: 1fr 1fr;3 unmodified linespadding: 10px 0;}.matrix-box {border: 2px solid #000;border-radius: 6px;padding: 12px;display: flex;flex-direction: column;justify-content: space-between;}/* Double Column budget/case tables */.budget-table {width: 100%;border-collapse: collapse;margin-top: 10px;}.budget-table th {font-size: 9px;font-weight: 900;text-align: left;padding: 8px;border-bottom: 3px solid #000;text-transform: uppercase;}.budget-table td {padding: 12px 8px;border-bottom: 2px solid #000;font-size: 11px;color: #000;}.page-number {text-align: center;font-size: 10px;color: #000;border-top: 2px solid #000;padding-top: 6px;font-weight: 700;}</style></head><body>${r}<script>window.onload = function() { window.print(); }<\/script>
4 unmodified lines5678910114 unmodified lines<link rel="icon" type="image/svg+xml" href="/favicon.svg" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>BookForge Digital - Premium AI Book Publisher & Dashboard</title><script type="module" crossorigin src="/assets/index-4x_ttUEu.js"></script><link rel="stylesheet" crossorigin href="/assets/index-D3V6GKGj.css"></head><body>4 unmodified lines5678910114 unmodified lines<link rel="icon" type="image/svg+xml" href="/favicon.svg" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>BookForge Digital - Premium AI Book Publisher & Dashboard</title><script type="module" crossorigin src="/assets/index-bJnV20--.js"></script><link rel="stylesheet" crossorigin href="/assets/index-D3V6GKGj.css"></head><body>
assets/index-4x_ttUEu.js → assets/index-bJnV20--.jsRenamed+143-114
index.html+1-1