$((function(){$(document).on("click","input[name=is_vendor]",(function(t){var s=$(t.currentTarget);1==s.val()?$('[data-bb-toggle="vendor-info"]').slideDown():($('[data-bb-toggle="vendor-info"]').slideUp(),s.closest("form").find("button[type=submit]").prop("disabled",!1))})),$('form.js-base-form input[name="shop_url"]').on("keyup",(function(t){var s=$(t.currentTarget),a=s.closest("form").find("[data-slug-value]");a.html("".concat(a.data("base-url"),"/<strong>").concat(s.val().substring(0,100).toLowerCase(),"</strong>"))})).on("change",(function(t){var s=$(t.currentTarget),a=s.closest("form"),e=s.val();if(e){var n=a.find("[data-slug-value]");$.ajax({url:s.data("url"),type:"POST",data:{url:e},beforeSend:function(){s.prop("disabled",!0),a.find("button[type=submit]").prop("disabled",!0)},success:function(t){var e=t.error,o=t.message,r=t.data;e?(s.addClass("is-invalid").removeClass("is-valid"),$(".shop-url-status").removeClass("text-success").addClass("text-danger").text(o)):($(".shop-url-status").removeClass("text-danger").addClass("text-success").text(o),a.find("button[type=submit]").prop("disabled",!1)),null!=r&&r.slug&&n.html("".concat(n.data("base-url"),"/<strong>").concat(r.slug.substring(0,100).toLowerCase(),"</strong>"))},complete:function(){return s.prop("disabled",!1)}})}}))}));