!function(t){"function"==typeof define&&define.amd?define("inputLimit",t):t()}(function(){"use strict";var e;window.MyListing=window.MyListing||{},window.MyListing.InputLimit=window.MyListing.InputLimit||{},e=jQuery,window.MyListing.InputLimit.init=function(){var t='.c27-submit-listing-form input[type="text"][maxlength], .c27-submit-listing-form input[type="text"][minlength], .c27-submit-listing-form textarea[maxlength], .c27-submit-listing-form textarea[minlength]';function n(t){var n,e,i,o,a=t.closest(".form-group");a.length&&(a=a.find(".field-head .field-char-counter")).length&&(n=a.find(".counter-label"),e=a.find(".counter-numbers"),i=parseInt(t.attr("minlength"),10)||0,o=parseInt(t.attr("maxlength"),10)||0,t=t.val().length,o||i)&&(a.show(),n.text(""),e.text(""),a.removeClass("min-exceeded max-exceeded"),0<i&&t<i?(n.text(CASE27.l10n.input_too_short.replace("%d",i)),a.addClass("min-exceeded")):0<o&&o<t?(n.text(CASE27.l10n.input_too_long.replace("%d",o)),a.addClass("max-exceeded")):n.text(""),0<o)&&e.text("".concat(t," / ").concat(o))}e(t).each(function(){0<e(this).val().length&&n(e(this))}),e(document).on("input keyup",t,function(){n(e(this))})}});
