(this.webpackJsonpfrontend=this.webpackJsonpfrontend||[]).push([[0],{104:function(e,t,n){},105:function(e,t,n){},111:function(e,t,n){"use strict";n.r(t);var c=n(0),a=n.n(c),s=n(14),i=n.n(s),r=n(10),o=n(7),d=n(4),j=n(53),u=(n(58),n(1)),l=function(e){var t=e.sendMessageFn,n=e.onLogin,a=Object(c.useState)(""),s=Object(o.a)(a,2),i=s[0],r=s[1],d=Object(c.useState)(""),j=Object(o.a)(d,2),l=j[0],b=j[1],O=Object(c.useState)(!1),h=Object(o.a)(O,2),f=h[0],p=h[1];return Object(u.jsxs)("div",{children:[Object(u.jsx)("span",{children:"Username: "}),Object(u.jsx)("input",{value:l,onChange:function(e){return b(e.target.value)}}),Object(u.jsx)("span",{children:"Password: "}),Object(u.jsx)("input",{type:"password",value:i,onChange:function(e){return r(e.target.value)}}),Object(u.jsx)("button",{onClick:function(){t({action:"login",data:{username:l,password:i}},(function(e){e.result?n(e.preferences):p(!0)}))},children:"Login"}),f&&Object(u.jsx)("p",{style:{color:"red"},children:"Wrong password"})]})},b=(n(104),function(e){var t=e.goTo;return Object(u.jsx)("div",{children:Object(u.jsxs)("ul",{className:"header",children:[Object(u.jsx)("li",{className:"header",onClick:function(){return t("sureBets")},children:Object(u.jsx)("a",{className:"header",children:"Sure bets"})}),Object(u.jsx)("li",{className:"header",onClick:function(){return t("analyses")},children:Object(u.jsx)("a",{className:"header",children:"Analyses"})}),Object(u.jsx)("li",{className:"header",onClick:function(){return t("pureOddsValueBets")},children:Object(u.jsx)("a",{className:"header",children:"Odds value bets"})}),Object(u.jsx)("li",{className:"header",onClick:function(){return t("mappings")},children:Object(u.jsx)("a",{className:"header",children:"Mapping"})}),Object(u.jsx)("li",{className:"header",onClick:function(){return t("history")},children:Object(u.jsx)("a",{className:"header",children:"Betting history"})}),Object(u.jsx)("li",{className:"header",onClick:function(){return t("browse_odds")},children:Object(u.jsx)("a",{className:"header",children:"Browse odds"})}),Object(u.jsx)("li",{className:"header",onClick:function(){return t("stats")},children:Object(u.jsx)("a",{className:"header",children:"Stats"})}),Object(u.jsx)("li",{className:"header",onClick:function(){return t("liveStats")},children:Object(u.jsx)("a",{className:"header",children:"Live stats"})}),Object(u.jsx)("li",{className:"header",onClick:function(){return t("configuration")},children:Object(u.jsx)("a",{className:"header",children:"Configuration"})})]})})}),O=function(e){var t=e.href,n=e.text;return t.startsWith("Lootbet")||t.startsWith("Betcoin")||t.startsWith("Nitrogen")?Object(u.jsx)("a",{href:"#",onClick:function(e){e.preventDefault();var n=t.substring(t.indexOf("search: ")+8),c=document.createElement("textarea");c.value=n,document.body.appendChild(c),c.select(),document.execCommand("copy"),document.body.removeChild(c)},children:n}):Object(u.jsx)("a",{href:t,target:"_blank",children:n})},h=function(e){var t=e.sendMessageFn,n=Object(c.useState)([]),a=Object(o.a)(n,2),s=a[0],i=a[1];return Object(c.useEffect)((function(){t({action:"getMappings",data:{}},(function(e){i(e)}))}),[]),Object(u.jsx)("div",{children:s.slice(0,100).map((function(e,n){return Object(u.jsxs)("div",{children:[e.min_distance," - ",e.home_team," vs ",e.away_team," at ",e.date,Object(u.jsx)("ul",{children:e.betting_sites.map((function(n){return Object(u.jsxs)("li",{children:[n.company," - ",n.home_team," vs ",n.away_team," at ",n.date,Object(u.jsx)("button",{onClick:function(){t({action:"fixMatch",data:{match_id:e.match_id,company:n.company,sport:e.sport}})},children:"Fake"})]},n.company)}))})]})}))})},f=n(19),p=n(169),x=n(160),_=n(161),m=n(154),v=n(166),y=n(155),g=n(165),S=n(156),C=n(150),k=n(167),w=n(162),T=(n(105),n(81)),M=n(82),B=n(170),A=n(163),N=["EUR","CZK"],I=["BITCOIN","TRON","MONERO","LITECOIN","ETHEREUM","RIPPLE"],E=[].concat(N,I),H={},F=function(e,t){return"CZK"==t?e:e*H[t.toLowerCase()].czk},P="ANALYSIS_BET",R="SURE_BET",z=function(e){var t=e.bet,n=e.sendMessage,a=e.setBets,s=e.idx,i=e.setBalance,j=Object(c.useState)({editable:!1,bet_amount:t.bet_amount,potential_win:t.potential_win}),l=Object(o.a)(j,2),b=l[0],O=l[1];return Object(u.jsxs)("tr",{children:[Object(u.jsx)("td",{children:t.sport}),Object(u.jsx)("td",{children:t.home_team}),Object(u.jsx)("td",{children:t.away_team}),Object(u.jsx)("td",{children:t.placed_at}),Object(u.jsx)("td",{children:t.starts_at}),Object(u.jsx)("td",{children:t.site}),Object(u.jsx)("td",{children:"string"==typeof t.odds_type?t.odds_type:JSON.stringify(t.odds_type)}),Object(u.jsx)("td",{children:b.editable?Object(u.jsx)("input",{type:"number",onChange:function(e){return O(Object(d.a)(Object(d.a)({},b),{},{bet_amount:parseFloat(e.target.value)}))},value:b.bet_amount}):t.bet_amount}),Object(u.jsx)("td",{children:t.currency}),Object(u.jsx)("td",{children:b.editable?Object(u.jsx)("input",{type:"number",onChange:function(e){return O(Object(d.a)(Object(d.a)({},b),{},{potential_win:parseFloat(e.target.value)}))},value:b.potential_win}):t.potential_win}),Object(u.jsx)("td",{children:F(t.bet_amount,t.currency)}),Object(u.jsx)("td",{children:F(t.potential_win,t.currency)}),Object(u.jsx)("td",{children:t.state}),Object(u.jsx)("td",{children:"OPEN"==t.state&&Object(u.jsxs)(u.Fragment,{children:[!b.editable&&Object(u.jsxs)(u.Fragment,{children:[Object(u.jsx)("button",{onClick:function(){n({action:"modifyBetHistory",data:{id:t.id,state:"WIN",bet_amount:t.bet_amount,potential_win:t.potential_win}},(function(e){e.result&&(a((function(e){return Object(T.a)(s,(function(e){return Object(d.a)(Object(d.a)({},e),{},{state:"WIN"})}),e)})),i((function(e){return Object(d.a)(Object(d.a)({},e),{},Object(r.a)({},t.site,e[t.site]+t.potential_win))})))}))},children:"Won"}),Object(u.jsx)("button",{onClick:function(){n({action:"modifyBetHistory",data:{id:t.id,state:"LOST",bet_amount:t.bet_amount,potential_win:t.potential_win}},(function(e){e.result&&a((function(e){return Object(T.a)(s,(function(e){return Object(d.a)(Object(d.a)({},e),{},{state:"LOST"})}),e)}))}))},children:"Lost"}),Object(u.jsx)("button",{onClick:function(){n({action:"modifyBetHistory",data:{id:t.id,state:"CANCELLED",bet_amount:t.bet_amount,potential_win:t.potential_win}},(function(e){e.result&&(a((function(e){return Object(T.a)(s,(function(e){return Object(d.a)(Object(d.a)({},e),{},{state:"CANCELLED"})}),e)})),i((function(e){return Object(d.a)(Object(d.a)({},e),{},Object(r.a)({},t.site,e[t.site]+t.bet_amount))})))}))},children:"Cancelled"})]}),Object(u.jsx)("button",{onClick:function(){b.editable?n({action:"modifyBetHistory",data:{id:t.id,bet_amount:b.bet_amount,potential_win:b.potential_win,state:t.state}},(function(e){e.result&&(a((function(e){return Object(T.a)(s,(function(e){return Object(d.a)(Object(d.a)({},e),{},{bet_amount:b.bet_amount,potential_win:b.potential_win})}),e)})),O(Object(d.a)(Object(d.a)({},b),{},{editable:!1})))})):O(Object(d.a)(Object(d.a)({},b),{},{editable:!0}))},children:"Edit"})]})}),Object(u.jsxs)("td",{children:["WIN"==t.state&&Object(u.jsx)("span",{style:{color:"green"},children:t.potential_win}),"LOST"==t.state&&Object(u.jsx)("span",{style:{color:"red"},children:t.bet_amount}),"CANCELLED"==t.state&&Object(u.jsx)("span",{style:{color:"ref"},children:t.bet_amount})]}),Object(u.jsx)("td",{children:t.auto_decision})]},t.id)},L=function(e){var t=e.sendMessage,n=e.companies,a=Object(c.useState)([]),s=Object(o.a)(a,2),i=s[0],j=s[1],l=Object(c.useState)({}),b=Object(o.a)(l,2),O=b[0],h=b[1],p=Object(c.useState)(!0),x=Object(o.a)(p,2),_=x[0],m=x[1],v=Object(c.useState)(!0),y=Object(o.a)(v,2),g=y[0],S=y[1],C=Object(c.useState)(!1),k=Object(o.a)(C,2),w=k[0],T=k[1],N=Object(c.useState)(!0),I=Object(o.a)(N,2),E=I[0],H=I[1],L=Object(c.useState)(!0),D=Object(o.a)(L,2),W=D[0],V=D[1],q=Object(c.useState)(!0),U=Object(o.a)(q,2),Y=U[0],G=U[1];Object(c.useEffect)((function(){t({action:"getBetHistory",data:{}},(function(e){j(e.bets),h(e.balance)}))}),[]);var J=Object(M.a)((function(e,t){return t.bet_type==R?"WIN"==t.state?(e.sure.profit+=F(t.potential_win,t.currency)-F(t.bet_amount,t.currency),e.sure.count+=1,e.sure.invested+=F(t.bet_amount,t.currency)):"LOST"==t.state&&(e.sure.profit-=F(t.bet_amount,t.currency),e.sure.count+=1,e.sure.invested+=F(t.bet_amount,t.currency)):t.bet_type==P?"WIN"==t.state?(e.value.profit+=F(t.potential_win,t.currency)-F(t.bet_amount,t.currency),e.value.count+=1,e.value.invested+=F(t.bet_amount,t.currency)):"LOST"==t.state&&(e.value.profit-=F(t.bet_amount,t.currency),e.value.count+=1,e.value.invested+=F(t.bet_amount,t.currency)):"ODDS_BET"==t.bet_type&&("WIN"==t.state?(e.odds.profit+=F(t.potential_win,t.currency)-F(t.bet_amount,t.currency),e.odds.count+=1,e.odds.invested+=F(t.bet_amount,t.currency)):"LOST"==t.state&&(e.odds.profit-=F(t.bet_amount,t.currency),e.odds.count+=1,e.odds.invested+=F(t.bet_amount,t.currency))),"OPEN"==t.state&&(e.currently_invested[t.site]+=t.bet_amount),e}),{value:{profit:0,count:0,invested:0,std_deviation:0},odds:{profit:0,count:0,invested:0,std_deviation:0},sure:{profit:0,count:0,invested:0,std_deviation:0},currently_invested:Object.fromEntries(n.map((function(e){return[e,0]})))},i),K=Object(M.a)((function(e,t){if(t.bet_type==R){var n=e.sure.profit/e.sure.count;"WIN"==t.state?e.sure.std_deviation+=Math.pow(t.potential_win-t.bet_amount-n,2):"LOST"==t.state&&(e.sure.std_deviation+=Math.pow(-t.bet_amount-n,2))}else if(t.bet_type==P){var c=e.value.profit/e.value.count;"WIN"==t.state?e.value.std_deviation+=Math.pow(t.potential_win-t.bet_amount-c,2):"LOST"==t.state&&(e.value.std_deviation+=Math.pow(-t.bet_amount-c,2))}else if("ODDS_BET"==t.bet_type){var a=e.odds.profit/e.odds.count;"WIN"==t.state?e.odds.std_deviation+=Math.pow(t.potential_win-t.bet_amount-a,2):"LOST"==t.state&&(e.odds.std_deviation+=Math.pow(-t.bet_amount-a,2))}return e}),J,i);return K.sure.std_deviation=Math.sqrt(K.sure.std_deviation/K.sure.count),K.odds.std_deviation=Math.sqrt(K.odds.std_deviation/K.odds.count),K.value.std_deviation=Math.sqrt(K.value.std_deviation/K.value.count),Object(u.jsxs)("div",{children:[Object(u.jsx)(B.a,{control:Object(u.jsx)(A.a,{checked:_,onChange:function(e){return m(e.target.checked)}}),label:"Only in past"}),Object(u.jsx)(B.a,{control:Object(u.jsx)(A.a,{checked:g,onChange:function(e){return S(e.target.checked)}}),label:"Only open"}),Object(u.jsx)(B.a,{control:Object(u.jsx)(A.a,{checked:w,onChange:function(e){return T(e.target.checked)}}),label:"Needs attention"}),Object(u.jsx)(B.a,{control:Object(u.jsx)(A.a,{checked:E,onChange:function(e){return H(e.target.checked)}}),label:"Sure bets"}),Object(u.jsx)(B.a,{control:Object(u.jsx)(A.a,{checked:W,onChange:function(e){return V(e.target.checked)}}),label:"Analyses"}),Object(u.jsx)(B.a,{control:Object(u.jsx)(A.a,{checked:Y,onChange:function(e){return G(e.target.checked)}}),label:"Odds bets"}),Object(u.jsxs)("div",{children:[Object(u.jsxs)("div",{style:{color:J.sure.profit>0?"green":"red",float:"left"},children:[Object(u.jsx)("h3",{children:"Sure bets"}),Object(u.jsxs)("p",{children:["Profit: ",J.sure.profit.toFixed(0)]}),Object(u.jsxs)("p",{children:["RoI: ",((J.sure.profit+J.sure.invested)/J.sure.invested*100-100).toFixed(2),"%"]}),Object(u.jsxs)("p",{children:["Count: ",J.sure.count]})]}),Object(u.jsxs)("div",{style:{color:J.value.profit>0?"green":"red",float:"left",marginLeft:25},children:[Object(u.jsx)("h3",{children:"Analysis bets"}),Object(u.jsxs)("p",{children:["Profit: ",J.value.profit.toFixed(0)]}),Object(u.jsxs)("p",{children:["RoI: ",((J.value.profit+J.value.invested)/J.value.invested*100-100).toFixed(2),"%"]}),Object(u.jsxs)("p",{children:["Count: ",J.value.count]}),Object(u.jsxs)("p",{children:["Std dev per bet: ",K.value.std_deviation.toFixed(2)]}),Object(u.jsxs)("p",{children:["80% profit: ",((J.value.profit/J.value.count-1.282*K.value.std_deviation/Math.sqrt(J.value.count))*J.value.count).toFixed(2)," to ",((J.value.profit/J.value.count+1.282*K.value.std_deviation/Math.sqrt(J.value.count))*J.value.count).toFixed(2)]}),Object(u.jsxs)("p",{children:["90% profit: ",((J.value.profit/J.value.count-1.645*K.value.std_deviation/Math.sqrt(J.value.count))*J.value.count).toFixed(2)," to ",((J.value.profit/J.value.count+1.645*K.value.std_deviation/Math.sqrt(J.value.count))*J.value.count).toFixed(2)]}),Object(u.jsxs)("p",{children:["99% profit: ",((J.value.profit/J.value.count-2.576*K.value.std_deviation/Math.sqrt(J.value.count))*J.value.count).toFixed(2)," to ",((J.value.profit/J.value.count+2.576*K.value.std_deviation/Math.sqrt(J.value.count))*J.value.count).toFixed(2)]})]}),Object(u.jsxs)("div",{style:{color:J.odds.profit>0?"green":"red",float:"left",marginLeft:25},children:[Object(u.jsx)("h3",{children:"Odds bets"}),Object(u.jsxs)("p",{children:["Profit: ",J.odds.profit.toFixed(0)]}),Object(u.jsxs)("p",{children:["RoI: ",((J.odds.profit+J.odds.invested)/J.odds.invested*100-100).toFixed(2),"%"]}),Object(u.jsxs)("p",{children:["Count: ",J.odds.count]}),Object(u.jsxs)("p",{children:["Std dev per bet: ",K.odds.std_deviation.toFixed(2)]}),Object(u.jsxs)("p",{children:["80% profit: ",((J.odds.profit/J.odds.count-1.282*K.odds.std_deviation/Math.sqrt(J.odds.count))*J.odds.count).toFixed(2)," to ",((J.odds.profit/J.odds.count+1.282*K.odds.std_deviation/Math.sqrt(J.odds.count))*J.odds.count).toFixed(2)]}),Object(u.jsxs)("p",{children:["90% profit: ",((J.odds.profit/J.odds.count-1.645*K.odds.std_deviation/Math.sqrt(J.odds.count))*J.odds.count).toFixed(2)," to ",((J.odds.profit/J.odds.count+1.645*K.odds.std_deviation/Math.sqrt(J.odds.count))*J.odds.count).toFixed(2)]}),Object(u.jsxs)("p",{children:["99% profit: ",((J.odds.profit/J.odds.count-2.576*K.odds.std_deviation/Math.sqrt(J.odds.count))*J.odds.count).toFixed(2)," to ",((J.odds.profit/J.odds.count+2.576*K.odds.std_deviation/Math.sqrt(J.odds.count))*J.odds.count).toFixed(2)]})]}),Object(u.jsxs)("div",{style:{float:"left",marginLeft:25},children:[Object(u.jsx)("h3",{children:"Current balance"}),n.map((function(e){return Object(u.jsxs)("p",{children:[e,": ",O[e],Object(u.jsx)("input",{type:"number",value:O[e+"_modify"],onChange:function(t){return h(Object(d.a)(Object(d.a)({},O),{},Object(r.a)({},e+"_modify",parseFloat(t.target.value))))}}),Object(u.jsx)("button",{onClick:function(){t({action:"updateBalance",data:{company:e,value:""+(O[e]+O[e+"_modify"])}},(function(t){var n;t.result&&h(Object(d.a)(Object(d.a)({},O),{},(n={},Object(r.a)(n,e,O[e]+O[e+"_modify"]),Object(r.a)(n,e+"_modify",0),n)))}))},children:"Add"}),Object(u.jsx)("button",{onClick:function(){t({action:"updateBalance",data:{company:e,value:""+(O[e]-O[e+"_modify"])}},(function(t){var n;t.result&&h(Object(d.a)(Object(d.a)({},O),{},(n={},Object(r.a)(n,e,O[e]-O[e+"_modify"]),Object(r.a)(n,e+"_modify",0),n)))}))},children:"Remove"})]})}))]}),Object(u.jsxs)("div",{style:{float:"left",marginLeft:25},children:[Object(u.jsx)("h3",{children:"Currently Invested"}),n.map((function(e){return Object(u.jsxs)("p",{children:[e,": ",J.currently_invested[e]]})}))]})]}),Object(u.jsxs)("table",{children:[Object(u.jsxs)("tr",{children:[Object(u.jsx)("th",{children:"Sport"}),Object(u.jsx)("th",{children:"Home"}),Object(u.jsx)("th",{children:"Away"}),Object(u.jsx)("th",{onClick:function(){var e=Object(f.a)(i);e.sort((function(e,t){var n=new Date(e.placed_at);return new Date(t.placed_at)-n})),j(e)},children:"Placed at"}),Object(u.jsx)("th",{children:"Starts at"}),Object(u.jsx)("th",{children:"Site"}),Object(u.jsx)("th",{children:"Type"}),Object(u.jsx)("th",{children:"Bet amount"}),Object(u.jsx)("th",{children:"Currency"}),Object(u.jsx)("th",{children:"Potential amount"}),Object(u.jsx)("th",{children:"Bet amount CZK"}),Object(u.jsx)("th",{children:"Potential amount CZK"}),Object(u.jsx)("th",{children:"Status"}),Object(u.jsx)("th",{children:"Actions"}),Object(u.jsx)("th",{children:"Result"}),Object(u.jsx)("th",{children:"Auto decision"})]}),i.map((function(e,n){var c=!0;_&&(c=new Date>new Date(e.starts_at));return g&&"OPEN"!=e.state&&(c=!1),!w||e.auto_decision&&"DECIDED"!=e.auto_decision&&"MATCH_IS_NOT_FINISHED"!=e.auto_decision||(c=!1),E||"SURE_BET"!=e.bet_type||(c=!1),W||"ANALYSIS_BET"!=e.bet_type||(c=!1),Y||"ODDS_BET"!=e.bet_type||(c=!1),c?Object(u.jsx)(z,{sendMessage:t,bet:e,idx:n,setBets:j,setBalance:h}):null}))]})]})},D=Object(c.memo)(L),W=n(146),V=n(147),q=n(171),U=n(149),Y=n(151),G=n(152),J=n(153),K=function(e){switch(e){case"Tipsport":case"Sazkabet":return"CZK";case"Betmaster":return"EUR";case"1Xbit":case"X1Bit":return"MONERO";case"Cloudbet":case"N1Bet":return"LITECOIN";case"Nitrogen":return"BITCOIN"}return"CZK"},Z=function(e){var t=e.vb,n=e.sendMessage,a=e.removeSameMatches,s=e.companies,i=Object(c.useState)(Object.fromEntries(s.map((function(e){return[e,0]})))),j=Object(o.a)(i,2),l=j[0],b=j[1];return Object(u.jsxs)(W.a,{children:[Object(u.jsx)(V.a,{children:t.date}),Object(u.jsx)(V.a,{children:JSON.stringify(t.odds_type)}),Object(u.jsx)(V.a,{children:t.home_team}),Object(u.jsx)(V.a,{children:t.away_team}),Object(u.jsx)(V.a,{children:100*t.probability_diff}),s.map((function(e){return Object(u.jsxs)(V.a,{children:[t.odds[e]&&Object(u.jsx)(q.a,{interactive:!0,title:Object(u.jsxs)(u.Fragment,{children:[Object(u.jsx)("p",{children:t.odds[e].home_team}),Object(u.jsx)("p",{children:t.odds[e].away_team}),Object(u.jsx)("p",{children:t.odds[e].date}),Object(u.jsx)("button",{onClick:function(){n({action:"fixMatch",data:{match_id:t.match_id,company:e,sport:t.sport}})},children:"Fake!"})]}),children:Object(u.jsx)("a",{target:"_blank",href:t.odds[e].url,children:t.odds[e].displayedValue})}),Object(u.jsxs)(u.Fragment,{children:[Object(u.jsx)("br",{}),Object(u.jsx)("input",{style:{width:50},type:"number",value:l[e],onChange:function(t){return b(Object(d.a)(Object(d.a)({},l),{},Object(r.a)({},e,parseInt(t.target.value))))}}),Object(u.jsx)("button",{onClick:function(){return function(e,c,a,s,i){n({action:"saveBetIntoHistory",data:{currency:K(e),site:e,starts_at:t.date,sport:t.sport,home_team:t.home_team,away_team:t.away_team,odds_type:t.odds_type,bet_amount:c,match_id:i,potential_win:c*a,bet_type:"ODDS_BET"}},(function(e){s()}))}(e,l[e],t.odds[e].displayedValue,a,t.odds[e].match_id)},children:"Bet"})]})]})}))]})},X=function(e){var t=e.sendMessage,n=e.companies,a=Object(c.useState)([]),s=Object(o.a)(a,2),i=s[0],r=s[1],d=Object(c.useState)(4),j=Object(o.a)(d,2),l=j[0],b=j[1];return Object(c.useEffect)((function(){t({action:"getValueBetsByPureOdds",data:{max_odds:l}},(function(e){r(e)}))}),[]),Object(u.jsxs)("div",{children:[Object(u.jsx)(U.a,{type:"number",value:l,onChange:function(e){return b(parseFloat(e.target.value))}}),Object(u.jsx)(C.a,{onClick:function(){t({action:"getValueBetsByPureOdds",data:{max_odds:l}},(function(e){r(e)}))},children:"Search"}),Object(u.jsxs)(Y.a,{children:[Object(u.jsx)(G.a,{children:Object(u.jsxs)(W.a,{children:[Object(u.jsx)(V.a,{children:"Date"}),Object(u.jsx)(V.a,{children:"Type"}),Object(u.jsx)(V.a,{children:"Home team"}),Object(u.jsx)(V.a,{children:"Away team"}),Object(u.jsx)(V.a,{children:"%EV"}),n.map((function(e){return Object(u.jsx)(V.a,{children:e},e)}))]})}),Object(u.jsx)(J.a,{children:i.map((function(e){return Object(u.jsx)(Z,{vb:e,sendMessage:t,companies:n,removeSameMatches:function(){return r(i.filter((function(t){return!(t.home_team==e.home_team&&t.away_team==e.away_team&&t.date==e.date)})))}})}))})]})]})},Q=Object(c.memo)(X),$=function(e){e.betSize;var t,n=e.sureBet,a=e.setGlobalState,s=(e.idx,e.sendMessage),i=e.showConfig,j=e.desiredPayout,l=e.isLiveBet,b=e.isFrozen,h=Object(c.useState)(!1),_=Object(o.a)(h,2),m=_[0],v=_[1],y=Object(c.useState)(n.odds.map((function(e){return j/e[1].effectiveValue}))),g=Object(o.a)(y,2),S=g[0],C=g[1],k=Object(c.useState)(n.odds.map((function(e){return K(e[1].company)}))),w=Object(o.a)(k,2),T=w[0],M=w[1],B=Object(c.useState)(n.odds.map((function(e){return!1}))),A=Object(o.a)(B,2),N=A[0],I=A[1],H=Object(c.useState)(n.odds.map((function(e){return{forced:!1,value:2}}))),P=Object(o.a)(H,2),z=P[0],L=P[1];Object(c.useEffect)((function(){var e=setInterval((function(){b&&l&&!m&&fetch(Se()+"/getOdds?sport="+n.sport+"&hashId="+n.odds[0][1].hashId).then((function(e){e.text().then((function(e){L((function(t){return Object(p.a)(0,{forced:!0,value:parseFloat(e)},t)}))}))}))}),1e3),t=setInterval((function(){b&&l&&!m&&fetch(Se()+"/getOdds?sport="+n.sport+"&hashId="+n.odds[1][1].hashId).then((function(e){e.text().then((function(e){L((function(t){return Object(p.a)(1,{forced:!0,value:parseFloat(e)},t)}))}))}))}),1e3);return function(){clearInterval(e),clearInterval(t)}}),[b,l,m]);for(var D=0,W=0;Wl&&(F+=1);return document.title=F>0?F+" new sure bets":"...",Object(u.jsxs)("div",{children:[0==t.length&&Object(u.jsx)("p",{children:"There are no sure bets right now"}),Object(u.jsxs)("div",{children:[Object(u.jsx)(C.a,{onClick:function(){return a((function(e){for(var n in t)t[n].isNew=!1;return document.title="...",Object(d.a)(Object(d.a)({},e),{},{sureBets:t})}))},variant:"contained",children:"Read all"}),Object(u.jsx)(C.a,{onClick:function(){return a((function(e){var t=Object(f.a)(e.sureBetsToHide);for(var n in e.sureBets)t.push(e.sureBets[n].id);return Object(d.a)(Object(d.a)({},e),{},{sureBetsToHide:t})}))},variant:"contained",children:"Hide all"})]}),Object(u.jsx)("div",{children:Object(_.a)(Object(m.a)(v.a)((function(e,t){return t>=100?null:Object(u.jsx)($,{sendMessage:s,betSize:n,sureBet:e,idx:t,setGlobalState:a,showConfig:i,showCopySnackbar:function(){return A(!0)},matchIdsToHide:r,desiredPayout:n,isLiveBet:p},e.id)})),Object(y.a)((function(e,t){return t[j]-e[j]})),Object(g.a)((function(e){return!r.find((function(t){return Object(x.a)(e.match_id,t)}))&&!b.find((function(t){return e.id==t}))})),S.a)(t)}),Object(u.jsx)(k.a,{open:B,autoHideDuration:2e3,onClose:function(){return A(!1)},children:Object(u.jsx)(w.a,{elevation:6,severity:"success",onClose:function(){return A(!1)},variant:"filled",children:"Copied into clipboard"})})]})},te=n(172),ne=n(159),ce=n(174),ae=["ANY","MATCH_PART_HOME_WINS","MATCH_PART_DRAW","MATCH_PART_AWAY_WINS","MATCH_PART_HOME_WINS_OR_DRAW","MATCH_PART_AWAY_WINS_OR_DRAW","MATCH_PART_NO_DRAW","MATCH_PART_HANDICAP_WITHOUT_DRAW_HOME_WINS","MATCH_PART_HANDICAP_WITHOUT_DRAW_AWAY_WINS","MATCH_PART_UNDER","MATCH_PART_OVER","MATCH_PART_HOME_TEAM_GOALS_UNDER","MATCH_PART_HOME_TEAM_GOALS_OVER","MATCH_PART_AWAY_TEAM_GOALS_UNDER","MATCH_PART_AWAY_TEAM_GOALS_OVER","MATCH_PART_BOTH_TEAMS_SCORE","MATCH_PART_BOTH_TEAMS_DONT_SCORE","MATCH_PART_HOME_TEAM_SCORES_FIRST","MATCH_PART_NOBODY_SCORES_FIRST","MATCH_PART_AWAY_TEAM_SCORES_FIRST","GOAL_IN_BOTH_HALVES","NO_GOAL_IN_BOTH_HALVES"],se=function(e){var t=e.match,n=e.odd,a=e.type,s=e.sendMessage,i=Object(c.useState)(0),r=Object(o.a)(i,2),d=r[0],j=r[1],l=Object(c.useState)(!1),b=Object(o.a)(l,2),O=b[0],h=b[1];return Object(u.jsx)(V.a,{children:!O&&Object(u.jsxs)(u.Fragment,{children:[Object(u.jsx)("input",{type:"number",value:d,onChange:function(e){return j(parseFloat(e.target.value))}}),Object(u.jsx)("button",{onClick:function(){s({action:"saveBetIntoHistory",data:{currency:"CZK",site:n.company,starts_at:t.date,sport:t.sport,home_team:t.home_team,away_team:t.away_team,match_id:t.id,odds_type:a,bet_amount:d,potential_win:parseFloat(d*n.displayedValue),bet_type:P}},(function(e){h(!0)}))},children:"Make bet"})]})})},ie=function(e){var t=e.sendMessage,n=e.companies,a=Object(c.useState)(""),s=Object(o.a)(a,2),i=s[0],r=s[1],d=Object(c.useState)(ae[0]),j=Object(o.a)(d,2),l=j[0],b=j[1],h=Object(c.useState)(void 0),f=Object(o.a)(h,2),p=f[0],x=f[1],_=Object(c.useState)([]),m=Object(o.a)(_,2),v=m[0],y=m[1];return Object(u.jsxs)(u.Fragment,{children:[Object(u.jsxs)("div",{children:[Object(u.jsx)("input",{value:i,onChange:function(e){return r(e.target.value)},onKeyDown:function(e){"Enter"==e.key&&t({action:"getOdds",data:{name:i}},(function(e){y(e)}))}}),Object(u.jsx)("button",{onClick:function(e){t({action:"getOdds",data:{name:i}},(function(e){y(e)}))},children:"Search"}),Object(u.jsx)(te.a,{id:"odds_filter",children:"Odds filter"}),Object(u.jsx)(ne.a,{labelId:"odds_filter",value:l,onChange:function(e){return b(e.target.value)},children:ae.map((function(e){return Object(u.jsx)(ce.a,{value:e,children:e})}))}),Object(u.jsx)(te.a,{id:"company_filter",children:"Company filter"}),Object(u.jsxs)(ne.a,{labelId:"company_filter",value:p,onChange:function(e){return x(e.target.value)},children:[Object(u.jsx)(ce.a,{value:void 0,children:"ANY"}),n.map((function(e){return Object(u.jsx)(ce.a,{value:e,children:e},e)}))]})]}),Object(u.jsxs)(Y.a,{children:[Object(u.jsx)(G.a,{children:Object(u.jsxs)(W.a,{children:[Object(u.jsx)(V.a,{children:"Sport"}),Object(u.jsx)(V.a,{children:"Home team"}),Object(u.jsx)(V.a,{children:"Away team"}),Object(u.jsx)(V.a,{children:"At"})]})}),Object(u.jsx)(J.a,{children:v.map((function(e){return Object(u.jsxs)(u.Fragment,{children:[Object(u.jsxs)(W.a,{children:[Object(u.jsx)(V.a,{children:e.sport}),Object(u.jsx)(V.a,{children:e.home_team}),Object(u.jsx)(V.a,{children:e.away_team}),Object(u.jsx)(V.a,{children:e.date})]}),Object(u.jsx)(W.a,{children:Object(u.jsx)(V.a,{colSpan:4,children:Object(u.jsxs)(Y.a,{children:[Object(u.jsx)(G.a,{children:Object(u.jsxs)(W.a,{children:[Object(u.jsx)(V.a,{children:"Type"}),Object(u.jsx)(V.a,{children:"Site"}),Object(u.jsx)(V.a,{children:"Odds"}),Object(u.jsx)(V.a,{children:"Link"}),Object(u.jsx)(V.a,{children:"Make bet"})]})}),Object(u.jsx)(J.a,{children:Object.keys(e.odds).filter((function(e){return"ANY"==l||e.startsWith('"'+l)||e.startsWith('{"'+l)})).map((function(n){return e.odds[n].map((function(c){return p&&p!=c.company?null:Object(u.jsxs)(W.a,{children:[Object(u.jsx)(V.a,{children:n}),Object(u.jsx)(V.a,{children:c.company}),Object(u.jsx)(V.a,{children:c.displayedValue}),Object(u.jsx)(V.a,{children:Object(u.jsx)(O,{href:c.url,text:c.url})}),Object(u.jsx)(se,{type:n,sendMessage:t,match:e,odd:c})]})}))}))})]})})})]})}))})]})]})},re=Object(c.memo)(ie),oe=n(168),de=function(e,t){return 0==e||0==t?0:1/e*100-1/t*100},je=function(e,t){"bestOdds"==e?t.sort((function(e,t){return de(t.analysis_odds,Math.max(t.tipsport_odds,t.sazka_odds,t.synot_odds,t.fortuna_odds))-de(e.analysis_odds,Math.max(e.tipsport_odds,e.sazka_odds,e.synot_odds,e.fortuna_odds))})):"created_at"==e?t.sort((function(t,n){var c=Date.parse(t[e]);return Date.parse(n[e])-c})):t.sort((function(t,n){return n[e]-t[e]}))},ue=function(e){var t=e.minProfit,n=e.sendMessage,a=e.vb,s=e.removeSameMatches,i=e.unit_size,r=Object(c.useState)(a.stake*i),d=Object(o.a)(r,2),j=d[0],l=d[1],b=Object(c.useState)(a.stake*i),h=Object(o.a)(b,2),f=h[0],p=h[1],x=Object(c.useState)(a.stake*i),_=Object(o.a)(x,2),m=_[0],v=_[1],y=Object(c.useState)(a.stake*i),g=Object(o.a)(y,2),S=g[0],C=g[1],k=Math.max(a.tipsport_odds,a.sazka_odds,a.synot_odds,a.fortuna_odds),w=function(e,t,c,s,i){n({action:"saveBetIntoHistory",data:{currency:"CZK",site:e,starts_at:a.date,sport:a.sport,home_team:a.home_team,away_team:a.away_team,odds_type:a.odds_type,bet_amount:t,match_id:i,potential_win:t*c,bet_type:P,analysis_site:a.source}},(function(e){s()}))};return a.analyser_profita.analysis_odds?"green":a.tipsport_odds==a.analysis_odds?"black":"red"},children:[Object(u.jsx)("a",{target:"_blank",href:a.tipsport_link,children:a.tipsport_odds}),Object(u.jsx)("br",{}),Object(u.jsx)("input",{style:{width:50},type:"number",value:j,onChange:function(e){return l(parseInt(e.target.value))}}),Object(u.jsx)("button",{onClick:function(){return w("Tipsport",j,a.tipsport_odds,(function(){return s()}))},children:"Bet"})]}),Object(u.jsxs)(V.a,{style:{color:a.tipsport_odds>a.analysis_odds?"green":a.tipsport_odds==a.analysis_odds?"black":"red"},children:[de(a.analysis_odds,a.tipsport_odds).toFixed(2),"%"]}),Object(u.jsxs)(V.a,{style:{color:a.sazka_odds>a.analysis_odds?"green":a.sazka_odds==a.analysis_odds?"black":"red"},children:[Object(u.jsx)(O,{href:a.sazka_link,text:a.sazka_odds}),Object(u.jsx)("br",{}),Object(u.jsx)("input",{style:{width:50},type:"number",value:f,onChange:function(e){return p(parseInt(e.target.value))}}),Object(u.jsx)("button",{onClick:function(){return w("Sazkabet",f,a.sazka_odds,(function(){return s()}))},children:"Bet"})]}),Object(u.jsxs)(V.a,{style:{color:a.sazka_odds>a.analysis_odds?"green":a.sazka_odds==a.analysis_odds?"black":"red"},children:[de(a.analysis_odds,a.sazka_odds).toFixed(2),"%"]}),Object(u.jsxs)(V.a,{style:{color:a.synot_odds>a.analysis_odds?"green":a.synot_odds==a.analysis_odds?"black":"red"},children:[Object(u.jsx)("a",{target:"_blank",href:a.synot_link,children:a.synot_odds}),Object(u.jsx)("br",{}),Object(u.jsx)("input",{style:{width:50},type:"number",value:m,onChange:function(e){return v(parseInt(e.target.value))}}),Object(u.jsx)("button",{onClick:function(){return w("Synottip",m,a.synot_odds,(function(){return s()}))},children:"Bet"})]}),Object(u.jsxs)(V.a,{style:{color:a.synot_odds>a.analysis_odds?"green":a.synot_odds==a.analysis_odds?"black":"red"},children:[de(a.analysis_odds,a.synot_odds).toFixed(2),"%"]}),Object(u.jsxs)(V.a,{style:{color:a.fortuna_odds>a.analysis_odds?"green":a.fortuna_odds==a.analysis_odds?"black":"red"},children:[Object(u.jsx)("a",{target:"_blank",href:a.fortuna_link,children:a.fortuna_odds}),Object(u.jsx)("br",{}),Object(u.jsx)("input",{style:{width:50},type:"number",value:S,onChange:function(e){return C(parseInt(e.target.value))}}),Object(u.jsx)("button",{onClick:function(){return w("Fortuna",S,a.fortuna_odds,(function(){return s()}))},children:"Bet"})]}),Object(u.jsxs)(V.a,{style:{color:a.fortuna_odds>a.analysis_odds?"green":a.fortuna_odds==a.analysis_odds?"black":"red"},children:[de(a.analysis_odds,a.fortuna_odds).toFixed(2),"%"]}),Object(u.jsx)(V.a,{style:{color:k>a.analysis_odds?"green":k==a.analysis_odds?"black":"red"},children:k}),Object(u.jsxs)(V.a,{style:{color:k>a.analysis_odds?"green":k==a.analysis_odds?"black":"red"},children:[de(a.analysis_odds,k).toFixed(2),"%"]})]})},le=function(e){var t=e.sendMessage,n=e.unitSize,a=Object(c.useState)([]),s=Object(o.a)(a,2),i=s[0],r=s[1],j=Object(c.useState)({minimumAuthorProfit:0,minimumOddsDiff:0,show:{tipsport:!0,bettingCom:!0,bettingExpert:!0}}),l=Object(o.a)(j,2),b=l[0],O=l[1];return Object(c.useEffect)((function(){t({action:"getValueBets",data:{}},(function(e){je("created_at",e),r(e)}))}),[]),Object(u.jsxs)("div",{children:[Object(u.jsx)(oe.a,{label:"Minimum author profit",value:b.minimumAuthorProfit,type:"number",onChange:function(e){return O(Object(d.a)(Object(d.a)({},b),{},{minimumAuthorProfit:parseFloat(e.target.value)}))}}),Object(u.jsx)(oe.a,{label:"Minimum odds difference",value:b.minimumOddsDiff,type:"number",onChange:function(e){return O(Object(d.a)(Object(d.a)({},b),{},{minimumOddsDiff:parseFloat(e.target.value)}))}}),Object(u.jsx)(B.a,{control:Object(u.jsx)(A.a,{checked:b.show.tipsport,onChange:function(e){return O(Object(d.a)(Object(d.a)({},b),{},{show:Object(d.a)(Object(d.a)({},b.show),{},{tipsport:e.target.checked})}))}}),label:"Tipsport"}),Object(u.jsx)(B.a,{control:Object(u.jsx)(A.a,{checked:b.show.bettingCom,onChange:function(e){return O(Object(d.a)(Object(d.a)({},b),{},{show:Object(d.a)(Object(d.a)({},b.show),{},{bettingCom:e.target.checked})}))}}),label:"Betting.com"}),Object(u.jsx)(B.a,{control:Object(u.jsx)(A.a,{checked:b.show.bettingExpert,onChange:function(e){return O(Object(d.a)(Object(d.a)({},b),{},{show:Object(d.a)(Object(d.a)({},b.show),{},{bettingExpert:e.target.checked})}))}}),label:"Betting Expert"}),Object(u.jsxs)(Y.a,{children:[Object(u.jsx)(G.a,{children:Object(u.jsxs)(W.a,{children:[Object(u.jsx)(V.a,{onClick:function(){var e=Object(f.a)(i);je("created_at",e),r(e)},children:"Created at"}),Object(u.jsx)(V.a,{children:"Home"}),Object(u.jsx)(V.a,{children:"Away"}),Object(u.jsx)(V.a,{children:"Date"}),Object(u.jsx)(V.a,{children:"Author"}),Object(u.jsx)(V.a,{onClick:function(){var e=Object(f.a)(i);je("analyser_profit",e),r(e)},children:"Author profit"}),Object(u.jsx)(V.a,{onClick:function(){var e=Object(f.a)(i);je("analyser_roi",e),r(e)},children:"Author ROI"}),Object(u.jsx)(V.a,{onClick:function(){var e=Object(f.a)(i);je("analyser_ticket_count",e),r(e)},children:"Author ticket count"}),Object(u.jsx)(V.a,{children:"Tip"}),Object(u.jsx)(V.a,{children:"Author odds"}),Object(u.jsx)(V.a,{children:"Stake"}),Object(u.jsx)(V.a,{colSpan:2,children:"Tipsport"}),Object(u.jsx)(V.a,{colSpan:2,children:"Sazka"}),Object(u.jsx)(V.a,{colSpan:2,children:"Synottip"}),Object(u.jsx)(V.a,{colSpan:2,children:"Fortuna"}),Object(u.jsx)(V.a,{onClick:function(){var e=Object(f.a)(i);je("bestOdds",e),r(e)},colSpan:2,children:"Best"})]})}),Object(u.jsx)(J.a,{children:i.map((function(e){var c=!0;b.show.tipsport||"TIPSPORT"!=e.source||(c=!1),b.show.bettingCom||"BETTING_COM"!=e.source||(c=!1),b.show.bettingExpert||"BETTING_EXPERT"!=e.source||(c=!1);var a=Math.max(e.tipsport_odds,e.sazka_odds,e.synot_odds,e.fortuna_odds);return 0==a&&(c=!1),de(e.analysis_odds,a).toFixed(2)