!function(){var e,r;window.shiptastic=window.shiptastic||{},window.shiptastic.dhl_preferred_services=window.shiptastic.dhl_preferred_services||{},e=jQuery,(r=window.shiptastic).dhl_preferred_services={params:{},init:function(){var t=r.dhl_preferred_services;t.params=wc_stc_dhl_preferred_services_params,e(document.body).on("updated_checkout",t.afterRefreshCheckout),e(document.body).on("shiptastic_current_pickup_location",(function(r,t){t?e(".dhl-preferred-service-content").hide():e(".dhl-preferred-service-content").show()})),e(document).on("change",".dhl-preferred-service-content .dhl-preferred-location-types input",t.onChangeLocationType).on("change",".woocommerce-checkout #billing_postcode",t.triggerCheckoutRefresh).on("change",".woocommerce-checkout #shipping_postcode",t.triggerCheckoutRefresh).on("change",".dhl-preferred-service-content .dhl-preferred-service-times input",t.triggerCheckoutRefresh).on("change",".dhl-preferred-service-content .dhl-preferred-delivery-types input",t.triggerCheckoutRefresh),t.params.payment_gateways_excluded&&e(document.body).on("payment_method_selected",t.triggerCheckoutRefresh),t.afterRefreshCheckout()},triggerCheckoutRefresh:function(){e(document.body).trigger("update_checkout")},afterRefreshCheckout:function(){var t=r.dhl_preferred_services;t.initTipTip(),t.onChangeLocationType(),window.hasOwnProperty("shiptastic")&&window.shiptastic.hasOwnProperty("shipments_pickup_locations")&&window.shiptastic.shipments_pickup_locations.hasPickupLocationDelivery()&&e(".dhl-preferred-service-content").hide()},onChangeLocationType:function(){r.dhl_preferred_services;var t=e(".dhl-preferred-service-content .dhl-preferred-location-types input:checked");e(".dhl-preferred-service-content .dhl-preferred-service-location-data").hide(),t.length>0&&("place"===t.val()?e(".dhl-preferred-service-content .dhl-preferred-service-location-place").show():"neighbor"===t.val()&&e(".dhl-preferred-service-content .dhl-preferred-service-location-neighbor").show())},initTipTip:function(){e("#tiptip_holder").removeAttr("style"),e("#tiptip_arrow").removeAttr("style"),e(".dhl-preferred-service-content .woocommerce-help-tip").tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50,delay:200})}},e(document).ready((function(){r.dhl_preferred_services.init()})),((window.wcShiptastic=window.wcShiptastic||{}).static=window.wcShiptastic.static||{})["preferred-services"]={}}();