PageSourceSearch

https://lakeforestgc.com/wp-content/plugins/woocommerce-extra-prod…/assets/js/thwepo-public.min.js?ver=3.2.8

js lakeforestgc.com collected 2026-09-28 11:15:58 UTC 82,618 bytes, 3 lines download raw bytes

1function thwepoViewPassword(elm){thwepo_public_base.thwepoviewpassword(elm)}function thwepo_remove_uploaded_file(elm){thwepo_public_file_upload.remove_uploaded_file(elm)}function init_thwepo(){thwepo_public.initialize_thwepo()}var thwepo_public_base=function($,window,document){"use strict";function remove_duplicates(arr){return arr.filter(function(elem,index,self){return index==self.indexOf(elem)})}function remove_empty_values(arr){var result=arr;return $.isArray(arr)&&(result=arr.filter(function(elem,index,self){return!isEmpty(elem)})),result}function is_subset_of(set,subset){var is_subset=!0;return $.isArray(set)&&$.isArray(subset)&&$.each(subset,function(index,value){if(-1==$.inArray(value,set))return is_subset=!1,!1}),is_subset}function array_intersection(arr1,arr2){return $.map(arr1,function(a){return $.inArray(a,arr2)<0?null:a})}function is_empty_arr(value){var is_empty=!0;return Array.isArray(value)&&value.length&&(is_empty=!1),is_empty}function padZero(s,len,c){s=""+s;for(var c=c||"0";s.length<len;)s=c+s;return s}function isInt(value){return!isNaN(value)&&parseInt(Number(value))==value&&!isNaN(parseInt(value,10))}function isFloat(value){return!isNaN(value)&&parseFloat(Number(value))==value&&!isNaN(parseFloat(value,10))}function isEmpty(val){return void 0===val||null==val||val.length<=0}function may_parse_date(dateStr){if(DATE_FORMAT_1.test(dateStr)){var date=new Date(dateStr);if(date)return date}return dateStr}function isInputField(field){if(field&&field.length>0){var tagName=field[0].tagName.toLowerCase();if($.inArray(tagName,["input","select","textarea"])>-1)return!0}return!1}function isInputChoiceField(type,multiple){return!!("select"===type||"radio"===type||"checkbox"===type&&multiple)}function getInputField(key){var field=null;return key&&(field=$("#"+key),isInputField(field)||(field=$("input[name='"+key+"']"),isInputField(field)||(field=$("input[name='"+key+"[]']"),isInputField(field)||(field=$("input[name='"+key+"[0]']"))))),field}function prepare_date(dateStr,format,strict){var date=null;if(!isEmpty(dateStr))try{date=$.datepicker.parseDate(format,dateStr),date.setHours(0,0,0,0)}catch(err){if(!strict){var pattern=dateStr.split(" "),years=null,months=null,days=null;if(pattern.length>0)for(var i=0;i<pattern.length;i++){var x=pattern[i];x=x.toLowerCase(),-1!=x.indexOf("y")?(x=x.replace(/y/gi,""),years=parseInt(x)):-1!=x.indexOf("m")?(x=x.replace(/m/gi,""),months=parseInt(x)):-1!=x.indexOf("d")&&(x=x.replace(/d/gi,""),days=parseInt(x))}isEmpty(years)&&isEmpty(months)&&isEmpty(days)||(date=new Date,date.setHours(0,0,0,0),years&&0!=years&&date.setFullYear(date.getFullYear()+years),months&&0!=months&&date.setMonth(date.getMonth()+months),days&&0!=days&&date.setDate(date.getDate()+days))}}return date}function compare_dates(field,cvalue){var result=null,value=field.val(),format=field.data("date-format"),type=field.data("type");if(isEmpty(value)||isEmpty(cvalue))return null;if("daterangepicker"===type)value=moment(value,format),value=value.format("YYYY-MM-DD"),cvalue=moment(cvalue,format),cvalue=cvalue.format("YYYY-MM-DD"),moment(value).isAfter(cvalue)?result=1:moment(value).isBefore(cvalue)?result=-1:moment(value).isSame(cvalue)&&(result=0);else{var d1=prepare_date(value,format,!0),d2=prepare_date(cvalue,format,!1);if(d1&&d2)try{d1>d2?result=1:d1<d2?result=-1:d1.getTime()===d2.getTime()&&(result=0)}catch(err){result=null}}return result}function isSameDate(date1,date2){if(date1&&date2){var day1=date1.getDate(),month1=date1.getMonth()+1,year1=date1.getFullYear(),day2=date2.getDate(),month2=date2.getMonth()+1,year2=date2.getFullYear(),matchYear=!(!isInt(day1)||!isInt(day2)||day1!=day2),matchMonth=!(!isInt(month1)||!isInt(month2)||month1!=month2),matchDay=!(!isInt(year1)||!isInt(year2)||year1!=year2);return matchYear&&matchMonth&&matchDay}return!1}function is_date_eq(field,cvalue){var result=compare_dates(field,cvalue);return null!=result&&0===result}function is_date_gt(field,cvalue){var result=compare_dates(field,cvalue);return null!=result&&1===result}function is_date_lt(field,cvalue){var result=compare_dates(field,cvalue);return null!=result&&-1===result}function is_day_eq(field,cvalue){var result=!1;if(!isEmpty(cvalue)){var value=field.val(),format=field.data("date-format"),date=prepare_date(value,format,!0);if(date){var day=date.getDay();if(isInt(cvalue))cvalue=parseInt(cvalue),result=null!=day&&day===cvalue;else if(cvalue=cvalue.toLowerCase(),$.inArray(cvalue,weekDays)>=0){var daystring=weekDays[day];result=null!=daystring&&daystring===cvalue}}}return result}
1function setup_enhanced_select(form,class_selector,data){form.find("select."+class_selector).each(function(){var ms=$(this),dataset=ms[0].dataset,select_id=ms.attr("id"),thwepo_select2_auto_width=thwepo_public_var.thwepo_select2_auto_width;ms.selectWoo({allowClear:!0,placeholder:ms.data("placeholder"),maximumSelectionLength:ms.data("maxselections"),language:data.language,dropdownAutoWidth:thwepo_select2_auto_width,dropdownCssClass:"thwepo-select2-dropdown thwepo-select-id-"+select_id,width:"100%",templateResult:function(data){if(!data.element)return data.text;var $element=$(data.element),$wrapper=$("<span></span>");return $wrapper.append($element.text()),$wrapper},templateSelection:function(data){return data.text}}).addClass("enhanced"),setSelect2Colors({text_color_active:dataset.selectOptionTextColorActive,text_color_inactive:dataset.selectOptionTextColorInactive,text_color_hover:dataset.selectOptionTextColorHover,background_color_active:dataset.selectOptionBackgroundColorActive,background_color_inactive:dataset.selectOptionBackgroundColorInactive,background_color_hover:dataset.selectOptionBackgroundColorHover,border_color_active:dataset.selectOptionBorderColorActive,border_color_inactive:dataset.selectOptionBorderColorInactive,border_color_hover:dataset.selectOptionBorderColorHover},select_id)})}function setSelect2Colors(colors,select_id){var style=document.createElement("style"),styleContent="";colors.background_color_inactive&&(styleContent+=".select2-container .thwepo-select-id-"+select_id+" .select2-results__option,.select2-container .thwepo-select-id-"+select_id+" .select2-results__option[data-selected=false] {    background-color: "+colors.background_color_inactive+" !important;}"),colors.background_color_active&&(styleContent+=".select2-container--default .thwepo-select-id-"+select_id+" .select2-results__option[data-selected=true] {    background-color: "+colors.background_color_active+" !important;}"),colors.background_color_hover&&(styleContent+=".select2-container--default .thwepo-select-id-"+select_id+" .select2-results__option--highlighted[aria-selected],.select2-container--default .thwepo-select-id-"+select_id+" .select2-results__option--highlighted[data-selected] {    background-color: "+colors.background_color_hover+" !important;}"),colors.text_color_active&&(styleContent+=".select2-container--default .thwepo-select-id-"+select_id+" .select2-results__option[data-selected=true] {    color: "+colors.text_color_active+" !important;}"),colors.text_color_inactive&&(styleContent+=".select2-container .thwepo-select-id-"+select_id+" .select2-results__option, .select2-container .thwepo-select-id-"+select_id+" .select2-results__option[data-selected=false] {    color: "+colors.text_color_inactive+" !important;}"),colors.text_color_hover&&(styleContent+=".select2-container--default .thwepo-select-id-"+select_id+" .select2-results__option--highlighted[aria-selected],.select2-container--default .thwepo-select-id-"+select_id+" .select2-results__option--highlighted[data-selected] {    color: "+colors.text_color_hover+" !important;}"),colors.border_color_inactive&&(styleContent+=".select2-container .thwepo-select-id-"+select_id+" .select2-results__option,.select2-container .thwepo-select-id-"+select_id+" .select2-results__option[data-selected=false] {    border: 0.5px solid "+colors.border_color_inactive+" !important;}"),colors.border_color_active&&(styleContent+=".select2-container--default .thwepo-select-id-"+select_id+" .select2-results__option[data-selected=true] {    border: 0.5px solid "+colors.border_color_active+" !important;}"),colors.border_color_hover&&(styleContent+=".select2-container--default .thwepo-select-id-"+select_id+" .select2-results__option--highlighted[aria-selected],.select2-container--default .thwepo-select-id-"+select_id+" .select2-results__option--highlighted[data-selected] {    border: 0.5px solid "+colors.border_color_hover+" !important;}"),(colors.background_color_inactive||colors.background_color_active||colors.background_color_hover||colors.text_color_active||colors.text_color_inactive||colors.text_color_hover||colors.border_color_inactive||colors.border_color_active||colors.border_color_hover)&&(styleContent+=".select2-container .thwepo-select-id-"+select_id+" .select2-results__option,.select2-container .thwepo-select-id-"+select_id+" .select2-results__option[data-selected=false] {   margin: 0px !important;}"),styleContent&&(style.textContent=styleContent,document.head.appendChild(style))}function calculate_minutes_from_hr_min(_hour,_min){var minutes=null;return isInt(_hour)&&isInt(_min)&&(minutes=60*_hour+_min),minutes}function get_minutes_from_time_24hr(time){var minutes=null,timeArr=time.split(":");if(2==timeArr.length){minutes=calculate_minutes_from_hr_min(parseInt(timeArr[0]),parseInt(timeArr[1]))}return minutes}function no_specific_days(date,disableDays){var day=date.getDay(),daystring=weekDays[day];return[-1==disableDays.indexOf(daystring),""]}function no_specific_dates(date,datestring){var day=date.getDate(),month=date.getMonth()+1,year=date.getFullYear(),dateArr=datestring.split("-");if(3==dateArr.length){var matchYear=!isInt(dateArr[0])||dateArr[0]==year,matchMonth=!isInt(dateArr[1])||dateArr[1]==month,matchDay=!isInt(dateArr[2])||dateArr[2]==day;return isInt(dateArr[0])||isInt(dateArr[1])||isInt(dateArr[2])?[!(matchYear&&matchMonth&&matchDay),""]:[!0,""]}if(LINKED_DATE_FORMAT.test(datestring)){var sd=get_linked_datepicker_selected_date(datestring,"disabled");return sd?[!isSameDate(date,sd),""]:[!0,""]}var _now=new Date;if(isSameDate(date,_now)){var _hour=_now.getHours(),_min=_now.getMinutes(),op="eq";-1!=datestring.indexOf("+")?(op="gt",datestring=datestring.replace("+","")):-1!=datestring.indexOf("-")&&(op="lt",datestring=datestring.replace("-",""));var _minutes=calculate_minutes_from_hr_min(_hour,_min),minutes=get_minutes_from_time_24hr(datestring);if(isInt(minutes)&&isInt(_minutes)&&("eq"===op&&_minutes==minutes||"gt"===op&&_minutes>minutes||"lt"===op&&_minutes<minutes))return[!1,""]}return[!0,""]}function no_specific_months(date,disableMonths){var month=date.getMonth(),monthstring=month.toString();return[-1==disableMonths.indexOf(monthstring),""]}function disable_dates(date){var disabledDays=$(this).data("disabled-days");if(disabledDays&&disabledDays.length>0){var daysArr=disabledDays.split(","),disabledDay=no_specific_days(date,daysArr);if(!disabledDay[0])return disabledDay}var disabledDates=$(this).data("disabled-dates");if(disabledDates&&disabledDates.length>0){var datesArr=disabledDates.split(",");if(datesArr.length>0)for(var i=0;i<datesArr.length;i++){var disabledDate=no_specific_dates(date,datesArr[i].trim());if(!disabledDate[0])return disabledDate}}var disabledMonths=$(this).data("disabled-months");if(Number.isInteger(disabledMonths)&&(disabledMonths=disabledMonths.toString()),disabledMonths&&disabledMonths.length>0){var monthsArr=disabledMonths.split(","),disabledMonth=no_specific_months(date,monthsArr);if(!disabledMonth[0])return disabledMonth}return[!0,""]}function get_linked_datepicker_selected_date(dateStr,option){var sd=null;if(LINKED_DATE_FORMAT.test(dateStr)){var linkedDate=dateStr.replace(/[{}]/g,"");if(linkedDate){var dp=$("#"+linkedDate);dp.length&&(sd=dp.datepicker("getDate"))}}return sd}function check_if_linked_date(dateStr,targetDp,option){if(LINKED_DATE_FORMAT.test(dateStr)){var linkedDate=dateStr.replace(/[{}]/g,"");if(linkedDate){var dp=$("#"+linkedDate);dp.length&&dp.datepicker("option","onSelect",function(dateText,inst){if("minDate"===option){var df=dp.data("date-format"),dpDate=prepare_date(dateText,df,!0),nextDate=new Date(dpDate.getTime()+864e5);targetDp.datepicker("option","minDate",nextDate)}else"maxDate"===option&&targetDp.datepicker("option","maxDate",dp.datepicker("getDate"))})}dateStr=""}return dateStr}
1function setup_date_picker(form,class_selector,data){form.find("."+class_selector).each(function(){var dateFormat=$(this).data("date-format"),defaultDate=$(this).data("default-date"),maxDate=$(this).data("max-date"),minDate=$(this).data("min-date"),yearRange=$(this).data("year-range"),numberOfMonths=$(this).data("number-months"),firstDay=$(this).data("first-day"),altField=$(this).data("alt-field"),readonly=$(this).data("readonly");readonly=!("yes"!==readonly||!data.readonly_date_field),maxDate=may_parse_date(maxDate),minDate=may_parse_date(minDate),maxDate=check_if_linked_date(maxDate,$(this),"maxDate"),minDate=check_if_linked_date(minDate,$(this),"minDate"),dateFormat=""==dateFormat?"dd/mm/yy":dateFormat,defaultDate=""==defaultDate?null:defaultDate,maxDate=""==maxDate?null:maxDate,minDate=""==minDate?null:minDate,yearRange=""==yearRange?"-100:+1":yearRange,numberOfMonths=numberOfMonths>0?numberOfMonths:1;var value=$(this).val();value.trim()&&(defaultDate=value),$(this).datepicker({defaultDate:defaultDate,maxDate:maxDate,minDate:minDate,yearRange:yearRange,numberOfMonths:numberOfMonths,showButtonPanel:!0,changeMonth:!0,changeYear:!0}),$(this).datepicker("option",$.datepicker.regional[data.language]),$(this).datepicker("option","dateFormat",dateFormat),$(this).datepicker("option","beforeShowDay",disable_dates),$(this).datepicker("option","firstDay",firstDay),$(this).datepicker("setDate",defaultDate),$(this).prop("readonly",readonly),altField&&$(this).datepicker("option","altField","#"+altField)})}function setup_daterange_picker(form,class_selector,data){form.find("."+class_selector).each(function(){var name=$(this).attr("name"),dateFormat=$(this).data("date-format"),startDate=$(this).data("start-date"),endDate=$(this).data("end-date"),maxDate=$(this).data("max-date"),minDate=$(this).data("min-date"),minYear=$(this).data("min-year"),maxYear=$(this).data("max-year"),readonly=($(this).data("first-day"),$(this).data("alt-field"),$(this).data("readonly")),timepicker=$(this).data("timepicker"),timeonly=$(this).data("timeonly"),single_calendar=$(this).data("single-calendar");readonly=!("yes"!==readonly||!data.readonly_date_field),timepicker="yes"===timepicker,dateFormat=""==dateFormat?"DD/MM/YYYY":dateFormat,startDate=startDate&&moment(startDate,dateFormat,!0).isValid()?startDate:moment().startOf("day"),endDate=endDate&&moment(endDate,dateFormat,!0).isValid()?endDate:moment().endOf("day"),maxDate=""==maxDate?null:maxDate,minDate=""==minDate?null:minDate;var range_picker_time_format=thwepo_public_var.range_picker_time_format;range_picker_time_format=!!range_picker_time_format;var range_picker_time_increment=thwepo_public_var.range_picker_time_increment,show_dropdown_year=thwepo_public_var.show_dropdown_year;show_dropdown_year=!!show_dropdown_year;var start_of_week=thwepo_public_var.start_of_week;single_calendar=!!single_calendar;var value=$(this).val();if(value.trim()){var startDate_val=$("#"+name+"_start").val();startDate=startDate_val||startDate;var endDate_val=$("#"+name+"_end").val();if(endDate=endDate_val||endDate,!startDate_val||!endDate_val){const parsedDates=parseDateRange(value);startDate=parsedDates.startDate?parsedDates.startDate:startDate,endDate=parsedDates.endDate?parsedDates.endDate:endDate}}moment.locale(data.language),$(this).daterangepicker({locale:{format:dateFormat,firstDay:start_of_week},startDate:startDate,endDate:endDate,minDate:minDate,maxDate:maxDate,minYear:minYear,maxYear:maxYear,showDropdowns:show_dropdown_year,timePicker:timepicker,timePicker24Hour:range_picker_time_format,timePickerIncrement:range_picker_time_increment,singleDatePicker:single_calendar},function(start,end,label){var start=start.format(dateFormat),end=end.format(dateFormat);$("#"+name+"_start").val(start),$("#"+name+"_end").val(end)}),"yes"===timeonly&&$(this).on("show.daterangepicker",function(ev,picker){picker.container.find(".calendar-table").hide()})})}function parseDateRange(value){const dates=value.trim().split("-").map(function(date){return date.trim()});if(2===dates.length){return{startDate:dates[0],endDate:dates[1]}}return null}function split_hour_min(hourMinStr){var hours=0,minutes=0;if(hourMinStr&&("string"==typeof hourMinStr||hourMinStr instanceof String)){var _hourMin=hourMinStr.split(" ");if(_hourMin.length>0)for(var i=0;i<_hourMin.length;i++){var x=_hourMin[i];x=x.toLowerCase(),-1!=x.indexOf("h")?(x=x.replace(/h/gi,""),hours=parseInt(x)):-1!=x.indexOf("m")&&(x=x.replace(/m/gi,""),minutes=parseInt(x))}hours=hours||0,minutes=minutes||0,minutes>=60&&(hours+=1,minutes=0)}return[hours,minutes]}function get_start_hr_min(startTime){var timeInfo={};if(startTime){var startTimeArr=split_hour_min(startTime);if(startTimeArr.length>1){var currTime=new Date,currHour=currTime.getHours(),currMin=currTime.getMinutes(),_startHour=startTimeArr[0],startDays=parseInt(_startHour/24),startDate=new Date;startDate.addDays(startDays).setHours(0,0,0,0);var startHour=_startHour%24,startMin=startTimeArr[1];startHour=currHour+startHour,startMin=currMin+startMin,startMin>=60?(startHour++,startMin-=60):startMin<0&&(startHour--,startMin=60+startMin),timeInfo.startDate=startDate,timeInfo.startDays=startDays,timeInfo.startHour=startHour,timeInfo.startMin=startMin,timeInfo.hour=startTimeArr[0],timeInfo.min=startTimeArr[1]}}return timeInfo}function get_time_suffix(time){time=time.toLowerCase();var suffix="";return-1!=time.indexOf("am")?suffix="am":-1!=time.indexOf("pm")&&(suffix="pm"),suffix}function split_time_string(time,ampm){time=time.replace(/pm/gi,""),time=time.replace(/am/gi,"");var timeArr=time.split(":"),hours=parseInt(timeArr[0]),minutes=parseInt(timeArr[1]);return"pm"==ampm&&hours<12?hours+=12:"am"==ampm&&12==hours&&(hours-=12),[hours,minutes]}function split_time_string_12hr(time){return split_time_string(time,get_time_suffix(time))}function get_disabled_time_ranges(minTime,maxTime,startTime){var minHour=minTime[0],minMin=minTime[1],currTime=(maxTime[0],maxTime[1],new Date);currTime.getHours(),currTime.getMinutes();currTime.setSeconds(0,0);var startHour=startTime.startHour,startMin=startTime.startMin;return(new Date).setHours(startHour,startMin,0,0),minHour=padZero(minHour,2),minMin=padZero(minMin,2),startHour=padZero(startHour,2),startMin=padZero(startMin,2),[[minHour+":"+minMin,startHour+":"+startMin]]}function disable_all_time_slots(tp,minTime,maxTime){var suffixMaxTime=get_time_suffix(maxTime),maxTimeArr=split_time_string(maxTime,suffixMaxTime),maxHour=maxTimeArr[0],maxMin=maxTimeArr[1];maxHour=padZero(maxHour,2),maxMin=padZero(parseInt(maxMin)+1,2);var newMaxTime=maxHour+":"+maxMin;tp.timepicker("option","disableTimeRanges",[[minTime,newMaxTime]])}function adjust_time_slots_based_on_date_selected(dp,tp){var dpDate=null;if(dp){var df=dp.data("date-format");dpDate=prepare_date(dp.val(),df,!0)}var minTime=tp.data("min-time"),maxTime=tp.data("max-time"),startTime=tp.data("start-time"),startTimeArr=get_start_hr_min(startTime);if(startTimeArr){var startDate=startTimeArr.startDate;if(null!=dp&&dpDate<startDate)disable_all_time_slots(tp,minTime,maxTime);else if(null!=dp&&dpDate>startDate)tp.timepicker("option","disableTimeRanges",[]);else{var minTimeArr=split_time_string_12hr(minTime),minHour=minTimeArr[0],minMin=minTimeArr[1],maxTimeArr=split_time_string_12hr(maxTime),maxHour=maxTimeArr[0],maxMin=maxTimeArr[1],startHour=startTimeArr.startHour,startMin=startTimeArr.startMin;if(startHour>maxHour||startHour==maxHour&&startMin>maxMin)disable_all_time_slots(tp,minTime,maxTime);else if(startHour<minHour||startHour==minHour&&startMin<minMin)tp.timepicker("option","disableTimeRanges",[]);else{var disabledTimeRanges=get_disabled_time_ranges(minTimeArr,maxTimeArr,startTimeArr);tp.timepicker("option","disableTimeRanges",disabledTimeRanges)}}}}
1function setup_time_picker(form,class_selector,data){form.find("."+class_selector).each(function(){var minTime=$(this).data("min-time"),maxTime=$(this).data("max-time"),step=$(this).data("step"),format=$(this).data("format"),linkedDate=($(this).data("start-time"),$(this).data("linked-date"));minTime=minTime||"12:00am",maxTime=maxTime||"11:30pm",step=step||"30",format=format||"h:i A";var args={minTime:minTime,maxTime:maxTime,step:step,timeFormat:format,forceRoundTime:!0,disableTextInput:!0,disableTouchKeyboard:!0,lang:data.lang};if($(this).timepicker(args),linkedDate){var dp=$("#"+linkedDate);dp.length&&adjust_time_slots_based_on_date_selected(dp,$(this))}else adjust_time_slots_based_on_date_selected(null,$(this))})}function setup_color_picker(form){var timer=null,parent=null;form.find(".thwepo-color-picker").length>0&&(form.find(".thwepo-color-picker").iris({change:function(event,ui){parent=$(this).parent(),parent.find(".thwepo-colorpicker-preview").css({backgroundColor:ui.color.toString()}),timer&&clearTimeout(timer),timer=setTimeout(function(){parent.find(".thwepo-color-picker").trigger("thwepocp_color_changed")},1e3)},hide:!0,border:!0}).click(function(){$(".iris-picker").hide(),$(this).closest(".value").find(".iris-picker").show()}),form.find(".thwepo-color-picker").keyup(function(){$(this).parent().find(".thwepo-colorpicker-preview").css({backgroundColor:this.value})})),$("body").click(function(){$(".iris-picker").hide()}),$(".thwepo-color-picker").click(function(event){event.stopPropagation()})}function setup_color_pick_preview(form){form.find(".thwepo-color-picker").length>0&&form.find(".thwepo-color-picker").each(function(){$(this).parent().find(".thwepo-colorpicker-preview").css({backgroundColor:this.value})})}function display_char_count(elm,isCount){var fid=elm.prop("id"),len=elm.val().length,displayElm=$("#"+fid+"-char-count");if(isCount)displayElm.text("("+len+" characters)");else{var maxLen=elm.prop("maxlength"),left=maxLen-len;displayElm.text("("+left+" characters left)"),rem<0&&displayElm.css("color","red")}}function apply_input_masking(elm){var data=$(elm).data("mask-pattern"),alias_items=["datetime","numeric","cssunit","url","IP","email","mac","vin"];-1!==$.inArray(data,alias_items)?$(elm).inputmask({alias:data}):$(elm).inputmask({mask:data,onincomplete:function(){add_unvalidated_fields(this)},oncomplete:function(){remove_validated_fields(this)}})}function add_unvalidated_fields(elm){var field=$(elm),name=$(elm).prop("name");if(field.prop("required")){var unvalidated_fields=$("#thwepo_unvalidated_fields").val(),unvalidated_fields_array=unvalidated_fields?unvalidated_fields.split(","):[];unvalidated_fields_array.push(name),unvalidated_fields=unvalidated_fields_array.toString(),$("#thwepo_unvalidated_fields").val(unvalidated_fields)}}function remove_validated_fields(elm){var name=($(elm),$(elm).prop("name")),unvalidated_fields=$("#thwepo_unvalidated_fields").val(),unvalidated_fields_array=unvalidated_fields?unvalidated_fields.split(","):[];unvalidated_fields_array=jQuery.grep(unvalidated_fields_array,function(value){return value!=name}),unvalidated_fields=unvalidated_fields_array.toString(),$("#thwepo_unvalidated_fields").val(unvalidated_fields)}function set_field_value_by_elm(elm,type,value){switch(type){case"radio":elm.val([value]);break;case"checkbox":1==elm.data("multiple")?(value=value||[],elm.val(value)):elm.val([value]);break;case"select":elm.prop("multiple")?elm.val(value):elm.val([value]);break;default:elm.val(value)}}function get_field_value(type,elm,name){var value="";switch(type){case"radio":value=$("input[type=radio][name="+name+"]:checked").val();break;case"checkbox":if(1==elm.data("multiple")){var valueArr=[];$("input[type=checkbox][name='"+name+"[]']:checked").each(function(){valueArr.push($(this).val())}),value=valueArr}else value=$("input[type=checkbox][name="+name+"]:checked").val();break;case"select":case"multiselect":value=elm.val();break;case"fieldset":value=$("fieldset[id='"+name+"'] input[type=radio]:checked").val();break;default:value=elm.val()}return value}function get_field_name(type,name,id,multiple){return"checkbox"==type&&multiple?name=name.replace("[]",""):"select"==type&&multiple&&(name=id),name}function show_magnified_image(elm){var full_image=$(elm).data("src");$("body").append('<div id="thwepo-image-popup-outer"><div class="thwepo-image-popup">
1<img src="'+full_image+'" alt="Option full image"</div></div>'),$("#thwepo-image-popup-outer").fadeIn("fast"),$("#thwepo-image-popup-outer").on("click",function(){$(this).remove()})}function thwepoviewpassword(elm){var icon=$(elm),parent_elm=icon.closest(".thwepo-password-field"),input=parent_elm.find("input");icon.hasClass("dashicons-visibility")?(input.attr("type","text"),icon.addClass("dashicons-hidden").removeClass("dashicons-visibility")):icon.hasClass("dashicons-hidden")&&(input.attr("type","password"),icon.addClass("dashicons-visibility").removeClass("dashicons-hidden"))}function number_format(number,decimals,dec_point,thousands_sep){number=(number+"").replace(/[^0-9+\-Ee.]/g,"");var n=isFinite(+number)?+number:0,prec=isFinite(+decimals)?Math.abs(decimals):0,sep=void 0===thousands_sep?",":thousands_sep,dec=void 0===dec_point?".":dec_point,s="";return s=(prec?function(n,prec){var k=Math.pow(10,prec);return""+Math.round(n*k)/k}(n,prec):""+Math.round(n)).split("."),s[0].length>3&&(s[0]=s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,sep)),(s[1]||"").length<prec&&(s[1]=s[1]||"",s[1]+=new Array(prec-s[1].length+1).join("0")),s.join(dec)}function animate_scroll_top(target_elm,offset){$("html, body").animate({scrollTop:$(target_elm).offset().top-offset},1e3)}function display_range_value(elm){var range_input=$(elm),range_val=range_input.val(),min_attr=(range_input.width(),range_input.attr("min")),max_attr=range_input.attr("max");const min=min_attr||0,max=max_attr||100,position=Number(100*(range_val-min)/(max-min));var display_div=range_input.siblings(".thwepo-range-val");display_div.html(range_val);var left_position;display_div.innerWidth();left_position="calc("+position+"% + ("+(8-.15*position)+"px))",display_div.css("left",left_position)}function apply_labelswatches_styles(){$(".thwepo_labelswatches").each(function(index,label){var label_value_section=$(label).find(".value"),container_class=($(label).attr("class")||"").trim().replace(/\s+/g,".").replace(/^\./,"");set_labelswatches_style({labelswatches_option_text_color_active:label_value_section.data("labelswatches-option-text-color-active"),labelswatches_option_text_color_inactive:label_value_section.data("labelswatches-option-text-color-inactive"),labelswatches_option_text_color_hover:label_value_section.data("labelswatches-option-text-color-hover"),labelswatches_option_background_color_active:label_value_section.data("labelswatches-option-background-color-active"),labelswatches_option_background_color_inactive:label_value_section.data("labelswatches-option-background-color-inactive"),labelswatches_option_background_color_hover:label_value_section.data("labelswatches-option-background-color-hover"),labelswatches_option_border_color_active:label_value_section.data("labelswatches-option-border-color-active"),labelswatches_option_border_color_inactive:label_value_section.data("labelswatches-option-border-color-inactive"),labelswatches_option_border_color_hover:label_value_section.data("labelswatches-option-border-color-hover")}
1,container_class)})}function set_labelswatches_style(label_swatches_colors,container_class){var isCustomColorFlag=!1,styleContent="";if((label_swatches_colors.labelswatches_option_text_color_hover||label_swatches_colors.labelswatches_option_background_color_hover||label_swatches_colors.labelswatches_option_border_color_hover)&&(styleContent+="."+container_class+" .value .thwepo-radio-label-swatch:hover { ",styleContent+=label_swatches_colors.labelswatches_option_text_color_hover?"color: "+label_swatches_colors.labelswatches_option_text_color_hover+" !important; ":"",styleContent+=label_swatches_colors.labelswatches_option_background_color_hover?"background-color: "+label_swatches_colors.labelswatches_option_background_color_hover+" !important; ":"",styleContent+=label_swatches_colors.labelswatches_option_border_color_hover?"border-color: "+label_swatches_colors.labelswatches_option_border_color_hover+" !important; ":"",styleContent+="}\n",isCustomColorFlag=!0),(label_swatches_colors.labelswatches_option_text_color_active||label_swatches_colors.labelswatches_option_background_color_active||label_swatches_colors.labelswatches_option_border_color_active)&&(styleContent+="."+container_class+" .value input:checked + .thwepo-label-swatch-label .thwepo-radio-label-swatch { ",styleContent+=label_swatches_colors.labelswatches_option_text_color_active?"color: "+label_swatches_colors.labelswatches_option_text_color_active+"; ":"",styleContent+=label_swatches_colors.labelswatches_option_background_color_active?"background-color: "+label_swatches_colors.labelswatches_option_background_color_active+"; ":"",styleContent+=label_swatches_colors.labelswatches_option_border_color_active?"border-color: "+label_swatches_colors.labelswatches_option_border_color_active+"; ":"",styleContent+="}\n",isCustomColorFlag=!0),(label_swatches_colors.labelswatches_option_text_color_inactive||label_swatches_colors.labelswatches_option_background_color_inactive||label_swatches_colors.labelswatches_option_border_color_inactive)&&(styleContent+="."+container_class+" .value input + .thwepo-label-swatch-label .thwepo-radio-label-swatch { ",styleContent+=label_swatches_colors.labelswatches_option_text_color_inactive?"color: "+label_swatches_colors.labelswatches_option_text_color_inactive+"; ":"",styleContent+=label_swatches_colors.labelswatches_option_background_color_inactive?"background-color: "+label_swatches_colors.labelswatches_option_background_color_inactive+"; ":"",styleContent+=label_swatches_colors.labelswatches_option_border_color_inactive?"border-color: "+label_swatches_colors.labelswatches_option_border_color_inactive+"; ":"",styleContent+="}\n",isCustomColorFlag=!0),isCustomColorFlag){var style=document.createElement("style");style.innerHTML=styleContent,document.head.appendChild(style)}}var LINKED_DATE_FORMAT=/^{[a-z\_]+[a-z0-9\_]*}$/,DATE_FORMAT_1=/^(19|20)\d{2}-(0?[1-9]|1[0-2])-(0?[1-9]|1\d|2\d|3[01])$/,weekDays=["sun","mon","tue","wed","thu","fri","sat"];return $.fn.getType=function(){try{return"INPUT"==this[0].tagName?this[0].type.toLowerCase():this[0].tagName.toLowerCase()}catch(err){return"E001"}},{setup_enhanced_select:setup_enhanced_select,setup_date_picker:setup_date_picker,setup_daterange_picker:setup_daterange_picker,setup_time_picker:setup_time_picker,setup_color_picker:setup_color_picker,setup_color_pick_preview:setup_color_pick_preview,display_char_count:display_char_count,remove_duplicates:remove_duplicates,remove_empty_values:remove_empty_values,set_field_value_by_elm:set_field_value_by_elm,get_field_value:get_field_value,get_field_name:get_field_name,isInputField:isInputField,isInputChoiceField:isInputChoiceField,getInputField:getInputField,is_date_eq:is_date_eq,is_date_gt:is_date_gt,is_date_lt:is_date_lt,is_day_eq:is_day_eq,isEmpty:isEmpty,isInt:isInt,isFloat:isFloat,is_empty_arr:is_empty_arr,array_intersection:array_intersection,is_subset_of:is_subset_of,apply_input_masking:apply_input_masking,show_magnified_image:show_magnified_image,thwepoviewpassword:thwepoviewpassword,number_format:number_format,animate_scroll_top:animate_scroll_top,display_range_value:display_range_value,apply_labelswatches_styles:apply_labelswatches_styles}}(window.jQuery,window,document),thwepo_public_conditions=function($,window,document){"use strict";function hide_section(celm,validations,needSetup){celm.hide();var sid=celm.prop("id");celm.addClass("thwepo-disabled-section"),
2celm.find(".validate-required").length&&celm.find(".validate-required").each(function(){$(this).removeAttr("required")});var disabled_snames=$("#thwepo_disabled_sections").val(),disabled_snames_x=disabled_snames?disabled_snames.split(","):[];disabled_snames_x.push(sid),disabled_snames=disabled_snames_x.toString(),$("#thwepo_disabled_sections").val(disabled_snames),enable_disable_price_fields(celm,!1,!needSetup),$(document.body).trigger("hide_the_section",[celm])}function show_section(celm,validations,needSetup){celm.show();var sid=celm.prop("id");celm.removeClass("thwepo-disabled-section"),celm.find(".validate-required").length&&celm.find(".validate-required:not(.thwepo-disabled-field)").each(function(){$(this).attr("required",!0)});var disabled_snames=$("#thwepo_disabled_sections").val(),disabled_snames_x=disabled_snames?disabled_snames.split(","):[];disabled_snames_x=jQuery.grep(disabled_snames_x,function(value){return value!=sid}),disabled_snames=disabled_snames_x.toString(),$("#thwepo_disabled_sections").val(disabled_snames),enable_disable_price_fields(celm,!0,!needSetup),$(document.body).trigger("show_the_section",[celm])}function hide_field(cfield,validations,needSetup){var cinput=cfield.find(":input.thwepo-input-field");"hidden"===cfield.getType()&&(cinput=cfield);var ftype=cinput.getType(),fid=cinput.prop("id");"radio"==ftype&&(fid=cinput.prop("name")),"checkbox"==ftype&&(fid=cinput.prop("name"),fid=fid.replace("[]","")),cinput.data("current-value")||cinput.data("current-value",thwepo_public_base.get_field_value(ftype,cinput,fid)),cfield.hide(),thwepo_public_base.set_field_value_by_elm(cinput,ftype,""),cinput.addClass("thwepo-disabled-field"),cinput.removeAttr("required");var change_event_disabled_fields=thwepo_public_var.change_event_disabled_fields,change_e_disabled_fields=change_event_disabled_fields?change_event_disabled_fields.split(","):[];-1===$.inArray(fid,change_e_disabled_fields)&&cinput.trigger("change",[{mt:!0}]);var disabled_fnames=$("#thwepo_disabled_fields").val(),disabled_fnames_x=disabled_fnames?disabled_fnames.split(","):[];disabled_fnames_x.push(fid),disabled_fnames=disabled_fnames_x.toString(),$("#thwepo_disabled_fields").val(disabled_fnames),validations&&(cfield.removeClass(validations),cfield.removeClass("woocommerce-validated woocommerce-invalid woocommerce-invalid-required-field")),$(document.body).trigger("hide_the_field",[cfield])}function show_field(cfield,validations,needSetup){var cinput=cfield.find(":input.thwepo-input-field");"hidden"===cfield.getType()&&(cinput=cfield);var ftype=cinput.getType(),fid=cinput.prop("id");"radio"==ftype&&(fid=cinput.prop("name")),"checkbox"==ftype&&(fid=cinput.prop("name"),fid=fid.replace("[]","")),cfield.show();var fval=cinput.data("current-value");fval&&(thwepo_public_base.set_field_value_by_elm(cinput,ftype,fval),cinput.data("current-value","")),cinput.removeClass("thwepo-disabled-field"),cinput.hasClass("val
2idate-required")&&cinput.attr("required",!0);var change_event_disabled_fields=thwepo_public_var.change_event_disabled_fields,change_e_disabled_fields=change_event_disabled_fields?change_event_disabled_fields.split(","):[];-1===$.inArray(fid,change_e_disabled_fields)&&cinput.trigger("change",[{mt:!0}]);var disabled_fnames=$("#thwepo_disabled_fields").val(),disabled_fnames_x=disabled_fnames?disabled_fnames.split(","):[];disabled_fnames_x=jQuery.grep(disabled_fnames_x,function(value){return value!=fid}),disabled_fnames=disabled_fnames_x.toString(),$("#thwepo_disabled_fields").val(disabled_fnames),validations&&cfield.addClass(validations),$(document.body).trigger("show_the_field",[cfield])}function hide_elm(elm,validations,needSetup){"section"===elm.data("rules-elm")?hide_section(elm,validations,needSetup):hide_field(elm,validations,needSetup)}function show_elm(elm,validations,needSetup){"section"===elm.data("rules-elm")?show_section(elm,validations,needSetup):show_field(elm,validations,needSetup)}function enable_disable_price_fields(wrapper,enable,trigger_price_calc){var price_fields=wrapper.find(".thwepo-price-field");price_fields.length&&(enable?price_fields.removeClass("thwepo-disabled-field"):price_fields.addClass("thwepo-disabled-field"),trigger_price_calc&&thwepo_public_price.may_calculate_extra_cost())}function validate_condition(condition,valid,needSetup,cfield){if(condition){var operand_type=condition.operand_type,operand=condition.operand,operator=condition.operator,cvalue=condition.value;"field"===operand_type&&operand&&jQuery.each(operand,function(){var field=!1,fname=this;if("product_variation"==this){if(""!=cvalue){var variation_arr=cvalue.split(":");if(2==variation_arr.length){var fid=variation_arr[0]?variation_arr[0].trim():"";cvalue=variation_arr[1]?variation_arr[1].trim():"",fid&&(fid=fid.replace(/\s+/g,"-").toLowerCase(),$("#"+fid).length?field=$("#"+fid):$("[name="+fid+"]").length&&(field=$("[name="+fid+"]")),fname=fid,valid=!!field&&valid)}}}else{var field=$("#"+this);0==field.length&&(field=$("input[name='"+this+"']"),0==field.length&&(field=$("input[name='"+this+"[]']")))}if(field){var ftype=field.getType(),value=thwepo_public_base.get_field_value(ftype,field,fname);if("empty"===operator&&""!=value)valid=!1;else if("not_empty"===operator&&""==value)valid=!1;else if("value_eq"===operator&&value!=cvalue)valid=!1;else if("value_ne"===operator&&value==cvalue)valid=!1;else if("value_in"===operator){var value_arr=[],cvalue_arr=[];value&&(value_arr=$.isArray(value)?value:value.split(",")),cvalue&&(cvalue_arr=$.isArray(cvalue)?cvalue:cvalue.split(",")),!thwepo_public_base.is_empty_arr(value_arr)&&thwepo_public_base.is_subset_of(cvalue_arr,value_arr)||(valid=!1)}else if("value_cn"===operator){var value_arr=[],cvalue_arr=[];value&&(value_arr=$.isArray(value)?value:value.split(",")),cvalue&&(cvalue_arr=$.isArray(cvalue)?cvalue:cvalue.split(",")),thwepo_public_base.is_subset_of(value_arr,cvalue_arr)||(valid=!1)}else if("value_nc"===operator){var value_arr=[],cvalue_arr=[];value&&(value_arr=$.isArray(value)?value:value.split(",")),cvalue&&(cvalue_arr=$.isArray(cvalue)?cvalue:cvalue.split(","));var intersection=thwepo_public_base.array_intersection(cvalue_arr,value_arr);thwepo_public_base.is_empty_arr(intersection)||(valid=!1)}
2else if("value_gt"===operator)valid=!(!$.isNumeric(value)||!$.isNumeric(cvalue))&&(!(Number(value)<=Number(cvalue))&&valid);else if("value_le"===operator)valid=!(!$.isNumeric(value)||!$.isNumeric(cvalue))&&(!(Number(value)>=Number(cvalue))&&valid);else if("value_sw"!==operator||value.startsWith(cvalue))if("value_nsw"===operator&&value.startsWith(cvalue))valid=!1;else if("date_eq"!==operator||thwepo_public_base.is_date_eq(field,cvalue))if("date_ne"===operator&&thwepo_public_base.is_date_eq(field,cvalue))valid=!1;else if("date_gt"!==operator||thwepo_public_base.is_date_gt(field,cvalue))if("date_lt"!==operator||thwepo_public_base.is_date_lt(field,cvalue))if("day_eq"!==operator||thwepo_public_base.is_day_eq(field,cvalue)){if("day_ne"===operator&&thwepo_public_base.is_day_eq(field,cvalue))valid=!1;else if("checked"===operator){var checked=field.prop("checked");valid=!!checked&&valid}else if("not_checked"===operator){var checked=field.prop("checked");valid=!checked&&valid}else if("regex"===operator&&cvalue){var regex=new RegExp(cvalue);regex.test(value)||(valid=!1)}}else valid=!1;else valid=!1;else valid=!1;else valid=!1;else valid=!1;if(needSetup){var depFields=field.data("fields");
2if(depFields){var depFieldsArr=depFields.split(",");depFieldsArr.push(cfield.prop("id")),depFields=depFieldsArr.toString()}else depFields=cfield.prop("id");field.data("fields",depFields),add_field_value_change_handler(field)}}})}return valid}function validate_field_condition(cfield,needSetup){var conditionalRules=cfield.data("rules"),conditionalRulesAction=cfield.data("rules-action"),validations=cfield.data("validations"),valid=!0;if(conditionalRules){try{jQuery.each(conditionalRules,function(){var ruleSet=this;jQuery.each(ruleSet,function(){var rule=this,validRS=!1;jQuery.each(rule,function(){var conditions=this,validCS=!0;jQuery.each(conditions,function(){validCS=validate_condition(this,validCS,needSetup,cfield)}),validRS=validRS||validCS}),valid=valid&&validRS})})}catch(err){alert(err)}"hide"===conditionalRulesAction?valid?hide_elm(cfield,validations,needSetup):show_elm(cfield,validations,needSetup):valid?show_elm(cfield,validations,needSetup):hide_elm(cfield,validations,needSetup)}}function conditional_field_value_change_listner(event,data){conditional_field_value_changed(this,data)}function trigger_conditional_field_value_change(elm){conditional_field_value_changed(elm,!1)}function conditional_field_value_changed(elm,data){var depFields=$(elm).data("fields");
2if(depFields){var depFieldsArr=depFields.split(",");depFieldsArr=thwepo_public_base.remove_duplicates(depFieldsArr),jQuery.each(depFieldsArr,function(){if(this.length>0){validate_field_condition($("#"+this),!1)}})}data&&data.mt||thwepo_public_price.may_calculate_extra_cost()}function add_field_value_change_handler(field){field.off("change",conditional_field_value_change_listner),field.on("change",conditional_field_value_change_listner)}return{validate_field_condition:validate_field_condition,conditional_field_value_change_listner:conditional_field_value_change_listner,trigger_conditional_field_value_change:trigger_conditional_field_value_change}}(window.jQuery,window,document),thwepo_public_edit_cart=function($,window,document){"use strict";function setup_cart_edit_state(){new URLSearchParams(window.location.search).has("cart_key")&&($(".single_add_to_cart_button").text("Update Cart"),$(".variations select").prop("disabled",!0),$(".reset_variations").css("pointer-events","none").css("opacity","0.5"))}function process_variation_attributes(product_url,cart_item){Array.isArray(cart_item.variation)&&cart_item.variation.forEach(function(variation){const attribute_name=variation.attribute.toLowerCase(),attribute_value=variation.value,global_attribute=thwepo_public_var.global_attributes.find(function(attr){return attr.name.toLowerCase()===attribute_name});if(global_attribute){const term=global_attribute.terms.find(function(term){return term.name.toLowerCase()===attribute_value.toLowerCase()});term&&product_url.searchParams.set("attribute_pa_"+global_attribute.slug,term.slug)}else product_url.searchParams.set("attribute_"+attribute_name,attribute_value)})}function modify_cart_item_name(original_name,extensions,args){const has_thwepo_options=args.cartItem.item_data&&args.cartItem.item_data.length>0||args.cartItem.extensions&&args.cartItem.extensions.thwepo_options;if(!thwepo_public_var.enable_edit_cart||"products_with_options"===thwepo_public_var.enable_edit_cart&&!has_thwepo_options)return original_name;try{const product_url=new URL(args.cartItem.permalink);"variation"===args.cartItem.type&&Array.isArray(args.cartItem.variation)&&args.cartItem.variation.length>0&&process_variation_attributes(product_url,args.cartItem),product_url.searchParams.set("cart_key",args.cartItem.key);const edit_link='<a href="'+product_url.toString()+'" class="thwepo-edit-product-link">edit</a>';return original_name+'<span class="thwepo-edit-product-container"> ('+edit_link+")</span>"}catch(error){return original_name}}function init_blocks_cart_filter(){window.wc&&window.wc.cart&&window.wc.blocksCheckout&&window.wc.blocksCheckout.registerCheckoutFilters("thwepo-blocks-cart-edit-link",{itemName:modify_cart_item_name})}return $(document).ready(init_blocks_cart_filter),{setup_cart_edit_state:setup_cart_edit_state}}(window.jQuery,window,document),thwepo_public_file_upload=function($,window,document){function handle_file_upload(elm){$("."+elm).on("change",function(){var upload_field=$(this);upload_field.parent(".value").find(".thwepo-preview-file").html(""),this.files.length>0&&$.each(this.files,function(){if(!validate_file(this))return show_validation_error(upload_field),!1;read_and_preview_uploaded_file(this,upload_field)})})}function validate_file(file){var valid=!0;if(file.name){var uploaded_file_size=file.size;valid=thwepo_public_var.wp_max_file_upload_size>uploaded_file_size}return valid}function show_validation_error(upload_field){var preview_elm=upload_field.siblings(".thwepo-preview-file");if(!(preview_elm.find(".thwepo-file-size-error").length>0)){var validation_error=$('<span class="thwepo-file-size-error">'+thwepo_public_var.file_upload_error+"</span>");setTimeout(function(){preview_elm.html(validation_error),upload_field.val(null)},50)}}function read_and_preview_uploaded_file(file,elm){if(file.name){var reader=new FileReader;reader.onload=function(event){var image_url=reader.result,image_holder=$('<span data-file-name="'+file.name+'" class="thwepo-uploaded-item"></span>'),image_html=$('<span class="thwepo-uploaded-file">'+file.name+"</span>"),remove_html=$('<span onclick="thwepo_remove_uploaded_file(this)" class="thwepo-remove-image">X</span>');image_html.attr("src",image_url),image_holder.append(image_html),image_holder.append(remove_html),elm.siblings(".thwepo-preview-file").append(image_holder)}
2,reader.readAsDataURL(file)}}function remove_uploaded_file(elm){var current_elm=$(elm),current_item=current_elm.parent(".thwepo-uploaded-item"),parent_td=current_elm.closest(".value"),file_name=current_item.data("file-name"),input_field=parent_td.find(".thwepo-file-upload"),input_file_array=[],input_file_array=Array.from(input_field[0].files);for(var key in input_file_array)input_file_array.hasOwnProperty(key)&&input_file_array[key].name==file_name&&(input_file_array.splice(key,1),current_item.remove());var uploaded_files=input_file_array;const dataTransfer=new DataTransfer||new ClipboardEvent("").clipboardData;for(var key in uploaded_files)uploaded_files.hasOwnProperty(key)&&dataTransfer.items.add(input_file_array[key]);input_field[0].files=dataTransfer.files,input_field.trigger("thwepo-file-upload-change")}return{handle_file_upload:handle_file_upload,remove_uploaded_file:remove_uploaded_file}}(window.jQuery,window,document),thwepo_public_image_updater=function($,window,document){"use strict";function store_original_product_image(){const product_image_thumbnail=thwepo_public_var.product_image_thumbnail,$all_image_elements=$(product_image_container_
2class);var $first_image_element="";if($all_image_elements&&($first_image_element=is_avado_theme_enabled?$all_image_elements.eq(1):$all_image_elements.first()),$first_image_element){const $image=$first_image_element.find("img"),original_product_image_link=$image.attr("src"),original_product_full_image_link=$image.data("large_image"),srcset=$image.attr("srcset");original_product_image.img_link=original_product_image_link==product_image_thumbnail?product_image_thumbnail:original_product_image_link,original_product_image.full_image_link=original_product_full_image_link==product_image_thumbnail?product_image_thumbnail:original_product_full_image_link,original_product_image.srcset=srcset}}function handle_image_group_option($element){if($element.is(":checked")){const new_image_link=$element.attr("data-full-image"),full_image_url=$element.attr("data-thumbnail-image");reset_product_image_slider_position(),update_product_image(new_image_link,full_image_url)}else reset_product_image()}function handle_click_outside_options(event){if(image_update_flag){const is_outside_thwepo_product_image_trigger=!$(event.target).hasClass("thwepo-product-image-update-trigger");!$(event.target).hasClass("thwepo-product-image-update-flag")&&is_outside_thwepo_product_image_trigger&&(reset_product_image(),image_update_flag=!1)}}function reset_product_image(){image_update_flag&&(image_update_flag=!1,update_product_image(original_product_image.img_link,original_product_image.full_image_link,original_product_image.srcset))}function reset_product_image_slider_position(){const galleryElement=$(".woocommerce-product-gallery");if(galleryElement.length>0){const slider=galleryElement.data("flexslider");slider&&"function"==typeof slider.flexslider&&slider.flexslider(0)}}function update_product_image(new_image_link,full_image_url,srcset){image_update_flag=!0;
2const $all_image_elements=$(product_image_container_class);var $first_image_element="";if($all_image_elements&&($first_image_element=is_avado_theme_enabled?$all_image_elements.eq(1):$all_image_elements.first()),$first_image_element){$first_image_element.attr("data-thumb",new_image_link),$first_image_element.find("a").attr("href",new_image_link);$first_image_element.find("img").each(function(index,image){$(image).attr({src:new_image_link,"data-src":new_image_link,"data-large_image":new_image_link})});var new_src_set="";srcset&&(new_src_set=srcset),$first_image_element.find("img").attr("srcset",new_src_set)}}const is_avado_theme_enabled=$("body").hasClass("theme-Avada");var image_update_flag=!1,original_product_image={img_link:"",full_image_link:"",srcset:""},product_image_classes=[".woocommerce-product-gallery__image",".wc-block-components-product-image",".woocommerce-product-gallery__image--placeholder",".woocommerce-product-gallery .ct-media-container"],product_image_container_class=!1;$.each(product_image_classes,function(index,className){if($(className).length>
20)return product_image_container_class=className,!1}),$(".thwepo-product-image-update-trigger").length>0&&($(document).on("click",".thwepo-product-image-update-trigger",function(){original_product_image.img_link||store_original_product_image(),handle_image_group_option($(this))}),$(document).on("click",handle_click_outside_options))}(window.jQuery,window,document),thwepo_js_price_calculation=function($,window,document){"use strict";function initializePriceData(data){priceData=data,originalPrice=parseFloat(priceData.thwepo_product_price),updatePriceDisplay()}function calculateTotalPrice(){var totalPrice=originalPrice,priceExtra=0,hasDynamicExBasePrice=!1,priceFormat=thwepo_public_var.price_data.price_format,currencySymbol=thwepo_public_var.price_data.currency_symbol,decimal=thwepo_public_var.price_data.decimals,decimalSeparator=thwepo_public_var.price_data.decimal_separator,thousandSeparator=thwepo_public_var.price_data.thousand_separator;if(!is_valid_request()){const formattedPriceOriginal=formatPrice(priceFormat,currencySymbol,originalPrice,decimal,decimalSeparator,thousandSeparator),formattedPriceExtra=formatPrice(priceFormat,currencySymbol,priceExtra,decimal,decimalSeparator,thousandSeparator),formattedPriceFinal=formatPrice(priceFormat,currencySymbol,totalPrice,decimal,decimalSeparator,thousandSeparator);return{status:!1,price_original:originalPrice,price_extra:priceExtra,price_final:totalPrice,display_price_original:formattedPriceOriginal,display_price_extra:formattedPriceExtra,display_price_final:formattedPriceFinal}}for(var fieldName in priceData.price_info)if(priceData.price_info.hasOwnProperty(fieldName)){var field=priceData.price_info[fieldName],fieldPrice=calculateFieldPrice(field);priceExtra+=fieldPrice,"dynamic-excl-base-price"===field.price_type&&(hasDynamicExBasePrice=!0)}totalPrice=hasDynamicExBasePrice?priceExtra:originalPrice+priceExtra;const formattedPriceOriginal=formatPrice(priceFormat,currencySymbol,originalPrice,decimal,decimalSeparator,thousandSeparator),formattedPriceExtra=formatPrice(priceFormat,currencySymbol,priceExtra,decimal,decimalSeparator,thousandSeparator),formattedPriceFinal=formatPrice(priceFormat,currencySymbol,totalPrice,decimal,decimalSeparator,thousandSeparator);return{status:!0,price_original:originalPrice,price_extra:priceExtra,price_final:totalPrice,display_price_original:formattedPriceOriginal,display_price_extra:formattedPriceExtra,display_price_final:formattedPriceFinal}}function is_valid_request(){return!!priceData.product_id&&!(priceData.is_variable_product&&(!priceData.variation_id||"0"===priceData.variation_id))}function calculateFieldPrice(field){var totalPrice=0,value=field.value;if("custom-formula"===field.price_type)totalPrice=calculateCustomFormulaPrice(value,field.price,field);else if(field.product_group_quantity)totalPrice=calculateProductGroupPrice(field);else if(Array.isArray(value)){var prices=field.price.split(","),priceTypes=field.price_type.split(","),priceOptions=field.price_options.split(",");value.forEach(function(selectedValue){var index=priceOptions.indexOf(selectedValue);if(-1!==index){var price=parseFloat(prices[index])||0,priceType=priceTypes[index]||"normal";totalPrice+=calculateSinglePrice(price,priceType,selectedValue,field)}})}else totalPrice=calculateSinglePrice(parseFloat(field.price)||0,field.price_type,value,field);return totalPrice}function calculateSinglePrice(price,priceType,value,field){switch(priceType){case"normal":case"fixed":return price;case"percentage":return originalPrice*(price/100);case"char-count":return calculateCharCountPrice(value,price,field);case"custom":return parseFloat(value)||0;case"dynamic":case"dynamic-excl-base-price":return calculateDynamicPrice(value,price,field);case"custom-formula":return calculateCustomFormulaPrice(value,field.custom_formula,field);default:return 0}}function calculateCharCountPrice(value,price,field){var charCount=value?value.length:0,priceUnit=parseFloat(field.price_unit)||1,minUnit=parseFloat(field.price_min_unit)||0;return charCount>minUnit?(charCount-minUnit)*price/priceUnit:0}function calculateDynamicPrice(value,price,field){if(/^-?\d+(\.\d+)?$/.test(value)){var unitCount=parseFloat(value),priceUnit=parseFloat(field.price_unit)||1,minUnit=parseFloat(field.price_min_unit)||0;if(unitCount>minUnit)return(unitCount-minUnit)*price/priceUnit}return 0}function calculateProductGroupPrice(field){var totalPrice=0;if(field.multiple){var prices=field.price.split(","),priceTypes=field.price_type.split(","),priceOptions=field.price_options.split(","),quantities=field.product_group_quantity.split(","),optionPrdPrices=field.option_prd_price?field.option_prd_price.split(","):[],selectedValues=field.value,optionPrdPriceIndex=0;
2selectedValues.forEach(function(selectedValue){var optionIndex=priceOptions.indexOf(selectedValue.toString());if(-1!==optionIndex){var price=parseFloat(prices[optionIndex])||0,priceType=priceTypes[optionIndex]||"normal",quantity=parseInt(quantities[optionIndex])||1;switch(priceType){case"normal":case"product_price":totalPrice+=price*quantity;break;case"option_percentage":var productPrice=parseFloat(optionPrdPrices[optionPrdPriceIndex])||0;totalPrice+=productPrice*(price/100)*quantity,optionPrdPriceIndex++;break;default:totalPrice+=price*quantity}}})}else{var price=parseFloat(field.price)||0,priceType=field.price_type,quantity=parseInt(field.product_group_quantity)||1,optionProductPrice=parseFloat(field.option_prd_price)||0;switch(priceType){case"normal":case"product_price":totalPrice=price*quantity;break;case"option_percentage":totalPrice=optionProductPrice*(price/100)*quantity;break;default:totalPrice=price*quantity}}return totalPrice}function calculateCustomFormulaPrice(value,formula,field){var formulaStr="number"==typeof formula?formula.toString():formula;if("string"!=typeof formulaStr)return console.error("Invalid formula type:",typeof formula,formula),0;var placeholders={value:parseFloat(value)||0,product_price:parseFloat(priceData.thwepo_product_price)||0,quantity:parseFloat(priceData.product_qty)||1,length:value?value.length:0};for(var fieldName in priceData.price_info)if(priceData.price_info.hasOwnProperty(fieldName)){var fieldData=priceData.price_info[fieldName];placeholders["thwepo_"+fieldName+"_price"]=parseFloat(fieldData.price)||0,placeholders["thwepo_"+fieldName+"_value"]=isNaN(fieldData.value)?fieldData.value:parseFloat(fieldData.value)||0}/^\d+(\.\d+)?$/.test(formulaStr)||(formulaStr=formulaStr.replace(/{([^}]+)}/g,function(match,key){return placeholders.hasOwnProperty(key)?placeholders[key]:(console.warn("Unknown placeholder in formula:",key),0)}));try{var result=new Function("return "+formulaStr)();return isNaN(result)?(console.error("Formula resulted in NaN:",formulaStr),0):parseFloat(result)}catch(e){return console.error("Error evaluating custom formula:",e,"Formula:",formulaStr),0}}function formatPrice(format,currencySymbol,price,decimal,decimalSeparator,thousandSeparator){var priceString=price.toFixed(decimal).replace(".",decimalSeparator),parts=priceString.split(decimalSeparator);return parts[0]=parts[0].replace(/\B(?=(\d{3})+(?!\d))/g,thousandSeparator),priceString=parts.join(decimalSeparator),format.replace("%1$s",currencySymbol).replace("%2$s",priceString)}function updatePriceDisplay(){var data=calculateTotalPrice();$(document.body).trigger("thwepo_js_calculation_success",[data]),display_new_js_price(data),display_js_price_table(data),$(document.body).trigger("thwepo_js_calculation_end")}function display_new_js_price(data){var display_price="",price_ph="",isVariationProduct=priceData.is_variable_product;if(!data.status)return!1;if(0!==data.price_extra?data.display_price_final&&(display_price=data.display_price_final):data.display_price_original&&(display_price=data.display_price_original),isVariationProduct?thwepo_public_var.price_ph_variable&&$(thwepo_public_var.price_ph_variable).length?price_ph=thwepo_public_var.price_ph_variable:$(".woocommerce-variation-price .price").length?price_ph=".woocommerce-variation-price .price":$(".product-info .price").length?price_ph=".product-info .price":$(".product-infos .price").length?price_ph=".product-infos .price":$(".product_infos .price").length?price_ph=".product_infos .price":$(".summary .price").length&&(price_ph=".summary .price"):thwepo_public_var.price_ph_simple&&$(thwepo_public_var.price_ph_simple).length?price_ph=thwepo_public_var.price_ph_simple:$(".summary .price").length?price_ph=".summary .price":$(".product-info .price").length?price_ph=".product-info .price":$(".product-infos .price").length?price_ph=".product-infos .price":$(".product_infos .price").length?price_ph=".product_infos .price":$(".price").length?price_ph=".price":$(".wc-block-components-product-price").length&&(price_ph=".wc-block-components-product-price"),price_ph&&display_price){var priceContainer=$(price_ph),del=priceContainer.find("del"),ins=priceContainer.find("ins");0!==data.price_extra?del.length>0&&ins.length>0?"woodmart"===thwepo_public_var.active_theme&&".wc-block-components-product-price"!=price_ph?2===del.length&&2===ins.length?(del.hide(),ins.html(display_price)):priceContainer.html(display_price):(del.hide(),ins.html(display_price)):priceContainer.html(display_price):del.length>0&&ins.length>0?"woodmart"===thwepo_public_var.active_theme&&".wc-block-components-product-price"!=price_ph?2===del.length&&2===ins.length?(del.show(),ins.html(display_price)):priceContainer.html(display_price):(del.show(),ins.html(display_price)):priceContainer.html(display_price)}}function display_js_price_table(data){var priceTable=$(".thwepo-price-table"),isVariationProduct=priceData.is_variable_product,show=!1;if(data.status){var initial_price=priceTable.find(".total-price .value").attr("data-price"),price_extra=data.price_extra?data.price_extra:0,display_price_extra=data.display_price_extra?data.display_price_extra:thwepo_public_price.prepare_price_html(0),display_price_final=data.display_price_final?data.display_price_final:thwepo_public_price.prepare_price_html(initial_price),display_price_original=data.display_price_original?data.display_price_original:thwepo_public_price.prepare_price_html(initial_price);if(priceTable.find(".extra-price .value").html(display_price_extra),isVariationProduct){var variationId=priceData.variation_id?priceData.variation_id:priceData.product_id,variationPrice=priceTable.attr("data-variation-"+variationId);variationPrice?priceTable.find(".product-price .value").html(variationPrice):priceTable.find(".product-price .value").html(display_price_original)}else priceTable.find(".product-price .value ins").html(display_price_original);priceTable.find(".total-price .value").html(display_price_final),show=0!=price_extra}show?priceTable.show():priceTable.hide()}function triggerPriceCalculation(data){initializePriceData(data)}var priceData={},originalPrice=0;return{init:triggerPriceCalculation}}(window.jQuery,window,document),thwepo_public_price=function($,window,document){"use strict";function is_active_price_field(elm){var result=!0;return elm.hasClass("thwepo-disabled-field")&&(result=!1),result}function is_multiselect_field(elm,type){var multiple=0;return"checkbox"==type?multiple=elm.data("multiple"):"select"==type&&elm.attr("multiple")&&(multiple=1),multiple}function get_price_field_value(elm,type,name){var value=thwepo_public_base.get_field_value(type,elm,name);return"radio"===type?value=elm.is(":checked")?value:"":"file"===type&&(value||(value=elm.data("file-name"),value=value||"")),value}function is_variable_product(form){var is_var_product=!1;return form.hasClass("variations_form")&&(is_var_product=!0),is_var_product}function is_grouped_product(form){var is_grp_product=!1;return form.hasClass("grouped_form")&&(is_grp_product=!0),is_grp_product}function get_product_id(){var product_id=$("input[name=add-to-cart]").val();
2return product_id||(product_id=$("button[name=add-to-cart]").val()),product_id}function get_variation_id(){return $("input[name=variation_id]").val()}function get_grouped_ids(){return $("input[name=grouped_child_ids]").val()}function get_selected_options(elm,name,type,multiple){var options=null;return"select"===type?options=elm.find("option:selected"):"radio"===type?elm.is(":checked")&&(options=elm):"checkbox"===type&&multiple&&(options=$("input[type=checkbox][name='"+name+"[]']:checked")),options}function prepare_price_props_for_selected_options(elm,name,type,multiple){var price_props=null,oPrice="",oPriceType="",oPriceOptions="",oPtionPrdPrice="",options=get_selected_options(elm,name,type,multiple);if(options){if(multiple)options.each(function(){var oprice=$(this).data("price"),opriceType=$(this).data("price-type"),optionVal=$(this).val(),optionPrdPrice=$(this).data("productPrice");oprice&&(opriceType=opriceType||"normal",oPrice.trim()&&(oPrice+=","),oPriceType.trim()&&(oPriceType+=","),oPriceOptions.trim()&&(oPriceOptions+=","),void 0!==optionPrdPrice&&null!==optionPrdPrice&&(oPtionPrdPrice.trim()&&(oPtionPrdPrice+=","),oPtionPrdPrice+=optionPrdPrice),oPrice+=oprice,oPriceType+=opriceType,oPriceOptions+=optionVal)});else{oPrice=options.data("price"),oPriceType=options.data("price-type"),oPriceType=oPriceType||"normal";var optionPrdPrice=options.data("productPrice");void 0!==optionPrdPrice&&null!==optionPrdPrice&&(oPtionPrdPrice=optionPrdPrice)}thwepo_public_base.isEmpty(oPrice)||thwepo_public_base.isEmpty(oPriceType)||(price_props={price:oPrice,priceType:oPriceType,priceOptions:oPriceOptions,optionPrdPrice:oPtionPrdPrice})}return price_props}function setup_price_fields(wrapper,data){wrapper.find(".thwepo-price-field").off("change",thwepo_public_conditions.conditional_field_value_change_listner),wrapper.find(".thwepo-price-field").on("change",thwepo_public_conditions.conditional_field_value_change_listner),custom_formula_field_change_listner(),may_calculate_extra_cost()}function update_product_price(variation){if(variation&&variation.display_price){var price_elm=$("#thwepo_product_price"),taxmultiplier=price_elm.data("taxmultiplier"),variation_price=variation.display_price;if(taxmultiplier){var org_price=variation_price/taxmultiplier;$("#thwepo_product_price").val(org_price)}}else $("#thwepo_product_price").val("0")}function prepare_price_html(price){return thwepo_public_var.price_symbol+price}function display_new_price(args,data,isVariableProduct){var display_price="";if("E000"===data.code||"E001"===data.code){var price_data=data.price_data;price_data&&(display_price=price_data.display_price_final)}if(display_price){var price_ph=""
3;isVariableProduct?args.price_ph_variable&&$(args.price_ph_variable).length?price_ph=args.price_ph_variable:$(".woocommerce-variation-price .price").length?price_ph=".woocommerce-variation-price .price":$(".product-info .price").length?price_ph=".product-info .price":$(".product-infos .price").length?price_ph=".product-infos .price":$(".product_infos .price").length?price_ph=".product_infos .price":$(".summary .price").length&&(price_ph=".summary .price"):args.price_ph_simple&&$(args.price_ph_simple).length?price_ph=args.price_ph_simple:$(".summary .price").length?price_ph=".summary .price":$(".product-info .price").length?price_ph=".product-info .price":$(".product-infos .price").length?price_ph=".product-infos .price":$(".product_infos .price").length?price_ph=".product_infos .price":$(".price").length?price_ph=".price":$(".wc-block-components-product-price").length&&(price_ph=".wc-block-components-product-price"),price_ph&&$(price_ph).html(display_price)}}function display_price_table(data){var price_table=$(".thwepo-price-table"),price_extra=0,display_price_extra=0,display_price_final=0,display_price_original=0,show=!1;if("E000"===data.code||"E001"===data.code||"E002"===data.code){var price_data=data.price_data,initial_price=price_table.find(".total-price .value").attr("data-price");price_data&&(price_extra=price_data.price_extra?price_data.price_extra:0,display_price_extra=price_data.display_price_extra?price_data.display_price_extra:prepare_price_html(0),display_price_final=price_data.display_price_final?price_data.display_price_final:initial_price,display_price_original=price_data.display_price_original?price_data.display_price_original:initial_price,show=0!=price_extra)}price_table.find(".extra-price .value").html(display_price_extra),price_table.find(".product-price .value").html(display_price_original),price_table.find(".total-price .value").html(display_price_final),show?price_table.show():price_table.hide()}function abort_curr_request(){null!=currRequest&&currRequest.abort()}function custom_formula_field_change_listner(){var price_field_elms=$(".thwepo-price-field");if(price_field_elms.length>0){var fields=[],is_quantity_listener_active=!1;price_field_elms.each(function(){var pfield=$(this),priceType=pfield.data("price-type"),formula=pfield.data("price");if(priceType&&"custom-formula"===priceType&&isNaN(formula)){if(formula.includes("{thwepo_")){var regExp=/{([^}]+)}/g,matches=formula.match(regExp);$.each(matches,function(index,value){var fnames=value.match("thwepo_(.*)_value");fnames&&fnames[1]&&fields.push(fnames[1]);var fnames=value.match("thwepo_(.*)_price");fnames&&fnames[1]&&fields.push(fnames[1])}),fields=thwepo_public_base.remove_duplicates(fields)}formula.includes("{quantity}")&&!is_quantity_listener_active&&(is_quantity_listener_active=!0)}}),thwepo_public_base.is_empty_arr(fields)||$.each(fields,function(index,value){value=value.trim();var field_obj=$('[name="'+value+'"]');$("."+value);0==field_obj.length&&(field_obj=$('[name="'+value+'[]"]')),field_obj.not(".thwepo-price-field").on("change",function(){thwepo_public_price.may_calculate_extra_cost()})}),is_quantity_listener_active&&$('.quantity input[name="quantity"]').on("change",function(){thwepo_public_price.may_calculate_extra_cost()})}}function calculate_field_price(field){var price=field.data("price"),price_type=field.data("price-type");if(price=thwepo_public_base.isFloat(price)?parseFloat(price):0,"normal"===price_type||"product_price"===price_type)price=price||0;else if("percentage"===price_type){var prd_price=$("#thwepo_product_price").val();price=prd_price*(price/100)}
3else price="option_percentage"===price_type?field.data("option-product-price"):0;return price}function calculate_extra_cost(args){"yes"===args.thwepo_js_enable_flag&&$(document).on("thwepo_calculation_start",function(event,data){thwepo_js_price_calculation.init(data)});var form=$(thwepo_public_var.cart_form_ph);if(!form.find(".thwepo_grouped").length){var price_field_elms=$(".thwepo-price-field");if(price_field_elms.length>0){var priceInfoArr={},isVariableProduct=is_variable_product(form),productId=get_product_id(),variationId=get_variation_id(),productQty=$('form.cart .quantity input[name="quantity"]').val(),prod_grp_qts="",pre_fname="";price_field_elms.each(function(){var pfield=$(this);if(is_active_price_field(pfield)){var ftype=pfield.getType(),multiple=is_multiselect_field(pfield,ftype),id=pfield.prop("id"),name=thwepo_public_base.get_field_name(ftype,pfield.prop("name"),id,multiple),value=get_price_field_value(pfield,ftype,name),valueText=value,quantity="",label=pfield.data("price-label"),price=pfield.data("price"),priceType=pfield.data("price-type"),priceUnit=pfield.data("price-unit"),priceMinUnit=pfield.data("price-min-unit"),flatFee=pfield.data("flat-fee"),customEqn=[],priceOptions="",optionPrdPrice="";if(thwepo_public_base.isInputChoiceField(ftype,multiple)){var price_props=prepare_price_props_for_selected_options(pfield,name,ftype,multiple);price_props?(price=price_props.price,priceType=price_props.priceType,priceOptions=price_props.priceOptions,optionPrdPrice=price_props.optionPrdPrice):(price=0,priceType="")}if(price&&priceType&&"custom-formula"===priceType){var is_valid_product=!0;if(!isVariableProduct||variationId&&"0"!==variationId||(is_valid_product=!1),""!==value&&is_valid_product&&isNaN(price)){var custom_formula=price,custom_parameter=[];if(custom_formula.includes("{value}")){var fvalue=$.isNumeric(value)?value:0;custom_formula=custom_formula.replace(/{value}/g,fvalue),custom_parameter.value=fvalue}if(custom_formula.includes("{length}")){var strlength=value.length;custom_formula=custom_formula.replace(/{length}/g,strlength),custom_parameter.length=strlength}if(custom_formula.includes("{quantity}")){var pquantity=$('.quantity input[name="quantity"]').val();pquantity=$.isNumeric(pquantity)?pquantity:0,custom_formula=custom_formula.replace(/{quantity}/g,pquantity),custom_parameter.quantity=pquantity}if(custom_formula.includes("{product_price}")){var prd_price=$("#thwepo_product_price").val();prd_price=$.isNumeric(prd_price)?prd_price:0,custom_formula=custom_formula.replace(/{product_price}/g,prd_price),custom_parameter.product_price=prd_price}if(custom_formula.includes("{thwepo_")){var regExp=/{([^}]+)}/g,matches=custom_formula.match(regExp);$.each(matches,function(index,value){var fnames=value.match("thwepo_(.*)_value"),fvalue=0;if(fnames&&fnames[1]){var field_name=fnames[1].trim(),field_parent=$("."+field_name),field_obj=$('[name="'+field_name+'"]');if(0==field_obj.length&&(field_obj=$('[name="'+field_name+'[]"]')),field_obj.length>0){var ftype=field_obj.getType();if("hidden"===ftype){var ftype_wrapper=field_parent.data("type");ftype="checkbox"===ftype_wrapper?"checkbox":"hidden"}if(fvalue=get_price_field_value(field_obj,ftype,field_name),Array.isArray(fvalue)){var total=0;for(var i in fvalue)total=thwepo_public_base.isInt(fvalue[i])?total+parseInt(fvalue[i]):total;fvalue=total}}if(fvalue=fvalue||0,custom_formula.includes(value)){var regex=new RegExp(value,"g");custom_formula=custom_formula.replace(regex,fvalue)}customEqn[value]=fvalue}var fnames=value.match("thwepo_(.*)_price");if(fnames&&fnames[1]){var field_name=fnames[1].trim(),field_obj=$('[name="'+field_name+'"]'),field_parent=$("."+field_name);0==field_obj.length&&(field_obj=$('[name="'+field_name+'[]"]'));var ftype=field_obj.getType();if("hidden"===ftype){var ftype_wrapper=field_parent.data("type");ftype="checkbox"===ftype_wrapper?"checkbox":"hidden"}var fvalue=get_price_field_value(field_obj,ftype,field_name),fprice=0;if(field_obj.length>0&&fvalue)if(Array.isArray(fvalue))$.each(field_obj,function(){var elm=$(this);if("select"===ftype&&$.each(fvalue,function(index,value){var option=elm.find('option[value="'+value+'"]'),oprice=calculate_field_price(option);fprice+=oprice}),elm.is(":checked")){var oprice=calculate_field_price(elm);fprice+=oprice}});else if("select"===ftype){var option=field_obj.find('option[value="'+fvalue+'"]');fprice=calculate_field_price(option)}else"radio"===ftype||"checkbox"===ftype?$.each(field_obj,function(){$(this).is(":checked")&&(fprice=calculate_field_price($
3(this)))}):fprice=calculate_field_price(field_obj);if(fprice=fprice||0,custom_formula.includes(value)){var regex=new RegExp(value,"g");custom_formula=custom_formula.replace(regex,fprice)}customEqn[value]=fprice}}),customEqn=thwepo_public_base.remove_duplicates(customEqn)}var regex=/^[0-9.\-\+\*\/\(\)\s]*$/,valid=regex.test(custom_formula);if(valid)try{price=eval(custom_formula)}catch(e){price=0}else price=0}else thwepo_public_base.isFloat(price)||(price=0);if($.isNumeric(price)){var taxmultiplier=$("#thwepo_product_price").data("taxmultiplier"),display_price=price*taxmultiplier,woocs_multiplier=$("#thwepo_woocs_multiplier").val();woocs_multiplier&&(display_price=price*woocs_multiplier),display_price=thwepo_public_base.number_format(display_price,thwepo_public_var.price_data.decimals,thwepo_public_var.price_data.decimal_separator,thwepo_public_var.price_data.thousand_separator),display_price='<span class="woocommerce-Price-currencySymbol">'+thwepo_public_var.price_data.currency_symbol+"</span>"+display_price,pfield.closest(".value").find(".woocommerce-Price-amount.amount").html(display_price),$(document.body).trigger("thwepo_updated_custom_formula_price",[display_price])}}if(!priceType||"dynamic"!==priceType&&"dynamic-excl-base-price"!==priceType&&"char-count"!==priceType?priceUnit=0:!$.isNumeric(priceUnit)&&$("#"+priceUnit).length&&(quantity=$("#"+priceUnit).val(),priceUnit=1),value&&name&&(price||priceType&&"custom"===priceType)){var priceInfo={};priceInfo.name=name,priceInfo.label=label,priceInfo.value=value,priceInfo.price=price,priceInfo.price_type=priceType,priceInfo.price_options=priceOptions,priceInfo.option_prd_price=optionPrdPrice,priceInfo.price_unit=priceUnit,priceInfo.price_min_unit=priceMinUnit,priceInfo.quantity=quantity,priceInfo.multiple=multiple,priceInfo.custom_formula=customEqn,priceInfoArr[name]=priceInfo}if(value&&pfield.hasClass("thwepo-prod-grp-qty")){var qname=pfield.data("name"),multiple_qty=pfield.data("multiple");if(qname!=pre_fname&&(pre_fname=qname,prod_grp_qts=""),multiple_qty){var prod_name=name.replace("quantity_","");$("#"+prod_name).prop("checked")&&(prod_grp_qts.trim()&&(prod_grp_qts+=","),prod_grp_qts+=value)}else{var $rad_field=$("input[name="+qname+"]:checked");value=$rad_field.parent(".thwepo-product-group-item").find('.wepo-quantity input[type="number"]').val(),prod_grp_qts=value}priceInfoArr[qname]&&(priceInfoArr[qname].product_group_quantity=prod_grp_qts)}}});var requestData={};requestData.product_id=productId,requestData.product_qty=productQty,requestData.price_info=priceInfoArr,requestData.is_variable_product=isVariableProduct,variationId&&(requestData.variation_id=variationId),requestData.thwepo_product_price=$("#thwepo_product_price").val(),$(document.body).trigger("thwepo_calculation_start",[requestData]);var data={action:"thwepo_calculate_extra_cost",security:thwepo_public_var.thwepo_extra_cost_nonce,price_info:JSON.stringify(requestData)};"yes"!==args.thwepo_js_enable_flag&&(currRequest=$.ajax({type:"POST",url:args.ajax_url,data:data,beforeSend:function(){null!=currRequest&&currRequest.abort()},success:function(data){$(document.body).trigger("thwepo_calculation_success",[data]),display_new_price(args,data,isVariableProduct),display_price_table(data)}})),$(document.body).trigger("thwepo_calculation_end")}}}function may_calculate_extra_cost(){calculate_extra_cost(thwepo_public_var)}var currRequest=null;return{setup_price_fields:setup_price_fields,may_calculate_extra_cost:may_calculate_extra_cost,abort_curr_request:abort_curr_request,update_product_price:update_product_price,prepare_price_html:prepare_price_html}}(window.jQuery,window,document),thwepo_public=function($,window,document){"use strict";function initialize_thwepo(){var extra_options_wrapper=$(".extra-options");if(extra_options_wrapper){thwepo_public_base.setup_enhanced_select(extra_options_wrapper,"thwepo-enhanced-multi-select",thwepo_public_var),thwepo_public_base.setup_enhanced_select(extra_options_wrapper,"thwepo-enhanced-select",thwepo_public_var),thwepo_public_base.setup_date_picker(extra_options_wrapper,"thwepo-date-picker",thwepo_public_var),thwepo_public_base.setup_daterange_picker(extra_options_wrapper,"thwepo-daterange-picker",thwepo_public_var),thwepo_public_base.setup_time_picker(extra_options_wrapper,"thwepo-time-picker",thwepo_public_var),thwepo_public_base.setup_color_picker(extra_options_wrapper,"thwepo-color-picker",thwepo_public_var),thwepo_public_base.setup_color_pick_preview(extra_options_wrapper,"thwepo-color-picker",thwepo_public_var),thwepo_public_base.apply_labelswatches_styles(extra_options_wrapper,"thwepo-labelswatches",thwepo_public_var),thwepo_public_edit_cart.setup_cart_edit_state(extra_options_wrapper,"extra-options",thwepo_public_var),$(".thwepo-char-count .thwepo-input-field").keyup(function(){thwepo_public_base.display_char_count($(this),!0)}),$(".thwepo-char-left .thwepo-input-field").keyup(function(){thwepo_public_base.display_char_count($(this),!1)}),$(".thwepo-conditional-field").each(function(){thwepo_public_conditions.validate_field_condition($(this),!0)}),$(".thwepo-conditional-section").each(function(){thwepo_public_conditions.validate_field_condition($(this),!0)});var show_variation=!1;$(".single_variation_wrap").on("show_variation",function(event,variation){thwepo_public_price.abort_curr_request(),thwepo_public_price.update_product_price(variation),thwepo_public_price.may_calculate_extra_cost(),show_variation=!0}
3),$(".single_variation_wrap").on("hide_variation",function(event,variation){show_variation&&(thwepo_public_price.may_calculate_extra_cost(),show_variation=!1)}),$(".thwepo-color-picker").on("thwepocp_color_changed",function(){thwepo_public_conditions.trigger_conditional_field_value_change(this)}),thwepo_public_price.setup_price_fields(extra_options_wrapper,thwepo_public_var),thwepo_public_file_upload.handle_file_upload("thwepo-file-upload"),$(".extra-options input").on("keypress",function(e){return 13!==e.which}),$(".thwepo-mask-input").each(function(){thwepo_public_base.apply_input_masking(this),$(this).val()&&$(this).trigger("blur")}),$(".thwepo-popup-image").on("click",function(event){event.preventDefault(),thwepo_public_base.show_magnified_image(this)});var wepo_range_input=$(".thwepo-range-input");wepo_range_input.each(function(){thwepo_public_base.display_range_value(this)}),wepo_range_input.on("change",function(){thwepo_public_base.display_range_value(this)})}}function initialize_thwepo_section(){display_style&&"default_style"!==display_style&&(tab_list=$(".thwepo-section-title"),extra_options=$(".extra-options"),first_elm=$(".thwepo-section-list .thwepo-section-title:first-child"),display_wepo_section(first_elm),tab_list.on("click",function(){display_wepo_section($(this))}),$(document.body).on("hide_the_section",function(event,section){var section_name=section.attr("id"),section_list=$(".thwepo-section-list"),section=section_list.find('.thwepo-section-title[data-section="'+section_name+'"]');section.hide()}),$(document.body).on("show_the_section",function(event,section){var section_name=section.attr("id"),section_list=$(".thwepo-section-list"),section=section_list.find('.thwepo-section-title[data-section="'+section_name+'"]');section.show()}),$(document.body).on("section_displayed",function(event,active_tab){$(this).find(".thwepo-range-input").each(function(){thwepo_public_base.display_range_value(this)})}),$("form.cart").attr("novalidate","novalidate"))}function _processAjaxRequest(e){e.preventDefault();var $form=$(this).closest("form");if(!$form[0].checkValidity())return $form[0].reportValidity(),!1;var $thisbutton=$(this),product_id=$(this).val()||"",variation_id=$('input[name="variation_id"]').val()||"";if(!$thisbutton.hasClass("disabled")){$thisbutton.removeClass("added"),$thisbutton.addClass("loading");var quantity=$('input[name="quantity"]').val();if($(".woocommerce-grouped-product-list-item").length){var quantities=$("input.qty"),quantity=[];$.each(quantities,function(index,val){var name=$(this).attr("name");name=name.replace("quantity[",""),name=name.replace("]",""),name=parseInt(name),$(this).val()&&(quantity[name]=$(this).val())})}var formData=new FormData($form[0]);formData.append("action","thwepo_add_cart_single_product"),variation_id||formData.append("add-to-cart",product_id),$.ajax({url:thwepo_public_var.ajax_url,type:"POST",data:formData,processData:!1,contentType:!1,success:function(results){if(0===results.length)return location.reload(),!1;$thisbutton.addClass("added"),$(document.body).trigger("wc_fragment_refresh"),$(document.body).trigger("added_to_cart",[results.fragments,results.cart_hash,$thisbutton])}})}}function check_oceanwp_quickview_opened(){$("#owp-qv-wrap").hasClass("is-visible")?initialize_thwepo():setTimeout(function(){check_oceanwp_quickview_opened()},1e3)}function display_wepo_section(elm){if(elm.length>=1){var section_name=elm.data("section"),active_tab_content=extra_options.find(".thwepo-field-wrapper."+section_name),current_tab=$('.thwepo-section-title[data-section="'+section_name+'"]');if(active_tab_content.hasClass("open")&&"accordion_style"===display_style)active_tab_content.hide().removeClass("open"),current_tab.removeClass("active");else{tab_list.not(current_tab).removeClass("active"),current_tab.addClass("active"),extra_options.find(".thwepo-field-wrapper").not("."+section_name).hide().removeClass("open"),active_tab_content.show().addClass("open");var disable_scrole_top_animation=thwepo_public_var.disable_scrole_top_animation,scroll_top_offset=thwepo_public_var.scroll_top_offset;disable_scrole_top_animation||thwepo_public_base.animate_scroll_top(elm,scroll_top_offset),$(document.body).trigger("section_displayed",[active_tab_content])}}}
3var tab_list="",extra_options="",first_elm="",display_style=thwepo_public_var.display_style;return initialize_thwepo(),initialize_thwepo_section(),thwepo_public_var.ajax_add_to_cart_enable&&$(document).on("click","body.single-product .product:not(.product-type-external) button.single_add_to_cart_button",_processAjaxRequest),"flatsome"==thwepo_public_var.is_quick_view?$(document).on("mfpOpen",function(e){initialize_thwepo(),$.magnificPopup.instance._onFocusIn=function(e){return!!$(e.target).hasClass("ui-datepicker-month")||(!!$(e.target).hasClass("ui-datepicker-year")||void $.magnificPopup.proto._onFocusIn.call(this,e))}}):"yith"==thwepo_public_var.is_quick_view?$(document).on("qv_loader_stop",function(){initialize_thwepo()}):"astra"==thwepo_public_var.is_quick_view?$(document).on("ast_quick_view_loader_stop",function(){initialize_thwepo_section(),initialize_thwepo()}):"oceanwp"==thwepo_public_var.is_quick_view&&$(document).on("click",".owp-quick-view",function(e){check_oceanwp_quickview_opened()}),{initialize_thwepo:initialize_thwepo}}(window.jQuery,window,document);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.