(()=>{var t,c;window.shiptastic=window.shiptastic||{},window.shiptastic.shipments_modal=window.shiptastic.shipments_modal||{},t=jQuery,(c=window.shiptastic).shipments_modal={params:{},init:function(){var a=c.shipments_modal;t(document).on("click",".wc-stc-modal-launcher, .wc-stc-modal-background, .wc-stc-modal-close",a.onTriggerModal),t(document).on("click",".wc-stc-modal-content.active",a.detectBgClick)},detectBgClick:function(c){t(c.target).closest(".wc-stc-modal-content-inner").length||t(c.target).is(".wc-stc-modal-content-inner")||t(this).find(".wc-stc-modal-close").trigger("click")},onTriggerModal:function(){var c;if((c=t(this).parents(".wc-stc-modal-content").length>0?t(this).parents(".wc-stc-modal-content").data("id"):t(this).data("modal-id"))&&t('.wc-stc-modal-content[data-id="'+c+'"]').length>0){var a=t('.wc-stc-modal-content[data-id="'+c+'"]');a.toggleClass("active"),t(".wc-stc-modal-background").toggleClass("active"),a.hasClass("active")?(t(".wc-stc-modal-background").attr("data-id",c),t("body").addClass("wc-stc-body-modal-active"),t(document.body).trigger("wc_shiptastic_modal_open",[c,a])):(t("body").removeClass("wc-stc-body-modal-active"),t(document.body).trigger("wc_shiptastic_modal_close",[c,a]))}return!1}},t(document).ready((function(){c.shipments_modal.init()})),((window.wcShiptastic=window.wcShiptastic||{}).static=window.wcShiptastic.static||{}).modal={}})();