(()=>{"use strict";var e={};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();const t="email",n="phone",a="name",r={[t]:["email","e-mail","mail","email address"],[n]:["phone","tel","mobile","cell","telephone","phone number"],[a]:["name","full-name","full name","full_name","fullname","first-name","first name","first_name","firstname","last-name","last name","last_name","lastname","given-name","given name","given_name","givenname","family-name","family name","family_name","familyname","fname","lname","first","last","your-name","your name"]};function l(e){return e&&"string"==typeof e?e.trim().toLowerCase():""}function i(e){const t=l(e),n=t.lastIndexOf("@");if(-1===n)return t;const a=t.slice(n+1);return["gmail.com","googlemail.com"].includes(a)?`${t.slice(0,n).replace(/\./g,"")}@${a}`:t}function s(e){const t=l(e),n=t.replace(/\D/g,"");return t.startsWith("+")?`+${n}`:n}function u(e){const t=e.filter(e=>{let{type:t}=e;return t===a}).map(e=>{let{value:t}=e;return t});if(!t.length)return;const[n,...r]=1===t.length?t[0].split(" "):t;return{first_name:l(n),...r?.length>0?{last_name:l(r.join(" "))}:{}}}function o(e){return e.find(e=>{let{type:n}=e;return n===t})?.value}function c(e){return e.find(e=>{let{type:t}=e;return t===n})?.value}((f,g,p)=>{if(!f||!g||!p)return;const d=g.Object.extend({initialize(){this.listenTo(p.Radio.channel("forms"),"submit:response",this.actionSubmit)},actionSubmit(f){const g=e.g._googlesitekit?.gtagUserData,p=g?(d=f.data.fields,function(e){const t=[["address",u(e)],["email",o(e)],["phone_number",c(e)]].filter(e=>{let[,t]=e;return t});if(0!==t.length)return Object.fromEntries(t)}(Object.values(d).map(e=>{const{label:u,type:o,value:c,key:f}=e;return function(e){let{type:u,name:o,value:c,label:m}=e||{};switch(u=l(u),o=l(o),c=l(c),m=function(e){return e&&"string"==typeof e?e.trim().toLowerCase().replace(/\s*\*+\s*$/,"").replace(/\s*\(required\)\s*$/i,"").replace(/\s*:\s*$/,"").trim():""}(m),u){case"email":return{type:t,value:i(c)};case"tel":return{type:n,value:s(c)}}return function(e){if(!e)return!1;const t=i(e);return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}(c)?{type:t,value:i(c)}:function(e){if(!e)return!1;if(!function(e){const t=e.replace(/\D/g,"");return!(t.length<7||t.length<e.length/2)&&/^[\s\-()+.\d]*$/.test(e)}(e))return!1;const t=s(e);return/^\+?\d{7,}$/.test(t)}(c)?{type:n,value:s(c)}:r[t].includes(o)||r[t].includes(m)?{type:t,value:i(c)}:r[n].includes(o)||r[n].includes(m)?{type:n,value:s(c)}:r[a].includes(o)||r[a].includes(m)?{type:a,value:l(c)}:null}({label:u,type:m[o]??o,value:c,name:f})}).filter(Boolean))):void 0;var d;e.g._googlesitekit?.gtagEvent?.("submit_lead_form",p?{user_data:p}:void 0)}});f(document).ready(()=>{new d})})(e.g.jQuery,e.g.Marionette,e.g.Backbone);const m={phone:"tel",textbox:"text"}})();