/* By db0 (db0company@gmail.com, http://db0.fr/) Source/Licence https://github.com/db0company/CuteForm */function cuteformhtml(t,e){var a=t.val(),o=t.text(),c=void 0!==e.images&&void 0!==e.images[a]?e.images[a]:void 0!==t.attr("data-cuteform-image")?t.attr("data-cuteform-image"):null;if(null!==c)return $('
');var d=void 0!==e.html&&void 0!==e.html[a]?e.html[a]:void 0!==t.attr("data-cuteform-html")?t.attr("data-cuteform-html"):a;return $('
'+d+"
")}function cuteform(t,e){var a,o;e=void 0===e?{}:e;t.addClass("cuteform-select");var c="true"==e.modal||"true"==t.attr("data-cuteform-modal"),d="true"==e["modal-text"]||"true"==t.attr("data-cuteform-modal-text");if(a=$(''+(l||c?"":"
")+"
"),t.after(a),c){o=$("#cuteform-modal");var r=$('');t.after(r),t.hide(),a.hide()}else{var l=!(void 0!==e.hide&&"false"==e.hide.toString()||"false"==t.attr("data-cuteform-hide"));l&&t.hide()}t.find("option").each(function(){var l=$(this),f=cuteformhtml(l,e);a.append(f),l.val()==t.find("option:selected").first().val()&&f.addClass("cuteform-selected"),f.click(function(e){t.val(f.attr("data-cuteform-val")),a.find(".cuteform-elt").removeClass("cuteform-selected"),f.addClass("cuteform-selected"),c&&(r.text(""),d?r.append(''+a.find(".cuteform-selected").attr("data-cuteform-text")+""):r.append(a.find(".cuteform-selected").clone(!0).off()),o.modal("hide"))})}),c&&(d?r.append(''+a.find(".cuteform-selected").attr("data-cuteform-text")+""):r.append(a.find(".cuteform-selected").clone(!0).off()),r.click(function(t){t.preventDefault(),o.css("display","block"),o.find(".modal-body").text("");var e=a.clone(!0);e.show(),o.find(".modal-body").append(e),o.modal(),o.on("hidden.bs.modal",function(t){o.css("display","none")})})),t.change(function(){a.find(".cuteform-elt").removeClass("cuteform-selected"),a.find("[data-cuteform-val="+t.find("option:selected").first().val()+"]").addClass("cuteform-selected")})}function cuteformclear(){$(".cuteform").remove(),$(".cuteform-selected").removeClass("cuteform-selected"),$(".cuteform-select").show(),$(".cuteform-select").removeClass("cuteform-select")}$(document).ready(function(){$("select[data-cuteform=true]").each(function(){cuteform($(this))})});