var ZFFullPageForm={menuItemsSpeed:350,inputClearAnimationSpeed:500,errorHideTimeOut:4e3,errorSlideDownSpeed:100,errorSlideUpSpeed:200},ZFPageTitle={},ZFPageAnimation={animType:1,pageFadeInSpeed:600,footerFadeInSpeed:600,pageFadeOutSpeed:400,footerFadeOutSpeed:400,pageLoadSpeed:100,fieldFadeOutSpeed:500,fieldFadeInSpeed:800,pageNavbarAnimTime:400};function init(isFormLoad){ZFFullPageForm.isCssHasSupported=isCssSelectorSupportedInBrowser("div:has(input)"),floatingFormComponentsHandler(),checkAndAddMiniContClass(),ZFLive.isFormPdf||(initPageHeader(isFormLoad),isFormLoad&&(setMaxWidthForDescriptionFieldImages($("div[elname=livefield-elem][reltype=parent]:visible:first").width()),bindWindowResizeEvent(),bindEventForClearIconShowOrHide($(ZFLive.formFormFieldsOuterWrapper)),showFormFirstPageComponents(),bindEvntInFirstPageSignatureComp($("div[elname=formBodyULName][page_no=1]"))))}function showFormFirstPageComponents(){$("div[elname=formBodyULName][page_no=1], div[elname=footer][page_no=1], div[elname=pageHdr]").animate({opacity:1},{duration:ZFPageAnimation.pageLoadSpeed,complete:function(){$(this).css("opacity","")}})}function bindWindowResizeEvent(){isMobileBrowser()?(window.matchMedia("(orientation: portrait)").addEventListener("change",function(e){hidePickerElems(),setTimeout(function(){setMatrixElemWidth($("div[elname=formWrapper]")),setMatrixElemHeight($("div[elname=formWrapper]"))},100),init(),scollPageNavElemIntoView(getCurrentActivePage())}),window.addEventListener("touchmove",function(e){setDatePickerPosition()})):window.visualViewport.addEventListener("resize",function(){setDatePickerPosition(),setTimeout(function(){setMatrixElemWidth($("div[elname=formWrapper]")),setMatrixElemHeight($("div[elname=formWrapper]"))},100),checkAndAddMiniContClass(),floatingFormComponentsHandler(),ZFLive.isThemePage&&initPageHeader()})}function hidePickerElems(){var currActiveDiv=$("div#formBodyDiv").find("div[elname=formBodyULName]:visible");if(currActiveDiv.length>0){var dateInpElems=$(currActiveDiv).find("input[elname=date],input[elname=dateTime]");if(dateInpElems.length>0){var datePickerSelectElems=$("#ui-datepicker-div").find("select:visible");datePickerSelectElems.length>0&&$(datePickerSelectElems).select2("close"),$(dateInpElems).datepicker("hide")}var selectElems=$(currActiveDiv).find("select:visible");selectElems.length>0&&($(".select2-dropdown").hide(),$(selectElems).select2("close")),$(currActiveDiv).find("div[phoneformat=INTERNATIONAL]").length>0&&window.dispatchEvent(new CustomEvent("scroll"));var zcrmField=$(currActiveDiv).find("div[comptype="+ZFFieldTypeConstants.ZOHO_CRM+"]");if($(zcrmField).length>0){var entryListingDiv=$("div[elname=crm-entry-listing-div]");if(0!=$(entryListingDiv).length&&$(entryListingDiv).is(":visible")){var entryULElem=$(entryListingDiv).find("ul[elname=entry-ul]");$(entryULElem).empty(),$(entryListingDiv).hide()}}}}function hideErrorOF(elem){var errMsgDiv=$(elem).find("div[name=errMsgDiv]"),errDiv=$(elem).find("div[name=errDiv]");$(elem).removeClass("error"),$(errMsgDiv).text(""),animateHideErrorMsgOF(errDiv)}function animateErrorMsgOF(elem){ZFUtil.findAndCloseHoverTextPopup(elem),"upload_field"===$(elem).attr("error_type")?animateUploadFieldErrorMsgOF(elem):(clearTimeout(ZFLive.onInputValErrTimeOut),$(elem).removeClass("zfErrorDivAnimate"),$(elem).hasClass("err_hiding")&&$(elem).hide(),ZFLive!=undefined&&ZFLive.preventHideOFError?$(elem).slideDown(ZFFullPageForm.errorSlideDownSpeed):1==$(elem).closest("div[elname='subFormFieldsUl']").length?$(elem).slideDown(ZFFullPageForm.errorSlideDownSpeed):($(elem).slideDown(ZFFullPageForm.errorSlideDownSpeed,function(){$(this).addClass("zfErrorDivAnimate")}),ZFLive.onInputValErrTimeOut=setTimeout(function(){animateHideErrorMsgOF(elem)},ZFFullPageForm.errorHideTimeOut)))}function animateUploadFieldErrorMsgOF(elem){ZFLive!=undefined&&ZFLive.preventHideOFError?$(elem).slideDown(ZFFullPageForm.errorSlideDownSpeed):($(elem).slideDown(ZFFullPageForm.errorSlideDownSpeed,function(){$(this).parent().addClass("zfErrorDivAnimate")}),"fu_error"!==$(elem).attr("elname")&&($(elem).parent().removeClass("zfErrorDivAnimate"),$(elem).hasClass("err_hiding")&&$(elem).hide(),clearTimeout(ZFLive.onInputValErrTimeOut),ZFLive.onInputValErrTimeOut=setTimeout(function(){animateHideErrorMsgOF(elem)},ZFFullPageForm.errorHideTimeOut)))}function animateHideErrorMsgOF(elem){clearTimeout(ZFLive.onInputValErrTimeOut),$(elem).removeClass("zfErrorDivAnimate"),$(elem).addClass("err_hiding"),$(elem).slideUp(ZFFullPageForm.errorSlideUpSpeed,function(){$(this).removeClass("err_hiding")})}function selectChoice(elem){var parentSpan=$(elem).parent("span");$(parentSpan).hasClass("selectedChoice")?$(parentSpan).removeClass("selectedChoice"):$(parentSpan).addClass("selectedChoice")}function selectChoiceForCb(elemArr){for(var i=0;i0,countryCodeProps=jQuery.extend(!0,{},ZFPhone.countryCodeProps);countryCodeProps.isRtl=isRTLform();var listofcountries=[];if(typeof initFldPropJson.allowed_countrylist!=ResponseKey.UNDEFINED&&(listofcountries=initFldPropJson.allowed_countrylist),countryCodeProps.onlyCountries=listofcountries,countryCodeProps.initialCountry="auto",typeof initFldPropJson.phonecountrycode_ipbased!=ResponseKey.UNDEFINED&&(0==listofcountries.length||listofcountries.length>0&&-1!=$.inArray(initFldPropJson.phonecountrycode_ipbased.toLowerCase(),listofcountries))){var val=initFldPropJson.phonecountrycode_ipbased.toLowerCase();"null"!=val&&"-"!=val&&""!=val&&(countryCodeProps.initialCountry=val)}var phoneInput=$(phoneFldSwiperDiv).find("input[name="+fieldlinkname+"]");isSfCloneElem||($(phoneInput).intlTelInput(countryCodeProps),void 0!==(countryIsoCode=$(phoneInput).attr("country_iso_code"))&&""!=countryIsoCode&&$(phoneInput).intlTelInput("setCountry",countryIsoCode));if($(phoneInput).attr({initCountry:countryCodeProps.initialCountry,countryList:listofcountries}),setCountryCodePropsForFlds("#"+fieldlinkname,isRTLform()),initFldPropJson.simple_email_reconf){var countryIsoCode,phoneInputConf=$(phoneFldSwiperDiv).find("input[name="+fieldlinkname+"-reconf]");if(!isSfCloneElem)$(phoneInputConf).intlTelInput(countryCodeProps),void 0!==(countryIsoCode=$(phoneInputConf).attr("country_iso_code"))&&""!=countryIsoCode&&$(phoneInputConf).intlTelInput("setCountry",countryIsoCode);setCountryCodePropsForFlds("#"+fieldlinkname+"-reconf",isRTLform())}}function sliderInit(formElem,initFldPropJson,fieldlinkname){var circularSlider,slideDiv=$(formElem).find('div[id="sld-'+fieldlinkname+'"]'),sliderType=initFldPropJson.slider_type,sliderMin=initFldPropJson.minimum_value,sliderMax=initFldPropJson.maximum_value,range=sliderMax-sliderMin,minClassLimit=parseFloat(sliderMin)+.1*range,maxClassLimit=parseFloat(sliderMin)+.9*range,isDisabled=initFldPropJson.is_disabled,stepValue=initFldPropJson.step_value,initialVal=document.getElementById("amount-"+fieldlinkname).getAttribute("value"),rangeDirection="2"===ZFLive.txtDirection?"max":"min",stopTriggered=!1,downEventTriggered=!1,moveEventTriggered=!1;if($(slideDiv).slider({orientation:sliderType,range:rangeDirection,min:sliderMin,max:sliderMax,animate:"300",value:initialVal,isRTL:isRTLform(),step:stepValue,slide:function(event,ui){if(event.originalEvent!=undefined&&("mousedown"===event.originalEvent.type?downEventTriggered=!0:"mousemove"===event.originalEvent.type&&(moveEventTriggered=!0),!stopTriggered&&downEventTriggered&&moveEventTriggered))return!1;var slidval=ui.value,sliderFieldElem=$("#"+fieldlinkname+"-li");if(slidval<=minClassLimit?$(sliderFieldElem).find("div[id=slid_"+fieldlinkname+"_Div").addClass("sliderMinRange"):slidval>=maxClassLimit?$(sliderFieldElem).find("div[id=slid_"+fieldlinkname+"_Div").addClass("sliderMaxRange"):$(sliderFieldElem).find("div[id=slid_"+fieldlinkname+"_Div").removeClass("sliderMinRange sliderMaxRange"),$(sliderFieldElem).find("div[id=amount-"+fieldlinkname+"]").attr("value",slidval),$(sliderFieldElem).find("div[id=slid-"+fieldlinkname+"]").text(slidval),isAccessibilitySupported()){var sliderValCont=$("#"+fieldlinkname+"-li").find("a[aria-label="+slidval+"]");isRTLform()?($(sliderValCont).nextAll("a[aria-label]").attr("tabindex","-1"),$(sliderValCont).prevAll("a[aria-label]").attr("tabindex","0"),$("#"+fieldlinkname+"-li").find("[elname=circular-slider]").attr("tabindex","0")):($(sliderValCont).prevAll("a[aria-label]").attr("tabindex","-1"),$(sliderValCont).nextAll("a[aria-label]").attr("tabindex","0")),$(sliderValCont).attr("tabindex","-1");var currPosForAriaVal=$("#"+fieldlinkname+"-li").find("[elname=circular-slider]");$(currPosForAriaVal).attr("aria-valuenow",slidval)}$(sliderFieldElem).find("div[id=slid_"+fieldlinkname+"_Div]").show(),stopTriggered=!1},stop:function(event,ui){stopTriggered=!0,downEventTriggered=!1,moveEventTriggered=!1,setSfTotalValForSlider(fieldlinkname);var liElem=$("div#"+fieldlinkname+"-li");ZFLive.prefillFieldLabelFromLiElem(liElem,!1),removeErrorFromLiElem(liElem),isAccessibilitySupported()||$(liElem).find("a:focus").blur()}}),initFldPropJson.advanced_options){var advanced_options=initFldPropJson.advanced_options;ZFLive.setSliderIndicators(slideDiv,stepValue,sliderMin,sliderMax,advanced_options.show_stepby_point,advanced_options.show_stepby_value,isRTLform())}circularSlider=$(slideDiv).find("a[elname=circular-slider]"),0!=initialVal?($(slideDiv).find("div[id=slid_"+fieldlinkname+"_Div").show(),$(circularSlider).attr("aria-valuenow",initialVal)):($(slideDiv).find("div[id=slid_"+fieldlinkname+"_Div").hide(),$(circularSlider).attr("aria-valuenow",0)),initialVal<=minClassLimit?$(slideDiv).find("div[id=slid_"+fieldlinkname+"_Div").addClass("sliderMinRange"):initialVal>=maxClassLimit?$(slideDiv).find("div[id=slid_"+fieldlinkname+"_Div").addClass("sliderMaxRange"):$(slideDiv).find("div[id=slid_"+fieldlinkname+"_Div").removeClass("sliderMinRange sliderMaxRange"),isDisabled&&($(slideDiv).slider({disabled:!0}),$(circularSlider).attr("tabindex","-1"))}function signatureInit(formElem,initFldPropJson,fieldlinkname){var isDisabled=initFldPropJson.is_disabled;setCanvasElemWidthAndHeight(fieldlinkname);var fontColor="#000000",valueTxtClr=$(":root").css("--value-txt-clr");(valueTxtClr!=ResponseKey.UNDEFINED||valueTxtClr.length>0)&&(fontColor="rgb("+valueTxtClr+")");var signCanvas=$("#drawingCanvas-"+fieldlinkname);if(isDisabled)$(signCanvas).css("pointer-events","none"),$(signCanvas).css("cursor","default");else{var canvasElem=document.getElementById("drawingCanvas-"+fieldlinkname),context=canvasElem.getContext("2d"),signFldDiv=$(signCanvas).closest("div[elname=livefield-elem][fldtype="+ZFFieldTypeConstants.SIGNATURE+"]");$(signCanvas).mousedown(function(event){var position=getXYCoords(event,canvasElem,!1);context.moveTo(position.X,position.Y),context.beginPath(),$(this).mousemove(function(event){bindSignatureOnSignEvent(signFldDiv,FormLayoutType.FULLPAGE),startScribbling(event,canvasElem,context,!1,fontColor)}).mouseup(function(event){endScribbling(event,canvasElem,context,fontColor);var fieldElem=getClosestFieldElemLi(canvasElem);removeErrorFromLiElem(fieldElem)}).mouseout(function(event){endScribbling(event,canvasElem,context,fontColor);var fieldElem=getClosestFieldElemLi(canvasElem);removeErrorFromLiElem(fieldElem)})}),canvasElem.addEventListener("touchstart",function(event){var position=getXYCoords(event,canvasElem,!1);context.moveTo(position.X,position.Y),context.beginPath()},!1),canvasElem.addEventListener("touchmove",function(event){bindSignatureOnSignEvent(signFldDiv,FormLayoutType.FULLPAGE),startScribbling(event,canvasElem,context,!0,fontColor),event.preventDefault()},!1),canvasElem.addEventListener("touchend",function(event){endScribbling(event,canvasElem,context,fontColor);var fieldElem=getClosestFieldElemLi(canvasElem);removeErrorFromLiElem(fieldElem)},!1)}window.navigator.userAgent.indexOf("MSIE ")>0&&$(signCanvas).keypress(function(event){13===event.keyCode&&event.preventDefault()})}function dateInit(formElem,fieldlinkname){var dateFldSwiperDiv=$(formElem).find("div[compname="+fieldlinkname+"]"),formActualDateFormat=$("#zf_date_format").val(),dateFldDiv=$(dateFldSwiperDiv).find("div[id="+fieldlinkname+"dateDiv]"),dateformat=$(dateFldDiv).attr("elname"),dateLocale=""==$(dateFldDiv).attr("datelocale")?"en-GB":$(dateFldDiv).attr("datelocale"),disableDays=$(dateFldSwiperDiv).attr("disableddays"),weekStart=$(dateFldSwiperDiv).attr("startoftheweek"),isDisabled=$(dateFldDiv).attr("isDisable");$(dateFldSwiperDiv).find("input[id="+fieldlinkname+"-date]").datepicker({showOn:"button",buttonImage:"",buttonImageOnly:!0,dateFormat:dateformat,showAnim:"drop",changeMonth:!0,yearRange:"1900:2100",firstDay:weekStart,beforeShowDay:function(date){return ZFUtil.blockDisabledDaysAndHolidays(date,disableDays)},beforeShow:function(){ZFUtil.setDateLimit(this,formActualDateFormat,dateLocale)},onClose:function(){isAccessibilitySupported()&&$(this).focus()},onChangeMonthYear:function(year,month,inst){var elem=$(this);isAccessibilitySupported()&&setTimeout(function(){ZFLive.handleKeyNavigationsForDatePicker(elem,event,!0)},0)},monthNamesShort:CustomDateLocale[dateLocale].monthNamesShort,monthNames:CustomDateLocale[dateLocale].monthNames,dayNamesMin:CustomDateLocale[dateLocale].dayNamesMin,showMonthAfterYear:CustomDateLocale[dateLocale].showMonthAfterYear,yearSuffix:CustomDateLocale[dateLocale].yearSuffix,changeYear:!0});var imgElem=$(dateFldDiv).find("img");$(imgElem).removeClass("ui-datepicker-trigger"),$(imgElem).addClass("calendarIcon"),$(imgElem).mousedown(function(e){e.preventDefault()}),$(imgElem).removeAttr("alt");var imgWrapDiv=$('
');$(imgWrapDiv).insertBefore(imgElem),$(imgElem).appendTo(imgWrapDiv),$("#ui-datepicker-div").addClass("calIndex"),$("#ui-datepicker-div").addClass("notranslate"),"true"==isDisabled&&$(dateFldSwiperDiv).find("input[id="+fieldlinkname+"-date]").datepicker().datepicker("disable")}function monthYearInit(oneFieldSwiperMainDiv,fieldlinkname){var monthYearFldSwiperDiv=$(oneFieldSwiperMainDiv).find("div[compname="+fieldlinkname+"]"),monthYearFldDiv=$(monthYearFldSwiperDiv).find("div[id="+fieldlinkname+"monthYearDiv]"),dateFormatVal=$("#zf_date_format").val(),dateFormat=typeof dateFormatVal==ResponseKey.UNDEFINED||""==dateFormatVal?"dd-MMM-yyyy":dateFormatVal,dateLocale=$(monthYearFldDiv).attr("datelocale");initializeMonthYearPicker($(monthYearFldSwiperDiv).find("input[id="+fieldlinkname+"-monthyear]"),dateFormat,dateLocale)}function dateTimeInit(formElem,fieldlinkname){var dateFldSwiperDiv=$(formElem).find("div[compname="+fieldlinkname+"]"),formActualDateFormat=$("#zf_date_format").val(),dateTimeFldDiv=$(dateFldSwiperDiv).find("div[id="+fieldlinkname+"dateTimeDiv]"),dateformat=$(dateTimeFldDiv).attr("elname"),dateLocale=""==$(dateTimeFldDiv).attr("datelocale")?"en-GB":$(dateTimeFldDiv).attr("datelocale"),timeformat=$(dateFldSwiperDiv).attr("timeformat"),isDisabled=$(dateTimeFldDiv).attr("isDisable");ZFUtil.datetimepicker(formActualDateFormat,dateformat,$(dateFldSwiperDiv).find("input[id="+fieldlinkname+"-dateTime]"),dateLocale,!1,timeformat);var imgElem=$(dateTimeFldDiv).find("img");$(imgElem).removeClass("ui-datepicker-trigger"),$(imgElem).addClass("calendarIcon"),$(imgElem).mousedown(function(e){e.preventDefault()}),$(imgElem).removeAttr("alt");var imgWrapDiv=$('
');$(imgWrapDiv).insertBefore(imgElem),$(imgElem).appendTo($(dateTimeFldDiv).find("div[elname=imgWrapDiv]")),$("#ui-datepicker-div").addClass("calIndex"),"true"==isDisabled&&$(dateFldSwiperDiv).find("input[id="+fieldlinkname+"-dateTime]").datepicker().datepicker("disable")}function paymentInitOF(formElem,initFldPropJson){var paymentLI=$(formElem).find("div[id=PaymentAmount-li]"),firstMerchant=initFldPropJson.merchants[0],merchantTypeFirstMerch=firstMerchant.merchant_type,currencyCodeFirstMerch=firstMerchant.currency_type,merchantDiv=$(paymentLI).find("div[elname=merchantDiv]").find("a[merchantType="+merchantTypeFirstMerch+"]");if("true"==$(paymentLI).attr("mandatory")&&($(merchantDiv).addClass("selected"),$(paymentLI).find("div[elname=merchantDiv]").attr("merchantType",merchantTypeFirstMerch),$(paymentLI).find("div[elname=paymentDetailsDiv]").show(),$(paymentLI).find("div[elname=paymentDetailsDiv]").removeClass("authNetCardContainer squareCardContainer"),merchantTypeFirstMerch==ZFFormPayments.MERCHANT_TYPE.STRIPE?$(paymentLI).find("div[elname=stripeMerchantDiv]").show():merchantTypeFirstMerch==ZFFormPayments.MERCHANT_TYPE.AUTHORIZE_NET?($(paymentLI).find("div[elname=authNetMerchantDiv]").show(),$(paymentLI).find("div[elname=paymentDetailsDiv]").addClass("authNetCardContainer")):merchantTypeFirstMerch==ZFFormPayments.MERCHANT_TYPE.SQUARE&&($(paymentLI).find("div[elname=squareMerchantDiv]").show(),$(paymentLI).find("div[elname=paymentDetailsDiv]").addClass("squareCardContainer")),2==$(paymentLI).find("div[elname=merchantDiv]").attr("paymenttype"))){var instructionDiv=$(paymentLI).find("p[elemType=instruction]"),minamountFirstMerch=typeof firstMerchant.varied_min_amount!=ResponseKey.UNDEFINED?firstMerchant.varied_min_amount:"",maxamountFirstMerch=typeof firstMerchant.varied_max_amount!=ResponseKey.UNDEFINED?firstMerchant.varied_max_amount:"";""!=minamountFirstMerch&&""!=maxamountFirstMerch?$(instructionDiv).text("( "+ZFUtil.replaceParamsArr(i18n.donationhintmsgminmax,[minamountFirstMerch,maxamountFirstMerch])+" )").show():""!=minamountFirstMerch&&""==maxamountFirstMerch?($(instructionDiv).text("( "+i18n.donationhintmsgmin).show(),$(instructionDiv).append(" "+currencyHashcode[currencyCodeFirstMerch]+minamountFirstMerch+" )")):""==minamountFirstMerch&&""!=maxamountFirstMerch?($(instructionDiv).text("( "+i18n.donationhintmsgmax).show(),$(instructionDiv).append(" "+currencyHashcode[currencyCodeFirstMerch]+maxamountFirstMerch+" )")):$(instructionDiv).hide()}if(!ZFLive.isFormPdf&&("live"==ZFLive.mode||"savedRecord"==ZFLive.mode)){ZFLive.bindEventForPaymentAutoFill();var pymntMerchDiv=$(paymentLI).find("div[elname=merchantDiv]");if(null!=merchantTypeFirstMerch&&""!=merchantTypeFirstMerch&&null!=ZFLive.paymentMerchantList){var paymentType=$(pymntMerchDiv).attr("paymenttype"),selectedMerchantDiv=$(pymntMerchDiv).find("a[merchanttype="+merchantTypeFirstMerch+"]"),amntType=$(selectedMerchantDiv).attr("amounttype");if(2==paymentType&&2==amntType){var dispAmnt=$.trim($(selectedMerchantDiv).attr("dispamnt"));""!=dispAmnt?ZFLive.changeValueInPayment(merchantTypeFirstMerch,paymentType,dispAmnt):ZFLive.changeValueInPayment(merchantTypeFirstMerch,paymentType)}else 1==paymentType&&2==amntType&&ZFLive.changeValueInPayment(merchantTypeFirstMerch,paymentType)}for(var i=0;i0&&($(otherTextSpanElem).find("input[name=allow-others-text]").val("").blur(),$(otherTextSpanElem).removeClass("otherChoiceAnimate")),$(elem).prop("checked",!1).trigger("change")):($(parentSpan).addClass("selectedChoice"),$(elem).prop("checked",!0).trigger("change"))}function addMultipleFileUploadFields_New_of(files,linkName,uploadlimit,isCompressionEnabledForField){var elemLi=$("#"+linkName+"-li"),fieldType=$(elemLi).attr("comptype");$("#error-"+linkName).hide(),$("#error-"+linkName).text("");var inputFileElemLen=files.length;if(inputFileElemLen>0){var totalfiles=0,fileDiv=$("#"+linkName+"-div-files"),selectedFileCount=$(fileDiv).find("ul[elname=fileElementUL]").find("li[name=singleFileElement][isdelsfpopup!=true]").length;if(selectedFileCount>=0&&(totalfiles=inputFileElemLen+selectedFileCount),totalfiles<=uploadlimit){var i,count=0,selectedfiles=$(fileDiv).find("ul[elname=fileElementUL]").find("li[elname=newlyAddedFUElement]");for(selectedfiles.length>0&&(count=selectedfiles.length),i=0;i{var newFileUploadLi=fileDiv.find("ul[elname=fileElementUL]").find("li[elname=templateFileElement]").first().clone();$(fileDiv).find("ul[elname=fileElementUL]").append(newFileUploadLi),readFile_New(files[i],newFileUploadLi,linkName,fieldType,count,isCompressionEnabledForField,readComplete,readError)}).then(({fileObj:fileObj,newFileUploadLi:newFileUploadLi,imgProcessId:imgProcessId})=>{ZFLive.uploadFile(linkName,fileObj,newFileUploadLi,imgProcessId)})["catch"](({error:error,imgProcessId:imgProcessId})=>{})}$(fileDiv).find("ul[elname=fileElementUL]").find("li[name=singleFileElement][isdelsfpopup!=true]").length==uploadlimit&&$("#"+linkName+"-id").attr("onclick","showUploadLimitErr('"+linkName+"','"+uploadlimit+"');event.preventDefault();"),i>0&&(fileDiv.show(),triggerFormResize())}else showUploadLimitErr(linkName,uploadlimit)}}function showUploadLimitErr(linkName,uploadlimit){var errorMsg;errorMsg=-1!=ZFLiveErrorConstants.fileuploadlimiterror.indexOf("{0}")?ZFUtil.replaceParams(ZFLiveErrorConstants.fileuploadlimiterror,uploadlimit):ZFLiveErrorConstants.fileuploadlimiterror;var fuErrTg=isSubFormField()||isOneFieldForm()?"#error-"+linkName:$("div[id="+linkName+"-li]").find("div[name=errDiv]");fuErrTg.text(errorMsg),animateErrorMsg(fuErrTg)}function removeUploadFldsOnclckEvnt(fieldName){$("#"+fieldName+"-id").removeAttr("onclick")}function bindSelect2form_of(formElem){var selectDiv="div[elname=livefield-elem] .fieldContainer .customDropDownof select, div[elname=livefield-elem][viewtype=1] div[elname=subFormFieldsUl] .fieldContainer .customDropDown select",direction=getSelect2Direction_of();if($(formElem).find(selectDiv).each(function(){var elem=$(this).closest("div[elname=livefield-elem]"),dropdownCustomCssClass=" select2FormList ";dropdownCustomCssClass+="child"==elem.attr("reltype")&&1==$(elem).closest("div[reltype=parent]").attr("viewtype")?" sfInlineDropdown ":"";var remainingText=$(this).attr("remaining_text");if(remainingText!=ResponseKey.UNDEFINED&&(dropdownCustomCssClass+=" valueRestrictionDiv"),"small"==$(this).attr("inpSize")&&(dropdownCustomCssClass+=" dropSmall"),$(this).attr("zfs2_cust")!=undefined&&"true"==$(this).attr("zfs2_cust")){var placeHolderVal=$(this).attr("zfs2_placeholder"),minimumResForSearch=0,dropdownAdapter=$.fn.select2.amd.require("ZFLive_Sel_dropdownAdapter");$(this).attr("zfs2_searchable")!=undefined&&"false"==$(this).attr("zfs2_searchable")&&(minimumResForSearch=-1,dropdownAdapter=$.fn.select2.amd.require("ZFLive_Sel_dropdownAdapter_without_search")),resetDropDownVal(this),$(this).select2({dropdownCssClass:dropdownCustomCssClass,containerCssClass:"select2FormCont oneFldDrpDwnSel2",dir:direction,templateSelection:getTemplateSelectionHtml,matcher:getSelect2Matcher,allowClear:!0,minimumResultsForSearch:minimumResForSearch,placeholder:placeHolderVal,templateResult:getTemplateResultHtml,dropdownAdapter:dropdownAdapter,dataAdapter:$.fn.select2.amd.require("ZFLive_Sel_dataAdapter"),selectionAdapter:$.fn.select2.amd.require("ZFLive_Sel_selectionAdapter"),resultsAdapter:$.fn.select2.amd.require("ZFLive_Sel_resultsAdapter"),language:{noResults:function(){return ZFLive.noresultsfound}}})}else $(this).select2({dropdownCssClass:"select2FormList",containerCssClass:"select2FormCont oneFldDrpDwnSel2",dir:direction,templateSelection:getTemplateSelectionHtml,matcher:getSelect2Matcher,templateResult:getTemplateResultHtml,language:{noResults:function(){return ZFLive.noresultsfound}}});remainingText!=ResponseKey.UNDEFINED&&$(this).find("optgroup").length>0&&$(this).find("optgroup").each(function(){0===$(this).find("option").length&&$(this).remove()})}),!(ZFLive.isThemePage||ZFLive.isFormPdf)){var select2Elems=$("#formBodyDiv").find(selectDiv);typeof select2Elems!=ResponseKey.UNDEFINED&&select2Elems.length>0&&typeof bindSelect2FuncForAccessibility!=ResponseKey.UNDEFINED&&bindSelect2FuncForAccessibility(select2Elems)}}function resetDropDownVal(selectElem){var defaultVal=$(selectElem).attr("zfs2_defaultval");defaultVal!=undefined&&$(selectElem).val()===defaultVal&&$(selectElem).val(null)}function bindSelect2DropdownForChildElemOneField(myClonedChildUl,listClass){var direction=getSelect2Direction_of();$(myClonedChildUl).find(".fieldContainer .customDropDownsf").find("select").each(function(){if($(this).attr("zfs2_cust")!=undefined&&"true"==$(this).attr("zfs2_cust")){var placeHolderVal=$(this).attr("zfs2_placeholder"),minimumResForSearch=0,dropdownAdapter=$.fn.select2.amd.require("ZFLive_Sel_dropdownAdapter");$(this).attr("zfs2_searchable")!=undefined&&"false"==$(this).attr("zfs2_searchable")&&(minimumResForSearch=-1,dropdownAdapter=$.fn.select2.amd.require("ZFLive_Sel_dropdownAdapter_without_search")),resetDropDownVal(this),$(this).select2({dropdownCssClass:listClass,containerCssClass:"select2FormCont oneFldDrpDwnSel2",dir:direction,templateSelection:getTemplateSelectionHtml,matcher:getSelect2Matcher,allowClear:!0,minimumResultsForSearch:minimumResForSearch,placeholder:placeHolderVal,templateResult:getTemplateResultHtml,dropdownAdapter:dropdownAdapter,dataAdapter:$.fn.select2.amd.require("ZFLive_Sel_dataAdapter"),selectionAdapter:$.fn.select2.amd.require("ZFLive_Sel_selectionAdapter"),resultsAdapter:$.fn.select2.amd.require("ZFLive_Sel_resultsAdapter"),language:{noResults:function(){return ZFLive.noresultsfound}}})}else $(this).select2({dropdownCssClass:listClass,containerCssClass:"select2FormCont oneFldDrpDwnSel2",dir:direction,templateSelection:getTemplateSelectionHtml,matcher:getSelect2Matcher,templateResult:getTemplateResultHtml,language:{noResults:function(){return ZFLive.noresultsfound}}})})}function multiSelectInit(formElem){var direction=getSelect2Direction_of();$(formElem).find("div[elname=livefield-elem] .fieldContainer .customDropDown2of select[multiple=multiple], div[elname=livefield-elem][viewtype=1] div[elname=subFormFieldsUl] .fieldContainer .customDropDown2sf select[multiple=multiple]").each(function(){$(this).closest("div[elname=fldcontdiv]");var placeHolderVal=$(this).attr("zfs2_placeholder"),dropdownCustomCssClass=" customCheckBox multiSelCusChkBoxCont";$(this).attr("remaining_text")!=ResponseKey.UNDEFINED&&(dropdownCustomCssClass+=" valueRestrictionDiv"),"small"==$(this).attr("inpSize")&&(dropdownCustomCssClass+=" dropSmall"),$(this).select2({width:"100%",dir:direction,closeOnSelect:!1,placeholder:placeHolderVal,dropdownCssClass:dropdownCustomCssClass,selectionAdapter:$.fn.select2.amd.require("ZFLive_MultiSel_selectionAdapter"),resultsAdapter:$.fn.select2.amd.require("ZFLive_MultiSel_resultsAdapter"),dataAdapter:$.fn.select2.amd.require("ZFLive_MultiSel_dataAdapter"),dropdownAdapter:$.fn.select2.amd.require("ZFLive_MultiSel_dropdownAdapter"),templateSelection:formatMultiChoiceResultsSelected,templateResult:multiSelectTemplateResultHtml,language:{noResults:function(){return ZFLive.noresultsfound}},dropdownPosition:"below"});let elem=$(this).closest("div[elname=livefield-elem]"),maxLimit=$(elem).attr("maxchoices");$(this).on("select2:selecting",function(e){var selectedVal=$(this).val();null!==selectedVal&&selectedVal.length==maxLimit?(e.preventDefault(),$(this).select2("close"),ZFLive.showMaxChoiceLimitErr(!1,maxLimit,elem)):ZFLive.showMaxChoiceLimitErr(!0,maxLimit,elem)}),$(this).on("change",function(e){multiSelectValChange()}),isAccessibilitySupported()&&bindMultiSelectForAccessibility(this)})}function bindMultiSelectForAccessibility(elem){var select2CrrElem=$(elem).next(".select2-container"),select2Elem=$(select2CrrElem).find(".select2-selection--multiple"),select2Input=$(select2Elem).find(".select2-search__field");$(select2Elem).attr({role:"combobox"}),$(select2Input).attr({role:"combobox","aria-expanded":"false","aria-labelledby":$(elem).attr("aria-labelledby")+" "+$(elem).attr("aria-describedby")});var selectedChoice=$(select2CrrElem).find(".select2-selection__choice__remove");$(selectedChoice).attr("role","button"),1==$(elem).prop("disabled")&&$(selectedChoice).next().attr("tabindex","-1"),$(elem).on("select2:open",function(){setTimeout(function(){var select2Elem=$(elem).next(".select2-container").find(".select2-selection--multiple"),select2Input=$(select2Elem).find(".select2-search__field");$(select2Input).attr({"aria-expanded":"true","aria-controls":$("ul.select2-results__options").attr("id"),"aria-activedescendant":$(".select2-results__option--highlighted").attr("id")}),$(select2Input).on("keydown",function(e){var keyCode=e.keyCode||e.which;38!=keyCode&&40!=keyCode||(e.preventDefault(),setTimeout(function(){var activeDescendant=$(".select2-results__option--highlighted");$(select2Input).attr({"aria-controls":$("ul.select2-results__options").attr("id"),"aria-activedescendant":$(activeDescendant).attr("id")})},0))})},100)}),$(elem).on("select2:close",function(event){var focusElem=$(elem).next(".select2-container").find(".select2-search__field");$(focusElem).attr("aria-expanded","false"),$(focusElem).focus()}),$(elem).on("select2:select",function(e){$(elem).next(".select2-container").find(".select2-selection__choice__remove").attr("role","button")})}function multiSelectInitSubformChild(parentDiv,subformParentLi){var direction=getSelect2Direction_of();$(parentDiv).find("div[elname=livefield-elem] .fieldContainer .customDropDown2sf select[multiple=multiple]").each(function(){var placeHolderVal=$(this).attr("zfs2_placeholder");$(this).select2({width:"100%",dir:direction,closeOnSelect:!1,multiple:!0,placeholder:placeHolderVal,dropdownCssClass:"customCheckBox multiSelCusChkBoxCont",selectionAdapter:$.fn.select2.amd.require("ZFLive_MultiSel_selectionAdapter"),resultsAdapter:$.fn.select2.amd.require("ZFLive_MultiSel_resultsAdapter"),dataAdapter:$.fn.select2.amd.require("ZFLive_MultiSel_dataAdapter"),dropdownAdapter:$.fn.select2.amd.require("ZFLive_MultiSel_dropdownAdapter"),templateSelection:formatMultiChoiceResultsSelected,templateResult:multiSelectTemplateResultHtml,language:{noResults:function(){return ZFLive.noresultsfound}},dropdownPosition:"below"});let elem=$(this).closest("div[elname=livefield-elem]"),maxLimit=$(elem).attr("maxchoices");$(this).on("select2:selecting",function(e){var selectedVal=$(this).val();null!==selectedVal&&selectedVal.length==maxLimit?(e.preventDefault(),$(this).select2("close"),ZFLive.showMaxChoiceLimitErr(!1,maxLimit,elem)):ZFLive.showMaxChoiceLimitErr(!0,maxLimit,elem)}),$(this).on("change",function(e){multiSelectValChange()})})}function getSelect2Direction_of(){return"2"===ZFLive.txtDirection?"rtl":"ltr"}function isRTLform(){return"rtl"==$("body").attr("textdir")}function radioFldOtherTextAnimate(elem){var parentSpan=$(elem).closest("span"),otherTextSpanElem=$(elem).closest("div[elname=livefield-elem]").find("span[elname=allow-others-span]");$(parentSpan)[0].isEqualNode($(otherTextSpanElem)[0])?($(otherTextSpanElem).addClass("otherChoiceAnimate"),$(otherTextSpanElem).find("input[name=allow-others-text]").focus()):($(otherTextSpanElem).find("input[name=allow-others-text]").val("").blur(),$(otherTextSpanElem).removeClass("otherChoiceAnimate")),triggerFormResizeOnTimeOut()}function clearInput(elem){var inpElem=$(elem).siblings("input");$(elem).addClass("inputClearDisable");var inpCaretDiv=$(inpElem).siblings("div[elname=inpCaret]"),fieldDiv=$(elem).closest("div[elname=livefield-elem]"),fieldType=$(fieldDiv).attr("comptype");if(fieldType==ZFFieldTypeConstants.PHONE){var phoneElemDiv=$(fieldDiv).find("div[elname=phoneFormatElem]");$(phoneElemDiv).attr("phoneformat")==ZFPhoneFormatConstants.INTERNATIONAL&&(inpElem=$(elem).closest("div[name=phone-elements]").find("input"),inpCaretDiv=$(elem).closest("div[name=phone-elements]").find("div[elname=inpCaret]"))}isMobileBrowser()?($(inpElem).val("").trigger("showOrHideClearIcon.zf_clear"),setSelectionRangeFrInputFld($(inpElem)[0],0,0),triggerFormulaAndRulesEvent(inpElem,fieldType),fieldType!=ZFFieldTypeConstants.DATE&&fieldType!=ZFFieldTypeConstants.DATETIME&&fieldType!=ZFFieldTypeConstants.MONTHYEAR&&$(inpElem).focus(),$(elem).removeClass("inputClearDisable")):animateInputCaret(elem,$(inpElem),$(inpCaretDiv),fieldType),event.preventDefault()}function animateInputCaret(elem,inpElem,inpCaretDiv,fieldType){var inpValue=$(inpElem).val(),inpLen=inpValue.length,inpElemWidth=$(inpElem).width();$(inpCaretDiv).css({width:inpElemWidth+"px"}),$(inpCaretDiv).animate({width:"0px"},{duration:ZFFullPageForm.inputClearAnimationSpeed,complete:function(){$(inpCaretDiv).hide(),$(inpElem).val("").trigger("showOrHideClearIcon.zf_clear"),triggerFormulaAndRulesEvent(inpElem,fieldType),fieldType!=ZFFieldTypeConstants.DATE&&fieldType!=ZFFieldTypeConstants.DATETIME&&fieldType!=ZFFieldTypeConstants.MONTHYEAR&&$(inpElem).focus(),$(elem).removeClass("inputClearDisable")},step:function(now,fx){var animatePos=Math.floor(100*fx.pos),txtCutOffPos=Math.floor(inpLen-inpLen*(animatePos/100))-1;txtCutOffPos<0&&(txtCutOffPos=0);var newVal=inpValue.substring(0,txtCutOffPos);$(inpElem).val(newVal),setSelectionRangeFrInputFld($(inpElem)[0],inpLen,inpLen)}})}function triggerFormulaAndRulesEvent(inpElem,fieldType){fieldType==ZFFieldTypeConstants.RADIO||fieldType==ZFFieldTypeConstants.DROPDOWN?($(inpElem).trigger("keyup"),$(inpElem).trigger("change")):fieldType==ZFFieldTypeConstants.NAME||fieldType==ZFFieldTypeConstants.ADDRESS?($(inpElem).trigger("keyup"),$(inpElem).trigger("blur")):fieldType==ZFFieldTypeConstants.NUMBER||fieldType==ZFFieldTypeConstants.CURRENCY||fieldType==ZFFieldTypeConstants.DECIMAL||fieldType==ZFFieldTypeConstants.SINGLE_LINE||fieldType==ZFFieldTypeConstants.EMAIL||fieldType==ZFFieldTypeConstants.WEBSITE||fieldType==ZFFieldTypeConstants.PHONE?($(inpElem).trigger("change"),$(inpElem).trigger("blur")):fieldType!=ZFFieldTypeConstants.CHECKBOX&&fieldType!=ZFFieldTypeConstants.DATETIME&&fieldType!=ZFFieldTypeConstants.DATE&&fieldType!=ZFFieldTypeConstants.MONTHYEAR||$(inpElem).trigger("change")}function setCanvasElemWidthAndHeight(compname){var canvasElem=document.getElementById("drawingCanvas-"+compname);if(null!==canvasElem&&"undefined"!==$.type(canvasElem)&&$(canvasElem).is(":visible")){var imgElem=document.getElementById("img-"+compname),parentWidth=$("#signContainer-"+compname).parent().width(),parentHeight=$("#signContainer-"+compname).parent().height();0==canvasElem.width&&(canvasElem.width=parentWidth,canvasElem.height=parentHeight),imgElem&&$(imgElem).attr("class","signImg signArea")}}function multiSelectTemplateResultHtml(data){if(data&&data.element){var dataEle=jQuery(data.element);if(dataEle&&dataEle.attr("available_val")){var availableVal=dataEle.attr("available_val"),remaining_text=dataEle.closest("select").attr("remaining_text");return(template=$('
()')).find("em[elname=choiceElm]").text(data.text),template.filter("span").attr({title:remaining_text}),template.find("em[elname=remainTextElm]").text(availableVal+" "+remaining_text),template}return(template=$('
')).find("em").text(data.text),template}var template;return(template=$('
')).find("em").text(data.text),template}function setSelect2DropDownHeight(formElem){var selectElem=$(formElem).find(".oneFldDrpDwnSel2");selectElem.length>0&&setSelect2DropDownHeightCommon(formElem,selectElem)}function setSelect2DropDownHeightCommon(formElem,selectElem){var inputElem=$(formElem).find("div[elname=livefield-elem] input.fieldtext:visible:first");if(inputElem.length>0){var outerHeight=$(inputElem[0]).outerHeight(!0),innerHeight=$(inputElem[0]).innerHeight();$(selectElem).each(function(){$(this).outerHeight(outerHeight);var livefieldElem=$(this).closest("div[elname=livefield-elem]");if($(livefieldElem).attr("fldtype")==ZFFieldTypeConstants.MATRIX_CHOICE){var heightForMatrixElem=outerHeight;1==ZFLive.matrixStyleType&&(heightForMatrixElem=innerHeight),$(this).find(".select2-selection__rendered").css("line-height",heightForMatrixElem+"px")}else $(this).find(".select2-selection__rendered").css("line-height",innerHeight+"px")})}else if($("#dummyInputElement").length>0){$("#dummyInputElement").show();var dummyInputElem=$("#dummyInputElement").find("input:visible");if(dummyInputElem.length>0){outerHeight=$(dummyInputElem[0]).outerHeight(!0),innerHeight=$(dummyInputElem[0]).innerHeight();$("#dummyInputElement").hide(),$(selectElem).each(function(){$(this).outerHeight(outerHeight);var livefieldElem=$(this).closest("div[elname=livefield-elem]");$(livefieldElem).attr("fldtype")==ZFFieldTypeConstants.MATRIX_CHOICE?$(this).find(".select2-selection__rendered").css("line-height",outerHeight+"px"):$(this).find(".select2-selection__rendered").css("line-height",innerHeight+"px")})}else $("#dummyInputElement").hide()}}function setMatrixElemHeight(oneFieldSwiperMainDiv){$(oneFieldSwiperMainDiv).find("div[fldtype='"+ZFFieldTypeConstants.MATRIX_CHOICE+"' ]").each(function(){setMatrixHeight($(this))})}function setMatrixElemWidth(formDiv){var matrixChoiceDiv;if((isMobileBrowser()||ZFLive.isResponsiveMode)&&window.visualViewport.width<=480)matrixChoiceDiv=$(formDiv).find("div[fldtype='"+ZFFieldTypeConstants.MATRIX_CHOICE+"' ]");else{if(isMobileBrowser()){var mxCustomWidthDiv=$(formDiv).find("div[fldtype='"+ZFFieldTypeConstants.MATRIX_CHOICE+"' ][isdefaultwidth=false]");$(mxCustomWidthDiv).each(function(){var freezedQnDiv=$(this).find("div[elname='matrixTableQuestionWrap']");$(freezedQnDiv).find("table").css("width","")})}matrixChoiceDiv=$(formDiv).find("div[fldtype='"+ZFFieldTypeConstants.MATRIX_CHOICE+"' ][isdefaultwidth=true]")}$(matrixChoiceDiv).each(function(){resizeMatrixWidth($(this))})}function setMatrixHeight(matrixElem){var matrixFixedQuestionDiv=$(matrixElem).find("div[elname='matrixTableQuestionWrap']"),matrixDiv=$(matrixElem).find("div[elname='matrixTableWrap']");compareAndSetHeightForMatrix($(matrixFixedQuestionDiv).find("table thead tr"),$(matrixDiv).find("table thead tr"));var matrixTbodyElem=$(matrixDiv).find("table tbody");$(matrixFixedQuestionDiv).find("table tbody tr").each(function(index){var rowIndex=index+1,matrixRowElem=$(matrixTbodyElem).find("tr:nth-child("+rowIndex+")");compareAndSetHeightForMatrix($(this),$(matrixRowElem))})}function setMatrixWidth(matrixElem){("true"==$(matrixElem).attr("isdefaultwidth")||(isMobileBrowser()||ZFLive.isResponsiveMode)&&window.visualViewport.width<=480)&&resizeMatrixWidth(matrixElem)}function resizeMatrixWidth(matrixElem){var freezedQnDiv=$(matrixElem).find("div[elname='matrixTableQuestionWrap']"),hiddenQnDiv=$(matrixElem).find("div[elname='matrixTableWrap']");$(freezedQnDiv).hide(),$(hiddenQnDiv).find('th[elname="questionTh"]').show(),$(hiddenQnDiv).find("tbody th").show(),$(freezedQnDiv).find("table").width($(hiddenQnDiv).find('th[elname="questionTh"]').width()),$(freezedQnDiv).show(),$(hiddenQnDiv).find("tbody th").hide(),$(hiddenQnDiv).find('th[elname="questionTh"]').hide()}function compareAndSetHeightForMatrix(elem1,elem2){var offsetHeightOfElem1=$(elem1).height(),offsetHeightOfElem2=$(elem2).height();offsetHeightOfElem10&&!ZFFullPageForm.isCssHasSupported||($(inputElem).val().length>0?$(clearElem).is(":hidden")&&$(clearElem).show():$(clearElem).hide())}function setPreviousValForOnInputValidation(inputElem){var oldValue=$(inputElem).val();$(inputElem).data("zf_old_val",oldValue),$(inputElem).data("zf_eventkey",event.key),$(inputElem).data("start_pos",event.target.selectionStart)}function removeNumberInvalidKeys(inputElem){$(inputElem).val($(inputElem).val())}function validateValOnInput(inputElem){var newVal=$(inputElem).val(),elem=$(inputElem).closest("div[elname=livefield-elem]"),compname=$(elem).attr("compname"),comptype=parseInt($(elem).attr("comptype")),errorIdd="#error-"+compname,constrJson=ZFLive.constraintJson,linkname=$(elem).attr("linkname");if(""!=newVal){if((comptype=parseInt($(elem).attr("comptype")))==ZFFieldTypeConstants.PHONE)validateAndFormatInput_Phone(elem,inputElem,$(elem).find("div[elname=phoneFormatElem]").attr("phoneFormat"),errorIdd);if(typeof constrJson[linkname]!==ResponseKey.UNDEFINED){var dataSpecJson=constrJson[linkname];if(comptype===ZFFieldTypeConstants.NUMBER)validateAndFormatInput_Number(elem,inputElem,dataSpecJson,errorIdd);else if(comptype===ZFFieldTypeConstants.DECIMAL||comptype===ZFFieldTypeConstants.CURRENCY){validateAndFormatInput_Decimal(elem,comptype,inputElem,dataSpecJson,$(elem).attr("decimalformat"),errorIdd)}}}else{if(comptype===ZFFieldTypeConstants.NUMBER){if(null!=event.data&&typeof constrJson[linkname]!==ResponseKey.UNDEFINED){dataSpecJson=constrJson[linkname],newVal=event.data;var numberRegex=/^\d+$/;if(!0===dataSpecJson[DataSpecConst.IS_NEGATIVE]&&(numberRegex=/^-?\d*$/),!numberRegex.test(newVal)){val=$(inputElem).data("zf_old_val");return $(inputElem).val(val),$(errorIdd+"-reconf").hide(),$(errorIdd).text(ZFLiveErrorConstants.numbererror),void animateErrorMsgOF(errorIdd)}if(""!=$(inputElem).data("zf_old_val")){var val=$(inputElem).data("zf_old_val");return $(inputElem).val(val),$(errorIdd+"-reconf").hide(),$(errorIdd).text(ZFLiveErrorConstants.numbererror),void animateErrorMsgOF(errorIdd)}hideErrorOF(elem)}}else comptype==ZFFieldTypeConstants.PHONE&&$(inputElem).val("");animateHideErrorMsgOF(errorIdd)}}function validateAndFormatInput_Number(elem,inputElem,dataSpecJson,errorIdd){var newVal=$(inputElem).val(),numberRegex=/^\d+$/;if(!0===dataSpecJson[DataSpecConst.IS_NEGATIVE]&&(numberRegex=/^-?\d*$/),numberRegex.test(newVal)){var numOfDigits=getNumberOfDigitsInString(newVal),maxLen=18;if(dataSpecJson[DataSpecConst.RANGE_TYPE]===RangeProperty.DIGITS&&(maxLen=dataSpecJson[DataSpecConst.MAX_LEN]),numOfDigits>maxLen){var errMsg=getErrMessageForDigitValidation(numOfDigits,0,maxLen);$(errorIdd+"-reconf").hide(),$(errorIdd).text(errMsg),animateErrorMsgOF(errorIdd);var val=$(inputElem).data("zf_old_val");$(inputElem).val(val)}else hideErrorOF(elem)}else{val=$(inputElem).data("zf_old_val");$(inputElem).val(val),$(errorIdd+"-reconf").hide(),$(errorIdd).text(ZFLiveErrorConstants.numbererror),animateErrorMsgOF(errorIdd)}}function validateAndFormatInput_Decimal(elem,comptype,inputElem,dataSpecJson,decimalFormat,errorIdd){var newVal=$(inputElem).val();if(getDecimalRegxForOnInputValidation(decimalFormat,dataSpecJson[DataSpecConst.IS_NEGATIVE]).test(newVal))hideErrorOF(elem);else{var errMsg;errMsg=comptype==ZFFieldTypeConstants.CURRENCY?ZFUtil.replaceParams(ZFLiveErrorConstants.invalidcurrency,ZFUtil.getDecimalErrorNO(decimalFormat)):ZFUtil.replaceParams(ZFLiveErrorConstants.decimalerror,ZFUtil.getDecimalErrorNO(decimalFormat));$(inputElem).data("start_pos");var val=$(inputElem).data("zf_old_val");$(inputElem).val(val),$(errorIdd).text(errMsg),animateErrorMsgOF(errorIdd)}}function validateAndFormatInput_Phone(elem,inputElem,phoneFormat,errorIdd){var phoneFormatType;if("countrycodeConf"==$(inputElem).attr("elname")){var phoneFldInputElem=$(inputElem).closest('div[elname="phoneFormatElem"]').find('div[elname="phoneFld"] input');phoneFormatType=$(phoneFldInputElem).attr("phoneFormatType"),$(phoneFldInputElem).attr("iscodeEnabled")}else phoneFormatType=$(inputElem).attr("phoneFormatType"),$(inputElem).attr("iscodeEnabled");var regex=/^[\d\(\)\.\-\+ ]*$/,errMsg=ZFLiveErrorConstants.phoneformaterror;phoneFormat===ZFPhoneFormatConstants.USAFORMAT?(regex=/^\d+$/,errMsg=ZFLiveErrorConstants.phoneformatnumeronlyerror):phoneFormatType==ZFPhoneFormatValues.ONLY_NUMERIC&&(regex=/^\d+$/,errMsg=ZFLiveErrorConstants.phoneformatnumeronlyerror);var newVal=$(inputElem).val();if(regex.test(newVal)){if(phoneFormat===ZFPhoneFormatConstants.USAFORMAT){var maxLen=$(inputElem).attr("size");if(getNumberOfDigitsInString(newVal)>maxLen){var start=$(inputElem).data("start_pos"),val=$(inputElem).data("zf_old_val");$(inputElem).val(val),setSelectionRangeFrInputFld(event.target,start,start)}}hideErrorOF(elem)}else{start=$(inputElem).data("start_pos"),val=$(inputElem).data("zf_old_val");$(inputElem).val(val),setSelectionRangeFrInputFld(event.target,start,start),$(errorIdd+"-reconf").hide(),$(errorIdd).text(errMsg),animateErrorMsgOF(errorIdd)}}function getDecimalRegxForOnInputValidation(format,isNegativeValAllowed){return 2==format||3==format?isNegativeValAllowed?/^-?[\d\.\,]*$/:/^[\d\.\,]*$/:4==format?isNegativeValAllowed?/^-?[\d\, ]*$/:/^[\d\, ]*$/:isNegativeValAllowed?/^-?[\d\.]*$/:/^[\d\.]*$/}function isCssSelectorSupportedInBrowser(selector){try{return document.querySelector(selector),!0}catch(error){return!1}}function setSelectionRangeFrInputFld(elem,start,end){"text"===elem.getAttribute("type")&&elem.setSelectionRange(start,end)}function setDatePickerPosition(){if($("#ui-datepicker-div").is(":visible")){var datePickerInst=$.datepicker._curInst;if(null!=datePickerInst&&typeof datePickerInst.id!=ResponseKey.UNDEFINED){var dateInpElem=datePickerInst.id,dateInpOffset=$("#"+dateInpElem).offset(),dateInpElemHeight=$("#"+dateInpElem).outerHeight(!0);datePickerInst.dpDiv.css({top:dateInpOffset.top+dateInpElemHeight,left:dateInpOffset.left})}}}function resetFormComponents(){setTimeout(function(){floatingFormComponentsHandler();var formBodyDiv=$("div[elname=formWrapper]");setMatrixElemWidth(formBodyDiv),setMatrixElemHeight(formBodyDiv),setSelect2DropDownHeight(formBodyDiv);var pageBar=getPageNavTypeContainer();if(pageBar.length>0){initPageHeader();var currentActivePageNum=getCurrentActivePage();selectPage(currentActivePageNum),1!=ZFLive.pageNavType&&3!=ZFLive.pageNavType&&4!=ZFLive.pageNavType||($(pageBar).find("div[elname=pBarContainer]").find("span").removeClass("cur_ActivePage"),$(pageBar).find("div[elname=pBarContainer][pageNum="+currentActivePageNum+"]").find("span").addClass("cur_ActivePage")),1==ZFLive.pageMovementStyle?scollPageNavElemIntoView(currentActivePageNum):moveNextGroup(currentActivePageNum),modifyWidthForPageProgress(currentActivePageNum)}},500)}function floatingFormComponentsHandler(){if(ZFPageAnimation.scrollWindow="html, body",initFloatingComponents(),!(ZFLive.isFormPdf||document.getElementById("resizeform")&&1==document.getElementById("resizeform").value))if(ZFFullPageForm.isFloatingFormComponentsPresent){ZFPageAnimation.scrollWindow="div[elname=formScrollContainer]",$(ZFPageAnimation.scrollWindow).addClass("formScrollContainer");var scrollWindowHeight=$(window).outerHeight(!0)-ZFFullPageForm.floatingFormHeaderHeight;$(ZFPageAnimation.scrollWindow).css("height",Math.floor(scrollWindowHeight)+"px")}else $("div[elname=formScrollContainer]").removeClass("formScrollContainer"),$("div[elname=formScrollContainer]").css("height","")}function initFloatingComponents(){var floatingFormHeader=$("#mainWrapper").children("div[elname=formHeader]:visible");$("#mainWrapper").children("div[elname=pageHdr]:visible");ZFFullPageForm.isFloatingFormHeaderType=$(floatingFormHeader).length>0,ZFFullPageForm.floatingFormHeaderHeight=ZFFullPageForm.isFloatingFormHeaderType?$(floatingFormHeader).outerHeight(!0):0,ZFFullPageForm.isFloatingFormComponentsPresent=!isMobileBrowser()&&ZFFullPageForm.isFloatingFormHeaderType}function isFieldPresentInDOM(fieldlinkname){return $("div[elname=livefield-elem][linkname="+fieldlinkname+"]").length>0}function showSfLiveMoreOption(elem){var currSfRow=$(elem).closest("div[elname=subFormFieldsUl]"),sfLiveMoreList=$(currSfRow).find("div[elname=sfLivemoreList]");$(sfLiveMoreList).is(":visible")||($(sfLiveMoreList).show(),setTimeout(function(){$(document).on("click.sfLiveMoreList",function(e){$(document).off("click.sfLiveMoreList"),$(sfLiveMoreList).hide()}),$(document).on("touch.sfLiveMoreList",function(e){$(document).off("touch.sfLiveMoreList"),$(sfLiveMoreList).hide()})},200))}function initMultiChoiceFields(pageUl){var multipleChoiceFlds=$(pageUl).find("div[elname=livefield-elem][comptype="+ZFFieldTypeConstants.MULTIPLE_CHOICE+"]");$(multipleChoiceFlds).each(function(){var fldDiv=$(this).find("div[elname=zfFieldDiv]"),inpFld=$(fldDiv).find("input");inpFld.length>0&&0==inpFld.width()&&$(fldDiv).find("select").trigger("change.select2")})}function setFocusToMatrixInput(tblTd){$(tblTd).find("input").focus()}function setFocusToMatrixDropDown(tblTd){var target=event.target;$(target).closest(".oneFldDrpDwnSel2").length>0||$(tblTd).find("select").select2("open")}function checkAndAddMiniContClass(){var viewportWidth=window.visualViewport.width;(ZFLive.isMobileMediaLoaded&&viewportWidth>400||!ZFLive.isMobileMediaLoaded)&&addMiniCont420Class(),(ZFLive.isMobileMediaLoaded&&viewportWidth>480||!ZFLive.isMobileMediaLoaded)&&addMiniCont480Class(),(ZFLive.isMobileMediaLoaded&&viewportWidth>580||!ZFLive.isMobileMediaLoaded)&&addMiniCont580Class()}function addMiniCont420Class(){$("#mainWrapper").find("div[elname=formContainer]").width()<=420?$("body").addClass("miniCont420"):$("body").removeClass("miniCont420")}function addMiniCont480Class(){$("#mainWrapper").find("div[elname=formContainer]").width()<=480?$("body").addClass("miniCont480"):$("body").removeClass("miniCont480")}function addMiniCont580Class(){var containerWidth=$("#mainWrapper").find("div[elname=formContainer]").width();481<=containerWidth&&containerWidth<=580?$("body").addClass("miniCont580"):$("body").removeClass("miniCont580")}function animatePageNavigation(animCompleteResolve,fromPageNo,toPageNo){defaultNavAnim(animCompleteResolve,fromPageNo,toPageNo)}function defaultNavAnim(animCompleteResolve,fromPageNo,toPageNo){var formDiv=$("div[elname=formWrapper]"),currPageFormContainer=$(formDiv).find("div[elname=formBodyULName][page_no="+fromPageNo+"]"),currPageFormFooter=$(formDiv).find("div[elname=footer][page_no="+fromPageNo+"]"),toPageFormContainer=$(formDiv).find("div[elname=formBodyULName][page_no="+toPageNo+"]"),toPageFormFooter=$(formDiv).find("div[elname=footer][page_no="+toPageNo+"]");$("div#screenFreezeDiv").show(),movePageProgress(fromPageNo,toPageNo),animatePageNavbar(fromPageNo,toPageNo),$(currPageFormFooter).hide(),$(currPageFormContainer).hide(),$(toPageFormFooter).show(),$(toPageFormContainer).fadeIn(400,function(){$("div#screenFreezeDiv").hide()}),animCompleteResolve()}function animatePageNavbar(fromPageNo,toPageNo){1==ZFLive.pageMovementStyle?scollPageNavElemIntoView(toPageNo):fromPageNoZFPageTitle.endPageHeader&&moveNextGroup(prevPageNo));var currPageHeader=prevPageNo;currPageHeader==ZFPageTitle.startPageHeader?ZFPageTitle.hiddenLeft>0&&movePrev(prevPageNo):currPageHeaderZFPageTitle.endPageHeader+1&&moveNextGroup(nextPageNo));var currPageHeader=nextPageNo;currPageHeader==ZFPageTitle.endPageHeader?ZFPageTitle.hiddenRight>0&&moveNext(nextPageNo):currPageHeader>ZFPageTitle.endPageHeader&&moveNext(nextPageNo),selectPage(nextPageNo),modifyWidthForPageProgress(nextPageNo)}function animateSubformPopupDone(sfPopUp,sfCardElem,ulElem,subFormLi,prevRowId){var sfPopupCont=$("#subFormPopUpCont");$(sfPopupCont).find("#sFPopUpCloseLink").hide(),$(sfCardElem).css("opacity","0").show();var sfCardInnerElem=$(sfCardElem).find('div[elname="sfCardInnerElem"]'),animTime=ZFPageAnimation.pageFadeInSpeed,sfCardElemBoundingRect=$(sfCardInnerElem)[0].getBoundingClientRect();new Promise(function(resolve,reject){$("#screenFreezeDiv").show(),$(sfPopupCont).css({"overflow-y":"hidden",opacity:"1"}),$(sfPopupCont).animate({opacity:"0.7"},{duration:animTime/2,start:function(){$(sfCardInnerElem).css({height:"10px"}).show()},complete:function(){$(sfPopupCont).animate({top:Math.ceil(sfCardElemBoundingRect.top)+"px",left:Math.ceil(sfCardElemBoundingRect.left)+"px",width:Math.ceil(sfCardElemBoundingRect.width)+"px",height:Math.ceil(sfCardElemBoundingRect.height)+"px","margin-top":"0px","margin-bottom":"0px"},{duration:animTime/2,start:function(){$("div[elname=formContainer]").animate({opacity:"1"},animTime/2),$(sfPopupCont).animate({opacity:"0"},animTime/2),$(sfPopupCont).find("div[elname=sfPopupBodyContainer]").animate({opacity:"0"},animTime/2)},complete:function(){$("#subFormPopUp").fadeOut("fast"),$(sfCardInnerElem).css({transition:animTime+"ms",height:""}),$(sfCardElem).css({transition:animTime+"ms",opacity:""}),$("body").removeClass("hideWindowScroll"),$(ulElem).addClass("subFormHorizontal"),$(ulElem).insertAfter($(subFormLi).find('div[rowid="'+prevRowId+'"]')),$(sfPopUp).css("overflow-y","scroll"),$(sfPopupCont).find("#sFPopUpCloseLink").show(),ZFLive.isSFPopUpEnterTriggered=!1,setTimeout(function(){resolve()},animTime/3)}})}})}).then(function(){setTimeout(function(){$(sfCardInnerElem).css({transition:""}),$(sfCardElem).css({transition:""}),subformPopupResetAnimStyles(),$("#screenFreezeDiv").hide()},animTime)})}function subformPopupResetAnimStyles(){var sfPopupCont=$("#subFormPopUpCont");$(sfPopupCont).css({position:"",opacity:"",top:"",left:"",height:"",width:"","margin-top":"","margin-bottom":"","backdrop-filter":"","-webkit-backdrop-filter":"","overflow-y":""})}function bindVisibilityEventOnFormVisible(){document.getElementById("resizeform")&&1==document.getElementById("resizeform").value&&!document.body.offsetWidth&&window.addEventListener("resize",triggerFormResizeAndUnbindEvent)}function triggerFormResizeAndUnbindEvent(){document.body.offsetWidth&&(triggerFormResize(),window.removeEventListener("resize",triggerFormResizeAndUnbindEvent))}function initPageHeader(isFormLoad){var pageBar=getPageNavTypeContainer();if(pageBar.length>0){ZFPageTitle={pageWidth:[0],prefixPageWidth:[0],startPageHeader:1,endPageHeader:0,hiddenLeft:0,hiddenRight:0,translate:0,pgTitleBarWidth:$(pageBar).find("div[elname=pageRowContainer]").outerWidth(!0),direction:isRTLform()?-1:1,progressEnabled:!1},storePgBarContainerWidth();var totalPgTitleElemWidth=ZFPageTitle.prefixPageWidth[ZFPageTitle.prefixPageWidth.length-1];ZFPageTitle.pgTitleBarWidth>=totalPgTitleElemWidth?(ZFPageTitle.endPageHeader=ZFPageTitle.startPageHeader=1,$(pageBar).addClass("pageCenter"),$(pageBar).find("div[elname=prevBar], div[elname=nextBar]").removeClass("pageNavDisable").css("visibility","hidden")):($(pageBar).removeClass("pageCenter"),2==ZFLive.pageMovementStyle&&initPageHeaderCarousel(isFormLoad)),isLineTypePageModel()&&setInitialPageProgress()}}function storePgBarContainerWidth(){var pageBar=getPageNavTypeContainer();$(pageBar).find("div[elname=prevBar]").addClass("pageNavDisable");var pageBarContainers=$(pageBar).find("div[elname=pBarContainer]");$(pageBarContainers).each(function(index,elem){var currPgTitleElemWidth=$(elem).outerWidth(!0);ZFPageTitle.pageWidth.push(currPgTitleElemWidth);var prevPgTitleElemWidth=ZFPageTitle.prefixPageWidth[ZFPageTitle.prefixPageWidth.length-1];ZFPageTitle.prefixPageWidth.push(prevPgTitleElemWidth+currPgTitleElemWidth)})}function initPageHeaderCarousel(isFormLoad){var pageBar=getPageNavTypeContainer(),pageBarContainers=$(pageBar).find("div[elname=pBarContainer]"),lastActivePage=getCurrentActivePage();if($(pageBar).find("div[elname=prevBar]").addClass("pageNavDisable"),isMobileDeviceForPageNavigation())ZFPageTitle.endPageHeader=ZFPageTitle.startPageHeader=1;else{for(;ZFPageTitle.endPageHeader15)&&($(pageBar).find("div[elname=nextBar]").removeClass("pageNavDisable"),$(pageBar).find("div[elname=navigBar]").css("justify-content","start"),ZFPageTitle.progressEnabled=!0,$(pageBar).find("div[elname=prevBar], div[elname=nextBar]").css("visibility","visible")),!isFormLoad&&!ZFLive.isThemePage){if(ZFPageTitle.progressEnabled)moveNextGroup(lastActivePage);else{var elem=$(pageBar).find("div[elname=pBarContainer][pagenum="+lastActivePage+"]");elem.length>0&&$(elem)[0].scrollIntoView({behavior:"auto",inline:"end"})}modifyWidthForPageProgress(lastActivePage)}}function setInitialPageProgress(){var pageBar=getPageNavTypeContainer(),pageBarContainers=$(pageBar).find("div[elname=pBarContainer]");if(2==ZFLive.pageMovementStyle&&isMobileDeviceForPageNavigation()){var pageSize=ZFPageTitle.prefixPageWidth.length,width=ZFPageTitle.prefixPageWidth[pageSize-1];$(pageBar).find("em[elname=pageBarLine]").css("width",width+"px"),$(pageBar).find("em[elname=pageBarLineProgress]").css("transition","width 700ms"),modifyWidthForPageProgress(1)}else{pageSize=ZFPageTitle.prefixPageWidth.length,width=ZFPageTitle.prefixPageWidth[pageSize-1];width-=ZFPageTitle.pageWidth[1]/2,width-=ZFPageTitle.pageWidth[pageSize-1]/2,$(pageBar).find("div#navigBar")[0].scrollLeft=0;var firstChild=$(pageBarContainers[0])[0],parent=$(pageBar).find("div[elname=navigBar]")[0],widthBtnChildParent=isRTLform()?parent.getBoundingClientRect().right-firstChild.getBoundingClientRect().right:firstChild.getBoundingClientRect().x-parent.getBoundingClientRect().x;$(pageBar).find("em[elname=pageBarLine]").css("width",width+"px"),$(pageBar).find("em[elname=pageBarLineProgress]").css("transition","width 700ms"),$(pageBar).find("em[elname=pageBarLine], em[elname=pageBarLineProgress]").css(isRTLform()?"right":"left",widthBtnChildParent+ZFPageTitle.pageWidth[1]/2)}}function scollPageNavElemIntoView(page){var pageBar=getPageNavTypeContainer();if(pageBar.length>0){var halfFormWidth=$("div[elname=formContainer]").width()/2,halfPageBarContainerWidth=ZFPageTitle.pageWidth[page]/2,scrollToLeft=ZFPageTitle.prefixPageWidth[page]-halfFormWidth-halfPageBarContainerWidth;isRTLform()&&(scrollToLeft*=-1);var navigBar=$(pageBar).find("div#navigBar");$(navigBar).animate({scrollLeft:scrollToLeft},ZFPageAnimation.pageNavbarAnimTime),selectPage(page),modifyWidthForPageProgress(page)}}function moveNext(page){var pageBar=getPageNavTypeContainer();if(ZFPageTitle.progressEnabled&&$(pageBar).find("div[elname=prevBar]").removeClass("pageNavDisable"),addTransitionToNavigBar(),isMobileDeviceForPageNavigation())return typeof page==ResponseKey.UNDEFINED?(ZFPageTitle.startPageHeader++,ZFPageTitle.endPageHeader++):ZFPageTitle.startPageHeader=ZFPageTitle.endPageHeader=page,ZFPageTitle.translate-=ZFPageTitle.pageWidth[ZFPageTitle.endPageHeader-1],void $(pageBar).find("div[elname=navigBar]").css("transform","translateX("+ZFPageTitle.translate*ZFPageTitle.direction+"px)");for(0!=ZFPageTitle.hiddenRight?(ZFPageTitle.translate-=ZFPageTitle.hiddenRight,$(pageBar).find("div[elname=navigBar]").css("transform","translateX("+ZFPageTitle.translate*ZFPageTitle.direction+"px)")):(ZFPageTitle.translate-=ZFPageTitle.pageWidth[++ZFPageTitle.endPageHeader],$(pageBar).find("div[elname=navigBar]").css("transform","translateX("+ZFPageTitle.translate*ZFPageTitle.direction+"px)")),ZFPageTitle.hiddenRight=0;ZFPageTitle.prefixPageWidth[ZFPageTitle.endPageHeader]-ZFPageTitle.prefixPageWidth[ZFPageTitle.startPageHeader]>ZFPageTitle.pgTitleBarWidth;)ZFPageTitle.startPageHeader++;ZFPageTitle.hiddenLeft=ZFPageTitle.prefixPageWidth[ZFPageTitle.endPageHeader]-ZFPageTitle.prefixPageWidth[ZFPageTitle.startPageHeader-1]-ZFPageTitle.pgTitleBarWidth,ZFPageTitle.endPageHeader==ZFPageTitle.prefixPageWidth.length-1&&0==ZFPageTitle.hiddenRight&&$(pageBar).find("div[elname=prevBar]").addClass("pageNavDisable"),removeTransitionToNavigBar()}function movePrev(page){var pageBar=getPageNavTypeContainer();if(ZFPageTitle.progressEnabled&&$(pageBar).find("div[elname=nextBar]").removeClass("pageNavDisable"),addTransitionToNavigBar(),isMobileDeviceForPageNavigation()){typeof page==ResponseKey.UNDEFINED?(ZFPageTitle.startPageHeader--,ZFPageTitle.endPageHeader--):ZFPageTitle.startPageHeader=ZFPageTitle.endPageHeader=page;var elem=$(pageBar).find("div[elname=pBarContainer][pagenum="+ZFPageTitle.endPageHeader+"]");elem.length>0&&$(elem)[0].scrollIntoView({behavior:"auto",inline:"start"})}else{for(0!=ZFPageTitle.hiddenLeft?(ZFPageTitle.translate+=ZFPageTitle.hiddenLeft,$(pageBar).find("div[elname=navigBar]").css("transform","translateX("+ZFPageTitle.translate*ZFPageTitle.direction+"px)")):(ZFPageTitle.translate+=ZFPageTitle.pageWidth[--ZFPageTitle.startPageHeader],$(pageBar).find("div[elname=navigBar]").css("transform","translateX("+ZFPageTitle.translate*ZFPageTitle.direction+"px)")),ZFPageTitle.hiddenLeft=0;ZFPageTitle.prefixPageWidth[ZFPageTitle.endPageHeader-1]-ZFPageTitle.prefixPageWidth[ZFPageTitle.startPageHeader-1]>ZFPageTitle.pgTitleBarWidth;)ZFPageTitle.endPageHeader--;ZFPageTitle.hiddenRight=ZFPageTitle.prefixPageWidth[ZFPageTitle.endPageHeader]-ZFPageTitle.prefixPageWidth[ZFPageTitle.startPageHeader-1]-ZFPageTitle.pgTitleBarWidth,1==ZFPageTitle.startPageHeader&&0==ZFPageTitle.hiddenLeft&&$(pageBar).find("div[elname=prevBar]").addClass("pageNavDisable"),removeTransitionToNavigBar()}}function modifyWidthForPageProgress(page){if((pageBar=getPageNavTypeContainer()).length>0&&isLineTypePageModel()){var width=0;2==ZFLive.pageMovementStyle&&isMobileDeviceForPageNavigation()?width=ZFPageTitle.prefixPageWidth[page]:(width=ZFPageTitle.prefixPageWidth[page],width-=ZFPageTitle.pageWidth[1]/2,width-=ZFPageTitle.pageWidth[page]/2);var pageBar=getPageNavTypeContainer();$(pageBar).find("em[elname=pageBarLineProgress]").css("width",width+"px")}}function moveNextGroup(page){addTransitionToNavigBar();var pageBar=getPageNavTypeContainer();if(1!=page?$(pageBar).find("div[elname=prevBar]").removeClass("pageNavDisable"):$(pageBar).find("div[elname=prevBar]").addClass("pageNavDisable"),typeof page!=ResponseKey.UNDEFINED&&(ZFPageTitle.endPageHeader=page,ZFPageTitle.hiddenRight=0),isMobileDeviceForPageNavigation())typeof page==ResponseKey.UNDEFINED?(ZFPageTitle.startPageHeader++,ZFPageTitle.endPageHeader++):ZFPageTitle.startPageHeader=ZFPageTitle.endPageHeader=page,ZFPageTitle.translate-=ZFPageTitle.pageWidth[ZFPageTitle.endPageHeader-1],$(pageBar).find("div[elname=navigBar]").css("transform","translateX("+ZFPageTitle.translate*ZFPageTitle.direction+"px)");else if(ZFPageTitle.prefixPageWidth[ZFPageTitle.prefixPageWidth.length-1]-ZFPageTitle.prefixPageWidth[ZFPageTitle.endPageHeader-1]=0&&ZFPageTitle.prefixPageWidth[ZFPageTitle.endPageHeader]-ZFPageTitle.prefixPageWidth[ZFPageTitle.startPageHeader-1]0){if(modifyWidthForPageProgress(toPageNo),1==ZFLive.pageMovementStyle?scollPageNavElemIntoView(toPageNo):isMobileDeviceForPageNavigation()?movePrev(toPageNo):(ZFPageTitle.startPageHeader>=toPageNo||ZFPageTitle.endPageHeader<=toPageNo)&&moveNextGroup(toPageNo),1==ZFLive.pageNavType||3==ZFLive.pageNavType||4==ZFLive.pageNavType){var pageBar=getPageNavTypeContainer();$(pageBar).find("div[elname=pBarContainer][pageNum="+fromPageNo+"]").find("span").removeClass("cur_ActivePage"),$(pageBar).find("div[elname=pBarContainer][pageNum="+toPageNo+"]").find("span").addClass("cur_ActivePage")}4==ZFLive.pageNavType&&($("div.pageTitleCont").find("p[pagenum="+fromPageNo+"]").hide(),$("div.pageTitleCont").find("p[pagenum="+toPageNo+"]").show())}}function getPageNavTypeContainer(){var pageNavType=ZFLive.pageNavType;return $(ZFLive.formFormFieldsOuterWrapper).children("div[elname=pageHdr]:visible").length>0?$(ZFLive.formFormFieldsOuterWrapper).find("div[navigtype="+pageNavType+"]"):$("div[navigtype="+pageNavType+"]").first()}function isMobileDeviceForPageNavigation(){return isMobileBrowser()||window.visualViewport.width<=480}function reInitPageHeader(){var pageBar=getPageNavTypeContainer();if($(pageBar).find("div[elname=pageRowContainer]").outerWidth(!0)>0){initPageHeader();var currentActivePageNum=getCurrentActivePage();scollPageNavElemIntoView(currentActivePageNum),modifyWidthForPageProgress(currentActivePageNum),window.removeEventListener("resize",reInitPageHeader)}}function bindEvntToPageNavBarOnFormLoad(){var pageBar=getPageNavTypeContainer();$(pageBar).find("div[elname=pageRowContainer]").outerWidth(!0);pageBar.length>0&&window.addEventListener("resize",reInitPageHeader)}function isLineTypePageModel(){return 1==ZFLive.pageNavType||3==ZFLive.pageNavType||5==ZFLive.pageNavType||6==ZFLive.pageNavType||7==ZFLive.pageNavType||8==ZFLive.pageNavType||9==ZFLive.pageNavType||10==ZFLive.pageNavType||11==ZFLive.pageNavType}function isMobileBrowser_tp(){var a,check=!1;return a=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))&&(check=!0),!!check||("ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0)}function initCustomSelect2Adapters(){function focusSelecltedItemCommon(dropdown){var $highlighted=dropdown.find(".select2-results__option--highlighted");if(0!==$highlighted.length){var $options=dropdown.find("[aria-selected]"),ulElem=dropdown.find("ul:first"),currentIndex=$options.index($highlighted),currentOffset=ulElem.offset().top,nextTop=$highlighted.offset().top,nextOffset=ulElem.scrollTop()+(nextTop-currentOffset),offsetDelta=nextTop-currentOffset;nextOffset-=2*$highlighted.outerHeight(!1),currentIndex<=2?ulElem.scrollTop(0):(offsetDelta>ulElem.outerHeight()||offsetDelta<0)&&ulElem.scrollTop(nextOffset)}}function positionDropdownCommon(self){var $window=$(window),isCurrentlyAbove=self.$dropdown.hasClass("select2-dropdown--above"),isCurrentlyBelow=self.$dropdown.hasClass("select2-dropdown--below"),newDirection=null,offset=self.$container.offset();offset.bottom=offset.top+self.$container.outerHeight(!1);var container={height:self.$container.outerHeight(!1)};container.top=offset.top,container.bottom=offset.top+container.height;var dropdown_height=self.$dropdown.outerHeight(!1),viewport_top=$window.scrollTop(),viewport_bottom=$window.scrollTop()+$window.height(),enoughRoomAbove=viewport_topoffset.bottom+dropdown_height,css={left:offset.left,top:container.bottom},$offsetParent=self.$dropdownParent;"static"===$offsetParent.css("position")&&($offsetParent=$offsetParent.offsetParent());var parentOffset=$offsetParent.offset();css.top-=parentOffset.top,css.left-=parentOffset.left;var dropdownPosition=self.options.get("dropdownPosition");"above"===dropdownPosition||"below"===dropdownPosition?newDirection=dropdownPosition:(isCurrentlyAbove||isCurrentlyBelow||(newDirection="below"),enoughRoomBelow||!enoughRoomAbove||isCurrentlyAbove?!enoughRoomAbove&&enoughRoomBelow&&isCurrentlyAbove&&(newDirection="below"):newDirection="above"),("above"==newDirection||isCurrentlyAbove&&"below"!==newDirection)&&(css.top=container.top-parentOffset.top-dropdown_height),null!=newDirection&&(self.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+newDirection),self.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+newDirection)),self.$dropdownContainer.css(css)}$.fn.select2.amd.define("ZFLive_BaseSelection",["select2/selection/base","select2/utils","select2/keys"],function(BaseSelection,Utils,KEYS){function ZFLive_BaseSelection($element,options){ZFLive_BaseSelection.__super__.constructor.call(this,$element,options)}return Utils.Extend(ZFLive_BaseSelection,BaseSelection),ZFLive_BaseSelection.prototype.bind=function(container,$container){var self=this,resultsId=(container.id,container.id+"-results");this.container=container,this.$selection.on("focus",function(evt){self.trigger("focus",evt)}),this.$selection.on("blur",function(evt){self._handleBlur(evt)}),this.$selection.on("keydown",function(evt){self.trigger("keypress",evt),evt.which===KEYS.SPACE&&evt.preventDefault()}),container.on("results:focus",function(params){self.$selection.attr("aria-activedescendant",params.data._resultId)}),container.on("selection:update",function(params){self.update(params.data)}),container.on("open",function(){self.$selection.attr("aria-expanded","true"),self.$selection.attr("aria-owns",resultsId),self._attachCloseHandler(container)}),container.on("close",function(){self.$selection.attr("aria-expanded","false"),self.$selection.removeAttr("aria-activedescendant"),self.$selection.removeAttr("aria-owns"),self._detachCloseHandler(container)}),container.on("enable",function(){self.$selection.attr("tabindex",self._tabindex)}),container.on("disable",function(){self.$selection.attr("tabindex","-1")})},ZFLive_BaseSelection}),$.fn.select2.amd.define("ZFLive_Sel_dropdownAdapter",["select2/utils","select2/dropdown","select2/dropdown/search","select2/dropdown/attachBody","select2/dropdown/closeOnSelect","select2/compat/dropdownCss"],function(Utils,Dropdown,DropdownSearch,AttachBody,CloseOnSelect,DropdownCSS){function ZFLive_Sel_DropdownSearch(){ZFLive_Sel_DropdownSearch.__super__.constructor.call(this)}Utils.Extend(ZFLive_Sel_DropdownSearch,DropdownSearch),ZFLive_Sel_DropdownSearch.prototype.render=function(decorated){var $rendered=decorated.call(this),$search=$(' ');return this.$searchContainer=$search,this.$search=$search.find("input"),$rendered.prepend($search),$rendered},ZFLive_Sel_DropdownSearch.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),this.$search.on("keydown",function(evt){self.trigger("keypress",evt),self._keyUpPrevented=evt.isDefaultPrevented()}),this.$search.on("input",function(evt){$(this).off("keyup")}),this.$search.on("keyup input",function(evt){self.handleSearch(evt)}),container.on("open",function(){self.$search.attr("tabindex",0),isMobileBrowser_tp()||(self.$search.focus(),window.setTimeout(function(){self.$search.focus()},0))}),container.on("close",function(){self.$search.attr("tabindex",-1),self.$search.val("")}),container.on("focus",function(){if(container.isOpen()){if(isMobileBrowser_tp())return;self.$search.focus()}}),container.on("results:all",function(params){null!=params.query.term&&""!==params.query.term||(self.showSearch(params)?self.$searchContainer.removeClass("select2-search--hide"):self.$searchContainer.addClass("select2-search--hide"))})};let adapter=Utils.Decorate(Dropdown,ZFLive_Sel_DropdownSearch);function ZFLive_Sel_AttachBody(decorated,$element,options){ZFLive_Sel_AttachBody.__super__.constructor.call(this,decorated,$element,options)}return adapter=Utils.Decorate(adapter,DropdownCSS),Utils.Extend(ZFLive_Sel_AttachBody,AttachBody),ZFLive_Sel_AttachBody.prototype._showDropdown=function(decorated){this.$dropdownContainer.appendTo(this.$dropdownParent);let conatiner=this.$dropdownContainer,dropdownElem=$(conatiner).find(".select2-dropdown");this._positionDropdown(),this._resizeDropdown(),$(dropdownElem).css("opacity","0");let selAdap=this;setTimeout(function(){$(dropdownElem).css("opacity","1"),$(dropdownElem).hide();let selAdap1=selAdap;dropdownElem.hasClass("select2-dropdown--above")?$(dropdownElem).show("slide",{direction:"down",complete:function(){selAdap1.focusSelecltedItem()},duration:ZFFullPageForm.menuItemsSpeed}):$(dropdownElem).slideDown({complete:function(){selAdap1.focusSelecltedItem()},duration:ZFFullPageForm.menuItemsSpeed})})},ZFLive_Sel_AttachBody.prototype.focusSelecltedItem=function(){isMobileBrowser_tp()||this.$search.focus(),focusSelecltedItemCommon(this.$dropdown)},ZFLive_Sel_AttachBody.prototype._hideDropdown=function(decorated){let conatiner=this.$dropdownContainer,dropdownElem=$(conatiner).find(".select2-dropdown"),selAdap=this;var prevHeightVal;dropdownElem.hasClass("select2-dropdown--above")?$(dropdownElem).animate({height:"0px"},{duration:ZFFullPageForm.inputClearAnimationSpeed,complete:function(){$(dropdownElem).css("height",""),$(conatiner).detach(),selAdap.$element.removeClass("zfs2_open")},step:function(now,fx){if(prevHeightVal!=undefined){var heightDiff=prevHeightVal-now,currentTop=parseFloat(conatiner.css("top"))+heightDiff;conatiner.css("top",currentTop+"px")}prevHeightVal=now}}):$(dropdownElem).slideUp({complete:function(){$(conatiner).detach(),selAdap.$element.removeClass("zfs2_open")},duration:ZFFullPageForm.menuItemsSpeed})},adapter=Utils.Decorate(adapter,ZFLive_Sel_AttachBody),adapter=Utils.Decorate(adapter,CloseOnSelect)}),$.fn.select2.amd.define("ZFLive_Sel_dropdownAdapter_without_search",["select2/utils","ZFLive_Sel_dropdownAdapter","select2/dropdown/minimumResultsForSearch"],function(Utils,CutDropdown,MinimumResultsForSearch){return Utils.Decorate(CutDropdown,MinimumResultsForSearch)}),$.fn.select2.amd.define("ZFLive_Sel_dataAdapter",["select2/utils","select2/data/select"],function(Utils,SelectData){function ZFLive_Sel_SelectAdapter($element,options){ZFLive_Sel_SelectAdapter.__super__.constructor.call(this,$element,options)}return Utils.Extend(ZFLive_Sel_SelectAdapter,SelectData),ZFLive_Sel_SelectAdapter.prototype.current=function(callback){var data=[],self=this;null!=this.$element.val()&&""!=this.$element.val()&&"-Select-"!=this.$element.val()&&this.$element.find(":selected").each(function(){var $option=$(this),option=self.item($option);data.push(option)}),callback(data)},ZFLive_Sel_SelectAdapter}),$.fn.select2.amd.define("ZFLive_Sel_SingleSelection",["jquery","ZFLive_BaseSelection","select2/utils","select2/keys"],function($,BaseSelection,Utils,KEYS){function ZFLive_Sel_SingleSelection(){ZFLive_Sel_SingleSelection.__super__.constructor.apply(this,arguments)}return Utils.Extend(ZFLive_Sel_SingleSelection,BaseSelection),ZFLive_Sel_SingleSelection.prototype.render=function(){var $selection=ZFLive_Sel_SingleSelection.__super__.render.call(this);return $selection.addClass("select2-selection--single"),$selection.html(''),$selection},ZFLive_Sel_SingleSelection.prototype.bind=function(container,$container){var self=this;ZFLive_Sel_SingleSelection.__super__.bind.apply(this,arguments);var id=container.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",id),this.$selection.attr("aria-labelledby",id),this.$selection.on("mousedown",function(evt){1===evt.which&&self.trigger("toggle",{originalEvent:evt})}),this.$selection.on("focus",function(evt){}),this.$selection.on("blur",function(evt){}),container.on("focus",function(evt){container.isOpen()||self.$selection.focus()}),container.on("selection:update",function(params){self.update(params.data)})},ZFLive_Sel_SingleSelection.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},ZFLive_Sel_SingleSelection.prototype.display=function(data,container){var template=this.options.get("templateSelection");return this.options.get("escapeMarkup")(template(data,container))},ZFLive_Sel_SingleSelection.prototype.selectionContainer=function(){return $("")},ZFLive_Sel_SingleSelection.prototype.update=function(data){if(0!==data.length){var selection=data[0],$rendered=this.$selection.find(".select2-selection__rendered"),formatted=this.display(selection,$rendered);$rendered.empty().append(formatted),$rendered.prop("title",selection.title||selection.text)}else this.clear()},ZFLive_Sel_SingleSelection}),$.fn.select2.amd.define("ZFLive_Sel_selectionAdapter",["select2/utils","ZFLive_Sel_SingleSelection","select2/selection/placeholder","select2/selection/allowClear","select2/selection/eventRelay","select2/compat/containerCss"],function(Utils,SingleSelection,Placeholder,AllowClear,EventRelay,ContainerCSS){let adapter=SingleSelection;function ZFLive_Sel_Placeholder(decorated,$element,options){ZFLive_Sel_Placeholder.__super__.constructor.call(this,decorated,$element,options)}function ZFLive_Sel_AllowClear(){ZFLive_Sel_AllowClear.__super__.constructor.call()}return Utils.Extend(ZFLive_Sel_Placeholder,Placeholder),ZFLive_Sel_Placeholder.prototype.update=function(decorated,data){var singlePlaceholder=1==data.length&&data[0].id!=this.placeholder.id;if(data.length>1||singlePlaceholder)return decorated.call(this,data);this.clear();var $placeholder=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__arrow").show(),this.$selection.find(".select2-selection__rendered").append($placeholder)},Utils.Extend(ZFLive_Sel_AllowClear,AllowClear),ZFLive_Sel_AllowClear.prototype.update=function(decorated,data){if(decorated.call(this,data),!(this.$selection.find(".select2-selection__placeholder").length>0||0===data.length)){var $remove=$('');$remove.data("data",data),this.$selection.find(".select2-selection__arrow").hide(),this.$selection.find(".select2-selection__rendered").prepend($remove)}},ZFLive_Sel_AllowClear.prototype._handleClear=function(_,evt){if(!this.options.get("disabled")){var $clear=this.$selection.find(".select2-selection__clear");if(0!==$clear.length){evt.stopPropagation();for(var data=$clear.data("data"),d=0;d0&&inpCaretDiv.length>0?isMobileBrowser_tp()?($(inpCaretDiv).hide(),this.$element.val(this.placeholder.id).trigger("change")):this.animateSelectInputCaret($(inpElem),$(inpCaretDiv)):this.$element.val(this.placeholder.id).trigger("change")},ZFLive_Sel_AllowClear.prototype.animateSelectInputCaret=function(_,inpElem,inpCaretDiv){var inpValue=$(inpElem).text(),inpLen=inpValue.length,inpElemWidth=$(inpElem).width();$(inpCaretDiv).css({width:inpElemWidth+"px"});var self=this;$(inpCaretDiv).animate({width:"0px"},{duration:ZFFullPageForm.inputClearAnimationSpeed,complete:function(){$(inpCaretDiv).hide(),self.$element.val(self.placeholder.id).trigger("change")},step:function(now,fx){var animatePos=Math.floor(100*fx.pos),txtCutOffPos=Math.floor(inpLen-inpLen*(animatePos/100))-1;txtCutOffPos<0&&(txtCutOffPos=0);var newVal=inpValue.substring(0,txtCutOffPos);$(inpElem).text(newVal)}})},adapter=Utils.Decorate(adapter,ZFLive_Sel_Placeholder),adapter=Utils.Decorate(adapter,ZFLive_Sel_AllowClear),adapter=Utils.Decorate(adapter,ContainerCSS),adapter=Utils.Decorate(adapter,EventRelay)}),$.fn.select2.amd.define("ZFLive_Sel_resultsAdapter",["select2/utils","select2/results","select2/dropdown/hidePlaceholder"],function(Utils,ResultsList,HidePlaceholder){function ZFLive_Sel_Results($element,options,dataAdapter){ZFLive_Sel_Results.__super__.constructor.call(this,$element,options,dataAdapter)}return Utils.Extend(ZFLive_Sel_Results,ResultsList),ZFLive_Sel_Results.prototype.append=function(data){this.hideLoading();var $options=[];if(null!=data.results&&0!==data.results.length){if(1===data.results.length)if((value=(item=data.results[0]).id)!=undefined&&"string"==typeof value&&item.element&&"zf-select-zf"===$(item.element).attr("zfs2_value"))return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));data.results=this.sort(data.results);for(var d=0;d=$options.length)){var $next=$options.eq(nextIndex);$next.trigger("mouseenter");var currentOffset=self.$results.offset().top+self.$results.outerHeight(!1),nextBottom=$next.offset().top+$next.outerHeight(!1),nextOffset=self.$results.scrollTop()+nextBottom-currentOffset;0===nextIndex?self.$results.scrollTop(0):nextBottom>currentOffset&&self.$results.scrollTop(nextOffset)}}),container.on("results:focus",function(params){params.element.addClass("select2-results__option--highlighted")}),container.on("results:message",function(params){self.displayMessage(params)}),$.fn.mousewheel&&this.$results.on("mousewheel",function(e){var top=self.$results.scrollTop(),bottom=self.$results.get(0).scrollHeight-top+e.deltaY,isAtTop=e.deltaY>0&&top-e.deltaY<=0,isAtBottom=e.deltaY<0&&bottom<=self.$results.height();isAtTop?(self.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):isAtBottom&&(self.$results.scrollTop(self.$results.get(0).scrollHeight-self.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(evt){var $this=$(this),data=$this.data("data");"true"!==$this.attr("aria-selected")?($this.addClass("optSelHighlight"),self.trigger("select",{originalEvent:evt,data:data})):self.options.get("multiple")?self.trigger("unselect",{originalEvent:evt,data:data}):self.trigger("close",{})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(evt){var data=$(this).data("data");self.getHighlightedResults().removeClass("select2-results__option--highlighted"),self.trigger("results:focus",{data:data,element:$(this)})})},ZFLive_Sel_Results.prototype.highlightFirstItem=function(){var $selected=this.$results.find(".select2-results__option[aria-selected]").filter("[aria-selected=true]");$selected.length>0&&$selected.first().trigger("mouseenter"),this.ensureHighlightVisible()},Utils.Decorate(ZFLive_Sel_Results,HidePlaceholder)}),$.fn.select2.amd.define("ZFLive_Sel_MultipleSelection",["jquery","ZFLive_BaseSelection","select2/utils"],function($,BaseSelection,Utils){function ZFLive_Sel_MultipleSelection($element,options){ZFLive_Sel_MultipleSelection.__super__.constructor.apply(this,arguments)}return Utils.Extend(ZFLive_Sel_MultipleSelection,BaseSelection),ZFLive_Sel_MultipleSelection.prototype.render=function(){var $selection=ZFLive_Sel_MultipleSelection.__super__.render.call(this);return $selection.addClass("select2-selection--multiple"),$selection.html('
    '),$selection},ZFLive_Sel_MultipleSelection.prototype.bind=function(container,$container){var self=this;ZFLive_Sel_MultipleSelection.__super__.bind.apply(this,arguments),this.$selection.on("click",function(evt){self.trigger("toggle",{originalEvent:evt})}),this.$selection.on("click",".select2-selection__choice__remove",function(evt){if(!self.options.get("disabled")){var data=$(this).parent().data("data");self.trigger("unselect",{originalEvent:evt,data:data})}})},ZFLive_Sel_MultipleSelection.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},ZFLive_Sel_MultipleSelection.prototype.display=function(data,container){var template=this.options.get("templateSelection");return this.options.get("escapeMarkup")(template(data,container))},ZFLive_Sel_MultipleSelection.prototype.selectionContainer=function(){return $('
  • ×
  • ')},ZFLive_Sel_MultipleSelection.prototype.update=function(data){if(this.clear(),0!==data.length){for(var $selections=[],d=0;d1||singlePlaceholder?decorated.call(this,data):this.clear();var $placeholder=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__arrow").show(),this.$selection.find(".select2-selection__rendered").append($placeholder)},ZFLive_MultiSel_MultipleSelection.prototype.bind=function(container,$container){var self=this;MultipleSelection.__super__.bind.apply(this,arguments),this.$selection.on("click",function(evt){container.isOpen()||self.trigger("toggle",{originalEvent:evt})}),this.$selection.on("click",".select2-selection__choice__remove",function(evt){if(!self.options.get("disabled")){var data=$(this).parent().data("data");return self.trigger("unselect",{originalEvent:evt,data:data}),!1}})},ZFLive_MultiSel_MultipleSelection.prototype.selectionContainer=function(){return $('
  • ')},ZFLive_MultiSel_MultipleSelection.prototype.update=function(data){if(0===data.length)return;for(var $selections=[],$zfselected=[],$zfunselectedPos=-1,d=0;d0){var closeDropDown=this.$element.find("option").length==data.length;closeDropDown&&(self.container.$results.addClass("dropdownContDisable"),self.$element.select2("close")),Utils.appendMany($rendered,$zfselected),$($zfselected[0]).css("visibility","hidden");var widthVal=$($zfselected[0]).outerWidth(!1);$($zfselected[0]).css("width","0px"),$($zfselected[0]).css("visibility","visible").animate({width:widthVal+"px"},ZFFullPageForm.menuItemsSpeed,function(){closeDropDown||self.repositionDropdown(),$rendered.scrollTop($rendered[0].scrollHeight),$(this).css("width","")})}else if($zfunselectedPos>=0){let matchedElem=$rendered.find("li").filter(function(index){return this.elemindex==$zfunselectedPos});widthVal=$(matchedElem).width()-$(matchedElem).outerWidth(!1);$(matchedElem).css("width",$(matchedElem).outerWidth(!0)),$(matchedElem).addClass("select2-selection_unselecting"),$(matchedElem).animate({"padding-left":"0px","padding-right":"0px",width:"0px"},ZFFullPageForm.menuItemsSpeed,function(){if($(matchedElem).remove(),1==data.length){var $placeholder=self.createPlaceholder(self.placeholder),selecitonUL=self.$selection.find(".select2-selection__rendered");$(selecitonUL).append($placeholder),$(selecitonUL).find(".select2-search__field").css("width",$(selecitonUL).innerWidth())}self.repositionDropdown()})}else this.clear(),Utils.appendMany($rendered,$selections),$rendered.scrollTop($rendered[0].scrollHeight)},ZFLive_MultiSel_MultipleSelection.prototype.repositionDropdown=function(){positionDropdownCommon(this.container.dropdown)};let adapter=Utils.Decorate(ZFLive_MultiSel_MultipleSelection,Placeholder);function ZFLive_MultiSel_SelectionSearch(decorated,$element,options){ZFLive_MultiSel_SelectionSearch.__super__.constructor.call(this,decorated,$element,options)}return Utils.Extend(ZFLive_MultiSel_SelectionSearch,SelectionSearch),ZFLive_MultiSel_SelectionSearch.prototype.update=function(decorated,data){var searchHadFocus=this.$search[0]==document.activeElement;decorated.call(this,data),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),searchHadFocus&&this.$search.focus()},ZFLive_MultiSel_SelectionSearch.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),container.on("open",function(){self.$search.trigger("focus")}),container.on("close",function(){self.$search.val(""),self.$search.removeAttr("aria-activedescendant")}),container.on("enable",function(){self.$search.prop("disabled",!1),self._transferTabIndex()}),container.on("disable",function(){self.$search.prop("disabled",!0)}),container.on("focus",function(evt){}),container.on("results:focus",function(params){self.$search.attr("aria-activedescendant",params.id)}),this.$selection.on("focusin",".select2-search--inline",function(evt){self.trigger("focus",evt)}),this.$selection.on("focusout",".select2-search--inline",function(evt){self._handleBlur(evt)}),this.$selection.on("keydown",".select2-search--inline",function(evt){if(evt.stopPropagation(),self.trigger("keypress",evt),self._keyUpPrevented=evt.isDefaultPrevented(),evt.which===KEYS.BACKSPACE&&""===self.$search.val()){var $previousChoice=self.$searchContainer.prev(".select2-selection__choice");if($previousChoice.length>0){var item=$previousChoice.data("data");self.searchRemoveChoice(item),evt.preventDefault()}}});var msie=document.documentMode,disableInputEvents=msie&&msie<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(evt){disableInputEvents?self.$selection.off("input.search input.searchcheck"):self.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(evt){if(disableInputEvents&&"input"===evt.type)self.$selection.off("input.search input.searchcheck");else{var key=evt.which;key!=KEYS.SHIFT&&key!=KEYS.CTRL&&key!=KEYS.ALT&&key!=KEYS.TAB&&self.handleSearch(evt)}})},ZFLive_MultiSel_SelectionSearch.prototype.searchRemoveChoice=function(decorated,item){this.trigger("unselect",{data:item})},adapter=Utils.Decorate(adapter,ZFLive_MultiSel_Placeholder),adapter=Utils.Decorate(adapter,ZFLive_MultiSel_SelectionSearch),adapter=Utils.Decorate(adapter,EventRelay)}),$.fn.select2.amd.define("ZFLive_MultiSel_dataAdapter",["select2/utils","select2/data/select"],function(Utils,SelectData){function ZFLive_MultiSel_SelectAdapter($element,options){ZFLive_MultiSel_SelectAdapter.__super__.constructor.call(this,$element,options)}return Utils.Extend(ZFLive_MultiSel_SelectAdapter,SelectData),ZFLive_MultiSel_SelectAdapter.prototype.select=function(data){var self=this;if(data.selected=!0,$(data.element).is("option"))return data.element.selected=!0,data.element.zf_select=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(currentData){var val=[];(data=[data]).push.apply(data,currentData);for(var d=0;d=$options.length)){var $next=$options.eq(nextIndex);$next.trigger("mouseenter");var currentOffset=self.$results.offset().top+self.$results.outerHeight(!1),nextBottom=$next.offset().top+$next.outerHeight(!1),nextOffset=self.$results.scrollTop()+nextBottom-currentOffset;0===nextIndex?self.$results.scrollTop(0):nextBottom>currentOffset&&self.$results.scrollTop(nextOffset)}}),container.on("results:focus",function(params){params.element.addClass("select2-results__option--highlighted")}),container.on("results:message",function(params){self.displayMessage(params)}),$.fn.mousewheel&&this.$results.on("mousewheel",function(e){var top=self.$results.scrollTop(),bottom=self.$results.get(0).scrollHeight-top+e.deltaY,isAtTop=e.deltaY>0&&top-e.deltaY<=0,isAtBottom=e.deltaY<0&&bottom<=self.$results.height();isAtTop?(self.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):isAtBottom&&(self.$results.scrollTop(self.$results.get(0).scrollHeight-self.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(evt){var $this=$(this),data=$this.data("data");"true"!==$this.attr("aria-selected")?self.trigger("select",{originalEvent:evt,data:data}):self.options.get("multiple")?self.trigger("unselect",{originalEvent:evt,data:data}):self.trigger("close",{})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(evt){var data=$(this).data("data");self.getHighlightedResults().removeClass("select2-results__option--highlighted"),self.trigger("results:focus",{data:data,element:$(this)})})},ZFLive_MultiSel_ResultsList.prototype.highlightFirstItem=function(){var $selected=this.$results.find(".select2-results__option[aria-selected]").filter("[aria-selected=true]");$selected.length>0&&$selected.first().trigger("mouseenter"),this.ensureHighlightVisible()},Utils.Decorate(ZFLive_MultiSel_ResultsList,HidePlaceholder)}),function($){var originalVal=$.fn.val;$.fn.val=function(value){if(arguments.length<=0&&(this.is("select")&&null===(value=originalVal.apply(this,arguments)))){value="";var defaultVal=this.attr("zfs2_defaultval");return defaultVal!=undefined&&defaultVal&&(value=defaultVal),value}return originalVal.apply(this,arguments)}}(jQuery)}ZFLive.removeAndDeleteFile_of=function(fieldName,ele){this.removeFile_New_of(fieldName,ele),isAccessibilitySupported()&&handleFocusOnFileUploadDelete(ele),this.deleteFile_of(fieldName,ele),removeUploadFldsOnclckEvnt(fieldName),triggerFormResizeOnTimeOut()},ZFLive.removeFile_New_of=function(fieldName,ele){var inputFileElem=$("#"+fieldName+"-id");$(inputFileElem).val("");var inp=$(inputFileElem).next();$(inp).val(null)},ZFLive.RemoveFileEdit_New_of=function(element,linkName){var errorIdd=ZFLive.errorId(linkName);$(errorIdd).hide();var liElem=$(element).closest("li");$(liElem).attr("isnewlyadded")==undefined&&typeof ZFSubFormLive!=ResponseKey.UNDEFINED&&ZFSubFormLive.zfSubFormLive!=undefined&&ZFSubFormLive.zfSubFormLive.isPopUpEdit?$(liElem).attr("isdelsfpopup","true").hide():$(liElem).remove(),$("#"+linkName+"-div-files").find("ul[elname=fileElementUL]").find("li[name=singleFileElement][isdelsfpopup!=true]").length<=0&&$("#"+linkName+"-div-files").hide(),triggerFormResize()},ZFLive.deleteFile_of=function(fieldName,ele){var elem=$(ele).closest("li"),filePath=$(elem).attr("uploadpath"),fileElementUL=$(ele).closest("ul[elname=fileElementUL]"),parentDiv=$(fileElementUL).parent("div");if(typeof filePath!=ResponseKey.UNDEFINED&&filePath.length>0){var reqUrl,formPerma=document.getElementById("formPerma").value;reqUrl=typeof ZFLive.assignedRecord!=ResponseKey.UNDEFINED&&1==ZFLive.assignedRecord?"/"+this.portalName+"/form/"+this.formLinkName+"/myrecords/deletefile?path="+filePath:typeof ZFLive.approvalEditRecord!=ResponseKey.UNDEFINED&&1==ZFLive.approvalEditRecord?"/"+this.portalName+"/form/"+this.formLinkName+"/approvals/deletefile?path="+filePath:formPerma.length>0?"/"+this.portalName+"/form/"+this.formLinkName+"/formperma/"+formPerma+"/deletefile?path="+filePath:"/"+this.portalName+"/form/"+this.formLinkName+"/deletefile?path="+filePath,$.ajax({url:reqUrl,type:"DELETE",async:!0,beforeSend:function(jqXHR,settings){var csrf=ZFUtil.getCSRF();$.trim(csrf).length>0&&jqXHR.setRequestHeader("X-ZCSRF-TOKEN","zfcpn="+csrf)}})}$(ele).closest("li").remove(),ZFLive.removeStoredFile(fieldName,ele),$(parentDiv).find("li[name=singleFileElement][isdelsfpopup!=true]").length<=0&&$(parentDiv).hide(),$("#error-"+fieldName).text("").hide();var errorElems=$(fileElementUL).find("li.fileUploadError");if(0==$(errorElems).length){var errorIdd=isSubFormField()||isOneFieldForm()?$("div[id="+fieldName+"-li]").find("div[elname=fu_error]"):"#fu_error-"+fieldName;$(errorIdd).hide(),$(errorIdd).text(""),ZFLive.validateUploadMinLimitConst(parentDiv)}};var ZFMonthYearComponent=new function(){this.currentDate=new Date};function getMonthYearPickerInst(){return $("#monthYearPicker")}function splitMonthYearVal(monthYearVal,dateformat,dateLocale){var datesep,month,monthYearElements=new Array(2);monthYearVal.indexOf("-")>=0?datesep="-":monthYearVal.indexOf("/")>=0?datesep="/":monthYearVal.indexOf(".")>=0&&(datesep=".");var dateformatLowercase=dateformat.toLowerCase();if(typeof dateLocale!=ResponseKey.UNDEFINED&&""!=dateLocale)switch(dateformatLowercase){case"dd-mmm-yyyy":month=CustomDateLocale[dateLocale].monthNamesShort;break;case"dd-mmmm-yyyy":case"mmmm-dd-yyyy":month=CustomDateLocale[dateLocale].monthNames}else switch(dateformatLowercase){case"dd-mmm-yyyy":month=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");break;case"dd-mmmm-yyyy":case"mmmm-dd-yyyy":month=new Array("January","February","March","April","May","June","July","August","September","October","November","December")}switch(dateformatLowercase){case"yyyy/mm/dd":case"yyyy-mm-dd":monthYearElements[0]=monthYearVal.substring(monthYearVal.indexOf(datesep)+1,monthYearVal.length)-1,monthYearElements[1]=monthYearVal.substring(0,monthYearVal.indexOf(datesep));break;case"mm-dd-yyyy":case"mm/dd/yyyy":monthYearElements[0]=monthYearVal.substring(0,monthYearVal.indexOf(datesep))-1,monthYearElements[1]=monthYearVal.substr(monthYearVal.lastIndexOf(datesep)+1,monthYearVal.length);break;case"dd.mm.yyyy":case"dd-mm-yyyy":case"dd/mm/yyyy":monthYearElements[0]=monthYearVal.substring(0,monthYearVal.lastIndexOf(datesep))-1,monthYearElements[1]=monthYearVal.substr(monthYearVal.lastIndexOf(datesep)+1,monthYearVal.length);break;case"dd-mmm-yyyy":case"dd-mmmm-yyyy":monthYearElements[0]=getMonthIndex(month,monthYearVal.substring(0,monthYearVal.lastIndexOf(datesep)).toLowerCase()),monthYearElements[1]=monthYearVal.substr(monthYearVal.lastIndexOf(datesep)+1,monthYearVal.length);break;case"mmmm-dd-yyyy":monthYearElements[0]=getMonthIndex(month,monthYearVal.substring(0,monthYearVal.indexOf(datesep)).toLowerCase()),monthYearElements[1]=monthYearVal.substr(monthYearVal.lastIndexOf(datesep)+1,monthYearVal.length)}return monthYearElements}function disableMonthValuesForMYPicker(monthYearPickerUlLiList,fromMonth,toMonth,disabledMonths){typeof ZFLive!=ResponseKey.UNDEFINED&&$(monthYearPickerUlLiList).each(function(){var monthIndex=$(this).attr("monthIndex");-1!=$.inArray(parseInt(monthIndex),disabledMonths)?$(this).addClass("disabledMonth"):fromMonth<=monthIndex-1&&monthIndex-1<=toMonth||$(this).addClass("disabledMonth")})}function checkMonthYearPicker(inputElem){$(inputElem).removeClass("hasMonthYearPicker"),typeof ZFLive.constraintJson!==ResponseKey.UNDEFINED&&setTimeout(function(){0===$(document.activeElement).closest("div[id=monthYearPicker]").length&&(isOneFieldForm()?ZFLive.validateFieldConstraintOF(inputElem):ZFLive.validateFieldConstraint(inputElem))},0)}function hideMonthYearPicker(){getMonthYearPickerInst().hide()}function focusMonthYearInpElem(imgElem){var inputElem=$(imgElem).closest("div[elname=calendarContDiv]").find("input"),isInputDisabled=$(inputElem).is(":disabled");typeof isInputDisabled!=ResponseKey.UNDEFINED&&isInputDisabled||$(inputElem).focus()}function setYearRangeForMonthYearPicker(monthYearPicker,startYear,endYear){var monthYearPickerYearElem=$(monthYearPicker).find("select[elname=selectYear]");$(monthYearPickerYearElem).find("option[elname=yearOption]").remove();for(var yearCloneElem=$(monthYearPicker).find("option[elname=yearOptionClone]"),yearVal=startYear;yearValmaxYearValue&&(yearValue=maxYearValue))}return yearValue}function getMonthYearValueForNumericalDateFormats(yearVal,dateFormat,monthIndex){var dateSep;return monthIndex<10&&(monthIndex="0"+monthIndex),"dd/mm/yyyy"==dateFormat.toLowerCase()||"mm/dd/yyyy"==dateFormat.toLowerCase()?(dateSep="/",value=monthIndex+dateSep+yearVal):"yyyy-mm-dd"==dateFormat.toLowerCase()?(dateSep="-",value=yearVal+dateSep+monthIndex):"yyyy/mm/dd"==dateFormat.toLowerCase()?(dateSep="/",value=yearVal+dateSep+monthIndex):"dd-mm-yyyy"==dateFormat.toLowerCase()||"mm-dd-yyyy"==dateFormat.toLowerCase()?(dateSep="-",value=monthIndex+dateSep+yearVal):"dd.mm.yyyy"==dateFormat.toLowerCase()&&(dateSep=".",value=monthIndex+dateSep+yearVal),value}function convertSelectedValToMonthYear(monthIndex,yearVal,dateFormat,dateLocale){dateLocale=dateLocale.toString();var value="";if("dd-mmm-yyyy"==dateFormat.toLowerCase()||"dd-mmmm-yyyy"==dateFormat.toLowerCase()||"mmmm-dd-yyyy"==dateFormat.toLowerCase()){var localeMonthArray,dateSep="-";localeMonthArray="dd-mmm-yyyy"==dateFormat.toLowerCase()?CustomDateLocale[dateLocale].monthNamesShort:CustomDateLocale[dateLocale].monthNames,monthVal=localeMonthArray[monthIndex-1],value=monthVal+dateSep+yearVal}else value=getMonthYearValueForNumericalDateFormats(yearVal,dateFormat,monthIndex);return value}function setMonthYearLimit(inputElement,dateFormat,dateLocale,monthYearPicker){var inpYearValue,inpMonthValue;getAndSetBasicMonthYearMinMaxRanges(inputElement,dateFormat,dateLocale);var currYearValue,value=$(inputElement).val();if(""!=value){var monthYearElem=splitMonthYearVal(value,dateFormat,dateLocale);inpYearValue=monthYearElem[1],inpMonthValue=monthYearElem[0],currYearValue=getValidYearFromRangeType(monthYearPicker,inpYearValue)}else currYearValue=getValidYearFromRangeType(monthYearPicker,ZFMonthYearComponent.currentDate.getFullYear());enableDisableMonthsAndAddRemoveClassInMYPicker(monthYearPicker,inpMonthValue,inpYearValue,undefined,currYearValue),$(monthYearPicker).find("select[elname=selectYear]").val(currYearValue).trigger("change.select2")}function monthYearPickerHandler(inputElement,monthYearPicker,dateFormat,dateLocale,isValidationRequired){setMonthYearLimit(inputElement,dateFormat,dateLocale,monthYearPicker),isValidationRequired&&bindSelect2FuncForAccessibility($(monthYearPicker).find("select[elname=selectYear]")),ZFUtil.closeHoverTextPopup(),$(monthYearPicker).show(),$(inputElement).addClass("hasMonthYearPicker")}function addCurrentClass(monthYearPicker,yearValue){var selectedMonthLiElem,currentMonth=ZFMonthYearComponent.currentDate.getMonth();yearValue==ZFMonthYearComponent.currentDate.getFullYear()&&(selectedMonthLiElem=$(monthYearPicker).find("li[monthIndex="+(currentMonth+1)+"]"),$(selectedMonthLiElem).hasClass("disabledMonth")||$(selectedMonthLiElem).addClass("currentMnth"))}function addSelectClass(monthYearPicker,monthValue){var selectedMonthLiElem=$(monthYearPicker).find("li[monthIndex="+(monthValue+1)+"]");$(selectedMonthLiElem).removeClass("currentMnth"),$(selectedMonthLiElem).hasClass("disabledMonth")||$(selectedMonthLiElem).addClass("select")}function positionMonthYearPicker(monthYearElem,monthYearPicker){if($(monthYearElem).is(":visible")){var secondPos=$(monthYearElem).offset(),top=secondPos.top,left=secondPos.left,topAndHeight=top+monthYearElem.offsetHeight;if($(monthYearPicker).css("left",left+"px"),topAndHeight+$(monthYearPicker).outerHeight(!0)>$(window).outerHeight(!0)){var modifiedTopAndHeight=top-$(monthYearPicker).outerHeight(!0);$(monthYearPicker).css("top",modifiedTopAndHeight+"px")}else $(monthYearPicker).css("top",topAndHeight+"px");left+$(monthYearPicker).find("div[elname=monthPickerDiv]").width()>$(window).width()&&$(monthYearPicker).css("left",$(window).width()-$(monthYearPicker).find("div[elname=monthPickerDiv]").width())}else{var imgElem=$(monthYearElem).siblings("svg"),imgElemOffset=$(imgElem).offset();top=imgElemOffset.top,left=imgElemOffset.left;$(monthYearPicker).css("top",top+"px"),$(monthYearPicker).css("left",left-$(monthYearPicker).find("div[elname=monthPickerDiv]").outerWidth(!0)+"px")}}function bindActionOnYearChangeForMonthYearPicker(inputElement,monthYearPicker,dateFormat,dateLocale){var monthYearPickerYearElem=$(monthYearPicker).find("select[elname=selectYear]");$(monthYearPickerYearElem).on("select2:select",function(e){var inpYearValue,inpMonthValue,selectedYear=$(this).val(),value=$(inputElement).val();if(""!=value){var monthYearElem=splitMonthYearVal(value,dateFormat,dateLocale);inpYearValue=monthYearElem[1],inpMonthValue=monthYearElem[0]}enableDisableMonthsAndAddRemoveClassInMYPicker(monthYearPicker,inpMonthValue,inpYearValue,selectedYear,getValidYearFromRangeType(monthYearPicker,selectedYear))})}function setValueToInputElement(inputElement,monthValue,yearValue,dateFormat,dateLocale){if(typeof monthValue!=ResponseKey.UNDEFINED&&""!=monthValue&&typeof yearValue!=ResponseKey.UNDEFINED&&""!=yearValue){var monthYearValue=convertSelectedValToMonthYear(monthValue,yearValue,dateFormat,dateLocale);$(inputElement).val(monthYearValue)}}function removePickerClassAndHidePicker(inputElement){$(inputElement).removeClass("hasMonthYearPicker"),hideMonthYearPicker()}function getAndSetBasicMonthYearMinMaxRanges(inputElement,dateFormat,dateLocale){if(typeof ZFLive!=ResponseKey.UNDEFINED&&typeof ZFLive.dateConstraintJson!=ResponseKey.UNDEFINED&&""!=ZFLive.dateConstraintJson){var fldLi=isNewHtmlDOM()?$(inputElement).closest("div[elname=livefield-elem]"):$(inputElement).closest("li[elname=livefield-elem]");if(typeof fldLi!=ResponseKey.UNDEFINED){var dateJson=ZFLive.dateConstraintJson[fldLi.attr("linkname")];typeof dateJson!=ResponseKey.UNDEFINED&&""!=dateJson&&setMinMaxMonthYearRangesOfMYPicker(dateJson,inputElement,dateFormat,dateLocale)}}}function initializeMonthYearPicker(inputElement,dateFormat,dateLocale,isBuilder,isValidationRequired){var monthYearPicker=getMonthYearPickerInst();$(inputElement).off("focus").on("focus",function(e){if($(this).hasClass("hasMonthYearPicker"))return removePickerClassAndHidePicker(this),!1;positionMonthYearPicker(this,monthYearPicker),monthYearPickerHandler($(this),monthYearPicker,dateFormat,dateLocale,isValidationRequired),bindActionOnYearChangeForMonthYearPicker(this,monthYearPicker,dateFormat,dateLocale),callOnKeyDown(inputElement,monthYearPicker,dateFormat,dateLocale);var monthYearPickerList=$(monthYearPicker).find("ul[elname=monthsUl]");$(monthYearPickerList).off("click"),$(monthYearPickerList).on("click",function(event){var elem;if(elem="DIV"===event.target.tagName?$(event.target).parent():$(event.target),!$(event.target).parent().hasClass("disabledMonth"))return setValueToInputElement(inputElement,$(elem).attr("monthIndex"),$(monthYearPicker).find("select[elname=selectYear]").val(),dateFormat,dateLocale),$(monthYearPickerList).off("click"),$(inputElement).off("keydown"),isBuilder&&hideMonthYearFldList(inputElement),$(inputElement).change(),typeof ZFLive!=ResponseKey.UNDEFINED&&ZFLive.isAccessibilitySupported&&$(inputElement).focus(),removePickerClassAndHidePicker(inputElement),!1}),$(monthYearPickerList).off("keydown"),$(monthYearPickerList).on("keydown",function(event){switch(event.keyCode){case 13:if(!$(event.target).parent().hasClass("disabledMonth"))return setValueToInputElement(inputElement,$(event.target).parent().attr("monthIndex"),$(monthYearPicker).find("select[elname=selectYear]").val(),dateFormat,dateLocale),$(inputElement).trigger("change"),typeof ZFLive!=ResponseKey.UNDEFINED&&ZFLive.isAccessibilitySupported&&$(inputElement).focus(),removePickerClassAndHidePicker(inputElement),!1;break;case 9:var monthYearDiv=$(inputElement).parent();handleTabKeyNavigationMonthYearPicker(monthYearDiv,1);break;case 32:if(!$(event.target).parent().hasClass("disabledMonth"))return setValueToInputElement(inputElement,$(event.target).parent().attr("monthIndex"),$(monthYearPicker).find("select[elname=selectYear]").val(),dateFormat,dateLocale),$(inputElement).trigger("change"),typeof ZFLive!=ResponseKey.UNDEFINED&&ZFLive.isAccessibilitySupported&&$(inputElement).focus(),$(inputElement).off("keydown"),removePickerClassAndHidePicker(inputElement),!1}}),$(monthYearPicker).find("select[elname=selectYear]").next().find("span.select2-selection").off("keydown").on("keydown",function(event){switch(event.keyCode){case 9:var monthYearDiv=$(inputElement).parent();handleTabKeyNavigationMonthYearPicker(monthYearDiv,0)}})}),$(inputElement).off("click").on("click",function(e){if($(this).hasClass("hasMonthYearPicker"))return!1;callOnKeyDown(inputElement,monthYearPicker,dateFormat,dateLocale),ZFUtil.closeHoverTextPopup(),$(monthYearPicker).show()})}function callOnKeyDown(inputElement,monthYearPicker,dateFormat,dateLocale){$(inputElement).off("keydown").on("keydown",function(event){if(13===event.keyCode){var monthValue,monthYearPickerList=$(monthYearPicker).find("ul[elname=monthsUl]"),selectedMonthLi=$(monthYearPickerList).find("li.select");0==$(selectedMonthLi).length?(selectedMonthLi=$(monthYearPickerList).find("li.currentMnth"),$(selectedMonthLi).length>0&&(monthValue=$(selectedMonthLi).attr("monthIndex"))):monthValue=$(selectedMonthLi).attr("monthIndex");var yearValue=$(monthYearPicker).find("select[elname=selectYear]").val();return setValueToInputElement(inputElement,monthValue,yearValue,dateFormat,dateLocale),removePickerClassAndHidePicker(inputElement),$(inputElement).off("keydown"),$(inputElement).trigger("change"),!1}if(9==event.keyCode)$(inputElement).removeClass("hasMonthYearPicker"),hideMonthYearPicker();else if(event.altKey&&40===event.keyCode&&typeof ZFLive!=ResponseKey.UNDEFINED&&ZFLive.isAccessibilitySupported){var setFocuedElem=$("#monthYearPicker").find("li.select");0===$(setFocuedElem).length&&(setFocuedElem=$("#monthYearPicker").find("li.currentMnth")),0===$(setFocuedElem).length&&(setFocuedElem=$("#monthYearPicker").find("li:first")),setTimeout(function(){$(setFocuedElem).find("div").focus()},0)}})}function monthYearClassicInit(fieldlinkname,dateFormat,dateLocale,isSubformField,sfRow){var monthYearFldLi;monthYearFldLi=isSubformField?$(sfRow).find("li[compname="+fieldlinkname+"]"):getFieldElemWithFldLinkNameAttrLivefieldElem(fieldlinkname),initializeMonthYearPicker($(monthYearFldLi).find("input[id="+fieldlinkname+"-monthyear]"),dateFormat,dateLocale,!1,!0)}function setMonthLabelsForPicker(monthYearPickerUl,dateLocale){for(var localeMonthArray=CustomDateLocale[dateLocale].monthNamesShort,i=0;i<12;i++){var eachLi=$(monthYearPickerUl).find("li[monthIndex="+(i+1)+"]");$(eachLi).find("div").length>0?$(eachLi).find("div").text(localeMonthArray[i]):$(eachLi).text(localeMonthArray[i])}}function setMonthLabelsInMYPickerAndModifyActionsOfMYPickerYearSelect(monthYearPicker,dateLocale){setMonthLabelsForPicker($(monthYearPicker).find("ul[elname=monthsUl]"),dateLocale);var monthYearPickerYearElem=$(monthYearPicker).find("select[elname=selectYear]");$(monthYearPickerYearElem).select2({theme:"default select2MonthYear"}).on("select2:open",function(){$(".select2-search__field").attr("maxlength",4)})}function enableDisableMonthsAndAddRemoveClassInMYPicker(monthYearPicker,inpMonthValue,inpYearValue,selectYearValue,currYearValue){var checkYearValue,rangeType=$(monthYearPicker).attr("rangeType"),minYearValue=$(monthYearPicker).attr("minYearValue"),maxYearValue=$(monthYearPicker).attr("maxYearValue"),minMonthValue=$(monthYearPicker).attr("minMonthValue"),maxMonthValue=$(monthYearPicker).attr("maxMonthValue");$(monthYearPicker).find("li").removeClass("select").removeClass("currentMnth").removeClass("disabledMonth"),checkYearValue=typeof selectYearValue!=ResponseKey.UNDEFINED?selectYearValue:typeof inpYearValue!=ResponseKey.UNDEFINED?inpYearValue:ZFMonthYearComponent.currentDate.getFullYear();var disabledMonths=[],disabledMonthsInString="";typeof $(monthYearPicker).attr("disabledMonths")!=ResponseKey.UNDEFINED&&(disabledMonthsInString=$(monthYearPicker).attr("disabledMonths").split(","));for(var i=0;iminYearValue&&checkYearValue=maxYearValue&&(minMonthValue=0):7==rangeType&&minYearValue!=maxYearValue&&(checkYearValue>=maxYearValue&&(minMonthValue=0),checkYearValue<=minYearValue&&(maxMonthValue=11)),disableMonthValuesForMYPicker($(monthYearPicker).find("ul[elname=monthsUl]").find("li"),minMonthValue,maxMonthValue,disabledMonths)}addCurrentClass(monthYearPicker,currYearValue),typeof inpYearValue!=ResponseKey.UNDEFINED&&(typeof selectYearValue!=ResponseKey.UNDEFINED?inpYearValue==selectYearValue&&addSelectClass(monthYearPicker,inpMonthValue):minYearValue<=inpYearValue&&inpYearValue<=maxYearValue&&addSelectClass(monthYearPicker,inpMonthValue))}function configureMonthYearPicker(inputElement,dateFormat,dateLocale,isValidationRequired,isBuilder){var monthYearPicker=getMonthYearPickerInst();initializeMonthYearPicker(inputElement,dateFormat,dateLocale,isBuilder,isValidationRequired),setValidationForMonthYear(monthYearPicker,dateLocale,isValidationRequired)}function setValidationForMonthYear(monthYearPicker,dateLocale,isValidationRequired){setMonthLabelsInMYPickerAndModifyActionsOfMYPickerYearSelect(monthYearPicker,dateLocale),isValidationRequired||($(monthYearPicker).attr("minMonthValue",0),$(monthYearPicker).attr("maxMonthValue",11),$(monthYearPicker).attr("minYearValue",1900),$(monthYearPicker).attr("maxYearValue",2100),setYearRangeForMonthYearPicker(getMonthYearPickerInst(),1900,2100))}function onClickImgIconOfMonthYear(imgElem){var inputElem=$(imgElem).siblings("input[elname=month_limit_inp],input[elname=field-initial-value],input[elname=monthyear]"),isInputDisabled=$(inputElem).is(":disabled");typeof isInputDisabled!=ResponseKey.UNDEFINED&&isInputDisabled||$(inputElem).trigger("focus")}$(document).on("keypress",".select2MonthYear .select2-search__field",function(){$(this).val($(this).val().replace(/[^\d].+/,"")),(event.which<48||event.which>57)&&event.preventDefault()}),$(document).on("mousedown",function(event){var target=$(event.target);"#monthYearPicker"===target[0].id||0!==target.parents("#monthYearPicker").length||target.hasClass("hasMonthYearPicker")||hideMonthYearPicker()});