1import{r as l,j as t,b as B}from"./react-BnfLHUj-.js";import{M as W}from"./MarketingHero-BIoNFSiO.js";import{d as K,e as X,M as I,f as J,g as Q,h as Z,i as ee,j as te,k as se,C as ne,S as E,l as ae,m as ie,n as re,o as oe,s as le,p as ce,q as de}from"./MarketingButton-BMgiYaom.js";import{M as Y}from"./MinimalKicker-DgalHU5K.js";import{L as ue,b as M,d as me,g as fe,e as he,n as pe,s as xe,f as F,i as k,h as ge,m as f}from"./index-BE93WfI9.js";import{u as ye,c as Ne}from"./useDocumentMeta-VI_uxe02.js";import{u as je}from"./use-reduced-motion-BTzzncaH.js";import"./MarketingTopography-6KvSEXlW.js";const N="mt-2 block w-full rounded-lg border border-slate-600/60 bg-background px-3 py-3 text-base text-foreground focus:border-cyan-400 focus:outline-none focus:ring-2 focus:ring-cyan-400/30",$={name:"Name",company:"Company",email:"Email",audience:"Your firm",service_line:"The service you selected",phone:"Phone",project_location:"Project location",message:"Your project description",attachments:"One of your attachments"},be=new Set([404,405,413,415,422]),ve="Your attachments could not be sent. Remove them to send your enquiry now, then email the files to [email protected]. Your entries are still here.",Se="Sending took longer than expected, so your enquiry may already have been received. Send it again to make sure: an unchanged enquiry will not be duplicated. If it still does not go through, remove your attachments to send your enquiry now, then email the files to [email protected]. Your entries are still here.",{maxFiles:q,maxFileBytes:O,maxTotalBytes:R,extensions:z}=Z,Ee=new Set(z),we=`Up to ${q} files, ${A(O)} each and ${A(R)} in total: ${H(z.map(e=>e.toUpperCase()),"or")}.`,Te=/^[0-9 +\-().,xX]*$/;function x(e,s){return String(e.get(s)??"").trim()}function H(e,s="and"){return e.length<2?e[0]??"":`${e.slice(0,-1).join(", ")} ${s} ${e[e.length-1]}`}function A(e){const s=e/1048576;return s<1?`${Math.max(1,Math.round(e/1024))} KB`:`${Number.isInteger(s)?s:s.toFixed(1)} MB`}function Ce(e){if(e.length>
150||!Te.test(e))return"Please use only digits, spaces and + - ( ) . in your phone number.";const s=e.split(/[xX]/)[0].replace(/\D/g,"").length;return s<7||s>15?"Please enter a phone number with 7 to 15 digits.":""}function Ae(e){const s=e.lastIndexOf(".");return s===-1?"":e.slice(s+1).toLowerCase()}function _e(e,s){const n=[...e],a=[];let i=n.reduce((r,o)=>r+o.size,0);for(const r of s)n.some(c=>c.name===r.name&&c.size===r.size&&c.lastModified===r.lastModified)||(Ee.has(Ae(r.name))?r.size>O?a.push(`${r.name} is larger than ${A(O)}. Please email it to [email protected] instead.`):n.length>=q?a.push(`${r.name} was not added: you can attach up to ${q} files. Please email any others to [email protected].`):i+r.size>R?a.push(`${r.name} was not added: attachments can total up to ${A(R)}. Please email the rest to [email protected].`):(n.push(r),i+=r.size):a.push(`${r.name} is not a file type we accept.`));return{files:n,refusals:a}}function D(e){if(e instanceof HTMLInputElement&&e.type==="radio"&&e.form){const s=e.form.elements.namedItem(e.name);if(s instanceof RadioNodeList){for(const n of Array.from(s))n instanceof HTMLInputElement&&n.setCustomValidity("");return}}(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement)&&e.setCustomValidity("")}function U(e,s){const n=e.elements.namedItem(s),a=n instanceof RadioNodeList?n[0]:n;return a instanceof HTMLInputElement||a instanceof HTMLSelectElement||a instanceof HTMLTextAreaElement?a:null}function G(e,s,n,a){const i=U(e,s);return i?(i.setCustomValidity(n),a(i)):!0}function Ie(e){if(!k(e)||e.response?.status!==422)return[];const s=e.response.data,n=typeof s=="object"&&s!==null?s.detail:void 0;if(!Array.isArray(n))return[];const a=[];for(const i of n){const r=typeof i=="object"&&i!==null?i.loc:void 0;if(!Array.isArray(r)||r.length===0)continue;const o=r[r.length-1];typeof o=="string"&&o in $&&!a.includes(o)&&a.push(o)}return a}function ke(e,s,n){const a=x(e,"service_line"),i=a==="civil_services";return{name:x(e,"name"),company:x(e,"company"),email:x(e,"email"),phone:x(e,"phone"),audience:x(e,"audience"),service_line:a,...i?{project_location:x(e,"project_location")}:{},message:s,website:String(e.get("website")??""),service:i?"not_sure":"custom_systems",...n?{handoff_token:n}:{}}}function Le(e,s){const n=new FormData;for(const[a,i]of Object.entries(e))n.append(a,i);for(const a of s)n.append("attachments",a,a.name);return n}function Pe(e,s,n,a){return s.length===0?F.post("/consulting/enquiries",e,{timeout:2e4,headers:{"Idempotency-Key":n}}):F.post("/consulting/enquiries",Le(e,s),{timeout:115e3,headers:{"Idempotency-Key":n,"Content-Type":"multipart/form-data"},onUploadProgress:i=>{i.total&&a(Math.round(i.loaded/i.total*100))}})}function Me(e){return k(e)&&(e.code==="ECONNABORTED"||e.code==="ETIMEDOUT")}function $e(e){return k(e)&&(!e.response||be.has(e.response.status))}function qe(e,s){return s&&Me(e)?"attachments_timeout":s&&$e(e)?"attachments_failed":k(e)&&e.response?.status===422?"rejected":"error"}function Oe(e){const s=typeof e=="object"&&e!==null?e.attachments_not_stored:void 0;return Array.isArray(s)?s.filter(n=>typeof n=="string"&&n!==""):[]}function Re(e,s){return Ie(s).map(n=>U(e,n)).filter(n=>n!==null&&!n.disabled)}function He(e){if(e.length===0)return"Some details were not accepted. Please check your entries and send again, or email [email protected]. Your entries are still here.";const s=e.length===1?"was":"were",n=e.length===1?"it":"them";return`${H(e)} ${s} not accepted. Please check ${n} and send again, or email [email protected]. Your entries are still here.`}function Ue(e,s){switch(e){case"rejected":return He(s);case"error":return"We could not send your enquiry. Please try again, or email [email protected]. Your entries are still here.";case"attachments_failed":return ve;case"attachments_timeout":return Se;default:return null}}function Fe(e,s){return e!=="sending"?"Send enquiry":s===null?"Sending enquiry...":`Sending enquiry... ${s}%`}function De(){const[e,s]=me(),[n]=l.useState(()=>e.get("handoff"));return l.useEffect(()=>{if(!e.has("handoff"))return;const a=new URLSearchParams(e);a.delete("handoff"),s(a,{replace:!0})},[e,s]),n}function Ge(e,s){for(const[n,a]of Object.entries(s)){if(typeof a!="string"||!a.trim())continue;const i=U(e,n);i&&!i.value.trim()&&(i.value=a)}}function Ye(e,s){const[n,a]=l.useState(null);return l.useEffect(()=>{if(!e)return;let i=!1;return fe(e).then(r=>{i||a(r)}),()=>{i=!0}},[e]),l.useEffect(()=>{n&&s.current&&Ge(s.current,n)},[n,s]),n}function ze({unstored:e}){const s=e.length===1?"it":"them";return t.jsxs("div",{role:"status",className:"rounded-2xl border border-emerald-500/30 bg-emerald-500/10 p-8",children:[t.jsx(he,{"aria-hidden":"true",className:"mb-4 h-8 w-8 text-emerald-400"}),t.jsx("h3",{className:"text-balance font-display text-xl font-semibold",children:"Your enquiry is with the team."}),t.jsx("p",{className:"mt-3 text-muted-foreground",children:"A person from our team will reply to the email you provided to discu
1ss the work."}),e.length>0&&t.jsxs("p",{className:"mt-3 text-muted-foreground",children:["We could not store ",H(e),". Please email ",s," to [email protected] so the team has ",s,"."]})]})}function Ve({inputRef:e,files:s,refusals:n,onPick:a,onRemove:i}){const r=l.useId();return t.jsxs("div",{children:[t.jsxs("label",{className:"block text-sm font-medium",children:["Attachments (optional)",t.jsx("input",{ref:e,name:"attachments",type:"file",multiple:!0,accept:Q,onChange:a,"aria-describedby":`${r}-hint ${r}-refusals`,className:`${N} file:mr-3 file:rounded-md file:px-3 file:py-1.5 file:text-sm file:font-medium`})]}),t.jsx("p",{id:`${r}-hint`,className:"mt-2 text-sm text-muted-foreground",children:we}),s.length>0&&t.jsx("ul",{"aria-label":"Attached files",className:"mt-3 space-y-2",children:s.map(o=>t.jsxs("li",{className:"flex min-w-0 items-center gap-3 rounded-md border px-3 py-2 text-sm",children:[t.jsx("span",{className:"min-w-0 flex-1 truncate",children:o.name}),t.jsx("span",{className:"shrink-0 text-muted-foreground",children:A(o.size)}),t.jsx("button",{type:"button",onClick:()=>i(o),"aria-label":`Remove ${o.name}`,className:"shrink-0 rounded-md px-2 py-1 font-medium text-cyan-300 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cyan-400",children:"Remove"})]},`${o.name}-${o.size}-${o.lastModified}`))}),t.jsx("div",{id:`${r}-refusals`,"aria-live":"polite",children:n.map((o,c)=>t.jsx("p",{className:"mt-2 text-sm text-red-400",children:o},`${c}-${o}`))})]})}function Be(e,s,n){const[a,i]=l.useState("idle"),[r,o]=l.useState([]),[c,u]=l.useState(null),[j,b]=l.useState([]),w=l.useRef(null);function L(v,y){const m=Re(v,y);if(m.length===0)return!1;B.flushSync(()=>{o(m.map(h=>$[h.name])),i("rejected")});for(const h of m)h.setCustomValidity(`${$[h.name]} was not accepted. Please check it and send again.`);return n(m[0]),!0}async function g(v){if(v.preventDefault(),a==="sending")return;const y=v.currentTarget,m=new FormData(y),h=x(m,"message");if(!G(y,"phone",Ce(x(m,"phone")),n)||!G(y,"message",h?"":"Please tell us about the work.",n))return;const T=ke(m,h,s),S=e,C=JSON.stringify([T,S.map(p=>[p.name,p.size,p.lastModified,p.type])]);w.current?.enquiry!==C&&(w.current={enquiry:C,key:pe()});const d=w.current.key;o([]),u(null),i("sending");try{const p=await Pe(T,S,d,u);b(Oe(p.data)),i("success"),xe("generate_lead",{form_location:"consulting_page"})}catch(p){L(y,p)||i(qe(p,S.length>0))}}return{state:a,rejectedNouns:r,progress:c,unstored:j,submit:g}}function We({selectedLine:e,onSelect:s}){return t.jsxs("fieldset",{className:"min-w-0",children:[t.jsx("legend",{className:"text-sm font-medium",children:"What do you need?"}),t.jsx("div",{className:"mt-2 grid grid-cols-1 gap-3 sm:grid-cols-2",children:J.map((n,a)=>t.jsxs("label",{className:"flex min-w-0 cursor-pointer items-center gap-3 rounded-lg border px-3 py-3 text-base has-checked:bg-cyan-500/10",children:[t.jsx("input",{type:"radio",name:"service_line",value:n.value,required:a===0,checked:e===n.value,onChange:()=>s(n.value),className:"h-4 w-4 shrink-0 accent-cyan-500"}),n.label]},n.value))})]})}function Ke(){const[e,s]=l.useState([]),[n,a]=l.useState([]),i=l.useRef(null);function r(c){const u=c.currentTarget,j=Array.from(u.files??[]);u.value="",u.setCustomValidity("");const b=_e(e,j);s(b.files),a(b.refusals)}function o(c){s(u=>u.filter(j=>j!==c)),a([]),i.current?.setCustomValidity("")}return{files:e,refusals:n,attachmentsInput:i,pickAttachments:r,removeAttachment:o}}function Xe(){const[e,s]=l.useState(""),n=l.useRef(!1),a=l.useRef(null),i=De(),r=Ye(i,a);function o(){n.current=!0,setTimeout(()=>{n.current=!1},0)}function c(d){return o(),d.reportValidity()}const{files:u,refusals:j,attachmentsInput:b,pickAttachments:w,removeAttachment:L}=Ke(),{state:g,rejectedNouns:v,progress:y,unstored:m,submit:h}=Be(u,i,c);if(g==="success")return t.jsx(ze,{unstored:m});const T=Ue(g,v),S=e||(r?"civil_services":""),C=S==="civil_services";return t.jsxs("form",{ref:a,"data-handoff-prefilled":r?"true":void 0,onSubmit:d=>{h(d)},onInput:d=>D(d.target),onInvalid:()=>o(),onFocus:d=>{n.current||D(d.target)},className:"rounded-2xl border border-slate-700/60 bg-background p-5 sm:p-8","aria-label":"Consulting enquiry",children:[t.jsx("p",{className:"mb-6 text-sm text-muted-foreground",children:r?"We filled
1in what we know from your workspace. Check it, pick what you need, and tell us more.":"All fields are required unless marked optional."}),t.jsxs("fieldset",{disabled:g==="sending",className:"min-w-0 space-y-5 disabled:opacity-70",children:[t.jsxs("div",{className:"grid grid-cols-1 gap-5 sm:grid-cols-2",children:[t.jsxs("label",{className:"block text-sm font-medium",children:["Name",t.jsx("input",{name:"name",autoComplete:"name",required:!0,pattern:".*\\S.*",maxLength:200,className:N})]}),t.jsxs("label",{className:"block text-sm font-medium",children:["Company",t.jsx("input",{name:"company",autoComplete:"organization",required:!0,pattern:".*\\S.*",maxLength:200,className:N})]})]}),t.jsxs("label",{className:"block text-sm font-medium",children:["Email",t.jsx("input",{name:"email",type:"email",autoComplete:"email",required:!0,maxLength:254,className:N})]}),t.jsxs("label",{className:"block text-sm font-medium",children:["Phone",t.jsx("input",{name:"phone",type:"tel",autoComplete:"tel",required:!0,maxLength:50,className:N})]}),t.jsxs("label",{className:"block text-sm font-medium",children:["Your firm",t.jsxs("select",{name:"audience",required:!0,defaultValue:"",className:N,children:[t.jsx("option",{value:"",disabled:!0,children:"Select your firm type"}),K.map(d=>t.jsx("option",{value:d.value,children:d.label},d.value))]})]}),t.jsx(We,{selectedLine:S,onSelect:s}),t.jsxs("label",{hidden:!C,className:"block text-sm font-medium",children:["Project location",t.jsx("input",{name:"project_location",required:!0,disabled:!C,maxLength:500,className:N,placeholder:"Address or municipality"})]}),t.jsxs("label",{className:"block text-sm font-medium",children:[X,t.jsx("textarea",{name:"message",required:!0,maxLength:5e3,rows:5,className:N,placeholder:"What are you planning, and what would help you move forward? For AI consulting, tell us what you would automate."})]}),t.jsx(Ve,{inputRef:b,files:u,refusals:j,onPick:w,onRemove:L}),t.jsx("div",{hidden:!0,"aria-hidden":"true",children:t.jsxs("label",{children:["Website",t.jsx("input",{name:"website",tabIndex:-1,autoComplete:"off"})]})}),T&&t.jsx("p",{role:"alert",className:"rounded-lg border border-red-400/40 bg-red-500/10 p-4 text-sm text-red-400",children:T}),t.jsxs(I,{variant:"primary",type:"submit",disabled:g==="sending",className:"w-full sm:w-auto",children:[g==="sending"?t.jsx(ue,{"aria-hidden":"true",className:"h-4 w-4 animate-spin"}):t.jsx(M,{"aria-hidden":"true",className:"h-4 w-4"}),Fe(g,y)]})]})]})}const _="py-28 md:py-36",V="mt-5 text-balance font-display text-3xl font-bold tracking-tight md:text-[2.75rem] md:leading-[1.1]";function P({id:e,kicker:s,heading:n,intro:a,accent:i}){return t.jsxs(f.div,{variants:E,className:"mb-14 md:mb-20",children:[t.jsx(Y,{label:s,accent:i,align:"start"}),t.jsx("h2",{id:e,className:`max-w-[20ch] ${V}`,children:n}),a&&t.jsx("p",{className:"mt-5 max-w-2xl text-lg leading-relaxed text-muted-foreground",children:a})]})}function it(){const e=je(),s=le(e);return ye({title:ce,description:de,canonical:Ne("/consulting")}),l.useEffect(()=>{const n=window.location.hash.slice(1);n&&document.getElementById(n)?.scrollIntoView()},[]),t.jsxs("div",{className:"min-h-screen",children:[t.jsxs(W,{kicker:"PrecisionDocs Consulting",title:te,subtitle:ee,children:[t.jsxs(I,{variant:"primary",href:"#request-a-service",children:["Request a service",t.jsx(M,{"aria-hidden":"true",className:"h-4 w-4"})]}),t.jsx(I,{href:ge("/signup"),children:"Try the app"})]}),t.jsx(f.section,{id:"services","aria-labelledby":"services-heading",...s,className:_,children:t.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6 lg:px-8",children:[t.jsx(P,{id:"services-heading",kicker:"What we do for you",heading:se}),t.jsx(ne,{}),t.jsxs(f.div,{variants:E,className:"mt-14 flex flex-col items-start gap-6",children:[t.jsx("p",{className:"max-w-2xl text-balance text-lg leading-relaxed text-muted-foreground",children:ae}),t.jsxs(I,{variant:"primary",href:"#request-a-service",children:["Contact us",t.jsx(M,{"aria-hidden":"true",className:"h-4 w-4"})]})]})]})}),t.jsx(f.section,{...s,className:_,children:t.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6 lg:px-8",children:[t.jsx(P,{kicker:"Who we work with",heading:"Less repeat work. More room to build.",intro:"Start with the work sitting between your team and its next decision."}),t.jsx(f.div,{variants:E,className:"grid grid-cols-1 gap-x-12 gap-y-12 md:grid-cols-2",children:ie.map(n=>t.jsxs("article",{className:"min-w-0 border-t pt-6",children:[t.jsx("h3",{className:"text-balance font-display text-xl font-semibold",children:n.title}),t.jsx("p",{className:"mt-4 leading-relaxed text-muted-foreground",children:n.body})]},n.title))})]})}),t.jsx(f.section,{...s,className:_,children:t.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6 lg:px-8",children:[t.jsx(P,{kicker:"How engagements work",accent:"emerald",heading:"A clear scope. A usable handoff."}),t.jsx(f.ol,{variants:E,className:"grid grid-cols-1 gap-x-12 gap-y-12 sm:grid-cols-2 lg:grid-cols-4",children:re.map((n,a)=>t.jsxs("li",{className:"min-w-0 border-t pt-6",children:[t.jsxs("span",{className:"font-mono text-sm text-emerald-400",children:["0",a+1]}),t.jsx("h3",{className:"mt-3 text-balance font-display text-xl font-semibold",children:n.title}),t.jsx("p",{className:"mt-4 leading-relaxed text-muted-foreground",children:n.body})]},n.title))})]})}),t.jsx(f.section,{id:"request-a-service",...s,className:`scroll-mt-24 ${_}`,children:t.jsxs("div",{className:"mx-auto grid max-w-6xl grid-cols-1 items-start gap-x-16 gap-y-12 px-4 sm:px-6 md:grid-cols-12 lg:px-8",children:[t.jsxs(f.div,{variants:E,className:"min-w-0 md:col-span-5",children:[t.jsx(Y,{label:"Let's talk",accent:"emerald",align:"start"}),t.jsx("h2",{className:`max-w-[16ch] ${V}`,children:oe}),t.jsx("p",{className:"mt-5 text-lg leading-relaxed text-muted-foreground",children:"Tell us what you are trying to get done. A person from the team will reply to discu
1ss whether we can help and what a useful scope looks like."}),t.jsxs("p",{className:"mt-8 text-sm text-muted-foreground",children:["Prefer email? ",t.jsx("a",{href:"mailto:[email protected]",className:"text-cyan-300 hover:underline",children:"[email protected]"})]})]}),t.jsx(f.div,{variants:E,className:"min-w-0 md:col-span-6 md:col-start-7",children:t.jsx(Xe,{})})]})})]})}export{it as ConsultingPage};
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.