/* Copyright © 2024 Melbet - All Rights Reserved */ import{BETTING_TIMERS as C,BettingTimerName as w,BETTING_TIMER_TYPE_DEFAULT as W}from"./tQSa7H3JUWRJ.js";import{SLASH_DELIMITER as x,BettingType as Y,isNumber as F}from"./entry-Bl6dkD65.js";const q=(t,e={roundingUp:!1})=>{const n=e.roundingUp?Math.ceil:Math.floor,o=n(t/864e5),a=n(t/36e5),r=n(t/6e4),s=n(t/1e3),l=t;return{totalDays:o,totalHours:a,totalMinutes:r,totalSeconds:s,totalMilliseconds:l,days:o,hours:a%24,minutes:r%60,seconds:s%60,milliseconds:l%1e3}},z=(t,e={roundingUp:!1})=>q(t*1e3,e),J=t=>t&&t.charAt(0).toUpperCase()+t.slice(1),K=t=>t<60,Q="<1",X=({isTimeDirectionBackward:t,timeInSeconds:e})=>{const n={roundingUp:!!t};if(K(e))return Q;const{totalMinutes:o}=z(e,n);return o},G=t=>t.map(e=>{const n=((e==null?void 0:e.toString())||"").trim();return J(n)}).filter(Boolean).join(x);var P,U,A;const O=(P=C[w.MENU_COMPONENT])==null?void 0:P[Y.LIVE],Z=(U=C[w.MENU_COMPONENT])==null?void 0:U[W],$=(A=O!=null?O:Z)!=null?A:0,tt=3*1e3,it=({T:t},{matchInfoStage:e,matchInfoFieldType:n,matchInfoScoreLabel:o,additionalInfo:a,additionalType:r,currentPeriodNumber:s,startDateFormatted:l,startTimeFormatted:I,currentPeriodLabel:m,timeInSeconds:_=0,startedAt:f=0,isTimeDirectionBackward:c=!1,matchInfoGameType:L,statsInfo:b,isGameOver:E=!1,currentDate:u=Date.now(),isShowDateTimeLabel:T})=>{const p=f+$+tt,i=u>p,S=i?_:_||(f-u)/1e3,g=!!(i&&s&&!m),v=i?m:void 0,B=(()=>{if(g)return t("main_game_delayed");if(!E&&S){const M=!i&&p-u<6e4,y=i&&K(S),d=X({isTimeDirectionBackward:c,timeInSeconds:S}),H=F(d)&&d>1&&y,R=F(d)&&d>0&&c&&!y;if(d&&!c)return t(i?"main_timer_passed_minutes":"main_timer_before_start_minutes",[d]);if([H,R,M,c].some(Boolean))return t(i?"main_timer_remained_minutes":"main_timer_before_start_minutes",[d])}if(!v&&i)return t("main_game_continues")})(),D=[v,B].filter(Boolean).join(", "),N=G([l,I]),h=M=>G([M,a,r,e,o,n,L,b]),j=h(T?N:D),k=h(T?N:B);return{infoLabel:j,infoLabelWithoutPeriod:k,periodTimeLabel:D}},at=(t,e,n=Date.now())=>{var o,a,r,s,l,I,m,_,f,c,L,b,E,u,T,p;return{matchInfoStage:(r=(o=t.matchInfo)==null?void 0:o.stageName)!=null?r:(a=t.matchInfo)==null?void 0:a.stage,matchInfoFieldType:(s=t.matchInfo)==null?void 0:s.fieldType,matchInfoScoreLabel:(l=t.matchInfo)==null?void 0:l.scoreLabel,additionalInfo:t.additionalInfo,additionalType:t.additionalType,currentPeriodNumber:(m=(I=t.stats)==null?void 0:I.currentPeriodNumber)!=null?m:t.currentPeriodNumber,currentPeriodLabel:(f=(_=t.stats)==null?void 0:_.currentPeriodLabel)!=null?f:t.currentPeriodLabel,startDateFormatted:t.startDateFormatted,startTimeFormatted:t.startTimeFormatted,timeInSeconds:(L=(c=t.stats)==null?void 0:c.timeInSeconds)!=null?L:t.timeInSeconds,startedAt:(b=t.startedAt)!=null?b:t.startTimestamp,isTimeDirectionBackward:!!((u=(E=t.stats)==null?void 0:E.isTimeDirectionBackward)!=null?u:t.isTimeDirectionBackward),matchInfoGameType:(T=t.matchInfo)==null?void 0:T.gameType,isGameOver:!!t.isGameOver,statsInfo:(p=t.stats)==null?void 0:p.info,currentDate:n,isShowDateTimeLabel:e}};export{at as createGetInfoLabelProps,G as createLabelString,it as getGameInfoLabel};