PageSourceSearch

https://webtoepub.com/_next/static/chunks/Converter-ALeLexBZ.js

js webtoepub.com collected 2026-09-24 14:57:04 UTC 23,896 bytes, 23 lines download raw bytes

1import{r as e}from"./rolldown-runtime-C60lm6uB.js";import{i as t,r as n}from"./framework-BaE7mD_r.js";import r from"./link-9x-b8L2X.js";var i=e(n(),1),a=[`[itemprop='articleBody']`,`.article-content`,`.article-body`,`.post-content`,`.entry-content`,`.story-body`,`article`,`main`,`[role='main']`,`#content`].join(`,`),o=new Set(`a.blockquote.br.code.dd.div.dl.dt.em.figcaption.figure.h1.h2.h3.h4.h5.h6.hr.img.li.ol.p.pre.span.strong.sub.sup.table.tbody.td.tfoot.th.thead.tr.ul`.split(`.`)),s=new Set([`aside`,`audio`,`button`,`canvas`,`dialog`,`footer`,`form`,`header`,`iframe`,`input`,`nav`,`noscript`,`script`,`select`,`style`,`svg`,`template`,`textarea`,`video`]),c=new Set([`br`,`hr`,`img`]);function l(e){return String(e||``).replace(/\s+/g,` `).trim()}function u(e,t){for(let n of t){let t=e.querySelector(n)?.getAttribute(`content`);if(l(t))return l(t)}return``}function d(e){let t=`${e.id} ${e.getAttribute(`class`)||``}`.replace(/([a-z])([A-Z])/g,`$1 $2`).replace(/[_-]+/g,` `);return/\b(?:ad|advert|banner|breadcrumb|comment|cookie|footer|modal|newsletter|popup|promo|related|share|social|sponsor|subscribe)\b/i.test(t)}function f(e){let t=l(e.textContent).length,n=e.querySelectorAll(`p`).length,r=e.querySelectorAll(`h1, h2, h3`).length,i=Array.from(e.querySelectorAll(`a`)).reduce((e,t)=>e+l(t.textContent).length,0);return t+n*90+r*40-i*.45}function p(e){let t=Array.from(e.querySelectorAll(a)).filter(e=>!d(e)).sort((e,t)=>f(t)-f(e))[0],n=e.body,r=t&&f(t)>=300?t:n;if(!r||l(r.textContent).length<160)throw Error(`No readable article was found on this page.`);return r}function m(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function h(e){return m(e).replace(/"/g,`&quot;`)}function g(e,t){try{let n=new URL(e,t);return n.protocol===`http:`||n.protocol===`https:`?n.href:``}catch{return``}}function _(e,t){let n=e.getAttribute(`src`)||e.getAttribute(`data-src`)||e.getAttribute(`data-lazy-src`),r=e.getAttribute(`srcset`)||e.getAttribute(`data-srcset`);return g(n||(r?r.split(`,`).at(-1)?.trim().split(/\s+/)[0]:``)||``,t)}function v({node:e,pageUrl:t,images:n}){if(e.nodeType===Node.TEXT_NODE)return m(e.textContent||``);if(e.nodeType!==Node.ELEMENT_NODE)return``;let r=e,i=r.tagName.toLowerCase();if(s.has(i)||d(r)||r.getAttribute(`aria-hidden`)===`true`||r.hasAttribute(`hidden`))return``;let a=Array.from(r.childNodes).map(e=>v({node:e,pageUrl:t,images:n})).join(``);if(!o.has(i))return a;if(i===`img`){if(n.length>=40)return``;let e=_(r,t);if(!e||n.some(t=>t.url===e))return``;let i=n.length+1,a={id:`image-${String(i).padStart(3,`0`)}`,path:`images/image-${String(i).padStart(3,`0`)}`,url:e,alt:l(r.getAttribute(`alt`))};return n.push(a),`<img src="${a.path}" alt="${h(a.alt)}" />`}let u=[];if(i===`a`){let e=g(r.getAttribute(`href`)||``,t);e&&u.push(`href="${h(e)}"`)}for(let e of[`colspan`,`rowspan`]){let t=r.getAttribute(e);t&&/^\d{1,2}$/.test(t)&&u.push(`${e}="${t}"`)}let f=u.length?`<${i} ${u.join(` `)}>`:`<${i}>`;return c.has(i)?f.slice(0,-1)+` />`:`${f}${a}</${i}>`}function y(e,t){let n=new DOMParser().parseFromString(e,`text/html`),r=p(n),i=[],a=Array.from(r.childNodes).map(e=>v({node:e,pageUrl:t,images:i})).join(``).replace(/<(?:div|span)>\s*<\/(?:div|span)>/gi,``).trim();return{title:u(n,[`meta[property="og:title"]`,`meta[name="twitter:title"]`])||l(r.querySelector(`h1`)?.textContent)||l(n.title)||`Untitled page`,author:u(n,[`meta[name="author"]`,`meta[property="article:author"]`,`meta[name="dc.creator"]`])||l(r.querySelector(`[rel="author"], [itemprop="author"], .byline, .author`)?.textContent),language:l(n.documentElement.lang).split(`-`)[0]||`en`,description:u(n,[`meta[name="description"]`,`meta[property="og:description"]`]),publishedAt:u(n,[`meta[property="article:published_time"]`,`meta[name="date"]`]),url:t,contentHtml:a,textLength:l(r.textContent).length,images:i}}async function b({pageUrl:e,errorStage:t,errorCode:n}){try{let r=new URL(e).hostname.toLowerCase();if(!r)return;await fetch(`/api/compatibility-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({sourceDomain:r,errorStage:t,errorCode:n}),keepalive:!0})}catch{}}function x(e){return String(e||``).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function S(e){return x(e).replace(/"/g,`&quot;`)}function C(e){return e.replace(/<[^>]+>/g,` `).replace(/&(?:lt|gt|quot|amp);/g,` `).replace(/\s+/g,` `).trim().toLowerCase()}function w(e,t){let n=/<h1\b[^>]*>([\s\S]*?)<\/h1>/i.exec(e);return!n||C(n[1])!==C(t)?e:e.slice(0,n.index)+e.slice(n.index+n[0].length)}function T(){return`<?xml version="1.0" encoding="UTF-8"?>
2<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
3  <rootfiles><rootfile full-path="OEBPS/package.opf" media-type="application/oebps-package+xml"/></rootfiles>
4</container>`}function E(){return`body { color: #191714; font-family: serif; line-height: 1.6; margin: 5%; }
5h1, h2, h3, h4, h5, h6 { line-height: 1.25; }
6a { color: inherit; } img { display: block; height: auto; margin: 1em auto; max-width: 100%; }
7figure { margin: 1.25em 0; } figcaption, .byline, .published, .source, .description { color: #625d55; font-size: .9em; }
8blockquote { border-left: .2em solid #aaa; margin-left: 0; padding-left: 1em; }
9pre { white-space: pre-wrap; } table { border-collapse: collapse; width: 100%; } td, th { border: 1px solid #bbb; padding: .35em; }`}function D({article:e,contentHtml:t}){let n=e.author?`<p class="byline">${x(e.author)}</p>`:``,r=e.publishedAt?`<p class="published">${x(e.publishedAt)}</p>`:``,i=e.description?`<p class="description">${x(e.description)}</p>`:``;return`<?xml version="1.0" encoding="UTF-8"?>
10<html xmlns="http://www.w3.org/1999/xhtml" lang="${S(e.language)}" xml:lang="${S(e.language)}">
11  <head><title>${x(e.title)}</title><link rel="stylesheet" type="text/css" href="styles.css"/></head>
12  <body><section class="title-page"><h1>${x(e.title)}</h1>${n}${r}<p class="source"><a href="${S(e.url)}">${x(e.url)}</a></p>${i}</section>
13  <article>${w(t,e.title)}</article></body>
14</html>`}function O(e,t){let n=t[0]?.article.language||`en`,r=t.map(e=>`<li><a href="${e.path}">${x(e.article.title)}</a></li>`).join(``);return`<?xml version="1.0" encoding="UTF-8"?>
15<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" lang="${S(n)}"><head><title>${x(e.title)}</title></head>
16<body><nav epub:type="toc" id="toc"><h1>Contents</h1><ol>${r}</ol></nav></body></html>`}
16function k(e,t,n){let r=t[0]?.article.language||`en`,i=t.map(e=>`<dc:source>${x(e.article.url)}</dc:source>`).join(``),a=t.map(e=>`    <item id="${e.id}" href="${e.path}" media-type="application/xhtml+xml"/>`).join(`
17`),o=n.map(e=>`    <item id="${e.id}" href="${e.path}" media-type="${e.mediaType}"/>`).join(`
18`),s=t.map(e=>`<itemref idref="${e.id}"/>`).join(``);return`<?xml version="1.0" encoding="UTF-8"?>
19<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="pub-id">
20  <metadata xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:identifier id="pub-id">urn:uuid:${crypto.randomUUID()}</dc:identifier><dc:title>${x(e.title)}</dc:title><dc:language>${x(r)}</dc:language><dc:creator>${x(e.author||`Unknown author`)}</dc:creator>${i}<meta property="dcterms:modified">${new Date().toISOString().replace(/\.\d{3}Z$/,`Z`)}</meta></metadata>
21  <manifest><item id="nav" href="nav.xhtml" media-type="application/xhtml+xml" properties="nav"/><item id="styles" href="styles.css" media-type="text/css"/>\n${a}${o?`\n${o}`:``}</manifest>
22  <spine>${s}</spine>
23</package>`}var A=class{constructor(){this.entries=[],this.offset=0,this.encoder=new TextEncoder}addFile(e,t){let n=typeof t==`string`?this.encoder.encode(t):t,r=this.encoder.encode(e),i=new Date,a=Math.max(i.getFullYear(),1980),o=i.getHours()<<11|i.getMinutes()<<5|Math.floor(i.getSeconds()/2),s=a-1980<<9|i.getMonth()+1<<5|i.getDate();this.entries.push({name:r,data:n,crc:M(n),time:o,date:s,offset:this.offset}),this.offset+=30+r.length+n.length}finish(){let e=[];for(let t of this.entries){let n=new Uint8Array(30+t.name.length),r=new DataView(n.buffer);r.setUint32(0,67324752,!0),r.setUint16(4,20,!0),r.setUint16(8,0,!0),r.setUint16(10,t.time,!0),r.setUint16(12,t.date,!0),r.setUint32(14,t.crc,!0),r.setUint32(18,t.data.length,!0),r.setUint32(22,t.data.length,!0),r.setUint16(26,t.name.length,!0),n.set(t.name,30),e.push(n,t.data)}let t=this.offset;for(let t of this.entries){let n=new Uint8Array(46+t.name.length),r=new DataView(n.buffer);r.setUint32(0,33639248,!0),r.setUint16(4,20,!0),r.setUint16(6,20,!0),r.setUint16(12,t.time,!0),r.setUint16(14,t.date,!0),r.setUint32(16,t.crc,!0),r.setUint32(20,t.data.length,!0),r.setUint32(24,t.data.length,!0),r.setUint16(28,t.name.length,!0),r.setUint32(42,t.offset,!0),n.set(t.name,46),e.push(n)}let n=e.slice(this.entries.length*2).reduce((e,t)=>e+t.length,0),r=new Uint8Array(22),i=new DataView(r.buffer);i.setUint32(0,101010256,!0),i.setUint16(8,this.entries.length,!0),i.setUint16(10,this.entries.length,!0),i.setUint32(12,n,!0),i.setUint32(16,t,!0),e.push(r);let a=e.reduce((e,t)=>e+t.length,0),o=new Uint8Array(a),s=0;for(let t of e)o.set(t,s),s+=t.length;return o}},j=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t+=1){let n=t;for(let e=0;e<8;e+=1)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n>>>0}return e})();function M(e){let t=4294967295;for(let n of e)t=j[(t^n)&255]^t>>>8;return(t^4294967295)>>>0}function N(e,t){return e.replace(/<img\b[^>]*\bsrc="([^"]+)"[^>]*\/>/gi,(e,n)=>t.has(n)?e:``).replace(/<figure>\s*<\/figure>/gi,``)}async function P(e,t){if(!e.title.trim()||e.articles.length===0)throw Error(`A book title and at least one chapter are required.`);let n=[],r=e.articles.map((e,t)=>{let n=String(t+1).padStart(3,`0`);return{id:`chapter-${n}`,path:`chapter-${n}.xhtml`,article:e,contentHtml:e.contentHtml}}),i=e.articles.reduce((e,t)=>e+t.images.length,0),a=0,o=0,s=!1;for(let e=0;e<r.length&&!s;e+=1){let c=r[e];for(let r=0;r<c.article.images.length;r+=1){let l=c.article.images[r];a+=1,t(`Fetching image ${a} of ${i}…`);try{let t=await fetch(`/api/fetch`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({url:l.url,kind:`image`})});if(!t.ok)continue;let i=(t.headers.get(`content-type`)||``).split(`;`)[0].toLowerCase();if(!/^image\/(?:jpeg|png|gif|webp)$/.test(i))continue;let a=new Uint8Array(await t.arrayBuffer());if(o+a.length>30*1024*1024){s=!0;break}o+=a.length;let u=i===`image/jpeg`?`jpg`:i.slice(6),d=String(e+1).padStart(3,`0`),f=String(r+1).padStart(3,`0`),p=`images/chapter-${d}-image-${f}.${u}`,m=`image-${d}-${f}`;c.contentHtml=c.contentHtml.replaceAll(`src="${l.path}"`,`src="${p}"`),n.push({id:m,path:p,mediaType:i,data:a})}catch{}}}let c=new Set(n.map(e=>e.path));for(let e of r)e.contentHtml=N(e.contentHtml,c);t(`Packaging EPUB…`);let l=new A;l.addFile(`mimetype`,`application/epub+zip`),l.addFile(`META-INF/container.xml`,T()),l.addFile(`OEBPS/styles.css`,E()),l.addFile(`OEBPS/nav.xhtml`,O(e,r));for(let e of r)l.addFile(`OEBPS/${e.path}`,D(e));l.addFile(`OEBPS/package.opf`,k(e,r,n));for(let e of n)l.addFile(`OEBPS/${e.path}`,e.data);return l.finish()}function F(e,t){let n=Array.from(t).map(e=>e.charCodeAt(0)<32?` `:e).join(``).replace(/[<>:"/\\|?*]/g,` `).replace(/\s+/g,` `).trim().slice(0,120)||`web-page`,r=new Blob([e.buffer],{type:`application/epub+zip`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`${n}.epub`,a.click(),window.setTimeout(()=>URL.revokeObjectURL(i),1e4)}var I=t(),L=10,R=3;function z(e){return e.images.reduce((e,t)=>
23{let n=t.url.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`);return e.replaceAll(`src="${t.path}"`,`src="${n}"`)},e.contentHtml)}function B(){let[e,t]=(0,i.useState)([{id:1,url:``,status:`idle`,message:``}]),[n,a]=(0,i.useState)(``),[o,s]=(0,i.useState)(``),[c,l]=(0,i.useState)(`idle`),[u,d]=(0,i.useState)(`Add up to 10 public article URLs to begin.`),f=(0,i.useRef)(2),p=(0,i.useRef)(null),m=e.flatMap(e=>e.article?[e.article]:[]);(0,i.useEffect)(()=>{if(c!==`ready`)return;let e=window.requestAnimationFrame(()=>{let e=p.current;if(!e)return;let t=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;e.scrollIntoView({behavior:t?`auto`:`smooth`,block:`start`}),e.focus({preventScroll:!0})});return()=>window.cancelAnimationFrame(e)},[c]);function h(e,n){t(t=>t.map(t=>t.id===e?{...t,...n}:t))}function g(n,r){let i=e.map(e=>e.id===n?{...e,url:r,status:`idle`,message:``,article:void 0}:e);t(i),i.some(e=>e.article)?(l(`ready`),d(`URL list changed. Create the preview again to refresh the book.`)):c!==`fetching`&&c!==`building`&&(l(`idle`),d(`Add up to 10 public article URLs to begin.`))}function _(){e.length>=L||(t([...e,{id:f.current,url:``,status:`idle`,message:``}]),f.current+=1)}function v(n){if(e.length===1)return;let r=e.filter(e=>e.id!==n);t(r);let i=r.flatMap(e=>e.article?[e.article]:[]);i.length===0?(l(`idle`),d(`Add up to 10 public article URLs to begin.`)):(l(`ready`),d(`${i.length} ${i.length===1?`chapter is`:`chapters are`} ready.`))}async function x(e){let t=`fetch`,n=`fetch_failed`;h(e.id,{status:`fetching`,message:`Reading page…`,article:void 0});try{let r=await fetch(`/api/fetch`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({url:e.url.trim(),kind:`document`})}),i=await r.json();if(!r.ok||!i.html||!i.url)throw n=r.ok?`invalid_response`:`http_${r.status}`,Error(i.error||`The page could not be loaded.`);t=`extract`,n=`extraction_failed`;let a=y(i.html,i.url),o={...e,status:`success`,message:a.title,article:a};return h(e.id,o),o}catch(r){let i=r instanceof Error?r.message:`The page could not be converted.`;b({pageUrl:e.url,errorStage:t,errorCode:n});let a={...e,status:`error`,message:i,article:void 0};return h(e.id,a),a}}async function S(n){n.preventDefault();let r=e.map(e=>({...e,url:e.url.trim(),status:`queued`,message:`Waiting…`,article:void 0}));t(r),l(`fetching`),d(`Reading ${r.length} ${r.length===1?`page`:`pages`}…`);let i=Array(r.length),o=0;async function c(){for(;o<r.length;){let e=o;o+=1,i[e]=await x(r[e])}}await Promise.all(Array.from({length:Math.min(R,r.length)},()=>c())),t(i);let u=i.flatMap(e=>e.article?[e.article]:[]),f=i.length-u.length;if(u.length===0){l(`error`),d(`None of the pages could be converted. Review the errors above and try again.`);return}a(e=>e.trim()?e:u.length===1?u[0].title:`Web Collection`);let p=[...new Set(u.map(e=>e.author).filter(Boolean))];s(e=>e.trim()?e:p.length===1?p[0]:``),l(`ready`),d(f?`${u.length} of ${i.length} chapters are ready. ${f} failed.`:`${u.length} ${u.length===1?`chapter is`:`chapters are`} ready.`)}async function C(){if(m.length!==0){l(`building`);try{F(await P({title:n,author:o,articles:m},d),n),l(`done`),d(`Your EPUB is ready.`)}catch{b({pageUrl:m[0].url,errorStage:`build`,errorCode:`epub_build_failed`}),l(`error`),d(`The EPUB could not be created. Please try again.`)}}}let w=c===`fetching`||c===`building`,T=m.reduce((e,t)=>e+t.textLength,0),E=m.reduce((e,t)=>e+t.images.length,0),D=c===`fetching`?`Reading`:c===`building`?`Building`:m.length?`Ready`:`Start`;return(0,I.jsxs)(`main`,{className:m.length?`has-article`:void 0,children:[(0,I.jsxs)(`nav`,{className:`topbar`,"aria-label":`Primary navigation`,children:[(0,I.jsxs)(r,{className:`brand`,href:`/`,"aria-label":`Web to EPUB home`,children:[(0,I.jsx)(`span`,{className:`brand-icon`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{children:`Web to EPUB`})]}),(0,I.jsxs)(`a`,{className:`extension-link`,href:`https://chromewebstore.google.com/detail/web-to-epub/iakajefkfcafdckgglehgikcglnblgom`,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(`span`,{className:`extension-dot`,"aria-hidden":`true`}),` Get the Chrome extension `,(0,I.jsx)(`span`,{"aria-hidden":`true`,children:`↗`})]})]}),(0,I.jsxs)(`section`,{className:`hero`,children:[(0,I.jsxs)(`div`,{className:`hero-copy`,children:[(0,I.jsxs)(`p`,{className:`eyebrow`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,children:`✦`}),` Public pages · Browser-based`]}),(0,I.jsxs)(`h1`,{children:[`Web to EPUB`,(0,I.jsx)(`br`,{}),(0,I.jsx)(`em`,{children:`online converter`})]}),(0,I.jsx)(`p`,{className:`lede`,children:`Convert a public web page to EPUB in seconds. Preview the article, edit the book details, and download a clean ebook for offline reading.`}),(0,I.jsxs)(`div`,{className:`trust-row`,"aria-label":`Highlights`,children:[(0,I.jsx)(`span`,{children:`✓ Reader-ready`}),(0,I.jsx)(`span`,{children:`✓ Images included`}),(0,I.jsx)(`span`,{children:`✓ Built in your browser`})]})]}),(0,I.jsxs)(`div`,{className:`converter-card`,children:[(0,I.jsxs)(`div`,{className:`format-flow`,"aria-hidden":`true`,children:[(0,I.jsxs)(`div`,{className:`browser-file`,children:[(0,I.jsxs)(`span`,{className:`browser-dots`,children:[(0,I.jsx)(`i`,{}),(0,I.jsx)(`i`,{}),(0,I.jsx)(`i`,{})]}),(0,I.jsx)(`b`,{children:`WEB`}),(0,I.jsx)(`span`,{className:`browser-lines`})]}),(0,I.jsx)(`span`,{className:`flow-arrow`,children:`→`}),(0,I.jsx)(`span`,{className:`flow-epub-file`})]}),(0,I.jsxs)(`div`,{className:`card-heading`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`p`,{children:`Online converter`}),(0,I.jsx)(`h2`,{children:`Create your ebook`})]}),(0,I.jsx)(`span`,{className:`live-badge`,children:D})]}),(0,I.jsxs)(`form`,{className:`url-form`,onSubmit:S,children:[(0,I.jsxs)(`fieldset`,{className:`url-fieldset`,children:[(0,I.jsx)(`legend`,{children:`Paste public article URLs`}),(0,I.jsx)(`div`,{className:`url-list`,children:e.map((t,n)=>(0,I.jsxs)(`div`,{className:`url-entry`,children:[(0,I.jsxs)(`div`,{className:`url-input-row`,children:[(0,I.jsx)(`span`,{className:`url-number`,"aria-hidden":`true`,children:n+1}),(0,I.jsx)(`input`,{id:`article-url-${t.id}`,"aria-label":`Article URL ${n+1}`,type:`url`,inputMode:`url`,required:!0,placeholder:`https://example.com/a-great-article`,value:t.url,onChange:e=>g(t.id,e.target.value),disabled:w}),e.length>1&&(0,I.jsx)(`button`,{className:`remove-url-button`,type:`button`,onClick:()=>v(t.id),disabled:w,"aria-label":`Remove article URL ${n+1}`,children:`Remove`})]}),t.status!==`idle`&&(0,I.jsxs)(`p`,{className:`url-status url-status-${t.status}`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,children:t.status===`success`?`✓`:t.status===`error`?`!`:`•`}),t.message]})]},t.id))}),(0,I.jsxs)(`div`,{className:`url-list-actions`,children:[(0,I.jsx)(`button`,{className:`add-url-button`,type:`button`,onClick:_,disabled:w||e.length>=L,children:`+ Add another URL`}),(0,I.jsxs)(`span`,{children:[e.length,` of `,L]})]})]}),(0,I.jsx)(`button`,{className:`submit-button`,type:`submit`,disabled:w,children:c===`fetching`?`Reading pages…`:(0,I.jsxs)(I.Fragment,{children:[`Create preview `,(0,I.jsx)(`span`,{"aria-hidden":`true`,children:`→`})]})}),(0,I.jsxs)(`p`,{className:`status ${c===`error`?`status-error`:``}`,role:`status`,children:[(0,I.jsx)(`span`,{className:`status-dot`,"aria-hidden":`true`}),u]})]})]})]}),m.length>0&&(0,I.jsxs)(`section`,{className:`workspace`,"aria-labelledby":`preview-title`,children:[(0,I.jsxs)(`div`,{className:`editor`,children:[(0,I.jsx)(`p`,{className:`section-label`,children:`Book details`}),(0,I.jsx)(`label`,{htmlFor:`book-title`,children:`Book title`}),(0,I.jsx)(`input`,{id:`book-title`,value:n,onChange:e=>a(e.target.value)}),(0,I.jsx)(`label`,{htmlFor:`book-author`,children:`Book author`}),(0,I.jsx)(`input`,{id:`book-author`,placeholder:`Unknown author`,value:o,onChange:e=>s(e.target.value)}),(0,I.jsxs)(`div`,{className:`facts`,children:[(0,I.jsxs)(`span`,{children:[m.length,` `,m.length===1?`chapter`:`chapters`]}
23),(0,I.jsxs)(`span`,{children:[T.toLocaleString(),` characters`]}),(0,I.jsxs)(`span`,{children:[E,` images found`]})]}),(0,I.jsxs)(`button`,{className:`download-button`,onClick:C,disabled:w||!n.trim(),children:[c===`building`?`Building your EPUB…`:`Download EPUB`,(0,I.jsx)(`span`,{"aria-hidden":`true`,children:`↓`})]})]}),(0,I.jsxs)(`article`,{ref:p,className:`preview`,tabIndex:-1,children:[(0,I.jsxs)(`div`,{className:`preview-head`,children:[(0,I.jsx)(`p`,{className:`section-label`,id:`preview-title`,children:`Full book preview`}),(0,I.jsxs)(`span`,{children:[m.length,` `,m.length===1?`chapter`:`chapters`]})]}),m.map((e,t)=>(0,I.jsxs)(`section`,{className:`preview-chapter`,"aria-labelledby":`chapter-title-${t}`,children:[(0,I.jsxs)(`p`,{className:`chapter-number`,children:[`Chapter `,t+1]}),(0,I.jsx)(`h2`,{id:`chapter-title-${t}`,children:e.title}),e.author&&(0,I.jsxs)(`p`,{className:`preview-author`,children:[`by `,e.author]}),(0,I.jsx)(`div`,{className:`article-content`,dangerouslySetInnerHTML:{__html:z(e)}})]},`${e.url}-${t}`))]})]}),m.length>0&&(0,I.jsx)(`div`,{className:`mobile-download-bar`,"aria-label":`EPUB download action`,children:(0,I.jsxs)(`button`,{className:`download-button`,onClick:C,disabled:w||!n.trim(),children:[c===`building`?`Building your EPUB…`:`Download EPUB`,(0,I.jsx)(`span`,{"aria-hidden":`true`,children:`↓`})]})}),(0,I.jsxs)(`section`,{className:`seo-content`,"aria-labelledby":`about-converter`,children:[(0,I.jsxs)(`div`,{className:`seo-intro`,children:[(0,I.jsx)(`p`,{className:`section-label`,children:`Webpage converter`}),(0,I.jsx)(`h2`,{id:`about-converter`,children:`Convert a webpage to EPUB online`}),(0,I.jsx)(`p`,{children:`Web to EPUB turns a public article or readable website page into a portable EPUB file. Paste a URL, review the extracted content, adjust the title or author, and download the finished file. The final ebook is assembled in your browser and is not uploaded or stored by this service.`})]}),(0,I.jsxs)(`div`,{className:`seo-grid`,children:[(0,I.jsxs)(`article`,{children:[(0,I.jsx)(`h3`,{children:`Website to EPUB in a few clicks`}),(0,I.jsx)(`p`,{children:`Use the online converter for public articles, essays, guides, tutorials, and other long-form pages. It keeps useful text and supported images while removing unrelated page clutter.`})]}),(0,I.jsxs)(`article`,{children:[(0,I.jsx)(`h3`,{children:`Clean HTML to EPUB conversion`}),(0,I.jsx)(`p`,{children:`The webpage is transformed into reader-friendly EPUB content with editable book details, navigation, and packaged images for a more comfortable offline reading experience.`})]}),(0,I.jsxs)(`article`,{children:[(0,I.jsx)(`h3`,{children:`Web to EPUB Chrome extension`}),(0,I.jsxs)(`p`,{children:[`Need to convert content already visible in a signed-in or highly dynamic tab? `,(0,I.jsx)(`a`,{href:`https://chromewebstore.google.com/detail/web-to-epub/iakajefkfcafdckgglehgikcglnblgom`,target:`_blank`,rel:`noreferrer`,children:`Get the Chrome extension`}),` and create the EPUB from the active page.`]})]})]}),(0,I.jsxs)(`div`,{className:`faq`,"aria-labelledby":`faq-title`,children:[(0,I.jsx)(`p`,{className:`section-label`,children:`Frequently asked questions`}),(0,I.jsx)(`h2`,{id:`faq-title`,children:`About the WebToEpub converter`}),(0,I.jsxs)(`details`,{children:[(0,I.jsx)(`summary`,{children:`What is WebToEpub?`}),(0,I.jsx)(`p`,{children:`WebToEpub is a browser-based webpage converter that turns the readable content of a public web page into a downloadable EPUB file.`})]}),(0,I.jsxs)(`details`,{children:[(0,I.jsx)(`summary`,{children:`How do I convert a web page to EPUB?`}),(0,I.jsx)(`p`,{children:`Paste a public page URL above, create a preview, edit the book title or author if needed, and select Download EPUB.`})]}),(0,I.jsxs)(`details`,{children:[(0,I.jsx)(`summary`,{children:`Can I convert signed-in or highly dynamic pages?`}),(0,I.jsx)(`p`,{children:`The web to EPUB online converter works with public pages. For content already visible in a signed-in or highly dynamic Chrome tab, use the extension instead.`})]})]})]}),(0,I.jsxs)(`footer`,{children:[(0,I.jsx)(`p`,{children:`© 2026 Webtoepub. Open source and free to use.`}),(0,I.jsx)(`p`,{className:`footer-links`,children:(0,I.jsx)(`a`,{href:`/privacy`,children:`Privacy Policy`})})]})]})}export{B as Converter};

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.