PageSourceSearch

https://to-md.org/assets/markdown-editor-NTm__3A9.js

js to-md.org collected 2026-10-08 08:31:20 UTC 26,933 bytes, 207 lines download raw bytes

1import{Lg as e,Ug as t,zg as n}from"./messages-B7vy2gX4.js";import{a as r,i,n as a,r as o,t as s}from"./list-ordered-CUQgRH0X.js";import{t as c}from"./clipboard-BrK7kAuP.js";import{t as l}from"./copy-CRdY-fFR.js";import{t as u}from"./download-7OtECDDf.js";import{t as ee}from"./eye-DcWyXIUS.js";import{t as d}from"./file-text-S5FBMYk7.js";import{t as f}from"./list-CC5BnVj-.js";import{t as p}from"./rotate-ccw-DgQIthHt.js";import{t as te}from"./save-DV-ceLft.js";import{t as ne}from"./table-2-C5J_NWZ7.js";import{t as m}from"./upload-B_6mcJWH.js";import{d as h}from"./index-CI4CH93Q.js";import{t as g}from"./utils-DXalBF5w.js";import{t as _}from"./button-scB-LEnO.js";import{t as v}from"./markdown-it-kY7O9_Eu.js";import{t as re}from"./textarea-BaW6AHDA.js";var y=h(`heading-1`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`m17 12 3-2v8`,key:`1hhhft`}]]),ie=h(`layout-panel-left`,[[`rect`,{width:`7`,height:`18`,x:`3`,y:`3`,rx:`1`,key:`2obqm`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}]]),ae=h(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),oe=h(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),se=h(`printer`,[[`path`,{d:`M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2`,key:`143wyd`}],[`path`,{d:`M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6`,key:`1itne7`}],[`rect`,{x:`6`,y:`14`,width:`12`,height:`8`,rx:`1`,key:`1ue0tg`}]]),b=t(n(),1),x=e(),S=`# TO MD Markdown to PDF - Feature Guide
2
3**TO MD** helps you turn Markdown into a clean, PDF-ready document in your browser. Paste Markdown on the left, review the live preview on the right, then use **Download PDF** or **Save as PDF** when the document is ready.
4
5> Try it now: edit this example, switch templates, and export a polished document without uploading your Markdown to a server.
6
7---
8
9## 1. Real-time Markdown Preview
10
11The editor renders your Markdown as you type, so you can check structure before exporting:
12
13- Headings from \`# H1\` to \`###### H6\`
14- Paragraphs, links, emphasis, lists and blockquotes
15- Tables for comparison data
16- Fenced code blocks for technical notes
17- Clean PDF-style page preview
18
19### Heading Hierarchy
20
21Use headings to make long documents scannable. TO MD keeps title, section and subsection levels visually distinct in the preview.
22
23---
24
25## 2. PDF-ready Templates
26
27Choose a visual style before exporting:
28
29| Template | Best For |
30| --- | --- |
31| GitHub Style | README files, changelogs, developer docs |
32| Clean | General writing, notes, lightweight reports |
33| Business | Proposals, internal updates, client documents |
34| Academic | Essays, research notes, long-form drafts |
35| Modern | Product briefs, planning documents |
36| Minimal | Simple documents that should stay quiet |
37
38---
39
40## 3. Markdown Elements
41
42### Lists
43
441. Paste or write Markdown.
452. Check the live preview.
463. Pick a template.
474. Export through the browser print dialog.
48
49### Code Blocks
50
51\`\`\`ts
52type DocumentFormat = "markdown" | "html" | "pdf";
53
54function describeExport(format: DocumentFormat) {
55  return "Export target: " + format;
56}
57\`\`\`
58
59\`\`\`bash
60pnpm build
61pnpm dev
62\`\`\`
63
64### Tables
65
66| Feature | Available |
67| --- | --- |
68| Live Markdown preview | Yes |
69| Save Markdown file | Yes |
70| Copy rendered HTML | Yes |
71| Browser-based PDF export | Yes |
72| Account required | No |
73
74---
75
76## 4. Privacy-first Workflow
77
78Markdown editing and previewing happen locally in your browser. That makes TO MD useful for:
79
80- Internal notes and product specs
81- Client-facing reports
82- AI prompt context cleanup
83- Documentation drafts
84- Meeting notes and research summaries
85
86No sign-up is required for the Markdown workspace.
87
88---
89
90## 5. More TO MD Tools
91
92TO MD is being built as a practical Markdown conversion toolbox:
93
94- Markdown to PDF
95- PDF to Markdown
96- Word to Markdown
97- Image to Markdown
98- HTML to Markdown
99- JSON to Markdown
100
101Use the homepage upload area when your source starts as a file. TO MD detects the file type and opens the matching workspace.
102
103---
104
105_Generated with TO MD - a free Markdown converter for PDF-ready documents, structured text and browser-based workflows._
106`,ce=new v({html:!1,linkify:!0,typographer:!0});function le(e){return e.replace(/^(\s{0,3}#{1,6})([^\s#].*)$/gm,`$1 $2`)}var C=[{id:`github`,page:`font-sans text-[#24292f]`,content:`[&_h1]:border-[#d0d7de] [&_h1]:text-[#1f2328] [&_h2]:border-[#d0d7de] [&_h2]:text-[#1f2328] [&_a]:text-[#0969da] [&_blockquote]:border-[#d0d7de] [&_blockquote]:text-[#57606a] [&_code]:bg-[#afb8c133] [&_pre]:bg-[#f6f8fa] [&_pre]:text-[#24292f] [&_th]:bg-[#f6f8fa]`},{id:`clean`,page:`font-serif text-[#172033]`,content:`[&_h1]:border-primary/30 [&_h1]:font-serif [&_h1]:text-primary [&_h2]:font-serif [&_h2]:text-[#172033] [&_a]:text-primary [&_blockquote]:border-primary/30 [&_blockquote]:bg-primary/5 [&_code]:bg-primary/10 [&_pre]:bg-[#172033] [&_pre]:text-[#f8fafc] [&_th]:bg-primary/10`},{id:`business`,page:`font-sans text-[#172033]`,content:`[&_h1]:border-[#f59e0b] [&_h1]:text-[#1d4ed8] [&_h2]:text-[#1d4ed8] [&_h3]:text-[#334155] [&_a]:text-[#1d4ed8] [&_blockquote]:border-[#f59e0b] [&_blockquote]:bg-[#fffbeb] [&_code]:bg-[#eaf1ff] [&_pre]:bg-[#172033] [&_pre]:text-white [&_th]:bg-[#eaf1ff]`},{id:`academic`,page:`font-serif text-[#202223]`,content:`[&_h1]:border-[#202223] [&_h1]:text-[#202223] [&_h2]:text-[#202223] [&_a]:text-[#1d4ed8] [&_blockquote]:border-[#202223] [&_blockquote]:bg-transparent [&_blockquote]:italic [&_code]:bg-[#f2f2ef] [&_pre]:bg-[#202223] [&_pre]:text-white [&_th]:bg-[#f2f2ef]`},{id:`modern`,page:`font-sans text-[#172033]`,content:`[&_h1]:border-transparent [&_h1]:text-primary [&_h2]:text-[#172033] [&_h3]:text-primary [&_a]:text-primary [&_blockquote]:border-primary [&_blockquote]:bg-primary/10 [&_code]:bg-primary/10 [&_pre]:bg-[#0f1a2e] [&_pre]:text-[#eaf1ff] [&_th]:bg-primary/10`},{id:`minimal`,page:`font-sans text-[#2d3333]`,content:`[&_h1]:border-border [&_h1]:text-[#2d3333] [&_h2]:text-[#2d3333] [&_a]:text-primary [&_blockquote]:border-muted-foreground/40 [&_blockquote]:bg-transparent [&_code]:bg-muted [&_pre]:bg-muted [&_pre]:text-foreground [&_th]:bg-muted`}],w={github:{fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif`,text:`#24292f`,heading:`#1f2328`,accent:`#0969da`,border:`#d0d7de`,muted:`#57606a`,codeBackground:`#f6f8fa`,codeText:`#24292f`,tableHead:`#f6f8fa`},clean:{fontFamily:`Georgia, 'Times New Roman', 'Noto Serif SC', serif`,text:`#172033`,heading:`#1d4ed8`,accent:`#1d4ed8`,border:`#bfd0ea`,muted:`#5b667a`,codeBackground:`#eaf1ff`,codeText:`#172033`,tableHead:`#eaf1ff`},business:{fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif`,text:`#172033`,heading:`#1d4ed8`,accent:`#f59e0b`,border:`#d7e2f2`,muted:`#5b667a`,codeBackground:`#172033`,codeText:`#f8fafc`,tableHead:`#eaf1ff`},academic:{fontFamily:`Georgia, 'Times New Roman', 'Noto Serif SC', serif`,text:`#202223`,heading:`#202223`,accent:`#202223`,border:`#c9c7c1`,muted:`#5f625f`,codeBackground:`#f2f2ef`,codeText:`#202223`,tableHead:`#f2f2ef`},modern:{fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif`,text:`#172033`,heading:`#1d4ed8`,accent:`#1d4ed8`,border:`#c7d8f6`,muted:`#5b667a`,codeBackground:`#0f1a2e`,codeText:`#eaf1ff`,tableHead:`#eaf1ff`},minimal:{fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif`,text:`#2d3333`,heading:`#2d3333`,accent:`#1d4ed8`,border:`#d7e2f2`,muted:`#606a74`,codeBackground:`#eef4ff`,codeText:`#2d3333`,tableHead:`#eef4ff`}};function ue(e,t){let n=w[t];return`<!doctype html>
107<html>
108<head>
109  <meta charset="utf-8" />
110  <meta name="viewport" content="width=device-width, initial-scale=1" />
111  <title>TO MD PDF Export</title>
112  <style>
113    @page { size: Letter; margin: 0.55in; }
114    * { box-sizing: border-box; }
115    html, body {
116      margin: 0;
117      background: #ffffff;
118      color: ${n.text};
119      font-family: ${n.fontFamily};
120      font-size: 15px;
121      line-height: 1.7;
122      -webkit-print-color-adjust: exact;
123      print-color-adjust: exact;
124    }
125    body { padding: 0.55in; }
126    h1, h2, h3, h4, h5, h6 {
127      color: ${n.heading};
128      break-after: avoid;
129      page-break-after: avoid;
130    }
131    h1 {
132      margin: 0 0 1rem;
133      padding-bottom: 0.75rem;
134      border-bottom: 1px solid ${n.border};
135      font-size: 2rem;
136      line-height: 1.18;
137      font-weight: 700;
138    }
139    h2 {
140      margin: 1.65rem 0 0.75rem;
141      padding-bottom: 0.5rem;
142      border-bottom: 1px solid ${n.border};
143      font-size: 1.55rem;
144      line-height: 1.25;
145      font-weight: 650;
146    }
147    h3 { margin: 1.45rem 0 0.5rem; font-size: 1.25rem; line-height: 1.3; font-weight: 650; }
148    h4 { margin: 1.25rem 0 0.45rem; font-size: 1.125rem; line-height: 1.35; font-weight: 650; }
149    h5 { margin: 1.1rem 0 0.35rem; font-size: 1rem; line-height: 1.4; font-weight: 650; }
150    h6 { margin: 1rem 0 0.3rem; color: ${n.muted}; font-size: 0.875rem; line-height: 1.45; font-weight: 650; }
151    p { margin: 1rem 0; }
152    a { color: ${n.accent}; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; }
153    blockquote {
154      margin: 1.25rem 0;
155      padding: 0.5rem 0.75rem 0.5rem 1rem;
156      border-left: 4px solid ${n.accent};
157      background: ${n.tableHead};
158      color: ${n.muted};
159      break-inside: avoid;
160      page-break-inside: avoid;
161    }
162    ul, ol { margin: 1rem 0; padding-left: 1.5rem; }
163    li { margin: 0.25rem 0; }
164    hr { margin: 1.5rem 0; border: 0; border-top: 1px solid ${n.border}; }
165    code {
166      border-radius: 0.375rem;
167      background: ${n.codeBackground};
168      padding: 0.125rem 0.375rem;
169      color: ${n.codeText};
170      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
171      font-size: 0.86em;
172    }
173    pre {
174      margin: 1.25rem 0;
175      overflow: auto;
176      border-radius: 0.5rem;
177      background: ${n.codeBackground};
178      padding: 1rem;
179      color: ${n.codeText};
180      white-space: pre-wrap;
181      break-inside: avoid;
182      page-break-inside: avoid;
183    }
184    pre code { background: transparent; padding: 0; color: inherit; }
185    table { margin: 1.25rem 0; width: 100%; border-collapse: collapse; break-inside: auto; }
186    thead { display: table-header-group; }
187    tr { break-inside: avoid; page-break-inside: avoid; }
188    th, td { border: 1px solid ${n.border}; padding: 0.5rem 0.75rem; text-align: left; vertical-align: top; }
189    th { background: ${n.tableHead}; font-weight: 650; }
190    img { max-width: 100%; height: auto; break-inside: avoid; page-break-inside: avoid; }
191    @media screen { body { min-height: 11in; } }
192    @media print { body { padding: 0; } }
193  </style>
194</head>
195<body>
196  ${e}
197</body>
198</html>`}function T({labels:e,className:t,initialStorageKey:n,initialMarkdown:r,exampleMarkdown:i,loadExampleOnMount:a=!1,fileAccept:o=`.md,.markdown,.txt,text/markdown,text/plain`,onSourceFile:s,onLoadExample:c,sourceAddon:l}){return typeof window>`u`?(0,x.jsx)(O,{labels:e,className:t}):(0,x.jsx)(E,{labels:e,className:t,initialStorageKey:n,initialMarkdown:r,exampleMarkdown:i,loadExampleOnMount:a,fileAccept:o,onSourceFile:s,onLoadExample:c,sourceAddon:l})}function E({labels:e,className:t,initialStorageKey:n,initialMarkdown:h,exampleMarkdown:v,loadExampleOnMount:w,fileAccept:T,onSourceFile:E,onLoadExample:de,sourceAddon:k}){let[fe,pe]=(0,b.useState)(!1),[A,j]=(0,b.useState)(``),[M,N]=(0,b.useState)(`write`),[P,F]=(0,b.useState)(`split`),[I,me]=(0,b.useState)(`github`),[L,R]=(0,b.useState)(!1),[z,he]=(0,b.useState)(!1),[B,V]=(0,b.useState)(``),H=(0,b.useRef)(null),U=(0,b.useRef)(null),W=(0,b.useRef)(null);(0,b.useEffect)(()=>{let e=!1;if(n){let t=sessionStorage.getItem(n);t&&(j(t),e=!0,sessionStorage.removeItem(n),sessionStorage.removeItem(`to-md.initialFileName`))}e||(h===void 0?w&&j(v||S):j(h)),pe(!0)},[v,h,n,w]),(0,b.useEffect)(()=>(document.body.classList.toggle(`overflow-hidden`,z),()=>document.body.classList.remove(`overflow-hidden`)),[z]);let G=(0,b.useMemo)(()=>ce.render(le(A)),[A]),K=C.find(e=>e.id===I)??C[0],ge={github:e.templateGithub,clean:e.templateClean,business:e.templateBusiness,academic:e.templateAcademic,modern:e.templateModern,minimal:e.templateMinimal};if(!fe)return(0,x.jsx)(O,{labels:e,className:t});function q(e,t){requestAnimationFrame(()=>{U.current?.focus(),U.current?.setSelectionRange(e,t)})}function J(e,t=e,n=`text`){let r=U.current;if(!r){j(r=>`${r}${e}${n}${t}`);return}let i=r.selectionStart,a=r.selectionEnd,o=A.slice(i,a)||n;j(`${A.slice(0,i)}${e}${o}${t}${A.slice(a)}`),q(i+e.length,i+e.length+o.length)}function Y(e){let t=U.current;if(!t){j(t=>`${t.trimEnd()}\n\n${`#`.repeat(e)} Heading`.trimStart());return}let n=t.selectionStart,r=t.selectionEnd,i=A.lastIndexOf(`
199`,Math.max(0,n-1))+1,a=A.indexOf(`
200`,r),o=a===-1?A.length:a,s=A.slice(i,o).replace(/^#{1,6}\s*/,``),c=`${`#`.repeat(e)} ${s||`Heading`}`;j(`${A.slice(0,i)}${c}${A.slice(o)}`),q(i+e+1,i+c.length)}function X(e=!1){let t=U.current,n=`List item`;if(!t){j(t=>`${t.trimEnd()}\n\n${e?`1.`:`-`} ${n}`.trimStart());return}let r=t.selectionStart,i=t.selectionEnd,a=(A.slice(r,i)||n).split(`
201`).map((t,n)=>`${e?`${n+1}.`:`-`} ${t.replace(/^([-*]|\d+\.)\s+/,``)}`).join(`
202`);j(`${A.slice(0,r)}${a}${A.slice(i)}`),q(r,r+a.length)}function _e(){let e=U.current,t=e?.selectionStart??A.length;j(`${A.slice(0,t)}
203
204| Column | Value |
205| --- | --- |
206| Example | Ready |
207${A.slice(e?.selectionEnd??t)}`),q(t+2,t+55)}async function ve(){let e=await navigator.clipboard.readText();e&&j(t=>t?`${t}\n${e}`:e)}function ye(){let e=v||S;de?.({markdown:e,setMarkdown:j,setActiveView:N}),j(e),N(`preview`)}function be(){V(A),j(``)}function xe(){B&&(j(B),V(``))}function Se(){if(!A.trim())return;let e=new Blob([A],{type:`text/markdown;charset=utf-8`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`to-md-document.md`,n.click(),URL.revokeObjectURL(t)}async function Ce(){G.trim()&&await navigator.clipboard.writeText(G)}function Z(){if(!A.trim())return;let t=document.body.style.overflow,n=document.createElement(`div`);
207n.style.position=`fixed`,n.style.inset=`0`,n.style.zIndex=`80`,n.style.display=`flex`,n.style.flexDirection=`column`,n.style.background=`#525659`;let r=document.createElement(`div`);r.style.minHeight=`76px`,r.style.display=`flex`,r.style.alignItems=`center`,r.style.justifyContent=`center`,r.style.gap=`12px`,r.style.padding=`12px 20px`,r.style.background=`#323639`,r.style.boxShadow=`0 2px 4px rgba(0,0,0,0.2)`;let i=document.createElement(`button`);i.type=`button`,i.innerText=e.printPdf,i.style.minHeight=`42px`,i.style.border=`0`,i.style.borderRadius=`6px`,i.style.background=`#1d4ed8`,i.style.color=`#ffffff`,i.style.cursor=`pointer`,i.style.fontWeight=`700`,i.style.padding=`0 24px`;let a=document.createElement(`button`);a.type=`button`,a.innerText=e.cancel,a.style.minHeight=`42px`,a.style.border=`1px solid #f59e0b`,a.style.borderRadius=`6px`,a.style.background=`transparent`,a.style.color=`#f59e0b`,a.style.cursor=`pointer`,a.style.fontWeight=`700`,a.style.padding=`0 24px`,r.append(i,a);let o=document.createElement(`div`);o.style.flex=`1`,o.style.overflow=`auto`,o.style.display=`flex`,o.style.justifyContent=`center`,o.style.padding=`40px 16px`;let s=document.createElement(`iframe`);s.title=`TO MD PDF preview`,s.style.width=`8.5in`,s.style.maxWidth=`calc(100vw - 32px)`,s.style.minHeight=`11in`,s.style.border=`0`,s.style.background=`#ffffff`,s.style.boxShadow=`0 0 12px rgba(0,0,0,0.35)`,o.append(s),n.append(r,o),document.body.append(n),document.body.style.overflow=`hidden`;let c=()=>{n.remove(),document.body.style.overflow=t,document.removeEventListener(`keydown`,l)},l=e=>{e.key===`Escape`&&c()};a.addEventListener(`click`,c),document.addEventListener(`keydown`,l),i.addEventListener(`click`,()=>{s.contentWindow?.focus(),s.contentWindow?.print()});let u=s.contentDocument??s.contentWindow?.document;u&&(u.open(),u.write(ue(G,I)),u.close(),window.setTimeout(()=>{let e=u.body?.scrollHeight??0;s.style.height=`${Math.max(e+40,920)}px`},100))}let Q={markdown:A,setMarkdown:j,setActiveView:N};async function $(e){if(E){let t=await E(e,Q);typeof t==`string`&&(j(t),N(`preview`));return}j(await e.text()),N(`preview`)}function we(e){let t=e.target.files?.[0];t&&$(t),e.target.value=``}function Te(e){e.preventDefault(),R(!1);let t=e.dataTransfer.files?.[0];t&&$(t)}function Ee(e){let t=e.currentTarget,n=W.current;if(!n)return;let r=t.scrollHeight-t.clientHeight,i=n.scrollHeight-n.clientHeight;r<=0||i<=0||(n.scrollTop=t.scrollTop/r*i)}let De=(0,x.jsxs)(`div`,{className:`flex min-h-[620px] flex-col border-border bg-background lg:border-r`,children:[(0,x.jsxs)(`div`,{className:`flex h-11 items-center justify-between border-b border-border px-4`,children:[(0,x.jsx)(`span`,{className:`text-sm font-medium`,children:e.editorLabel}),(0,x.jsx)(`span`,{className:`hidden text-xs text-muted-foreground sm:inline`,children:e.write})]}),(0,x.jsxs)(`div`,{className:`flex flex-col gap-2 border-b border-border bg-muted/30 p-2 print:hidden`,children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,x.jsx)(D,{label:e.bold,onClick:()=>J(`**`,`**`,`bold`),children:(0,x.jsx)(r,{className:`size-4`})}),(0,x.jsx)(D,{label:e.italic,onClick:()=>J(`*`,`*`,`italic`),children:(0,x.jsx)(a,{className:`size-4`})}),(0,x.jsx)(D,{label:`H1`,onClick:()=>Y(1),children:(0,x.jsx)(y,{className:`size-4`})}),(0,x.jsx)(D,{label:`H2`,onClick:()=>Y(2),children:(0,x.jsx)(i,{className:`size-4`})}),(0,x.jsx)(D,{label:`H3`,onClick:()=>Y(3),children:(0,x.jsx)(o,{className:`size-4`})}),(0,x.jsx)(D,{label:e.bulletList,onClick:()=>X(!1),children:(0,x.jsx)(f,{className:`size-4`})}),(0,x.jsx)(D,{label:e.numberedList,onClick:()=>X(!0),children:(0,x.jsx)(s,{className:`size-4`})}),(0,x.jsx)(D,{label:e.table,onClick:_e,children:(0,x.jsx)(ne,{className:`size-4`})})]}),(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,x.jsx)(`input`,{ref:H,type:`file`,accept:T,className:`sr-only`,onChange:we}),(0,x.jsxs)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-8 gap-1.5`,onClick:()=>H.current?.click(),children:[(0,x.jsx)(m,{className:`size-4`}),e.browse]}),(0,x.jsxs)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-8 gap-1.5`,onClick:ye,children:[(0,x.jsx)(d,{className:`size-4`}),e.loadExample]}),(0,x.jsxs)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-8 gap-1.5`,onClick:()=>void ve(),children:[(0,x.jsx)(c,{className:`size-4`}),e.paste]}),(0,x.jsxs)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-8 gap-1.5`,onClick:be,disabled:!A,children:[(0,x.jsx)(p,{className:`size-4`}),e.clear]}),(0,x.jsxs)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-8 gap-1.5`,onClick:xe,disabled:!B,children:[(0,x.jsx)(p,{className:`size-4`}),e.undo]})]})]}),k?k(Q):null,(0,x.jsxs)(`button`,{type:`button`,className:g(`flex min-h-9 items-center justify-center gap-2 rounded-md border border-dashed border-border bg-background px-3 py-1.5 text-center text-xs text-muted-foreground transition-colors hover:bg-primary/5`,L&&`bg-primary/10 text-primary`),onClick:()=>H.current?.click(),children:[(0,x.jsx)(m,{className:`size-4`}),(0,x.jsx)(`span`,{className:`font-medium text-foreground`,children:e.dropTitle})]})]}),(0,x.jsx)(re,{ref:U,value:A,onChange:e=>j(e.target.value),onScroll:Ee,placeholder:e.placeholder,spellCheck:!1,className:`min-h-[430px] flex-1 resize-none rounded-none border-0 bg-background p-5 font-mono text-[14px] leading-7 shadow-none outline-none focus-visible:ring-0`})]}),Oe=(0,x.jsxs)(`div`,{className:`flex min-h-[620px] flex-col bg-[#f1f5ff]`,children:[(0,x.jsxs)(`div`,{className:`flex flex-col gap-2 border-b border-border bg-background p-2 print:hidden`,children:[(0,x.jsxs)(`div`,{className:`flex min-h-9 flex-wrap items-center justify-between gap-2`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsx)(`span`,{className:`text-sm font-medium`,children:e.previewLabel}),(0,x.jsx)(`span`,{className:`hidden text-xs text-muted-foreground sm:inline`,children:e.printHint})]}),(0,x.jsxs)(`label`,{className:`inline-flex h-8 items-center gap-2 rounded-md border border-border bg-background px-2.5 text-sm`,children:[(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:e.template}),(0,x.jsx)(`select`,{value:I,onChange:e=>me(e.target.value),className:`bg-transparent text-sm font-medium outline-none`,children:C.map(e=>(0,x.jsx)(`option`,{value:e.id,children:ge[e.id]},e.id))})]})]}),(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1.5`,children:[(0,x.jsxs)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-8 gap-1.5`,onClick:Se,disabled:!A.trim(),children:[(0,x.jsx)(te,{className:`size-4`}),e.saveMarkdown]}),(0,x.jsxs)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-8 gap-1.5`,onClick:()=>void Ce(),disabled:!A.trim(),children:[(0,x.jsx)(l,{className:`size-4`}),e.copyHtml]}),(0,x.jsxs)(_,{type:`button`,size:`sm`,className:`h-8 gap-1.5`,onClick:Z,disabled:!A.trim(),children:[(0,x.jsx)(u,{className:`size-4`}),e.downloadPdf]}),(0,x.jsxs)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-8 gap-1.5`,onClick:Z,disabled:!A.trim(),children:[(0,x.jsx)(se,{className:`size-4`}),e.printPdf]}),(0,x.jsx)(D,{label:z?e.exitFullscreen:e.fullscreen,onClick:()=>he(e=>!e),children:z?(0,x.jsx)(oe,{className:`size-4`}):(0,x.jsx)(ae,{className:`size-4`})})]})]}),(0,x.jsx)(`div`,{ref:W,className:`flex-1 overflow-auto p-4 sm:p-6`,children:(0,x.jsx)(`article`,{className:g(`mx-auto min-h-[720px] max-w-[760px] bg-white px-7 py-8 shadow-xl shadow-black/10 ring-1 ring-black/5 sm:px-10 sm:py-12`,K.page),
207children:A.trim()?(0,x.jsx)(`div`,{className:g(`markdown-preview-content`,K.content),dangerouslySetInnerHTML:{__html:G}}):(0,x.jsx)(`div`,{className:`flex min-h-[560px] items-center justify-center text-center text-sm text-muted-foreground`,children:e.emptyPreviewPdf})})})]});return(0,x.jsxs)(`div`,{id:`editor`,className:g(`w-full overflow-hidden rounded-lg border border-border bg-card shadow-2xl shadow-foreground/5 print:shadow-none`,z&&`fixed inset-3 z-50 flex flex-col bg-card`,t),onDragOver:e=>{e.preventDefault(),R(!0)},onDragLeave:()=>R(!1),onDrop:Te,children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 border-b border-border bg-muted/30 px-3 py-2 print:hidden`,children:[(0,x.jsxs)(`div`,{className:`inline-flex rounded-md border border-border bg-background p-1 lg:hidden`,children:[(0,x.jsxs)(_,{type:`button`,size:`sm`,variant:M===`write`?`default`:`ghost`,className:`h-8 rounded px-3`,onClick:()=>N(`write`),children:[(0,x.jsx)(d,{className:`size-4`}),e.write]}),(0,x.jsxs)(_,{type:`button`,size:`sm`,variant:M===`preview`?`default`:`ghost`,className:`h-8 rounded px-3`,onClick:()=>N(`preview`),children:[(0,x.jsx)(ee,{className:`size-4`}),e.preview]})]}),(0,x.jsxs)(`div`,{className:`hidden items-center rounded-md border border-border bg-background p-1 lg:inline-flex`,children:[(0,x.jsxs)(_,{type:`button`,size:`sm`,variant:P===`split`?`default`:`ghost`,className:`h-7 rounded px-2.5`,onClick:()=>F(`split`),children:[(0,x.jsx)(ie,{className:`size-4`}),e.split]}),(0,x.jsxs)(_,{type:`button`,size:`sm`,variant:P===`focus`?`default`:`ghost`,className:`h-7 rounded px-2.5`,onClick:()=>F(`focus`),children:[(0,x.jsx)(d,{className:`size-4`}),e.focus]})]}),(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:P===`split`?e.split:e.focus})]}),(0,x.jsxs)(`div`,{className:g(`grid flex-1 print:block`,P===`split`?`lg:grid-cols-[minmax(0,0.95fr)_minmax(0,1.05fr)]`:`lg:grid-cols-1`),children:[(0,x.jsx)(`div`,{className:g(M===`preview`&&`hidden lg:block`),children:De}),(0,x.jsx)(`div`,{className:g(M===`write`&&`hidden lg:block`,P===`focus`&&`lg:hidden`),children:Oe})]})]})}function D({label:e,children:t,onClick:n}){return(0,x.jsx)(_,{type:`button`,size:`icon`,variant:`outline`,className:`size-8 shrink-0`,title:e,"aria-label":e,onClick:n,children:t})}function O({labels:e,className:t}){return(0,x.jsxs)(`div`,{id:`editor`,className:g(`w-full overflow-hidden rounded-lg border border-border bg-card shadow-2xl shadow-foreground/5`,t),children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-b border-border bg-muted/30 p-3`,children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,x.jsx)(`span`,{className:`inline-flex size-8 items-center justify-center rounded-md border border-border bg-background`,children:(0,x.jsx)(r,{className:`size-4`})}),(0,x.jsx)(`span`,{className:`inline-flex size-8 items-center justify-center rounded-md border border-border bg-background`,children:(0,x.jsx)(a,{className:`size-4`})}),(0,x.jsx)(`span`,{className:`inline-flex size-8 items-center justify-center rounded-md border border-border bg-background`,children:(0,x.jsx)(y,{className:`size-4`})}),(0,x.jsx)(`span`,{className:`inline-flex size-8 items-center justify-center rounded-md border border-border bg-background`,children:(0,x.jsx)(f,{className:`size-4`})}),(0,x.jsx)(`span`,{className:`inline-flex h-8 items-center rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground`,children:e.downloadPdf})]}),(0,x.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[e.template,`: `,e.templateGithub]})]}),(0,x.jsxs)(`div`,{className:`border-b border-dashed border-border bg-background px-4 py-3 text-center`,children:[(0,x.jsx)(m,{className:`mx-auto mb-1 size-5 text-muted-foreground`}),(0,x.jsx)(`p`,{className:`text-sm font-medium`,children:e.dropTitle}),(0,x.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e.dropDescription})]}),(0,x.jsxs)(`div`,{className:`grid min-h-[620px] lg:grid-cols-[minmax(0,0.95fr)_minmax(0,1.05fr)]`,children:[(0,x.jsxs)(`div`,{className:`border-border bg-background lg:border-r`,children:[(0,x.jsx)(`div`,{className:`flex h-11 items-center border-b border-border px-4 text-sm font-medium`,children:e.editorLabel}),(0,x.jsx)(`div`,{className:`min-h-[576px] p-5 text-left font-mono text-sm leading-7 text-muted-foreground`,children:e.placeholder})]}),(0,x.jsxs)(`div`,{className:`bg-[#f1f5ff]`,children:[(0,x.jsx)(`div`,{className:`flex h-11 items-center border-b border-border bg-background px-4 text-sm font-medium`,children:e.previewLabel}),(0,x.jsx)(`div`,{className:`p-6`,children:(0,x.jsx)(`article`,{className:`mx-auto min-h-[560px] max-w-[760px] bg-white px-10 py-12 text-center text-sm text-muted-foreground shadow-xl shadow-black/10 ring-1 ring-black/5`,children:e.emptyPreviewPdf})})]})]})]})}export{T as t};

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.