1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8949],{9770:(e,s,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/feedback",function(){return t(9791)}])},9791:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>d});var a=t(979),r=t(5963),l=t(5774),n=t(780);function o(){let e=(0,n.useRouter)(),{id:s}=e.query,[t,o]=(0,r.useState)(null),[i,c]=(0,r.useState)(!0),[d,m]=(0,r.useState)(null),[x,u]=(0,r.useState)(!1),[h,f]=(0,r.useState)(!1),[p,b]=(0,r.useState)({}),[j,N]=(0,r.useState)(!1),[y,v]=(0,r.useState)(!1),{register:w,handleSubmit:g,setValue:k}=(0,l.mN)();(0,r.useEffect)(()=>{s&&"string"==typeof s&&JSON.parse(localStorage.getItem("submittedFeedbackForms")||"[]").includes(s)&&v(!0)},[s]),(0,r.useEffect)(()=>{t&&t.questions.forEach(e=>{k(`answers.${e.id}.id`,e.id)})},[t,k]);let F=async e=>{N(!0),window.scrollTo({top:0,behavior:"smooth"});try{let t=await fetch(`https://p4afetsom6jxf4c63o4pzdwkhi0xmyvp.lambda-url.us-east-1.on.aws/?id=${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({referenceId:s,answers:e.answers,email:e.email})});if(404===t.status)return void f(!0);if(!t.ok)throw Error(`Failed to submit feedback: ${t.status} ${t.statusText}`);if(s&&"string"==typeof s){let e=JSON.parse(localStorage.getItem("submittedFeedbackForms")||"[]");e.includes(s)||(e.push(s),localStorage.setItem("submittedFeedbackForms",JSON.stringify(e)))}u(!0)}catch(e){console.error("Error submitting form:",e),m(e instanceof Error?e.message:"An error occurred")}finally{N(!1)}};return((0,r.useEffect)(()=>{e.isReady&&(async()=>{if(!s){f(!0),c(!1);return}try{let e=await fetch(`https://p4afetsom6jxf4c63o4pzdwkhi0xmyvp.lambda-url.us-east-1.on.aws/?id=${s}`),t=await e.json();if(404===e.status)f(!0);else if(e.ok)o(t),f(!1);else throw Error("Failed to fetch feedback form data")}catch(e){m(e instanceof Error?e.message:"An error occurred")}finally{c(!1)}})()},[s,e.isReady]),i)?(0,a.jsx)("div",{className:"flex h-64 items-center justify-center",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsxs)("svg",{className:"mx-auto h-12 w-12 animate-spin text-[#FF9900]",fill:"none",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),(0,a.jsx)("p",{className:"text-slate-400",children:"Loading your feedback form..."})]})}):h?(0,a.jsx)("div",{className:"mx-auto max-w-2xl p-6",children:(0,a.jsxs)("div",{className:"rounded-lg bg-red-500/10 p-8 text-center",children:[(0,a.jsx)("div",{className:"mb-6",children:(0,a.jsx)("svg",{className:"mx-auto h-24 w-24 text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,a.jsx)("h3",{className:"mb-2 text-2xl font-bold text-red-300",children:"Oops! Form Not Found"}),(0,a.jsx)("p",{className:"mb-4 text-lg text-red-400",children:"Looks like this feedback form went on a coffee break!"}),(0,a.jsxs)("div",{className:"rounded-lg bg-slate-900 p-4 shadow-sm",children:[(0,a.jsx)("p",{className:"text-sm text-slate-400",children:"Don't worry, we've sent our best detectives to find it."}),(0,a.jsxs)("p",{className:"text-sm text-slate-400",children:["You could also send us an email at ",(0,a.jsx)("a",{href:"mailto:[email protected]",children:"[email protected]"})," to let us know."]})]})]})}):d?(0,a.jsx)("div",{className:"p-4 text-red-400",children:d}):t?x?(0,a.jsxs)("div",{className:"rounded-lg bg-emerald-500/10 p-4",children:[(0,a.jsx)("h3",{className:"font-medium text-emerald-300",children:"Thank you for your feedback!"}),(0,a.jsx)("p",{className:"mt-1 text-emerald-400",children:"Your responses have been submitted successfully."})]}):y?(0,a.jsx)("div",{className:"mx-auto max-w-2xl p-6",children:(0,a.jsxs)("div",{className:"rounded-lg bg-blue-500/10 p-8 text-center",children:[(0,a.jsx)("div",{className:"mb-6",children:(0,a.jsx)("svg",{className:"mx-auto h-24 w-24 text-blue-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,a.jsx)("h3",{className:"mb-2 text-2xl font-bold text-blue-300",children:"Thank You!"}),(0,a.jsx)("p",{className:"mb-4 text-lg text-blue-400",children:"You have already submitted your feedback for this form."}),(0,a.jsx)("div",{className:"rounded-lg bg-slate-900 p-4 shadow-sm",children:(0,a.jsx)("p",{className:"text-sm text-slate-400",children:"We appreciate your time and feedback."})})]})}):(0,a.jsxs)("div",{className:"mx-auto max-w-2xl p-6",children:[(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsx)("h2",{className:"mb-2 text-2xl font-bold text-white",children:t.title}),(0,a.jsx)("p",{className:"text-slate-400",children:t.description}),t.link&&(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsx)("p",{className:"font-bold text-white",children:"Related Resources"}),(0,a.jsx)("ul",{className:"mt-2 list-disc space-y-2 pl-5",children:Array.isArray(t.link)?t.link.map((e,s)=>(0,a.jsx)("li",{children:(0,a.jsxs)("a",{href:e.value,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-[#FF9900] hover:text-[#FF9900]",children:[(0,a.jsx)("span",{children:e.name}),(0,a.jsx)("svg",{className:"ml-1 h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})},s)):(0,a.jsx)("li",{children:(0,a.jsxs)("a",{href:t.link.value,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-[#FF9900] hover:text-[#FF9900]",children:[(0,a.jsx)("span",{children:t.link.name}),(0,a.jsx)("svg",{className:"ml-1 h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})})})]})]}),(0,a.jsxs)("form",{onSubmit:e=>{g(F)(e)},className:"space-y-8",children:[t.questions.map((e,s)=>(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("label",{className:"block text-base font-semibold text-slate-300",children:e.text}),e.note&&(0,a.jsx)("p",{className:"text-sm text-slate-400",children:e.note}),"text"===e.type&&(0,a.jsx)("textarea",{...w(`answers.${e.id}.answer`),className:"w-full rounded-md border border-slate-700 px-3 py-2 focus:border-[#FF9900] focus:outline-none focus:ring-1 focus:ring-orange-500",rows:3}),"rating"===e.type&&(0,a.jsx)("div",{className:"flex space-x-2",children:[1,2,3,4,5].map(s=>(0,a.jsx)("button",{type:"button",className:`flex h-10 w-10 items-center justify-center rounded-full border ${p[e.id]===s?"border-[#FF9900] bg-[#FF9900]/15 text-[#FF9900]":"border-slate-700 hover:bg-[#FF9900]/10"} focus:outline-none focus:ring-2 focus:ring-orange-500`,onClick:()=>{b(t=>
1({...t,[e.id]:s})),k(`answers.${e.id}.answer`,s)},children:s},s))}),"multiple_choice"===e.type&&e.options&&(0,a.jsx)("div",{className:"space-y-2",children:e.options.map(s=>(0,a.jsxs)("label",{className:"flex items-center",children:[(0,a.jsx)("input",{type:"radio",value:s,...w(`answers.${e.id}.answer`,{setValueAs:e=>e}),className:"h-4 w-4 border-slate-700 text-[#FF9900] focus:ring-orange-500"}),(0,a.jsx)("span",{className:"ml-2 text-sm text-slate-300",children:s})]},s))}),s<t.questions.length-1&&(0,a.jsx)("div",{className:"border-t border-slate-800 pt-8"})]},e.id)),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-slate-300",children:"Email (optional)"}),(0,a.jsx)("input",{type:"email",...w("email"),className:"w-full rounded-md border border-slate-700 px-3 py-2 focus:border-[#FF9900] focus:outline-none focus:ring-1 focus:ring-orange-500",placeholder:"[email protected]"}),(0,a.jsxs)("p",{className:"text-xs text-slate-400",children:["If you have any questions, you can optionally provide your email address. We will ",(0,a.jsx)("b",{children:"only"})," use it to contact you regarding your feedback or questions. We will ",(0,a.jsx)("b",{children:"not"})," use it for any other purpose."]})]}),(0,a.jsx)("div",{children:(0,a.jsx)("button",{type:"submit",disabled:j,className:"flex w-full justify-center rounded-md border border-transparent bg-orange-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-orange-700 focus:outline-none focus:ring-2 focus:ring-orange-500 focus:ring-offset-2 disabled:opacity-75",children:j?(0,a.jsxs)("svg",{className:"h-5 w-5 animate-spin text-white",fill:"none",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):"Submit Feedback"})})]})]}):(0,a.jsx)("div",{className:"p-4 text-slate-400",children:"No feedback form available"})}var i=t(9759),c=t.n(i);function d(){return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(c(),{children:[(0,a.jsx)("title",{children:"Feedback Form | AWS Fundamentals"}),(0,a.jsx)("meta",{name:"description",content:"Share your feedback about AWS Fundamentals"})]}),(0,a.jsx)("div",{className:"min-h-screen bg-slate-900/40 py-12",children:(0,a.jsx)("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:(0,a.jsx)(o,{})})})]})}}},e=>{e.O(0,[5496,636,6593,8792],()=>e(e.s=9770)),_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.