PageSourceSearch

https://page2doc.com/assets/support-BBrQLJc9.js

js page2doc.com collected 2026-09-24 14:49:58 UTC 9,226 bytes, 1 lines download raw bytes

1import{y as C,h as S,u as O,r as o,M as R,z,j as e,v as r,a2 as M,e as T,o as N,ae as q,t,q as _,s as E,a1 as D,I as v,av as F,H as L,d as H,Y as A,_ as I}from"./index--O6ybP7K.js";import{T as B}from"./textarea-Di93jljE.js";import{M as J}from"./mail-DKaT0Ksg.js";const U=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],X=C("send",U),Y=T;function G(){const{lang:s}=S();O({lang:s});const[l,p]=o.useState(""),[i,g]=o.useState(""),[n,h]=o.useState(""),[d,f]=o.useState(""),[c,m]=o.useState("idle"),[u,j]=o.useState(!1),{beginRequest:y,isCurrentRequest:b}=R(),k=z(s,"supportPage.subjectOptions");async function w(a){if(a.preventDefault(),!l||!i||!n||!d)return;const x=y();m("sending");try{if(await A("/api/contact",{method:"POST",headers:{"Content-Type":"application/json"},signal:x.signal,body:JSON.stringify({name:l,email:i,subject:n,message:d})}),!b(x))return;m("success"),p(""),g(""),h(""),f("")}catch(P){if(I(P)||!b(x))return;m("error")}}return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("header",{className:"sticky top-0 z-50 bg-background/80 backdrop-blur-lg border-b border-border/50",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 h-16 flex items-center justify-between",children:[e.jsx("a",{href:r("/",s),className:"flex items-center gap-2","aria-label":"Page2Doc — Home","data-testid":"link-header-home",children:e.jsx("img",{src:"/assets/logo.webp",alt:"Page2Doc",className:"h-8 w-auto"})}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(M,{}),e.jsx("a",{href:Y,target:"_blank",rel:"noopener noreferrer","data-testid":"button-add-chrome-header",children:e.jsxs(N,{size:"sm",className:"hidden sm:flex",children:[e.jsx(q,{className:"w-4 h-4 mr-2"}),t(s,"common.addToChrome")]})})]})]})}),e.jsxs("main",{className:"max-w-5xl mx-auto px-4 sm:px-6 py-16 sm:py-24",children:[e.jsxs("div",{className:"text-center mb-14",children:[e.jsx("h1",{className:"text-4xl sm:text-5xl font-bold tracking-tight text-foreground mb-4",children:t(s,"supportPage.hero")}),e.jsx("p",{className:"text-lg text-muted-foreground max-w-xl mx-auto",children:t(s,"supportPage.heroSub")})]}),e.jsxs("div",{className:"grid lg:grid-cols-3 gap-10",children:[e.jsx("div",{className:"lg:col-span-2",children:e.jsx(_,{className:"border-border/60 shadow-sm",children:e.jsx(E,{className:"p-8",children:c==="success"?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center gap-4","data-testid":"text-success-message",children:[e.jsx(D,{className:"w-14 h-14 text-green-500"}),e.jsx("p",{className:"text-lg font-semibold text-foreground",children:t(s,"supportPage.success")})]}):e.jsxs("form",{onSubmit:w,className:"space-y-6",children:[e.jsxs("div",{className:"grid sm:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"support-name",className:"text-sm font-medium leading-none","data-testid":"label-name",children:t(s,"supportPage.name")}),e.jsx(v,{id:"support-name",value:l,onChange:a=>p(a.target.value),required:!0,autoComplete:"name","data-testid":"input-name",className:"bg-background"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"support-email",className:"text-sm font-medium leading-none","data-testid":"label-email",children:t(s,"supportPage.email")}),e.jsx(v,{id:"support-email",type:"email",value:i,onChange:a=>g(a.target.value),required:!0,autoComplete:"email","data-testid":"input-email",className:"bg-background"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"support-subject",className:"text-sm font-medium leading-none","data-testid":"label-subject",children:t(s,"supportPage.subject")}),e.jsxs("div",{className:"relative",children:[e.jsxs("button",{type:"button",id:"support-subject","data-testid":"button-subject-dropdown",onClick:()=>j(!u),className:"w-full flex items-center justify-between px-3 py-2 rounded-md border border-input bg-background text-sm r
1ing-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 text-left",children:[e.jsx("span",{className:n?"text-foreground":"text-muted-foreground",children:n||t(s,"supportPage.subject")}),e.jsx(F,{className:`w-4 h-4 text-muted-foreground transition-transform ${u?"rotate-180":""}`})]}),u&&e.jsx("div",{className:"absolute z-10 mt-1 w-full rounded-md border border-border bg-popover shadow-lg",children:k.map(a=>e.jsx("button",{type:"button","data-testid":`option-subject-${a}`,className:"w-full text-left px-3 py-2 text-sm hover:bg-accent hover:text-accent-foreground transition-colors first:rounded-t-md last:rounded-b-md",onClick:()=>{h(a),j(!1)},children:a},a))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"support-message",className:"text-sm font-medium leading-none","data-testid":"label-message",children:t(s,"supportPage.message")}),e.jsx(B,{id:"support-message",value:d,onChange:a=>f(a.target.value),rows:6,required:!0,placeholder:t(s,"supportPage.messagePlaceholder"),"data-testid":"input-message",className:"bg-background resize-none"})]}),c==="error"&&e.jsxs("div",{className:"flex items-start gap-2 text-sm text-destructive","data-testid":"text-error-message",children:[e.jsx(L,{className:"w-4 h-4 mt-0.5 flex-shrink-0"}),e.jsx("span",{children:t(s,"supportPage.error")})]}),e.jsx(N,{type:"submit",size:"lg",className:"w-full",disabled:c==="sending"||!l||!i||!n||!d,"data-testid":"button-submit-support",children:c==="sending"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),t(s,"supportPage.sending")]}):e.jsxs(e.Fragment,{children:[e.jsx(X,{className:"w-4 h-4 mr-2"}),t(s,"supportPage.send")]})})]})})})}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold text-foreground mb-4",children:t(s,"supportPage.infoTitle")}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-3 text-sm",children:[e.jsx("div",{className:"mt-0.5 w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:e.jsx(J,{className:"w-4 h-4 text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:t(s,"supportPage.emailLabel")}),e.jsx("a",{href:"mailto:[email protected]",className:"text-primary hover:underline","data-testid":"link-support-email",children:"[email protected]"})]})]}),e.jsxs("div",{className:"flex items-start gap-3 text-sm",children:[e.jsx("div",{className:"mt-0.5 w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:e.jsx(H,{className:"w-4 h-4 text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:t(s,"supportPage.responseTime")}),e.jsx("p",{className:"text-muted-foreground",children:t(s,"supportPage.responseTimeValue")})]})]})]})]}),e.jsx("div",{className:"rounded-lg bg-primary/5 border border-primary/20 p-4 text-sm text-muted-foreground",children:t(s,"supportPage.builtBy")}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsx("p",{className:"font-medium text-foreground",children:"Quick links"}),e.jsxs("ul",{className:"space-y-1.5 text-muted-foreground",children:[e.jsx("li",{children:e.jsxs("a",{href:r("/docs",s),className:"hover:text-foreground transition-colors","data-testid":"link-support-docs",children:["→ ",t(s,"footer.docs")]})}),e.jsx("li",{children:e.jsxs("a",{href:r("/pricing",s),className:"hover:text-foreground transition-colors","data-testid":"link-support-pricing",children:["→ ",t(s,"common.pricing")]})}),e.jsx("li",{children:e.jsx("a",{href:"https://billing.stripe.com/p/login/4gM6oJ4BR4CAeDM1mX67S00",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors","data-testid":"link-support-billing",children:"→ Manage subscription"})})]})]})]})]}),e.jsx("div",{className:"text-center mt-16",children:e.jsxs("a",{href:r("/",s),className:"text-sm text-muted-foreground hover:text-foreground transition-colors","data-testid":"link-back-home",children:["← ",t(s,"supportPage.backHome")]})})]}),e.jsx("footer",{className:"py-8 bg-card border-t border-border",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 flex flex-col sm:flex-row items-center justify-between gap-4",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:[new Date().getFullYear()," Page2Doc. ",t(s,"common.copyright")]}),e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[e.jsx("a",{href:r("/privacy",s),className:"hover:text-foreground transition-colors","data-testid":"link-footer-privacy",children:t(s,"footer.privacyPolicy")}),e.jsx("a",{href:r("/terms",s),className:"hover:text-foreground transition-colors","data-testid":"link-footer-terms",children:t(s,"footer.termsOfService")}),e.jsx("a",{href:r("/docs",s),className:"hover:text-foreground transition-colors","data-testid":"link-footer-docs",children:t(s,"footer.docs")})]})]})})]})}export{G as default};

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.