PageSourceSearch

https://www.showitbetter.co/cpresources/7693493b/js/formie.js?v=1771445336

js showitbetter.co collected 2026-09-26 02:46:52 UTC 49,135 bytes, 1 lines download raw bytes

vendor: 4,103 bytes, line 1
1!function(){"use strict";var t,e={8502:function(){!function(){var t;function e(t){var e=0;return function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}}}var r="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,r){return t==Array.prototype||t==Object.prototype||(t[e]=r.value),t};var i,s=function(t){t=["object"==typeof globalThis&&globalThis,t,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var e=0;e<t.length;++e){var r=t[e];if(r&&r.Math==Math)return r}throw Error("Cannot find global object")}(this);function n(t,e){if(e)t:{var i=s;t=t.split(".");for(var n=0;n<t.length-1;n++){var o=t[n];if(!(o in i))break t;i=i[o]}(e=e(n=i[t=t[t.length-1]]))!=n&&null!=e&&r(i,t,{configurable:!0,writable:!0,value:e})}}function o(t){return(t={next:t})[Symbol.iterator]=function(){return this},t}function a(t){var r="undefined"!=typeof Symbol&&Symbol.iterator&&t[Symbol.iterator];return r?r.call(t):{next:e(t)}}if(n("Symbol",(function(t){function e(t,e){this.A=t,r(this,"description",{configurable:!0,writable:!0,value:e})}if(t)return t;e.prototype.toString=function(){return this.A};var i="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",s=0;return function t(r){if(this instanceof t)throw new TypeError("Symbol is not a constructor");return new e(i+(r||"")+"_"+s++,r)}})),n("Symbol.iterator",(function(t){if(t)return t;t=Symbol("Symbol.iterator");for(var i="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),n=0;n<i.length;n++){var a=s[i[n]];"function"==typeof a&&"function"!=typeof a.prototype[t]&&r(a.prototype,t,{configurable:!0,writable:!0,value:function(){return o(e(this))}})}return t})),"function"==typeof Object.setPrototypeOf)i=Object.setPrototypeOf;else{var l;t:{var u={};try{u.__proto__={a:!0},l=u.a;break t}catch(t){}l=!1}i=l?function(t,e){if(t.__proto__=e,t.__proto__!==e)throw new TypeError(t+" is not extensible");return t}:null}var h=i;function d(){this.m=!1,this.j=null,this.v=void 0,this.h=1,this.u=this.C=0,this.l=null}function c(t){if(t.m)throw new TypeError("Generator is already running");t.m=!0}function f(t,e){return t.h=3,{value:e}}function m(t){this.g=new d,this.G=t}function g(t,e,r,i){try{var s=e.call(t.g.j,r);if(!(s instanceof Object))throw new TypeError("Iterator result "+s+" is not an object");if(!s.done)return t.g.m=!1,s;var n=s.value}catch(e){return t.g.j=null,t.g.s(e),p(t)}return t.g.j=null,i.call(t.g,n),p(t)}function p(t){for(;t.g.h;)try{var e=t.G(t.g);if(e)return t.g.m=!1,{value:e.value,done:!1}}catch(e){t.g.v=void 0,t.g.s(e)}if(t.g.m=!1,t.g.l){if(e=t.g.l,t.g.l=null,e.F)throw e.D;return{value:e.return,done:!0}}return{value:void 0,done:!0}}function b(t){this.next=function(e){return t.o(e)},this.throw=function(e){return t.s(e)},this.return=function(e){return function(t,e){c(t.g);var r=t.g.j;return r?g(t,"return"in r?r.return:function(t){return{value:t,done:!0}},e,t.g.return):(t.g.return(e),p(t))}(t,e)},this[Symbol.iterator]=function(){return this}}function v(t,e){return e=new b(new m(e)),h&&t.prototype&&h(e,t.prototype),e}if(d.prototype.o=function(t){this.v=t},d.prototype.s=function(t){this.l={D:t,F:!0},this.h=this.C||this.u},d.prototype.return=function(t){this.l={return:t},this.h=this.u},m.prototype.o=function(t){return c(this.g),this.g.j?g(this,this.g.j.next,t,this.g.o):(this.g.o(t),p(this))},m.prototype.s=function(t){return c(this.g),this.g.j?g(this,this.g.j.throw,t,this.g.o):(this.g.s(t),p(this))},n("Array.prototype.entries",(function(t){return t||function(){return function(t,e){t instanceof String&&(t+="");var r=0,i=!1,s={next:function(){if(!i&&r<t.length){var s=r++;return{value:e(s,t[s]),done:!1}}return i=!0,{done:!0,value:void 0}}};return s[Symbol.iterator]=function(){return s},s}(this,(function(t,e){return[t,e]}))}})),"undefined"!=typeof Blob&&("undefined"==typeof FormData||!FormData.prototype.keys)){var y=function(t,e){for(var r=0;r<t.length;r++)e(t[r])},E=function(t){return t.replace(/\r?\n|\r/g,"\r\n")},x=function(t,e,r){return e instanceof Blob?(r=void 0!==r?String(r+""):"str
1ing"==typeof e.name?e.name:"blob",e.name===r&&"[object Blob]"!==Object.prototype.toString.call(e)||(e=new File([e],r)),[String(t),e]):[String(t),String(e)]},A=function(t,e){if(t.length<e)throw new TypeError(e+" argument required, but only "+t.length+" present.")},S="object"==typeof globalThis?globalThis:"object"==typeof window?window:"object"==typeof self?self:this,$=S.FormData,C=S.XMLHttpRequest&&S.XMLHttpRequest.prototype.send,w=S.Request&&S.fetch,F=S.navigator&&S.navigator.sendBeacon,O=S.Element&&S.Element.prototype,P=S.Symbol&&Symbol.toStringTag;P&&(Blob.prototype[P]||(Blob.prototype[P]="Blob"),"File"in S&&!File.prototype[P]&&(File.prototype[P]="File"));try{new File([],"")}catch(t){S.File=function(t,e,r){return t=new Blob(t,r||{}),Object.defineProperties(t,{name:{value:e},lastModified:{value:+(r&&void 0!==r.lastModified?new Date(r.lastModified):new Date)},toString:{value:function(){return"[object File]"}}}),P&&Object.defineProperty(t,P,{value:"File"}),t}}var j=function(t){return t.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22")},T=function(t){this.i=[];var e=this;t&&y(t.elements,(function(t){if(t.name&&!t.disabled&&"submit"!==t.type&&"button"!==t.type&&!t.matches("form fieldset[disabled] *"))if("file"===t.type){var r=t.files&&t.files.length?t.files:[new File([],"",{type:"application/octet-stream"})];y(r,(function(r){e.append(t.name,r)}))}else"select-multiple"===t.type||"select-one"===t.type?y(t.options,(function(r){!r.disabled&&r.selected&&e.append(t.name,r.value)})):"checkbox"===t.type||"radio"===t.type?t.checked&&e.append(t.name,t.value):(r="textarea"===t.type?E(t.value):t.value,e.append(t.name,r))}))};if((t=T.prototype).append=function(t,e,r){A(arguments,2),this.i.push(x(t,e,r))},t.delete=function(t){A(arguments,1);var e=[];t=String(t),y(this.i,(function(r){r[0]!==t&&e.push(r)})),this.i=e},t.entries=function t(){var e,r=this;return v(t,(function(t){if(1==t.h&&(e=0),3!=t.h)return e<r.i.length?t=f(t,r.i[e]):(t.h=0,t=void 0),t;e++,t.h=2}))},t.forEach=function(t,e){A(arguments,1);for(var r=a(this),i=r.next();!i.done;i=r.next()){var s=a(i.value);i=s.next().value,s=s.next().value,t.call(e,s,i,this)}},t.get=function(t){A(arguments,1);var e=this.i;t=String(t);for(var r=0;r<e.length;r++)if(e[r][0]===t)return e[r][1];return null},t.getAll=function(t){A(arguments,1);var e=[];return t=String(t),y(this.i,(function(r){r[0]===t&&e.push(r[1])})),e},t.has=function(t){A(arguments,1),t=String(t);for(var e=0;e<this.i.length;e++)if(this.i[e][0]===t)return!0;return!1},t.keys=function t(){var e,r,i,s,n=this;return v(t,(function(t){if(1==t.h&&(e=a(n),r=e.next()),3!=t.h)return r.done?void(t.h=0):(i=r.value,s=a(i),f(t,s.next().value));r=e.next(),t.h=2}))},t.set=function(t,e,r){A(arguments,2),t=String(t);var i=[],s=x(t,e,r),n=!0;y(this.i,(function(e){e[0]===t?n&&(n=!i.push(s)):i.push(e)})),n&&i.push(s),this.i=i},t.values=function t(){var e,r,i,s,n=this;return v(t,(function(t){if(1==t.h&&(e=a(n),r=e.next()),3!=t.h)return r.done?void(t.h=0):(i=r.value,(s=a(i)).next(),f(t,s.next().value));r=e.next(),t.h=2}))},T.prototype._asNative=function(){for(var t=new $,e=a(this),r=e.next();!r.done;r=e.next()){var i=a(r.value);r=i.next().value,i=i.next().value,t.append(r,i)}return t},T.prototype._blob=function(){var t="----formdata-polyfill-"+Math.random(),e=[],r="--"+t+'\r\nContent-Disposition: form-data; name="';return this.forEach((function(t,i){return"string"==typeof t?e.push(r+j(E(i))+'"\r\n\r\n'+E(t)+"\r\n"):e.push(r+j(E(i))+'"; filename="'+j(t.name)+'"\r\nContent-Type: '+(t.type||"application/octet-stream")+"\r\n\r\n",t,"\r\n")})),e.push("--"+t+"--"),new Blob(e,{type:"multipart/form-data; boundary="+t})},T.prototype[Symbol.iterator]=function(){return this.entries()},T.prototype.toString=function(){return"[object FormData]"},O&&!O.matches&&(O.matches=O.matchesSelector||O.mozMatchesSelector||O.msMatchesSelector||O.oMatchesSelector||O.webkitMatchesSelector||function(t){for(var e=(t=(this.document||this.ownerDocument).querySelectorAll(t)).length;0<=--e&&t.item(e)!==this;);return-1<e}),P&&(T.prototype[P]="FormData"),C){var I=S.XMLHttpRequest.prototype.setRequestHeader;S.XMLHttpRequest.prototype.setRequestHeader=function(t,e){I.call(this,t,e),"content-type"===t.toLowerCase()&&(this.B=!0)},S.XMLHttpRequest.prototype.send=function(t){t instanceof T?(t=t._blob(),this.B||this.setRequestHeader("Content-Type",t.type),C.call(this,t)):C.call(this,t)}}w&&(S.fetch=function(t,e){return e&&e.body&&e.body instanceof T&&(e.body=e.body._blob()),w.call(this,t,e)}),F&&(S.navigator.sendBeacon=function(t,e){return e instanceof T&&(e=e._asNative()),F.call(this,t,e)}),S.FormData=T}}(),function(){if("function"==typeof window.CustomEvent)return!1;window.CustomEvent=function(t,e){e=e||{bubbles:!1,cancelable:!1,detail:null};const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),r}}(),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(t){let e=this;do{if(e.matches(t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null});const t=function(t){return t&&0===Object.keys(t).length&&t.constructor===Object},e=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return window.FormieTranslations&&(t=window.FormieTranslations[t]||t),t.replace(/{([a-zA-Z0-9]+)}/g,((t,r)=>e[r]?e[r]:t))},r=function(t,e){t&&e&&("string"==typeof e&&(e=e.split(" ")),e.forEach((e=>{t.classList.add(e)})))},i=function(t,e){t&&e&&("string"==typeof e&&(e=e.split(" ")),e.forEach((e=>{t.classList.remove(e)})))},s=function(t,e,r,i,s,n){const o=new XMLHttpRequest;o.open(e,r,i,s,n),o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.setRequestHeader("Accept","application/json"),o.setRequestHeader("C
1ache-Control","no-cache");const a=new CustomEvent("modifyAjaxClient",{bubbles:!0,detail:{client:o}});return t.dispatchEvent(a),a.detail.client},n=(t,e)=>{const r=t.closest("form");return!!r&&r.querySelector(`[data-field-handle="${e}"]`)};var o={rule:t=>{let{field:e,input:r,config:i,getRule:s}=t;const o=s("match");if(!o)return!0;const a=n(e,o);if(!a)return!0;const l=a.querySelector(i.fieldsSelector);if(!l)return!0;return l.value===r.value},message:t=>{let{field:e,label:r,t:i,getRule:s}=t;const o=s("match"),a=n(e,o);return i("{name} must match {value}.",{name:r,value:a?.querySelector("[data-field-label]")?.childNodes[0].textContent?.trim()??""})}};var a={rule:t=>{let{input:e,config:r}=t;const i=e.getAttribute("pattern"),s=i?new RegExp(`^(?:${i})$`):r.patterns[e.type];return!s||!e.value||e.value.length<1||!!e.value.match(s)},message:t=>{let{input:e,label:r,t:i}=t;const s={email:i("{attribute} is not a valid email address.",{attribute:r}),url:i("{attribute} is not a valid URL.",{attribute:r}),number:i("{attribute} is not a valid number.",{attribute:r}),default:i("{attribute} is not a valid format.",{attribute:r})};return e.getAttribute(`data-pattern-${e.type}-message`)??s[e.type]??s.default}};var l={rule:t=>{let{input:e}=t;if(!e.hasAttribute("required")||"hidden"===e.type)return!0;if("checkbox"===e.type||"radio"===e.type){const t=e.form.querySelectorAll(`[name="${e.name}"]:not([type="hidden"])`);if(t.length){return Array.prototype.filter.call(t,(t=>t.checked)).length}return e.checked}return""!==e.value.trim()},message:t=>{let{input:e,label:r,t:i}=t;return e.getAttribute("data-required-message")??i("{attribute} cannot be blank.",{attribute:r})}};var u={rule:t=>{let{input:e,config:r}=t;if("number"!==e.type)return!0;const i=parseFloat(e.value),s=e.hasAttribute("min")?parseFloat(e.getAttribute("min")):null,n=e.hasAttribute("max")?parseFloat(e.getAttribute("max")):null;return!(null!==s&&i<s)&&!(null!==n&&i>n)},message:t=>{let{input:e,label:r,t:i}=t;const s=e.hasAttribute("min")?parseFloat(e.getAttribute("min")):null,n=e.hasAttribute("max")?parseFloat(e.getAttribute("max")):null;return null!==s&&null!==n?i("{attribute} must be between {min} and {max}.",{attribute:r,min:s,max:n}):null!==s?i("{attribute} must be no less than {min}.",{attribute:r,min:s}):null!==n?i("{attribute} must be no greater than {max}.",{attribute:r,max:n}):i("{attribute} has an invalid value.",{attribute:r})}};var h={rule:t=>{let{field:e}=t;if(!e)return!0;if("checkboxes"!==e.getAttribute("data-field-type"))return!0;const r=e.querySelectorAll('input[type="checkbox"]'),i=Array.from(r).filter((t=>t.checked)).length,s=e.hasAttribute("data-min-options")?parseFloat(e.getAttribute("data-min-options")):null,n=e.hasAttribute("data-max-options")?parseFloat(e.getAttribute("data-max-options")):null;return!(null!==s&&i<s)&&!(null!==n&&i>n)},message:t=>{let{field:e,label:r,t:i}=t;if(e){const t=e.hasAttribute("data-min-options")?parseFloat(e.getAttribute("data-min-options")):null,s=e.hasAttribute("data-max-options")?parseFloat(e.getAttribute("data-max-options")):null;if(null!==t&&null!==s)return i("{attribute} must select between {min} and {max}.",{attribute:r,min:t,max:s});if(null!==t)return i("{attribute} must select no less than {min}.",{attribute:r,min:t});if(null!==s)return i("{attribute} must select no greater than {max}.",{attribute:r,max:s})}return i("{attribute} has an invalid value.",{attribute:r})}},d={match:o,pattern:a,required:l,minmax:u,minmaxOptions:h};function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function f(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var m=class{constructor(t,e){this.form=t,this.errors=[],this.errorIds={},this.validators={},this.boundListeners=!1,this.activated=new WeakSet,this.submitted=!1,this.initialValues=new WeakMap,this.onBlur=this.blurHandler.bind(this),this.onChange=this.changeHandler.bind(this),this.onInput=this.inputHandler.bind(this),this.config=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};
1e%2?c(Object(r),!0).forEach((function(e){f(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({live:!1,inputErrorIndicatorAttribute:"data-field-has-error",fieldContainerErrorClass:"fui-error",inputErrorClass:"fui-error",messagesClass:"fui-errors",messageClass:"fui-error-message",fieldsSelector:'input:not([type="hidden"]):not([type="submit"]):not([type="button"]), select, textarea',patterns:{email:/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*(\.\w{2,})+$/,url:/^(?:(?:https?|HTTPS?|ftp|FTP):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-zA-Z\u00a1-\uffff0-9]-*)*[a-zA-Z\u00a1-\uffff0-9]+)(?:\.(?:[a-zA-Z\u00a1-\uffff0-9]-*)*[a-zA-Z\u00a1-\uffff0-9]+)*(?:\.(?:[a-zA-Z\u00a1-\uffff]{2,}))\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/,number:/^(?:[-+]?[0-9]*[.,]?[0-9]+)$/,color:/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/,date:/(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))/,time:/^(?:(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]))$/,month:/^(?:(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])))$/}},e),Object.entries(d).forEach((t=>{let[e,r]=t;this.addValidator(e,r.rule,r.message)})),this.init()}init(){this.form.setAttribute("novalidate",!0),this.inputs().forEach((t=>{this.initialValues.set(t,this.getInputValue(t))})),this.config.live&&this.addEventListeners(),this.emitEvent(document,"formieValidatorInitialized")}inputs(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(t instanceof HTMLElement){if(["INPUT","TEXTAREA","SELECT","BUTTON"].includes(t.tagName.toUpperCase()))return[t]}return t||(t=this.form),t.querySelectorAll(this.config.fieldsSelector)}getInputValue(t){return"checkbox"===t.type||"radio"===t.type?t.checked:"file"===t.type?t.files?.length?Array.from(t.files).map((t=>t.name)).join("|"):"":t.value??""}isDirty(t){return this.initialValues.has(t)?this.getInputValue(t)!==this.initialValues.get(t):(this.initialValues.set(t,this.getInputValue(t)),!1)}shouldShowError(t){return this.submitted||this.activated.has(t)}validate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this.errors=[],this.inputs(t).forEach((t=>{let e=!1;if(!this.isVisible(t))return;this.shouldShowError(t)&&this.removeError(t);const r=this.getValidatorCallbackOptions(t);Object.entries(this.validators).forEach((i=>{let[s,n]=i;const o=n.validate(r);if(!o){if(this.shouldShowError(t)&&!e){const e=this.getErrorMessage(t,s,n,r);this.showError(t,s,e)}this.errors.push({input:t,validator:s,result:o}),e=!0}})),!e&&this.shouldShowError(t)&&this.removeError(t)})),this.errors}removeAllErrors(){this.inputs().forEach((t=>{this.removeError(t)}))}removeError(t){t.removeAttribute("aria-errormessage"),t.removeAttribute("aria-invalid");const e=t.closest("[data-field-handle]");if(!e)return;const r=e.querySelector("[data-field-error-messages]");r&&r.remove(),i(t,this.config.inputErrorClass),t.removeAttribute(this.config.inputErrorIndicatorAttribute);for(let e=t.parentElement;e;e=e.parentElement)e.hasAttribute("data-field-handle")&&i(e,this.config.fieldContainerErrorClass);this.emitEvent(t,"formieValidatorClearError")}showError(t,e,i){const s=t.closest("[data-field-handle]");if(!s)return;let n=s.querySelector("[data-field-error-messages]");n||(n=document.createElement("div"),n.setAttribute("data-field-error-messages",""),r(n,this.config.messagesClass),s.appendChild(n));let o=s.querySelector(`[data-field-error-message-${e}]`);if(!o){o=document.createElement("div"),o.setAttribute("data-field-error-message",""),o.setAttribute(`data-field-error-message-${e}`,""),r(o,this.config.messageClass),o.textContent=i,n.appendChild(o);const a=`error-${s.getAttribute("data-field-handle")}`;this.errorIds[a]||(this.errorIds[a]=`${a}-${Math.random().toString(20).substr(2,5)}`);const l=this.errorIds[a];t.setAttribute("aria-errormessage",l),t.setAttribute("aria-invalid",!0),o.setAttribute("id",l),o.setAttribute("aria-live","polite"),o.setAttribute("aria-atomic",!0)}r(t,this.config.inputErrorClass),t.setAttribute(this.config.inputErrorIndicatorAttribute,!0);for(let e=t.parentElement;e;e=e.parentElement)e.hasAttribute("data-field-handle")&&r(e,this.config.fieldContainerErrorClass);this.emitEvent(t,"formieValidatorShowError",{validatorName:e,errorMessage:i})}getValidatorCallbackOptions(t){const r=t.closest("[data-field-handle]"),i=r?.querySelector("[data-field-label]")?.childNodes[0].textContent?.trim()??"";return{t:e,input:t,label:i,field:r,config:this.config,getRule:t=>this.getRule(r,t)}}getErrorMessage(t,r,i,s){return("function"==typeof i.errorMessage?i.errorMessage(s):i.errorMessage)??e("{attribute}
1 is invalid.",{attribute:s.label})}getErrors(){return this.errors}getRule(t,e){if(t){const r=t.getAttribute("data-validation");if(r){const t=this.parseValidationRules(r);if(t[e])return t[e]}}return!1}parseValidationRules(t){const e={};return t.split("|").forEach((t=>{const[r,i]=t.split(":");e[r]=void 0===i||i})),e}destroy(){this.removeEventListeners(),this.form.removeAttribute("novalidate"),this.emitEvent(document,"formieValidatorDestroyed")}isVisible(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}blurHandler(t){t instanceof CustomEvent||!t.target.form||!t.target.form.isSameNode(this.form)||"file"!==t.target.type&&"checkbox"!==t.target.type&&"radio"!==t.target.type&&(this.isDirty(t.target)&&this.activated.add(t.target),this.shouldShowError(t.target)&&this.validate(t.target))}changeHandler(t){t instanceof CustomEvent||!t.target.form||!t.target.form.isSameNode(this.form)||"file"!==t.target.type&&"checkbox"!==t.target.type&&"radio"!==t.target.type||(this.activated.add(t.target),this.validate(t.target))}inputHandler(t){t instanceof CustomEvent||!t.target.form||!t.target.form.isSameNode(this.form)||"checkbox"!==t.target.type&&"radio"!==t.target.type&&this.shouldShowError(t.target)&&this.validate(t.target)}submit(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,{final:e=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e&&(this.submitted=!0,this.config.live||this.addEventListeners()),this.validate(t)}addEventListeners(){this.boundListeners||(this.form.addEventListener("blur",this.onBlur,!0),this.form.addEventListener("change",this.onChange,!1),this.form.addEventListener("input",this.onInput,!1),this.boundListeners=!0)}removeEventListeners(){this.form.removeEventListener("blur",this.onBlur,!0),this.form.removeEventListener("change",this.onChange,!1),this.form.removeEventListener("input",this.onInput,!1),this.boundListeners=!1}emitEvent(t,e,r){const i=new CustomEvent(e,{bubbles:!0,detail:r||{}});t.dispatchEvent(i)}addValidator(t,e,r){this.validators[t]={validate:e,errorMessage:r}}};class g{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.$form=t,this.config=e,this.settings=e.settings,this.validationOnSubmit=!!this.settings.validationOnSubmit,this.validationOnFocus=!!this.settings.validationOnFocus,this.setCurrentPage(this.settings.currentPageId),this.$form&&(this.$form.formTheme=this,this.form=this.$form.form,this.loadingClass=this.form.getClasses("loading"),this.tabErrorClass=this.form.getClasses("tabError"),this.tabActiveClass=this.form.getClasses("tabActive"),this.tabCompleteClass=this.form.getClasses("tabComplete"),this.errorMessageClass=this.form.getClasses("errorMessage"),this.successMessageClass=this.form.getClasses("successMessage"),this.tabClass=this.form.getClasses("tab"),this.initValidator(),this.hideSuccess(),this.addSubmitEventListener(),this.updateFormHash(),this.settings.enableUnloadWarning&&this.addFormUnloadEventListener(),"ajax"===this.settings.submitMethod&&this.formTabEventListener(),this.$form.dispatchEvent(new CustomEvent("onFormieThemeReady",{bubbles:!0,detail:{theme:this,addValidator:this.addValidator.bind(this)}})))}initValidator(){const t={live:this.validationOnFocus,fieldContainerErrorClass:this.form.getClasses("fieldContainerError"),inputErrorClass:this.form.getClasses("fieldInputError"),messagesClass:this.form.getClasses("fieldErrors"),messageClass:this.form.getClasses("fieldError")};this.validator=new m(this.$form,t),this.form.triggerEvent("registerFormieValidation",{validator:this.validator})}addValidator(){this.form.registerEvent("registerFormieValidation",(t=>{t.validator.addValidator(...arguments)}))}addSubmitEventListener(){this.$form.querySelectorAll('[type="submit"]').forEach((t=>{this.form.addEventListener(t,"click",(t=>{this.$submitBtn=t.target,this.originalButtonText=this.$submitBtn.textContent.trim();const e=this.$submitBtn.getAttribute("data-submit-action")||"submit";this.updateSubmitAction(e)}))})),this.form.addEventListener(this.$form,"onBeforeFormieSubmit",this.onBeforeSubmit.bind(this)),this.form.addEventListener(this.$form,"onFormieValidate",this.onValidate.bind(this)),this.form.addEventListener(this.$form,"onFormieSubmit",this.onSubmit.bind(this)),this.form.addEventListener(this.$form,"onFormieSubmitError",this.onSubmitError.bind(this))}onBeforeSubmit(t){this.beforeSubmit(),this.submitHandler=t.detail.submitHandler}onValidate(t){this.validate()||(this.onFormError(),t.detail.invalid=!0,t.preventDefault())}onSubmit(t){t.preventDefault(),"ajax"===this.settings.submitMethod?this.ajaxSubmit():((this.settings.enableBackSubmission||"back"!==this.form.submitAction)&&this.updateFormHash(),"submit"===this.form.submitAction&&this.triggerJsEvents(),this.$form.submit())}onSubmitError(t){this.onFormError()}addFormUnloadEventListener(){this.form.addEventListener(window,"beforeunload",(t=>{if(this.savedFormHash!==this.hashForm())return t.preventDefault(),t.returnValue=e("Are you sure you want to leave?")}))}formTabEventListener(){this.$form.querySelectorAll("[data-fui-page-tab-anchor]").forEach((t=>{this.form.addEventListener(t,"click",(t=>{t.preventDefault();const e=t.target.getAttribute("data-fui-page-index"),r=t.target.getAttribute("data-fui-page-id");this.setPage({pageIndex:e,pageId:r,action:t.target.getAttribute("href")})}))}))}setPage(t){this.togglePage({nextPageIndex:t.pageIndex,nextPageId:t.pageId,totalPages:this.settings.pages.length});s(this.$form,"GET",t.action,!0).send()}hashForm(){const t={},e=new FormData(this.$form),r=["g-recaptcha-response","h-captcha-response","CRAFT_CSRF_TOKEN","CSRF_TOKEN","__JSCHK","__DUP","beesknees","cf-turnstile-response","frc-captcha-solution","snaptcha","submitAction"];for(const i of e.entries()){r.filter((t=>i[0].startsWith(t))).length||(t[i[0]]=i[1])}return JSON.stringify(t)}updateFormHash(){this.savedFormHash=this.hashForm()}validate(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.validationOnSubmit)return!0;
1if("submit"!==this.form.submitAction)return!0;let e=this.$form;this.$currentPage&&(e=this.$currentPage);const r=this.validator.submit(e,{final:this.isLastPage()});return r.length>0&&t&&r[0].input.focus(),0===r.length&&this.removeFormAlert(),r.length&&setTimeout((()=>{this.form.validateError({errors:r})}),10),!r.length}hideSuccess(){const t=this.$form.parentNode.querySelector("[data-fui-alert-success]");if(t&&this.settings.submitActionMessageTimeout){const e=1e3*parseInt(this.settings.submitActionMessageTimeout,10);setTimeout((()=>{t.remove()}),e)}}addLoading(){this.$submitBtn&&(this.$submitBtn.setAttribute("disabled",!0),this.$submitBtn.setAttribute("data-loading",!0),"spinner"===this.settings.loadingIndicator&&r(this.$submitBtn,this.loadingClass),"text"===this.settings.loadingIndicator&&(this.$submitBtn.textContent=this.settings.loadingIndicatorText))}removeLoading(){this.$submitBtn&&(this.$submitBtn.removeAttribute("disabled"),this.$submitBtn.removeAttribute("data-loading"),"spinner"===this.settings.loadingIndicator&&i(this.$submitBtn,this.loadingClass),"text"===this.settings.loadingIndicator&&(this.$submitBtn.textContent=this.originalButtonText))}onFormError(t){t?this.showFormAlert(t,"error"):this.showFormAlert(this.settings.errorMessage,"error"),this.removeLoading()}showFormAlert(t,e){let r=this.$form.parentNode.querySelector("[data-fui-alert]");r?r.innerHTML!==this.decodeHtml(t)&&(r.innerHTML=`${r.innerHTML}<br>${t}`):(r=document.createElement("div"),r.innerHTML=t,this.form.applyThemeConfig(r,"alert"),"error"==e?(this.form.applyThemeConfig(r,"alertError"),"bottom-form"==this.settings.errorMessagePosition?this.$submitBtn.parentNode.parentNode.insertBefore(r,this.$submitBtn.parentNode):"top-form"==this.settings.errorMessagePosition&&this.$form.parentNode.insertBefore(r,this.$form)):(this.form.applyThemeConfig(r,"alertSuccess"),"bottom-form"==this.settings.submitActionMessagePosition?this.settings.submitActionFormHide?this.$form.parentNode.insertBefore(r,this.$form):this.$submitBtn.parentNode?this.$submitBtn.parentNode.parentNode.insertBefore(r,this.$submitBtn.parentNode):this.$form.parentNode.insertBefore(r,this.$form.nextSibling):"top-form"==this.settings.submitActionMessagePosition&&this.$form.parentNode.insertBefore(r,this.$form)))}showTabErrors(t){Object.keys(t).forEach(((t,e)=>{const i=this.$form.parentNode.querySelector(`[data-fui-page-id="${t}"]`);i&&r(i.parentNode,this.tabErrorClass)}))}decodeHtml(t){const e=document.createElement("textarea");return e.innerHTML=t,e.value}removeFormAlert(){const t=this.$form.parentNode.querySelector("[data-fui-alert]");t&&t.remove()}removeTabErrors(){this.$form.parentNode.querySelectorAll("[data-fui-page-tab]").forEach((t=>{i(t,this.tabErrorClass)}))}beforeSubmit(){this.validator?.removeAllErrors(),this.removeFormAlert(),this.removeTabErrors(),(this.settings.enableBackSubmission||"back"!==this.form.submitAction)&&this.addLoading()}ajaxSubmit(){const t=new FormData(this.$form),r=this.$form.getAttribute("method"),i=this.$form.getAttribute("action"),n=s(this.$form,r||"POST",i||window.location.href,!0);n.timeout=1e3*(this.settings.ajaxTimeout||10),this.beforeSubmit(),n.ontimeout=()=>{this.onAjaxError(e("The request timed out."))},n.onerror=t=>{this.onAjaxError(e("The request encountered a network error. Please try again."))},n.onload=()=>{if(n.status>=200&&n.status<300)try{const t=JSON.parse(n.responseText);t.errors?this.onAjaxError(t.errorMessage,t):this.onAjaxSuccess(t)}catch(t){this.onAjaxError(e("Unable to parse response `{e}`.",{e:t}))}else this.onAjaxError(`${n.status}: ${n.statusText}`)},n.send(t)}afterAjaxSubmit(t){if(this.updateSubmitAction("submit"),this.updateSubmissionInput(t),t.submitData&&Array.isArray(t.submitData)&&t.submitData.length){const e=t.submitData.filter((t=>"event"in t));e.length&&(this.removeFormAlert(),e.forEach((t=>{this.$form.dispatchEvent(new CustomEvent(t.event,{bubbles:!0,detail:{data:t.data}}))})))}}onAjaxError(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=e.errors||{},i=e.pageFieldErrors||{};this.onFormError(t),this.showTabErrors(i),this.submitHandler.formSubmitError(e),this.afterAjaxSubmit(e),Object.keys(r).forEach(((t,e)=>{const[i]=r[t];let s=t.split(".");s=s.join("][");let n=this.$form.querySelector(`[name="fields[${s}]"]`);if(n||(n=this.$form.querySelector(`[name="fields[${s}][]"]`)),!n&&t.includes("[")){const e=t.match(/\[(.*?)\]/)[1]||null;let r=`fields[${t.replace(/\./g,"][").replace("]]","]").replace(/\[.*?\]/,"][rows][.*][fields]")}]`;r=r.replace(/\[/g,"\\[").replace(/\]/g,"\\]");const i=this.querySelectorAllRegex(new RegExp(r),"name");i.length&&i[e]&&(n=i[e])}n||(n=this.$form.querySelector(`[name="fields[${s}][date]"]`),n||(n=this.$form.querySelector(`[name="fields[${s}][time]"]`))),!n&&s.includes("formieCaptchaQuestion")&&(s=s.replace("formieCaptchaQuestion","[formieCaptchaQuestion]"),n=this.$form.querySelector(`[name="fields${s}"]`)),n&&(i&&this.validator?.showError(n,"server",i),0===e&&n.focus())})),this.togglePage(e,!1)}onAjaxSuccess(t){if(this.submitHandler.formAfterSubmit(t),this.afterAjaxSubmit(t),this.updateFormHash(),"submit"===this.form.submitAction&&this.triggerJsEvents(),t.nextPageId)return this.removeLoading(),void this.togglePage(t);if(t.redirectCallback)t.redirectCallback();else if(t.redirectUrl)"new-tab"===this.settings.submitActionTab?(this.resetForm(),t.redirectTarget.open(t.redirectUrl,"_blank")):t.redirectTarget.location.href=t.redirectUrl;else{if(this.removeLoading(),t.totalPages>1)if("top-form"==this.settings.submitActionMessagePosition)this.togglePage({nextPageIndex:0,nextPageId:this.settings.pages[0].id,totalPages:this.settings.pages.length});else{this.$submitBtn&&this.$submitBtn.remove();this.$form.querySelectorAll('[data-submit-action="back"]').forEach((t=>{t.remove()}))}if("message"===this.settings.submitAction){const e=t.submitActionMessage||this.settings.submitActionMessage;
1this.showFormAlert(e,"success"),this.hideSuccess(),this.settings.submitActionFormHide&&(this.$form.style.display="none"),this.settings.scrollToTop&&this.scrollToForm()}this.resetForm(),this.removeHiddenInput("submissionId"),this.removeHiddenInput("submissionUid"),this.updateFormHash()}}updateSubmitAction(t){t||(t="submit"),this.form.submitAction=t,this.updateOrCreateHiddenInput("submitAction",t)}updateSubmissionInput(t){t.nextPageId&&(t.submissionId&&this.updateOrCreateHiddenInput("submissionId",t.submissionId),t.submissionUid&&this.updateOrCreateHiddenInput("submissionUid",t.submissionUid))}updateOrCreateHiddenInput(t,e){let r=this.$form.querySelector(`[name="${t}"][type="hidden"]`);r||(r=document.createElement("input"),r.setAttribute("type","hidden"),r.setAttribute("name",t),this.$form.appendChild(r)),r.setAttribute("value",e)}resetForm(){this.$form.reset(),this.$form.querySelectorAll('[type="checkbox"]').forEach((t=>{t.removeAttribute("checked")}))}removeHiddenInput(t){const e=this.$form.querySelector(`[name="${t}"][type="hidden"]`);e&&e.parentNode.removeChild(e)}togglePage(t){this.$form.dispatchEvent(new CustomEvent("onFormiePageToggle",{bubbles:!0,detail:{data:t}}));const e=this.$form.querySelectorAll("[data-fui-page]");t.nextPageId&&e.forEach((e=>{e.id===`${this.getPageId(t.nextPageId)}`?e.removeAttribute("data-fui-page-hidden"):e.setAttribute("data-fui-page-hidden",!0)}));const s=this.$form.querySelector("[data-fui-progress-bar]"),n=this.$form.querySelector("[data-fui-progress-value]");if(s&&t.nextPageIndex>=0){const e=parseInt(t.nextPageIndex,10)+1,r=Math.round(e/t.totalPages*100);s.style.width=`${r}%`,s.setAttribute("aria-valuenow",r),n.setAttribute("data-fui-progress-value",r),n.textContent=`${r}%`}const o=this.$form.querySelectorAll("[data-fui-page-tab]");if(t.nextPageId){o.forEach((e=>{e.id===`${this.tabClass}-${t.nextPageId}`?r(e,this.tabActiveClass):i(e,this.tabActiveClass)}));let e=!0;o.forEach((t=>{t.classList.contains(this.tabActiveClass)&&(e=!1),e?r(t,this.tabCompleteClass):i(t,this.tabCompleteClass)})),this.setCurrentPage(t.nextPageId)}this.settings.scrollToTop&&this.scrollToForm()}setCurrentPage(t){this.settings.currentPageId=t,this.$currentPage=this.$form.querySelector(`#${this.getPageId(t)}`);const e=this.$form.querySelector('input[type="hidden"][name="pageIndex"]');e&&(e.value=this.getCurrentPageIndex())}getCurrentPage(){return this.settings.pages.find((t=>t.id==this.settings.currentPageId))}getCurrentPageIndex(){const t=this.getCurrentPage();return t?this.settings.pages.indexOf(t):0}getPageId(t){return`${this.config.formHashId}-p-${t}`}isLastPage(){return this.getCurrentPageIndex()===this.settings.pages.length-1}scrollToForm(){this.$form.parentNode.scrollIntoView({behavior:"smooth",block:"start"})}triggerJsEvents(){const t=this.getCurrentPage();if(t&&t.settings.enableJsEvents){const e={};t.settings.jsGtmEventOptions.forEach((t=>{e[t.label]=t.value})),window.dataLayer=window.dataLayer||[],window.dataLayer.push(e)}}querySelectorAllRegex(t,e){const r=[];for(const i of this.$form.querySelectorAll(`[${e}]`))t.test(i.getAttribute(e))&&r.push(i);return r}}class p{constructor(){this._listeners=new Set}on(t,e,r){let{key:i,options:s}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!t)return;i&&this.offByKey(i);const n={element:t,type:e,handler:r,options:s,key:i};return t.addEventListener(e,r,s),this._listeners.add(n),()=>this.off(t,e,r,s)}off(t,e,r,i){for(const s of this._listeners)s.element===t&&s.type===e&&s.handler===r&&s.options===i&&(s.element.removeEventListener(s.type,s.handler,s.options),this._listeners.delete(s))}offByKey(t){if(t)for(const e of this._listeners)e.key===t&&(e.element.removeEventListener(e.type,e.handler,e.options),this._listeners.delete(e))}offAll(){for(const t of this._listeners)t.element.removeEventListener(t.type,t.handler,t.options);this._listeners.clear()}}class b{constructor(){this._listeners=new Map,this._lastPayload=new Map}on(t,e){let{replay:r=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._listeners.has(t)||this._listeners.set(t,new Set),this._listeners.get(t).add(e),r&&this._lastPayload.has(t)&&e(this._lastPayload.get(t)),()=>{this.off(t,e)}}off(t,e){const r=this._listeners.get(t);r&&(r.delete(e),r.size||(this._listeners.delete(t),this._lastPayload.delete(t)))}emit(t,e){let{sticky:r=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r&&this._lastPayload.set(t,e);const i=this._listeners.get(t);if(i)for(const t of i)t(e)}clear(){this._listeners.clear(),this._lastPayload.clear()}}class v{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.$form=t,this.config=e,this.settings=e.settings,this.eventManager=new p,this.eventBus=new b,this.destroyed=!1,this.$form&&(this.$form.form=this,this.settings.outputJsTheme&&(this.formTheme=new g(this.$form,this.config)),this.registerFieldEvents(this.$form),this.$form.dispatchEvent(new CustomEvent("onFormieReady",{bubbles:!0,detail:{form:this}})),this.addEventListener(this.$form,"submit",(t=>{t.preventDefault(),this.initSubmit()})))}initSubmit(){const t=this.eventObject("onBeforeFormieSubmit",{submitHandler:this});this.$form.dispatchEvent(t)&&this.processSubmit()}destroy(){this.destroyed||(this.destroyed=!0,this.formDestroy({form:this}),this.eventManager&&this.eventManager.offAll(),this.eventBus&&this.eventBus.clear(),this.$form&&this.$form.form===this&&delete this.$form.form)}processSubmit(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];setTimeout((()=>{this.validate()&&this.afterValidate()&&(t.includes("captcha")||this.validateCaptchas())&&(t.includes("payment")||this.validatePayment())&&this.validateCustom()&&this.submitForm(
1)}),300)}validate(){const t=this.eventObject("onFormieValidate",{submitHandler:this});return this.$form.dispatchEvent(t)}validateError(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.$form.dispatchEvent(new CustomEvent("onFormieValidateError",{bubbles:!0,detail:t}))}afterValidate(){const t=this.eventObject("onAfterFormieValidate",{submitHandler:this});return this.$form.dispatchEvent(t)}validateCaptchas(){const t=this.eventObject("onFormieCaptchaValidate",{submitHandler:this});return this.$form.dispatchEvent(t)}validatePayment(){const t=this.eventObject("onFormiePaymentValidate",{submitHandler:this});return this.$form.dispatchEvent(t)}validateCustom(){const t=this.eventObject("onFormieCustomValidate",{submitHandler:this});return this.$form.dispatchEvent(t)}submitForm(){const t=this.eventObject("onFormieSubmit",{submitHandler:this});this.$form.dispatchEvent(t)&&("ajax"===this.settings.submitMethod?this.formAfterSubmit():this.$form.submit())}formAfterSubmit(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.redirectTarget=t.redirectTarget||window,this.$form.dispatchEvent(new CustomEvent("onAfterFormieSubmit",{bubbles:!0,detail:t})),t.nextPageId||this.config.Formie.refreshFormTokens(this)}formSubmitError(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.$form.dispatchEvent(new CustomEvent("onFormieSubmitError",{bubbles:!0,detail:t}))}formDestroy(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.$form.dispatchEvent(new CustomEvent("onFormieDestroy",{bubbles:!0,detail:t}))}registerFieldEvents(t){t.querySelectorAll("[data-field-type]").forEach((t=>{const e=t.querySelector("input, select");e&&(this.addEventListener(e,"input",(e=>{t.dispatchEvent(new CustomEvent("input",{bubbles:!1,detail:{input:e.target}}))})),this.addEventListener(e,"focus",(e=>{t.dispatchEvent(new CustomEvent("focus",{bubbles:!1,detail:{input:e.target}}))})),this.addEventListener(e,"blur",(e=>{t.dispatchEvent(new CustomEvent("blur",{bubbles:!1,detail:{input:e.target}}))})),t.dispatchEvent(new CustomEvent("init",{bubbles:!1,detail:{input:e}})))}))}addEventListener(t,e,r,i){if(this.destroyed)return;if(!t||!e||!r)return;const s=e.split(".")[0],n=e.includes(".")?e:void 0;this.eventManager.on(t,s,r,{key:n,options:i})}removeEventListener(t){this.eventManager.offByKey(t)}eventObject(t,e){return new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e})}getThemeConfigAttributes(t){return(this.settings.themeConfig||{})[t]||{}}getClasses(t){const e=this.getThemeConfigAttributes(t).class;return Array.isArray(e)?e.filter((t=>"string"==typeof t&&t.trim())).join(" ").trim():"string"==typeof e?e.trim():""}applyThemeConfig(t,e){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const i=this.getThemeConfigAttributes(e);i&&Object.entries(i).forEach((e=>{let[i,s]=e;("class"!==i||r)&&(!0===s?t.setAttribute(i,""):t.setAttribute(i,s))}))}registerEvent(t,e,r){return this.eventBus.on(t,e,r)}triggerEvent(t,e,r){this.eventBus.emit(t,e,r)}}function y(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function E(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?y(Object(r),!0).forEach((function(e){x(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function x(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const A={get initPromise(){return window.__formieCsrfInitPromise__||null},set initPromise(t){window.__formieCsrfInitPromise__=t},get initialized(){return!!window.__formieCsrfInitialized__},set initialized(t){window.__formieCsrfInitialized__=!!t},settleDelayMs:0};class S{constructor(){this.forms=[]}initForms(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.$forms=document.querySelectorAll("form[data-fui-form]")||[],this.$forms.length||(this.$forms=document.querySelectorAll("div[data-fui-form]")||[]),this.$forms.forEac
1h((e=>{if(t){const t=new IntersectionObserver((r=>{0!==r[0].intersectionRatio&&(this.initForm(e),t.disconnect())}));t.observe(e)}else this.initForm(e)})),document.dispatchEvent(new CustomEvent("onFormieLoaded",{bubbles:!0,detail:{formie:this}}))}async initForm(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t(r)&&(r=JSON.parse(e.getAttribute("data-fui-form"))),t(r))return void console.error("Unable to parse `data-fui-form` form attribute for config. Ensure this attribute exists on your form and contains valid JSON.");const i=this.getFormByHashId(r.formHashId);i&&await this.destroyForm(i);const s=r.registeredJs||[];r.Formie=this;const n=new v(e,r);if(this.forms.push(n),n.fieldConfigs=this.parseFieldConfig(e,e),s.length){if(document.querySelector(`[data-fui-scripts="${r.formHashId}"]`))return void console.warn(`Formie scripts already loaded for form #${r.formHashId}.`);n.$registeredJs=document.createElement("div"),n.$registeredJs.setAttribute("data-fui-scripts",r.formHashId),document.body.appendChild(n.$registeredJs),s.forEach((t=>{const i=document.createElement("script");t.src&&(i.src=t.src,i.defer=!0,r.settings.scriptAttributes&&Object.entries(r.settings.scriptAttributes).forEach((t=>{let[e,r]=t;i.setAttribute(e,r)})),i.onload=()=>{if(t.module){const r=n.fieldConfigs[t.module];r&&Array.isArray(r)&&r.length&&r.forEach((e=>{this.initJsClass(t.module,e)})),t.settings&&this.initJsClass(t.module,E({$form:e},t.settings)),"FormieConditions"===t.module&&this.initJsClass(t.module,{$form:e})}}),n.$registeredJs.appendChild(i)}))}document.dispatchEvent(new CustomEvent("onFormieInit",{bubbles:!0,detail:{formie:this,form:n,$form:e,formId:n.config.formHashId}}))}initJsClass(t,e){const r=window[t];r&&new r(e)}parseFieldConfig(t,e){const r={};return t.querySelectorAll("[data-field-config]").forEach((t=>{let i=JSON.parse(t.getAttribute("data-field-config"));
1Array.isArray(i)||(i=[i]),i.forEach((i=>{r[i.module]||(r[i.module]=[]),r[i.module].push(E({$form:e,$field:t},i))}))})),r}getForm(t){return this.forms.find((e=>e.$form==t))}getFormById(t){return this.forms.find((e=>{if(e.config)return e.config.formId==t}))}getFormByHashId(t){return this.forms.find((e=>{if(e.config)return e.config.formHashId==t}))}getFormByHandle(t){return this.forms.find((e=>{if(e.config)return e.config.formHandle==t}))}async destroyForm(t){let e;if(t instanceof v?e=t.$form:(e=t,t=this.getForm(e)),!t||!e)return;const r=this.forms.indexOf(t);-1!==r&&(t.$registeredJs&&t.$registeredJs.parentNode&&t.$registeredJs.parentNode.removeChild(t.$registeredJs),t.formTheme&&t.formTheme.validator&&t.formTheme.validator.destroy(),t.destroy(),this.forms.splice(r,1))}refreshForCache(t,e){const r=this.getFormByHashId(t);r?this.refreshFormTokens(r,e):console.error(`Unable to find form "${t}".`)}ensureCsrfInitialized(t){return A.initialized?Promise.resolve():(A.initPromise||(A.initPromise=fetch(t,{method:"GET",credentials:"include",headers:{Accept:"application/json"}}).then((t=>{if(!t.ok)throw new Error(`CSRF init failed (${t.status})`);A.initialized=!0})).then((async()=>{A.settleDelayMs>0&&await new Promise((t=>setTimeout(t,A.settleDelayMs)))})).catch((t=>{throw A.initPromise=null,A.initialized=!1,t})).finally((()=>{A.initialized&&(A.initPromise=null)}))),A.initPromise)}refreshFormTokens(t,e){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const{formHashId:i,formHandle:s}=t.config,n=t.settings.refreshTokenUrl.replace("FORM_PLACEHOLDER",s);return this.ensureCsrfInitialized(n).then((()=>fetch(n,{method:"GET",credentials:"include",headers:{Accept:"application/json"}}))).then((t=>{if(!t.ok)throw new Error(`GET ${n} failed (${t.status})`);return t.json()})).then((s=>{const{$form:n}=t;if(r){if(s.csrf&&s.csrf.param){const e=n.querySelector(`input[name="${s.csrf.param}"]`);e?(e.value=s.csrf.token,t.settings.outputConsoleMessages&&console.log(`${i}: Refreshed CSRF input %o.`,s.csrf)):console.error(`${i}: Unable to locate CSRF input for "${s.csrf.param}".`)}else console.error(`${i}: Missing CSRF token information in cache-refresh response.`);s.captchas&&Object.entries(s.captchas).forEach((e=>{let[r,s]=e;var o,a;(o=`input[name="${s.sessionKey}"]`,a=n,a=a||document,new Promise((t=>{if(a.querySelector(o))return t(a.querySelector(o));const e=new MutationObserver((r=>{a.querySelector(o)&&(e.disconnect(),t(a.querySelector(o)))}));e.observe(a,{childList:!0,subtree:!0})}))).then((e=>{s.value&&(e.value=s.value,t.settings.outputConsoleMessages&&console.log(`${i}: Refreshed "${r}" captcha input %o.`,s))})),setTimeout((()=>{n.querySelector(`input[name="${s.sessionKey}"]`)||console.error(`${i}: Unable to locate captcha input for "${r}".`)}),1e4)})),t.formTheme&&t.formTheme.updateFormHash()}return e&&e(s),s})).catch((t=>{throw console.error(`${i}: Token refresh failed.`,t),t}))}}window.Formie=S,window.Formie=new S;const $=document.currentScript,C=!$?.hasAttribute("data-manual-init"),w=!$?.hasAttribute("data-bypass-observer");C&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",(t=>{window.Formie.initForms(w)})):window.Formie.initForms(w))},207:function(){},6921:function(){},9303:function(){},5745:function(){},1425:function(){},8910:function(){},880:function(){}},r={};function i(t){var s=r[t];if(void 0!==s)return s.exports;var n=r[t]={exports:{}};return e[t](n,n.exports,i),n.exports}i.m=e,t=[],i.O=function(e,r,s,n){if(!r){var o=1/0;for(h=0;h<t.length;h++){r=t[h][0],s=t[h][1],n=t[h][2];for(var a=!0,l=0;l<r.length;l++)(!1&n||o>=n)&&Object.keys(i.O).every((function(t){return i.O[t](r[l])}))?r.splice(l--,1):(a=!1,n<o&&(o=n));if(a){t.splice(h--,1);var u=s();void 0!==u&&(e=u)}}return e}n=n||0;for(var h=t.length;h>0&&t[h-1][2]>n;h--)t[h]=t[h-1];t[h]=[r,s,n]},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){var t={6031:0,2119:0,8815:0,3555:0,6644:0,907:0,3997:0,9634:0};i.O.j=function(e){return 0===t[e]};var e=function(e,r){var s,n,o=r[0],a=r[1],l=r[2],u=0;if(o.some((function(e){return 0!==t[e]}))){for(s in a)i.o(a,s)&&(i.m[s]=a[s]);if(l)var h=l(i)}for(e&&e(r);u<o.length;u++)n=o[u],i.o(t,n)&&t[n]&&t[n][0](),t[n]=0;return i.O(h)},r=self.formieConfigChunkLoadingGlobal=self.formieConfigChunkLoadingGlobal||[];
1r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))}(),i.O(void 0,[2119,8815,3555,6644,907,3997,9634],(function(){return i(8502)})),i.O(void 0,[2119,8815,3555,6644,907,3997,9634],(function(){return i(9303)})),i.O(void 0,[2119,8815,3555,6644,907,3997,9634],(function(){return i(5745)})),i.O(void 0,[2119,8815,3555,6644,907,3997,9634],(function(){return i(1425)})),i.O(void 0,[2119,8815,3555,6644,907,3997,9634],(function(){return i(8910)})),i.O(void 0,[2119,8815,3555,6644,907,3997,9634],(function(){return i(880)})),i.O(void 0,[2119,8815,3555,6644,907,3997,9634],(function(){return i(207)}));var s=i.O(void 0,[2119,8815,3555,6644,907,3997,9634],(function(){return i(6921)}));s=i.O(s)}();

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.