(()=>{function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}new(function(){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.eventListeners()}var i,n,o;return i=t,(n=[{key:"eventListeners",value:function(){var e=this;$(document).on("click","#add-new-commission-setting-category",(function(t){return t.preventDefault(),t.stopPropagation(),e.addNewCommissionSetting(t.target),!1})),$(document).on("click",".remove-commission-setting",(function(e){e.preventDefault(),e.stopPropagation();var t=$(e.target).attr("data-index");$(document).find("#commission-setting-item-".concat(t)).remove()})),document.querySelectorAll(".tagify-commission-setting").forEach((function(t){e.tagify(t)}))}},{key:"tagify",value:function(e){new Tagify(e,{delimiters:null,enforceWhitelist:!0,whitelist:this.formatWhitelist(),dropdown:{enabled:1,classname:"extra-properties",searchBy:["name"]}})}},{key:"formatWhitelist",value:function(){var e=[];return window.tagifyWhitelist.map((function(t){e.push({value:t.name,id:t.id})})),e}},{key:"addNewCommissionSetting",value:function(){var e=$("#commission-setting-item-template").html(),t=$(".commission-setting-item").length,i=e.replace(/__index__/g,t);$(".commission-setting-item-wrapper").append(i);var n=document.querySelector("#commission-setting-item-".concat(t," .tagify-commission-setting"));this.tagify(n)}}])&&e(i.prototype,n),o&&e(i,o),Object.defineProperty(i,"prototype",{writable:!1}),t}())})();