Jake Vanderwerf
2026-05-11 ac444cba221832c012c0435fdc8339fe9f37febb
build/forms/index.js
@@ -1 +1 @@
(()=>{"use strict";var e,l={677:()=>{const e=window.wp.blocks,l=window.wp.i18n,a=window.wp.blockEditor,t=window.wp.components,i=window.wp.element,s=window.ReactJSXRuntime;(0,e.registerBlockType)("jvb/forms",{edit:function({attributes:e,setAttributes:r}){const{formType:o,showLabels:b,customEmailTo:n,turnstileEnabled:d}=e,[v,c]=(0,i.useState)(!0),j=(0,a.useBlockProps)({className:"jvb-form-block "+(o?`jvb-form-block-${o}`:"")}),p="undefined"!=typeof window&&window.jvbFormsData&&window.jvbFormsData.formTypes?window.jvbFormsData.formTypes:[{label:(0,l.__)("Select a form type","jvb"),value:""},{label:(0,l.__)("No forms available","jvb"),value:"",disabled:!0}],u=(console.log(window.jvbFormsData),"undefined"!=typeof window&&window.jvbFormsData&&window.jvbFormsData.availableForms?window.jvbFormsData.availableForms:{}),m=(()=>{const e=o&&u[o]?u[o]:null;return e?{title:e.title||(0,l.__)("Form","jvb"),description:Array.isArray(e.description)?e.description.join(" "):e.description||"",button:e.submit||(0,l.__)("Submit","jvb")}:{title:(0,l.__)("Form","jvb"),description:o?(0,l.__)("Loading form configuration...","jvb"):(0,l.__)("Please select a form type in the sidebar","jvb"),button:(0,l.__)("Submit","jvb")}})();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(a.InspectorControls,{children:[(0,s.jsxs)(t.PanelBody,{title:(0,l.__)("Form Settings","jvb"),children:[(0,s.jsx)(t.SelectControl,{label:(0,l.__)("Form Type","jvb"),value:o,options:p,onChange:e=>r({formType:e})}),(0,s.jsx)(t.ToggleControl,{label:(0,l.__)("Show Field Labels","jvb"),checked:b,onChange:e=>r({showLabels:e}),help:(0,l.__)("Toggle to show or hide field labels.","jvb")}),(0,s.jsx)(t.TextControl,{label:(0,l.__)("Custom Recipient Email","jvb"),value:n||"",onChange:e=>r({customEmailTo:e}),help:(0,l.__)("Leave empty to use the default email.","jvb"),type:"email"})]}),(0,s.jsxs)(t.PanelBody,{title:(0,l.__)("Form Preview","jvb"),initialOpen:!1,children:[(0,s.jsx)(t.ToggleControl,{label:(0,l.__)("Show Preview","jvb"),checked:v,onChange:e=>c(e)}),(0,s.jsx)("p",{className:"components-base-control__help",children:(0,l.__)("This is just a preview. The actual form will be rendered on the frontend.","jvb")})]})]}),(0,s.jsx)("div",{...j,children:v?(()=>{if(!o)return(0,s.jsx)(t.Notice,{status:"warning",isDismissible:!1,children:(0,l.__)("Please select a form type in the block settings.","jvb")});let e=[];switch(o){case"contact":e=[{id:"name",label:(0,l.__)("Name","jvb"),type:"text",required:!0},{id:"email",label:(0,l.__)("Email","jvb"),type:"email",required:!0},{id:"phone",label:(0,l.__)("Phone","jvb"),type:"tel",required:!0},{id:"instagram",label:(0,l.__)("Instagram URL","jvb"),type:"url"},{id:"contact_methods",label:(0,l.__)("Preferred Contact","jvb"),type:"checkboxes",options:[{value:"text",label:(0,l.__)("Text","jvb")},{value:"call",label:(0,l.__)("Call","jvb")},{value:"email",label:(0,l.__)("Email","jvb")},{value:"instagram",label:(0,l.__)("Instagram","jvb")}]},{id:"message",label:(0,l.__)("Your Message","jvb"),type:"textarea",required:!0}];break;case"feature_request":e=[{id:"name",label:(0,l.__)("Name","jvb"),type:"text",help:(0,l.__)("Required if you want us to follow up.","jvb")},{id:"email",label:(0,l.__)("Email","jvb"),type:"email",help:(0,l.__)("Required if you want us to follow up.","jvb")},{id:"follow_up",label:(0,l.__)("Would you like me to follow up with you?","jvb"),type:"checkbox"},{id:"target_audience",label:(0,l.__)("This Feature is For","jvb"),type:"checkboxes",options:[{value:"artists",label:(0,l.__)("Artists","jvb")},{value:"visitors",label:(0,l.__)("Site Visitors","jvb")},{value:"partners",label:(0,l.__)("Partners","jvb")},{value:"other",label:(0,l.__)("Other","jvb")}]},{id:"feature_name",label:(0,l.__)("Name your Feature","jvb"),type:"text",required:!0},{id:"message",label:(0,l.__)("Describe Your Feature","jvb"),type:"textarea",required:!0}];break;case"technical_issue":e=[{id:"name",label:(0,l.__)("Name","jvb"),type:"text"},{id:"email",label:(0,l.__)("Email","jvb"),type:"email"},{id:"follow_up",label:(0,l.__)("Would you like me to follow up with you?","jvb"),type:"checkbox"},{id:"issue_type",label:(0,l.__)("Type of Issue","jvb"),type:"checkboxes",options:[{value:"visual",label:(0,l.__)("Visual","jvb")},{value:"error",label:(0,l.__)("Error Page","jvb")},{value:"other",label:(0,l.__)("Other","jvb")}]},{id:"message",label:(0,l.__)("Please describe the issue.","jvb"),type:"textarea",required:!0}]}return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h3",{className:"jvb-form-title",children:m.title}),(0,s.jsx)("p",{className:"jvb-form-description",children:m.description}),(0,s.jsxs)("div",{className:"jvb-form-preview",children:[e.map((e=>(0,s.jsxs)("div",{className:"jvb-form-field",children:[b&&(0,s.jsx)("label",{htmlFor:`jvb-${e.id}`,className:e.required?"required":"",children:e.label}),"text"===e.type&&(0,s.jsx)("input",{type:"text",id:`jvb-${e.id}`,placeholder:b?"":e.label,disabled:!0}),"email"===e.type&&(0,s.jsx)("input",{type:"email",id:`jvb-${e.id}`,placeholder:b?"":e.label,disabled:!0}),"tel"===e.type&&(0,s.jsx)("input",{type:"tel",id:`jvb-${e.id}`,placeholder:b?"":e.label,disabled:!0}),"url"===e.type&&(0,s.jsx)("input",{type:"url",id:`jvb-${e.id}`,placeholder:b?"":e.label,disabled:!0}),"textarea"===e.type&&(0,s.jsx)("textarea",{id:`jvb-${e.id}`,placeholder:b?"":e.label,disabled:!0,rows:"4"}),"checkbox"===e.type&&(0,s.jsxs)("div",{className:"jvb-form-checkbox",children:[(0,s.jsx)("input",{type:"checkbox",id:`jvb-${e.id}`,disabled:!0}),(0,s.jsx)("label",{htmlFor:`jvb-${e.id}`,children:e.label})]}),"checkboxes"===e.type&&e.options&&(0,s.jsx)("div",{className:"jvb-form-checkboxes",children:e.options.map((l=>(0,s.jsxs)("div",{className:"jvb-form-checkbox",children:[(0,s.jsx)("input",{type:"checkbox",id:`jvb-${e.id}-${l.value}`,disabled:!0}),(0,s.jsx)("label",{htmlFor:`jvb-${e.id}-${l.value}`,children:l.label})]},l.value)))}),e.help&&(0,s.jsx)("p",{className:"jvb-form-help",children:e.help})]},e.id))),d&&(0,s.jsx)("div",{className:"jvb-form-turnstile",children:(0,s.jsx)("div",{className:"jvb-turnstile-placeholder",children:(0,s.jsx)("span",{children:(0,l.__)("Cloudflare Turnstile will appear here","jvb")})})}),(0,s.jsx)("div",{className:"jvb-form-submit",children:(0,s.jsx)("button",{type:"button",className:"jvb-form-button",children:m.button})})]})]})})():(0,s.jsxs)("div",{className:"jvb-form-placeholder",children:[(0,s.jsx)("h3",{children:m.title}),(0,s.jsx)("p",{children:(0,l.__)("Form preview is hidden. Edit settings in the sidebar.","jvb")})]})})]})},save:function(){return null}})}},a={};function t(e){var i=a[e];if(void 0!==i)return i.exports;var s=a[e]={exports:{}};return l[e](s,s.exports,t),s.exports}t.m=l,e=[],t.O=(l,a,i,s)=>{if(!a){var r=1/0;for(d=0;d<e.length;d++){for(var[a,i,s]=e[d],o=!0,b=0;b<a.length;b++)(!1&s||r>=s)&&Object.keys(t.O).every((e=>t.O[e](a[b])))?a.splice(b--,1):(o=!1,s<r&&(r=s));if(o){e.splice(d--,1);var n=i();void 0!==n&&(l=n)}}return l}s=s||0;for(var d=e.length;d>0&&e[d-1][2]>s;d--)e[d]=e[d-1];e[d]=[a,i,s]},t.o=(e,l)=>Object.prototype.hasOwnProperty.call(e,l),(()=>{var e={637:0,705:0};t.O.j=l=>0===e[l];var l=(l,a)=>{var i,s,[r,o,b]=a,n=0;if(r.some((l=>0!==e[l]))){for(i in o)t.o(o,i)&&(t.m[i]=o[i]);if(b)var d=b(t)}for(l&&l(a);n<r.length;n++)s=r[n],t.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return t.O(d)},a=globalThis.webpackChunkjvb=globalThis.webpackChunkjvb||[];a.forEach(l.bind(null,0)),a.push=l.bind(null,a.push.bind(a))})();var i=t.O(void 0,[705],(()=>t(677)));i=t.O(i)})();
(()=>{"use strict";var e,l={677(){const e=window.wp.blocks,l=window.wp.i18n,a=window.wp.blockEditor,t=window.wp.components,i=window.wp.element,s=window.ReactJSXRuntime;(0,e.registerBlockType)("jvb/forms",{edit:function({attributes:e,setAttributes:r}){const{formType:o,showLabels:b,customEmailTo:n,turnstileEnabled:d}=e,[v,c]=(0,i.useState)(!0),j=(0,a.useBlockProps)({className:"jvb-form-block "+(o?`jvb-form-block-${o}`:"")}),p="undefined"!=typeof window&&window.jvbFormsData&&window.jvbFormsData.formTypes?window.jvbFormsData.formTypes:[{label:(0,l.__)("Select a form type","jvb"),value:""},{label:(0,l.__)("No forms available","jvb"),value:"",disabled:!0}],u=(console.log(window.jvbFormsData),"undefined"!=typeof window&&window.jvbFormsData&&window.jvbFormsData.availableForms?window.jvbFormsData.availableForms:{}),m=(()=>{const e=o&&u[o]?u[o]:null;return e?{title:e.title||(0,l.__)("Form","jvb"),description:Array.isArray(e.description)?e.description.join(" "):e.description||"",button:e.submit||(0,l.__)("Submit","jvb")}:{title:(0,l.__)("Form","jvb"),description:o?(0,l.__)("Loading form configuration...","jvb"):(0,l.__)("Please select a form type in the sidebar","jvb"),button:(0,l.__)("Submit","jvb")}})();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(a.InspectorControls,{children:[(0,s.jsxs)(t.PanelBody,{title:(0,l.__)("Form Settings","jvb"),children:[(0,s.jsx)(t.SelectControl,{label:(0,l.__)("Form Type","jvb"),value:o,options:p,onChange:e=>r({formType:e})}),(0,s.jsx)(t.ToggleControl,{label:(0,l.__)("Show Field Labels","jvb"),checked:b,onChange:e=>r({showLabels:e}),help:(0,l.__)("Toggle to show or hide field labels.","jvb")}),(0,s.jsx)(t.TextControl,{label:(0,l.__)("Custom Recipient Email","jvb"),value:n||"",onChange:e=>r({customEmailTo:e}),help:(0,l.__)("Leave empty to use the default email.","jvb"),type:"email"})]}),(0,s.jsxs)(t.PanelBody,{title:(0,l.__)("Form Preview","jvb"),initialOpen:!1,children:[(0,s.jsx)(t.ToggleControl,{label:(0,l.__)("Show Preview","jvb"),checked:v,onChange:e=>c(e)}),(0,s.jsx)("p",{className:"components-base-control__help",children:(0,l.__)("This is just a preview. The actual form will be rendered on the frontend.","jvb")})]})]}),(0,s.jsx)("div",{...j,children:v?(()=>{if(!o)return(0,s.jsx)(t.Notice,{status:"warning",isDismissible:!1,children:(0,l.__)("Please select a form type in the block settings.","jvb")});let e=[];switch(o){case"contact":e=[{id:"name",label:(0,l.__)("Name","jvb"),type:"text",required:!0},{id:"email",label:(0,l.__)("Email","jvb"),type:"email",required:!0},{id:"phone",label:(0,l.__)("Phone","jvb"),type:"tel",required:!0},{id:"instagram",label:(0,l.__)("Instagram URL","jvb"),type:"url"},{id:"contact_methods",label:(0,l.__)("Preferred Contact","jvb"),type:"checkboxes",options:[{value:"text",label:(0,l.__)("Text","jvb")},{value:"call",label:(0,l.__)("Call","jvb")},{value:"email",label:(0,l.__)("Email","jvb")},{value:"instagram",label:(0,l.__)("Instagram","jvb")}]},{id:"message",label:(0,l.__)("Your Message","jvb"),type:"textarea",required:!0}];break;case"feature_request":e=[{id:"name",label:(0,l.__)("Name","jvb"),type:"text",help:(0,l.__)("Required if you want us to follow up.","jvb")},{id:"email",label:(0,l.__)("Email","jvb"),type:"email",help:(0,l.__)("Required if you want us to follow up.","jvb")},{id:"follow_up",label:(0,l.__)("Would you like me to follow up with you?","jvb"),type:"checkbox"},{id:"target_audience",label:(0,l.__)("This Feature is For","jvb"),type:"checkboxes",options:[{value:"artists",label:(0,l.__)("Artists","jvb")},{value:"visitors",label:(0,l.__)("Site Visitors","jvb")},{value:"partners",label:(0,l.__)("Partners","jvb")},{value:"other",label:(0,l.__)("Other","jvb")}]},{id:"feature_name",label:(0,l.__)("Name your Feature","jvb"),type:"text",required:!0},{id:"message",label:(0,l.__)("Describe Your Feature","jvb"),type:"textarea",required:!0}];break;case"technical_issue":e=[{id:"name",label:(0,l.__)("Name","jvb"),type:"text"},{id:"email",label:(0,l.__)("Email","jvb"),type:"email"},{id:"follow_up",label:(0,l.__)("Would you like me to follow up with you?","jvb"),type:"checkbox"},{id:"issue_type",label:(0,l.__)("Type of Issue","jvb"),type:"checkboxes",options:[{value:"visual",label:(0,l.__)("Visual","jvb")},{value:"error",label:(0,l.__)("Error Page","jvb")},{value:"other",label:(0,l.__)("Other","jvb")}]},{id:"message",label:(0,l.__)("Please describe the issue.","jvb"),type:"textarea",required:!0}]}return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h3",{className:"jvb-form-title",children:m.title}),(0,s.jsx)("p",{className:"jvb-form-description",children:m.description}),(0,s.jsxs)("div",{className:"jvb-form-preview",children:[e.map(e=>(0,s.jsxs)("div",{className:"jvb-form-field",children:[b&&(0,s.jsx)("label",{htmlFor:`jvb-${e.id}`,className:e.required?"required":"",children:e.label}),"text"===e.type&&(0,s.jsx)("input",{type:"text",id:`jvb-${e.id}`,placeholder:b?"":e.label,disabled:!0}),"email"===e.type&&(0,s.jsx)("input",{type:"email",id:`jvb-${e.id}`,placeholder:b?"":e.label,disabled:!0}),"tel"===e.type&&(0,s.jsx)("input",{type:"tel",id:`jvb-${e.id}`,placeholder:b?"":e.label,disabled:!0}),"url"===e.type&&(0,s.jsx)("input",{type:"url",id:`jvb-${e.id}`,placeholder:b?"":e.label,disabled:!0}),"textarea"===e.type&&(0,s.jsx)("textarea",{id:`jvb-${e.id}`,placeholder:b?"":e.label,disabled:!0,rows:"4"}),"checkbox"===e.type&&(0,s.jsxs)("div",{className:"jvb-form-checkbox",children:[(0,s.jsx)("input",{type:"checkbox",id:`jvb-${e.id}`,disabled:!0}),(0,s.jsx)("label",{htmlFor:`jvb-${e.id}`,children:e.label})]}),"checkboxes"===e.type&&e.options&&(0,s.jsx)("div",{className:"jvb-form-checkboxes",children:e.options.map(l=>(0,s.jsxs)("div",{className:"jvb-form-checkbox",children:[(0,s.jsx)("input",{type:"checkbox",id:`jvb-${e.id}-${l.value}`,disabled:!0}),(0,s.jsx)("label",{htmlFor:`jvb-${e.id}-${l.value}`,children:l.label})]},l.value))}),e.help&&(0,s.jsx)("p",{className:"jvb-form-help",children:e.help})]},e.id)),d&&(0,s.jsx)("div",{className:"jvb-form-turnstile",children:(0,s.jsx)("div",{className:"jvb-turnstile-placeholder",children:(0,s.jsx)("span",{children:(0,l.__)("Cloudflare Turnstile will appear here","jvb")})})}),(0,s.jsx)("div",{className:"jvb-form-submit",children:(0,s.jsx)("button",{type:"button",className:"jvb-form-button",children:m.button})})]})]})})():(0,s.jsxs)("div",{className:"jvb-form-placeholder",children:[(0,s.jsx)("h3",{children:m.title}),(0,s.jsx)("p",{children:(0,l.__)("Form preview is hidden. Edit settings in the sidebar.","jvb")})]})})]})},save:function(){return null}})}},a={};function t(e){var i=a[e];if(void 0!==i)return i.exports;var s=a[e]={exports:{}};return l[e](s,s.exports,t),s.exports}t.m=l,e=[],t.O=(l,a,i,s)=>{if(!a){var r=1/0;for(d=0;d<e.length;d++){for(var[a,i,s]=e[d],o=!0,b=0;b<a.length;b++)(!1&s||r>=s)&&Object.keys(t.O).every(e=>t.O[e](a[b]))?a.splice(b--,1):(o=!1,s<r&&(r=s));if(o){e.splice(d--,1);var n=i();void 0!==n&&(l=n)}}return l}s=s||0;for(var d=e.length;d>0&&e[d-1][2]>s;d--)e[d]=e[d-1];e[d]=[a,i,s]},t.o=(e,l)=>Object.prototype.hasOwnProperty.call(e,l),(()=>{var e={637:0,705:0};t.O.j=l=>0===e[l];var l=(l,a)=>{var i,s,[r,o,b]=a,n=0;if(r.some(l=>0!==e[l])){for(i in o)t.o(o,i)&&(t.m[i]=o[i]);if(b)var d=b(t)}for(l&&l(a);n<r.length;n++)s=r[n],t.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return t.O(d)},a=globalThis.webpackChunkjvb=globalThis.webpackChunkjvb||[];a.forEach(l.bind(null,0)),a.push=l.bind(null,a.push.bind(a))})();var i=t.O(void 0,[705],()=>t(677));i=t.O(i)})();