1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9348],{4068:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>c});var a=t(7876),r=t(4232),n=t(38),l=t.n(n),i=t(4704),o=t(1895),d=t(6107);let c=()=>{let[e,s]=(0,r.useState)([]),[t,n]=(0,r.useState)(""),[c,m]=(0,r.useState)(!1),[u,h]=(0,r.useState)(!0),g=(0,r.useRef)(null),x=(0,r.useRef)(null);(0,r.useEffect)(()=>{"light"===localStorage.getItem("darkMode")?(h(!1),document.documentElement.classList.remove("dark-mode")):(h(!0),document.documentElement.classList.add("dark-mode"))},[]),(0,r.useEffect)(()=>{x.current&&x.current.scrollIntoView({behavior:"smooth"})},[e]);let j=async t=>{m(!0);let a=[...e,{role:"user",content:t}];s(a);try{let e=await fetch("/api/generate-german",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:a})});if(!e.ok)throw Error(`Failed to send message: ${e.status}`);let t=await e.text();s(e=>[...e,{role:"assistant",content:t}])}catch(e){console.error("Error sending message:",e),s(e=>[...e,{role:"assistant",content:"Sorry, there was an error."}])}finally{m(!1)}},N=e.reduceRight((e,s,t)=>-1===e&&"user"===s.role?t:e,-1);
1return(0,a.jsxs)("div",{className:`${l().themeContainer} ${u?l().darkMode:l().lightMode} ${l().transitionAll}`,children:[(0,a.jsx)(o.A,{children:(0,a.jsx)("title",{children:"German Interpreter"})}),(0,a.jsx)(i.A,{}),(0,a.jsx)("button",{className:l().themeToggleFixed,onClick:()=>{let e=!u;h(e),localStorage.setItem("darkMode",e?"dark":"light"),e?document.documentElement.classList.add("dark-mode"):document.documentElement.classList.remove("dark-mode")},"aria-label":u?"Switch to light mode":"Switch to dark mode",children:u?"Light":"Dark"}),(0,a.jsxs)("section",{className:l().hero,children:[(0,a.jsx)("p",{className:l().kicker,children:"Translation"}),(0,a.jsx)("h1",{className:l().title,children:"German Interpreter"}),(0,a.jsx)("p",{className:l().subtitle,children:"Translate from German and back â try arte.tv/de"})]}),(0,a.jsxs)("div",{className:l().chat1container,children:[(0,a.jsxs)("div",{className:l().message1List,ref:g,children:[e.map((s,t)=>(0,a.jsxs)("div",{className:`${l().message1} ${"user"===s.role?l().user:l().assistant} ${t===N&&c?l().userGradient:""}`,children:[(0,a.jsx)("div",{className:l().avatar,children:"user"===s.role?(0,a.jsx)("img",{src:"/you.png",alt:"User Avatar",className:l().avatarImage}):(0,a.jsx)("img",{src:"/avrob.gif",alt:"Translator Avatar",className:l().avatarImage})}),(0,a.jsxs)("div",{className:l().messageContent,children:[s.content,t===e.length-1&&(0,a.jsx)("div",{ref:x})]})]},t)),c&&(0,a.jsxs)("div",{className:l().typingIndicator,children:[(0,a.jsx)("div",{className:l().typingDot}),(0,a.jsx)("div",{className:l().typingDot}),(0,a.jsx)("div",{className:l().typingDot})]})]}),(0,a.jsx)("div",{className:l().message1FormContainer,children:(0,a.jsx)("form",{onSubmit:e=>{e.preventDefault(),t.trim()&&(j(t),n(""))},className:l().message1Form,children:(0,a.jsxs)("div",{className:l().inputContainer1,children:[(0,a.jsx)("input",{type:"text",value:t,onChange:e=>n(e.target.value),placeholder:"Type in English or Germanâ¦",className:l().message1FormInput,disabled:c}),(0,a.jsx)("button",{type:"submit",className:l().sendButton,disabled:c||!t.trim(),children:c?"Sending...":"Send"})]})})})]}),(0,a.jsx)(d.default,{})]})}},5308:(e,s,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/germaninterpreter",function(){return t(4068)}])}},e=>{e.O(0,[5695,1737,636,6593,8792],()=>e(e.s=5308)),_N_E=e.O()}]);
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.