(()=>{"use strict";var e={};function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function n(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,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 r="email",i="phone",l="name",a={[r]:["email","e-mail","mail","email address"],[i]:["phone","tel","mobile","cell","telephone","phone number"],[l]:["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 o(e){return e&&"string"==typeof e?e.trim().toLowerCase():""}function u(e){const t=o(e),n=t.lastIndexOf("@");if(-1===n)return t;const r=t.slice(n+1);if(["gmail.com","googlemail.com"].includes(r)){const e=t.slice(0,n).replace(/\./g,"");return"".concat(e,"@").concat(r)}return t}function c(e){const t=o(e),n=t.replace(/\D/g,"");return t.startsWith("+")?"+".concat(n):n}function s(e){const r=e.filter(e=>{let{type:t}=e;return t===l}).map(e=>{let{value:t}=e;return t});if(!r.length)return;const[i,...a]=1===r.length?r[0].split(" "):r;return function(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?t(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}({first_name:o(i)},(null==a?void 0:a.length)>0?{last_name:o(a.join(" "))}:{})}function m(e){var t;return null===(t=e.find(e=>{let{type:t}=e;return t===r}))||void 0===t?void 0:t.value}function f(e){var t;return null===(t=e.find(e=>{let{type:t}=e;return t===i}))||void 0===t?void 0:t.value}e.g.document.addEventListener("om.Analytics.track",t=>{let{detail:n}=t;if("conversion"===n.Analytics.type){var p,v,y,g;const t=(null===(p=e.g._googlesitekit)||void 0===p?void 0:p.gtagUserData)&&null!==(v=n.Campaign)&&void 0!==v&&v.Form?function(e){if(!e||!e.inputs)return;const t=Array.isArray(e.inputs)?e.inputs:Object.values(e.inputs);return t.length?function(e){const t=[["address",s(e)],["email",m(e)],["phone_number",f(e)]].filter(e=>{let[,t]=e;return t});if(0!==t.length)return Object.fromEntries(t)}(t.map(e=>{var t;if("hidden"===e.type)return null;const n=e.id?null===(t=document.querySelector("label[for='".concat(e.id,"']")))||void 0===t?void 0:t.textContent:e.placeholder||"";return function(e){let{type:t,name:n,value:s,label:m}=e||{};switch(t=o(t),n=o(n),s=o(s),m=function(e){return e&&"string"==typeof e?e.trim().toLowerCase().replace(/\s*\*+\s*$/,"").replace(/\s*\(required\)\s*$/i,"").replace(/\s*:\s*$/,"").trim():""}(m),t){case"email":return{type:r,value:u(s)};case"tel":return{type:i,value:c(s)}}return function(e){if(!e)return!1;const t=u(e);return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}(s)?{type:r,value:u(s)}: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=c(e);return/^\+?\d{7,}$/.test(t)}(s)?{type:i,value:c(s)}:a[r].includes(n)||a[r].includes(m)?{type:r,value:u(s)}:a[i].includes(n)||a[i].includes(m)?{type:i,value:c(s)}:a[l].includes(n)||a[l].includes(m)?{type:l,value:o(s)}:null}({type:e.type,name:e.name,value:e.value,label:n})}).filter(Boolean)):void 0}(n.Campaign.Form):null,d={campaignID:n.Campaign.id,campaignType:n.Campaign.type};t&&(d.user_data=t),null===(y=e.g._googlesitekit)||void 0===y||null===(g=y.gtagEvent)||void 0===g||g.call(y,"submit_lead_form",d)}})})();