https://ronaldosborne.org/wp-content/uploads/bitforms/form-scripts/15/bitform-js-15.js?bfv=48&ver=48
1 if(!window.bf_globals){ window.bf_globals={};}["bitforms_2_15_1"].forEach(function(contentId){const form=document.getElementById(contentId);if(!form){ delete window.bf_globals[contentId];return;}if(!window.bf_globals[contentId]){window.bf_globals[contentId]={inits:{},contentId: contentId};}else{ window.bf_globals[contentId].inits={};window.bf_globals[contentId].contentId=contentId;}});var bfSelect=function(){"use strict";return function(e,t){return(t||document).querySelector(e)}}();var bfReset=function(){"use strict";return function(e,t=!1){if(t){const t=new CustomEvent("bf-form-reset",{detail:{formId:e}});bfSelect(`#form-${e}`).dispatchEvent(t)}const s=window.bf_globals[e];"undefined"!=typeof resetPlaceholders&&resetPlaceholders(s),"undefined"!=typeof bfResetDefaultValue&&bfResetDefaultValue(s),"undefined"!=typeof customFieldsReset&&customFieldsReset(s),"undefined"!=typeof resetOtherOpt&&resetOtherOpt(),bfSelect(`#form-${e}`).reset(),localStorage.setItem("bf-entry-id",""),window.bf_globals[e].modifiedFields=s.fields,Object.keys(s.fields).forEach(t=>{const s=bfSelect(`#form-${e} .${t}-err-wrp`);s&&(setStyleProperty(s,"height","0px"),setStyleProperty(s,"opacity",0),setStyleProperty(bfSelect(`.${t}-err-msg`,s),"display","none"))}),s.gRecaptchaSiteKey&&"v2"===s.gRecaptchaVersion&&window?.grecaptcha?.reset(),s.turnstileSiteKey&&window?.turnstile?.reset(),s.hCaptchaSiteKey&&window?.hcaptcha?.reset()}}();var setBFMsg=function(){"use strict";return function(e){if("undefined"!=typeof handleConversationalFormMsg&&handleConversationalFormMsg(e))return;let t=bfSelect(`#bf-form-msg-wrp-${e.contentId}`);t.innerHTML=`<div class="bf-form-msg deactive ${e.type} scroll">${e.msg}</div>`,t=bfSelect(".bf-form-msg",t);let s=5e3;e.msgId&&(t=bfSelect(`.msg-content-${e.msgId} .msg-content`,bfSelect(`#${e.contentId}`)),t.innerHTML=e.msg,t=bfSelect(`.msg-container-${e.msgId}`,bfSelect(`#${e.contentId}`)),s=e.duration),t&&t.classList.replace("active","deactive"),t.classList.contains("scroll")&&scrollToElm(t),t&&(setTimeout(()=>{t.classList.replace("deactive","active")},100),s&&setTimeout(()=>{t.classList.replace("active","deactive")},s))}}();var bfSplit=function(){"use strict";return function(t,n,i=","){const r=n?.configs?.bf_separator||"__bf__";return t.includes(r)?t.split(r):t.split(i)}}();var scrollToElm=function(){"use strict";const t=function(t){(function(t,e=10){const n=t.getBoundingClientRect(),o=window.innerHeight||document.documentElement.clientHeight,i=window.innerWidth||document.documentElement.clientWidth;return n.top>=e&&n.left>=e&&n.bottom<=o-e&&n.right<=i-e})(t)||(function(t){let e=t.parentElement;for(;e&&e!==document.body;){if(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth){e.scrollIntoView({behavior:"smooth"});break}e=e.parentElement}}(t),t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"}))},e=function(t){let e;const n=function(...n){clearTimeout(e),e=setTimeout(()=>t(...n),300)};return n.cancel=function(){clearTimeout(e)},n}(t);return function(n,{immediate:o=!1}={}){e.cancel(),o?t(n):e(n)}}();var getFldKeyAndRowIndx=function(){"use strict";return function(n){const t=n.match(/([^\[]+)(?:\[(\d+)\])?/);return t?[t[1],t[2]||""]:[n]}}();var moveToFirstErrFld=function(){"use strict";return function(t,e=[]){const r=t?.layout||{},n=t?.nestedLayout||{},o=Array.isArray(r)&&r.length>1,i=Array.isArray(r)?r:[{layout:r}];let s=-1;const c=i.reduce((t,r,o)=>{const i=r.layout.lg.reduce((t,e)=>{const r=e.i;if(r in n){const e=n[r].lg.map(t=>t.i);return[...t,r,...e]}return[...t,r]},[]),c=i.find(t=>e.includes(t));return-1===s&&c&&(s=o),[...t,...i]},[]);o&&s>-1&&t.inits.multi_step_form.step!==s+1&&(t.inits.multi_step_form.step=s+1),t.inits?.conversational_form&&(t.inits.conversational_form.activeFieldStep=e[0]),c.some(r=>e.some(e=>{const[n,o]=getFldKeyAndRowIndx(e);if(r===n){const e=o?`.rpt-index-${o}`:"",n=bfSelect(`#form-${t.contentId} ${e} .btcd-fld-itm.${r}`);return setTimeout(()=>scrollToElm(n),0),!0}return!1}))}}();var bfValidationErrMsg=function(){"use strict";return function(e,t){const{data:r}=e;r&&"string"==typeof r?setBFMsg({contentId:t,msg:r,error:!0,show:!0,type:"error"}):r&&(void 0!==r.$form&&(setBFMsg({contentId:t,msg:r.$form.message,msgId:r.$form.msg_id,duration:r.$form.msg_duration,type:"error"}),delete r.$form),Object.keys(r).length>0&&function(e,t){const r=Object.keys(e);r.forEach(r=>{const[o,s]=getFldKeyAndRowIndx(r),y=bfSelect(`#form-${t} ${s?`.rpt-index-${s}`:""} .${o}-err-wrp`),i=bfSelect(`.${o}-err-txt`,y),n=bfSelect(`.${o}-err-msg`,y);let l=!1;try{l="grid"===getComputedStyle(y).display,l&&(y.style.removeProperty("opacity"),y.style.removeProperty("height"),n.style.removeProperty("display"))}catch(e){l=!1}i.innerHTML=e[r],l?setStyleProperty(y,"grid-template-rows","1fr"):setTimeout(()=>{n.style.removeProperty("display"),setStyleProperty(y,"height",`${i.offsetHeight}px`),setStyleProperty(y,"opacity",1)},100)}),moveToFirstErrFld(window?.bf_globals?.[t],r)}(r,t))}}();var setHiddenFld=function(){"use strict";return function e(t,n){let a=bfSelect(`input[name="${t.name}"]`,n);return a||(a=document.createElement("input"),a.type="text",a.className="d-none",n.append(a)),"b_h_t"===t.name&&(bfSelect(`input[name="${a.value}"]`,n)?.remove(),e({name:t.value,required:""}
1,n)),Object.keys(t).forEach(e=>{a.setAttribute(e,t[e])}),a}}();var submit_form=function(){"use strict";function e(e,t){const n=new URL(e?.ajaxURL),o=e?.entryId?"bitforms_update_form_entry":"bitforms_submit_form";return n.searchParams.append("action",o),e?.entryId&&(n.searchParams.append("_ajax_nonce",e.nonce||""),n.searchParams.append("entryID",e.entryId),n.searchParams.append("formID",e.formId),n.searchParams.append("entryToken",e.entryToken||"")),fetch(n,{method:"POST",body:t})}function t(e,t,o){e.then(e=>new Promise((n,o)=>{if(e.staus>400){const n=new CustomEvent("bf-form-submit-error",{detail:{formId:t,errors:e.data}});bfSelect(`#form-${t}`).dispatchEvent(n),500===e.staus?o(new Error("Mayebe Internal Server Error")):o(e.json())}else n(e.json())})).then(e=>{const a=new CustomEvent("bf-form-submit-success",{detail:{formId:t,entryId:e.data.entry_id,formData:o}});bfSelect(`#form-${t}`).dispatchEvent(a);let r=null,s=null,d="",c=1e3;const i=window.bf_globals[t];if(void 0!==e&&e.success){const n=bfSelect(`#form-${t}`);bfReset(t),"object"==typeof e.data?(n&&e?.data?.hidden_fields?.map(e=>{setHiddenFld(e,n)}),r=e.data.redirectPage,e.data.cron&&(s=e.data.cron),e.data.cronNotOk&&(s=e.data.cronNotOk),e.data.new_nonce&&(d=e.data.new_nonce,i.nonce=d),setBFMsg({contentId:t,msgId:e.data.msg_id,msg:e.data.message,duration:e.data.msg_duration,show:!0,type:"success",error:!1}),c=Number(e.data.msg_duration||1e3)):setBFMsg({contentId:t,msg:e.data,type:"success",show:!0,error:!1}),localStorage.removeItem(`bitform-partial-form-${i.formId}`);const o=bfSelect('input[name="entryID"]',n);o&&o.remove(),delete i.entryId}else{const n=new CustomEvent("bf-form-submit-error",{detail:{formId:t,errors:e.data}});bfSelect(`#form-${t}`).dispatchEvent(n),bfValidationErrMsg(e,t)}if(function(e,t,n){const o=window.bf_globals[n];if(e)if("string"==typeof e){const t=new URL(e);t.protocol!==window.location.protocol&&(t.protocol=window.location.protocol),fetch(t)}else{const n=new URL(o.ajaxURL);n.searchParams.append("action","bitforms_trigger_workflow");const a={cronNotOk:e,token:t||o.nonce,id:o.appID};fetch(n,{method:"POST",body:JSON.stringify(a),headers:{"Content-Type":"application/json"}}).then(e=>e.json())}}(s,d,t),r){const e=setTimeout(()=>{window.location=decodeURI(r),e&&clearTimeout(e)},c)}n(t,!1)}).catch(e=>{const o=e?.message?e.message:"Unknown Error";setBFMsg({contentId:t,msg:o,show:!0,type:"error",error:!0}),n(t,!1)})}function n(e,t){const n=bfSelect('button[type="submit"]',bfSelect(`#form-${e}`));n&&(n.disabled=t);const o=bfSelect('button[type="submit"] span',bfSelect(`#form-${e}`));o&&o.classList.toggle("d-none")}return function(o=null){(o?[o]:Object.keys(window.bf_globals)).forEach(o=>{const a=bfSelect(`#form-${o}`);a&&(a.addEventListener("submit",o=>{!function(o){o.preventDefault();const a=o.target.id.slice(o.target.id.indexOf("-")+1);if("undefined"!=typeof validateForm&&!validateForm({form:a})){const e=new CustomEvent("bf-form-validation-error",{detail:{formId:a,fieldId:"",error:""}});return void o.target.dispatchEvent(e)}n(a,!0);let r=new FormData(o.target);const s=window.bf_globals[a];"undefined"!=typeof advancedFileHandle&&(r=advancedFileHandle(s,r)),"undefined"!=typeof decisionFldHandle&&(r=decisionFldHandle(s,r)),"undefined"!=typeof hideChildFldHandle&&(r=hideChildFldHandle(s,r)),s.GCLID&&r.set("GCLID",s.GCLID);const d=[];Object.entries(s?.fields||{}).forEach(e=>{e[1]?.valid?.hide&&d.push(e[0])}),d.length&&r.append("hidden_fields",d),"v3"===s?.gRecaptchaVersion&&s?.gRecaptchaSiteKey?grecaptcha.ready(()=>{grecaptcha.execute(s.gRecaptchaSiteKey,{action:"submit"}).then(n=>{r.append("g-recaptcha-response",n),t(e(s,r),a,r)})}):t(e(s,r),a,r)}(o)}),bfSelect('button[type="reset"]',a)?.addEventListener("click",()=>bfReset(a.id.replace("form-",""),!0)))}),document.querySelectorAll(".msg-backdrop,.bf-msg-close").forEach(e=>{e.addEventListener("click",t=>{t.target===e&&(t.stopPropagation(),bfSelect(`#${e.dataset.contentid} .msg-container-${e.dataset.msgid}`).classList.replace("active","deactive"))})}),localStorage.setItem("bf-entry-id","")}}();var setStyleProperty=function(){"use strict";return function(t,e,r){t?.style&&t.style.setProperty(e,r,"important")}}();var requiredFldValidation=function(){"use strict";return r=>r?.valid?.req?"req":""}();var generateBackslashPattern=function(){"use strict";return t=>(t||"").split("$_bf_$").join("\\")}();var emailFldValidation=function(){"use strict";return(e,t)=>t.err.invalid.show?new RegExp(generateBackslashPattern(t.pattern)).test(e)?"":"invalid":""}();var validateForm=function(){"use strict";let e,t,i={},n=[];const l=t=>window?.bf_globals?.[e].inits?.[t],r=(e,t,i)=>{const n=Number(i)>1?`${e}[${i}]`:e;return t.inits&&!t.inits[n]?e:n},d=e=>{const n=e.replace(/\[\d*\]/g,"");if(i[n])return i[n];const l=Object.entries(t);for(let e=0;e<l.length;e+=1){const[t,r]=l[e];
1if(r?.fieldName===n)return i[n]=t,t}return""},o=()=>{const n=new FormData(bfSelect(`#form-${e}`)),l={},r=Array.from(n.entries());return i={},r.forEach(([e,i])=>{const n=d(e),r=e.replace("[]","");n in t&&(l[r]?(Array.isArray(l[r])||(l[r]=[l[r]]),l[r].push(i)):l[r]=i)}),l},a=(t,i,l,r="")=>{const d=bfSelect(`#form-${e} ${r} .${i}-err-wrp`),o=bfSelect(`.${i}-err-txt`,d),a=bfSelect(`.${i}-err-msg`,d);let s=!1;try{s="grid"===getComputedStyle(d).display,s&&(d.style.removeProperty("opacity"),d.style.removeProperty("height"),a.style.removeProperty("display"))}catch(e){s=!1}o&&"err"in(l||{})&&(t&&l?.err?.[t]?.show?(o.innerHTML=l.err[t].custom?l.err[t].msg:l.err[t].dflt,s?setStyleProperty(d,"grid-template-rows","1fr"):setTimeout(()=>{a.style.removeProperty("display"),setStyleProperty(d,"height",`${o.offsetHeight}px`),setStyleProperty(d,"opacity",1)},100),n.push(i)):(o.innerHTML="",s?setStyleProperty(d,"grid-template-rows","0fr"):(setStyleProperty(d,"height",0),setStyleProperty(d,"opacity",0),setStyleProperty(a,"display","none"))))};return function({form:i,input:s},{step:f,otherOptions:c}={}){i?e=i:s?.form?.id&&([,e]=s.form.id.split("form-"));const p=window?.bf_globals?.[e];if(void 0===p)return!1;let u={};n=[];const y=p.configs.bf_separator;if(f){let e=p.layout[f-1];if(!e)return!1;e=e?.layout||e;const i=e.lg.map(e=>e.i),n=p.nestedLayout||{};Object.entries(n).forEach(([e,t])=>{if(i.includes(e)){const e=t.lg.map(e=>e.i);i.push(...e)}}),t=i.reduce((e,t)=>({...e,[t]:p.fields[t]}),{})}else t=p.fields;const{modifiedFields:m}=p;if(m&&Object.assign(t,m),i)u=o();else if(s){if(!p.validateFocusLost&&!c?.validateOnInput)return!0;const e=d(s.name);u=o(),t={[e]:t[e]}}let h=!0;const F=Object.entries(t);let{length:V}=F;for(;V--;){const[t,i]=F[V];let n=[""];if("undefined"!=typeof checkRepeatedField){const e=checkRepeatedField(t,p);n=getRepeatedIndexes(e,p,s)}for(let d=0;d<n.length;d+=1){const o=n[d],s=o?`${i.fieldName}[${o}]`:i.fieldName,f=`#form-${e}`,c=o?`.rpt-index-${o}`:"",m=i.typ,F="string"==typeof u[s]?u[s].trim():u[s],V=r(t,p,o);if(bfSelect(`${f} ${c} .${t}.fld-hide,${f} .fld-hide ${c} .${t}`)){a("",t,i,c);continue}let g="";"check"!==m&&"image-select"!==m||(g="undefined"!=typeof checkFldValidation?checkFldValidation(F,i):""),"check"!==m&&"radio"!==m||g||"undefined"==typeof customOptionValidation||(g=customOptionValidation(e,t,i)),F||g||"0"===F||(g="undefined"!=typeof requiredFldValidation?requiredFldValidation(i):null),a(g,t,i,c),g?h=!1:F&&("number"===m&&"undefined"!=typeof nmbrFldValidation?g=nmbrFldValidation(F,i):"email"===m&&"undefined"!=typeof emailFldValidation?g=emailFldValidation(F,i):"url"===m&&"undefined"!=typeof urlFldValidation?g=urlFldValidation(F,i):["decision-box","gdpr"].includes(m)&&"undefined"!=typeof dcsnbxFldValidation?g=dcsnbxFldValidation(F,i):["check","select","image-select"].includes(m)&&"undefined"!=typeof checkMinMaxOptions?g=checkMinMaxOptions(F,i,y):"range"===m&&"undefined"!=typeof checkMinMaxValue?g=checkMinMaxValue(F,i):"file-up"===m&&"undefined"!=typeof fileupFldValidation?g=fileupFldValidation(l(V),F,i):"advanced-file-up"===m&&"undefined"!=typeof advanceFileUpFldValidation?g=advanceFileUpFldValidation(l(V),i):"phone-number"===m&&"undefined"!=typeof phoneNumberFldValidation?g=phoneNumberFldValidation(l(V),i):"currency"===m&&"undefined"!=typeof currencyFldValidation&&(g=currencyFldValidation(l(V),i)),g||"undefined"==typeof bfDatetimeFldValidation||(g=bfDatetimeFldValidation(l(V),F,i)),i?.valid?.inputMask&&!g&&(g="undefined"!=typeof inputMaskValidation?inputMaskValidation(e,t,F,i):null),i?.valid?.regexr&&!g&&(g="undefined"!=typeof regexPatternValidation?regexPatternValidation(F,i):null),a(g,t,i,c),g&&(h=!1))}}return moveToFirstErrFld(p,n),h}}();var bitform_init=function(){"use strict";function e(e=null){"undefined"!=typeof hidden_token_field&&hidden_token_field(e),"undefined"!=typeof initAllCustomFlds&&initAllCustomFlds(e),"undefined"!=typeof initAddOtherOpt&&initAddOtherOpt(e),"undefined"!=typeof setSliderFieldValue&&setSliderFieldValue(e),"undefined"!=typeof setBitInputMaskToInput&&setBitInputMaskToInput(e),"undefined"!=typeof initCheckDisableOnMax&&initCheckDisableOnMax(e),"undefined"!=typeof validate_focus&&validate_focus(e),"undefined"!=typeof submit_form&&submit_form(e),"undefined"!=typeof bit_form_abandonment&&bit_form_abandonment(e),"undefined"!=typeof setFieldValues&&setFieldValues(e),"undefined"!=typeof bit_multi_step_form&&bit_multi_step_form(e),"undefined"!=typeof bit_conversational_form&&bit_conversational_form(e)}return document.addEventListener("DOMContentLoaded",()=>{e()}),e}();let bfContentId="",bfSlNo="1",bfVars="";
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.