!function(f,_){const t=PaoValidation;function e(a){return this instanceof e?!!a.length&&(this.$el=a,this.$addons=this.$el.find(".wc-pao-addon-field"),this.$addons.length?(this.is_rtl="rtl"===document.documentElement.dir,this.validation=new t(this),this.totals=new o(this),this.show_incomplete_subtotals=this.totals.showIncompleteSubtotals(),this.contains_required=this.containsRequired(),this.setupEvents(),this.validation.validate(),this.updateTotals(),f(".wc-pao-addon-image-swatch").tipTip({delay:200}),void WC_PAO.initialized_forms.push(this)):this.$addons=!1):new e(a)}function o(a){return this instanceof o?!f.isEmptyObject(a)&&(this.$form=a.$el,this.$addons=a.$addons,this.$variation_input=!!this.$form.hasClass("variations_form")&&this.$form.find('input[name="variation_id"], input.variation_id'),this.is_variable=this.$variation_input&&0")).attr("type","hidden"),t.attr("name",e.attr("name")+"-wc-pao-date-gmt-offset"),a.append(t)),new Date),n=parseFloat(woocommerce_addons_params.gmt_offset,10),s=a.getTimezoneOffset()/60,t=("default"===woocommerce_addons_params.date_input_timezone_reference?t.val(s):"store"===woocommerce_addons_params.date_input_timezone_reference&&(a.getHours(),a.getMinutes(),t.val(n)),e.datepicker({beforeShow:function(a,t){woocommerce_addons_params.datepicker_class&&(f("#ui-datepicker-div").removeClass(woocommerce_addons_params.datepicker_class),f("#ui-datepicker-div").addClass(woocommerce_addons_params.datepicker_class))},dateFormat:woocommerce_addons_params.datepicker_date_format,changeMonth:!0,changeYear:!0,yearRange:"c-100:c+10"}),e.datepicker("getDate"));null!==t&&"function"==typeof t.getTime&&(t.setHours(a.getHours(),a.getMinutes()),"store"===woocommerce_addons_params.date_input_timezone_reference&&(t=WC_PAO.Helper.addMinutes(t,-1*s*60),t=WC_PAO.Helper.addMinutes(t,60*n)),i.val(t.getTime()/1e3),o.show()),e.on("change",function(){var a,t=e.datepicker("getDate");null!==t&&"function"==typeof t.getTime?(a=new Date,t.setHours(a.getHours(),a.getMinutes()),"store"===woocommerce_addons_params.date_input_timezone_reference&&(t=WC_PAO.Helper.addMinutes(t,-1*s*60),t=WC_PAO.Helper.addMinutes(t,60*n)),i.val(t.getTime()/1e3),o.show()):(o.hide(),i.val(""))}),o.on("click",function(a){a.preventDefault(),i.val(""),e.val("").trigger("change")})}),n.$el.on("click",".reset_file",function(a){a.preventDefault();var a=f(this).closest(".wc-pao-addon-container"),t=a.find("input.wc-pao-addon-field"),a=a.find(".wc-pao-addon-file-name");a.length&&a.hide(250,function(){f(this).remove()}),f(this).removeClass("active").addClass("inactive"),t.data("value",""),t.val(""),n.validation.validateAddon(t,!0),n.updateTotals()}),f("#credit_called").on("keyup",function(){n.validation.validate(),n.updateTotals()})},e.prototype.updateTotals=function(){this.totals.calculate(),(this.show_incomplete_subtotals||this.isValid())&&(this.contains_required||this.totals.$totals.data("price_data").length)?this.totals.render():this.totals.reset()},e.prototype.isValid=function(){var a=!0;return this.$el.find("button.single_add_to_cart_button").is(".disabled")?a=!1:(f.each(this.validation.getValidationState(),function(){if(!this.validity)return a=!1}),a)},e.prototype.containsRequired=function(){var t=!1;return this.$addons.each(function(){var a=f(this).data("restrictions");if(!f.isEmptyObject(a)&&"required"in a&&"yes"===a.required)return t=!0}),t},e.prototype.is_in_viewport=function(a,t,e,o){var i,n,s,d,r,c,l,p=f(_);if(!(a.length<1))return s=(a=1l,n=0<=s.left&&s.left"+(s?' - '+s+"":"")):(i=a.val(),_=parseInt(woocommerce_addons_params.trim_user_input_characters,10),a.is(".wc-pao-addon-file-upload")?i=(i=t.find(".wc-pao-addon-file-name").length?t.find(".wc-pao-addon-file-name").data("value"):i).replace(/^.*[\\\/]/,""):a.is(".wc-pao-addon-custom-price")&&("."!==woocommerce_addons_params.currency_format_decimal_sep&&(i=i.replace(woocommerce_addons_params.currency_format_decimal_sep,".")),i=accounting.formatNumber(i,{symbol:"",decimal:woocommerce_addons_params.currency_format_decimal_sep,precision:parseFloat(i)%1==0?0:i.toString().split(".")[1].length})),_ - '+WC_PAO.Helper.escapeHtml(i)+""),p.is_custom_price=l,p.price_type=c,m.addons_price_data.push(p))}}),m.$totals.data("price_data",m.addons_price_data),m.$form.trigger("updated_addons")},o.prototype.render=function(){var a,e,o,t,i,n,s,d,r,c=this;c.$totals.data("show-sub-total")&&c.qty&&(c.formatMoney(c.total),o=!1,void 0!==c.base_price&&c.product_id&&(a=f(".wc-bookings-booking-form").length?isNaN(c.base_price)?0:parseFloat(c.base_price):parseFloat(c.base_price*c.qty),e=c.formatMoney(a+c.total)),c.has_subscription_plans?(t=c.$form.data("satt_script"))&&t.schemes_model.get_active_scheme_key()&&(t=c.$subscription_plans.find("input:checked")).val()&&(i=t.parent().find(".subscription-details")):c.$form.parent().find(".subscription-details").length&&!c.$form.hasClass("bundle_data")&&(i=c.$form.parent().find(".subscription-details"),c.$variation_input)&&0").parent().html()),"grouped"===c.product_type?n&&!WC_PAO.Helper.isGroupedMixedProductType()&&WC_PAO.Helper.isGroupedSubsSelected()&&e&&(e+=n):n&&e&&(e+=n),e)?(t=c.$form.find(".wc-pao-addon-container").data("product-name"),i=c.formatMoney(a),n=c.$form.find(".wc-pao-addon-container").data("product-tax-status"),s=f(".wc-bookings-booking-form").length?'
  • '+t+'
    '+i+"
  • ":'
    • '+(c.is_rtl?woocommerce_addons_params.quantity_symbol+c.qty:c.qty+woocommerce_addons_params.quantity_symbol)+" "+t+'
      '+i+"
    • ",c.addons_price_data.length&&f.each(c.addons_price_data,function(a,t){var e=t.cost,e=0===e?"-":0
      '+t.nameFormattedHTML+'
      '+e+"
      ",woocommerce_addons_params.tax_enabled&&t.is_custom_price&&(o=!0)}),d="",r=void 0===c.$totals.data("i18n_sub_total")?woocommerce_addons_params.i18n_sub_total:c.$totals.data("i18n_sub_total"),o||woocommerce_addons_params.price_display_suffix&&woocommerce_addons_params.tax_enabled?"taxable"!==n||o||!1!=-1'+woocommerce_addons_params.price_display_suffix+"",t=c.formatMoney(a.price_including_tax),a=c.formatMoney(a.price_excluding_tax),d=(d=d.replace("{price_including_tax}",''+t+"")).replace("{price_excluding_tax}",''+a+""),t=woocommerce_addons_params.display_include_tax?t:a,s+'
    • '+r+' '+t+" "+d+"

    "):s+'
  • '+r+' '+e+"

",c.show_subtotal_panel?c.$totals.html(s):c.$totals.html(""),c.$form.trigger("updated_addons")},error:function(){s=s+'
  • '+r+' '+e+"

  • ",c.show_subtotal_panel?c.$totals.html(s):c.$totals.html(""),c.$form.trigger("updated_addons")}}):(s=s+'
  • '+r+' '+e+" "+woocommerce_addons_params.price_display_suffix+"
  • ",c.show_subtotal_panel?c.$totals.html(s):c.$totals.html(""),c.$form.trigger("updated_addons")):(s=s+'
  • '+r+' '+e+"

  • ",c.show_subtotal_panel?c.$totals.html(s):c.$totals.html(""),c.$form.trigger("updated_addons"))):(c.$totals.empty(),c.$form.trigger("updated_addons"))},o.prototype.reset=function(){this.$totals.empty(),this.$totals.html(""),this.$form.trigger("updated_addons")},o.prototype.formatMoney=function(a){let t=woocommerce_addons_params.currency_format_num_decimals;var e;return woocommerce_addons_params.trim_trailing_zeros&&(e=parseFloat(a)%1==0,a=parseFloat(a),t=e?0:a.toString().split(".")[1].length),accounting.formatMoney(a,{symbol:woocommerce_addons_params.currency_format_symbol,decimal:woocommerce_addons_params.currency_format_decimal_sep,thousand:woocommerce_addons_params.currency_format_thousand_sep,precision:t,format:woocommerce_addons_params.currency_format})},e),f(function(){f("body").on("quick-view-displayed",function(){f(this).find(".cart:not(.cart_group)").each(function(){new WC_PAO.Form(f(this))})}),f("body").find(".cart:not(.cart_group)").each(function(){new WC_PAO.Form(f(this))})})}(jQuery,window);