1const e={holdem:"holdem","holdem-h/l":"holdem8",omaha:"omaha","omaha-h/l":"omaha8","7-stud":"7stud","7-stud-h/l":"7stud8",razz:"razz"},t=["6-holdem","6-omaha","5-omaha","5-omaha-h/l","6-omaha-h/l","courchevel","courchevel-h/l"],a={"6-holdem":"6-holdem","6-omaha":"6-omaha","5-omaha":"5-omaha","5-omaha-h/l":"5-omaha-h/l","6-omaha-h/l":"6-omaha-h/l"},n={2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"T",jack:"J",queen:"Q",king:"K",ace:"A"},r={hearts:"h",diamonds:"d",clubs:"c",spades:"s"},l=e=>e&&e.rank&&e.suit?`${n[e.rank]||e.rank}${r[e.suit]||e.suit}`:null,o=e=>"number"==typeof e?e:"string"==typeof e?parseFloat(e.replace("%","")):0,i=["2","3","4","5","6","7","8","9","T","J","Q","K","A"],s=["A","2","3","4","5","6","7","8","9","T","J","Q","K"],c=["s","h","d","c"],d={2:{singular:"Two",plural:"Deuces"},3:{singular:"Three",plural:"Treys"},4:{singular:"Four",plural:"Fours"},5:{singular:"Five",plural:"Fives"},6:{singular:"Six",plural:"Sixes"},7:{singular:"Seven",plural:"Sevens"},8:{singular:"Eight",plural:"Eights"},9:{singular:"Nine",plural:"Nines"},T:{singular:"Ten",plural:"Tens"},J:{singular:"Jack",plural:"Jacks"},Q:{singular:"Queen",plural:"Queens"},K:{singular:"King",plural:"Kings"},A:{singular:"Ace",plural:"Aces"}},u={s:{singular:"spade",plural:"spades"},h:{singular:"heart",plural:"hearts"},d:{singular:"diamond",plural:"diamonds"},c:{singular:"club",plural:"clubs"}};function m(e,t){var a=i.indexOf(e.rank);return i.indexOf(t.rank)-a}function h(e,t){var a=m(e,t);return a>0?-1:a<0?1:0}function y(e,t){var a=s.indexOf(e.rank),n=s.indexOf(t.rank)-a;return n>0?-1:n<0?1:0}class p{constructor(e,t){if(1===arguments.length)if("string"==typeof arguments[0])this.rank=arguments[0].substring(0,1),this.suit=arguments[0].substring(1,2);else if(Array.isArray(arguments[0]))this.rank=arguments[0][0],this.suit=arguments[0][1];else{var a=Object.assign({},e);this.rank=a.rank,this.suit=a.suit}else{if(2!==arguments.length)throw Error("invalid number of arguments");this.rank=e,this.suit=t}if(!i.includes(this.rank))throw Error("invalid rank");if(!c.includes(this.suit))throw Error("invalid suit")}static get RANKS(){return i}static get ACE_LOW_RANKS(){return s}static get SUITS(){return c}static get SUIT_SPADE(){return"s"}static get SUIT_HEART(){return"h"}static get SUIT_DIAMOND(){return"d"}static get SUIT_CLUB(){return"c"}static get RANK_TWO(){return"2"}static get RANK_THREE(){return"3"}static get RANK_FOUR(){return"4"}static get RANK_FIVE(){return"5"}static get RANK_SIX(){return"6"}static get RANK_SEVEN(){return"7"}static get RANK_EIGHT(){return"8"}static get RANK_NINE(){return"9"}static get RANK_TEN(){return"T"}static get RANK_JACK(){return"J"}static get RANK_QUEEN(){return"Q"}static get RANK_KING(){return"K"}static get RANK_ACE(){return"A"}static sortCards(e,t=!0){var a=[...e];return t?a.sort(h):a.sort(y),a}static compare(e,t){return h(e,t)}static compareAceLow(e,t){return y(e,t)}static greaterThan(e,t){return 1===h(e,t)}static lessThan(e,t){return-1===h(e,t)}static distance(e,t){return m(e,t)}static singularRankName(e){return d[e.rank].singular}static pluralRankName(e){return d[e.rank].plural}static singularSuitName(e){return u[e.suit].singular}static pluralSuitName(e){return u[e.suit].plural}static objectifyCards(e){return e.map((e=>new p(e)))}}const f="Royal Flush",g="Straight Flush",_="Four of a kind",S="Full House",v="flush",L="straight",b="three of a kind",w="two pair",C="pair",k="high card",q={type:f,validate:function(e,t,a,n){return!n&&e[0].rank===p.RANK_ACE&&t&&a},description:function(e){return f}},P={type:g,validate:function(e,t,a,n){return!n&&!(e[0].rank===p.RANK_ACE)&&t&&a},description:function(e){return"Straight Flush, "+p.singularRankName(e[0])+"-High"}},E={type:_,validate:function(e){return K(e,[4,1])},description:function(e){return"Four of a kind, "+p.pluralRankName(e[0])}},x={type:S,validate:function(e){return K(e,[3,2])},description:function(e){return"Full House "+p.pluralRankName(e[0])+" full of "+p.pluralRankName(e[3])}},A={type:v,validate:function(e,t,a,n){return!n&&!t&&a},description:function(e){return"Flush, "+p.singularRankName(e[0])+" High"}},H={type:L,validate:function(e,t,a,n){return!n&&t&&!a},description:function(e){return"Straight, "+p.singularRankName(e[0])+" High"}},T={type:b,validate:function(e){return K(e,[3,1,1])},description:function(e){return"Three of a kind, "+p.pluralRankName(e[0])}},R={type:w,validate:function(e){return K(e,[2,2,1])},description:function(e){return"Two pairs "+p.pluralRankName(e[0])+" and "+p.pluralRankName(e[2])}},I={type:C,validate:function(e){return K(e,[2,1,1,1])},description:function(e){return"Pair of "+p.pluralRankName(e[0])}},B={type:k,validate:function(e,t,a,n){var r=K(e,[1,1,1,1,1]);return n?r:r&&!t&&!a},description:function(e){return p.singularRankName(e[0])+"-High"}},N={[f]:q,[g]:P,[_]:E,[S]:x,[v]:A,[L]:H,[b]:T,[w]:R,[C]:I,[k]:B},O=[f,g,_,S,v,L,b,w,C,k];function F(e,t,a){a||(a=p.compare);var n=O.indexOf(e.ranking),r=O.indexOf(t.ranking)-n;if(r>0)return 1;if(r<0)return-1;for(var l=0;l<5;l++){var o=a(e.cards[l],t.cards[l]);if(0!==o)return e.kicker=e.cards[l],t.kicker=t.cards[l],o}return 0}function $(e,t){return F(e,t,p.compare)}function M(e,t){return F(e,t,p.compareAceLow)}function z(e,t){return void 0===t&&(t={onlyPairsCount:!1,aceHigh:!0}),function(e){var t=e[0].rank===p.RANK_ACE,a=e[1].rank===p.RANK_FIVE,n=e[2].rank===p.RANK_FOUR,r=e[3].rank===p.RANK_THREE,l=e[4].rank===p.RANK_TWO;return t&&a&&n&&r&&l}(e=p.sortCards(e,t.aceHigh).reverse())&&!t.onlyPairsCount&&(e=[e[1],e[2],e[3],e[4],e[0]]),e}function K(e,t){const a=[...new Set(e.map((e=>e.rank)))];var n=[];return a.forEach((function(t){var a=e.filter((e=>e.rank===t)).length;n.push(a)})),n.join(",")===t.join(",")}function D(e){return function(e){for(var t=1;t<e.length;t++){var a=e[t-1],n=e[t];if(-1!==p.distance(a,n))return!1}return!0}(e)||function(e){var t=e[0].rank===p.RANK_FIVE,a=e[1].rank===p.RANK_FOUR,n=e[2].rank===p.RANK_THREE,r=e[3].rank===p.RANK_TWO;return e[4].rank===p.RANK_ACE&&t&&a&&n&&r}(e)}function j(e){for(var t=e[0].suit,a=0;a<e.length;a++)if(e[a].suit!==t)return!1;return!0}class W{constructor(e,t,a){if(5!==e.length)throw Error("hand ranking is found using five cards");if(!N[t])throw Error("hand ranking not valid");a||(a={formed:!1}),this.cards=a.formed?e:z(p.objectifyCards(e),a),this.hasStraight=void 0===a.hasStraight?D(this.cards):a.hasStraight,this.hasFlush=void 0===a.hasFlush?j(this.cards):a.hasFlush,this.onlyPairsCount=void 0!==a.onlyPairsCount&&a.onlyPairsCount,this.aceHigh=void 0===a.aceHigh||a.aceHigh,this.ranking=t,this.cards=function(e){var t=[];for(let n=4;n>0;n--){var a=e.filter((function(t){var a=0;return e.forEach((function(e){e.rank===t.rank&&a++})),a===n}));t.push(a)}return t.flat()}(this.cards),this.isValid=function(){return N[this.ranking].validate(this.cards,this.hasStraight,this.hasFlush,this.onlyPairsCount)},this.description=N[this.ranking].description(this.cards)}static get ROYAL_FLUSH(){return f}static get STRAIGHT_FLUSH(){return g}static get FOUR_OF_A_KIND(){return _}static get FULL_HOUSE(){return S}static get FLUSH(){return v}static get STRAIGHT(){return L}static get THREE_OF_A_KIND(){return b}static get TWO_PAIR(){return w}static get PAIR(){return C}static get HIGH_CARD(){return k}static get HAND_RANKINGS(){return O}static compareHandRankings(e,t){return F(e,t)}
1static compareAceHighHandRankings(e,t){return $(e,t)}static compareAceLowHandRankings(e,t){return M(e,t)}static containsStraight(e){return D(e)}static containsFlush(e){return j(e)}static formCards(e,t){return z(e,t)}static eightOrBetter(e){return a=K((t=e).cards,[1,1,1,1,1]),n=t.cards[0],r=new p(p.RANK_EIGHT,p.SUIT_CLUB),1!==p.compareAceLow(n,r)&&a;var t,a,n,r}static sortHandRankings(e,t=!0){return[...e].sort(t?$:M)}}const U=function e(t,a){var n,r,l,o,i;if(a>t.length||a<=0)return[];if(a===t.length)return[t];if(1===a){for(l=[],n=0;n<t.length;n++)l.push([t[n]]);return l}for(l=[],n=0;n<t.length-a+1;n++)for(o=t.slice(n,n+1),i=e(t.slice(n+1),a-1),r=0;r<i.length;r++)l.push(o.concat(i[r]));return l},J="high",G="low",Y="hi/lo",V={winType:J,aceHigh:!0,onlyPairsCount:!1,omaha:!1,eightOrBetter:!1},Q={winType:J,aceHigh:!0,onlyPairsCount:!1,omaha:!0,eightOrBetter:!1},X={winType:G,aceHigh:!1,onlyPairsCount:!0,omaha:!0,eightOrBetter:!0},Z={winType:G,aceHigh:!1,onlyPairsCount:!0,omaha:!1,eightOrBetter:!0},ee={winType:G,aceHigh:!0,onlyPairsCount:!1,omaha:!1,eightOrBetter:!1},te={winType:G,aceHigh:!1,onlyPairsCount:!0,omaha:!1,eightOrBetter:!1},ae={"Texas Holdem":V,"Omaha Hi":Q,"Omaha Hi/Lo":{winType:Y,aceHigh:!0,onlyPairsCount:!1,omaha:!0,eightOrBetter:!0},Stud:V,"Stud Hi/Lo":{winType:Y,aceHigh:!0,onlyPairsCount:!1,omaha:!1,eightOrBetter:!0},Razz:te,"Kansas City Lowball":ee,"California Lowball":te,"Deuce to Seven":ee,"Deuce to Six":{winType:G,aceHigh:!0,onlyPairsCount:!0,omaha:!1,eightOrBetter:!1},"Ace to Six":{winType:G,aceHigh:!1,onlyPairsCount:!1,omaha:!1,eightOrBetter:!1}};function ne(e,t,a){return function(e,t){var a=t.winType===J;if(e.sort((function(e,n){var r=(t.aceHigh?W.compareAceHighHandRankings:W.compareAceLowHandRankings)(e.handRanking,n.handRanking);return a?r:-1*r})),t.eightOrBetter&&0===(e=e.filter((function(e){return W.eightOrBetter(e.handRanking)}))).length)return!1;for(var n=0,r=0,l=[[re(e[0])]],o=1;o<e.length;o++){var i=e[o],s=e[o-1],c=(t.aceHigh?W.compareAceHighHandRankings:W.compareAceLowHandRankings)(i.handRanking,s.handRanking),d=re(i);if(i.handRanking.description===s.handRanking.description){let e,t,a,o=!1;i.handRanking.kicker&&(e=i.handRanking.kicker.rank,t=i.handRanking.kicker.suit),s.handRanking.kicker&&(a=s.handRanking.kicker.rank,o=s.handRanking.kicker.suit),i.handRanking.cards.filter((a=>e&&a.rank===e&&a.suit===t)).length>0&&(d.highKicker=i.handRanking.kicker),s.handRanking.cards.filter((e=>a&&e.rank===a&&e.suit===o)).length>0&&(l[n][r].highKicker=s.handRanking.kicker)}0===c?(l[l.length-1].push(d),r+=1):(l.push([d]),n+=1,r=0)}return l.reverse()}(e.map((function(e){return{id:e.id,cards:e.cards,board:t,handRanking:le(e.cards,t,a)}})),a)}function re(e){return{id:e.id,ranking:e.handRanking.ranking,cards:e.cards,board:e.board,playingCards:e.handRanking.cards,description:e.handRanking.description,highKicker:!1}}function le(e,t,a){if(!a.omaha)return oe(e.concat(t),a);var n=function(e,t){var a=U(e,2),n=U(t,3),r=[];return a.forEach((function(e){n.forEach((function(t){r.push(e.concat(t))}))})),r}(e,t).map((function(e){return oe(e,a)})),r=W.sortHandRankings(n,a.aceHigh);return a.winType===J?r[r.length-1]:a.winType===G?r[0]:void 0}function oe(e,t){var a=U(e,5).map((function(e){return function(e,t){for(var a=W.HAND_RANKINGS,n=W.formCards(e,t),r=W.containsStraight(n),l=W.containsFlush(n),o=a.length-1;o>=0;o--){var i=a[o],s={hasStraight:r,hasFlush:l,formed:!0,onlyPairsCount:t.onlyPairsCount,aceHigh:t.aceHigh},c=new W(n,i,s);if(c.isValid())return c}throw Error("no hand ranking was found")}(e,t)})),n=W.sortHandRankings(a,t.aceHigh);return t.winType===J?n[n.length-1]:t.winType===G?n[0]:void 0}const ie={holdem:"Texas Holdem","holdem-h/l":"Texas Holdem Hi/Lo",omaha:"Omaha Hi","omaha-h/l":"Omaha Hi/Lo","7-stud":"Stud","7-stud-h/l":"Stud Hi/Lo",razz:"Razz"};function se(e){if(!e||!e.rank||!e.suit)return null;const t={ace:"A",king:"K",queen:"Q",jack:"J",10:"T",9:"9",8:"8",7:"7",6:"6",5:"5",4:"4",3:"3",2:"2"}[e.rank],a={spades:"s",hearts:"h",diamonds:"d",clubs:"c"}[e.suit];return t&&a?t+a:null}const ce=new class{constructor(){this.apiUrl="https://pokerlistings.info/wp-json/pokerlistings/v1/poker/",this.localApiUrl="http://127.0.0.1:8000/api/calculate"}canCalculate(a,n,r,l){if(t.includes(a))return{canCalculate:!0,useLocalApi:!0,reason:`Game type '${a}' will use local Python API`};if(!e[a])return{canCalculate:!1,reason:"Game type not supported by API"};const o=n.filter((e=>e.active));if(o.length<2)return{canCalculate:!1,reason:"Not enough active players (minimum 2)"};if(["holdem","holdem-h/l","omaha","omaha-h/l"].includes(a)){if(!o.every((e=>e.hand.every((e=>null!==e)))))return{canCalculate:!1,reason:"Not all players have full hands"};if(r&&5===r.length){const e=r.slice(0,3),t=r[3],a=r[4],n=e.filter((e=>null!==e)).length;if(0===n)return{canCalculate:!0};if(n>0&&n<3)return{canCalculate:!1,reason:"Incomplete flop (need 0 or 3 cards)"};if(null===t&&null!==a)return{canCalculate:!1,reason:"Turn is missing but river is present"}}
1return{canCalculate:!0}}return 7===(l?l.handSize:7)?o.every((e=>e.hand.filter((e=>null!==e)).length>=3))?{canCalculate:!0}:{canCalculate:!1,reason:"Players need at least 3 cards for 7-card games"}:o.every((e=>e.hand.every((e=>null!==e))))?{canCalculate:!0}:{canCalculate:!1,reason:"Not all players have full hands"}}async calculateOdds({gameType:t,players:a,communityCards:n,gameConfig:r}){const o=this.canCalculate(t,a,n,r);if(!o.canCalculate)throw new Error(`API calculation not possible: ${o.reason}`);if(o.useLocalApi)return await this.calculateOddsLocalApi({gameType:t,players:a,communityCards:n,gameConfig:r});const i=e[t],s={};let c=1;if(a.forEach((e=>{if(e.active&&e.hand.some((e=>null!==e))){const t=e.hand.filter((e=>null!==e)).map(l).filter((e=>null!==e)).join(",");t&&(s[`player_${c}`]=t,c++)}})),n&&n.length>0){const e=n.filter((e=>null!==e)).map(l).filter((e=>null!==e)).join(",");e&&(s.board_cards=e)}const d=new URLSearchParams(s).toString(),u=`${this.apiUrl}?game=${i}&action=odds&${d}`;try{const e=await fetch(u);if(!e.ok)throw new Error(`API request failed with status ${e.status}`);const t=await e.json();if(!t||!t.results||!t.results.players)throw new Error("Invalid API response format");return this.transformApiResponse(t,a)}catch(e){throw new Error(`API calculation failed: ${e.message}`)}}async calculateOddsLocalApi({gameType:e,players:t,communityCards:n,gameConfig:r}){const o=a[e];if(!o)throw new Error(`Game type '${e}' not mapped for local API`);const i=[];t.forEach((e=>{if(e.active&&e.hand.some((e=>null!==e))){const t=e.hand.filter((e=>null!==e)).map(l).filter((e=>null!==e)).join("");t&&i.push(t)}}));let s=null,c=0;if(n&&n.length>0){const e=n.filter((e=>null!==e)).map(l).filter((e=>null!==e));e.length>0&&(s=e.join(" "),c=e.length)}r&&r.isHiLo,o.includes("6-omaha");let d=5e4;5===c&&(d=1);const u={game_type:o,hands:i,board:s,iterations:d};try{const e=await fetch(this.localApiUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)});if(!e.ok)throw new Error(`Local API request failed with status ${e.status}`);const a=await e.json();if(!a||!a.success||!a.results)throw new Error("Invalid local API response format");return this.transformLocalApiResponse(a,t,r)}catch(e){throw new Error(`Local API calculation failed: ${e.message}`)}}transformLocalApiResponse(e,t,a){const n=[],r=e.results,l=a&&a.isHiLo;return t.forEach(((e,t)=>{if(!e.active)return;const a=r[t];a?l?n.push({playerId:e.id,winHiPercent:a["Win Hi"]||0,tieHiPercent:a["Tie Hi"]||0,winLoPercent:a["Win Lo"]||0,tieLoPercent:a["Tie Lo"]||0}):n.push({playerId:e.id,winPercent:a["Win Hi"]||0,tiePercent:a["Tie Hi"]||0}):l?n.push({playerId:e.id,winHiPercent:0,tieHiPercent:0,winLoPercent:0,tieLoPercent:0}):n.push({playerId:e.id,winPercent:0,tiePercent:0})})),n}transformApiResponse(e,t){const a=[],n=e.results.players;let r=0;return t.forEach((e=>{if(!e.active)return;const t=n[r];if(!t||!t.results)return a.push({playerId:e.id,winPercent:0,tiePercent:0}),void r++;const l=t.results;void 0!==l.winLo?a.push({playerId:e.id,winHiPercent:o(l.win||0),tieHiPercent:o(l.tie||0),winLoPercent:o(l.winLo||0),tieLoPercent:o(l.tieLo||0)}):a.push({playerId:e.id,winPercent:o(l.win||0),tiePercent:o(l.tie||0)}),r++})),a}},de=new class{canCalculate(e,t,a,n){if(!ie[e])return{canCalculate:!1,reason:`Game type '${e}' not supported by WHW calculator`};const r=t.filter((e=>e.active));if(r.length<2)return{canCalculate:!1,reason:"Not enough active players (minimum 2)"};if(!r.every((e=>e.hand.every((e=>null!==e)))))return{canCalculate:!1,reason:"Not all players have full hands"};if(n&&n.hasCommunityCards){if(!a||5!==a.length)return{canCalculate:!1,reason:"Invalid community cards array"};if(!a.every((e=>null!==e)))return{canCalculate:!1,reason:"WHW requires all 5 community cards to be filled"}}return{canCalculate:!0}}calculateWinner({gameType:e,players:t,communityCards:a}){const n=ie[e];if(!n)throw new Error(`Game type '${e}' not supported by WHW calculator`);const r=[],l={};t.forEach(((e,t)=>{if(e.active&&e.hand.some((e=>null!==e))){const a=e.hand.filter((e=>null!==e)).map(se).filter((e=>null!==e));a.length>0&&(r.push({id:t,cards:a}),l[t]=e.id)}}));const o=a?a.filter((e=>null!==e)).map(se).filter((e=>null!==e)):[],i=function(e,t,a){try{const n=function(e,t,a){var n=[],r=V;if(Array.isArray(t)?(n=t,"string"==typeof a&&(r=ae[a])):"string"==typeof t&&(r=ae[t]),!r)throw Error("Unsupported Game Type");if(e=e.map((function(e){return{id:e.id,cards:p.objectifyCards(e.cards)}})),n=p.objectifyCards(n),r.winType===Y){var l=r.omaha?{high:Q,low:X}:{high:V,low:Z};return{high:ne(e,n,l.high),low:ne(e,n,l.low)}}return ne(e,n,r)}(e,t,a);return n.high&&void 0!==n.low?{highWinners:n.high[0]?n.high[0].map((e=>e.id)):[],lowWinners:!1!==n.low&&n.low&&n.low[0]?n.low[0].map((e=>e.id)):[]}:{winners:n[0]?n[0].map((e=>e.id)):[e[0].id]}}catch(t){return console.error("Error in getWinnersFast:",t),{winners:[e[0].id]}}}(r,o,n);return this.transformWHWResult(i,t,l)}transformWHWResult(e,t,a){const n=[];if(void 0!==e.highWinners&&void 0!==e.lowWinners){const r=e.highWinners||[],l=e.lowWinners||[],o=r.map((e=>a[e])),i=l.map((e=>a[e]));t.forEach((e=>{if(!e.active)return;const t=o.includes(e.id),a=t&&o.length>1,r=i.includes(e.id),l=r&&i.length>1;
1n.push({playerId:e.id,winHiPercent:t&&!a?100:0,tieHiPercent:a?100:0,winLoPercent:r&&!l?100:0,tieLoPercent:l?100:0})}))}else{const r=(e.winners||[]).map((e=>a[e]));t.forEach((e=>{if(!e.active)return;const t=r.includes(e.id),a=t&&r.length>1;n.push({playerId:e.id,winPercent:t&&!a?100:0,tiePercent:a?100:0})}))}return n}};let ue=null,me=!1;const he={player:"Player",win:"Win",tie:"Tie",winHi:"Win Hi",tieHi:"Tie Hi",winLo:"Win Lo",tieLo:"Tie Lo",board:"Board"};let ye={...he};const pe=(e,t={})=>{let a=ye[e]||he[e]||e;return Object.keys(t).forEach((e=>{a=a.replace(`{${e}}`,t[e])})),a},fe={holdem:{handSize:2,hasCommunityCards:!0,minRank:"2",maxPlayers:7,isHiLo:!1},omaha:{handSize:4,hasCommunityCards:!0,minRank:"2",maxPlayers:7,isHiLo:!1},"6-holdem":{handSize:2,hasCommunityCards:!0,minRank:"6",maxPlayers:6,isHiLo:!1},"6-omaha":{handSize:6,hasCommunityCards:!0,minRank:"2",maxPlayers:6,isHiLo:!1},"5-omaha":{handSize:5,hasCommunityCards:!0,minRank:"2",maxPlayers:7,isHiLo:!1},"omaha-h/l":{handSize:4,hasCommunityCards:!0,minRank:"2",maxPlayers:7,isHiLo:!0},"5-omaha-h/l":{handSize:5,hasCommunityCards:!0,minRank:"2",maxPlayers:7,isHiLo:!0},"6-omaha-h/l":{handSize:6,hasCommunityCards:!0,minRank:"2",maxPlayers:6,isHiLo:!0},"7-stud":{handSize:7,hasCommunityCards:!1,minRank:"2",maxPlayers:7,isHiLo:!1},"7-stud-h/l":{handSize:7,hasCommunityCards:!1,minRank:"2",maxPlayers:7,isHiLo:!0},razz:{handSize:7,hasCommunityCards:!1,minRank:"2",maxPlayers:7,isHiLo:!1}},ge={gameType:"holdem",communityCards:[null,null,null,null,null],players:[{id:1,active:!0,hand:[null,null],winPercent:0,tiePercent:0},{id:2,active:!0,hand:[null,null],winPercent:0,tiePercent:0},{id:3,active:!1,hand:[null,null],winPercent:0,tiePercent:0},{id:4,active:!1,hand:[null,null],winPercent:0,tiePercent:0},{id:5,active:!1,hand:[null,null],winPercent:0,tiePercent:0},{id:6,active:!1,hand:[null,null],winPercent:0,tiePercent:0},{id:7,active:!1,hand:[null,null],winPercent:0,tiePercent:0},{id:8,active:!1,hand:[null,null],winPercent:0,tiePercent:0},{id:9,active:!1,hand:[null,null],winPercent:0,tiePercent:0},{id:10,active:!1,hand:[null,null],winPercent:0,tiePercent:0}],disabledCards:new Set,modalState:{isOpen:!1,currentPlayer:null,activeSlotIndex:0,isBoard:!1,tempCommunityCards:null,tempPlayerHand:null,wasInitiallyEmpty:!1}},_e={tabs:null,calculatorContent:null,boardSlots:null,playerItems:null,modal:null,modalTitle:null,modalPlayerSlots:null,modalBoardSlots:null,modalCards:null,modalDoneBtn:null,modalResetBtn:null,modalCloseBtn:null,addPlayerBtns:null,resetCardsBtn:null,boardResetBtn:null,modalPlayerCards:null,modalBoard:null,mobileAddPlayerBtn:null,init(){this.tabs=document.querySelectorAll(".calculator__tabs li"),this.calculatorContent=document.querySelector(".calculator-content"),this.boardSlots=document.querySelectorAll(".calculator__table-body .calculator__board .calculator__card-slot"),this.playerItems=document.querySelectorAll(".calculator__players-item"),this.modal=document.querySelector(".calculator__modal"),this.modalTitle=document.querySelector(".calculator__modal-title"),this.modalPlayerSlots=document.querySelectorAll(".calculator__modal-cards .calculator__player-cards .calculator__card-slot"),this.modalBoardSlots=document.querySelectorAll(".calculator__modal-cards .calculator__board .calculator__card-slot"),this.modalCards=document.querySelectorAll(".calculator__cards .calculator__card"),this.modalDoneBtn=document.querySelector(".calculator__modal-done"),this.modalResetBtn=document.querySelector(".calculator__modal-reset"),this.modalCloseBtn=document.querySelector(".calculator__modal-close"),this.addPlayerBtns=document.querySelectorAll(".calculator__player-add"),this.resetCardsBtn=document.querySelector(".calculator__controls-btn-reset"),this.boardResetBtn=document.querySelector(".calculator__board-reset"),this.modalPlayerCards=document.querySelector(".calculator__modal-cards .calculator__player-cards"),this.modalBoard=document.querySelector(".calculator__modal-cards .calculator__board"),this.mobileAddPlayerBtn=document.querySelector(".calculator__controls .calculator__player-add")}},Se=(e,t)=>`${e}-${t}`,ve=()=>window.innerWidth<1024,Le=e=>{ve()&&e&&requestAnimationFrame((()=>{const t=e.getBoundingClientRect(),a=t.top+window.pageYOffset,n=t.height,r=a-window.innerHeight/2+n/2;window.scrollTo({top:r,behavior:"smooth"})}))},be=(e,t)=>
1{if(!e)return;const a=e.querySelector(".calculator__player-chances-item");if(a)if(e.innerHTML="",t){const t=a.cloneNode(!0);t.querySelector(".calculator__player-chances-item-value").textContent="0%",t.querySelector(".calculator__player-chances-item-name").textContent=pe("winHi"),e.appendChild(t);const n=a.cloneNode(!0);n.querySelector(".calculator__player-chances-item-value").textContent="0%",n.querySelector(".calculator__player-chances-item-name").textContent=pe("tieHi"),e.appendChild(n);const r=a.cloneNode(!0);r.querySelector(".calculator__player-chances-item-value").textContent="0%",r.querySelector(".calculator__player-chances-item-name").textContent=pe("winLo"),e.appendChild(r);const l=a.cloneNode(!0);l.querySelector(".calculator__player-chances-item-value").textContent="0%",l.querySelector(".calculator__player-chances-item-name").textContent=pe("tieLo"),e.appendChild(l)}else{const t=a.cloneNode(!0);t.querySelector(".calculator__player-chances-item-value").textContent="0%",t.querySelector(".calculator__player-chances-item-name").textContent=pe("win"),e.appendChild(t);const n=a.cloneNode(!0);n.querySelector(".calculator__player-chances-item-value").textContent="0%",n.querySelector(".calculator__player-chances-item-name").textContent=pe("tie"),e.appendChild(n)}},we=e=>{const t=fe[e];if(!t)return;ge.gameType=e,_e.calculatorContent&&(_e.calculatorContent.dataset.gameType=e),ge.communityCards=[null,null,null,null,null],ge.players.forEach(((e,a)=>{e.hand=new Array(t.handSize).fill(null),t.isHiLo?(e.winHiPercent=0,e.winLoPercent=0,e.tieHiPercent=0,e.tieLoPercent=0):(e.winPercent=0,e.tiePercent=0),a>=t.maxPlayers&&(e.active=!1)})),ge.disabledCards.clear(),ge.modalState.isOpen=!1,ge.modalState.currentPlayer=null,ge.modalState.activeSlotIndex=0,ge.modalState.isBoard=!1,ge.modalState.tempCommunityCards=null,ge.modalState.tempPlayerHand=null;const a=[];"6"===t.minRank&&a.push("2","3","4","5"),_e.modalCards&&_e.modalCards.forEach((e=>{const t=e.dataset.rank;a.includes(t)?e.style.display="none":e.style.display=""}));const n=document.querySelector(".calculator__table-body .calculator__board");n&&(t.hasCommunityCards?n.style.display="":n.style.display="none"),_e.playerItems.forEach(((e,a)=>{const n=a+1,r=ge.players[n-1];if(n>t.maxPlayers)return e.style.display="none",void(r.active=!1);e.style.display="";const l=e.querySelector(".calculator__player");if(n<=2){r.active=!0,e.classList.add("is-added");const a=e.querySelector(".calculator__player-add");a&&a.classList.add("is-hidden");const n=l?.querySelector(".calculator__player-cards");if(n){const e=n.querySelectorAll(".calculator__card-slot"),a=t.handSize;if(e.length!==a){const e=n.querySelector(".calculator__card-slot");if(e){n.innerHTML="";for(let t=0;t<a;t++){const t=e.cloneNode(!0);n.appendChild(t)}}}}const o=l?.querySelector(".calculator__player-chances");o&&be(o,t.isHiLo)}else{r.active=!1,e.classList.remove("is-added");const t=e.querySelector(".calculator__player-add");t&&t.classList.remove("is-hidden"),l&&l.remove()}}));const r=_e.modalPlayerCards;if(r){const e=r.querySelectorAll(".calculator__card-slot"),a=t.handSize;if(e.length!==a){const e=r.querySelector(".calculator__card-slot");if(e){r.innerHTML="";for(let t=0;t<a;t++){const t=e.cloneNode(!0);r.appendChild(t)}}}}_e.modalPlayerSlots=_e.modalPlayerCards?.querySelectorAll(".calculator__card-slot")||[],_e.modalBoardSlots=_e.modalBoard?.querySelectorAll(".calculator__card-slot")||[],_e.playerItems.forEach(((e,t)=>{const a=t+1,n=ge.players[a-1];n&&n.active&&Me(e,a)})),_e.modalPlayerSlots.forEach(((e,t)=>{const a=e.cloneNode(!0);e.parentNode.replaceChild(a,e),a.addEventListener("click",(()=>{if(ge.modalState.isOpen&&!ge.modalState.isBoard){const e=ge.modalState.tempPlayerHand;e&&null!==e[t]&&(e[t]=null,He())}}))})),_e.modalPlayerSlots=_e.modalPlayerCards?.querySelectorAll(".calculator__card-slot")||[],He(),ve()||setTimeout((()=>{ze(1)}),100)},Ce=(e,t)=>{if(!e)return;const a=e.querySelector(".calculator__card"),n=null!==a,r=null!==t;let l=!1;if(!n&&r||n&&!r?l=!0:n&&r&&t&&(l=a.dataset.rank!==t.rank||a.dataset.suit!==t.suit),l)if(t){e.innerHTML="";const a=(e=>{const t=document.querySelector(".calculator__cards .calculator__card");if(!t)return null;const a=t.cloneNode(!0);return a.dataset.rank=e.rank,a.dataset.suit=e.suit,a.textContent=e.display,a.style.display="",a.classList.remove("is-disabled"),a})(t);
1a&&e.appendChild(a),e.classList.add("is-selected")}else e.innerHTML="",e.classList.remove("is-selected")},ke=()=>{ve()&&ge.modalState.isOpen||me||(ue&&clearTimeout(ue),ue=setTimeout((()=>{qe()}),2e3))},qe=()=>{const e=ge.players.filter((e=>e.active)),t=fe[ge.gameType],a=t&&t.isHiLo;return e.length<2?(ge.players.forEach((e=>{a?(e.winHiPercent=0,e.winLoPercent=0,e.tieHiPercent=0,e.tieLoPercent=0):(e.winPercent=0,e.tiePercent=0)})),void Ae()):(()=>{const e=ge.players.filter((e=>e.active)),t=fe[ge.gameType];if(e.length<2)return!1;if(t&&t.hasCommunityCards){if(!e.every((e=>e.hand.every((e=>null!==e)))))return!1;const[t,a,n,r,l]=ge.communityCards;if(null===t&&null===a&&null===n&&null===r&&null===l)return!0;const o=null!==t&&null!==a&&null!==n;return!(!o||o&&null===r&&null!==l)}return 7===(t?t.handSize:2)?e.every((e=>e.hand.filter((e=>null!==e)).length>=3)):e.every((e=>e.hand.every((e=>null!==e))))})()?(me=!0,xe(),void setTimeout((async()=>{try{const e=fe[ge.gameType];let t;const a=de.canCalculate(ge.gameType,ge.players,ge.communityCards,e);t=a.canCalculate?de.calculateWinner({gameType:ge.gameType,players:ge.players,communityCards:ge.communityCards}):await ce.calculateOdds({gameType:ge.gameType,players:ge.players,communityCards:ge.communityCards,gameConfig:e});const n=e&&e.isHiLo;ge.players.forEach((e=>{const a=t.find((t=>t.playerId===e.id));a?n&&void 0!==a.winHiPercent?(e.winHiPercent=a.winHiPercent,e.winLoPercent=a.winLoPercent,e.tieHiPercent=a.tieHiPercent||0,e.tieLoPercent=a.tieLoPercent||0):(e.winPercent=a.winPercent,e.tiePercent=a.tiePercent):n?(e.winHiPercent=0,e.winLoPercent=0,e.tieHiPercent=0,e.tieLoPercent=0):(e.winPercent=0,e.tiePercent=0)}))}catch(e){console.error("Calculation error:",e.message);const t=fe[ge.gameType],a=t&&t.isHiLo;ge.players.forEach((e=>{a?(e.winHiPercent=0,e.winLoPercent=0,e.tieHiPercent=0,e.tieLoPercent=0):(e.winPercent=0,e.tiePercent=0)}))}finally{me=!1,Ae()}}),0)):(ge.players.forEach((e=>{a?(e.winHiPercent=0,e.winLoPercent=0,e.tieHiPercent=0,e.tieLoPercent=0):(e.winPercent=0,e.tiePercent=0)})),void Ae())};let Pe=0,Ee=null;const xe=()=>{Ee&&clearInterval(Ee),Pe=0;const e=["â³","â²"],t=fe[ge.gameType],a=t&&t.isHiLo,n=()=>{Pe=(Pe+1)%e.length,_e.playerItems.forEach(((t,n)=>{const r=ge.players[n];if(!r||!r.active)return;const l=t.querySelector(".calculator__player");if(!l)return;l.classList.add("is-calculating");const o=t.querySelectorAll(".calculator__player-chances-item-value");a?(o[0]&&(o[0].textContent=e[Pe]),o[1]&&(o[1].textContent=e[Pe]),o[2]&&(o[2].textContent=e[Pe]),o[3]&&(o[3].textContent=e[Pe])):(o[0]&&(o[0].textContent=e[Pe]),o[1]&&(o[1].textContent=e[Pe]))}))};n(),Ee=setInterval(n,300)},Ae=()=>{Ee&&(clearInterval(Ee),Ee=null),_e.playerItems.forEach(((e,t)=>{const a=ge.players[t];if(!a||!a.active)return;const n=e.querySelector(".calculator__player");n&&n.classList.remove("is-calculating")}));const e=fe[ge.gameType],t=e&&e.isHiLo;_e.playerItems.forEach(((e,a)=>{const n=ge.players[a];if(!n||!n.active)return;const r=e.querySelector(".calculator__player"),l=e.querySelectorAll(".calculator__player-chances-item"),o=e.querySelectorAll(".calculator__player-chances-item-value");if(r&&r.classList.remove("is-winner","is-splited"),l.forEach((e=>{e.classList.remove("is-highlighted")})),t){const e=n.winHiPercent||0,t=n.tieHiPercent||0,a=n.winLoPercent||0,i=n.tieLoPercent||0;o[0]&&(o[0].textContent=`${e}%`),o[1]&&(o[1].textContent=`${t}%`),o[2]&&(o[2].textContent=`${a}%`),o[3]&&(o[3].textContent=`${i}%`),(100===e||100===t||100===a||100===i)&&r&&r.classList.add("is-winner"),100===e&&l[0]&&l[0].classList.add("is-highlighted"),100===t&&l[1]&&l[1].classList.add("is-highlighted"),100===a&&l[2]&&l[2].classList.add("is-highlighted"),100===i&&l[3]&&l[3].classList.add("is-highlighted")}else{const e=n.winPercent||0,t=n.tiePercent||0;o[0]&&(o[0].textContent=`${e}%`),o[1]&&(o[1].textContent=`${t}%`),(100===e||100===t)&&r&&r.classList.add("is-winner"),100===e&&l[0]&&l[0].classList.add("is-highlighted"),100===t&&l[1]&&l[1].classList.add("is-highlighted")}}));const a=ge.players.filter((e=>e&&e.active));if(t){const e=a.filter((e=>100===(e.tieHiPercent||0))).length===a.length&&a.length>1,t=a.filter((e=>100===(e.tieLoPercent||0))).length===a.length&&a.length>1;(e||t)&&a.forEach((e=>{const t=ge.players.indexOf(e),a=_e.playerItems[t];if(a){const e=a.querySelector(".calculator__player");e&&(e.classList.remove("is-winner"),e.classList.add("is-splited"))}}));let n=0,r=null;
1if(a.forEach((e=>{const t=e.winHiPercent||0;t>n&&t>0&&(n=t,r=e)})),r&&n<100){const e=ge.players.indexOf(r),t=_e.playerItems[e];if(t){const e=t.querySelectorAll(".calculator__player-chances-item");e[0]&&e[0].classList.add("is-highlighted")}}let l=0,o=null;if(a.forEach((e=>{const t=e.winLoPercent||0;t>l&&t>0&&(l=t,o=e)})),o&&l<100){const e=ge.players.indexOf(o),t=_e.playerItems[e];if(t){const e=t.querySelectorAll(".calculator__player-chances-item");e[2]&&e[2].classList.add("is-highlighted")}}}else{a.filter((e=>100===(e.tiePercent||0))).length===a.length&&a.length>1&&a.forEach((e=>{const t=ge.players.indexOf(e),a=_e.playerItems[t];if(a){const e=a.querySelector(".calculator__player");e&&(e.classList.remove("is-winner"),e.classList.add("is-splited"))}}));let e=0,t=null;if(a.forEach((a=>{const n=a.winPercent||0;n>e&&n>0&&(e=n,t=a)})),t&&e<100){const e=ge.players.indexOf(t),a=_e.playerItems[e];if(a){const e=a.querySelectorAll(".calculator__player-chances-item");e[0]&&e[0].classList.add("is-highlighted")}}}},He=()=>{ge.disabledCards.clear(),ge.modalState.isOpen?(ge.modalState.isBoard&&ge.modalState.tempCommunityCards?ge.modalState.tempCommunityCards.forEach((e=>{e&&ge.disabledCards.add(Se(e.rank,e.suit))})):ge.modalState.tempPlayerHand&&ge.modalState.tempPlayerHand.forEach((e=>{e&&ge.disabledCards.add(Se(e.rank,e.suit))})),ge.communityCards.forEach((e=>{e&&ge.disabledCards.add(Se(e.rank,e.suit))})),ge.players.forEach((e=>{e.active&&ge.modalState.currentPlayer!==e.id&&e.hand.forEach((e=>{e&&ge.disabledCards.add(Se(e.rank,e.suit))}))}))):(ge.communityCards.forEach((e=>{e&&ge.disabledCards.add(Se(e.rank,e.suit))})),ge.players.forEach((e=>{e.active&&e.hand.forEach((e=>{e&&ge.disabledCards.add(Se(e.rank,e.suit))}))}))),_e.modalCards.forEach((e=>{const t=e.dataset.rank,a=e.dataset.suit,n=Se(t,a);ge.disabledCards.has(n)?e.classList.add("is-disabled"):e.classList.remove("is-disabled")})),_e.boardSlots.forEach(((e,t)=>{const a=ge.communityCards[t];Ce(e,a),ge.modalState.isOpen&&ge.modalState.isBoard&&ge.modalState.activeSlotIndex===t?e.classList.add("is-active"):e.classList.remove("is-active")})),_e.playerItems.forEach(((e,t)=>{const a=ge.players[t];if(!a)return;const n=e.querySelector(".calculator__player-cards");if(!n)return;n.querySelectorAll(".calculator__card-slot").forEach(((e,t)=>{const n=a.hand[t];Ce(e,n),ge.modalState.isOpen&&!ge.modalState.isBoard&&ge.modalState.currentPlayer===a.id&&ge.modalState.activeSlotIndex===t?e.classList.add("is-active"):e.classList.remove("is-active")}));const r=e.querySelector(".calculator__player-reset"),l=e.querySelector(".calculator__player-close");r&&l&&(a.hand.some((e=>null!==e))&&a.active?r.classList.remove("is-hidden"):r.classList.add("is-hidden"),a.id>=3&&a.active?l.classList.remove("is-hidden"):l.classList.add("is-hidden"))})),(()=>{if(ge.modalState.isOpen)if(ge.modalState.isBoard){const e=ge.modalState.tempCommunityCards;if(_e.modalBoardSlots.forEach(((t,a)=>{t.classList.remove("is-active");const n=e[a];Ce(t,n)})),null!==ge.modalState.activeSlotIndex){const e=_e.modalBoardSlots[ge.modalState.activeSlotIndex];e&&e.classList.add("is-active")}}else{const e=ge.modalState.tempPlayerHand;if(!e)return;if(_e.modalPlayerSlots.forEach(((t,a)=>{t.classList.remove("is-active");const n=e[a];Ce(t,n)})),null!==ge.modalState.activeSlotIndex){const e=_e.modalPlayerSlots[ge.modalState.activeSlotIndex];e&&e.classList.add("is-active")}}})(),(()=>{if(ge.communityCards.some((e=>null!==e))||ge.players.some((e=>e.active&&e.hand.some((e=>null!==e))))?_e.resetCardsBtn&&_e.resetCardsBtn.classList.remove("is-disabled"):_e.resetCardsBtn&&_e.resetCardsBtn.classList.add("is-disabled"),ge.communityCards.some((e=>null!==e))?_e.boardResetBtn&&(_e.boardResetBtn.style.display="flex"):_e.boardResetBtn&&(_e.boardResetBtn.style.display="none"),ge.modalState.isOpen){(ge.modalState.isBoard?ge.modalState.tempCommunityCards?.some((e=>null!==e)):ge.modalState.tempPlayerHand?.some((e=>null!==e)))?_e.modalResetBtn&&_e.modalResetBtn.classList.remove("is-disabled"):_e.modalResetBtn&&_e.modalResetBtn.classList.add("is-disabled");let e=!1;if(ge.modalState.isBoard)if(ve()){const t=ge.modalState.tempCommunityCards?.slice(0,3).every((e=>null!==e));e=t}else e=ge.modalState.tempCommunityCards?.every((e=>null!==e));else e=ge.modalState.tempPlayerHand?.every((e=>null!==e));if(e?_e.modalDoneBtn&&_e.modalDoneBtn.classList.remove("is-disabled"):_e.modalDoneBtn&&_e.modalDoneBtn.classList.add("is-disabled"),ve()&&_e.modalDoneBtn){ge.gameType;const e="7-stud"===ge.gameType||"7-stud-h/l"===ge.gameType||"razz"===ge.gameType,t=ge.modalState.isBoard||e&&!ge.modalState.isBoard;ge.modalState.wasInitiallyEmpty&&!t?_e.modalDoneBtn.classList.add("is-hidden"):_e.modalDoneBtn.classList.remove("is-hidden")}}})(),(()=>{if(!_e.mobileAddPlayerBtn)return;const e=fe[ge.gameType];e&&(ge.players.filter((e=>e.active)).length>=e.maxPlayers?_e.mobileAddPlayerBtn.classList.add("is-disabled"):_e.mobileAddPlayerBtn.classList.remove("is-disabled"))})(),Ae()},Te=(e=null,t=!1,a=0)=>
1{if(ge.modalState.isOpen=!0,ge.modalState.currentPlayer=e,ge.modalState.isBoard=t,ge.modalState.activeSlotIndex=a,t)ge.modalState.tempCommunityCards=[...ge.communityCards],ge.modalState.wasInitiallyEmpty=ve()&&ge.communityCards.every((e=>null===e)),ve()&&null!==ge.modalState.tempCommunityCards[a]&&(ge.modalState.tempCommunityCards[a]=null),_e.modalTitle.textContent=pe("board"),_e.modalPlayerCards&&_e.modalPlayerCards.classList.add("is-hidden"),_e.modalBoard&&_e.modalBoard.classList.remove("is-hidden");else{const t=ge.players[e-1];t&&(ge.modalState.tempPlayerHand=[...t.hand],ge.modalState.wasInitiallyEmpty=ve()&&t.hand.every((e=>null===e)),ve()&&null!==ge.modalState.tempPlayerHand[a]&&(ge.modalState.tempPlayerHand[a]=null)),_e.modalTitle.textContent=`${pe("player")} ${e}`,_e.modalPlayerCards&&_e.modalPlayerCards.classList.remove("is-hidden"),_e.modalBoard&&_e.modalBoard.classList.add("is-hidden")}_e.modal&&_e.modal.classList.add("is-open"),ve()&&(document.documentElement.style.overflow="hidden",document.body.style.overflow="hidden",document.querySelector(".calculator").classList.add("is-higher")),He()},Re=()=>{ge.modalState.isOpen=!1,ge.modalState.currentPlayer=null,ge.modalState.activeSlotIndex=0,ge.modalState.isBoard=!1,ge.modalState.tempCommunityCards=null,ge.modalState.tempPlayerHand=null,ge.modalState.wasInitiallyEmpty=!1,_e.modal&&_e.modal.classList.remove("is-open"),ve()&&window.scrollController&&(document.documentElement.style.overflow="",document.body.style.overflow="",document.querySelector(".calculator").classList.remove("is-higher")),He(),ke()},Ie=()=>{if(ge.modalState.isBoard)ge.communityCards=[...ge.modalState.tempCommunityCards];else{const e=ge.players[ge.modalState.currentPlayer-1];e&&ge.modalState.tempPlayerHand&&(e.hand=[...ge.modalState.tempPlayerHand])}Re(),ke()},Be=()=>{if(!ge.modalState.isOpen)return;const e=fe[ge.gameType],t=e?e.handSize:2;if(ge.modalState.isBoard)ge.modalState.tempCommunityCards=[null,null,null,null,null],ve()||(ge.communityCards=[null,null,null,null,null]);else if(ge.modalState.tempPlayerHand&&(ge.modalState.tempPlayerHand=new Array(t).fill(null),!ve())){const e=ge.players[ge.modalState.currentPlayer-1];e&&(e.hand=new Array(t).fill(null))}ge.modalState.activeSlotIndex=0,He()},Ne=()=>{const e=fe[ge.gameType],t=e?e.handSize:2,a=e&&e.isHiLo;ge.communityCards=[null,null,null,null,null],ge.players.forEach((e=>{e.hand=new Array(t).fill(null),a?(e.winHiPercent=0,e.winLoPercent=0,e.tieHiPercent=0,e.tieLoPercent=0):(e.winPercent=0,e.tiePercent=0)})),ge.modalState.isOpen=!1,ge.modalState.currentPlayer=null,ge.modalState.activeSlotIndex=0,ge.modalState.isBoard=!1,ge.modalState.tempCommunityCards=null,ge.modalState.tempPlayerHand=null,He(),Ae(),ve()||setTimeout((()=>{ze(1)}),100)},Oe=()=>{ge.communityCards=[null,null,null,null,null],ge.modalState.isBoard&&(ge.modalState.isOpen=!1,ge.modalState.activeSlotIndex=0,ge.modalState.isBoard=!1,ge.modalState.tempCommunityCards=null),He(),ke(),ve()||setTimeout((()=>{Ke()}),100)},Fe=e=>{const t=ge.players.find((t=>t.id===e));if(!t)return;t.active=!0;const a=_e.playerItems[e-1];if(!a)return;a.classList.add("is-added");const n=a.querySelector(".calculator__player-add");n&&n.classList.add("is-hidden");let r=a.querySelector(".calculator__player");if(!r){const t=document.querySelector(".calculator__player");if(!t)return;const n=t.cloneNode(!0),l=n.querySelector(".calculator__player-name");l&&(l.textContent=`${pe("player")} ${e}`);const o=fe[ge.gameType];
1if(o){const e=n.querySelector(".calculator__player-cards");if(e){const t=e.querySelectorAll(".calculator__card-slot"),a=o.handSize;if(t.length!==a){const t=e.querySelector(".calculator__card-slot");if(t){e.innerHTML="";for(let n=0;n<a;n++){const a=t.cloneNode(!0);e.appendChild(a)}}}}const t=n.querySelector(".calculator__player-chances");t&&be(t,o.isHiLo)}a.appendChild(n),r=n}Me(a,e),He();const l=fe[ge.gameType],o=l&&l.isHiLo;ge.players.forEach((e=>{o?(e.winHiPercent=0,e.winLoPercent=0,e.tieHiPercent=0,e.tieLoPercent=0):(e.winPercent=0,e.tiePercent=0)})),ve()?(Le(a),ke()):Te(e,!1,0)},$e=()=>{if(!ve())return;const e=fe[ge.gameType];if(!e)return;if(ge.players.filter((e=>e.active)).length>=e.maxPlayers)return;const t=ge.players.find((e=>!e.active));t&&(Fe(t.id),ge.players.filter((e=>e.active)).length>=e.maxPlayers&&_e.mobileAddPlayerBtn&&_e.mobileAddPlayerBtn.classList.add("is-disabled"))},Me=(e,t)=>{e.querySelectorAll(".calculator__card-slot").forEach(((e,a)=>{e.addEventListener("click",(e=>{if(e.preventDefault(),!ve()){const e=ge.players[t-1];if(e&&null!==e.hand[a])return e.hand[a]=null,ge.modalState.isOpen=!0,ge.modalState.currentPlayer=t,ge.modalState.isBoard=!1,ge.modalState.activeSlotIndex=a,ge.modalState.tempPlayerHand=[...e.hand],ge.modalState.tempCommunityCards=null,He(),void ke()}Te(t,!1,a)}))}));const a=e.querySelector(".calculator__player-reset"),n=e.querySelector(".calculator__player-close");a&&a.addEventListener("click",(()=>(e=>{const t=ge.players.find((t=>t.id===e));if(!t)return;const a=fe[ge.gameType],n=a?a.handSize:2,r=a&&a.isHiLo;t.hand=new Array(n).fill(null),r?(t.winHiPercent=0,t.winLoPercent=0,t.tieHiPercent=0,t.tieLoPercent=0):(t.winPercent=0,t.tiePercent=0),ge.modalState.currentPlayer===e&&(ge.modalState.isOpen=!1,ge.modalState.currentPlayer=null,ge.modalState.activeSlotIndex=0,ge.modalState.isBoard=!1,ge.modalState.tempCommunityCards=null,ge.modalState.tempPlayerHand=null),He(),Ae(),ke(),ve()||setTimeout((()=>{ze(e)}),100)})(t))),n&&n.addEventListener("click",(()=>(e=>{const t=ge.players.find((t=>t.id===e));if(!t)return;const a=fe[ge.gameType],n=a?a.handSize:2,r=a&&a.isHiLo;t.active=!1,t.hand=new Array(n).fill(null),r?(t.winHiPercent=0,t.winLoPercent=0,t.tieHiPercent=0,t.tieLoPercent=0):(t.winPercent=0,t.tiePercent=0),ge.modalState.currentPlayer===e&&(ge.modalState.isOpen=!1,ge.modalState.currentPlayer=null,ge.modalState.activeSlotIndex=0,ge.modalState.isBoard=!1,ge.modalState.tempCommunityCards=null,ge.modalState.tempPlayerHand=null);const l=_e.playerItems[e-1];if(l){l.classList.remove("is-added");const e=l.querySelector(".calculator__player");e&&e.remove();const t=l.querySelector(".calculator__player-add");t&&t.classList.remove("is-hidden")}if(He(),Ae(),ve()){const e=ge.players.filter((e=>e.active));if(e.length>0){const t=e[e.length-1],a=_e.playerItems[t.id-1];Le(a)}}ke()})(t)))},ze=(e=1)=>{const t=ge.players[e-1];if(!t||!t.active)return;const a=_e.playerItems[e-1];if(!a)return;const n=a.querySelector(".calculator__card-slot");n&&(ve()||(n.classList.add("is-active"),Te(e,!1,0)))},Ke=()=>{if(!_e.boardSlots||0===_e.boardSlots.length)return;const e=_e.boardSlots[0];e&&(ve()||(e.classList.add("is-active"),Te(null,!0,0)))},De=()=>{(()=>{const e=document.querySelector(".calculator[data-translate-calc]");if(e)try{const t=e.dataset.translateCalc;if(t){const e=JSON.parse(t);ye={...he,...e}}}catch(e){console.error("Failed to parse translations:",e)}})(),_e.init();const e=_e.calculatorContent?.dataset.gameType||"holdem",t=document.querySelector(`.calculator__tabs li[data-game-type="${e}"]`);t&&(_e.tabs.forEach((e=>e.classList.remove("is-active"))),t.classList.add("is-active")),we(e),_e.boardSlots.forEach(((e,t)=>{e.addEventListener("click",(e=>{if(e.preventDefault(),!ve()&&null!==ge.communityCards[t])return ge.communityCards[t]=null,ge.modalState.isOpen=!0,ge.modalState.isBoard=!0,ge.modalState.activeSlotIndex=t,ge.modalState.tempCommunityCards=[...ge.communityCards],ge.modalState.tempPlayerHand=null,He(),void ke();Te(null,!0,t)}))})),_e.playerItems.forEach(((e,t)=>{const a=t+1;if(ge.players[t].active)Me(e,a);else{const t=e.querySelector(".calculator__player-add");t&&t.addEventListener("click",(()=>Fe(a)))}})),_e.modalCards.forEach((e=>{e.addEventListener("click",(()=>{((e,t,a)=>{if(!ge.modalState.isOpen)return;const n=Se(e,t);if(ge.disabledCards.has(n))return;const r={rank:e,suit:t,display:a};if(ge.modalState.isBoard){ge.modalState.tempCommunityCards[ge.modalState.activeSlotIndex]=r,ve()||(ge.communityCards[ge.modalState.activeSlotIndex]=r);const e=ge.modalState.tempCommunityCards.findIndex((e=>null===e));if(-1!==e)ge.modalState.activeSlotIndex=e;else{if(ge.modalState.activeSlotIndex=null,ve()&&ge.modalState.wasInitiallyEmpty)return void Ie();if(!ve()){let e=null;for(let t=0;t<ge.players.length;t++){const a=ge.players[t];
1if(a.active&&a.hand.some((e=>null===e))){e=a;break}}if(e){const t=e.hand.findIndex((e=>null===e)),a=-1!==t?t:0;Te(e.id,!1,a)}else Re();return}}}else{if(!ge.modalState.tempPlayerHand)return;if(ge.modalState.tempPlayerHand[ge.modalState.activeSlotIndex]=r,!ve()){const e=ge.players[ge.modalState.currentPlayer-1];e&&(e.hand[ge.modalState.activeSlotIndex]=r)}const e=ge.modalState.tempPlayerHand.findIndex((e=>null===e));if(-1!==e)ge.modalState.activeSlotIndex=e;else{if(ge.modalState.activeSlotIndex=null,ve()&&ge.modalState.wasInitiallyEmpty)return void Ie();if(!ve()){const e=ge.modalState.currentPlayer-1;ge.players.filter((e=>e.active));let t=null;for(let a=e+1;a<ge.players.length;a++){const e=ge.players[a];if(e.active&&e.hand.some((e=>null===e))){t=e;break}}if(t){const e=t.hand.findIndex((e=>null===e)),a=-1!==e?e:0;Te(t.id,!1,a)}else{let t=null;for(let a=0;a<e;a++){const e=ge.players[a];if(e.active&&e.hand.some((e=>null===e))){t=e;break}}if(t){const e=t.hand.findIndex((e=>null===e)),a=-1!==e?e:0;Te(t.id,!1,a)}else{const e=fe[ge.gameType];
1if(e&&e.hasCommunityCards&&ge.communityCards.some((e=>null===e))){const e=ge.communityCards.findIndex((e=>null===e));Te(null,!0,e)}else Re()}}return}}}He(),ve()||ke()})(e.dataset.rank,e.dataset.suit,e.textContent)}))})),_e.modalPlayerSlots.forEach(((e,t)=>{e.addEventListener("click",(()=>{if(ge.modalState.tempPlayerHand&&null!==ge.modalState.tempPlayerHand[t]&&(ge.modalState.tempPlayerHand[t]=null,!ve())){const e=ge.players[ge.modalState.currentPlayer-1];e&&(e.hand[t]=null)}ge.modalState.activeSlotIndex=t,He()}))})),_e.modalBoardSlots.forEach(((e,t)=>{e.addEventListener("click",(()=>{ge.modalState.tempCommunityCards&&null!==ge.modalState.tempCommunityCards[t]&&(ge.modalState.tempCommunityCards[t]=null,ve()||(ge.communityCards[t]=null)),ge.modalState.activeSlotIndex=t,He()}))})),_e.modalCloseBtn&&_e.modalCloseBtn.addEventListener("click",Re),_e.modalDoneBtn&&_e.modalDoneBtn.addEventListener("click",Ie),_e.modalResetBtn&&_e.modalResetBtn.addEventListener("click",Be),_e.resetCardsBtn&&_e.resetCardsBtn.addEventListener("click",Ne),_e.boardResetBtn&&_e.boardResetBtn.addEventListener("click",Oe),_e.mobileAddPlayerBtn&&_e.mobileAddPlayerBtn.addEventListener("click",$e),_e.tabs.forEach((e=>{e.addEventListener("click",(()=>{const t=e.dataset.gameType;_e.tabs.forEach((e=>e.classList.remove("is-active"))),e.classList.add("is-active"),we(t),ke()}))})),ve()||ze(),ke()};document.addEventListener("DOMContentLoaded",(()=>{!function(){const e=document.querySelector(".highlighted-news");if(!e)return;const t=e.querySelector(".news-tabs"),a=e.querySelectorAll(".news-tabs__tab"),n=e.querySelector(".highlighted__panel").clientHeight,r=e.querySelector("[data-highlighted-news-panel]"),l=e.querySelector(".highlighted-news__loading");let o=!0;a.forEach((a=>{a.addEventListener("click",(function(){if(this.classList.contains("tab--active"))return;const a=this.closest("[data-highlighted-news-tab]"),i=e.querySelector(".highlighted-news__posts");if(a?i.classList.add("highlighted-news__posts--hide"):i.classList.remove("highlighted-news__posts--hide"),o&&a){r.style.minHeight=`${n}px`,l&&(l.style.display="block",l.setAttribute("aria-busy","true"));const a=e.dataset.nonce,i=t.dataset.terms,s=new FormData;s.append("action","getPopularNews"),s.append("terms",i),s.append("nonce",a),function(e){fetch(ajaxurl,{method:"POST",body:e}).then((e=>{if(!e.ok)throw new Error(`HTTP: ${e.status}`);return e.text()})).then((e=>{o=!1,r.insertAdjacentHTML("beforeend",e),l&&(l.style.display="none",l.setAttribute("aria-busy","false")),r.style.minHeight="auto"})).catch((e=>{console.error("AJAX:",e)}))}(s)}}))}))}(),function(){const e=document.querySelectorAll(".main-content--filter-sidebar");if(e.length<1)return!1;e.forEach((e=>{e.addEventListener("click",(function(e){if(e.target.classList.contains("run-search")){let e=new Ue;e.SetCurrentPage(1),e.request()}if(e.target.classList.contains("load-more-wrap")||e.target.classList.contains("load-more")){let e=new Ue;e.SetCurrentPage(++e.currentPage),e.request()}e.target.classList.contains("filters__clear")&&(new Ue).clearFilter(),e.target.classList.contains("close-tag")&&(new Ue).clearTag(e.target.parentElement)})),e.querySelector(".filters__inner-wrapper").addEventListener("change",(function(e){"input"
1===e.target.localName&&(new Ue).RenderTagField()}))}))}(),function(){const e=document.getElementById("poker-terms-search");let t=document.querySelector(".poker-terms__nav"),a=document.querySelector(".poker-terms__group-list");e&&e.addEventListener("submit",(function(e){let n=new FormData,r=document.getElementById("poker-terms-search-input").value;n.append("action","pokerTermsSearch"),n.append("s",r||""),fetch(ajaxurl,{method:"POST",dataType:"json",body:n}).then((e=>e.text())).then((e=>{e=JSON.parse(e),t.innerHTML=e.headlineList,a.innerHTML=e.glossary})).catch((e=>console.log(e))),e.preventDefault()}))}(),function(){const e=document.querySelector(".author-news");if(!e)return;const t=e.getAttribute("data-nonce"),a=e.querySelector(".author-news__content").getAttribute("data-author"),n=e.querySelector(".author-news__cards"),r=e.querySelector(".author-news__loading");let l=e.querySelector(".author-news__tabs"),o=l.querySelectorAll(".news-tabs__tab"),i=e.querySelector(".author-news__load-more"),s=e.querySelector(".author-news__content").getAttribute("data-page"),c=e.querySelector(".author-news__content").getAttribute("data-count-page");function d(e,t=!1){t||n.replaceChildren(),fetch(ajaxurl,{method:"POST",dataType:"json",body:e}).then((e=>e.text())).then((e=>{(e=JSON.parse(e))&&(t?n.insertAdjacentHTML("beforeend",e.posts):(n.replaceChildren(),n.insertAdjacentHTML("beforeend",e.posts),s=1),c=e.max_count_page,function(e,t){i&&(i.style.display=e<t?"block":"none")}(s,c)),r&&(r.style.display="none",r.setAttribute("aria-busy","false"))})).catch((e=>console.log(e)))}a&&o&&(o.forEach((e=>{e.addEventListener("click",(function(){if(this.classList.contains("tab--active"))return;r&&(r.style.display="block",r.setAttribute("aria-busy","true")),o.forEach((e=>e.classList.remove("tab--active"))),this.classList.add("tab--active");let e=this.getAttribute("data-terms"),n=new FormData;n.append("action","getUserNews"),n.append("terms",e),n.append("termsName",this.innerText),n.append("authorID",a),n.append("nonce",t),d(n)}))})),i&&i.addEventListener("click",(function(){if(s<c){let e=l.querySelector(".tab--active"),n=e.getAttribute("data-terms"),r=new FormData;r.append("action","getUserNews"),r.append("terms",n),r.append("termsName",e.innerText),r.append("authorID",a),r.append("page",++s),r.append("nonce",t),d(r,!0)}})))}(),function(){let e=document.querySelector(".comments-area__comments-wrapper");if(e){let t=document.querySelector(".comments-area__inner-wrapper").getAttribute("data-count"),a=0,n=document.getElementById("load-more-comments");n&&n.addEventListener("click",(function(){let r=parseInt(n.getAttribute("data-page")),l=n.getAttribute("data-post-id");fetch(ajaxurl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({action:"load_more_comments",post_id:l,page:r+1})}).then((e=>e.text())).then((l=>{(l=(new DOMParser).parseFromString(l,"text/html").querySelector(".comments-area__comments")).childElementCount>0?(document.querySelector(".comments-area__comments-wrapper ").appendChild(l),e.insertAdjacentElement("beforeend",l),n.setAttribute("data-page",r+1),a=e.querySelectorAll(".comments-area__comment").length,a>=t&&n.remove()):n.remove()})).catch((e=>{console.error("Error:",e)}))}))}}(),function(){const e=document.querySelector("#comments");if(e){const t=e.querySelector(".comments-area__respond"),a=document.querySelector(".comments-area__comments");if(t&&a){const e=document.getElementById("comment_parent"),t=document.getElementById("reply_author"),n=document.querySelector(".comments-area__form-stars");a.addEventListener("click",(a=>{const r=a.target;if(r.classList.contains("comments-area__reply")){const a=r.getAttribute("data-comment-id"),l=r.closest(".comments-area__comment").querySelector(".comments-area__author-name").innerHTML;e.value=a,t.style.display="flex",t.innerHTML="",t.insertAdjacentHTML("beforeend",`\n\t\t\t\t\t<span>${t.getAttribute("data-reply")}</span>\n\t\t\t\t\t<span>@${l}</span>\n\t\t\t\t\t`),t.nextElementSibling.style.display="flex",n&&(n.style.display="none",n.querySelectorAll('input[type="radio"]').forEach((e=>{e.checked=!1}
1)))}}))}}}(),function(){const e=document.querySelector("#comments");if(e){const t=e.querySelector(".comments-area__respond"),a=document.querySelector(".comments-area__comments");if(t&&a){const e=document.getElementById("cancel_reply"),t=document.getElementById("comment_parent"),a=document.getElementById("reply_author"),n=document.querySelector(".comments-area__form-stars");e.addEventListener("click",(e=>{const r=e.target.closest("button");if(t.value=0,a.innerHTML="",a.style.display="none",r.style.display="none",n&&(n.style.display="flex",!n.querySelector('input[type="radio"]:checked'))){const e=n.querySelector('input[type="radio"][value="5"]');if(e){e.checked=!0;const t=n.querySelector(".comments-area__form-star-count > span:last-child");t&&(t.textContent="5 / 5")}}}))}}}(),document.querySelectorAll(".menu-item-has-children:not(.header__menu-list > .menu-item-has-children)").forEach((e=>{e.insertAdjacentHTML("beforeend",'<div class="menu-arrow">\n <span class="icon-font icon-control-point"></span>\n </div>')})),function(){const e=document.querySelector(".mobile-menu"),t=document.querySelector(".header__burger-button"),a=document.documentElement;t.addEventListener("click",(n=>{if(e.classList.toggle("mobile-menu--active"),t.classList.toggle("header__burger-button--active"),a.classList.toggle("lock"),e.classList.contains("mobile-menu--active")){const e=document.querySelector(".floating-mobile-menu__bonuses--open");e&&e.classList.remove("floating-mobile-menu__bonuses--open")}})),window.addEventListener("resize",(function(){window.innerWidth>767&&(e.classList.remove("mobile-menu--active"),t.classList.remove("header__burger-button--active"),a.classList.remove("lock"))}))}(),function(){const e=document.querySelector(".mobile-menu");e&&e.addEventListener("click",(t=>{const a=t.target,n=e.querySelectorAll(".menu-item-has-children"),r=a.closest(".menu-item-has-children");if(n.forEach((e=>{const t=e.querySelector(".sub-menu"),a=e.classList.contains("menu-item--active");r!==e||a?(e.classList.remove("menu-item--active"),t.style.maxHeight="0px"):(e.classList.add("menu-item--active"),t.style.maxHeight=`${t.scrollHeight}px`)})),a.closest("a")){const t=document.querySelector(".header__burger-button"),n=document.documentElement;e.classList.remove("mobile-menu--active"),t.classList.remove("header__burger-button--active"),n.classList.remove("lock"),setTimeout((()=>{window.location.href=a.href}),300)}})),document.addEventListener("click",(t=>{const a=t.target;e.contains(a)||function(){const t=e.querySelectorAll(".menu-item--active");t&&t.forEach((e=>{const t=e.querySelector(".sub-menu");e.classList.remove("menu-item--active"),t.style.maxHeight="0px"}))}()}))}(),function(){const e=document.querySelector(".header-bonus");if(!e)return;const t=e.querySelector(".header-bonus__header"),a=e.querySelector(".header-bonus__arrow"),n=e.querySelector(".header-bonus__title"),r=e.querySelector(".header-bonus__subtitle"),l=e.querySelector(".header-bonus__sub-menu"),o=e.querySelectorAll(".header-bonus__item"),i=r.textContent.split(" ");i[0]=o.length,r.textContent=i.join(" "),t.addEventListener("click",(()=>{l.classList.toggle("header-bonus__sub-menu--active"),a.classList.toggle("header-bonus__arrow--active"),n.classList.toggle("header-bonus__title--active"),l.classList.contains("header-bonus__sub-menu--active")?l.style.display="block":l.style.display="none"})),document.addEventListener("click",(t=>{const r=t.target,o=r.closest(".header-bonus__button");e.contains(r)&&!o||(l.style.display="none",l.classList.remove("header-bonus__sub-menu--active"),a.classList.remove("header-bonus__arrow--active"),n.classList.remove("header-bonus__title--active"))}))}(),function(){const e=document.querySelector(".footer__region");if(e){const t=e.querySelector(".footer__region-button"),a=e.querySelector(".footer__region-links");t.addEventListener("click",(()=>{t.classList.toggle("footer__region-button--active"),a.classList.toggle("footer__region-links--active"),document.addEventListener("click",(e=>{const n=e.target;(!n.closest(".footer__region-links")&&!n.closest(".footer__region-button")||n.closest(".footer__region-link"))&&(t.classList.remove("footer__region-button--active"),a.classList.remove("footer__region-links--active"))}))}))}}(),function(){const e=document.querySelector(".header__menu-list"),t=e.querySelectorAll(".header__menu-list .sub-menu__list > .menu-item-has-children"),a=document.body;function n(){t.forEach((e=>{if(!e.closest(".sub-menu").closest(".menu-item--active")){const t=e.querySelector(".sub-menu");e.classList.remove("menu-item--active"),t.style.maxHeight="0px"}}))}function r(){const t=e.querySelector(".menu-item--active");if(!t)return;const r=t.querySelector(".sub-menu");if(r){const e=document.querySelector(".menu-search--active"),l=document.querySelector(".floating-mobile-menu__bonuses--open");t.classList.remove("menu-item--active"),r.style.top="-200%",e||l||a.classList.remove("lock"),n()}}e.addEventListener("click",(function(t){const l=t.target,o=l.closest(".menu-item-has-children");if(o){const t=l.closest(".sub-menu");if(t)t.querySelectorAll(".menu-item-has-children").forEach((e=>{const t=e.querySelector(".sub-menu"),a=e.classList.contains("menu-item--active");o!==e||a?(e.classList.remove("menu-item--active"),t.style.maxHeight="0px"):(e.scrollIntoView({behavior:"smooth",block:"end"}),e.classList.add("menu-item--active"),t.style.maxHeight=`${t.scrollHeight}px`)}));else if(e.querySelectorAll(".header__menu-list > .menu-item-has-children").forEach((e=>{const t=e.querySelector(".sub-menu"),a=e.classList.contains("menu-item--active");if(o!==e||a)e.classList.remove("menu-item--active"),t.style.top="-200%",t.style.minHeight="0px";else{e.classList.add("menu-item--active");let a=document.querySelector(".header"),n=a.getBoundingClientRect().height;window.addEventListener("resize",(()=>{a=document.querySelector(".header"),n=a.getBoundingClientRect().height})),t.style.top=+n-+window.scrollY-2+"px",t.style.maxHeight="555px"}})),e.querySelector(".menu-item--active")){a.classList.add("lock"),n();const e=document.querySelector(".floating-mobile-menu__bonuses--open");e&&e.classList.remove("floating-mobile-menu__bonuses--open")}else a.classList.remove("lock"),n()}window.addEventListener("resize",(function(){window.innerWidth<768&&(n(),r())}))})),document.addEventListener("click",(function(t){const a=t.target;e.contains(a)||r(),a.closest("a")&&a.hasAttribute("href")&&"#"!=a.getAttribute("href")&&e.contains(a)&&(t.preventDefault(),r(),setTimeout((()=>{window.location.href=a.href}),300))}))}(),function(){const e=document.querySelectorAll("[data-block-with-tabs]");function t(e){const t=this.querySelectorAll('[role="tab"]'),a=this.querySelectorAll('[role="tabpanel"]');t.length&&t.forEach(((t,n)=>{t.contains(e.target)?(t.classList.add("tab--active"),t.setAttribute("aria-selected","true"),a.length>1&&(a[n].setAttribute("aria-hidden","false"),a[n].classList.add("panel--active"))):(t.classList.remove("tab--active"),t.setAttribute("aria-selected","false"),a.length>1&&(a[n].setAttribute("aria-hidden","true"),a[n].classList.remove("panel--active")))}))}e&&e.forEach((e=>{(function(e){const t=e.querySelectorAll('[role="tab"]'),a=e.querySelectorAll('[role="tabpanel"]');t.length&&(t[0].setAttribute("aria-selected","true"),a[0].setAttribute("aria-hidden","false"))})(e),e.addEventListener("click",(function(e){e.target.closest('[role="tab"]')&&t.call(this,e)}))}))}(),function(){const e=document.querySelectorAll("[data-expandable]");if(e){function t(e){const t=e,n=t.querySelector("[data-expandable-btn]");if(n){const e=t.querySelectorAll("[data-expandable-item]"),r=t.querySelector("[data-expandable-counter]"),l=t.querySelector("[data-expandable-shown]"),o=t.querySelector("[data-expandable-total]");if(!(e.length>6))return n.style.display="none",void(r.style.display="none");l.textContent=6,o.textContent=`${e.length}`,a(e),n.addEventListener("click",(()=>{n.classList.toggle("expandable__show-button--active"),n.classList.contains("expandable__show-button--active")?(e.forEach((e=>{"TR"===e.tagName?e.style.display="table-row":e.style.display="flex"})),l.textContent=`${e.length}`,n.querySelector(".button__text:nth-child(1)").style.display="none",n.querySelector(".button__text:nth-child(2)").style.display="block",n.querySelector(".icon-font").style.rotate="270deg"):(a(e),l.textContent=6,n.querySelector(".button__text:nth-child(1)").style.display="block",n.querySelector(".button__text:nth-child(2)").style.display="none",n.querySelector(".icon-font").style.rotate="90deg",n.scrollIntoView(!1))}))}}function a(e){e.forEach(((e,t)=>{t>=6&&(e.style.display="none")}))}e.forEach((e=>{t(e)}))}}(),function(){const e=document.querySelector(".floating-mobile-menu");if(e){const t=e.querySelector(".floating-mobile-menu__button");if(!t)return;const a=e.querySelector(".floating-mobile-menu__bonuses"),n=e.querySelectorAll(".floating-mobile-menu__bonuses-item"),r=t.querySelector(".floating-mobile-menu__count"),l=document.body;r.textContent=n.length,t.addEventListener("click",(()=>{a.classList.toggle("floating-mobile-menu__bonuses--open"),a.classList.contains("floating-mobile-menu__bonuses--open")?l.classList.add("lock"):l.classList.remove("lock")})),window.addEventListener("resize",(function(){if(window.innerWidth>1024){a.classList.remove("floating-mobile-menu__bonuses--open");const e=document.querySelector(".menu-item--active"),t=document.querySelector(".popup--show"),n=document.querySelector(".user-consent--show");if(t||n)return;e||l.classList.remove("lock")}}))}}(),function(){const e=document.querySelector(".highlighted-data");if(e){const t=e.querySelector(".highlighted-data__list");function a(e){e.forEach(((e,t)=>{t>4&&(e.style.display="none")}))}e.querySelectorAll(".highlighted-data__nested-list").forEach((e=>{const t=e.closest(".highlighted-data__item"),n=t.querySelector(".highlighted-data__show-more"),r=t.querySelector(".highlighted-data__show-more > span:first-child"),l=e.querySelectorAll(".highlighted-data__nested-item");l.length>5?(r.textContent=`+${l.length-5} ${r.textContent}`,a(l)):n.style.display="none"})),t.addEventListener("click",(e=>{const t=e.target.closest(".highlighted-data__show-more");if(t){const e=t.previousElementSibling,n=e.querySelectorAll(".highlighted-data__nested-item");if(n.length>5){const r=t.closest(".highlighted-data__item"),l=r.querySelector(".highlighted-data__show-more > span:first-child"),o=r.querySelector(".highlighted-data__show-more > span:nth-child(2)"),i=t.querySelector(".highlighted-data__arrow-icon");
1e.classList.toggle("open"),n.forEach((t=>{e.classList.contains("open")?(t.style.display="flex",l.style.display="none",o.style.display="block",i.style.rotate="270deg"):(a(n),l.style.display="block",o.style.display="none",i.style.rotate="90deg")}))}else t.style.display="none"}}))}}(),function(){const e=document.querySelector(".comments-area__form-stars");if(e){const t=e.querySelector(".comments-area__form-stars-wrapper"),a=e.querySelector(".comments-area__form-star-count > span:last-child"),n=t.querySelectorAll("label");a.textContent=`${n.length} / ${n.length}`,t.addEventListener("click",(e=>{const t=e.target;if("INPUT"===t.tagName){const e=t.getAttribute("value");a.textContent=`${e} / 5`}}))}}(),document.querySelectorAll("[data-checkbox]").forEach((e=>{const t=e.closest("form"),a=t.querySelector('[type="submit"]');t.addEventListener("submit",(e=>{})),e.addEventListener("click",(e=>{"INPUT"===e.target.tagName&&function(e){e.disabled=!e.disabled}(a)}))})),function(){const e=document.querySelectorAll(".video");e&&e.forEach((e=>{e.addEventListener("click",(e=>{const t=e.currentTarget,a=t.querySelector(".video__image"),n=t.querySelector(".video__play"),r=t.querySelector(".video__inner-wrapper"),l=t.dataset.url;let o=document.createElement("div");const i=`\n\t\t\t\t\t\t\t<iframe allowfullscreen allow="autoplay" src="${l}?rel=0&showinfo=0&autoplay=1" class="video__media">\n\t\t\t\t\t\t\t</iframe>\n\t\t\t\t\t\t\t`;o.innerHTML=i,a.remove(),n.remove(),r.appendChild(o.firstElementChild)}))}))}(),function(){const e=document.querySelectorAll("[data-clipboard]");if(e){const t=window.location.href;function a(e,t){setTimeout((()=>{e.setAttribute("class","icon-font icon-link"),t.textContent="Link"}),7e3)}e.forEach((e=>{e.addEventListener("click",(()=>{const n=e.querySelector(".icon-font"),r=e.querySelector(".share-block__link-name");navigator.clipboard.writeText(t).then((()=>{n.setAttribute("class","icon-font icon-checkmark"),r.textContent="Copied",a(n,r)})).catch((()=>{n.setAttribute("class","icon-font icon-cross"),r.textContent="Failed",a(n,r)}))}))}))}}(),function(){const e=document.querySelectorAll("[data-load-more]");if(e){function t(e){const t=e,n=t.querySelector("[data-expandable-btn]");if(n){const r=+e.dataset.loadMore,l=t.querySelectorAll("[data-expandable-item]"),o=t.querySelector("[data-expandable-counter]"),i=t.querySelector("[data-expandable-shown]"),s=t.querySelector("[data-expandable-total]"),c=e.querySelector("[data-load-more-count]");l.length>2*r?o&&(i.textContent=2*r,s.textContent=`${l.length}`):(o&&(o.style.display="none"),n.style.display="none"),a(l,r);let d=e.querySelectorAll('[aria-hidden="true"]'),u=e.querySelectorAll('[aria-hidden="false"]'),m=d.length<=r?d.length:r;c.textContent=m,n.addEventListener("click",(()=>{u.length!==l.length?(d.forEach(((e,t)=>{t<m&&(e.style.display="flex",e.setAttribute("aria-hidden","false"))})),d=e.querySelectorAll('[aria-hidden="true"]'),u=e.querySelectorAll('[aria-hidden="false"]'),o&&(i.textContent=`${u.length}`),u.length===l.length?(n.querySelector(".button__text:nth-child(1)").style.display="none",n.querySelector(".button__text:nth-child(2)").style.display="block",n.querySelector(".icon-font").style.rotate="-90deg"):c.textContent=d.length):(a(l,r),d.forEach(((e,t)=>{t<2*r?(e.style.display="flex",e.setAttribute("aria-hidden","false")):e.setAttribute("aria-hidden","true")})),d=e.querySelectorAll('[aria-hidden="true"]'),u=e.querySelectorAll('[aria-hidden="false"]'),o&&(i.textContent=`${u.length}`),c.textContent=m,n.querySelector(".button__text:nth-child(1)").style.display="block",n.querySelector(".button__text:nth-child(2)").style.display="none",n.querySelector(".icon-font").style.rotate="90deg",n.scrollIntoView(!1))}))}}function a(e,t){e.forEach(((e,a)=>{a>=2*t?(e.style.display="none",e.setAttribute("aria-hidden","true")):(e.style.display="flex",e.setAttribute("aria-hidden","false"))}))}e.forEach((e=>{t(e)}))}}(),function(){const e=document.querySelector(".to-top");if(e){const t=document.documentElement.clientHeight;let a,n;window.addEventListener("scroll",(()=>{n=window.scrollY,n<a&&n>t?e.classList.add("show-up"):e.classList.remove("show-up"),a=n}))}}(),function(){const e=document.querySelector("#filter");
1if(e){const t=document.querySelector(".filters__inner-wrapper"),a=document.querySelector(".filters__result");e.addEventListener("change",(()=>{e.checked?(t.style.display="grid",a.style.display="grid"):(t.style.display="none",a.style.display="none")}))}}(),function(){const e=document.querySelector("#popup-age");if(e){const t=e.querySelector(".popup__buttons"),a=(e.querySelector(".popup__description"),e.querySelector(".popup__note"),document.body);localStorage.getItem("confirmAge")||setTimeout((()=>{e.classList.add("popup--show"),a.classList.add("lock")}),2e3),t.addEventListener("click",(t=>{const n=t.target.closest("button");n&&("popup-yes-button"===n.id&&(e.classList.remove("popup--show"),localStorage.setItem("confirmAge","true"),a.classList.remove("lock"),setTimeout((()=>{We()}),1e3)),"popup-no-button"===n.id&&(window.location.href="https://google.com"))}))}}(),We(),function(){const e=document.querySelectorAll(".button-copy");e&&e.forEach((e=>{e.addEventListener("click",(t=>{const a=e.querySelector(".button-copy__input"),n=a.value,r=e.querySelector(".button-copy__button"),l=e.querySelector(".icon-copy");a.select(),document.execCommand("copy"),a.value="Copied!",r.setAttribute("disabled","disabled"),a.setAttribute("disabled","disabled"),l.classList.remove("icon-copy"),l.classList.add("icon-checkmark"),setTimeout((()=>{r.removeAttribute("disabled"),a.removeAttribute("disabled"),l.classList.remove("icon-checkmark"),l.classList.add("icon-copy"),a.value=n}),7e3)}))}))}(),function(){const e=document.querySelector(".header__search-button"),t=document.querySelectorAll(".menu-search"),a=document.querySelector(".header__search").querySelector(".menu-search"),n=a.querySelector("#menu-search-input"),r=document.querySelector(".mobile-menu__search").querySelector("#mobile-menu-search-input"),l=document.body;function o(e){const t=e.currentTarget.querySelector(".menu-search__reset-button"),a=e.target.closest(".menu-search__reset-button");t&&t===a&&(t.previousElementSibling.value="")}e&&t&&(document.addEventListener("click",(t=>{const n=t.target,r=a.querySelector(".menu-search__form > .button");if(n.closest(".header__search-button"))return;const o=t.offsetY>a.offsetHeight;if(!a.contains(n)||r.contains(n)||o){const t=document.querySelector(".menu-item--active"),n=document.querySelector(".floating-mobile-menu__bonuses--open"),r=document.querySelector(".popup--show"),o=document.querySelector(".user-consent--show");if(r||o)return;e.classList.remove("header__search-button--active"),a.classList.remove("menu-search--active"),t||n||l.classList.remove("lock")}})),e.addEventListener("click",(function(t){if(t.target.closest(".header__search-button")){e.classList.toggle("header__search-button--active"),a.classList.toggle("menu-search--active"),n.value="",a.classList.contains("menu-search--active")?l.classList.add("lock"):l.classList.remove("lock");const t=e.classList.contains("header__search-button--active"),r=document.querySelector(".floating-mobile-menu__bonuses--open");r&&t&&r.classList.remove("floating-mobile-menu__bonuses--open")}})),t.forEach((e=>{e.addEventListener("click",o)})),window.addEventListener("resize",(function(){if(window.innerWidth<768){const t=document.querySelector(".popup--show"),r=document.querySelector(".user-consent--show");if(e.classList.remove("header__search-button--active"),a.classList.remove("menu-search--active"),n.value="",t||r)return;l.classList.remove("lock")}else r.value=""})))}(),document.body.addEventListener("click",(e=>{const t=e.target.closest(".condition__button");if(t){const e=t.nextElementSibling,a=document.querySelector(".condition__button--active");e.classList.toggle("condition__description--active"),t.classList.toggle("condition__button--active"),a&&(a.classList.remove("condition__button--active"),a.nextElementSibling.classList.remove("condition__description--active"))}})),function(){const e=document.querySelector(".room-main-screen__games");if(!e)return;const t=e.querySelectorAll(".room-main-screen__game"),a=e.querySelector(".room-main-screen__show-more"),n=e.querySelector(".room-main-screen__show-more-content"),r=n.querySelector("span:nth-child(1)"),l=n.querySelector("span:nth-child(2)"),o=e.querySelector(".room-main-screen__games-list");if(!t.length||!a||!o)return;let i=t[0].clientHeight,s=i-52,c=3*i-s,d=o.clientHeight-s;function u(){i=t[0].clientHeight,s=i-52,c=3*i-s,o.removeAttribute("style"),a.classList.remove("room-main-screen__show-more--active"),r.style.display="inline",l.style.display="none",d=o.clientHeight-s,t.length>9&&c<d?(a.style.display="flex",o.style.maxHeight=`${c}px`):a.style.display="none"}u(),window.addEventListener("resize",u),a.addEventListener("click",(()=>{a.classList.toggle("room-main-screen__show-more--active"),a.classList.contains("room-main-screen__show-more--active")?(o.style.maxHeight=`${d}px`,r.style.display="none",l.style.display="inline"):(o.style.maxHeight=`${c}px`,r.style.display="inline",l.style.display="none")}))}(),function(){const e=document.querySelector(".default-search__form");if(!e)return;const t=e.querySelector(".default-search__input > input");e.addEventListener("click",(e=>{e.target.closest(".default-search__reset-button")&&(t.value="")}
1))}(),function(){const e=document.querySelectorAll(".freerolls__card-date");e.length>0&&e.forEach((function(e){const t=e.textContent,[a,n]=t.split(", "),r=new Date(`${n} ${a} UTC`).toLocaleString(void 0,{hour:"2-digit",minute:"2-digit",day:"numeric",month:"long"});e.textContent=r}))}(),function(){const e=document.querySelectorAll(".openchat");e&&e.forEach((function(e){e.addEventListener("click",(function(e){e.preventDefault();const t=document.createElement("script");t.src="/jivosite/jivosite.js",t.type="text/javascript",document.body.appendChild(t)}))}))}(),function(){const e=document.querySelector(".highlighted-news");function t(t){t.classList.contains("highlighted__submenu--active")&&(t.classList.remove("highlighted__submenu--active"),t.style.maxHeight="0px");const n=e.querySelector(".highlighted__more--active");n&&n.classList.remove("highlighted__more--active"),a()}function a(){const t=e.querySelectorAll(".menu-item--active");t.length&&t.forEach((e=>{e.querySelector(".sub-menu").style.maxHeight="0px",e.classList.remove("menu-item--active")}))}e&&(e.addEventListener("click",(function(n){const r=n.target,l=r.closest(".highlighted__more"),o=e.querySelector(".highlighted__submenu");if(l&&o&&(l.classList.toggle("highlighted__more--active"),o.classList.toggle("highlighted__submenu--active"),o.classList.contains("highlighted__submenu--active")?o.style.maxHeight=`${o.scrollHeight}px`:(o.style.maxHeight="0px",a())),(r.closest("a")||!o.contains(r)&&!r.closest(".highlighted__more"))&&t(o),r.closest(".menu-item-has-children")){const t=e.querySelectorAll(".menu-item-has-children"),a=n.target.closest(".menu-item-has-children");t.forEach((e=>{const t=e.querySelector(".sub-menu"),n=e.classList.contains("menu-item--active");a!==e||n?(e.classList.remove("menu-item--active"),t.style.maxHeight="0px"):(e.classList.add("menu-item--active"),t.style.maxHeight=`${t.scrollHeight}px`)}))}})),document.addEventListener("click",(a=>{const n=e.querySelector(".highlighted__submenu");e.contains(a.target)||t(n)})))}(),De(),function(){const e=document.getElementById("comment-notice");if(!e)return;const t=document.querySelector(".comments-area__comment-notice > div");t&&(setTimeout((()=>{t.style.opacity="0"}),5e3),t.addEventListener("transitionend",(()=>{e.classList.add("comments-area__comment-notice--hidden"),t.style.padding="0",e.style.paddingBlock="0"})))}()})),window.addEventListener("load",(()=>{const e=document.querySelectorAll("[data-slider]");e.length&&e.forEach((e=>{!function(e){const t=e.querySelectorAll('[data-track="slider"] > li'),a=e.querySelector("[data-slider-controls]"),n=e.querySelector('[data-track="slider"]'),r=e.querySelector('[data-control="left"]'),l=e.querySelector('[data-control="right"]'),o="with-indicators"===e.dataset.slider;if(t.length<=1)return void(a.style.display="none");const i=t[0].offsetWidth;let s,c,d,u,m,h,y=i,p=0,f=window.innerWidth;function g(){p=e.offsetWidth,s=t.length>1?t[1].getBoundingClientRect().left-t[0].getBoundingClientRect().right:0,y=i,c=y+s;let a=p/c;a-Math.floor(a)>=.5&&a>1?y=(p-s*Math.floor(a))/(Math.floor(a)+.5):a<=1&&(y=p),p-s-Math.floor(a)*c<=s&&1!==Math.floor(a)&&(y=(p-s*(a-1))/Math.floor(a)),p-(t.length*c-s)>s&&1!==Math.floor(a)&&(y=(p-s*(t.length-1))/t.length),t.forEach((e=>{e.style.width=`${y}px`})),c=y+s,d=Math.max(0,t.length*c-s-p),u=0,m=0,n.style.left=`${u}px`,h=Math.floor((t.length*c-s)/y),a>1&&(h-=a-1)}function _(){a.style.display=p>=t.length*c-s?"none":"flex"}function S(){const t=e.querySelector(".slider-controls__lines");t.innerHTML="";for(let e=0;e<h;e++){const a=document.createElement("span");a.classList.add("slider-controls__line"),0===e&&a.classList.add("slider-controls__line--active"),t.append(a)}}function v(){o&&e.querySelectorAll(".slider-controls__line").forEach(((e,t)=>{e.classList.toggle("slider-controls__line--active",t===m)}))}function L(){0===u?(u=-d,m=Math.floor(h)):(u=Math.min(u+c,0),m--),n.style.left=`${u}px`,v()}function b(){Math.abs(u)>=d?(u=0,m=0):(u=Math.max(u-c,-d),m++),n.style.left=`${u}px`,v()}g(),_(),window.addEventListener("resize",(()=>{f=window.innerWidth,g(),_(),o&&S(),e.classList.contains("freerolls")&&f>1023&&(a.style.display="none")})),o&&S(),r.addEventListener("click",L),l.addEventListener("click",b),function(){let t,a,n;const r=e.querySelector('[data-area="area"]');function l(e){if(e.target.closest("button")||e.target.closest("a"))return;const r=e.changedTouches?e.changedTouches[0]:e;t=r.pageX,a=r.pageY,n=(new Date).getTime(),e.preventDefault()}function o(e){if(e.target.closest("button")||e.target.closest("a"))return;const r=e.changedTouches?e.changedTouches[0]:e,l=r.pageX-t,o=r.pageY-a;
1(new Date).getTime()-n<=1e3&&Math.abs(l)>=50&&Math.abs(o)<=50&&(l>0?L():b()),e.preventDefault()}r.addEventListener("mousedown",l),r.addEventListener("mouseup",o),r.addEventListener("touchstart",l),r.addEventListener("touchend",o)}()}(e)}))}));const je=new class{html=document.documentElement;body=document.body;scrollY=0;disabledScroll(){this.scrollY=window.scrollY,this.body.style.top=`-${this.scrollY}px`,this.body.classList.add("no-scroll"),this.html.style.scrollBehavior="unset"}enableScroll(){this.body.removeAttribute("style"),this.body.classList.remove("no-scroll"),window.scrollTo({top:this.scrollY,left:0}),this.html.style.scrollBehavior="smooth"}};function We(){const e=document.querySelector("#user-consent");if(e){const t=document.body;localStorage.getItem("cookieAccept")||localStorage.getItem("cookieReject")||localStorage.getItem("cookieCustomize")||(e.classList.add("user-consent--show"),t.classList.add("lock"));class a{constructor(e){e.addEventListener("click",this.clickBtn.bind(this)),this.switches=["essential information","measurement"]}accept(){document.cookie="cookies_accepted=categories: essential information, measurement, pokerListings promotions, targeted advertising, on screen messaging, external content; path=/; max-age=31536000",e.classList.remove("user-consent--show"),t.classList.remove("lock"),localStorage.setItem("cookieAccept","true")}reject(){document.cookie="cookies_accepted=necessary: essential information, measurement; path=/; max-age=31536000",e.classList.remove("user-consent--show"),t.classList.remove("lock"),localStorage.setItem("cookieReject","true")}customize(){const t=e.querySelector(".user-consent__main"),a=e.querySelector(".user-consent__customize");t.style.display="none",a.style.display="grid"}save(){const a=this.switches.join(", ");document.cookie=`cookies_accepted=categories: ${a}; path=/; max-age=31536000`,e.classList.remove("user-consent--show"),t.classList.remove("lock"),localStorage.setItem("cookieCustomize","true")}toggle(e){const t=e.target.closest(".user-consent__switch"),a=t.dataset.value.toLowerCase();if(t.classList.contains("user-consent__switch--active")){t.classList.remove("user-consent__switch--active");const e=this.switches.findIndex((e=>e===a));-1!==e&&this.switches.splice(e,1)}else t.classList.add("user-consent__switch--active"),this.switches.push(a)}display(e){const t=e.target.closest(".user-consent__accordion-item"),a=e.target.closest(".user-consent__accordion-item-title"),n=t.querySelector(".user-consent__accordion-item-body"),r=t.querySelector(".user-consent__accordion-item-arrow");a.classList.toggle("user-consent__accordion-item-title--active"),n.classList.toggle("user-consent__accordion-item-body--active"),r.classList.toggle("user-consent__accordion-item-arrow--active"),n.addEventListener("transitionend",(()=>{n.scrollIntoView({behavior:"smooth",block:"center"})}),{once:!0})}clickBtn(e){const t=e.target.closest("[data-action]");t&&this[t.dataset.action](e)}}new a(e)}}window.scrollController=je;class Ue{constructor(){this.action="reviews",this.mainContainer=document.querySelector(".main-content--filter-sidebar .filter"),this.currentPage=Number(this.mainContainer.getAttribute("data-current-page")),this.formFields=this.mainContainer.querySelectorAll(".filters input"),this.roomFinderBlock=this.mainContainer.querySelector(".ajax-fill"),this.typeRoomFinder=this.mainContainer.querySelector(".ajax-fill").getAttribute("data-type"),this.loadMoreBtn=this.mainContainer.querySelector(".poker-rooms__show-button"),this.filterTagListContainer=this.mainContainer.querySelector(".filters__result-list"),this.data=new FormData,this.loadMore=!1}request(){this.SetFormData(this.groupFields()),this.HideLoadMore(),fetch(ajaxurl,{method:"POST",dataType:"json",body:this.data}).then((e=>e.text())).then((e=>{e=JSON.parse(e),this.SetCurrentPage(Number(e.page)),e.has_next_page&&this.ShowLoadMore(),1===this.currentPage?this.roomFinderBlock.innerHTML=e.html:this.roomFinderBlock.innerHTML+=e.html})).catch((e=>console.log(e)))}groupFields(e=!0){let t={};return this.formFields.forEach((function(e){("checkbox"!==e.type&&"radio"!==e.type||e.checked)&&(t[e.name]||(t[e.name]=[]),t[e.name].push(e.value))})),e&&(t.page=this.currentPage,t.nonce=nonceCode),t}SetFormData(e){let t=new FormData,a=this.roomFinderBlock.querySelectorAll(".expandable__room"),n=[];for(let e=0;e<a.length;e++)n[e]=a[e].getAttribute("data-i");t.append("action",this.action),t.append("type_of_room",this.typeRoomFinder),t.append("count_post_page",a.length),t.append("excludeID",n),Object.keys(e).map((function(a){t.append(a,e[a])})),this.data=t}ShowLoadMore(){this.loadMoreBtn.style.display="flex"}HideLoadMore(){this.loadMoreBtn.style.display="none"}SetCurrentPage(e){this.mainContainer.dataset.currentPage=e,this.currentPage=e}RenderTagField(){let e=this.groupFields(!1),t=(this.filterTagListContainer.closest(".filters__result").querySelector(".filters__clear"),""),a={};this.formFields.forEach((function(e){a[e.value]=e.closest(".filters__item")}));
1for(let n in e)e[n].forEach((function(e){"vpn"!==n&&(t+='<li class="filters__result-item" data-name="'+e+'">\n <span class="filters__result-item-name"> '+a[e].innerText+' </span>\n <span class="icon-font icon-cross-v2 close-tag"></span>\n </li>')}));this.filterTagListContainer.innerHTML=t,this.showHideClear()}clearFilter(){this.filterTagListContainer.innerHTML="",this.formFields.forEach((function(e){"checkbox"!==e.type&&"radio"!==e.type||"vpn"===e.name||!e.checked||(e.checked=!1),"vpn"===e.name&&"no"===e.value&&(e.checked=!0)})),this.showHideClear()}clearTag(e){let t=e.getAttribute("data-name");this.formFields.forEach((function(e){"checkbox"!==e.type&&"radio"!==e.type||e.value!==t||(e.checked=!1)})),e.remove(),this.showHideClear()}showHideClear(){this.filterTagListContainer.closest(".filters__result").querySelector(".filters__clear").style.display=0===this.filterTagListContainer.innerHTML.length?"none":"inline"}}
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.