document.addEventListener("alpine:init",()=>{Alpine.data("dataPrediksi",()=>({isLoad:!0,search:"",data:[],init(){this.getData(),this.$watch("sPrediksi",e=>{this.isLoad=!0,this.getData()})},getData(){var s;let e=(s=this.sPrediksi)!=null?s:"";axios.get("/proxy.php?type=prediksi&p="+e).then(a=>{let i=a.data.map(t=>(t.top_2d=JSON.parse(t.top_2d),t.top_3d=JSON.parse(t.top_3d),t.top_4d=JSON.parse(t.top_4d),t));this.data=i,this.isLoad=!1,scrollInMenuHome(),setTimeout(()=>{this.highLight()})}).catch(a=>{this.isLoad=!1,Toast(a.message)})},onSearch(){this.isLoad=!0,this.getData()},highLight(){const e=this.search,s=e.charAt(0).toUpperCase()+e.slice(1),a=e.toUpperCase();let i=document.querySelectorAll(".hlsText");[...i].forEach(t=>highLightSearch(e,t)),[...i].forEach(t=>highLightSearch(s,t)),[...i].forEach(t=>highLightSearch(a,t))}}))});