(()=>{var e={584:function(e,t,o){var n,r;n=function(){var e=!1;function t(e){this.opts=function(){for(var e=1;e<arguments.length;e++)for(var t in arguments[e])arguments[e].hasOwnProperty(t)&&(arguments[0][t]=arguments[e][t]);return arguments[0]}({},{onClose:null,onOpen:null,beforeOpen:null,beforeClose:null,stickyFooter:!1,footer:!1,cssClass:[],closeLabel:"Close",closeMethods:["overlay","button","escape"]},e),this.init()}function o(){this.modalBoxFooter&&(this.modalBoxFooter.style.width=this.modalBox.clientWidth+"px",this.modalBoxFooter.style.left=this.modalBox.offsetLeft+"px")}return t.prototype.init=function(){if(!this.modal)return function(){this.modal=document.createElement("div"),this.modal.classList.add("tingle-modal"),0!==this.opts.closeMethods.length&&-1!==this.opts.closeMethods.indexOf("overlay")||this.modal.classList.add("tingle-modal--noOverlayClose"),this.modal.style.display="none",this.opts.cssClass.forEach((function(e){"string"==typeof e&&this.modal.classList.add(e)}),this),-1!==this.opts.closeMethods.indexOf("button")&&(this.modalCloseBtn=document.createElement("button"),this.modalCloseBtn.type="button",this.modalCloseBtn.classList.add("tingle-modal__close"),this.modalCloseBtnIcon=document.createElement("span"),this.modalCloseBtnIcon.classList.add("tingle-modal__closeIcon"),this.modalCloseBtnIcon.innerHTML='<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"><path d="M.3 9.7c.2.2.4.3.7.3.3 0 .5-.1.7-.3L5 6.4l3.3 3.3c.2.2.5.3.7.3.2 0 .5-.1.7-.3.4-.4.4-1 0-1.4L6.4 5l3.3-3.3c.4-.4.4-1 0-1.4-.4-.4-1-.4-1.4 0L5 3.6 1.7.3C1.3-.1.7-.1.3.3c-.4.4-.4 1 0 1.4L3.6 5 .3 8.3c-.4.4-.4 1 0 1.4z" fill="#000" fill-rule="nonzero"/></svg>',this.modalCloseBtnLabel=document.createElement("span"),this.modalCloseBtnLabel.classList.add("tingle-modal__closeLabel"),this.modalCloseBtnLabel.innerHTML=this.opts.closeLabel,this.modalCloseBtn.appendChild(this.modalCloseBtnIcon),this.modalCloseBtn.appendChild(this.modalCloseBtnLabel)),this.modalBox=document.createElement("div"),this.modalBox.classList.add("tingle-modal-box"),this.modalBoxContent=document.createElement("div"),this.modalBoxContent.classList.add("tingle-modal-box__content"),this.modalBox.appendChild(this.modalBoxContent),-1!==this.opts.closeMethods.indexOf("button")&&this.modal.appendChild(this.modalCloseBtn),this.modal.appendChild(this.modalBox)}.call(this),function(){this._events={clickCloseBtn:this.close.bind(this),clickOverlay:function(e){var t=this.modal.offsetWidth-this.modal.clientWidth,o=e.clientX>=this.modal.offsetWidth-15,n=this.modal.scrollHeight!==this.modal.offsetHeight;"MacIntel"===navigator.platform&&0==t&&o&&n||-1!==this.opts.closeMethods.indexOf("overlay")&&!function(e,t){for(;(e=e.parentElement)&&!e.classList.contains("tingle-modal"););return e}(e.target)&&e.clientX<this.modal.clientWidth&&this.close()}.bind(this),resize:this.checkOverflow.bind(this),keyboardNav:function(e){-1!==this.opts.closeMethods.indexOf("escape")&&27===e.which&&this.isOpen()&&this.close()}.bind(this)},-1!==this.opts.closeMethods.indexOf("button")&&this.modalCloseBtn.addEventListener("click",this._events.clickCloseBtn),this.modal.addEventListener("mousedown",this._events.clickOverlay),window.addEventListener("resize",this._events.resize),document.addEventListener("keydown",this._events.keyboardNav)}.call(this),document.body.appendChild(this.modal,document.body.firstChild),this.opts.footer&&this.addFooter(),this},t.prototype._busy=function(t){e=t},t.prototype._isBusy=function(){return e},t.prototype.destroy=function(){null!==this.modal&&(this.isOpen()&&this.close(!0),function(){-1!==this.opts.closeMethods.indexOf("button")&&this.modalCloseBtn.removeEventListener("click",this._events.clickCloseBtn),this.modal.removeEventListener("mousedown",this._events.clickOverlay),window.removeEventListener("resize",this._events.resize),document.removeEventListener("keydown",this._events.keyboardNav)}.call(this),this.modal.parentNode.removeChild(this.modal),this.modal=null)},t.prototype.isOpen=function(){return!!this.modal.classList.contains("tingle-modal--visible")},t.prototype.open=function(){if(!this._isBusy()){this._busy(!0);var e=this;return"function"==typeof e.opts.beforeOpen&&e.opts.beforeOpen(),this.modal.style.removeProperty?this.modal.style.removeProperty("display"):this.modal.style.removeAttribute("display"),document.getSelection().removeAllRanges(),this._scrollPosition=window.pageYOffset,document.body.classList.add("tingle-enabled"),document.body.style.top=-this._scrollPosition+"px",this.setStickyFooter(this.opts.stickyFooter),this.modal.classList.add("tingle-modal--visible"),"function"==typeof e.opts.onOpen&&e.opts.onOpen.call(e),e._busy(!1),this.checkOverflow(),this}},t.prototype.close=function(e){if(!this._isBusy()){if(this._busy(!0),"function"==typeof this.opts.beforeClose&&!this.opts.beforeClose.call(this))return void this._busy(!1);document.body.classList.remove("tingle-enabled"),document.body.style.top=null,window.scrollTo({top:this._scrollPosition,behavior:"instant"}),this.modal.classList.remove("tingle-modal--visible");var t=this;t.modal.style.display="none","function"==typeof t.opts.onClose&&t.opts.onClose.call(this),t._busy(!1)}},t.prototype.setContent=function(e){return"string"==typeof e?this.modalBoxContent.innerHTML=e:(this.modalBoxContent.innerHTML="",this.modalBoxContent.appendChild(e)),this.isOpen()&&this.checkOverflow(),this},t.prototype.getContent=function(){return this.modalBoxContent},t.prototype.addFooter=function(){return function(){this.modalBoxFooter=document.createElement("div"),this.modalBoxFooter.classList.add("tingle-modal-box__footer"),this.modalBox.appendChild(this.modalBoxFooter)}.call(this),this},t.prototype.setFooterContent=function(e){return this.modalBoxFooter.innerHTML=e,this},t.prototype.getFooterContent=function(){return this.modalBoxFooter},t.prototype.setStickyFooter=function(e){return this.isOverflow()||(e=!1),e?this.modalBox.contains(this.modalBoxFooter)&&(this.modalBox.removeChild(this.modalBoxFooter),this.modal.appendChild(this.modalBoxFooter),this.modalBoxFooter.classList.add("tingle-modal-box__footer--sticky"),o.call(this),this.modalBoxContent.style["padding-bottom"]=this.modalBoxFooter.clientHeight+20+"px"):this.modalBoxFooter&&(this.modalBox.contains(this.modalBoxFooter)||(this.modal.removeChild(this.modalBoxFooter),this.modalBox.appendChild(this.modalBoxFooter),this.modalBoxFooter.style.width="auto",this.modalBoxFooter.style.left="",this.modalBoxContent.style["padding-bottom"]="",this.modalBoxFooter.classList.remove("tingle-modal-box__footer--sticky"))),this},t.prototype.addFooterBtn=function(e,t,o){var n=document.createElement("button");return n.innerHTML=e,n.addEventListener("click",o),"string"==typeof t&&t.length&&t.split(" ").forEach((function(e){n.classList.add(e)})),this.modalBoxFooter.appendChild(n),n},t.prototype.resize=function(){console.warn("Resize is deprecated and will be removed in version 1.0")},t.prototype.isOverflow=function(){return window.innerHeight<=this.modalBox.clientHeight},t.prototype.checkOverflow=function(){this.modal.classList.contains("tingle-modal--visible")&&(this.isOverflow()?this.modal.classList.add("tingle-modal--overflow"):this.modal.classList.remove("tingle-modal--overflow"),!this.isOverflow()&&this.opts.stickyFooter?this.setStickyFooter(!1):this.isOverflow()&&this.opts.stickyFooter&&(o.call(this),this.setStickyFooter(!0)))},{modal:t}},void 0===(r=n.call(t,o,t,e))||(e.exports=r)}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,o),i.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],t=e.join(","),n="undefined"==typeof Element?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,r=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return isNaN(t)?function(e){return"true"===e.contentEditable}(e)?0:"AUDIO"!==e.nodeName&&"VIDEO"!==e.nodeName&&"DETAILS"!==e.nodeName||null!==e.getAttribute("tabindex")?e.tabIndex:0:t},i=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},a=function(e){return"INPUT"===e.tagName},l=function(e,t){return!(t.disabled||function(e){return a(e)&&"hidden"===e.type}(t)||function(e,t){if("hidden"===getComputedStyle(e).visibility)return!0;var o=n.call(e,"details>summary:first-of-type")?e.parentElement:e;if(n.call(o,"details:not([open]) *"))return!0;if(t&&"full"!==t){if("non-zero-area"===t){var r=e.getBoundingClientRect(),i=r.width,a=r.height;return 0===i&&0===a}}else for(;e;){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(t,e.displayCheck)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(a(e)||"SELECT"===e.tagName||"TEXTAREA"===e.tagName||"BUTTON"===e.tagName)for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var o=0;o<t.children.length;o++){var n=t.children.item(o);if("LEGEND"===n.tagName)return!n.contains(e)}return!0}t=t.parentElement}return!1}(t))},s=function(e,t){return!(!l(e,t)||function(e){return function(e){return a(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,o=e.form||e.ownerDocument,n=function(e){return o.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=n(window.CSS.escape(e.name));else try{t=n(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var r=function(e,t){for(var o=0;o<e.length;o++)if(e[o].checked&&e[o].form===t)return e[o]}(t,e.form);return!r||r===e}(e)}(t)||r(t)<0)},d=e.concat("iframe").join(","),c=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==n.call(e,d)&&l(t,e)};function f(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function u(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var m,p=(m=[],{activateTrap:function(e){if(m.length>0){var t=m[m.length-1];t!==e&&t.pause()}var o=m.indexOf(e);-1===o||m.splice(o,1),m.push(e)},deactivateTrap:function(e){var t=m.indexOf(e);-1!==t&&m.splice(t,1),m.length>0&&m[m.length-1].unpause()}}),g=function(e){return setTimeout(e,0)},h=function(e,t){var o=-1;return e.every((function(e,n){return!t(e)||(o=n,!1)})),o},v=function(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];return"function"==typeof e?e.apply(void 0,o):e},_=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},b=function(e,o){var a,l=(null==o?void 0:o.document)||document,d=function(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?f(Object(o),!0).forEach((function(t){u(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):f(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0},o),m={containers:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0},b=function(e,t,o){return e&&void 0!==e[t]?e[t]:d[o||t]},y=function(e){return!(!e||!m.containers.some((function(t){return t.contains(e)})))},w=function(e){var t=d[e];if("function"==typeof t){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];t=t.apply(void 0,n)}if(!t){if(void 0===t||!1===t)return t;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var i=t;if("string"==typeof t&&!(i=l.querySelector(t)))throw new Error("`".concat(e,"` as selector refers to no known node"));return i},C=function(){var e=w("initialFocus");if(!1===e)return!1;if(void 0===e)if(y(l.activeElement))e=l.activeElement;else{var t=m.tabbableGroups[0];e=t&&t.firstTabbableNode||w("fallbackFocus")}if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},F=function(){if(m.tabbableGroups=m.containers.map((function(e){var o,a,l,d,c,f,u,m=(a=[],l=[],(d=e,c=(o=o||{}).includeContainer,f=s.bind(null,o),u=Array.prototype.slice.apply(d.querySelectorAll(t)),c&&n.call(d,t)&&u.unshift(d),u.filter(f)).forEach((function(e,t){var o=r(e);0===o?a.push(e):l.push({documentOrder:t,tabIndex:o,node:e})})),l.sort(i).map((function(e){return e.node})).concat(a));if(m.length>0)return{container:e,firstTabbableNode:m[0],lastTabbableNode:m[m.length-1]}})).filter((function(e){return!!e})),m.tabbableGroups.length<=0&&!w("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},I=function e(t){!1!==t&&t!==l.activeElement&&(t&&t.focus?(t.focus({preventScroll:!!d.preventScroll}),m.mostRecentlyFocusedNode=t,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(t)&&t.select()):e(C()))},x=function(e){var t=w("setReturnFocus",e);return t||!1!==t&&e},E=function(e){var t=_(e);y(t)||(v(d.clickOutsideDeactivates,e)?a.deactivate({returnFocus:d.returnFocusOnDeactivate&&!c(t)}):v(d.allowOutsideClick,e)||e.preventDefault())},k=function(e){var t=_(e),o=y(t);o||t instanceof Document?o&&(m.mostRecentlyFocusedNode=t):(e.stopImmediatePropagation(),I(m.mostRecentlyFocusedNode||C()))},B=function(e){if(function(e){return"Escape"===e.key||"Esc"===e.key||27===e.keyCode}(e)&&!1!==v(d.escapeDeactivates,e))return e.preventDefault(),void a.deactivate();(function(e){return"Tab"===e.key||9===e.keyCode})(e)&&function(e){var t=_(e);F();var o=null;if(m.tabbableGroups.length>0){var n=h(m.tabbableGroups,(function(e){return e.container.contains(t)}));if(n<0)o=e.shiftKey?m.tabbableGroups[m.tabbableGroups.length-1].lastTabbableNode:m.tabbableGroups[0].firstTabbableNode;else if(e.shiftKey){var r=h(m.tabbableGroups,(function(e){var o=e.firstTabbableNode;return t===o}));if(r<0&&m.tabbableGroups[n].container===t&&(r=n),r>=0){var i=0===r?m.tabbableGroups.length-1:r-1;o=m.tabbableGroups[i].lastTabbableNode}}else{var a=h(m.tabbableGroups,(function(e){var o=e.lastTabbableNode;return t===o}));if(a<0&&m.tabbableGroups[n].container===t&&(a=n),a>=0){var l=a===m.tabbableGroups.length-1?0:a+1;o=m.tabbableGroups[l].firstTabbableNode}}}else o=w("fallbackFocus");o&&(e.preventDefault(),I(o))}(e)},M=function(e){if(!v(d.clickOutsideDeactivates,e)){var t=_(e);y(t)||v(d.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())}},O=function(){if(m.active)return p.activateTrap(a),m.delayInitialFocusTimer=d.delayInitialFocus?g((function(){I(C())})):I(C()),l.addEventListener("focusin",k,!0),l.addEventListener("mousedown",E,{capture:!0,passive:!1}),l.addEventListener("touchstart",E,{capture:!0,passive:!1}),l.addEventListener("click",M,{capture:!0,passive:!1}),l.addEventListener("keydown",B,{capture:!0,passive:!1}),a},T=function(){if(m.active)return l.removeEventListener("focusin",k,!0),l.removeEventListener("mousedown",E,!0),l.removeEventListener("touchstart",E,!0),l.removeEventListener("click",M,!0),l.removeEventListener("keydown",B,!0),a};return(a={activate:function(e){if(m.active)return this;var t=b(e,"onActivate"),o=b(e,"onPostActivate"),n=b(e,"checkCanFocusTrap");n||F(),m.active=!0,m.paused=!1,m.nodeFocusedBeforeActivation=l.activeElement,t&&t();var r=function(){n&&F(),O(),o&&o()};return n?(n(m.containers.concat()).then(r,r),this):(r(),this)},deactivate:function(e){if(!m.active)return this;clearTimeout(m.delayInitialFocusTimer),m.delayInitialFocusTimer=void 0,T(),m.active=!1,m.paused=!1,p.deactivateTrap(a);var t=b(e,"onDeactivate"),o=b(e,"onPostDeactivate"),n=b(e,"checkCanReturnFocus");t&&t();var r=b(e,"returnFocus","returnFocusOnDeactivate"),i=function(){g((function(){r&&I(x(m.nodeFocusedBeforeActivation)),o&&o()}))};return r&&n?(n(x(m.nodeFocusedBeforeActivation)).then(i,i),this):(i(),this)},pause:function(){return m.paused||!m.active||(m.paused=!0,T()),this},unpause:function(){return m.paused&&m.active?(m.paused=!1,F(),O(),this):this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return m.containers=t.map((function(e){return"string"==typeof e?l.querySelector(e):e})),m.active&&F(),this}}).updateContainerElements(e),a},y=o(584),w=o.n(y),C=window.ko;!function(e){window.GPNestedForms=function(n){var r=this;for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i]);r.destroy=function(){var t;null===(t=r.modal)||void 0===t||t.destroy(),e(document).off(".".concat(r.getNamespace())),window.gform.removeHook("action","gform_list_post_item_add",10,r.getNamespace()),window.gform.removeHook("action","gform_list_post_item_delete",10,r.getNamespace()),gform.removeFilter("gform_calculation_formula",10,"gpnf_".concat(r.formId,"_").concat(r.fieldId))},r.init=function(){if(r.id=r.getDebugId(),r.$fieldContainer=e("#field_".concat(r.formId,"_").concat(r.fieldId)),r.$parentFormContainer=r.$fieldContainer.parents("form").first(),r.$modalSource=e(".gpnf-nested-form-".concat(r.formId,"-").concat(r.fieldId)),r.isActive=!1,r.initialized=!1,r.formTheme=r.$parentFormContainer.closest(".gform_wrapper").data("form-theme"),void 0!==window["GPNestedForms_".concat(r.formId,"_").concat(r.fieldId)]){var t=window["GPNestedForms_".concat(r.formId,"_").concat(r.fieldId)];r.entries=t.entries,t.destroy()}r.initKnockout(),r.initCalculations(),window["GPNestedForms_".concat(r.formId,"_").concat(r.fieldId)]=r,r.finalizeInit()},r.inHiddenPage=function(){var t=e("#gform_source_page_number_".concat(r.formId)).val(),o=r.$parentFormContainer.find("#gform_page_".concat(r.formId,"_").concat(t));return!(!o.length||o.find(r.$fieldContainer).length)},r.finalizeInit=function(){if(r.inHiddenPage())console.debug("Nested form is not visible. Skipping loading.");else{var t=r.initSession();e(document).on("click.".concat(r.getNamespace()),"#field_".concat(r.formId,"_").concat(r.fieldId," .gpnf-add-entry"),r.openAddModal),r.initModal(),r.addColorStyles(),gform.applyFilters("gpnf_fetch_form_html_on_load",!0,r.formId,r.fieldId,r)&&t.always(r.getFormHtml),r.initialized=!0}},r.initSession=function(){return void 0===window["gpnfSessionPromise_"+r.formId]&&(r.sessionData.gpnf_context=r.ajaxContext,window["gpnfSessionPromise_"+r.formId]=e.post(r.ajaxUrl,r.sessionData,(function(e){gform.doAction("gpnf_session_initialized",r)}))),window["gpnfSessionPromise_"+r.formId]},r.initModal=function(){r.modalArgs=gform.applyFilters("gpnf_modal_args",{labels:r.modalLabels,closeLabel:r.modalLabels.closeScreenReaderLabel,colors:r.modalColors,footer:!0,stickyFooter:r.modalStickyFooter,closeMethods:["button"],cssClass:[r.modalClass,"gpnf-modal","gform-theme--api","gpnf-modal-".concat(r.formId,"-").concat(r.fieldId)],onOpen:function(){if(r.isActive=!0,!r.trap&&r.enableFocusTrap&&(r.trap=b(r.modal.modalBox.parentElement,{escapeDeactivates:!1,allowOutsideClick:!0})),r.trap)try{r.trap.activate()}catch(e){console.error("Failed to activate focus trap: ",e)}gform.doAction("gpnf_modal_opened",r)},onClose:function(){r.clearModalContent(),r.setParentFocus(),r.trap&&r.trap.deactivate(),r.isActive=!1,gform.doAction("gpnf_modal_closed",r)},beforeOpen:function(){r.$modal.attr("role","dialog").attr("aria-label",r.getModalTitle()).attr("aria-modal","true"),r.$modal.find(".tingle-modal__close").attr("aria-label",r.modalLabels.closeScreenReaderLabel)},beforeClose:function(){return!0}},r.formId,r.fieldId,r),r.modal?r.$modal=e(r.modal.modal):(r.modal=new(w().modal)(r.modalArgs),r.$modal=e(r.modal.modal),r.bindResizeEvents(),e(document).on("gpnf_post_render.".concat(r.getNamespace()),(function(t,o,n){var i=e("#gform_wrapper_"+o);o==r.nestedFormId&&i.length>0&&r.isActive&&(r.scrollToTop(),n&&(r.initFormScripts(n),setTimeout((function(){var e=r.$modal.find("input, select, textarea").filter(":visible").first();if(e.hasClass("datepicker")){var t=e.prop("disabled");null==e||e.datepicker("disable"),t||e.prop("disabled",!1)}e.focus(),e.hasClass("datepicker")&&(null==e||e.datepicker("enable"))})),r.addModalButtons(),r.observeDefaultButtons(),r.triggerButtonAnimationOnSubmit()))})))},r.initKnockout=function(){var e=C.dataFor(r.$fieldContainer[0]);if(e)return"function"==typeof e.entries&&e.entries(r.prepareEntriesForKnockout(r.entries)),void(r.viewModel=e);r.$fieldContainer.find(".gpnf-row-actions button:not(.gpnf-button-disabled)").attr("disabled",!1),r.setViewModel(new t(r.prepareEntriesForKnockout(r.entries),r)),r.addRowIdComputedToEntries(r.viewModel.entries),0!==r.$fieldContainer.length?C.applyBindings(r.viewModel,r.$fieldContainer[0]):console.warn("Could not find the Nested Form field container to initialize.")},r.setViewModel=function(e){r.viewModel=gform.applyFilters("gpnf_view_model",e,r)},r.initCalculations=function(){gform.addFilter("gform_calculation_formula",r.parseCalcs,10,"gpnf_".concat(r.formId,"_").concat(r.fieldId)),r.runCalc(r.formId)},r.openAddModal=function(t){t.preventDefault(),t.target.disabled=!0;var n=new o(t.target,r.spinnerUrl,"");r.getFormHtml().done((function(o){r.setModalContent(o.formHtml),r.openModal(e(t.target))})).always((function(){n.destroy(),t.target.disabled=!1}))},r.triggerGformPostRender=function(e,t){["gform/postRender","gform/post_render"].forEach((function(o){var n;null===(n=null===gform||void 0===gform?void 0:gform.utils)||void 0===n||n.trigger({event:o,native:!1,data:{formId:e,currentPage:t}})}))},r.openModal=function(t){window.gform.applyFilters("gpnf_should_open_modal",!0,r.modal,r.formId,r.fieldId,r)&&(r.saveParentFocus(t),r.modal.open(),(r.isGF25||parseInt(jQuery.fn.jquery)<3)&&e(document).trigger("gpnf_post_render",[r.nestedFormId,"1"]),r.initIframe(r.nestedFormId),r.triggerGformPostRender(r.nestedFormId,e("#gform_source_page_number_".concat(r.nestedFormId)).val()))},r.saveParentFocus=function(e){r.parentFocus=e},r.setParentFocus=function(){var e;switch(typeof r.parentFocus){case"undefined":return;case"function":e=r.parentFocus.apply();break;default:e=r.parentFocus}e.focus()},r.scrollToTop=function(){var t=e(r.modal.modal)[0];t.scroll?t.scroll({top:0,left:0,behavior:"smooth"}):t.scrollTop=0},r.observeDefaultButtons=function(){var t=r.getDefaultButtonObserver();r.getDefaultButtons().each((function(){t.observe(e(this)[0],{attributes:!0,childList:!0})}))},r.getDefaultButtonObserver=function(){return new MutationObserver((function(e){e.forEach((function(e){"attributes"!=e.type||"style"!=e.attributeName&&"disabled"!=e.attributeName||r.addModalButtons()}))}))},r.triggerButtonAnimationOnSubmit=function(){r.$modal.on("keypress",(function(e){r.$modal.data("gpnfEnterPressed",13===e.which)})),r.$modal.find("form").on("submit",(function(t){t.stopImmediatePropagation(),r.$modal.data("gpnfEnterPressed")&&(r.$modal.data("gpnfEnterPressed",!1),e(r.modal.modalBoxFooter).find(".gpnf-btn-submit, .gpnf-btn-next").addClass("gpnf-spinner"))}))},r.setModalContent=function(t,o){e(document).off("gform_post_render.gpnf"),r.setMode(void 0===o?"add":"edit"),e(r.modal.modalBoxContent).html(void 0!==t?t:r.formHtml).prepend('<div class="gpnf-modal-header">'.concat(r.getModalTitle(),"</div>")),r.$modal.find('input[name="gpnf_nested_form_field_id"]').val(r.fieldId),r.addModalButtons(),r.stashFormData();var n=r.getDefaultButtonObserver();r.getDefaultButtons().each((function(){n.observe(e(this)[0],{attributes:!0,childList:!0})}))},r.clearModalContent=function(){e(r.modal.modalBoxContent).html("")},r.setMode=function(e){r.mode=e},r.getMode=function(){return r.mode?r.mode:"add"},r.getModalTitle=function(){return"add"===r.getMode()?r.modalArgs.labels.title:r.modalArgs.labels.editTitle},r.hasPendingUploads=function(){var t=!1;return!(!gfMultiFileUploader||!gfMultiFileUploader.uploaders)&&(e.each(gfMultiFileUploader.uploaders,(function(e,o){if(o.total.queued>0)return t=!0,!1})),t)},r.addModalButtons=function(){r.modal.modalBoxFooter.innerHTML="";var t=window.gform.applyFilters("gpnf_modal_button_css_classes","tingle-btn tingle-btn--default gpnf-btn-cancel","cancel",r.formId,r.fieldId,r);r.modal.addFooterBtn(r.modalArgs.labels.cancel,t,(function(){r.handleCancelClick(e(this))})),r.getDefaultButtons().each((function(){var t=e(this),o=null,n="function"==typeof window.jQuery.fn.wc_gravity_form;if("none"!==t[0].style.display||n&&""===t[0].style.display){var i="submit"===t.attr("type")||"image"===t.attr("type")?r.getSubmitButtonLabel():t.val(),a=["tingle-btn","tingle-btn--primary"],l=t.is(":disabled"),s=["gform_next_page_errors_button","gform_last_page_button"],d=(s=window.gform.applyFilters("gpnf_modal_button_passthrough_classes",s,r.formId,r.fieldId,r)).find((function(e){return t.hasClass(e)}));d?a.push(d):t.hasClass("gform_previous_button")?(a.push("gpnf-btn-previous"),o="previous"):t.hasClass("gform_next_button")?(o="next",a.push("gpnf-btn-next")):(o="submit",a.push("gpnf-btn-submit")),a=window.gform.applyFilters("gpnf_modal_button_css_classes",a.join(" "),o,r.formId,r.fieldId,r);var c=r.modal.addFooterBtn(i,a,(function(o){var n,i;if(r.hasPendingUploads()){var a="undefined"!=typeof gform_gravityforms?gform_gravityforms.strings:{};alert(a.currently_uploading)}else{e(o.target).addClass("gpnf-spinner");var l=null===(i=null===(n=null===window||void 0===window?void 0:window.gform)||void 0===n?void 0:n.submission)||void 0===i?void 0:i.handleButtonClick;l?(o.preventDefault(),l(t[0])):t.click()}}));l&&e(c).prop("disabled",!0)}}));var o=window.gform.applyFilters("gpnf_modal_button_css_classes","tingle-btn tingle-btn--default gpnf-btn-cancel-mobile","cancel-mobile",r.formId,r.fieldId,r);if(r.modal.addFooterBtn(r.modalArgs.labels.cancel,o,(function(){r.handleCancelClick(e(this))})),"edit"==r.mode&&e(r.modal.modalBoxContent).find(".gform_wrapper").length>0){var n=window.gform.applyFilters("gpnf_modal_button_css_classes","tingle-btn tingle-btn--danger tingle-btn--pull-left gpnf-btn-delete","delete",r.formId,r.fieldId,r);r.modal.addFooterBtn(r.modalArgs.labels.delete,n,(function(){var t=e(this),o=!1!==r.modalArgs.labels.confirmAction&&""!==r.modalArgs.labels.confirmAction;!t.data("isConfirming")&&o?(t.data("isConfirming",!0).text(r.modalArgs.labels.confirmAction),setTimeout((function(){t.data("isConfirming",!1).text(r.modalArgs.labels.delete)}),3e3)):(r.getEntryRow(r.getCurrentEntryId()).find(".delete-button").click(),r.modal.close())}))}},r.getSubmitButtonLabel=function(){var e=r.getMode();return"add"===e&&r.modalArgs.labels.submit?r.modalArgs.labels.submit:"edit"===e&&r.modalArgs.labels.editSubmit?r.modalArgs.labels.editSubmit:r.getModalTitle()},r.getThemeColor=function(e,t){var o=r.$parentFormContainer.closest(".gform-theme--framework, .gform-theme--api")[0],n="";return o&&(n=window.getComputedStyle(o).getPropertyValue(e).trim()),!n&&r.modal&&r.modal.modal&&(n=window.getComputedStyle(r.modal.modal).getPropertyValue(e).trim()),n||t},r.getModalColors=function(){return{primary:r.modalHeaderColor||r.modalArgs.colors.primary||r.getThemeColor("--gf-color-primary"),primaryContrast:r.getThemeColor("--gf-ctrl-btn-color-primary",r.getThemeColor("--gf-color-primary-contrast")),secondary:r.modalArgs.colors.secondary,primaryDarker:r.getThemeColor("--gf-color-primary-darker"),danger:r.modalArgs.colors.danger||r.getThemeColor("--gf-color-danger"),dangerContrast:r.getThemeColor("--gf-color-danger-contrast")}},r.addColorStyles=function(){var t=r.getModalColors();r.$style&&"function"==typeof r.$style.remove&&r.$style.remove(),r.$style='<style type="text/css">\n\t\t\t\t\t.gpnf-modal-'.concat(r.formId,"-").concat(r.fieldId," {\n\t\t\t\t\t\t--gpnf-modal-color-primary: ").concat(t.primary,";\n\t\t\t\t\t\t--gpnf-modal-color-primary-contrast: ").concat(t.primaryContrast,";\n\t\t\t\t\t\t").concat(t.secondary?"--gpnf-modal-color-secondary: ".concat(t.secondary,";"):"","\n\t\t\t\t\t\t--gpnf-modal-color-primary-darker: ").concat(t.primaryDarker,";\n\t\t\t\t\t\t--gpnf-modal-color-danger: ").concat(t.danger,";\n\t\t\t\t\t\t--gpnf-modal-color-danger-contrast: ").concat(t.dangerContrast,";\n\t\t\t\t\t}\n\t\t\t\t</style>"),e("head").append(r.$style)},r.getDefaultButtons=function(){return e("#gform_page_".concat(r.nestedFormId,"_").concat(r.getCurrentPage()," .gform_page_footer, #gform_").concat(r.nestedFormId," .gform_footer, #gform_").concat(r.nestedFormId," .gfield--type-submit")).first().find('input[type="button"], input[type="submit"], input[type="image"], button')},r.handleCancelClick=function(e){var t=window.gform.applyFilters("gpnf_disable_new_cancel_confirmation",!1===r.modalArgs.labels.confirmAction||""===r.modalArgs.labels.confirmAction);e.data("isConfirming")?r.modal.close():r.hasChanges()&&!t?(e.data("isConfirming",!0).removeClass("tingle-btn--default").addClass("tingle-btn--danger").text(r.modalArgs.labels.confirmAction),setTimeout((function(){e.data("isConfirming",!1).removeClass("tingle-btn--danger").addClass("tingle-btn--default").text(r.modalArgs.labels.cancel)}),3e3)):r.modal.close()},r.setMode=function(e){r.mode=e},r.getMode=function(){return r.mode?r.mode:"add"},r.stashFormData=function(){r.formData=r.$modal.find("form").serialize()},r.hasChanges=function(){return r.$modal.find("form").serialize()!==r.formData},r.bindResizeEvents=function(){var t=function(){requestAnimationFrame((function(){r.modal.checkOverflow()}))},o=function(e){r.nestedFormId==e&&t()};e(document).on("gpnf_post_render.".concat(r.getNamespace()),(function(){setTimeout((function(){t()}),0)})),e(document).on("gform_post_conditional_logic.".concat(r.getNamespace()),(function(e,t){o(t)})),e(document).on("gppa_updated_batch_fields.".concat(r.getNamespace()),(function(e,t){o(t)})),e(document).on("gppa_merge_tag_values_replaced.".concat(r.getNamespace()),(function(e,t){o(t)})),gform.addFilter("gform_file_upload_markup",(function(e,o,n,r,i,a){return t(),e})),gform.addAction("gform_list_post_item_add",r.modal.checkOverflow.bind(r.modal),10,r.getNamespace()),gform.addAction("gform_list_post_item_delete",r.modal.checkOverflow.bind(r.modal),10,r.getNamespace())},r.isBound=function(e){return!!C.dataFor(e)},r.prepareEntriesForKnockout=function(e){for(var t=0;t<e.length;t++)e[t]=r.prepareEntryForKnockout(e[t]);return e},r.addRowIdComputedToEntries=function(e){for(var t=e(),o=0;o<t.length;o++)t.splice(o,1,r.addRowIdComputedToEntry(t[o]));return e(t),e},r.prepareEntryForKnockout=function(t){var o=e.extend({},t);for(var n in o)if(t.hasOwnProperty(n)){var i=t[n];!1===i.label&&(i.label=""),t["f"+n]=i}return r.addRowIdComputedToEntry(t)},r.addRowIdComputedToEntry=function(t){var o=C.computed((function(){var o=e.map(r.viewModel?r.viewModel.entries():r.entries,(function(e){return parseInt(e.id)})),n=o.indexOf(parseInt(t.id))+1;return window.gform.applyFilters("gpnf_row_id_value",n,t,r)}),r.viewModel),n={label:o,value:o};return t.row_id=n,t.frow_id=n,t},r.refreshMarkup=function(){return e.post(r.ajaxUrl,{action:"gpnf_refresh_markup",nonce:GPNFData.nonces.refreshMarkup,gpnf_parent_form_id:r.formId,gpnf_nested_form_field_id:r.fieldId,gpnf_context:r.ajaxContext,form_theme:r.formTheme},(function(e){r.formHtml=e.formHtml}))},r.editEntry=function(t,n){var i=new o(n,r.spinnerUrl,"");n.css({visibility:"hidden"}),e.post(r.ajaxUrl,{action:"gpnf_edit_entry",nonce:GPNFData.nonces.editEntry,gpnf_entry_id:t,gpnf_parent_form_id:r.formId,gpnf_nested_form_field_id:r.fieldId,gpnf_context:r.ajaxContext,form_theme:r.formTheme},(function(e){i.destroy(),n.css({visibility:"visible"}),r.setModalContent(e.formHtml,"edit"),r.openModal((function(){return r.$parentFormContainer.find('[data-entryid="'+t+'"]').find(".edit").find("a, button")}))}))},r.deleteEntry=function(t,n,i){if(!1!==window.gform.applyFilters("gpnf_should_delete",!0,t,n,r)){i=e.extend({},{showSpinner:!0},i);var a=null;i.showSpinner&&(a=new o(n,r.spinnerUrl,"")),n.css({visibility:"hidden"}),e.post(r.ajaxUrl,{action:"gpnf_delete_entry",nonce:GPNFData.nonces.deleteEntry,gpnf_entry_id:t.id,gpnf_nested_form_field_id:r.fieldId,gpnf_context:r.ajaxContext},(function(e){a&&a.destroy(),n.css({visibility:"visible"}),e?e.success?(r.viewModel.entriesRaw.remove((function(e){return e.id===t.id||e===t})),window.gform.applyFilters("gpnf_fetch_form_html_after_delete",!0,r.formId,r.fieldId,r)&&r.refreshMarkup()):console.log("Error:"+e.data):console.log("Error: no response.")}))}},r.duplicateEntry=function(t,n){var i=new o(n,r.spinnerUrl,"");n.css({visibility:"hidden"}),e.post(r.ajaxUrl,{action:"gpnf_duplicate_entry",nonce:GPNFData.nonces.duplicateEntry,gpnf_entry_id:t,gpnf_parent_form_id:r.formId,gpnf_nested_form_field_id:r.fieldId,gpnf_context:r.ajaxContext},(function(e){i.destroy(),n.css({visibility:"visible"}),e.success&&GPNestedForms.loadEntry(e.data),gform.doAction("gpnf_post_duplicate_entry",e.data.entry,e)}))},r.getFormHtml=function(){return r.formHtml?e.when(r.formHtml):r.refreshMarkup()},r.initFormScripts=function(t){window.gform.doAction("gpnf_init_nested_form",r.nestedFormId,r),e(document).trigger("gform_post_render",[r.nestedFormId,t]),window.gformInitDatepicker&&(r.trap&&gform.addFilter("gform_datepicker_options_pre_init",(function(e,t){if(t!=r.nestedFormId)return e;var o=e.beforeShow;e.beforeShow=function(e,t){o(e,t),r.trap.deactivate({returnFocus:!1})};var n=e.onClose;return e.onClose=function(e,t){n(e,t),r.trap.activate()},e})),r.$modal.find(".datepicker").each((function(){e(this).removeClass("hasDatepicker"),gformInitSingleDatepicker(e(this))}))),r.handleParentMergeTag(),gform.addAction("gform_post_conditional_logic_field_action",(function(e,t,o,n,i){if(r.nestedFormId==e){var a=gf_get_input_id_by_html_id(o);r.handleParentMergeTag([a])}}))},r.runCalc=function(){e(document).trigger("gform_post_conditional_logic",[r.formId,[],!1])},r.isProductCalcTarget=function(e){return!!Array.isArray(r.productFieldIds)&&r.productFieldIds.map(String).indexOf(String(e))>-1},r.getProductCalcValue=function(e,t){if(void 0===e[t])return 0;var o=e[t].value,n=o,i=1,a=r.productQuantityFieldMap&&r.productQuantityFieldMap[t];return o&&"object"==typeof o?(n=o["".concat(t,".2")],void 0!==o["".concat(t,".3")]&&(i=o["".concat(t,".3")]?gformToNumber(o["".concat(t,".3")]):0)):"string"==typeof o&&o.indexOf("|")>-1&&(n=o.split("|").pop()),void 0!==a&&void 0!==e[a]&&(i=e[a].value?gformToNumber(e[a].value):0),n||0===n||"0"===n?gformToNumber(n)*parseFloat(i):0},r.parseCalcs=function(t,o,n,i){return n!=r.formId||(a="function"!=typeof GFMergeTag.parseMergeTags?getMatchGroups(t,/{[^{]*?:([0-9]+):(sum|total|count|set)=?([0-9]*)}/i):GFMergeTag.parseMergeTags(t,/{[^{]*?:([0-9]+):(sum|total|count|set)=?([0-9]*)}/i),e.each(a,(function(e,n){var i=n[0],a=n[1],l=n[2],s=n[3],d=0;if(a==r.fieldId){if(gformIsHidden(r.$fieldContainer.find("> :first-child")))return 0;var c=r.viewModel&&"function"==typeof r.viewModel.entries?r.viewModel.entries():r.entries,f=window.gform.applyFilters("gpnf_calc_entries",c,{search:i,nestedFormFieldId:a,func:l,targetFieldId:s},r.fieldId,r.formId,r,o);switch(l){case"sum":var u=0;f.forEach((function(e){var t=0;void 0!==e[s]&&(t=r.isProductCalcTarget(s)?r.getProductCalcValue(e,s):e[s].value?gformToNumber(e[s].value):0),u+=parseFloat(t)})),d=u;break;case"total":u=0,f.forEach((function(e){u+=parseFloat(e.total)})),d=u;break;case"count":d=f.length;break;case"set":var m=[];f.forEach((function(e){var t=0;void 0!==e[s]&&e[s].value&&(t=gformToNumber(e[s].value)),m.push(t)})),d=m.join(", ")}d=window.gform.applyFilters("gpnf_calc_replacement_value",d,{search:i,nestedFormFieldId:a,func:l,targetFieldId:s},f,r.fieldId,r.formId,r,o),t=t.replace(i,d)}}))),t;var a},r.handleParentMergeTag=function(t){var o;if(void 0!==t){var n=[];e.each(t,(function(e,t){n.push("#field_".concat(r.nestedFormId,"_").concat(t))})),o=r.$modal.find(n.join(",")).find(":input")}else o=r.$modal.find(":input");o.each((function(){var t,o,n,i,a,l,s=e(this),d=s.data("gpnf-value"),c=s.attr("type");if(!d)return!0;function f(t,o){if(""===o){var n=e(t),r=n.prop("id");if("string"==typeof r&&"_raw"===r.slice(-4)){var i=r.replace(/_raw$/,""),a=n.siblings("#"+i+'[type="hidden"]');a.length&&a.val("").change()}}}function u(t){var o=e(t);d=o.val();var n=r.getParentMergeTags(d);if(n.length){for(var i=0,a=n.length;i<a;i++)d=d.replace(n[i][0],"");o.val(d).change().trigger("chosen:updated"),f(t,d)}}if(0!==r.$modal.find(".gform_validation_error").length)return u(this),!0;var m=r.getParentMergeTags(d);if(!m)return!0;for(var p,g,h,v=function(){if(p=m[_][1],isNaN(p))return{value:!0};if(((g=r.$parentFormContainer.find("#input_"+r.formId+"_"+p.split(".").join("_"))).hasClass("gfield_radio")||g.hasClass("gfield_checkbox"))&&(g=g.find("input:checked")),h=[],-1!==m[_][0].indexOf(":label")?g.each((function(){var t=e(this);t.hasClass("gfield_select")?h.push(t.find("option:selected").text()):h.push(t.parent().find("label").text())})):g.each((function(){h.push(e(this).val())})),"gf_other_choice"===(h=h.join(", ")))h=g.closest(".gfield").find(".gchoice_other_control").val();else if("number"===c)if(null===(o=null===(t=window.gf_global)||void 0===t?void 0:t.gfcalc)||void 0===o?void 0:o[r.formId]){var i=Number(p.split(".").pop()),a=window.gf_global.gfcalc[r.formId],l=a.formulaFields.find((function(e){return e.field_id===i}));l&&(h=a.cleanNumber(h,r.formId,i,l))}else{var s=new gform.Currency(null===(n=window.gf_global)||void 0===n?void 0:n.gf_currency_config);h=s.toNumber(h)}h=gform.applyFilters("gpnf_parent_merge_tag_value",g.length?h:"",p,r.formId,r),d=d.replace(m[_][0],h)},_=0;_<m.length;_++){var b=v();if("object"==typeof b)return b.value}f(this,d=d.trim());var y=e(this).val();if("edit"===r.mode&&!gform.applyFilters("gpnf_replace_parent_merge_tag_on_edit",!1,r.formId))return u(this),e(this).siblings('input[name^="gwro_hidden_capture_"]').val(y),!0;if(e(this).siblings('input[name^="gwro_hidden_capture_"]').val(d),y!=d){e(this).val(d).change().trigger("chosen:updated").trigger("gpnfUpdatedFromParentMergeTag");var w=null===(i=e(this).prop("id"))||void 0===i?void 0:i.split("_"),C=null==w?void 0:w[2],F=null===(l=null===(a=null===window||void 0===window?void 0:window.tinyMCE)||void 0===a?void 0:a.editors)||void 0===l?void 0:l["input_".concat(r.nestedFormId,"_").concat(C)];F&&F.setContent(d)}}))},r.getParentMergeTags=function(e){for(var t=[],o=/{Parent:(\d+(\.\d+)?)[^\}]*}/i;o.test(e);){var n=t.length;t[n]=o.exec(e),e=e.replace(""+t[n][0],"")}return t},r.getCurrentPage=function(){var t=e("#gform_source_page_number_".concat(r.nestedFormId)).val();return Math.max(1,parseInt(t))},r.getCurrentEntryId=function(){return r.$modal.find('input[name="gpnf_entry_id"]').val()},r.getEntryRow=function(t){return e('.gpnf-nested-entries [data-entryid="'+t+'"]')},r.getDebugId=function(){return"xxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))},r.getNamespace=function(){return"gpnf-".concat(r.formId,"-").concat(r.fieldId)},r.initIframe=function(t){e("#gform_ajax_frame_".concat(t)).off("load").on("load",(function(){var o=e(this).contents().find("*").html();if(o.indexOf("GF_AJAX_POSTBACK")>=0){var n=e(this).contents().find("#gform_wrapper_".concat(t)),i=e(this).contents().find("#gform_confirmation_wrapper_".concat(t)).length>0,a=o.indexOf("gformRedirect(){")>=0,l=n.length>0&&!a&&!i,s=e("#gform_wrapper_".concat(t));if(l){s.html(n.html()),n.hasClass("gform_validation_error")?s.addClass("gform_validation_error"):s.removeClass("gform_validation_error"),setTimeout((function(){}),50),window.gformInitPriceFields&&gformInitPriceFields();var d=e("#gform_source_page_number_".concat(t)).val();e(document).trigger("gform_page_loaded",[t,d]),r.triggerGformPostRender(t,d),window["gf_submitting_".concat(t)]=!1}else if(!a){var c=e(this).contents().find(".GF_AJAX_POSTBACK").html();c||(c=o),setTimeout((function(){s.replaceWith(c),e(document).trigger("gform_confirmation_loaded",[t]),window["gf_submitting_".concat(t)]=!1}),50)}e(document).trigger("gpnf_post_render",[t,d])}}))},GPNestedForms.deleteEntry=function(e,t,o){r.deleteEntry(e,t,o)},GPNestedForms.loadEntry=function(e){var t=window["GPNestedForms_".concat(e.formId,"_").concat(e.fieldId)],o=!0,n=t.prepareEntryForKnockout(e.fieldValues);if(n.id=e.entryId,"edit"==e.mode){var i=r.getEntryRow(n.id).index();t.viewModel.entriesRaw.remove((function(e){return e.id==n.id})),t.viewModel.entriesRaw.splice(i,0,n)}else t.viewModel.entriesRaw.push(n),o=window.gform.applyFilters("gpnf_fetch_form_html_after_add",o,r.formId,r.fieldId,r);window.gform.applyFilters("gpnf_fetch_form_html_after_add_or_edit",o,r.formId,r.fieldId,r,e)&&t.refreshMarkup(),t.isActive&&t.modal.close()},r.init()};var t=function(t,o){var n=this;n.entriesRaw=C.observableArray(t),n.entries=C.pureComputed({read:function(){return gform.applyFilters("gpnf_sorted_entries",n.entriesRaw(),o.formId,o.fieldId,o)},write:function(e){n.entriesRaw(e)}}),n.entries.subscribe((function(){o.$parentFormContainer.trigger("change")})),n.isMaxed=C.computed((function(){var e=gform.applyFilters("gpnf_entry_limit_max",o.entryLimitMax,o.formId,o.fieldId,o);return""!==e&&n.entries().length>=e})),n.entryIds=C.computed((function(){var t=[];return e.each(n.entries(),(function(e,o){t.push(o.id)})),t}),n),n.runCalc=C.computed((function(){return o.runCalc(),n.entries().length}),n),n.editEntry=function(t,n){o.editEntry(t.id,e(n.target))},n.deleteEntry=function(t,n){o.deleteEntry(t,e(n.target))},n.duplicateEntry=function(t,n){o.duplicateEntry(t.id,e(n.target))}};function o(e,t,o){return t=void 0!==t&&t?t:gf_global.base_url+"/images/spinner.gif",o=void 0!==o?o:"",this.elem=e,this.image='<img class="gfspinner" src="'+t+'" style="'+o+'" />',this.init=function(){return this.spinner=jQuery(this.image),jQuery(this.elem).after(this.spinner),this},this.destroy=function(){jQuery(this.spinner).remove()},this.init()}}(jQuery)})()})();