"use strict";(self.webpackChunklauncher=self.webpackChunklauncher||[]).push([[8361],{8361:(e,t,r)=>{r.r(t),r.d(t,{useBetPartInput:()=>m,useNumberValidation:()=>s});var n=r(4914),u=r(6295),o=r(3387),i=r(678),a=r(5218);function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,i.useDispatch)(),r=(0,a.shallowSelector)(a.selectUseNumberValidationData),o=r.resources,s=r.minBet,f=r.maxBet,b=(0,n.useMemo)((function(){return Object.values(function(e){for(var t=1;t",notification:{id:12,value:f}}},e))}),[e]);return function(e){var r=b.find((function(t){var r=t.pattern,n=t.operator;return function(e,t,r){switch(t){case"===":return e===r;case"<=":return e<=r;case">=":return e>=r;case">":return e>r;case"<":return ee.length)&&(t=e.length);for(var r=0,n=new Array(t);rP?P:r}))}),[]),E=(0,n.useCallback)((function(e){(f.isDemo||(null==k?void 0:k.type)!==p)&&O((function(t){var r=(0,u.subtractWithPrecision)(+(0,u.toNumberString)(t),e||B,C);return null==j||j(r),rP?P:r}))}),[]),x=(0,n.useCallback)((function(){(f.isDemo||(null==k?void 0:k.type)!==p)&&O((function(e){var t=(0,u.sumWithPrecision)(+(0,u.toNumberString)(e),+(0,u.toNumberString)(e),C);return null==j||j(t),t>=P?P:t<=B?B:t}))}),[]),T=(0,n.useCallback)((function(){if(!V||k.type!==p)if(V&&k.type===v){var e=k.remainingBet;D(e>=P?P:e)}else D(I<=P?I:P)}));(0,n.useEffect)((function(){O(i)}),[i]);var W=(0,n.useCallback)((function(e){var t=e.target.value;e.target.value="",e.target.value=t;var r=e.target.value;if(!(0,u.isValidInputForNumberInput)(e.keyCode)||Number.isNaN(+(0,u.toNumberString)(r)))return e.preventDefault();if(l&&+(0,u.toNumberString)(r)>l)return O(l),e.preventDefault();var n=(0,u.validInputWithEveryCase)(e,C,h);if(n)O(n);else{var o=r.split(".")[1];o&&!C?(o=o.length>C?o.slice(0,C):o,O(+"".concat(Math.floor(r),".").concat(o))):O(r)}}),[i,C,N]),F=(0,n.useCallback)((function(e){var t=e.target.value;l&&+(0,u.toNumberString)(t)>l?O(l):Number.isNaN(+(0,u.toNumberString)(t))||O(t)}),[]);return{inputValue:N,handleSetInputValue:D,handleNumberInputChange:F,handleNumberInputKey:W,incrementBetValue:A,decrementBetValue:E,doubleBetValue:x,handleAllIn:T,numberValue:+(0,u.toNumberString)(N)}}}}]);