1import{j as t}from"./jsx-runtime.BmMlpIyE.js";import{r as q}from"./index.Bi0mM-7B.js";import{e as x,b as g,d as C,u as R,F as W,a as K,c as Y}from"./recaptchaUtils.CU2t2HVb.js";import{I as O,f as U}from"./InsiderInfo.0TWeI0YU.js";import{i as Q}from"./InfoWallInit.DJZd5Tb-.js";import{w as V,c as B}from"./debug-build.J23Xc8J1.js";import{a as _}from"./breadcrumbs.4DJNv9wz.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};n.SENTRY_RELEASE={id:"c71e717f85102b72b3e962a3fd03a66f506af669"};var r=new n.Error().stack;r&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[r]="297e1872-1df0-4f19-b7db-e3bae2d2e80c",n._sentryDebugIdIdentifier="sentry-dbid-297e1872-1df0-4f19-b7db-e3bae2d2e80c")}catch{}})();function G({fieldName:n,question:r,required:o,options:s}){const{isSubmitting:l,errors:c,touched:p}=x();return t.jsxs(t.Fragment,{children:[t.jsxs("div",{id:`${n}-radio-group`,className:"mt-4 text-left font-bold",children:[r,o&&t.jsx("span",{className:"text-red-600",children:"*"})]}),t.jsx("div",{role:"group","aria-labelledby":`${n}-radio-group`,className:"flex flex-row flex-wrap form-checkbox-parent",children:s.map(function(m,w){return t.jsxs("label",{children:[t.jsx(g,{type:"radio",className:`form-radio ${y(n,c,p)}`,name:n,value:m.value,disabled:l}),m.label]},w)})})]})}function H({fieldName:n,question:r,required:o}){const{isSubmitting:s,errors:l,touched:c}=x();return t.jsxs(t.Fragment,{children:[t.jsxs("div",{id:`${n}-email`,className:"mt-4 text-left font-bold",children:[r,o&&t.jsx("span",{className:"text-red-600",children:"*"})]}),t.jsx(g,{type:"email",className:`form-input w-full md:w-96 ${y(n,l,c)}`,name:n,disabled:s})]})}function L({fieldName:n,question:r,required:o}){const{isSubmitting:s,errors:l,touched:c}=x();return t.jsxs(t.Fragment,{children:[t.jsxs("div",{id:`${n}-textarea`,className:"mt-4 text-left font-bold",children:[r,o&&t.jsx("span",{className:"text-red-600",children:"*"})]}),t.jsx(g,{type:"textarea",as:"textarea",className:`form-textarea w-full ${y(n,l,c)}`,rows:"2",name:n,disabled:s})]})}function z({fieldName:n,question:r,required:o}){const{isSubmitting:s,errors:l,touched:c}=x();return t.jsxs(t.Fragment,{children:[t.jsxs("div",{id:`${n}-text`,className:"mt-4 text-left font-bold",children:[r,o&&t.jsx("span",{className:"text-red-600",children:"*"})]}),t.jsx(g,{type:"text",className:`form-input w-full ${y(n,l,c)}`,name:n,disabled:s})]})}function J({fieldName:n,question:r,required:o}){const{isSubmitting:s}=x();return t.jsxs(t.Fragment,{children:[t.jsxs("div",{id:`${n}-radio-group`,className:"mt-4 text-left font-bold",children:[r,o&&t.jsx("span",{className:"text-red-600",children:"*"})]}),t.jsx(g,{type:"checkbox",className:"form-checkbox",name:n,disabled:s})]})}class e{constructor(r,o){this.label=r,this.value=o}label;value}function T(n){return n?C().required("Required"):C().optional()}class b{constructor(r,o,s,l=T(o)){this.question=r,this.required=o,this.recycleValue=s,this.validation=l}question;required;recycleValue;validation}class A extends b{constructor(r,o){super(r,o,!0)}writeInterface(r,o){return t.jsx(J,{fieldName:o,question:this.question,required:this.required},r)}}class i extends b{constructor(r,o,s){super(r,o,!0),this.options=s}options;mapOptions(){return this.options.map(r=>({label:r.label,value:r.value}))}writeInterface(r,o){return t.jsx(G,{fieldName:o,question:this.question,required:this.required,options:this.mapOptions()},r)}}class X extends b{constructor(r,o){super(r,o,!0,T(o).email("Invalid email"))}writeInterface(r,o){return t.jsx(H,{fieldName:o,question:this.question,required:this.required},r)}}class f extends b{constructor(r,o,s){super(r,o,s)}writeInterface(r,o){return t.jsx(z,{fieldName:o,question:this.question,required:this.required},r)}}class F extends b{constructor(r,o,s){super(r,o,s)}writeInterface(r,o){return t.jsx(L,{fieldName:o,question:this.question,required:this.required},r)}}const Z={dogCat:new i("Dogs or Cats 22?",!0,[new e("Dogs","Dogs"),new e("Cats","Cats")]),favColor:new i("What's your favorite color?",!0,[new e("Red","Red"),new e("Yellow","Yellow"),new e("Green","Green"),new e("Blue","Blue"),new e("
1Violet","Violet")]),engManager:new i("Are you an engineering manager?",!0,[new e("Yes","Yes"),new e("No","No")]),currKmp:new i(`Are you currently ______ 2 Kotlin Multiplatform 3 (KMP)?`,!0,[new e("Exploring","Exploring"),new e("Comparing","Comparing"),new e("Piloting","Piloting"),new e("Scaling","Scaling"),new e("No Activity With","No Activity With")]),appPlan:new i("Where do you plan to use KMP?",!0,[new e("Existing App","Existing App"),new e("New App","New App"),new e("Both","Both"),new e("Neither","Neither")]),appRepo:new i("If an existing app, what is your repo structure?",!0,[new e("Apps in separate repos","separate repos"),new e("Apps in same repo","same repo"),new e("No existing app","new app")]),engRole:new i("What is your role (if you had to pick)?",!0,[new e("Engineering Manager","Engineering Manager"),new e("iOS Developer","iOS Developer"),new e("Android Developer","Android Developer"),new e("Developer (other)","Other Developer"),new e("Non-technical","Non-technical"),new e("None of the above","None")]),mobileTeamSize2:new i(`How many mobile developers are on your team? 4?`,!0,[new e("0 or 1","0 or 1"),new e("2-5","2-5"),new e("5-10","5-10"),new e("More than 10","More than 10")]),currKmpOpt:new i(`Are you currently ______ 5 Kotlin Multiplatform 6 (KMP)?`,!1,[new e("Exploring","Exploring"),new e("Comparing","Comparing"),new e("Piloting","Piloting"),new e("Scaling","Scaling"),new e("No Activity With","No Activity With")]),teamRole:new i("Your role (or of those joining the call)",!0,[new e("Decision Maker","Decision Maker"),new e("Technical Team Lead","Technical Team Lead"),new e("Mobile Developer","Mobile Developer"),new e("Other (please explain below)","Other")]),currKmpDiscussions:new i(`Are you currently ______ 7?`,!0,[new e("using KMP in production","Using In Prod"),new e("exploring KMP","Exploring"),new e("explored, but not using","Explored/Rejected")]),mobileTeamSize:new i(`How many mobile developers are on your team? 8?`,!0,[new e("0 to 3","0 to 3"),new e("4 to 7","4 to 7"),new e("8 to 15","8 to 15"),new e("More than 15","More than 15")]),moreContext:new F("Any other context you'd like to provide? (optional)",!1,!1),outside:new i("Are you interested in finding a way to work with Touchlab?",!0,[new e("Yes","Yes"),new e("Not sure","Not sure"),new e("No","No")]),interestedInWorkingWithUs:new i("Are you interested in finding a way to work with Touchlab?",!0,[new e("Yes","Yes"),new e("Not sure","Not sure"),new e("No","No")]),newsCategory:new i("What kind of news are you interested in?",!0,[new e("All","All"),new e("Technical","Technical"),new e("Organizational/Team","Team"),new e("Industry","Industry")]),companyName:new f("Company Name",!0,!0),contactName:new f("Full Name",!0,!0),contactNameOpt:new f("Full Name",!1,!0),contactEmail:new X("Email Address",!0),contactCompany:new f("Company",!1,!0),contactPhone:new f("Phone Number",!1,!0),contactYourProject:new F("Please provide some background on your project.",!1,!1),makeKmpBetter:new F("How can Touchlab make KMP better for you?",!0,!1),newsletterCheckbox:new A("Subscribe to the Touchlab newsletter",!1),oldGuideCheckbox:new A("Also, send me the original guide!",!1),newGuideCheckbox:new A("Also, sign me up for the new guide!",!1)};function E(n){return Z[n]}function y(n,r,o){return`${r[n]&&o[n]?"border-red-400":"border-neutral-500"} bg-neutral-800`}const ie=({formType:n,questions:r,updateExisting:o=!0,successMessage:s="Thanks, all set!",hiddenValues:l={},afterDone:c,children:p})=>{let m=new O;const w=m.getUniqueUserId(),[j,k]=q.useState(!1),[M,v]=q.useState(!1),P=R(),I={...l,uniqueUserId:w||""},S={},N=[];r.forEach(a=>{const u=E(a).recycleValue?m.getUserValue(a):"";N.push(a),I[a]=u||"",S[a]=E(a).validation}),q.useEffect(()=>{j&&c&&setTimeout(c,2e3)},[j]);const $=(a,h)=>h.some(u=>a[u]);return j?t.jsx(t.Fragment,{children:t.jsx("h3",{className:"h3",children:s})}):t.jsxs(t.Fragment,{children:[M&&t.jsx("h3",{className:"h3 text-red-400",children:"Post failed. Please try again."}),t.jsx(W,{initialValues:I,validationSchema:Y().shape(S),onSubmit:async(a,{setSubmitting:h})=>{v(!1);
8try{_({category:"form",message:`Requesting reCAPTCHA token for ${n}`,level:"info"});const u=await P.getToken("AllQuestions");_({category:"form",message:`Submitting form: ${n}`,level:"info"});const d=await U(a.uniqueUserId,n,a,o,u);d.processed?(m.applyUserInfo(d.infoWallUserReply),k(!0),setTimeout(Q,1e3)):v(!0)}catch(u){V(d=>{d.setTag("feature","forms"),d.setContext("form",{formType:n,uniqueUserId:w}),B(u)}),console.error(`Form submission failed (${n})`,u),v(!0)}finally{h(!1)}},children:({isSubmitting:a,values:h,errors:u})=>t.jsxs(K,{className:"flex flex-col items-start",children:[N.map((d,D)=>E(d).writeInterface(`qu_${D}`,d)),t.jsxs("div",{className:"mt-4",children:[t.jsx("span",{className:"text-red-600",children:"*"})," ",t.jsx("span",{className:`${$(u,N)?"text-red-400":""}`,children:"Mandatory field"})]}),t.jsxs("div",{className:"w-full mt-8",children:[p&&t.jsx(t.Fragment,{children:p}),!p&&t.jsx("button",{type:"submit",disabled:a,className:`btn text-white ${a?"bg-neutral-600 hover:bg-neutral-700":"bg-cyan-600 hover:bg-cyan-700"} text-lg w-full`,children:a?"Submitting...":"Submit"})]})]})})]})};export{ie 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.