class l{constructor(){this.attributeId=0,this.valuesCount=0,this.addOldValues(FleetCart.data["attribute.values"]),this.valuesCount===0&&this.addAttributeValue(),this.eventListeners(),this.sortable(),window.admin.removeSubmitButtonOffsetOn("#values")}addOldValues(t={}){for(let e of t)this.addAttributeValue(e)}addAttributeValue(t={id:"",value:""}){let a=_.template($("#attribute-value-template").html())({valueId:this.valuesCount++,value:t});$("#attribute-values").append(a),window.admin.tooltip()}eventListeners(){$("#add-new-value").on("click",()=>this.addAttributeValue()),$("#attribute-values").on("click",".delete-row",t=>{$(t.currentTarget).closest("tr").remove()})}sortable(){Sortable.create(document.getElementById("attribute-values"),{handle:".drag-handle",animation:150})}}$("#attribute-values-wrapper").length!==0&&new l;
