import{n as l,b as r,e as m}from"./vendor-lit-B2r-dKc0.js";import{aC as $,aD as x,aE as g,aH as u}from"./app-session-runtime-CeFJDILJ.js";import{p as s}from"./vendor-lucide-B9Yl1Gez.js";import{T as f}from"./vendor-typebox-DJ_ZScJ4.js";import"./vendor-mini-lit-CpUQub-j.js";import"./vendor-marked-_iteVaMm.js";import"./app-review-C3CmcSYC.js";import"./app-panel-workspace-C3XDRCgE.js";import"./app-routing-C_r2pdnC.js";import"./app-message-reducer-wATqnZGf.js";import"./vendor-sortable-B1o3v0Qs.js";import"./app-inbox-CaZD85aD.js";import"./app-pr-walkthrough-WipZACSB.js";f.Object({url:f.String({description:"URL of the document to extract text from (PDF, DOCX, or PPTX)"})});const E={render(o,t,p){const a=$(t,p),i=m(),d=m();if(t&&o){const e=t.details,v=e?t.isError?`Failed to extract ${e.fileName||"document"}`:`Extracted text from ${e.fileName} (${e.format.toUpperCase()}, ${(e.size/1024).toFixed(1)}KB)`:t.isError?"Failed to extract document":"Extracted text from document",n=t.content?.filter(c=>c.type==="text").map(c=>c.text).join(`
`)||"";return{content:r`
					<div>
						${x(a,s,v,i,d,!1)}
						<div ${l(i)} class="max-h-0 overflow-hidden transition-all duration-300 space-y-3">
							${o.url?r`<div class="text-sm text-gray-600 dark:text-gray-400">
										<strong>URL:</strong> ${o.url}
								  </div>`:""}
							${n&&!t.isError?r`<code-block .code=${n} language="plaintext"></code-block>`:""}
							${t.isError&&n?r`<console-block .content=${n} .variant=${"error"}></console-block>`:""}
						</div>
					</div>
				`,isCustom:!1}}return o?{content:r`
					<div>
						${x(a,s,"Extracting document...",i,d,!1)}
						<div ${l(i)} class="max-h-0 overflow-hidden transition-all duration-300">
							<div class="text-sm text-gray-600 dark:text-gray-400"><strong>URL:</strong> ${o.url}</div>
						</div>
					</div>
				`,isCustom:!1}:{content:g(a,s,"Preparing extraction..."),isCustom:!1}}};u("extract_document",E);export{E as extractDocumentRenderer};
