!function(t){const e=function(e,n){const i=this,o=t(e).hasClass("advanced-list")?t(e):t(".advanced-list",e);function s(t){o.children(":eq("+(t-1)+")").remove(),i.options.onRemove&&i.options.onRemove.call(i)}this.options=t.extend({template:'
{{text}} '},n||{}),this.$el=o,o.on("click",".remove-item",(function(e){e.preventDefault(),s(o.children().index(t(this).closest("li"))+1)})),this.add=function(e,n){let s={},a=function(){const e=t(i.options.template);if(e.length)return e.html();return i.options.template}();t.isPlainObject(e)?s=t.extend({id:0,text:""},e):"string"==typeof e?s={id:"",text:e}:void 0!==e[0]&&(s={id:e[1]?e[1]:"",text:e[0]});for(const t in s){const e=new RegExp("{{"+t+"}}","g");a=a.replace(e,s[t])}if(a=t(a),void 0!==n){const t=o.children(":eq("+(n-1)+")");t.length?a.insertBefore(t):o.append(a)}else o.append(a);o.children().detach().each((function(){o.append("\n").append(this)})),i.options.onAdd&&i.options.onAdd.call(i)},this.remove=s};t.fn.LP("AdvancedList",(function(n){const i=[];for(let t=1;t