document.addEventListener("alpine:init",()=>{Alpine.data("filterPasaran",()=>({sPrediksi:null,select2Prediksi:null,init(){this.setSelect2Prediksi(),this.tab&&this.$watch("tab",e=>{(e=="resultPage"||e=="prediksiPage")&&(this.sPrediksi=null,this.$refs.sPasaran.value=null,this.setSelect2Prediksi())})},setSelect2Prediksi(){this.select2Prediksi!=null&&this.select2Prediksi.destroy(),setTimeout(()=>{this.select2Prediksi=NiceSelect.bind(this.$refs.sPasaran,{searchable:!0,placeholder:"Fiter berdasarkan pasaran",onChange:e=>{let i=e.at().value;this.sPrediksi=i=="null"?null:i,i=="null"&&this.setSelect2Prediksi()}})})}}))});