1import{n as p,m as e}from"./index-Bza8Zpeo.js";import{A as P,a as O}from"./AwsMarketplaceHeader-NsvAd31T.js";import{H as j,e as A,d as E,g as L,r as N}from"./cookies-ZCwNdYed.js";import"./arrow-right-B_BPIEas.js";const T="w-full min-h-[280px] [&_.hs-form]:text-slate-900 [&_.hs-button]:!font-semibold [&_.hs-button]:[font-family:var(--font-family)]",I=50,H=100,_=40;function D({className:g}){const r=`hs-aws-onboarding-${p.useId().replace(/:/g,"")}`,[k,h]=p.useState("idle"),[v,b]=p.useState("Oops! Something went wrong while submitting the form.");function M(i){if(!i||typeof i!="object")return null;const s=i;if(typeof s.message=="string"&&s.message.trim())return s.message.trim();if(typeof s.errorMessage=="string"&&s.errorMessage.trim())return s.errorMessage.trim();const c=Array.isArray(s.errors)?s.errors:null;if(c)for(const a of c){if(!a||typeof a!="object")continue;const n=a.message;if(typeof n=="string"&&n.trim())return n.trim()}return null}return p.useEffect(()=>{function i(){const o=document.getElementById(r);if(!o)return!1;const t=o.querySelector("form");return t?(t.dataset.awsDirectSubmitBound==="1"||(t.dataset.awsDirectSubmitBound="1",t.addEventListener("submit",async u=>{if(u.preventDefault(),u.stopPropagation(),!t.checkValidity()){t.reportValidity();return}b("Oops! Something went wrong while submitting the form."),h("submitting");const f=new FormData(t),y=[];for(const[d,m]of f.entries()){const x=typeof m=="string"?m.trim():"";!d||!x||y.push({name:d,value:x})}try{const d=await fetch(L(j),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({fields:y,context:{hutk:N("hubspotutk"),pageUri:window.location.href,pageName:document.title,pageId:window.location.pathname}})}),m=await d.json().catch(()=>null);if(!(d.ok&&m?.status!=="error")){const S=M(m);S&&b(S),h("error");return}window.location.assign("/aws/onboarding-success")}catch{b("Network error while submitting. Please try again."),h("error")}},{capture:!0})),!0):!1}const s=`#${r}`,c=()=>{const o=document.getElementById(r);o&&(o.innerHTML="");const t=window.hbspt?.forms?.create;if(typeof t!="function")return;t({region:E,portalId:A,formId:j,target:s});let u=0;const f=()=>{i()||u++<_&&setTimeout(f,H)};f()},a=()=>{let o=0;const t=()=>{if(typeof window.hbspt?.forms?.create=="function"){c();return}o++<_&&setTimeout(t,I)};t()};if(typeof window.hbspt?.forms?.create=="function"){c();return}const n=document.querySelector('script[src="https://js.hsforms.net/forms/embed/v2.js"]');if(n){if(n.dataset.loaded==="1"){a();return}const o=()=>{n.dataset.loaded="1",a()};return n.addEventListener("load",o),()=>n.removeEventListener("load",o)}const l=document.createElement("script");l.src="https://js.hsforms.net/forms/embed/v2.js",l.async=!0,l.addEventListener("load",()=>{l.dataset.loaded="1",a()}),document.body.appendChild(l)},[r]),e.jsxs(e.Fragment,{children:[e.jsx("div",{id:r,className:g??T}),k==="error"?e.jsx("div",{className:"mt-3 rounded-md border border-red-400/40 bg-red-950/30 px-3 py-2 text-sm text-red-100",children:v}):null]})}const R="mailto:[email protected]?subject=PowerSync%20AWS%20Marketplace%20Purchase",F=[{href:"https://docs.powersync.com",label:"Documentation",external:!0},{href:R,label:"Email Support"}];function U({links:g=F,className:w=""}){return e.jsxs("div",{className:`flex flex-col gap-2 ${w}`.trim(),children:[e.jsx("p",{className:"m-0 text-xs font-semibold uppercase tracking-wider text-[var(--text-light-secondary)]",children:"Need help?"}),e.jsx("div",{className:"flex flex-col gap-2",children:g.map(r=>e.jsx(P,{href:r.href,external:r.external,fullWidth:!0,children:r.label},r.href))})]})}function q(){return e.jsxs("main",{className:"bg-[var(--blue-dark-background)] min-h-screen",children:[e.jsx(O,{title:"PowerSync Enterprise",children:"Please complete the form below to finish your registration for PowerSync Cloud Enterprise via AWS Marketplace."}),e.jsxs("div",{className:"mx-auto flex w-full max-w-[840px] flex-col gap-8 px-6 pb-16 lg:flex-row lg:items-start lg:gap-10",children:[e.jsx("div",{className:"order-1 min-w-0 w-full lg:order-2 lg:flex-1",children:e.jsx("div",{className:"rounded-xl border border-[var(--blue-dark-b177)] bg-[var(--blue-dark-b098)] p-1.5 shadow-xl shadow-black/20",children:e.jsx("div",{className:"rounded-lg bg-white px-6 py-6",children:e.jsx(D,{})})})}),e.jsx(U,{className:"order-2 mx-auto w-full max-w-[220px] lg:order-1 lg:mx-0 lg:shrink-0"})]})]})}export{q as component};
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.