PageSourceSearch

https://toptrader.io/app/themes/ba-theme/public/build/entries/app-C0_LVLQw.js

js toptrader.io collected 2026-10-09 22:41:37 UTC 10,201 bytes, 1 lines download raw bytes

1import{C as t}from"../assets/vendor-flowbite-BTg1c-vm.js";import{d as e,a as s,b as a}from"../assets/debug-utils-DPNoUJjN.js";import{g as i}from"../assets/helper-C6s7TZM4.js";import{i as n}from"../assets/lazy-load-H3fTemXz.js";import{a as r}from"../assets/vendor-axios-DGc3PeEL.js";import{m as o}from"../assets/vendor-alpine-BpFAdBFE.js";import{m as u}from"../assets/match-api-BPtr1Y9-.js";import"./bb-match-sidebar-DNMChw6J.js";import"../assets/vendor-FKnezBCi.js";function h(){return{getStatusClass:i,fixtureLoading:!1,hasGroupStages:!1,fixtureData:[],activeGroupKey:null,activeStageIndex:null,activeRoundKey:null,displayMatches:[],isMobile:window.innerWidth<=768,currentPage:1,itemsPerPage:10,get totalPages(){return Math.ceil(this.displayMatches?.length/this.itemsPerPage)},get paginatedData(){const t=(this.currentPage-1)*this.itemsPerPage,e=t+this.itemsPerPage;return this.displayMatches?.slice(t,e)},get startIndex(){return(this.currentPage-1)*this.itemsPerPage},get endIndex(){return Math.min(this.startIndex+this.itemsPerPage,this.currentSelectedStat?.rank?.length)},goToPage(t){t>=1&&t<=this.totalPages&&(this.currentPage=t)},nextPage(){this.currentPage<this.totalPages&&this.currentPage++},prevPage(){this.currentPage>1&&this.currentPage--},get pageNumbers(){const t=[];let e=Math.max(1,this.currentPage-2),s=Math.min(this.totalPages,e+5-1);s-e+1<5&&(e=Math.max(1,s-5+1));for(let a=e;a<=s;a++)t.push(a);return t},paginationButtons:[],getPaginationButtonsMatches(){let t=[];if(this.totalPages<=0)return this.paginationButtons=[],this.paginationButtons;if(1===this.totalPages)return this.paginationButtons=[{type:"number",value:1}],this.paginationButtons;if(this.totalPages<=9){for(let e=1;e<=this.totalPages;e++)t.push({type:"number",value:e});return this.paginationButtons=t,this.paginationButtons}t.push({type:"number",value:1});const e=this.currentPage>4,s=this.currentPage<this.totalPages-3;if(e&&s){t.push({type:"ellipsis",value:"..."});for(let e=this.currentPage-2;e<=this.currentPage+2;e++)t.push({type:"number",value:e});t.push({type:"ellipsis",value:"..."})}else if(e){t.push({type:"ellipsis",value:"..."});for(let e=this.totalPages-6;e<this.totalPages;e++)e>1&&t.push({type:"number",value:e})}else if(s){for(let e=2;e<=7;e++)t.push({type:"number",value:e});t.push({type:"ellipsis",value:"..."})}else for(let a=2;a<this.totalPages;a++)t.push({type:"number",value:a});return this.totalPages>1&&t.push({type:"number",value:this.totalPages}),this.paginationButtons=t,this.paginationButtons},nextPage(){this.currentPage<this.totalPages&&(this.currentPage++,this.paginationButtons=[])},prevPage(){this.currentPage>1&&(this.currentPage--,this.paginationButtons=[])},goToPage(t){t>=1&&t<=this.totalPages&&t!==this.currentPage&&(this.currentPage=t,this.paginationButtons=[])},formatDate:(t,e="en-GB")=>!t||isNaN(t)?"":new Date(1e3*t).toLocaleString(e,{timeZone:"Asia/Ho_Chi_Minh",day:"2-digit",month:"short",hour:"2-digit",minute:"2-digit",hour12:!1}).replace(",",""),updateWidth(){this.isMobile=window.innerWidth<=768},switchStage(t){this.currentPage=1,this.activeStageIndex=t,this.activeRoundKey=null,this.fixtureData[t]&&this.fixtureData[t].rounds&&(this.activeRoundKey=Object.keys(this.fixtureData[t].rounds)[0]);const s=this.fixtureData[this.activeStageIndex].rounds[this.activeRoundKey]?.group_stages??{};this.hasGroupStages=Object.keys(s).length>0,this.hasGroupStages=Object.keys(s).length>0,e("Has Group Stages",this.hasGroupStages),this.displayMatches=this.hasGroupStages?this.fixtureData[this.activeStageIndex].rounds[this.activeRoundKey]?.group_stages[Object.keys(s)[0]].fixtures:this.fixtureData[this.activeStageIndex].rounds[this.activeRoundKey].fixtures,e("Active Stage:",this.activeStageIndex),e("Active Round:",this.activeRoundKey),e("keys",Object.keys(s),"keys"),e("current Round matches:",this.displayMatches)},switchRound(t){this.currentPage=1,e(t.target),this.activeRoundKey=t.target.value,e("Active Stage:",this.activeStageIndex),e("Switched to round:",this.activeRoundKey);const s=this.fixtureData[this.activeStageIndex].rounds[this.activeRoundKey]?.group_stages??{};this.hasGroupStages=Object.keys(s).length>0,e("keys",Object.keys(s),"keys"),this.activeGroupKey=Object.keys(s)[0],this.displayMatches=this.hasGroupStages?this.fixtureData[this.activeStageIndex].rounds[this.activeRoundKey]?.group_stages[this.activeGroupKey].fixtures:this.fixtureData[this.activeStageIndex].rounds[this.activeRoundKey].fixtures,e("current Round matches:",this.displayMatches)},switchGroup(t){this.currentPage=1,e(t.target),this.activeGroupKey=t.target.value,e("Active Stage:",this.activeStageIndex),e("Switched to group:",this.activeGroupKey),e("Has Group Stages",this.hasGroupStages),this.displayMatches=this.fixtureData[this.activeStageIndex].rounds[this.activeRoundKey]?.group_stages[this.activeGroupKey].fixtures,e("current Round matches:",this.displayMatches)},getSeasonId(){const t=document.getElementById("league-filter");return t?t.options[t.selectedIndex].getAttribute("data-seasonId"):null}
1,async initFixtures(){this.fixtureLoading=!0,window.addEventListener("stats-info",t=>{this.fetchFixtures(),this.activeStageIndex=0,this.activeRoundKey=null}),await this.fetchFixtures(),e(this.activeStageIndex)},async fetchFixtures(t=!1){try{this.fixtureLoading=!0,this.currentPage=1;const t=this.getSeasonId();if(!t)return a("No season ID available"),void(this.fixtureData=[]);const s=await u("league-fixtures","uuid="+t);if(this.fixtureData=await s.json(),e(Object.keys(this.fixtureData).length>0,"condition in fetch fixtures"),Object.keys(this.fixtureData).length>0){const t=Object.keys(this.fixtureData)[0];this.activeStageIndex=t,this.activeRoundKey=Object.keys(this.fixtureData[this.activeStageIndex].rounds)[0];const s=this.fixtureData[this.activeStageIndex].rounds[this.activeRoundKey]?.group_stages??{};this.hasGroupStages=Object.keys(s).length>0,e(Object.keys(s),"keys"),e("Has Group Stages",this.hasGroupStages),this.fixtureData[t]&&this.fixtureData[t].rounds&&(this.activeRoundKey=Object.keys(this.fixtureData[t].rounds)[0],this.displayMatches=this.hasGroupStages?this.fixtureData[this.activeStageIndex].rounds[this.activeRoundKey]?.group_stages[Object.keys(s)[0]].fixtures:this.fixtureData[this.activeStageIndex].rounds[this.activeRoundKey]?.fixtures,e(this.displayMatches,"diaplay matches"))}}catch(s){e(s,"Error in fetchFixtures")}finally{this.fixtureLoading=!1}}}}o.data("loadNewsComponent",function(a="",i=""){let n=document.getElementById("itemsPerPage");return e(n),{news:[],trending:[],itemsPerPage:n?n.value:12,totalPages:0,currentPage:1,loading:!0,buttonTimeout:!1,buttonTimeoutDuration:700,taxonomy:a,term:i,init(){n&&(this.itemsPerPage=n.value),this.load(1,this.itemsPerPage)},async load(t=1,a){this.loading=!0,window.scrollTo({top:0,behavior:"smooth"}),n.value=a;try{let s=`/wp-json/ba/v1/load-news?paged=${t}&perPage=${a}`;this.taxonomy&&this.term&&(s+=`&taxonomy=${this.taxonomy}&term=${this.term}`),e(s,"page in loadNews");const i=await r.get(s);e(i),this.news=i.data.posts,this.trending=i.data.trending,this.$nextTick(()=>{window.carouselInstance||setTimeout(()=>{e("Initializing carousel..."),this.initCarousel()},300)}),e("trending",this.trending),this.totalPages=i.data.total_pages||0,this.currentPage=i.data.current_page}catch(i){s("Error fetching News:",i)}finally{this.loading=!1}},initCarousel(){const s=document.getElementById("default-carousel"),a=document.querySelectorAll("[data-carousel-item]");a.forEach((t,e)=>{t.id="carousel-item-"+e});const i=Array.from(a).map((t,e)=>({position:e,el:t})),n=new t(s,i,{interval:5e3,indicators:{activeClasses:"bg-white dark:bg-gray-800",inactiveClasses:"bg-gray-700/400 dark:bg-gray-800/50 hover:bg-white dark:hover:bg-gray-800",items:i}},{id:"default-carousel",override:!0});window.carouselInstance=n,n.cycle(),window.manualNext=()=>{e("Alpine manual next clicked"),n.next(),n.pause(),n.cycle()},window.manualPrev=()=>{e("Alpine manual prev clicked"),n.prev(),n.pause(),n.cycle()}},goToPage(t){t>=1&&t<=this.totalPages&&this.load(t,this.itemsPerPage)},setButtonTimeout(){this.buttonTimeout=!0,setTimeout(()=>{this.buttonTimeout=!1},this.buttonTimeoutDuration)},handlePrevClick(){this.buttonTimeout||(this.setButtonTimeout(),window.manualPrev())},handleNextClick(){this.buttonTimeout||(this.setButtonTimeout(),window.manualNext())},getVisibleNews(){return this.news},getVisibleTrending(){return this.trending},previousPage(){this.currentPage>1&&this.load(this.currentPage-1,this.itemsPerPage)},nextPage(){this.currentPage<this.totalPages&&this.load(this.currentPage+1,this.itemsPerPage)},isCurrentPage(t){return this.currentPage===t},getPaginationButtons(){let t=[];if(this.totalPages<=9)for(let e=1;e<=this.totalPages;e++)t.push({type:"number",value:e});else{if(t.push({type:"number",value:1}),this.currentPage<=5){for(let e=2;e<=6;e++)t.push({type:"number",value:e});t.push({type:"ellipsis",value:"..."})}else if(this.currentPage>=this.totalPages-4){t.push({type:"ellipsis",value:"..."});for(let e=this.totalPages-5;e<=this.totalPages-1;e++)t.push({type:"number",value:e})}else{t.push({type:"ellipsis",value:"..."});for(let e=this.currentPage-2;e<=this.currentPage+2;e++)t.push({type:"number",value:e});t.push({type:"ellipsis",value:"..."})}t.push({type:"number",value:this.totalPages})}return t}}}),o.data("fixtureComponent",h),window.fixtureComponent=h,window.Alpine=o,o.start(),document.addEventListener("DOMContentLoaded",async()=>{(()=>{const t=document.createElement("div");
1t.className="custom-js-tooltip",document.body.appendChild(t),document.addEventListener("mouseover",e=>{const s=e.target.closest("[data-tooltip]");if(!s)return;const a=s.getAttribute("data-tooltip");if(!a)return;t.textContent=a,t.classList.add("visible");const i=()=>{const e=s.getBoundingClientRect(),a=t.getBoundingClientRect(),i=e.top-a.height-10+window.scrollY;t.style.left=e.left+e.width/2-a.width/2+"px",t.style.top=i+"px"};i(),requestAnimationFrame(i)}),document.addEventListener("mouseout",e=>{e.target.closest("[data-tooltip]")&&t.classList.remove("visible")})})(),ajax_object,(async()=>{try{await Promise.all([n()])}catch(t){}})()}),e("Main app.js loaded successfully"),e("Body classes:",[...document.body.classList]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.