if(!window.bf_globals){ window.bf_globals={};}["bitforms_1_66_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 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 observeElm=function(){"use strict";return function(t,e,r,u=0){const i=new MutationObserver(t=>{t.forEach(t=>{if(t.attributeName===e){const{oldValue:i}=t,a=t.target[e];"function"==typeof r&&setTimeout(r.call(this,i,a),u)}})}),a={attributes:!0,attributeOldValue:!0,attributeFilter:[e]};return i.observe(t,a),i}}();var setStyleProperty=function(){"use strict";return function(t,e,r){t?.style&&t.style.setProperty(e,r,"important")}}();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 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:""},n)),Object.keys(t).forEach(e=>{a.setAttribute(e,t[e])}),a}}();var submit_form=function(){"use strict";function e(e,t){const o=new URL(e?.ajaxURL),n=e?.entryId?"bitforms_update_form_entry":"bitforms_submit_form";return o.searchParams.append("action",n),e?.entryId&&(o.searchParams.append("_ajax_nonce",e.nonce||""),o.searchParams.append("entryID",e.entryId),o.searchParams.append("formID",e.formId),o.searchParams.append("entryToken",e.entryToken||"")),fetch(o,{method:"POST",body:t})}function t(e,t,n){e.then(e=>new Promise((o,n)=>{if(e.staus>400){const o=new CustomEvent("bf-form-submit-error",{detail:{formId:t,errors:e.data}});bfSelect(`#form-${t}`).dispatchEvent(o),500===e.staus?n(new Error("Mayebe Internal Server Error")):n(e.json())}else o(e.json())})).then(e=>{const a=new CustomEvent("bf-form-submit-success",{detail:{formId:t,entryId:e.data.entry_id,formData:n}});bfSelect(`#form-${t}`).dispatchEvent(a);let r=null,s=null,c="",d=1e3;const i=window.bf_globals[t];if(void 0!==e&&e.success){const o=bfSelect(`#form-${t}`);bfReset(t),"object"==typeof e.data?(o&&e?.data?.hidden_fields?.map(e=>{setHiddenFld(e,o)}),r=e.data.redirectPage,e.data.cron&&(s=e.data.cron),e.data.cronNotOk&&(s=e.data.cronNotOk),e.data.new_nonce&&(c=e.data.new_nonce,i.nonce=c),setBFMsg({contentId:t,msgId:e.data.msg_id,msg:e.data.message,duration:e.data.msg_duration,show:!0,type:"success",error:!1}),d=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 n=bfSelect('input[name="entryID"]',o);n&&n.remove(),delete i.entryId}else{const o=new CustomEvent("bf-form-submit-error",{detail:{formId:t,errors:e.data}});bfSelect(`#form-${t}`).dispatchEvent(o),bfValidationErrMsg(e,t)}if(function(e,t,o){const n=window.bf_globals[o];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 o=new URL(n.ajaxURL);o.searchParams.append("action","bitforms_trigger_workflow");const a={cronNotOk:e,token:t||n.nonce,id:n.appID};fetch(o,{method:"POST",body:JSON.stringify(a),headers:{"Content-Type":"application/json"}}).then(e=>e.json())}}(s,c,t),r){const e=setTimeout(()=>{window.location=decodeURI(r),e&&clearTimeout(e)},d)}o(t,!1)}).catch(e=>{const n=e?.message?e.message:"Unknown Error";setBFMsg({contentId:t,msg:n,show:!0,type:"error",error:!0}),o(t,!1)})}function o(e,t){const o=bfSelect('button[type="submit"]',bfSelect(`#form-${e}`));o&&(o.disabled=t);const n=bfSelect('button[type="submit"] span',bfSelect(`#form-${e}`));n&&n.classList.toggle("d-none")}return function(n=null){(n?[n]:Object.keys(window.bf_globals)).forEach(n=>{const a=bfSelect(`#form-${n}`);a&&(a.addEventListener("submit",n=>{!function(n){n.preventDefault();const a=n.target.id.slice(n.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 n.target.dispatchEvent(e)}o(a,!0);let r=new FormData(n.target);const s=window.bf_globals[a];"undefined"!=typeof advancedFileHandle&&(r=advancedFileHandle(s,r)),"undefined"!=typeof decisionFldHandle&&(r=decisionFldHandle(s,r)),s.GCLID&&r.set("GCLID",s.GCLID);const c=[];Object.entries(s?.fields||{}).forEach(e=>{e[1]?.valid?.hide&&c.push(e[0])}),c.length&&r.append("hidden_fields",c),"v3"===s?.gRecaptchaVersion&&s?.gRecaptchaSiteKey?grecaptcha.ready(()=>{grecaptcha.execute(s.gRecaptchaSiteKey,{action:"submit"}).then(o=>{r.append("g-recaptcha-response",o),t(e(s,r),a,r)})}):t(e(s,r),a,r)}(n)}),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 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 getFldKeyAndRowIndx=function(){"use strict";return function(n){const t=n.match(/([^\[]+)(?:\[(\d+)\])?/);return t?[t[1],t[2]||""]:[n]}}();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 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 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=`
${e.msg}
`,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 customFieldsReset=function(){"use strict";return function(e){Object.entries(e.inits||{}).map(([t,s])=>{if(s?.reset){const i=t.replace(/\[\w+\]/g,""),n=e.fields[i];s.reset(n?.val)}})}}();var bit_select_field=function(){"use strict";return class{#t=null;#e=null;#s=null;#i=null;#n=null;#l=null;#o=null;#h=null;#a=null;#r=null;#p=null;#c=!1;#d=null;#u=null;#m="data:image/svg+xml,";#g="";#f=[];#O=[];#b=null;#C={};#E=!1;#y={separator:",",selectedOptImage:!1,dropdownIcn:"",selectedOptClearable:!0,searchClearable:!0,optionIcon:!0,defaultValue:"",placeholder:"Select an option",searchPlaceholder:"Search option",maxHeight:370,closeOnSelect:!1,showChip:!0,options:[],attributes:{},classNames:{},activeList:0,onChange:()=>{}};#w=null;#I="";#v=[];constructor(t,e){Object.assign(this.#y,e),this.#b=e.document?e.document:document,this.#C=e.window?e.window:window,this.#t="string"==typeof t?this.#b.querySelector(t):t,this.fieldKey=this.#y.fieldKey,this.init()}init(){this.#s=this.#S(`.${this.fieldKey}-dpd-hidden-input`),this.#i=this.#S(`.${this.fieldKey}-opt-search-input`),this.#n=this.#S(`.${this.fieldKey}-option-wrp`),this.#l=this.#S(`.${this.fieldKey}-dpd-wrp`),this.#o=this.#S(`.${this.fieldKey}-selected-opt-wrp`),this.#h=this.#S(`.${this.fieldKey}-selected-opt-img`),this.#a=this.#S(`.${this.fieldKey}-selected-opt-lbl`),this.#r=this.#S(`.${this.fieldKey}-selected-opt-clear-btn`),this.#p=this.#y.searchClearable?this.#S(`.${this.fieldKey}-search-clear-btn`):{},this.#x(this.#l,"click",t=>{this.#A(t)}),this.#x(this.#l,"keyup",t=>{this.#A(t)}),this.#x(this.#l,"blur",t=>{this.#L(t)}),this.#x(this.#t,"keydown",t=>{this.#k(t)}),this.#T(),this.#y.defaultValue&&this.setSelectedOption(this.#y.defaultValue),this.#y.defaultValue||this.#N(),this.#y.selectedOptImage&&(this.#h.src=this.#m),this.#y.searchClearable&&(this.#V(this.#p,"display","none"),this.#x(this.#p,"click",()=>{this.searchOptions("")})),this.#i.placeholder=this.#y.searchPlaceholder,this.#i.value="",this.#x(this.#i,"keyup",t=>{this.#W(t)}),this.#c=this.#y.allowCustomOption,this.#C.observeElm(this.#s,"value",(t,e)=>{this.#P(t,e,this.#E)})}#T(){const t=this.#S(`.${this.fieldKey}-option-list[data-list-index="${this.#y.activeList}"]`);this.#u=this.#S(`.${this.fieldKey}-option-list.active-list`),this.#u.innerHTML=t.innerHTML,this.#B(),this.#y.options=this.#M(),this.#O=[...this.#y.options],this.#x(this.#u,"scroll",t=>t.stopPropagation())}#S(t,e){return e?e.querySelector(t):this.#t.querySelector(t)}#F(t){return this.#t.querySelectorAll(t)}#x(t,e,s){t?.addEventListener(e,s),this.#v.push({selector:t,eventType:e,cb:s})}#H(t,e){t.appendChild(e)}#N(){this.#s.value&&(this.setSelectedOption(this.#s.value),this.#D())}#$(t,e){const s=new Event(e);t.dispatchEvent(s)}#P(t,e){t!==e&&this.setSelectedOption(e),"undefined"!=typeof bit_conditionals&&bit_conditionals({target:this.#s})}#K(t=-1,e){if("next"===e){const e=this.#O.length;for(let s=t+1;s=0;e-=1){const t=this.#O[e];if("group"!==t.type&&!t.disabled&&!t.disableOnMax)return e}}#R(t){return this.#S(`${this.#j()} .option[data-index="${t}"]`)}#k(t){const e=this.#b.activeElement;let s=null;if(this.#q()){const i=Number(e.dataset.index||-1);if("ArrowDown"===t.key||!t.shiftKey&&"Tab"===t.key){t.preventDefault();let n=0,l=null;e===this.#i?(n=this.#K(-1,"next"),this.#c&&0===n&&"block"!==this.#_(this.#d)&&(n=1),l=this.#R(n)):e.classList.contains("option")&&(n=this.#K(i,"next"),l=this.#R(n)),l&&(s=l)}else if("ArrowUp"===t.key||t.shiftKey&&"Tab"===t.key){if(t.preventDefault(),e===this.#i)s=this.#l,this.#q()&&this.setMenu({open:!1});else if(e.classList.contains("option")){let t=this.#K(i,"previous");this.#z&&0===t&&"block"!==this.#_(this.#d)&&(t=-1);const e=this.#R(t);e?s=e:e||(s=this.#i)}}else"Escape"===t.key&&this.setMenu({open:!1})}else if(t.key>="a"&&t.key<="z"){clearTimeout(this.#w),this.#I+=t.key,this.#w=setTimeout(()=>{this.#I=""},300);const e=this.#y.options.find(t=>"group"!==t.type&&!t.disabled&&t.lbl.toLowerCase().startsWith(this.#I));e&&this.setSelectedOption(e.val)}else if("ArrowDown"===t.key||"ArrowUp"===t.key){if(this.#y.multipleSelect)return;t.preventDefault();const e=this.#U(),s="ArrowDown"===t.key?"next":"previous";let i=this.#K(e,s);this.#c&&0===i&&(i=1),i>-1&&i{const e={},s=t.querySelector(".opt-lbl"),{value:i}=t.dataset;e.lbl=s.textContent,e.val=i||e.lbl,this.#G(t,"disabled-opt")&&(e.disabled=!0);const n=t.querySelector(".opt-icn");this.#y.optionIcon&&n?.src&&(e.icn=n.src);const{attributes:l}=t,o=l.length;e.attributes={};for(let s=0;se.val===t)}#X(t){if(this.#Y(this.#a,""),this.#e=this.#t.parentElement,!t.length)return this.#e.style.removeProperty("min-height"),this.#y.selectedOptImage&&this.#V(this.#h,"display","block"),void this.#Y(this.#a,this.#y.placeholder);this.#y.selectedOptImage&&this.#V(this.#h,"display","none"),t.forEach((t,e)=>{const s=this.#et("div");this.#st(s,"chip-wrp");const i=this.#y.customClasses?.["chip-wrp"];i&&this.#it(s,i);const n=this.#y.customAttributes?.["chip-wrp"];if(n&&this.#nt(s,n),"chip-wrp"in this.#y.attributes){const t=this.#y.attributes["chip-wrp"];this.#nt(s,t)}if(this.#y.selectedOptImage&&this.#y.optionIcon){const e=this.#et("img");if(this.#st(e,"chip-icn"),"chip-icn"in this.#y.attributes){const t=this.#y.attributes["chip-icn"];this.#nt(e,t)}const i=this.#tt(t);this.#lt(e,"src",i.icn||this.#m),this.#Q(e,i.icn),this.#lt(e,"alt",i.lbl);const n=this.#y.customClasses?.["chip-icn"];n&&this.#it(e,n);const l=this.#y.customAttributes?.["chip-icn"];l&&this.#nt(e,l),this.#H(s,e)}const l=this.#et("span");if(this.#st(l,"chip-lbl"),"chip-lbl"in this.#y.attributes){const t=this.#y.attributes["chip-lbl"];this.#nt(l,t)}const o=this.#y.customClasses?.["chip-lbl"];o&&this.#it(l,o);const h=this.#y.customAttributes?.["chip-lbl"];h&&this.#nt(l,h);const a=this.#tt(t);this.#Y(l,a?a.lbl:t),this.#H(s,l);const r=this.#et("button");if(this.#st(r,"chip-clear-btn"),"chip-clear-btn"in this.#y.attributes){const t=this.#y.attributes["chip-clear-btn"];this.#nt(r,t)}const p=this.#y.customClasses?.["chip-clear-btn"];p&&this.#it(r,p);const c=this.#y.customAttributes?.["chip-clear-btn"];c&&this.#nt(r,c),r.innerHTML=this.#r.innerHTML,this.#x(r,"click",t=>{this.#ot(t,e)}),this.#x(r,"keyup",t=>{"Backspace"===t.key&&this.#ot(t,e)}),this.#H(s,r),this.#H(this.#a,s)}),this.#e=this.#t.parentElement,this.#V(this.#e,"min-height",this.#t.offsetHeight-this.#n.offsetHeight+"px")}#ot(t,e){t.stopPropagation();const s=this.#g.split(this.#y.separator);s.splice(e,1),this.setSelectedOption(s.join(this.#y.separator)),this.#D()}#Q(t=null,e=0){e?this.#ht(t,"placeholder-img"):this.#st(t,"placeholder-img")}#Z(t=!1){if(t){const t=this.#g.split(this.#y.separator);this.#O=this.#O.map(e=>{const s=e;return e.disabled||t.includes(e.val)?s.disableOnMax=!1:s.disableOnMax=!0,s})}else this.#O=this.#O.map(t=>{const e=t;return delete e.disableOnMax,e});this.#D()}setSelectedOption(t){let e=null,s=t.split(this.#y.separator);s=s.filter(t=>this.#tt(t)),this.#y.multipleSelect?(1===s.length?e=this.#tt(s[0]):s.length>1&&(e={lbl:`${s.length} options selected`}),this.#y.disableOnMax&&this.#y.mx&&s.length>=this.#y.mx?this.#Z(!0):this.#Z(!1)):e=this.#tt(t),this.#g=t,this.#g||this.#J(),e&&(this.value=t,this.#y.selectedOptImage&&(this.#y.multipleSelect?s.length>1?(this.#h.src=this.#m,this.#Q(this.#h)):1===s.length?(this.#h.src=e.icn||this.#m,this.#Q(this.#h,e.icn)):(this.#h.src=this.#m,this.#Q(this.#h)):(this.#h.src=e.icn||this.#m,this.#Q(this.#h,e.icn))),this.#y.multipleSelect&&this.#y.showChip&&this.#X(s),this.#y.showChip||this.#Y(this.#a,e.lbl),this.#y.closeOnSelect&&this.setMenu({open:!1}),this.#y.selectedOptClearable&&(this.#V(this.#r,"display","grid"),this.#x(this.#r,"click",t=>{this.#J(t)})),this.#y.onChange&&this.#y.onChange(t),this.#E||this.#$(this.#s,"blur"))}#U(){return this.#O.findIndex(t=>t.val===this.#g)}#et(t){return this.#b.createElement(t)}#at(t,e){t.tabIndex=e}#st(t,e){t.classList.add(e)}#ht(t,e){t.classList.remove(e)}#_(t){return t?.style.display||""}#G(t,e){return t.classList.contains(e)}#Y(t,e){t.textContent=e}#V(t,e,s){t.style.setProperty(e,s,"important")}#rt(t){return t&&t.split(this.#y.separator)||[]}#pt(t){return t.join(this.#y.separator)}#ct(t){t.stopPropagation();const e=t.currentTarget,s=e.dataset.value;if(this.#c&&e.classList.contains("create-opt")&&this.#z(s),this.#y.multipleSelect){const t=this.#rt(this.#g);if(t.includes(s)){const i=t.indexOf(s);t.splice(i,1),this.#ht(e,"selected-opt")}else t.push(s),this.#st(e,"selected-opt");this.#g=this.#pt(t)}else{const t=this.#S(".selected-opt");t&&this.#ht(t,"selected-opt"),this.#st(e,"selected-opt"),this.#g=s}this.setSelectedOption(this.#g),setTimeout(()=>{this.#S(`${this.#j()} .option[data-value="${s}"]`).focus()},0)}#D(){this.#dt()}#ut(){return this.#F(`${this.#j()} .option:not(.opt-group-title):not(.create-opt)`)}#B(){const t=this.#ut(),e=t.length;for(let s=0;s{this.#ct(t)}),this.#x(e,"keyup",t=>{"Enter"===t.key&&this.#ct(t)})}}#mt(){const t=this.#ut(),e=this.#q(),s=t.length;for(let i=0;ithis.#st(t,e))}#nt(t,e){const s=e.length;if(s)for(let i=0;i{this.#lt(i,t,e.attributes[t])}),t.includes(e.val)?(this.#st(i,"selected-opt"),this.#lt(i,"aria-selected",!0)):this.#lt(i,"aria-selected",!1),"group"===e.type?this.#st(i,"opt-group-title"):("groupIndex"in e&&this.#st(i,"opt-group-child"),this.#lt(i,"data-index",s),this.#lt(i,"data-value",e.val),this.#lt(i,"role","option"),this.#lt(i,"aria-posinset",s+1),this.#lt(i,"aria-setsize",this.#O.length),this.#at(i,this.#q()?"0":"-1"),e.disabled?this.#st(i,"disabled-opt"):e.disableOnMax?this.#st(i,"disable-on-max"):(this.#x(i,"click",t=>{this.#ct(t)}),this.#x(i,"keyup",t=>{"Enter"===t.key&&this.#ct(t)}))),this.#H(this.#u,i)}}#W(t){if(t.stopPropagation(),"Enter"===t.key&&this.#O.length){const e=this.#O?.[0].i;if(e&&(this.setSelectedOption(e),this.searchOptions("")),this.#c&&"none"!==this.#_(this.#d)){const{value:e}=t.target;if(this.#z(e),this.#y.multipleSelect){const t=this.#rt(this.#g);t.push(e),this.#g=this.#pt(t)}else this.#g=e;this.#D(),this.setSelectedOption(this.#g)}}else this.searchOptions(t.target.value)}#z(t){let e=t.trim();if(e.includes&&e){const t=this.#f.length;for(let s=0;sthis.#ft(t)),this.#at(this.#i,0),this.#at(this.#p,0),this.#l.setAttribute("aria-expanded","true"),this.#lt(this.#u,"aria-hidden",!1),this.#lt(this.#i,"aria-hidden",!1),this.#D()):(this.#ht(this.#t,"menu-open"),this.#b.removeEventListener("click",this.#ft),setTimeout(()=>{this.searchOptions("")},100),this.#at(this.#i,-1),this.#at(this.#p,-1),this.#l.setAttribute("aria-expanded","false"),this.#lt(this.#u,"aria-hidden",!0),this.#lt(this.#i,"aria-hidden",!0)),this.#mt()}#A(t){"Space"===t.code&&(this.#i.focus(),this.setMenu({open:!0})),"click"===t.type&&(this.#q()?this.setMenu({open:!1}):(this.#i.focus(),this.setMenu({open:!0})))}#L(t){t.target.parentElement?.contains(t.relatedTarget)||this.#$(this.#s,"blur")}set activelist(t){const e=this.#S(`.${this.fieldKey}-option-list[data-list="${t}"]`);if(e){const t=e.getAttribute("data-list-index");this.#y.activeList=t,this.setSelectedOption(""),this.#T()}}set disabled(t){"true"===String(t).toLowerCase()?(this.#t.classList.add("disabled"),this.#s.disabled=!0,this.#at(this.#l,-1),this.#at(this.#r,-1),this.#lt(this.#l,"aria-label","Dropdown disabled"),this.setMenu({open:!1})):"false"===String(t).toLowerCase()&&(this.#ht(this.#t,"disabled"),this.#s.removeAttribute("disabled"),this.#at(this.#l,0),this.#at(this.#r,0),this.#lt(this.#l,"aria-label",this.#y.placeholder))}get disabled(){return this.#s.disabled}set readonly(t){"true"===String(t).toLowerCase()?(this.#st(this.#t,"disabled"),this.#s.readOnly=!0,this.#at(this.#l,-1),this.#at(this.#r,-1),this.setMenu({open:!1})):"false"===String(t).toLowerCase()&&(this.#ht(this.#t,"disabled"),this.#s.removeAttribute("readonly"),this.#at(this.#l,0),this.#at(this.#r,0))}get readonly(){return this.#s.readOnly}set value(t){this.#s.value=t,this.#lt(this.#s,"value",t)}get value(){return this.#s.value}#bt(){this.#v.forEach(({selector:t,eventType:e,cb:s})=>{t.removeEventListener(e,s)})}destroy(){this.value="",this.#bt()}reset(){this.#E=!0,this.#J(),this.destroy(),this.init(),setTimeout(()=>{this.#E=!1},1)}}}();var bit_file_up_field=function(){"use strict";return class{#e=null;#t=null;#s=null;#i=null;#l=null;#a=null;#r=null;#c=null;#n=null;#h={};#o=[];#f=null;#d={};#p="";#u={};#m={};#v="";#g="";#b=[];#w={id:"upload",name:"upload",required:!0,multiple:!1,maxSize:0,sizeUnit:"KB",isItTotalMax:!1,showMaxSize:!0,showSelectStatus:!0,fileSelectStatus:"No Choosen File",allowedFileType:"",showFileList:!0,showFilePreview:!0,showFileSize:!0,accept:".pdf,.exe,.msi",duplicateAllow:!1,capture:"",minFile:0,maxFile:0,onchange:()=>{console.log("Hellow World")},oninput:()=>{}};constructor(e,t){Object.assign(this.#w,t),this.#f=t.document?t.document:document,this.#d=t.window?t.window:window,this.#u=t.attributes||{},this.#m=t.classNames||{},this.#p=t.contentId||"",this.#e="string"==typeof e?this.#f.querySelector(e):e,this.#v=this.#w.fieldKey,this.fieldKey=this.#v,this.#g=t.assetsURL||"",this.init()}init(){this.#t=this.#C(`.${this.#v}-label`),this.#s=this.#C(`.${this.#v}-inp-btn`),this.#i=this.#C(`.${this.#v}-file-select-status`),this.#l=this.#C(`.${this.#v}-file-input-wrpr`),this.#a=this.#C(`.${this.#v}-max-size-lbl`),this.#r=this.#C(`.${this.#v}-file-upload-input`),this.#n=this.#C(`.${this.#v}-file-input-wrpr .err-wrp`);const{multiple:e,allowedFileType:t,accept:s,showSelectStatus:i,fileSelectStatus:l,oldFiles:a}=this.#w;this.#r.multiple=e,this.#r.accept=t?`${t},${s}`:s,i&&this.#i?this.#i.innerHTML=l:this.#i?.remove(),this.#h={},this.#L(),a&&this.#F(a),this.#S(this.#r,"change",e=>this.#y(e)),this.#S(this.#s,"click",()=>this.#r.click())}#x(e){if("string"==typeof e)try{return JSON.parse(e)}catch(e){console.error("Invalid JSON string",e)}return Array.isArray(e)?e:[]}#F(e){const t=this.#x(e);this.#b=t,this.#c||this.#A(),t.forEach(e=>{this.#E(e)});const s=this.#$("input");s.type="hidden",s.name=this.#z(),s.value=this.#b.toString(),this.#l.appendChild(s)}#E(e){const t=this.#$("div"),s=e.replace(/( |\.|\(|\))/g,"");if(t.id=`file-wrp-${s}`,this.#U(t,"file-wrpr"),"file-wrpr"in this.#m){const e=this.#m["file-wrpr"];e&&this.#I(t,e)}if("file-wrpr"in this.#u){const e=this.#u["file-wrpr"];this.#T(t,e)}const i=this.#$("div");this.#U(i,"file-details");const l=this.#$("a");if(this.#U(l,"file-title"),"file-title"in this.#m){const e=this.#m["file-title"];e&&this.#I(l,e)}if("file-title"in this.#w.attributes){const e=this.#w.attributes["file-title"];this.#T(l,e)}this.#N(l,"target","_blank"),this.#N(l,"href",`${this.#w.baseDLURL}&fileID=${e}`),this.#K(l,e),i.append(l),t.append(i);const a=this.#$("button");if(this.#U(a,"cross-btn"),"cross-btn"in this.#m){const e=this.#m["cross-btn"];e&&this.#I(a,e)}if(this.#N(a,"data-file-id",s),this.#N(a,"data-file-name",e),this.#N(a,"type","button"),"cross-btn"in this.#w.attributes){const e=this.#w.attributes["cross-btn"];this.#T(a,e)}this.#K(a,"×"),this.#S(a,"click",e=>this.#k(e)),t.append(a),this.#c.appendChild(t)}#y(e){const{files:t}=this.#r,{sizeUnit:s,allowMaxSize:i,maxSize:l,maxSizeErrMsg:a,isItTotalMax:r,multiple:c,showFileList:n,fileExistMsg:h,showFilePreview:o,showFileSize:f,showSelectStatus:d,fileSelectStatus:p,minFile:u,minFileErrMsg:m,maxFile:v,maxFileErrMsg:g}=this.#w,b=this.#M(s,l);let w=0;const C=[];this.#O(this.#n,"active"),r&&Object.values(this.#h).forEach(e=>{w+=e.size}),!c&&t.length>0&&(this.#h={},this.#c&&this.#K(this.#c,""));for(let e=0;e0)||Object.keys(this.#h).length{this.#O(this.#n,"active")},3e3);else C.push(a)}this.#R(`.${this.#v}-file-input-wrpr .cross-btn`).forEach(e=>{this.#S(e,"click",e=>this.#B(e))});const L=Object.keys(this.#h).length;this.#H(),L&&d?this.#i.innerText=`${L} file${L>1?"s":""} selected`:d&&(this.#i.innerHTML=p),u>0&&L0&&this.#A(),C.map((e,t)=>{this.#c.insertAdjacentHTML("afterbegin",`\n \n ${e}\n
`);const s=this.#C(`#err-${t}`);this.#U(s,"active"),setTimeout(()=>{this.#O(s,"active")},3e3),setTimeout(()=>{s?.remove(),Object.keys(this.#h).length||this.#L()},5e3)})}#A(){if(this.#c=this.#$("div"),this.#U(this.#c,"files-list"),"files-list"in this.#m){const e=this.#m["files-list"];e&&this.#I(this.#c,e)}if("files-list"in this.#u){const e=this.#u["files-list"];this.#T(this.#c,e)}this.#l.append(this.#c)}#L(){this.#c?.remove(),this.#c=null}#H(){const e=new DataTransfer;Object.values(this.#h)?.forEach(t=>{e.items.add(t)}),this.#r.files=e.files}#k(e){const t=e.target.getAttribute("data-file-id"),s=e.target.getAttribute("data-file-name");this.#_(`#file-wrp-${t}`),this.#b=this.#b.filter(e=>e!==s),this.#C(`input[name="${this.#z()}"]`).value=this.#b.toString()}#B=e=>{const t=e.target.getAttribute("data-file-id");this.#_(`#file-wrp-${t}`),delete this.#h[t];const s=Object.keys(this.#h).length;s?this.#i.innerText=`${s} file${s>1?"s":""} selected`:(this.#i.innerHTML=this.#w.fileSelectStatus,this.#L()),this.#H()};#C(e){return this.#e.querySelector(e)}#R(e){return this.#e.querySelectorAll(e)}#_(e){this.#C(e)?.remove()}#$(e){return this.#f.createElement(e)}#W(e){switch(e.name.substring(e.name.lastIndexOf(".")+1)){case"xbm":case"tif":case"pjp":case"pjpeg":case"svgz":case"jpg":case"jpeg":case"ico":case"tiff":case"gif":case"svg":case"bmp":case"png":case"jfif":case"webp":return URL.createObjectURL(e);case"7z":case"arj":case"deb":case"pkg":case"rar":case".rpm":case".gz":case"z":case"zip":return`${this.#g}/zip-compressed.svg`;case"key":case"odp":case"pps":case"ppt":case"pptx":return`${this.#g}/presentation.svg`;case"_RF_":case"doc":case"docx":case"odt":case"pdf":case"rtf":case"tex":case"txt":case"wks":case"wps":case"wpd":return`${this.#g}/document.svg`;case"csv":case"dat":case"db":case"dbf":case"log":case"mdb":case"sav":case"sql":case"tar":case"sqlite":case"xml":return`${this.#g}/database.svg`;case"opus":case"flac":case"webm":case"weba":case"wav":case"ogg":case"m4a":case"mp3":case"oga":case"mid":case"amr":case"aiff":case"wma":case"au":case"acc":case"wpl":case"ogm":case"wmv":case"mpg":case"ogv":case"mov":case"asx":case"mpeg":case"mp4":case"m4v":case"avi":case"3gp":case"flv":case"mkv":case"swf":return`${this.#g}/file-audio.svg`;default:return`${this.#g}/paperclip.svg`}}#S(e,t,s){e.addEventListener(t,s),this.#o.push({element:e,eventType:t,eventAction:s})}#U(e,t){e.classList.add(t)}#O(e,t){e.classList.remove(t)}#K(e,t){e.textContent=t}#N(e,t,s){e?.setAttribute?.(t,s)}#I(e,t){t.trim().split(/\b\s+\b/g).forEach(t=>this.#U(e,t))}#T(e,t){const s=t.length;if(s)for(let i=0;i=1024&&e<1048576?`${(e/1024).toFixed(1)}KB`:e>=1048576&&e<1073741824?`${(e/1048576).toFixed(1)}MB`:e>=1073741824?`${(e/1073741824).toFixed(1)}GB`:void 0}#M(e,t){switch(e){case"Bytes":return t;case"KB":return 1024*t;case"MB":return 1048576*t;case"GB":return 1073741824*t;default:return 0}}#q(){this.#o.forEach(({element:e,eventType:t,eventAction:s})=>{e.removeEventListener(t,s)})}#z(){return"undefined"!=typeof checkRepeatedField&&checkRepeatedField(this.#v,this.#d?.bf_globals?.[this.#p])?`${this.#v}_old[]`:`${this.#v}_old`}checkValidate(){return 0===this.#b.length&&0===Object.keys(this.#h).length?"req":""}set value(e){this.#F(e)}get value(){return this.#h}destroy(){this.#c&&(this.#c.innerHTML=""),this.#q()}reset(){this.destroy(),this.init()}}}();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],d=e=>{const n=e.replace(/\[\d*\]/g,"");if(i[n])return i[n];const l=Object.entries(t);for(let e=0;e{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},o=(t,i,l,d="")=>{const r=bfSelect(`#form-${e} ${d} .${i}-err-wrp`),o=bfSelect(`.${i}-err-txt`,r),a=bfSelect(`.${i}-err-msg`,r);let f=!1;try{f="grid"===getComputedStyle(r).display,f&&(r.style.removeProperty("opacity"),r.style.removeProperty("height"),a.style.removeProperty("display"))}catch(e){f=!1}o&&"err"in(l||{})&&(t&&l?.err?.[t]?.show?(o.innerHTML=l.err[t].custom?l.err[t].msg:l.err[t].dflt,f?setStyleProperty(r,"grid-template-rows","1fr"):setTimeout(()=>{a.style.removeProperty("display"),setStyleProperty(r,"height",`${o.offsetHeight}px`),setStyleProperty(r,"opacity",1)},100),n.push(i)):(o.innerHTML="",f?setStyleProperty(r,"grid-template-rows","0fr"):(setStyleProperty(r,"height",0),setStyleProperty(r,"opacity",0),setStyleProperty(a,"display","none"))))};return function({form:i,input:a},{step:f,otherOptions:s}={}){i?e=i:a?.form?.id&&([,e]=a.form.id.split("form-"));const c=window?.bf_globals?.[e];if(void 0===c)return!1;let p={};n=[];const u=c.configs.bf_separator;if(f){let e=c.layout[f-1];if(!e)return!1;e=e?.layout||e;const i=e.lg.map(e=>e.i),n=c.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]:c.fields[t]}),{})}else t=c.fields;const{modifiedFields:y}=c;if(y&&Object.assign(t,y),i)p=r();else if(a){if(!c.validateFocusLost&&!s?.validateOnInput)return!0;const e=d(a.name);p=r(),t={[e]:t[e]}}let m=!0;const h=Object.entries(t);let{length:F}=h;for(;F--;){const[t,i]=h[F];let n=[""];if("undefined"!=typeof checkRepeatedField){const e=checkRepeatedField(t,c);n=getRepeatedIndexes(e,c,a)}for(let d=0;ddefaultValue"],"val":""},"separator":{"val":"__bf__"},"mn":{"path":"mn","val":0},"mx":{"path":"mx","val":0},"disableOnMax":{"path":"valid->disableOnMax","val":false}},"file-up":{"fieldKey":{"var":"fieldKey"},"formID":{"var":"formId"},"maxSizeErrMsg":{"path":["err->maxSize->msg","err->maxSize->dflt"]},"minFileErrMsg":{"path":["err->minFile->msg","err->minFile->dflt"]},"maxFileErrMsg":{"path":["err->maxFile->msg","err->maxFile->dflt"]},"assetsURL":{"val":"https:\/\/blogs.jccc.edu\/gphc\/wp-content\/plugins\/bit-form\/static\/file-upload\/"},"classNames":{"path":"customClasses"},"attributes":{"path":"customAttributes"},"fieldName":{"path":"fieldName"},"contentId":{"var":"contentId"}}};const fldContainers={"select":".__$fk__-dpd-fld-wrp","file-up":".__$fk__-file-up-wrpr"};;function initAllCustomFlds(formContentId=null){const allContendIds=formContentId? [formContentId]: Object.keys(bf_globals);allContendIds.forEach((contentId)=>{const contentData=bf_globals[contentId];const flds=bf_globals[contentId]?.fields ||{};const fldKeys=Object.keys(flds).reverse();fldKeys.forEach((fldKey)=>{const fldData=flds[fldKey];const fldType=fldData.typ;if(fldType==='paypal'){;} else if(fldType==='razorpay'){;} else if(fldType==='recaptcha'){;} else if(fldType==='turnstile'){;} else if(fldType==='hcaptcha'){;} else if(fldType==='stripe'){;} else if(customFldConfigPaths[fldType]){contentData.inits[fldKey]=getFldInstance(contentId,fldKey,fldType);}});if(contentData.gRecaptchaVersion==='v3' && contentData.gRecaptchaSiteKey){;}});};function getFldInstance(contentId,fldKey,fldTyp,nestedSelector=''){const fldClass=this['bit_'+fldTyp.replace(/-/g,'_')+'_field'];const selector='#form-'+contentId+' '+nestedSelector+fldContainers[fldTyp].replace("__$fk__",fldKey);if(!fldClass || !bfSelect(selector)) return;return new fldClass(selector,getFldConf(contentId,fldKey,fldTyp));};function getFldConf(contentId,fieldKey,fldTyp){const fldData=bf_globals[contentId].fields[fieldKey];const fldConfPaths=Object.entries(customFldConfigPaths[fldTyp]);let fldConf={};const{ formId }=bf_globals[contentId];if(!("config" in customFldConfigPaths[fldTyp]) && "config" in fldData) fldConf=fldData.config;const varData={ contentId,fieldKey,formId };fldConfPaths.forEach(([ confPath,fldPath ])=>{let value="";if(fldPath.var) value=varData[fldPath.var];if(!value && fldPath.path){if(Array.isArray(fldPath.path)){fldPath.path.forEach((path)=>{if(!value) value=getDataFromNestedPath(fldData,path);});} else{value=getDataFromNestedPath(fldData,fldPath.path);}}if(!value && fldPath.val){value=fldPath.val;if(typeof value==='string'){Object.entries(varData).forEach(([key,val])=>{value=value.replace("__$"+key+"__",val);});}}fldConf=setDataToNestedPath(fldConf,confPath,value);});return fldConf;};function getDataFromNestedPath(data,key){const keys=key.split("->");const lastKey=keys.pop();let current={...data};for(const k of keys){if(!(k in current)) return null;current=current[k];}return current[lastKey] || null;}function setDataToNestedPath(data,key,value){const keys=key.split("->");const lastKey=keys.pop();let current={...data};keys.forEach((k)=>{if(!current[k]) current[k]={};current=current[k];});current[lastKey]=value;return current;}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="";