PageSourceSearch

https://www.adrian.co/assets/FormSubmissionMessage-oDoAoGYl.js

js adrian.co collected 2026-10-04 16:03:14 UTC 10,743 bytes, 5 lines download raw bytes

1
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e079ea6f-d0fc-5144-9f8c-8c642d258511")}catch(e){}}();
3import{a as e,t}from"./jsx-runtime-CMgEUHpv.js";import{V as n}from"./dist-CAHjj65Z.js";import{t as r}from"./useTranslation-BymTnaHx.js";import{t as i}from"./classnames-PxzWHlFm.js";import{t as a}from"./Text-B4PqLHDw.js";import{t as o}from"./ChevronDownIcon-B_shkkzD.js";import{t as s}from"./StatusInputs-Bo_bMqPM.js";import{t as c}from"./Image-B1Otrzxn.js";import{t as l}from"./Button-DG1GtAKw.js";import{t as u}from"./menu-BwR_gk66.js";import{t as d}from"./transition-zOPc9j2i.js";var f=e(n());function p({title:e,titleId:t,...n},r){return f.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?f.createElement(`title`,{id:t},e):null,f.createElement(`path`,{fillRule:`evenodd`,d:`M16.28 11.47a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 0 1-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 0 1 1.06-1.06l7.5 7.5Z`,clipRule:`evenodd`}))}var m=f.forwardRef(p),h=t(),g=({name:e,title:t,description:n})=>(0,h.jsxs)(`div`,{children:[(0,h.jsxs)(`div`,{className:`relative mb-1 mt-1 inline-flex items-center space-x-1 overflow-hidden rounded-wt px-2 py-1 text-xs`,children:[(0,h.jsx)(`div`,{className:`absolute inset-0 bg-wt-primary text-wt-primary opacity-10`}),(0,h.jsx)(`span`,{className:`z-10 font-medium text-wt-primary`,children:e})]}),(0,h.jsx)(a,{as:`h1`,size:`3xl`,weight:`bold`,theme:`default`,type:`title`,children:t}),n&&(0,h.jsx)(a,{as:`h4`,size:`lg`,weight:`light`,theme:`default`,type:`body`,children:n})]}),_=function(e){return e.FREE_FORM=`free_form`,e.MULTIPLE_CHOICE=`multiple_choice`,e.DROPDOWN=`dropdown`,e.LONG_TEXT=`long_text`,e}({}),v=e(i(),1),y=({actions:e,buttonText:t=`Actions`,node:n,size:r=`md`,dropdownClass:i=`right-0`,buttonClass:a=``,optionClass:s=``,disabled:c})=>{let l=r===`sm`;return(0,h.jsxs)(u,{as:`div`,className:`relative inline-block text-left`,children:[(0,h.jsx)(`div`,{children:(0,h.jsxs)(u.Button,{disabled:c,className:(0,v.default)(a,`border-surface-200 z-0 inline-flex w-full justify-center whitespace-nowrap border bg-white text-sm font-medium text-gray-800 focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75`,l?`px-2 py-1`:`px-4 py-2`),children:[t,(0,h.jsx)(o,{className:`-mr-1 ml-2 h-5 w-5 text-gray-800`,"aria-hidden":`true`})]})}),(0,h.jsx)(d,{as:f.Fragment,enter:`transition ease-out duration-100`,enterFrom:`transform opacity-0 scale-95`,enterTo:`transform opacity-100 scale-100`,leave:`transition ease-in duration-75`,leaveFrom:`transform opacity-100 scale-100`,leaveTo:`transform opacity-0 scale-95`,children:(0,h.jsx)(u.Items,{className:(0,v.default)(`absolute z-10 w-56 origin-top-right divide-y divide-gray-100 bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none`,i),children:e.map(e=>(0,h.jsx)(`div`,{className:`px-1 py-1`,children:e.map(e=>{if(!e.isVisible(n))return null;let t=e.name.split(` `).length===1&&`break-all`;return(0,h.jsx)(`div`,{children:(0,h.jsx)(u.Item,{children:({active:r})=>(0,h.jsx)(`button`,{"data-tip":!0,"data-for":e.name,className:(0,v.default)(r?`bg-primary-100 text-primary-800`:`text-gray-900`,e.isCurrent?`text-primary-800`:`text-gray-900`,`group flex w-full items-center rounded-md px-2 py-2 text-sm`,s,t),type:`button`,onClick:()=>e.onClick(n),children:e.name})})},e.name)})},JSON.stringify(e)))})})]})},b=({question:e})=>{let[t,n]=(0,f.useState)(``),r=e.form_question_options.map(e=>({name:e.value,isCurrent:t===e.value,onClick:()=>{n(e.value)},isVisible:()=>!0})),i=e.form_question_options.find(e=>e.value===t)?.value||`Please select a value`;return(0,h.jsxs)(`fieldset`,{className:`mt-2 space-y-2`,children:[(0,h.jsx)(`input`,{id:e.id,name:e.id,type:`hidden`,value:t}),(0,h.jsx)(y,{buttonText:i,size:`md`,actions:[r],node:{},buttonClass:(0,v.default)(t?`text-black`:`text-gray-400 text-opacity-50`,`wt-body-font w-full rounded-wt border-2 border-gray-200 text-base font-light shadow-md focus:border-wt-primary focus:outline-none sm:shadow-none`),dropdownClass:`left-0 wt-body-font text-base rounded-wt font-light text-black shadow-md`,optionClass:`text-left break-words`})]})},x=({question:e})=>{let[t,n]=(0,f.useState)(0),{t:i}=r(),o=e.max_character_limit?Math.min(1e3,e.max_character_limit):400,s=e.min_character_limit&&t<e.min_character_limit?`text-red-500`:`text-gray-500`,c=o-t<20?`text-red-500`:`text-gray-500`,l=e.required||e.min_character_limit>0;return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`textarea`,{className:`wt-body-font h-28 w-full rounded-wt border-2 border-gray-200 text-base font-light text-black placeholder-gray-400 shadow-md focus:border-wt-primary focus:outline-none focus:ring-0 sm:shadow-none`,maxLength:o,minLength:e.min_character_limit,name:e.id,required:l,placeholder:i(`forms.placeholders.string`).toString(),onChange:e=>n(e.target.value.length)}),e.min_character_limit>0&&(0,h.jsx)(a,{size:`sm`,theme:`default`,type:`title`,children:(0,h.jsxs)(`span`,{className:(0,v.default)(s,`text-xs`),children:[`Minumum entry size of `,e.min_character_limit,` characters`]})}),(0,h.jsx)(a,{size:`sm`,theme:`default`,type:`title`,children:(0,h.jsx)(`span`,{className:`inline-block`,children:(0,h.jsxs)(`span`,{className:(0,v.default)(s,c,`text-xs`),children:[`Characters remaining: `,o-t]})})})]})},S=({question:e,questionOption:t,checkedBoxes:n,setCheckedBoxes:r})=>{let i=e.required;i&&e.multi_select&&n>0&&(i=!1);let a=e=>{e.target.checked?r(n+1):r(n-1)};return(0,h.jsxs)(`div`,{className:`flex items-center`,children:[(0,h.jsx)(`input`,{id:t.id,name:e.id,value:t.value,type:e.multi_select?`checkbox`:`radio`,required:i,defaultChecked:!1,className:`h-5 w-5 cursor-pointer border-gray-300 text-wt-primary focus:ring-wt-primary`,onCh
3ange:e=>{a(e)}}),(0,h.jsx)(`label`,{htmlFor:t.id,className:`text-md wt-body-font ml-3 block cursor-pointer font-semibold text-gray-700`,children:t.value})]})},C=({question:e})=>{let[t,n]=(0,f.useState)(0);return(0,h.jsx)(`fieldset`,{className:`mt-2 space-y-2`,children:e.form_question_options.map(r=>(0,h.jsx)(S,{question:e,questionOption:r,checkedBoxes:t,setCheckedBoxes:n},r.id))})},w=({name:e,required:t})=>{let{t:n}=r();return(0,h.jsx)(`div`,{children:(0,h.jsx)(`fieldset`,{className:``,children:(0,h.jsxs)(`div`,{className:`space-y-2`,children:[(0,h.jsx)(`div`,{className:`flex items-center`,children:(0,h.jsxs)(`label`,{className:`text-md wt-body-font block flex cursor-pointer items-center font-semibold text-gray-700`,children:[(0,h.jsx)(`input`,{name:e,value:`true`,type:`radio`,required:t,defaultChecked:!1,className:`h-5 w-5 cursor-pointer border-gray-300 text-wt-primary focus:ring-wt-primary`}),(0,h.jsx)(`span`,{className:`pl-2`,children:n(`forms.labels.true`)})]})}),(0,h.jsx)(`div`,{className:`flex items-center`,children:(0,h.jsxs)(`label`,{className:`text-md wt-body-font block flex cursor-pointer items-center font-semibold text-gray-700`,children:[(0,h.jsx)(`input`,{name:e,value:`false`,type:`radio`,required:t,defaultChecked:!1,className:`h-5 w-5 cursor-pointer border-gray-300 text-wt-primary focus:ring-wt-primary`}),(0,h.jsx)(`span`,{className:`pl-2`,children:n(`forms.labels.false`)})]})})]})})})},T=({type:e,placeholder:t,name:n,required:r})=>(0,h.jsx)(`input`,{required:r,type:e,name:n,className:`wt-body-font block w-full rounded-wt border-2 border-gray-200 bg-white px-5 py-2 text-base font-light text-black placeholder-gray-400 shadow-md focus:border-2 focus:border-wt-primary focus:outline-none sm:shadow-none`,placeholder:t}),E=({name:e,type:t,required:n})=>{let{t:i}=r();switch(t){case`string`:return(0,h.jsx)(T,{name:e,type:`text`,required:n,placeholder:i(`forms.placeholders.string`)});case`integer`:return(0,h.jsx)(T,{name:e,type:`number`,required:n,placeholder:i(`forms.placeholders.integer`)});case`boolean`:return(0,h.jsx)(w,{name:e,required:n});case`date`:return(0,h.jsx)(T,{name:e,type:`date`,placeholder:i(`forms.placeholders.date`),required:n});case`datetime`:return(0,h.jsx)(T,{name:e,type:`time`,placeholder:i(`forms.placeholders.datetime`),required:n});default:return(0,h.jsx)(T,{name:e,type:`text`,placeholder:i(`forms.placeholders.default`),required:n})}},D=({questions:e})=>(0,h.jsx)(`div`,{className:`space-y-6`,children:e.map((e,t)=>{let n=t+1,r=e.question_type===_.FREE_FORM,i=e.question_type===_.MULTIPLE_CHOICE,o=e.question_type===_.LONG_TEXT,s=e.question_type===_.DROPDOWN;return(0,h.jsxs)(`div`,{className:`space-y-1`,children:[(0,h.jsxs)(a,{as:`h6`,size:`lg`,weight:`semibold`,theme:`default`,type:`title`,children:[(0,h.jsxs)(`span`,{className:`mr-2`,children:[n,`.`]}),e.prompt,e.required&&(0,h.jsx)(`span`,{className:`mr-2`,children:`*`})]}),(0,h.jsxs)(`div`,{children:[o&&(0,h.jsx)(x,{question:e}),r&&(0,h.jsx)(E,{name:e.id,required:e.required,type:e.custom_field.kind}),i&&(0,h.jsx)(C,{question:e}),s&&(0,h.jsx)(b,{question:e})]})]},e.id)})}),O=({email:e,publication:t,form:n,isSubmitting:i,isPreview:a=!1,onPreviewSubmit:o})=>{let{t:c}=r(),u=n.cta_text||c(`shared.cta.submit`);return(0,h.jsxs)(`div`,{className:`space-y-8`,children:[(0,h.jsx)(g,{name:t.name,title:n.title,description:n.description}),(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`input`,{name:`email`,type:`hidden`,value:e}),(0,h.jsx)(`input`,{name:`form_id`,type:`hidden`,value:n.id}),(0,h.jsx)(`input`,{name:`publication_id`,type:`hidden`,value:t.id}),(0,h.jsx)(s,{name:`no_subscription`,errorMessage:c(`forms.toast.no_subscription`),successMessage:``}),(0,h.jsx)(s,{name:`form_response`,errorMessage:c(`errors.default`),successMessage:c(`forms.toast.success`)}),(0,h.jsx)(D,{questions:n.form_questions})]}),(0,h.jsx)(`div`,{className:`flex w-full justify-between`,children:a?(0,h.jsx)(l,{type:`button`,variant:`primary`,onClick:o,disabled:i,children:i?`${c(`shared.actions.submitting`)}...`:u}):(0,h.jsx)(l,{type:`submit`,variant:`primary`,disabled:i,children:i?`${c(`shared.actions.submitting`)}...`:u})})]})},k=({message:e,children:t,logo:n,logoAlt:r})=>(0,h.jsxs)(`div`,{className:`flex flex-col items-center space-y-8 pt-16`,children:[(0,h.jsx)(`div`,{className:`h-24 w-24 overflow-hidden rounded shadow-md`,children:n&&(0,h.jsx)(c,{src:n,alt:r,maxWidth:200,aspectRatio:`square`})}),(0,h.jsx)(a,{as:`h6`,size:`2xl`,weight:`semibold`,type:`title`,theme:`default`,className:`max-w-md text-center`,children:e}),(0,h.jsx)(`div`,{children:t})]});
3export{m as i,O as n,g as r,k as t};
4//# sourceMappingURL=FormSubmissionMessage-oDoAoGYl.js.map
5//# debugId=e079ea6f-d0fc-5144-9f8c-8c642d258511

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.