­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ (()=>{"use strict";function t(){this.attrName="",this.initial=null,this.isFromData=!1,this.value=null}t.prototype={attrName:"",input:null,initial:null,value:null,observe(){this.value=new _(this.initial),this.value.make(),this.addWatcherAttr()},nodeSignal(){const[t]=this.input.nodes;t[this.attrName]=this.value.current},addWatcherAttr(){this.value.watch(()=>this.nodeSignal())},isSupported(t){var e;const[n]=t.nodes,r=null!==(e=-1!==n[this.attrName])&&void 0!==e?e:-1;return!(!n.dataset.hasOwnProperty(this.attrName)&&!r)&&(this.initial=this.getInitial(t),Boolean(this.initial))},getInitial(t){const[e]=t.nodes;return e.dataset[this.attrName]||e[this.attrName]||!1},setInput(t){this.input=t}};const e=t;function n(){e.call(this),this.attrName="max_files",this.isSupported=function(t){const[e]=t.nodes;return"file"===e.type},this.setInput=function(t){e.prototype.setInput.call(this,t);const{max_files:n=1}=JSON.parse(t.previewsContainer.dataset.args);this.initial=+n},this.addWatcherAttr=()=>{}}n.prototype=Object.create(e.prototype);const r=n;function o(){r.call(this),this.attrName="max_size",this.setInput=function(t){r.prototype.setInput.call(this,t);const{max_size:e=1}=JSON.parse(t.previewsContainer.dataset.args);this.initial=+e}}o.prototype=Object.create(r.prototype);const i=o;function s(){e.call(this),this.attrName="remaining",this.isSupported=function(t){return t.attrs.hasOwnProperty("maxLength")},this.setInput=function(t){var n;e.prototype.setInput.call(this,t);const{maxLength:r}=t.attrs,o=null!==(n=t.value.current?.length)&&void 0!==n?n:0;this.initial=r.value.current-o},this.addWatcherAttr=()=>{},this.observe=function(){e.prototype.observe.call(this),this.input.value.watch(()=>this.updateAttr()),this.input.attrs.maxLength.value.watch(()=>this.updateAttr())},this.updateAttr=function(){var t;const{maxLength:e}=this.input.attrs,n=null!==(t=this.input.value.current?.length)&&void 0!==t?t:0;this.value.current=e.value.current-n}}s.prototype=Object.create(e.prototype);const a=s;function u(){r.call(this),this.attrName="file_ext",this.isSupported=function(t){const[e]=t.nodes;return"file"===e.type&&Boolean(e.accept)},this.setInput=function(t){r.prototype.setInput.call(this,t);const[e]=t.nodes;this.initial=e.accept.split(",")},this.addWatcherAttr=function(){const[t]=this.input.nodes;this.value.watch(()=>{t.accept=this.value.current.join(",")})}}u.prototype=Object.create(r.prototype);const l=u,c=navigator.userAgent,h={safari:/^((?!chrome|android).)*safari/i.test(c)||/constructor/i.test(window.HTMLElement)||"[object SafariRemoteNotification]"===(!window.safari||"undefined"!=typeof safari&&window.safari.pushNotification).toString()},{applyFilters:p}=JetPlugins.hooks;async function f(t){const e=await Promise.allSettled(t.map(t=>new Promise(t)));return window?.JetFormBuilderSettings?.devmode&&(console.group("allRejected"),console.info(...e),console.groupEnd()),e.filter(t=>"rejected"===t.status).map(({reason:t,value:e})=>t?.length?t[0]:null!=t?t:e)}let d=[];function m(t){const n=new e;return n.attrName=t,n}function g(t){for(const e of(d.length||(d=p("jet.fb.input.html.attrs",["min","max","minLength","maxLength",r,i,a,l])),[...d])){let n;n="string"==typeof e?m(e):new e,n.isSupported(t)&&(t.attrs[n.attrName]=n,n.setInput(t),n.observe())}}function y(t){return"boolean"==typeof t?!t:null==t||("object"!=typeof t||Array.isArray(t)?"number"==typeof t?0===t:!t?.length:!Object.keys(t)?.length)}function b(t){return t?.isConnected&&null!==t?.offsetParent}function v(t){var e;const n=t.getBoundingClientRect(),r=S(t);return n?.top+(null!==(e=r?.scrollY)&&void 0!==e?e:0)}const w=t=>t.scrollHeight>t.clientHeight&&t;function S(t){let e=t.closest(".jet-popup__container-inner");return e?w(e):(e=t.closest(".elementor-popup-modal .dialog-message"),e?w(e):window)}function j(t){for(const e of t)if(!e.reporting.validityState.current){!e.reporting.hasAutoScroll()&&e.onFocus();break}}function N(t=null){this.current=t,this.signals=[],this.sanitizers=[],this.isDebug=!1,this.isSilence=!1,this.isMaked=!1}N.prototype={watchOnce(t){if("function"!=typeof t)return;const e=this.watch(()=>{e(),t()})},watch(t){if("function"!=typeof t)return!1;if(this.signals.some(({signal:e})=>e===t))return!0;this.signals.push({signal:t,trace:(new Error).stack});const e=this.signals.length-1;return()=>this.signals.splice(e,1)},sanitize(t){if("function"!=typeof t)return!1;if(-1!==this.sanitizers.indexOf(t))return!0;this.sanitizers.push(t);const e=this.sanitizers.length-1;return()=>this.sanitizers.splice(e,1)},make(){if(this.isMaked)return;this.isMaked=!0;let t=this.current,e=null;const n=this;Object.defineProperty(this,"current",{get:()=>t,set(r){t!==r&&(e=t,n.isDebug&&(console.group("ReactiveVar has changed"),console.log("current:",t),console.log("newVal:",r),console.groupEnd()),t=n.applySanitizers(r),n.isSilence||n.notify(e))}})},notify(t=null){this.signals.forEach(({signal:e})=>e.call(this,t))},applySanitizers(t){for(const e of this.sanitizers)t=e.call(this,t);return t},setIfEmpty(t){y(this.current)&&(this.current=t)},debug(){this.isDebug=!this.isDebug},silence(){this.isSilence=!this.isSilence}};const _=N;function I(){_.call(this,!1),this.start=function(){this.current=!0},this.end=function(){this.current=!1},this.toggle=function(){this.current=!this.current}}I.prototype=Object.create(_.prototype);const F=I;function O(){this.handlers=[]}O.prototype={addFilter(t){this.handlers.push(t);const e=this.handlers.length-1;return()=>this.handlers.splice(e,1)},applyFilters(...t){let e=t[0];const n=t.slice(1);for(const t of this.handlers)e=t(e,...n);return e}};const k=O,{strict_mode:C=!1}=window?.JetFormBuilderSettings,E=Boolean(C);function R(){this.input=null,this.lock=new _,this.lock.make(),this.triggerjQuery=!E}R.prototype={input:null,lock:null,isSupported:(t,e)=>!1,setInput(t){this.input=t},run(t){if(!this.lock.current)return this.runSignal(t),void this.unlockTrigger();this.lock.signals.length||this.lock.watchOnce(()=>this.runSignal(t))},triggerJQuery(t){this.triggerjQuery&&jQuery(t).trigger("change")},runSignal(t){},lockTrigger(){this.triggerjQuery=!1},unlockTrigger(){E||(this.triggerjQuery=!0)}};const P=R;function x(t){return"hidden"===t.type}function T(t){return"range"===t.type}function M(){P.call(this)}M.prototype=Object.create(P.prototype),M.prototype.isSupported=function(t,e){return x(t)&&e.isArray()},M.prototype.runSignal=function(){const{current:t}=this.input.value;if(!t?.length){for(const t of this.input.nodes)t.remove();return void this.input.nodes.splice(0,this.input.nodes.length)}const e=[];for(const n of t){if(this.input.nodes.some((t,r)=>t.value===n&&(e.push(r),!0)))continue;const t=document.createElement("input");t.type="hidden",t.value=n,t.name=this.input.rawName,this.input.nodes.push(t),e.push(this.input.nodes.length-1),this.input.comment.parentElement.insertBefore(t,this.input.comment.nextElementSibling)}this.input.nodes=this.input.nodes.filter((t,n)=>!!e.includes(n)||(t.remove(),!1))};const A=M;function B(){P.call(this),this.isSupported=function(t){return T(t)},this.runSignal=function(){const[t]=this.input.nodes;t.value=this.input.value.current,this.input.numberNode.textContent=t.value,this.triggerJQuery(t)}}B.prototype=Object.create(P.prototype);const D=B;function L(){A.call(this),this.isSupported=function(t){return"_jfb_current_render_states[]"===t.name},this.runSignal=function(t){A.prototype.runSignal.call(this,t);const e=new URL(window.location),n=this.input.getSubmit().getFormId(),r=this.input.value.current||[],o=`jfb[${n}][state]`,i=[];for(const t of r)this.input.isCustom(t)&&i.push(t);if(!i.length){if(!e.searchParams.has(o))return;return e.searchParams.delete(o),void window.history.pushState({},"",e.toString())}const s=i.join(",");e.searchParams.get(o)!==s&&(e.searchParams.set(o,s),window.history.pushState({},"",e.toString()))}}L.prototype=Object.create(A.prototype);const V=L,{applyFilters:J}=JetPlugins.hooks;let H=[];function $(t){Error.call(this,t),Error.captureStackTrace?Error.captureStackTrace(this,$):this.stack=(new Error).stack}$.prototype=Object.create(Error.prototype);const Q=$;function q(){this.input=null,this.isRequired=!1,this.errors=null,this.restrictions=[],this.valuePrev=null,this.validityState=null,this.promisesCount=0}q.prototype={restrictions:[],valuePrev:null,validityState:null,promisesCount:0,validateOnChange(){},validateOnBlur(){},async validate(t=null){const e=await this.getErrors(t);if(this.validityState.current=!Boolean(e.length),!e.length)return this.clearReport(),!0;throw!this.input.root.getContext().silence&&this.report(e),new Q(e[0].name)},async getErrorsRaw(t){throw new Error("getError must return a Promise")},async getErrors(t=null){if(this.input.loading.current||this.input?.callable?.lock?.current||!this.input.isVisible())return[];const e=this.getPromises(t);var n;return this.hasChangedValue()||this.promisesCount!==e.length||this.input.stopValidation||"hr-select-level"===this.input.inputType?(this.promisesCount=e.length,this.errors=[],e.length?(this.errors=await this.getErrorsRaw(e,t),this.errors):this.errors):null!==(n=this.errors)&&void 0!==n?n:[]},report(t){this.input.getContext().reportedFirst?this.reportRaw(t):(this.input.getContext().reportFirst(),this.reportFirst(t))},reportRaw(t){throw new Error("report is empty")},reportFirst(t){this.report(t)},clearReport(){throw new Error("clearReport is empty")},getPromises(t=null){const e=[];for(const n of this.restrictions)this.canProcessRestriction(n)&&(this.beforeProcessRestriction(n),e.push((e,r)=>{n.validatePromise(t).then(()=>e(n)).catch(t=>r([n,t]))}));return e},canProcessRestriction:t=>!0,beforeProcessRestriction(t){},isSupported(t,e){throw new Error("isSupported is empty")},setInput(t){this.validityState=new _,this.validityState.make(),this.input=t,this.setRestrictions(),this.filterRestrictions()},setRestrictions(){},getNode(){return this.input.nodes[0]},hasChangedValue(){return this.valuePrev!==this.input.getValue()},checkValidity(){const t=this.input.getContext().silence;return null===this.validityState.current?this.validateOnChangeState():this.validityState.current?Promise.resolve():(t||!t&&this.report(this.errors||[]),Promise.reject())},hasAutoScroll:()=>!1,filterRestrictions(){const t={};for(let[e,n]of Object.entries(this.restrictions))e=n.getType()?n.getType():e,t[e]=n;this.restrictions=Object.values(t)}};const Y=q;function z(){Y.call(this),this.isSupported=function(){return!0},this.reportRaw=function(){},this.reportFirst=function(){this.getNode().reportValidity()},this.setRestrictions=function(){const[t]=this.input.nodes;!function(t,e){for(const n of(ot.length||(ot=rt()),[...ot])){const r=new n;r.isSupported(e,t)&&t.restrictions.push(r)}t.restrictions.forEach(e=>e.setReporting(t))}(this,t)},this.clearReport=function(){},this.validateOnChange=function(){this.getErrors().then(t=>{this.validityState.current=!Boolean(t.length),t.length||this.clearReport()}).catch(()=>{})},this.getErrorsRaw=async function(t){const e=await f(t);return this.valuePrev=this.input.getValue(),e},this.validateOnChangeState=function(){return this.validate()},this.hasAutoScroll=function(){return this.input.hasAutoScroll()},this.getNode=function(){return this.input.getReportingNode()}}z.prototype=Object.create(Y.prototype);const W=z;function K(){this.reporting=null,this.type=""}K.prototype={isSupported:(t,e)=>!0,getType(){return this.type},setReporting(t){this.reporting=t},getValue(){return this.reporting.input.value.current},validate(){throw new Error("validate is wrong")},async validatePromise(){let t;try{t=await this.validate()}catch(t){var e;return Promise.reject(null!==(e=t?.message)&&void 0!==e?e:t)}return t?Promise.resolve():Promise.reject("validate is wrong")},onReady(){}};const U=K;function Z(){U.call(this),this.isSupported=function(t){return!!t.checkValidity},this.validate=function(){const{nodes:t}=this.reporting.input;for(const e of t)if(e.checkValidity())return!0;return!1}}Z.prototype=Object.create(U.prototype);const G=Z;function X(){U.call(this),this.type="required"}X.prototype=Object.create(U.prototype),X.prototype.isSupported=function(t,e){return e.input.isRequired},X.prototype.validate=function(){const{current:t}=this.reporting.input.value;return!y(t)};const tt=X,{applyFilters:et}=JetPlugins.hooks;let nt=[];const rt=()=>et("jet.fb.restrictions.default",[G,tt]);let ot=[];function it(t,e=!1){const n=[];t?.[0]?.getContext()?.reset({silence:e});for(const e of t){if(!(e instanceof lt))throw new Error("Input is not instance of InputData");n.push((t,n)=>{e.reporting.validateOnChangeState().then(t).catch(n)})}return n}function st(t,e=!1){return f(it(t,e))}const{doAction:at}=JetPlugins.hooks;function ut(){this.rawName="",this.name="",this.comment=!1,this.nodes=[],this.attrs={},this.enterKey=null,this.inputType=null,this.offsetOnFocus=75,this.path=[],this.value=this.getReactive(),this.value.watch(this.onChange.bind(this)),this.isRequired=!1,this.calcValue=null,this.reporting=null,this.checker=null,this.root=null,this.loading=new F(!1),this.loading.make(),this.isResetCalcValue=!0,this.validateTimer=!1,this.stopValidation=!1,this.abortController=null}ut.prototype.attrs={},ut.prototype.isSupported=function(t){return!1},ut.prototype.addListeners=function(){const[t]=this.nodes;t.addEventListener("input",t=>{this.value.current=t.target.value}),t.addEventListener("blur",()=>{}),t.addEventListener("input",()=>{this.reporting&&"function"==typeof this.reporting.switchButtonsState&&this.reporting.switchButtonsState(!0),this.debouncedReport()}),!E&&jQuery(t).on("change",t=>{this.value.current!=t.target.value&&(this.callable.lockTrigger(),this.value.current=t.target.value,this.callable.unlockTrigger())}),"input"===this.inputType&&(this.enterKey=new k,t.addEventListener("keydown",this.handleEnterKey.bind(this)))},ut.prototype.makeReactive=function(){this.onObserve(),this.addListeners(),this.setValue(),this.initNotifyValue(),this.value.make(),at("jet.fb.input.makeReactive",this)},ut.prototype.onChange=function(t){this.isResetCalcValue&&(this.calcValue=this.value.current),this?.callable?.run(t),this.report()},ut.prototype.report=function(){this.reporting.validateOnChange()},ut.prototype.reportOnBlur=function(t=null){this.reporting.validateOnBlur(t)},ut.prototype.debouncedReport=function(){this.validateTimer&&(this.stopValidation=!0,clearTimeout(this.validateTimer),this.abortController&&this.abortController.abort()),this.abortController=new AbortController;let t=this.abortController.signal;this.validateTimer=setTimeout(()=>{this.reportOnBlur(t)},450)},ut.prototype.watch=function(t){return this.value.watch(t)},ut.prototype.watchValidity=function(t){return this.reporting.validityState.watch(t)},ut.prototype.sanitize=function(t){return this.value.sanitize(t)},ut.prototype.merge=function(t){this.nodes=[...t.getNode()]},ut.prototype.setValue=function(){let t;t=this.isArray()?Array.from(this.nodes).map(({value:t})=>t):this.nodes[0]?.value,this.calcValue=t,this.value.current=t},ut.prototype.setNode=function(t){var e;this.nodes=[t],this.rawName=null!==(e=t.name)&&void 0!==e?e:"",this.name=_t(this.rawName),this.inputType=t.nodeName.toLowerCase()},ut.prototype.onObserve=function(){const[t]=this.nodes;t.jfbSync=this,this.isRequired=this.checkIsRequired(),this.callable=function(t,e){for(const n of(H.length||(H=J("jet.fb.signals",[D,V,A])),[...H])){const r=new n;if(r.isSupported(t,e))return r}return null}(t,this),this.callable.setInput(this),this.reporting=function(t){for(const e of(nt.length||(nt=et("jet.fb.reporting",[W])),[...nt])){const n=new e;if(n.isSupported(t.nodes[0],t))return n.setInput(t),n}throw new Error("Something went wrong")}(this),this.loading.watch(()=>this.onChangeLoading()),this.path=[...this.getParentPath(),this.name],this.getSubmit().submitter.hasOwnProperty("status")&&!this.hasParent()&&this.getSubmit().submitter.watchReset(()=>this.onClear())},ut.prototype.onChangeLoading=function(){this.getSubmit().lockState.current=this.loading.current;const[t]=this.nodes;t.closest(".jet-form-builder-row").classList.toggle("is-loading",this.loading.current)},ut.prototype.setRoot=function(t){this.root=t},ut.prototype.onRemove=function(){},ut.prototype.getName=function(){return this.name},ut.prototype.getValue=function(){return this.value.current},ut.prototype.getNode=function(){return this.nodes},ut.prototype.isArray=function(){return this.rawName.includes("[]")},ut.prototype.beforeSubmit=function(t,e=!1){this.getSubmit().submitter.promise(t,e)},ut.prototype.getSubmit=function(){return this.getRoot().form},ut.prototype.getRoot=function(){return this.root?.parent?this.root.parent.getRoot():this.root},ut.prototype.isVisible=function(){return b(this.getWrapperNode())},ut.prototype.onClear=function(){this.silenceSet(null)},ut.prototype.getReactive=function(){return new _},ut.prototype.checkIsRequired=function(){var t;const[e]=this.nodes;return null!==(t=e.required)&&void 0!==t?t:!!e.dataset.required?.length},ut.prototype.silenceSet=function(t){const e=this.report.bind(this);this.report=()=>{},this.value.current=t,this.report=e},ut.prototype.silenceNotify=function(){const t=this.report.bind(this);this.report=()=>{},this.value.notify(),this.report=t},ut.prototype.hasParent=function(){return!!this.root?.parent},ut.prototype.getWrapperNode=function(){return this.nodes[0].closest(".jet-form-builder-row")},ut.prototype.handleEnterKey=function(t){"Enter"!==t.key||!this.enterKey||t.shiftKey||t.isComposing||(t.preventDefault(),this.onEnterKey())},ut.prototype.onEnterKey=function(){this.enterKey.applyFilters(!0)&&!0===this.getSubmit().canTriggerEnterSubmit&&this.getSubmit().submit()},ut.prototype.initNotifyValue=function(){this.silenceNotify()},ut.prototype.onFocus=function(){this.scrollTo(),this.focusRaw()},ut.prototype.focusRaw=function(){const[t]=this.nodes;["date","time","datetime-local"].includes(t.type)||t?.focus({preventScroll:!0})},ut.prototype.scrollTo=function(){const t=this.getWrapperNode();window.scrollTo({top:v(t)-this.offsetOnFocus,behavior:"smooth"})},ut.prototype.getContext=function(){return this.root.getContext()},ut.prototype.populateInner=function(){return!1},ut.prototype.hasAutoScroll=function(){return!0},ut.prototype.getReportingNode=function(){return this.nodes[0]},ut.prototype.getParentPath=function(){if(!this.root?.parent)return[];const t=this.root.parent.value.current;if("object"!=typeof t)return[];for(const[e,n]of Object.entries(t))if(n===this.root)return[...this.root.parent.getParentPath(),this.root.parent.name,e];return[]},ut.prototype.reQueryValue=function(){this.setValue(),this.initNotifyValue()},ut.prototype.revertValue=function(t){this.value.current=t},ut.prototype.reCalculateFormula=function(){this.setValue(),this.initNotifyValue()};const lt=ut;function ct(){lt.call(this),this.isSupported=function(t){return function(t){return["select-one","range"].includes(t.type)}(t)},this.addListeners=function(){const[t]=this.nodes;t.addEventListener("change",t=>{this.value.current=t.target.value}),!E&&jQuery(t).on("change",t=>{this.value.current!=t.target.value&&(this.callable.lockTrigger(),this.value.current=t.target.value,this.callable.unlockTrigger())}),this.enterKey=new k,t.addEventListener("keydown",this.handleEnterKey.bind(this))},this.onClear=function(){this.silenceSet("")}}ct.prototype=Object.create(lt.prototype);const ht=ct;function pt(){lt.call(this),this.numberNode=null,this.isSupported=function(t){return T(t)},this.setNode=function(t){lt.prototype.setNode.call(this,t),this.numberNode=t.parentElement.querySelector(".jet-form-builder__field-value-number")}}pt.prototype=Object.create(lt.prototype);const ft=pt;function dt(){lt.call(this),this.comment=null,this.isSupported=function(t){return x(t)},this.addListeners=function(){},this.onObserve=function(){lt.prototype.onObserve.call(this),this.isArray()&&this.setComment()},this.setComment=function(){this.comment=document.createComment(this.name);const[t]=this.nodes;t.parentElement.insertBefore(this.comment,t)},this.isVisible=function(){return!1},this.merge=function(t){this.nodes.push(...t.getNode())}}dt.prototype=Object.create(lt.prototype);const mt=dt;function gt(t){_.call(this,t)}gt.prototype=Object.create(_.prototype),gt.prototype.add=function(t){var e;this.current=[...new Set([...null!==(e=this.current)&&void 0!==e?e:[],t])]},gt.prototype.remove=function(t){this.current=this.current.filter(e=>e!==t)},gt.prototype.toggle=function(t,e=null){null===e?this.current.includes(t)?this.remove(t):this.add(t):e?this.add(t):this.remove(t)};const yt=gt,{builtInStates:bt}=window.JetFormBuilderSettings;function vt(){mt.call(this),this.isSupported=function(t){return"hidden"===t?.type&&"_jfb_current_render_states[]"===t.name},this.add=function(t){this.value.add(t)},this.remove=function(t){this.value.remove(t)},this.toggle=function(t,e=null){this.value.toggle(t,e)},this.isCustom=function(t){return!bt.includes(t)}}vt.prototype=Object.create(mt.prototype),vt.prototype.getReactive=function(){return new yt};const wt=vt,{applyFilters:St,doAction:jt}=JetPlugins.hooks;let Nt=[];function _t(t){const e=[/^([\w\-]+)\[\]$/,/^[\w\-]+\[\d+\]\[([\w\-]+)\]\[?\]?$/];for(const n of e)if(n.test(t))return t.match(n)[1];return t}function It(t){const e=[];for(const n of t){const t=n.populateInner();t?.length&&e.push(...t),e.push(n)}return e}function Ft(t){this.form=t,this.lastResponse={},this.promises=[]}Ft.prototype.submit=function(){throw new Error("You need to replace this callback")},Ft.prototype.getPromises=function(){return this.promises.map(({callable:t})=>new Promise(t))},Ft.prototype.promise=function(t,e=!1){const n=e?e.path.join("."):"";this.promises=this.promises.filter(({idPath:t})=>!t||t!==n),this.promises.push({callable:t,idPath:e?e.path.join("."):""})};const Ot=Ft;function kt(t){return"success"===t||t?.includes("dsuccess|")}function Ct(t){Ot.call(this,t),this.status=new _,this.status.make(),this.submit=function(){const t=jQuery(this.form.observable.rootNode),{applyFilters:e}=JetPlugins.hooks;Promise.all(e("jet.fb.submit.ajax.promises",this.getPromises(),t)).then(t=>this.runSubmit(t)).catch(()=>this.form.toggle())},this.runSubmit=function(t){const{rootNode:e}=this.form.observable,n=new FormData(e);n.append("_jet_engine_booking_form_id",this.form.getFormId()),this.status.silence(),this.status.current=null,this.status.silence(),jQuery.ajax({url:JetFormBuilderSettings.ajaxurl,type:"POST",dataType:"json",data:n,cache:!1,contentType:!1,processData:!1}).done(n=>{this.onSuccess(n);const r=jQuery(e);t.forEach(t=>{"function"==typeof t&&t.call(r,n)})}).fail(this.onFail.bind(this))},this.onSuccess=function(t){this.form.toggle();const{rootNode:e}=this.form.observable;this.lastResponse=t;const n=jQuery(e),r=t?._jfb_csrf_token;r&&this.refreshCsrfToken(r),"success"===t.status?jQuery(document).trigger("jet-form-builder/ajax/on-success",[t,n]):jQuery(document).trigger("jet-form-builder/ajax/processing-error",[t,n]),this.status.current=t.status,t.redirect?t.open_in_new_tab?window.open(t.redirect,"_blank"):window.location=t.redirect:t.reload&&window.location.reload(),this.insertMessage(t.message)},this.onFail=function(t,e,n){this.form.toggle(),this.status.current=!1;const{rootNode:r}=this.form.observable,o=jQuery(r);jQuery(document).trigger("jet-form-builder/ajax/on-fail",[t,e,n,o]),console.error(t.responseText,n)},this.insertMessage=function(t){const{rootNode:e}=this.form.observable,n=document.createElement("div");n.classList.add("jet-form-builder-messages-wrap"),n.innerHTML=t,e.appendChild(n)},this.refreshCsrfToken=function(t){const e=this.form.getFormId(),n=document.querySelectorAll("form.jet-form-builder[data-form-id]");for(const r of n){if(+r.dataset.formId!==e)continue;const n=r.querySelectorAll('input[name="_jfb_csrf_token"]');for(const e of n)e.value=t}}}Ct.prototype=Object.create(Ot.prototype),Ct.prototype.status=null,Ct.prototype.watchReset=function(t){const{rootNode:e}=this.form.observable;e.dataset?.clear&&this.watchSuccess(t)},Ct.prototype.watchSuccess=function(t){const e=this.status;e.watch(()=>{kt(e.current)&&t()})},Ct.prototype.watchFail=function(t){const e=this.status;e.watch(()=>{kt(e.current)||t()})};const Et=Ct;function Rt(t){Ot.call(this,t),this.failPromises=[],this.submit=function(){const{rootNode:t}=this.form.observable,{applyFilters:e}=JetPlugins.hooks;Promise.all(e("jet.fb.submit.reload.promises",this.getPromises(),{target:t})).then(()=>t.submit()).catch(()=>{this.failPromises.forEach(t=>t()),this.form.toggle()})},this.onFailSubmit=function(t){"function"==typeof t&&this.failPromises.push(t)}}Rt.prototype=Object.create(Ot.prototype);const Pt=Rt,xt=function(t){this.observable=t,this.lockState=new F(!1),this.lockState.make(),this.autoFocus=window.JetFormBuilderSettings?.auto_focus,this.canSubmitForm=!0,this.canTriggerEnterSubmit=!0,this.onSubmit=function(t){t.preventDefault(),this.submit()},this.submit=function(){!0===this.canSubmitForm&&(this.canSubmitForm=!1,this.canTriggerEnterSubmit=!1,this.observable.inputsAreValid().then(()=>{this.clearErrors(),this.toggle(),this.submitter.submit()}).catch(()=>{this.autoFocus&&j(It(this.observable.getInputs()))}).finally(()=>{this.canTriggerEnterSubmit=!0,this.canSubmitForm=!0}))},this.clearErrors=function(){const t=this.observable.rootNode.querySelectorAll(".jet-form-builder-messages-wrap");for(const e of t)e.remove()},this.toggle=function(){this.lockState.toggle(),this.toggleLoading()},this.handleButtons=function(){const t=this.observable.rootNode.querySelectorAll(".jet-form-builder__submit");this.lockState.watch(()=>{for(const e of t)e.disabled=this.lockState.current;!1===this.lockState.current&&(this.canSubmitForm=!0)})},this.toggleLoading=function(){this.observable.rootNode.classList.toggle("is-loading")},this.createSubmitter=function(){const{classList:t}=this.observable.rootNode;return t.contains("submit-type-ajax")?new Et(this):new Pt(this)},this.getFormId=function(){const{rootNode:t}=this.observable;return+t.dataset.formId},this.onEndSubmit=function(t){this.submitter.hasOwnProperty("status")?this.submitter.status.watch(t):this.submitter.onFailSubmit(t)},this.observable.rootNode.addEventListener("submit",t=>this.onSubmit(t)),this.submitter=this.createSubmitter(),this.handleButtons()},Tt=function(t,e){const{replaceAttrs:n=[]}=window.JetFormBuilderSettings,r=[];for(let t=0;tNodeFilter.FILTER_ACCEPT){const n=document.createNodeIterator(t,NodeFilter.SHOW_COMMENT,{acceptNode:e});let r;for(;r=n.nextNode();)r.nodeValue=r.nodeValue.trim(),yield r},At=function*(t){yield*Mt(t,t=>!t.jfbObserved&&t.textContent.includes("JFB_FIELD::"))},Bt=function(t,e,n={}){if(null===e||!e?.length)return t;let r=Boolean(n?.rawRepeaterValue);for(const o of e){const e=r&&!1===o?.isCoreFilter;t=o.applyWithProps(e?n.rawRepeaterValue:t),r=!1}return t};function Dt(){this.props=[]}Dt.prototype.getSlug=function(){throw new Error("getSlug is empty")},Dt.prototype.setProps=function(t){this.props.push(...t)},Dt.prototype.applyWithProps=function(t){return this.apply(t,...this.props)},Dt.prototype.apply=function(t,...e){return t};const Lt=Dt;function Vt(){Lt.call(this),this.getSlug=function(){return"length"},this.apply=function(t){var e;return null!==(e=t?.length)&&void 0!==e?e:0}}Vt.prototype=Object.create(Lt.prototype);const Jt=Vt;function Ht(){Lt.call(this),this.getSlug=function(){return"ifEmpty"},this.apply=function(t,e){return y(t)||Number.isNaN(t)?e:t}}Ht.prototype=Object.create(Lt.prototype);const $t=Ht;function Qt(t,e){return(t=""+t).length>=e?t:new Array(e-t.length).fill(0)+t}function qt(t,e=!0){const n=e?t.getUTCMonth():t.getMonth(),r=e?t.getUTCDate():t.getDate();return[e?t.getUTCFullYear():t.getFullYear(),Qt(n+1,2),Qt(r,2)].join("-")}function Yt(t,e=!0){const n=e?t.getUTCHours():t.getHours(),r=e?t.getUTCMinutes():t.getMinutes();return[Qt(n,2),Qt(r,2)].join(":")}function zt(t,e=!1){return qt(t,e)+"T"+Yt(t,e)}function Wt(t){if(!Number.isNaN(+t))return{time:+t,type:"number"};if((t=t.toString()).split("-").length>1)return{time:new Date(t).getTime(),type:"date"};const e=t.split(":"),n=[Date.prototype.setHours,Date.prototype.setMinutes,Date.prototype.setSeconds],r=new Date;for(const t in e)e.hasOwnProperty(t)&&n.hasOwnProperty(t)&&n[t].call(r,e[t]);return{time:r.getTime(),type:"time"}}function Kt(){Lt.call(this),this.getSlug=function(){return"toDate"},this.apply=function(t,e=!0){if("string"==typeof e){const t=e.trim().replace(/^['"]|['"]$/g,"");e="false"!==t.toLowerCase()}else e=Boolean(e);return qt(new Date(t),e)}}Kt.prototype=Object.create(Lt.prototype);const Ut=Kt;function Zt(){Lt.call(this),this.getSlug=function(){return"toTime"},this.apply=function(t,e=!0){if("string"==typeof e){const t=e.trim().replace(/^['"]|['"]$/g,"");e="false"!==t.toLowerCase()}else e=Boolean(e);return Yt(new Date(t),e)}}Zt.prototype=Object.create(Lt.prototype);const Gt=Zt;function Xt(){Lt.call(this),this.getSlug=function(){return"toDateTime"},this.apply=function(t,e=!1){if("string"==typeof e){const t=e.trim().replace(/^['"]|['"]$/g,"").toLowerCase();e=""!==t&&"false"!==t}else e=Boolean(e);return zt(new Date(t),e)}}Xt.prototype=Object.create(Lt.prototype);const te=Xt;function ee(){Lt.call(this),this.getSlug=function(){return"addYear"},this.apply=function(t,e){const{time:n}=Wt(t),r=new Date(n);return Number.isNaN(r.getTime())?0:(e=e?+e.trim():1,r.setFullYear(r.getFullYear()+e))}}ee.prototype=Object.create(Lt.prototype);const ne=ee;function re(){Lt.call(this),this.getSlug=function(){return"addMonth"},this.apply=function(t,e){const{time:n}=Wt(t),r=new Date(n);return Number.isNaN(r.getTime())?0:(e=e?+e.trim():1,r.setMonth(r.getMonth()+e))}}re.prototype=Object.create(Lt.prototype);const oe=re;function ie(){Lt.call(this),this.getSlug=function(){return"addDay"},this.apply=function(t,e){const{time:n}=Wt(t),r=new Date(n);return Number.isNaN(r.getTime())?0:(e=e?+e.trim():1,r.setDate(r.getDate()+e))}}ie.prototype=Object.create(Lt.prototype);const se=ie;function ae(){Lt.call(this),this.getSlug=function(){return"addHour"},this.apply=function(t,e){const{time:n}=Wt(t),r=new Date(n);return Number.isNaN(r.getTime())?0:(e=e?+e.trim():1,r.setHours(r.getHours()+e))}}ae.prototype=Object.create(Lt.prototype);const ue=ae;function le(){Lt.call(this),this.getSlug=function(){return"addMin"},this.apply=function(t,e){const{time:n}=Wt(t),r=new Date(n);return Number.isNaN(r.getTime())?0:(e=e?+e.trim():1,r.setMinutes(r.getMinutes()+e))}}le.prototype=Object.create(Lt.prototype);const ce=le;function he(){Lt.call(this),this.getSlug=function(){return"T"},this.apply=function(t){if(!t)return 0;const{time:e}=Wt(t);return e}}he.prototype=Object.create(Lt.prototype);const pe=he;function fe(){Lt.call(this),this.getSlug=function(){return"setHour"},this.apply=function(t,e){const{time:n}=Wt(t),r=new Date(n);return Number.isNaN(r.getTime())?t:(e=e?+e.trim():0,r.setHours(e))}}fe.prototype=Object.create(Lt.prototype);const de=fe;function me(){Lt.call(this),this.getSlug=function(){return"setMin"},this.apply=function(t,e){const{time:n}=Wt(t),r=new Date(n);return Number.isNaN(r.getTime())?t:(e=e?+e.trim():0,r.setMinutes(e))}}me.prototype=Object.create(Lt.prototype);const ge=me;function ye(){Lt.call(this),this.getSlug=function(){return"setDay"},this.apply=function(t,e){const{time:n}=Wt(t),r=new Date(n);return Number.isNaN(r.getTime())?0:(e=e?+e.trim():1,r.setDate(e))}}ye.prototype=Object.create(Lt.prototype);const be=ye;function ve(){Lt.call(this),this.getSlug=function(){return"setYear"},this.apply=function(t,e){if(!(e=!!e&&+e.trim()))return t;const{time:n}=Wt(t),r=new Date(n);return Number.isNaN(r.getTime())?0:r.setFullYear(e)}}ve.prototype=Object.create(Lt.prototype);const we=ve;function Se(){Lt.call(this),this.getSlug=function(){return"setMonth"},this.apply=function(t,e){const{time:n}=Wt(t),r=new Date(n);return Number.isNaN(r.getTime())?0:(e=e?+e.trim():1,r.setMonth(e))}}Se.prototype=Object.create(Lt.prototype);const je=Se;function Ne(){Lt.call(this),this.getSlug=function(){return"subHour"},this.apply=function(t,e){const{time:n}=Wt(t),r=new Date(n);return Number.isNaN(r.getTime())?0:(e=e?+e.trim():1,r.setHours(r.getHours()-e))}}Ne.prototype=Object.create(Lt.prototype);const _e=Ne;function Ie(){Lt.call(this),this.getSlug=function(){return"subDay"},this.apply=function(t,e){const{time:n}=Wt(t),r=new Date(n);return Number.isNaN(r.getTime())?0:(e=e?+e.trim():1,r.setDate(r.getDate()-e))}}Ie.prototype=Object.create(Lt.prototype);const Fe=Ie;function Oe(){Lt.call(this),this.getSlug=function(){return"subMin"},this.apply=function(t,e){const{time:n}=Wt(t),r=new Date(n);return Number.isNaN(r.getTime())?0:(e=e?+e.trim():1,r.setMinutes(r.getMinutes()-e))}}Oe.prototype=Object.create(Lt.prototype);const ke=Oe;function Ce(){Lt.call(this),this.getSlug=function(){return"subMonth"},this.apply=function(t,e){const{time:n}=Wt(t),r=new Date(n);return Number.isNaN(r.getTime())?0:(e=e?+e.trim():1,r.setMonth(r.getMonth()-e))}}Ce.prototype=Object.create(Lt.prototype);const Ee=Ce;function Re(){Lt.call(this),this.getSlug=function(){return"subYear"},this.apply=function(t,e){const{time:n}=Wt(t),r=new Date(n);return Number.isNaN(r.getTime())?0:(e=e?+e.trim():1,r.setFullYear(r.getFullYear()-e))}}Re.prototype=Object.create(Lt.prototype);const Pe=Re;function xe(){Lt.call(this),this.getSlug=function(){return"toDayInMs"},this.apply=function(t){return 864e5*t}}xe.prototype=Object.create(Lt.prototype);const Te=xe;function Me(){Lt.call(this),this.getSlug=function(){return"toMonthInMs"},this.apply=function(t){return 2592e6*t}}Me.prototype=Object.create(Lt.prototype);const Ae=Me;function Be(){Lt.call(this),this.getSlug=function(){return"toYearInMs"},this.apply=function(t){return 31536e6*t}}Be.prototype=Object.create(Lt.prototype);const De=Be;function Le(){Lt.call(this),this.getSlug=function(){return"toHourInMs"},this.apply=function(t){return 36e5*t}}Le.prototype=Object.create(Lt.prototype);const Ve=Le;function Je(){Lt.call(this),this.getSlug=function(){return"toMinuteInMs"},this.apply=function(t){return 6e4*t}}Je.prototype=Object.create(Lt.prototype);const He=Je;function $e(){Lt.call(this),this.getSlug=function(){return"toWeekInMs"},this.apply=function(t){return 6048e5*t}}$e.prototype=Object.create(Lt.prototype);const Qe=$e,{applyFilters:qe}=JetPlugins.hooks;let Ye=[];const ze=[we,je,be,de,ge,Pe,Ee,Fe,_e,ke,ne,oe,se,ue,ce,Jt,$t,Ut,Gt,te,pe,Te,Ae,De,Ve,He,Qe];let We=[];function Ke(t,e=""){let n;Ye.length||(Ye=qe("jet.fb.filters",[...ze]));for(let e of Ye){const r=e;if(e=new r,t===e.getSlug()){e.isCoreFilter=ze.includes(r),n=e;break}}n&&(e=e.split(",").map(t=>t.trim()),n.setProps(e),We.push(n))}const Ue=function(t){if(null===t||!t?.length)return null;for(const e of t){const t=e.match(/^(\w+)\(([^()]+)\)/);null!==t?Ke(t[1],t[2]):Ke(e)}const e=[...We];return We=[],e},Ze={"&":"&","<":"<",">":">",'"':""","'":"'"};class Ge{constructor(t){this.html=String(t)}toString(){return this.html}}function Xe(){}Xe.prototype={getId(){throw new Error("You need to rewrite this method")},getResult(){throw new Error("You need to rewrite this method")}};const tn=Xe;function en(){tn.call(this),this.getId=()=>"CurrentDate",this.getResult=()=>(new Date).getTime()}en.prototype=Object.create(tn.prototype);const nn=en,rn={Milli_In_Sec:1e3,Sec_In_Min:60,Min_In_Hour:60,Hour_In_Day:24,Day_In_Month:30,Year_In_Day:365,Kb_In_Bytes:1024};rn.Min_In_Sec=rn.Sec_In_Min*rn.Milli_In_Sec,rn.Hour_In_Sec=rn.Min_In_Hour*rn.Min_In_Sec,rn.Day_In_Sec=rn.Hour_In_Day*rn.Hour_In_Sec,rn.Month_In_Sec=rn.Day_In_Month*rn.Day_In_Sec,rn.Year_In_Sec=rn.Year_In_Day*rn.Day_In_Sec,rn.Mb_In_Bytes=1024*rn.Kb_In_Bytes,rn.Gb_In_Bytes=1024*rn.Mb_In_Bytes,rn.Tb_In_Bytes=1024*rn.Gb_In_Bytes;const on=rn;function sn(){tn.call(this),this.getId=()=>"Min_In_Sec",this.getResult=()=>on.Min_In_Sec}sn.prototype=Object.create(tn.prototype);const an=sn;function un(){tn.call(this),this.getId=()=>"Month_In_Sec",this.getResult=()=>on.Month_In_Sec}un.prototype=Object.create(tn.prototype);const ln=un;function cn(){tn.call(this),this.getId=()=>"Hour_In_Sec",this.getResult=()=>on.Hour_In_Sec}cn.prototype=Object.create(tn.prototype);const hn=cn;function pn(){tn.call(this),this.getId=()=>"Day_In_Sec",this.getResult=()=>on.Day_In_Sec}pn.prototype=Object.create(tn.prototype);const fn=pn;function dn(){tn.call(this),this.getId=()=>"Year_In_Sec",this.getResult=()=>on.Year_In_Sec}dn.prototype=Object.create(tn.prototype);const mn=dn,{applyFilters:gn}=JetPlugins.hooks;let yn=[];const bn=window.wp.i18n,{applyFilters:vn,addFilter:wn}=JetPlugins.hooks;wn("jet.fb.custom.formula.macro","jet-form-builder",function(t,e){if(!e.includes("CT::"))return t;const n=function(t){yn.length||(yn=gn("jet.fb.static.functions",[nn,an,ln,hn,fn,mn]));for(const e of yn){const n=new e;if(n.getId()===t)return n}return!1}(e=e.replace("CT::",""));return!1===n?t:n.getResult()});const Sn=/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/,jn=["await","break","case","continue","debugger","delete","do","else","in","instanceof","new","of","return","throw","typeof","void","yield"],Nn=["if","while","for","switch","catch","with"];function _n(t,e){return!t.startsWith("\0")&&(")"===t?Nn.includes(e):"++"!==t&&"--"!==t&&("..."===t||!t||jn.includes(t)||/[([{:;,=!?&|+\-*%~^<>}]/.test(t)))}function In(t,e,n=!1){if(/[\w$]/.test(e)){if(!n&&/^[A-Za-z_$][\w$]*$/.test(t))return t+e;if("."===t)return"\0"+e;if(t.startsWith("\0")&&/^[\w$]*$/.test(t.slice(1)))return t+e}return"+"!==e&&"-"!==e||e!==t||n?"."!==e||"."!==t&&".."!==t?e:t+e:e+e}function Fn(t,e,n=!1){const r=String(t);if(n)return r.length?"u"+r.charCodeAt(0).toString(16).padStart(4,"0")+Fn(r.slice(1),e):"\n";let o=JSON.stringify(r).slice(1,-1);return"single"===e&&(o=o.replace(/'/g,"\\'")),"template"===e&&(o=o.replace(/`/g,"\\`").replace(/\$/g,"\\$")),o}function On(t,e=!1,n=!1){const r=String(t);return e?r.length?"u"+r.charCodeAt(0).toString(16).padStart(4,"0")+On(r.slice(1),!1,n):"u0000":(n?r.replace(/[\\^\]-]/g,"\\$&"):r.replace(/[\\^$.*+?()[\]{}|/]/g,"\\$&")).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function kn(t){if(!t)return"";if("SELECT"===t.tagName)return Array.from(t.selectedOptions||[]).map(t=>String(t.label||t.textContent||t.value||"").trim()).filter(Boolean).join(", ");if(("checkbox"===t.type||"radio"===t.type)&&!t.checked)return"";if("checkbox"===t.type||"radio"===t.type){const e=t.closest("label");if(!e)return"";const n=e.querySelector("span");return String(n?.textContent||e.textContent||t.value||"").trim()}return""}function Cn(t,e={}){var n;this.parts=[],this.related=[],this.relatedAttrs=[],this.regexp=/%([\w\-].*?\S?)%/g,this.watchers=[];const{forceFunction:r=!1}=e;this.forceFunction=r,t instanceof lt&&(this.input=t),this.root=null!==(n=this.input?.root)&&void 0!==n?n:t}Cn.prototype={formula:null,parts:[],related:[],relatedAttrs:[],input:null,root:null,regexp:null,forceFunction:!1,setResult:()=>{throw new Error("CalculatedFormula.setResult is not set!")},relatedCallback:t=>t.value.current,relatedLabelCallback:t=>function(t){const e=Array.from(t.nodes||[]).map(kn).filter(Boolean);return e.length?e.join(", "):t.value.current}(t),observe(t){this.formula=t,Array.isArray(t)?t.forEach(t=>{this.observeItem(t)}):this.observeItem(t)},observeItem(t){let e,n=0;for(t+="";null!==(e=this.regexp.exec(t));){const r=this.observeMacro(e[1]);0!==e.index&&this.parts.push(t.slice(n,e.index)),n=e.index+e[0].length,!1===r?this.onMissingPart(e[0]):this.parts.push(r)}n!==t.length&&(this.parts.push(t.slice(n)),1===this.parts.length&&(this.parts=[]))},onMissingPart(t){this.parts.push(t)},isFieldNodeExists(t){if(void 0===this.root.dataInputs[t])return!1;let e=this.root.rootNode[t]||this.root.rootNode[t+"[]"]||this.root.rootNode.querySelectorAll('[data-field-name="'+t+'"]');if(e&&0===e.length&&(e=void 0),void 0===e){const n=t.replace(/([\\^$*+?.()|{}\[\]])/g,"\\$1"),r=`[name$="[${n}]"],[name$="[${n}][]"],[name*="[${n}]["]`,o=this.root.rootNode.querySelectorAll(r);o&&o.length&&(e=o)}return e=vn("jet.fb.formula.node.exists",e,t,this),e},observeMacro(t){null===this.formula&&(this.formula=t);const[e,...n]=t.split("|"),r=e.match(/[\w\-:]+/g);if(!r)return!1;let[o,...i]=r;if(e.includes("::")){const[t,...n]=e.split("::");this.root.getInput(t)&&(o=t,i=n)}if(void 0===this.isFieldNodeExists(o)){const t=new RegExp(`%${o}%`,"g");let e,n=0,r=this.formula;for(;null!==(e=t.exec(this.formula));){const t=this.formula[e.index-1],r=this.formula[e.index+e[0].length];if("*"===t||"/"===t||"*"===r||"/"===r){n="/"===t||"*"===t&&"*"===r?1:0;break}n=0;break}return r=r.replace(e[0],n),this.formula=r,n}const s="this"!==o?this.root.getInput(o):this.input;if(!s&&!o.includes("::"))return!1;const a=Ue(n);if(o.includes("::")){const t=vn("jet.fb.custom.formula.macro",!1,o,i,this);return!1!==t&&("function"==typeof t?()=>Bt(t(),a):Bt(t,a))}if(this.related.includes(s.name)||(this.related.push(s.name),this.watchers.push(s.watch(()=>this.setResult()))),!i?.length)return()=>Bt(this.relatedCallback(s),a);const[u]=i;if("label"===u)return()=>Bt(this.relatedLabelCallback(s),a);if(!s.attrs.hasOwnProperty(u))return!1;const l=s.attrs[u];return this.relatedAttrs.includes(s.name+u)||(this.relatedAttrs.push(s.name+u),this.watchers.push(l.value.watch(()=>this.setResult()))),()=>Bt(l.value.current,a)},mapParts(t,e=t=>t){var n;if(!this.parts.length)return this.formula;const{applyFilters:r=!1}=null!==(n=window?.JetFormBuilderMain?.filters)&&void 0!==n?n:{};return this.parts.map(n=>{if("function"!=typeof n)return this.input?.nodes&&!1!==r&&"string"==typeof n?(n=vn("jet.fb.onCalculate.part",n,this),e(r("forms/calculated-formula-before-value",n,jQuery(this.input.nodes[0])))):e(n);const o=n(),i=null==o||""===o||Number.isNaN(o)?this.emptyValue():o;return t(i)}).join("")},calculateString(){return this.mapParts(t=>function(t){return String(t).replace(/[&<>"']/g,t=>Ze[t])}(t))},calculateEvalString(){const t=function(){let t="code",e=!1,n="code",r="code";const o=[],i=[];let s=!1,a="code",u="",l="",c=!1;const h=[];let p="";return{consume(f){f=String(f);let d="";for(let y=0;yt,isEscaped:()=>e,isInRegexCharacterClass:()=>s}}();return this.parts.length?this.mapParts(e=>{const n=t.getState(),r=t.isEscaped();let o;if(["single","double","template"].includes(n))o=Fn(e,n,r);else if("regex"===n)o=On(e,r,t.isInRegexCharacterClass());else if(["line-comment","block-comment"].includes(n))o="";else if("boolean"==typeof e)o=String(e);else if("number"==typeof e)o=Number.isFinite(e)&&Object.is(e,-0)?"-0":String(e);else{const t=String(e).trim();o=!/^[+-]?0\d/.test(t)&&Sn.test(t)&&Number.isFinite(parseFloat(t))||"true"===t||"false"===t?t:JSON.stringify(String(e))}return t.consume(o),o},e=>t.consume(e)):t.consume(this.formula)},emptyValue:()=>"",calculate(){if(!this.parts.length&&!this.forceFunction)return this.formula;const t=this.calculateEvalString();try{return new Function("return "+t)()}catch(e){this.showError(t)}},clearWatchers(){this.watchers.forEach(t=>"function"==typeof t&&t()),this.watchers=[],this.relatedAttrs=[],this.related=[]},showError(t){console.group((0,bn.__)("JetFormBuilder: You have invalid calculated formula","jet-form-builder")),this.showErrorDetails(t),console.groupEnd()},showErrorDetails(t){if(console.error((0,bn.sprintf)((0,bn.__)("Initial: %s","jet-form-builder"),this.formula)),console.error((0,bn.sprintf)((0,bn.__)("Computed: %s","jet-form-builder"),t)),!this.input&&!this.root?.parent)return;if(this.input)return void console.error((0,bn.sprintf)((0,bn.__)("Field: %s","jet-form-builder"),this.input.path.join(".")));const e=this.root.parent.findIndex(this.root);console.error((0,bn.sprintf)((0,bn.__)("Scope: %s","jet-form-builder"),[...this.root.parent.path,-1===e?"":e].filter(Boolean).join(".")))}};const En=Cn,Rn=new Set(["a","abbr","b","blockquote","br","caption","code","col","colgroup","dd","del","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","ins","li","mark","ol","p","pre","q","s","small","span","strike","strong","sub","sup","table","tbody","td","tfoot","th","thead","tr","u","ul"]),Pn=new Set(["script","style","iframe","frame","frameset","object","embed","applet","template","noscript","svg","math","form","input","button","textarea","select","option","link","meta","base","title","head","audio","video","source","track","canvas","dialog","xmp","plaintext"]),xn=new Set(["href","src","alt","title","class","style","target","rel","width","height","colspan","rowspan","align","dir","lang"]),Tn=new Set(["href","src"]),Mn=new Set(["color","background-color","font-weight","font-style","font-size","font-family","text-align","text-decoration","text-indent","text-transform","line-height","letter-spacing","vertical-align","list-style-type","white-space","width","height","max-width","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","display","float","opacity","box-sizing","object-fit","word-break","overflow-wrap","list-style","min-width","min-height","max-height","background","border","border-top","border-right","border-bottom","border-left","border-color","border-style","border-width","border-radius"]),An=/^[a-z0-9#%.,\s+-]*(?:(?:rgb|rgba|hsl|hsla)\([0-9.,%\s/+-]*\)[a-z0-9#%.,\s+-]*)*$/i;function Bn(t){Array.from(t.childNodes).forEach(e=>{if(1!==e.nodeType)return void(3!==e.nodeType&&t.removeChild(e));const n=e.localName;if(Pn.has(n))t.removeChild(e);else if(Bn(e),Rn.has(n))Array.from(e.attributes).forEach(t=>{const n=t.name.toLowerCase();var r;if(!xn.has(n)||Tn.has(n)&&!function(t){const e=String(t).replace(/[\u0000- \u007f-\u009f]/g,"").match(/^([a-z][a-z0-9+.-]*):/i);return!e||["http","https","mailto","tel"].includes(e[1].toLowerCase())}(t.value))e.removeAttribute(t.name);else if("style"===n){const n=(r=t.value,String(r).split(";").map(t=>{const e=t.indexOf(":");if(e<1)return"";const n=t.slice(0,e).trim().toLowerCase(),r=t.slice(e+1).trim();return Mn.has(n)&&r&&An.test(r)?`${n}: ${r}`:""}).filter(Boolean).join("; "));n?e.setAttribute("style",n):e.removeAttribute("style")}}),e.hasAttribute("target")&&e.setAttribute("rel","noopener noreferrer");else{for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}})}const Dn=function(t){const e=String(null!=t?t:"");if(!/[<&]/.test(e))return e;const n=(new DOMParser).parseFromString(`${e}`,"text/html");return Bn(n.body),n.body.innerHTML},{applyFilters:Ln}=JetPlugins.hooks;function Vn(t){if(!t)return"";if("SELECT"===t.tagName)return Array.from(t.selectedOptions||[]).map(t=>String(t.label||t.textContent||t.value||"").trim()).filter(Boolean).join(", ");if(("checkbox"===t.type||"radio"===t.type)&&!t.checked)return"";if("checkbox"===t.type||"radio"===t.type){const e=t.closest("label");if(!e)return"";const n=e.querySelector("span");return String(n?.textContent||e.textContent||t.value||"").trim()}return""}function Jn(t){return t instanceof Ge?t.toString():t}function Hn(t,{withPrefix:e=!0,macroHost:n=!1,macroFormat:r="",...o}={}){En.call(this,t,o),e&&(this.regexp=/JFB_FIELD::(.+)/gi),this.macroHost=n||!1,this.macroFormat=r||"",this.relatedCallback=function(t){const e=jQuery(t.nodes[0]),n=!!this.macroHost&&jQuery(this.macroHost);let r=Ln("jet.fb.macro.field.value",!1,e,n,this.macroFormat);return r=wp?.hooks?.applyFilters?wp.hooks.applyFilters("jet.fb.macro.field.value",r,e,n,this.macroFormat):r,!1!==r?new Ge(r):"option-label"===this.macroFormat&&function(t){return Array.from(t.nodes||[]).map(Vn).filter(Boolean).join(", ")}(t)||t.value.current}.bind(this),this.onMissingPart=function(){}}Hn.prototype=Object.create(En.prototype),Hn.prototype.observeMacro=function(t){null===this.formula&&(this.formula=t);const[e,...n]=t.split("|"),r=e.match(/[\w\-:]+/g);if(!r)return!1;const[o,...i]=r;if(void 0===this.isFieldNodeExists(o))return!1;const s="this"!==o?this.root.getInput(o):this.input;if(!s&&!o.includes("::"))return!1;const a=Ue(n);if(o.includes("::"))return En.prototype.observeMacro.call(this,t);if(this.related.includes(s.name)||(this.related.push(s.name),this.watchers.push(s.watch(()=>this.setResult()))),!i?.length)return()=>{if("repeater"===s.inputType&&a?.length){const t=Jn(this.relatedCallback(s));return s.reQueryValue?.(),Bt(t,a,{rawRepeaterValue:s.value.current})}const t=this.relatedCallback(s);return t instanceof Ge&&!a?.length?t:Bt(Jn(t),a)};const[u]=i;if(!s.attrs.hasOwnProperty(u))return!1;const l=s.attrs[u];return this.relatedAttrs.includes(s.name+u)||(this.relatedAttrs.push(s.name+u),this.watchers.push(l.value.watch(()=>this.setResult()))),()=>Bt(l.value.current,a)},Hn.prototype.mapParts=function(t){return this.parts.length?this.parts.map(e=>{if("function"!=typeof e)return e;const n=e();return null==n||""===n?"":t(n)}).join(""):this.formula},Hn.prototype.calculateString=function(){return this.mapParts(t=>String(t))},Hn.prototype.calculateHtml=function(){return this.mapParts(t=>t instanceof Ge?t.toString():Dn(t))};const $n=Hn,{__:Qn,sprintf:qn}=wp.i18n,Yn=function(t,e){if(t.jfbObserved)return;const n=new $n(e);if(n.observe(t.textContent),!n.parts?.length)return console.group(Qn("JetFormBuilder: You have invalid html macro","jet-form-builder")),console.error(qn(Qn("Content: %s","jet-form-builder"),t.textContent)),console.groupEnd(),void n.clearWatchers();const r=document.createElement("span"),o=t.parentNode.insertBefore(r,t);n.setResult=()=>{o.innerHTML=n.calculateHtml()},n.setResult(),t.jfbObserved=!0},zn=function(t,e,n){var r;const o=null!==(r=t[e])&&void 0!==r?r:"";if("string"!=typeof o)return null;const i="placeholder"===e&&/^$/.test(o)?o.slice(4,-3):o,s=new $n(n);s.observe(i),s.setResult=()=>{t[e]=s.calculateString()},s.setResult()},Wn=function(t,e){t.__jfbMacroTemplate||(t.__jfbMacroTemplate=t.innerHTML);const n=new $n(e,{withPrefix:!1,macroHost:t,macroFormat:t.dataset.jfbMacroFormat||""});if(n.observe(`%${t.dataset.jfbMacro}%`),!n.parts?.length)return console.group((0,bn.__)("JetFormBuilder: You have invalid html macro","jet-form-builder")),console.error((0,bn.sprintf)((0,bn.__)("Content: %s","jet-form-builder"),t.dataset.jfbMacro)),console.groupEnd(),void n.clearWatchers();t.dataset.jfbObserved=1,n.setResult=()=>{let e=String(n.calculateHtml());const r=t.querySelector?.("textarea");r&&(e=e.replace(/\r\n|\r|\n/g,"
")),t.innerHTML=e},n.setResult()};function Kn(t){this.root=t,this.reportedFirst=!1,this.silence=!0}Kn.prototype={reset(t={}){var e;this.reportedFirst=!1,this.setSilence(null===(e=t?.silence)||void 0===e||e)},reportFirst(){this.reportedFirst=!0},setSilence(t){this.silence=!!t}};const Un=Kn,{doAction:Zn}=JetPlugins.hooks;function Gn(t=null){this.parent=t,this.dataInputs={},this.form=null,this.multistep=null,this.rootNode=null,this.isObserved=!1,this.context=this.parent?null:new Un(this)}Gn.prototype={parent:null,dataInputs:{},form:null,multistep:null,rootNode:null,isObserved:!1,value:null,observe(t=null){this.isObserved||(null!==t&&(this.rootNode=t),this.isObserved=!0,Zn("jet.fb.observe.before",this),this.initSubmitHandler(),this.initFields(),this.makeReactiveProxy(),this.initMacros(),this.initActionButtons(),this.initValue(),Zn("jet.fb.observe.after",this))},initFields(){for(const t of this.rootNode.querySelectorAll("[data-jfb-sync]"))this.pushInput(t)},initMacros(){for(const t of At(this.rootNode))Yn(t,this);const t=Tt(this.rootNode,"JFB_FIELD::"),{replaceAttrs:e=[]}=window.JetFormBuilderSettings;for(const n of t)for(const t of e)zn(n,t,this);const n=this.rootNode.querySelectorAll("[data-jfb-macro]:not([data-jfb-observed])");for(const t of n)Wn(t,this)},initSubmitHandler(){this.parent||(this.form=new xt(this))},initActionButtons(){if(!this.parent)for(const t of this.rootNode.querySelectorAll(".jet-form-builder__button-switch-state")){let e;try{e=JSON.parse(t.dataset.switchOn)}catch(t){continue}t.addEventListener("click",()=>{this.getState().value.current=e})}},async inputsAreValid(){const t=await st(It(this.getInputs()));return Boolean(t.length)?Promise.reject(t):Promise.resolve()},watch(t,e){const n=this.getInput(t);if(n)return n.watch(e);throw new Error(`dataInputs in Observable don't have ${t} field`)},observeInput(t,e=!1){const n=this.pushInput(t,e);n.makeReactive(),Zn("jet.fb.observe.input.manual",n)},makeReactiveProxy(){for(const t of this.getInputs())t.makeReactive()},pushInput(t,e=!1){var n;if(!this.parent&&t.parentElement.closest(".jet-form-builder-repeater"))return;const r=function(t,e){for(const n of(Nt.length||(Nt=St("jet.fb.inputs",[wt,ft,ht,mt])),[...Nt])){const r=new n;if(r.isSupported(t))return r.setRoot(e),r.setNode(t),g(r),jt("jet.fb.input.created",r),r}throw new Error("Something went wrong")}(t,this),o=null!==(n=this.dataInputs[r.getName()])&&void 0!==n&&n;return!1===o||e?(this.dataInputs[r.getName()]=r,r):(o.merge(r),o)},getInputs(){return Object.values(this.dataInputs)},getState(){return this.getInput("_jfb_current_render_states")},getInput(t){var e;if(this.dataInputs.hasOwnProperty(t))return this.dataInputs[t];const n=null!==(e=this.parent?.root)&&void 0!==e?e:null;return n&&n.dataInputs.hasOwnProperty(t)?n.dataInputs[t]:null},getSubmit(){return this.form?this.form:this.parent.root.form},getContext(){var t;return null!==(t=this.context)&&void 0!==t?t:this.parent.root.context},remove(){for(const t of this.getInputs())t.onRemove()},reQueryValues(){for(const t of this.getInputs())t.reQueryValue()},initValue(){this.value=new _({}),this.value.watch(()=>{const t=Object.entries(this.value.current);for(const[e,n]of t)this.getInput(e).revertValue(n)});for(const t of this.getInputs())t.watch(()=>{this.value.current[t.getName()]=t.getValue()});this.value.make()}};const Xn=Gn;var tr;window.JetFormBuilder=null!==(tr=window.JetFormBuilder)&&void 0!==tr?tr:{};const er=function(t){const e=t[0].querySelector("form.jet-form-builder");if(!e)return;const n=new Xn;window.JetFormBuilder[e.dataset.formId]=n,jQuery(document).trigger("jet-form-builder/init",[t,n]),n.observe(e),jQuery(document).trigger("jet-form-builder/after-init",[t,n])};var nr,rr,or,ir,sr;window.JetFormBuilderAbstract={...null!==(nr=window.JetFormBuilderAbstract)&&void 0!==nr?nr:{},Filter:Lt,CalculatedFormula:En,BaseInternalMacro:tn},window.JetFormBuilderFunctions={...null!==(rr=window.JetFormBuilderFunctions)&&void 0!==rr?rr:{},getFilters:Ue,applyFilters:Bt,toDate:qt,toDateTime:zt,toTime:Yt,getTimestamp:Wt},window.JetFormBuilderConst={...null!==(or=window.JetFormBuilderConst)&&void 0!==or?or:{},...on},window.JetFormBuilderAbstract={...null!==(ir=window.JetFormBuilderAbstract)&&void 0!==ir?ir:{},InputData:lt,BaseSignal:P,ReactiveVar:_,ReactiveHook:k,LoadingReactiveVar:F,Observable:Xn,ReportingInterface:Y,Restriction:U,RestrictionError:Q,BaseHtmlAttr:e,ReactiveSet:yt,RequiredRestriction:tt},window.JetFormBuilderFunctions={...null!==(sr=window.JetFormBuilderFunctions)&&void 0!==sr?sr:{},allRejected:f,getLanguage:function(){const t=window?.navigator?.languages?.length?window.navigator.languages[0]:window?.navigator?.language;return null!=t?t:"en-US"},toHTML:function(t){const e=document.createElement("template");return e.innerHTML=t.trim(),e.content},validateInputs:function(t,e=!1){return Promise.all(it(t,e).map(t=>new Promise(t)))},validateInputsAll:st,getParsedName:_t,isEmpty:y,getValidateCallbacks:it,getOffsetTop:v,focusOnInvalidInput:j,populateInputs:It,isVisible:b,queryByAttrValue:Tt,iterateComments:Mt,observeMacroAttr:zn,observeComment:Yn,iterateJfbComments:At,getScrollParent:S,isUA:function(t){return h?.[t]},resetRuntimeRegistries:function(){d=[],Nt=[],H=[],nt=[],ot=[]}},document.addEventListener("DOMContentLoaded",function(){for(const[t,e]of Object.entries(h))e&&document.body.classList.add(`jet--ua-${t}`)}),jQuery(()=>JetPlugins.init()),JetPlugins.bulkBlocksInit([{block:"jet-forms.form-block",callback:er,condition:()=>"loading"!==document.readyState}]),jQuery(window).on("elementor/frontend/init",function(){if(!window.elementorFrontend)return;const t={"jet-engine-booking-form.default":er,"jet-form-builder-form.default":er};jQuery.each(t,function(t,e){window.elementorFrontend.hooks.addAction("frontend/element_ready/"+t,e)})}),addEventListener("load",()=>{const t=Object.values(window.JetFormBuilder);for(const e of t)e instanceof Xn&&e.reQueryValues()})})();