jQuery(function(l){if("undefined"==typeof wc_address_i18n_params)return!1;var e=wc_address_i18n_params.locale.replace(/&quot;/g,'"'),n=JSON.parse(e);function o(e,a){a?(e.find("label .optional").remove(),e.addClass("validate-required"),0===e.find("label .required").length&&e.find("label").append('&nbsp;<abbr class="required" title="'+wc_address_i18n_params.i18n_required_text+'">*</abbr>')):(e.find("label .required").remove(),e.removeClass("validate-required woocommerce-invalid woocommerce-invalid-required-field"),0===e.find("label .optional").length&&e.find("label").append('&nbsp;<span class="optional">('+wc_address_i18n_params.i18n_optional_text+")</span>"))}l(document.body).on("country_to_state_changing",function(e,a,i){var d=i,r="undefined"!=typeof n[a]?n[a]:n["default"],i=d.find("#billing_postcode_field, #shipping_postcode_field"),a=d.find("#billing_city_field, #shipping_city_field"),t=d.find("#billing_state_field, #shipping_state_field"),i=(i.attr("data-o_class")||(i.attr("data-o_class",i.attr("class")),a.attr("data-o_class",a.attr("class")),t.attr("data-o_class",t.attr("class"))),JSON.parse(wc_address_i18n_params.locale_fields));l.each(i,function(e,a){var a=d.find(a),i=l.extend(!0,{},n["default"][e],r[e]);"undefined"!=typeof i.label&&a.find("label").html(i.label),"undefined"!=typeof i.placeholder&&(a.find(":input").attr("placeholder",i.placeholder),a.find(":input").attr("data-placeholder",i.placeholder),a.find(".select2-selection__placeholder").text(i.placeholder)),"undefined"!=typeof i.placeholder||"undefined"==typeof i.label||a.find("label").length||(a.find(":input").attr("placeholder",i.label),a.find(":input").attr("data-placeholder",i.label),a.find(".select2-selection__placeholder").text(i.label)),"undefined"!=typeof i.required?o(a,i.required):o(a,!1),"undefined"!=typeof i.priority&&a.data("priority",i.priority),"state"!==e&&("undefined"!=typeof i.hidden&&!0===i.hidden?a.hide().find(":input").val(""):a.show()),Array.isArray(i["class"])&&(a.removeClass("form-row-first form-row-last form-row-wide"),a.addClass(i["class"].join(" ")))}),l(".woocommerce-billing-fields__field-wrapper,.woocommerce-shipping-fields__field-wrapper,.woocommerce-address-fields__field-wrapper,.woocommerce-additional-fields__field-wrapper .woocommerce-account-fields").each(function(e,a){var a=l(a).find(".form-row"),i=a.first().parent(),d=0;a.each(function(){l(this).data("priority")||l(this).data("priority",d+1),d=l(this).data("priority")}),a.sort(function(e,a){e=parseInt(l(e).data("priority"),10),a=parseInt(l(a).data("priority"),10);return a<e?1:e<a?-1:0}),a.detach().appendTo(i)})}).trigger("wc_address_i18n_ready")});