1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,571003,794501,831809,510334,855506,269162,746203,501958,557538,189574,889295,109918,891003,182128,416513,261841,171992,81762,617180,147521,516947,761501,662864,594621,139619,833624,e=>{"use strict";let t,n;var r=e.i(271645),a=e.i(160478);e.i(26623);var l=e.i(909850);e.i(327562);let i=new a.default,o=["off","normal","fast"],s=(0,l.createGlobalState)(1),u=(0,l.createGlobalState)(0),c="caseAnimationMode",d=e=>o.includes(e)?e:"normal",p=(0,l.createGlobalState)("normal"),m=(0,r.createContext)("normal"),g=()=>()=>void 0,f=()=>!0,E=()=>!1,h=()=>{let[e,t]=p(),n=(0,r.useContext)(m),a=(0,r.useSyncExternalStore)(g,f,E);return(0,r.useEffect)(()=>{t(d(i.get(c)))},[t]),[a?e:n,e=>{let n=d(e);t(n),i.set(c,n,{path:"/"})}]},S=()=>{let[e,t]=s();return[e,t]},C="/350fx350f";e.s(["CASE_ANIMATION_MODES",0,o,"CaseAnimationModeInitialProvider",0,({children:e,initialMode:t})=>(0,r.createElement)(m.Provider,{value:d(t)},e),"ROULETTE_IMAGE_SIZE",0,384,"ROULETTE_IMAGE_SUFFIX",0,C,"readCaseAnimationModeCookie",0,()=>d(i.get(c)),"useCaseAnimationMode",0,h,"useFreeOpenStickyValue",0,u,"useGameCount",0,S],794501);var y=e.i(247167);e.i(654893);var b=e.i(492055),w=e.i(400943),R=e.i(559815);let M="caseCanvasRoulette",O=new Set(["","auto"]),T=new Set(["0","false","off","disabled","dom"]),v=new Set(["all","canvas","force","forced"]),I=new Set(["1","true","on","enabled"]),_=new Set,x=e=>String(e??"").trim().toLowerCase(),A=(e,t="auto")=>{let n=x(e);return T.has(n)?"off":I.has(n)?"on":v.has(n)?"force":O.has(n)?"auto":t},D=(e,t=!1)=>{let n=String(e??""),r=/iPad|iPhone|iPod/i.test(n)||t&&/Macintosh/i.test(n),a=/Safari/i.test(n)&&/Version\//i.test(n)&&!/Android|CriOS|FxiOS|EdgiOS|OPiOS|Chrome|Chromium/i.test(n);return r&&a},N=({countOpen:e,flagMode:t,isMobile:n,isIosSafari:r})=>"off"!==t&&("on"===t?n&&e>0:"force"===t||r&&e>2),k=A(y.default.env.NEXT_PUBLIC_CASE_CANVAS_ROULETTE??"on","on"),L=k,P=()=>I.has(x("")),F=({flagMode:e,isRendererModeControlEnabled:t=P()})=>t?e:"on",K=e=>{L=e;try{window.localStorage.setItem(M,e)}catch(e){(0,R.reportRecoverableError)(e,"features/open-case/model/case-canvas-roulette-feature-flags.ts#1")}_.forEach(e=>e())},U=(e=P())=>{let[t,n]=(0,r.useState)(k);return(0,r.useEffect)(()=>{let t=()=>n(((e=P())=>{if(!e)return"on";try{let e=window.localStorage.getItem(M);if(null===e)return L;return A(e,L)}catch{return L}})(e));t(),_.add(t);let r=e=>{e.key===M&&t()};return window.addEventListener("storage",r),()=>{_.delete(t),window.removeEventListener("storage",r)}},[e]),[t,K]},G=()=>(({isMobileUserAgent:e,isMobileViewport:t})=>e||t)({isMobileUserAgent:(0,w.useIsMobile)(),isMobileViewport:(()=>{let[e,t]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{if(!window.matchMedia)return;let e=window.matchMedia("(max-width: 1024px)"),n=()=>t(e.matches);return(n(),e.addEventListener)?(e.addEventListener("change",n),()=>e.removeEventListener("change",n)):(e.addListener(n),()=>e.removeListener(n))},[]),e})()}),q=()=>{let e=(0,b.useConfig)(),t=G(),n=e?.userAgent,a=P(),[l]=U(a),[i,o]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"u">typeof navigator&&o("MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)},[]);let s=(0,r.useMemo)(()=>D(n,i),[i,n]),u=F({flagMode:l,isRendererModeControlEnabled:a});return(0,r.useCallback)(e=>N({countOpen:e,flagMode:u,isMobile:t,isIosSafari:s}),[u,s,t])};e.s(["isCaseRouletteRendererModeControlEnabled",0,P,"useCaseCanvasRouletteFlag",0,q,"useCaseRouletteRendererMode",0,()=>{let e=(0,b.useConfig)(),t=G(),[n]=S(),a=P(),[l,i]=U(a),[o,s]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"u">typeof navigator&&s("MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)},[]);let u=(0,r.useMemo)(()=>D(e?.userAgent,o),[e?.userAgent,o]);return[(({countOpen:e,flagMode:t,isIosSafari:n,isMobile:r})=>N({countOpen:e,flagMode:t,isIosSafari:n,isMobile:r})?"canvas":"dom")({countOpen:n,flagMode:F({flagMode:l,isRendererModeControlEnabled:a}),isIosSafari:u,isMobile:t}),(0,r.useCallback)(e=>{i("canvas"===e?t?"on":"force":"off")},[t,i])]}],831809),e.i(183235);var J=e.i(497518);let $=e=>{let t=Number(e);return Number.isFinite(t)?Math.max(0,Math.round(t)):0},H=({openingKey:e,openCases:t,particleCount:n})=>{let r=t.reduce((e,t)=>
1{let n=t.getGame,r=n?.getItem?.price;return e+(e=>{for(let t of e){let e=$(t);if(e>0)return e}return 0})([n?.priceSell,r,n?.price])},0);e&&!(r<=0)&&(0,J.emitHeaderBalanceEffect)({amountMinor:r,applyBalanceDelta:!1,effectKey:`${e}:skin-win`,kind:"skin-win",particleCount:n??t.length,suppressNextBalanceDelta:!0})};e.s(["emitCaseOpeningSellBalanceEffect",0,({amountMinor:e,openingKey:t})=>{let n=$(e);t&&!(n<=0)&&(0,J.emitHeaderBalanceEffect)({amountMinor:n,effectKey:`${t}:sell-transfer`,kind:"sell-transfer"})},"emitCaseOpeningSkinWinBalanceEffect",0,H],510334);var B=e.i(711726);let W="terminal/terminal-jackpot.mp3",j=new Set;e.s(["CASE_JACKPOT_AUDIO_SRC",0,W,"playCaseJackpotStinger",0,({openingKey:e})=>{if(e&&j.has(e))return!1;let t=(0,B.playCriticalAudio)(W,1);return t&&e&&j.add(e),t}],855506);var V=e.i(451088);let X=(e,t,n)=>e.getPropertyValue(t).trim()||n;e.s(["resolveStyleThemeColor",0,X,"withThemeColorAlpha",0,(e,t)=>{let n=e.match(/^#([\da-f]{3}|[\da-f]{6})$/i);if(!n)return e;let r=3===n[1].length?[...n[1]].map(e=>`${e}${e}`).join(""):n[1],a=r.slice(0,2),l=r.slice(2,4),i=r.slice(4,6),o=Math.min(1,Math.max(0,t));return`rgba(${Number.parseInt(a,16)}, ${Number.parseInt(l,16)}, ${Number.parseInt(i,16)}, ${o})`}],269162);let Q=(e,t,n)=>({end:X(e,`--t-rarity-${t}-end`,n.end),start:X(e,`--t-rarity-${t}-start`,n.start)});e.s(["getRouletteCanvasTheme",0,e=>{let t=Q(e,"consumer",{end:V.DEFAULT_THEME_COLORS.rarityConsumerEnd,start:V.DEFAULT_THEME_COLORS.rarityConsumerStart}),n=Q(e,"military",{end:V.DEFAULT_THEME_COLORS.rarityMilitaryEnd,start:V.DEFAULT_THEME_COLORS.rarityMilitaryStart}),r=Q(e,"industrial",{end:V.DEFAULT_THEME_COLORS.rarityIndustrialEnd,start:V.DEFAULT_THEME_COLORS.rarityIndustrialStart}),a=Q(e,"restricted",{end:V.DEFAULT_THEME_COLORS.rarityRestrictedEnd,start:V.DEFAULT_THEME_COLORS.rarityRestrictedStart}),l=Q(e,"classified",{end:V.DEFAULT_THEME_COLORS.rarityClassifiedEnd,start:V.DEFAULT_THEME_COLORS.rarityClassifiedStart}),i=Q(e,"covert",{end:V.DEFAULT_THEME_COLORS.rarityCovertEnd,start:V.DEFAULT_THEME_COLORS.rarityCovertStart}),o=Q(e,"rare",{end:V.DEFAULT_THEME_COLORS.rarityRareEnd,start:V.DEFAULT_THEME_COLORS.rarityRareStart});return{baseBackground:X(e,"--t-bg-consumer",V.DEFAULT_THEME_COLORS.consumer),dimOverlay:X(e,"--t-effects-roulette-canvas-dim-overlay",V.DEFAULT_THEME_COLORS.rouletteCanvasDimOverlay),rarities:{b0c3d9:t,"4b69ff":n,"5e98d9":r,"8847ff":a,d32ce6:l,eb4b4b:i,ffc600:o,ffc700:o,ffd600:o,ffd700:o,e4ae39:o},shadow:X(e,"--t-effects-roulette-canvas-shadow",V.DEFAULT_THEME_COLORS.rouletteCanvasShadow),toneOverlay:X(e,"--t-effects-roulette-canvas-tone-overlay",V.DEFAULT_THEME_COLORS.rouletteCanvasToneOverlay)}}],746203),e.i(156046);var z=e.i(407914);let Y=180,Z=(e,t)=>e?(0,z.withSteamImageSize)(e,t):null,ee=(e,t)=>{let n=new Set;return e.forEach(e=>{let r=Z(e.getGame?.getItem?.getImage,t);r&&n.add(r),e.rouletteItems?.forEach(e=>{let r=Z(e.getImage,t);r&&n.add(r)})}),Array.from(n)},et=(e,t)=>{let n=new Set;return e.forEach(e=>{let r=Z(e.getImage,t);r&&n.add(r)}),Array.from(n)},en=(e,t)=>e.startsWith("/_next/image?")||e.startsWith("data:")||e.startsWith("blob:")?e:`/_next/image?url=${encodeURIComponent(e)}&w=${t}&q=75`,er=(e,t,n)=>new Promise(r=>{if(n?.aborted||"function"!=typeof window.Image)return void r();let a=new window.Image(t,t),l=!1,i=()=>{l||(l=!0,a.src="",a.onload=null,a.onerror=null,n?.removeEventListener("abort",i),r())},o=()=>{l||(l=!0,a.onload=null,a.onerror=null,n?.removeEventListener("abort",i),r())};a.decoding="async",a.loading="eager",a.onload=o,a.onerror=o,n?.addEventListener("abort",i,{once:!0}),a.src=en(e,t),"function"==typeof a.decode&&a.decode().then(o,o)}),ea=async(e,t,n,r)=>{let a=0,l=Math.min(e.length,Math.max(1,Math.floor(n)));await Promise.allSettled(Array.from({length:l},async()=>{for(;a<e.length&&!r?.aborted;){let n=e[a];a+=1,await er(n,t,r)}}))},el=async(e,{concurrency:t=e.length,deadlineMs:n=Y,imageSize:r=384,signal:a}={})=>{if(0===e.length||a?.aborted)return;let l=Array.from(new Set(e)),i=new AbortController,o=()=>i.abort(),s=globalThis.setTimeout(o,n);a?.addEventListener("abort",o,{once:!0});try{await ea(l,r,t,i.signal)}finally{globalThis.clearTimeout(s),a?.removeEventListener("abort",o)}};e.s(["getNextImagePredecodeSource",0,en,"getRouletteImageSources",0,ee,"getRouletteItemImageSources",0,et,"predecodeRouletteImages",0,el],501958);var ei=e.i(613857);let eo=(0,ei.createEvent)("opencase:roulette:settled"),es=(0,ei.createEvent)("opencase:roulette:motion-ready"),eu=(0,ei.createEvent)("opencase:roulette:winner-centered"),ec=(0,ei.createEvent)("opencase:roulette:result-revealed"),ed=(e,t,n="event")=>{null!=t&&e.dispatch({openingKey:t,source:n})},ep=(e,t,n={})=>{let{openingKey:r,signal:a,timeoutMs:l}=n;return a?.aborted?Promise.reject(Error(`Roulette ${t} wait aborted`)):null==r?Promise.reject(Error(`Roulette ${t} wait requires openingKey`)):new Promise((n,i)=>{let o,s=()=>void 0,u=()=>{s(),a?.removeEventListener("abort",c),void 0!==o&&clearTimeout(o)},c=()=>{u(),i(Error(`Roulette ${t} wait aborted`))};s=e.subscribe(e=>{let t=e?.openingKey;(void 0===r||t===r)&&(u(),n(e?.source??"event"))}),a?.addEventListener("abort",c,{once:!0}),null!=l&&(o=setTimeout(()=>{u(),i(Error(`Roulette ${t} wait timed out`))},l))})},em=(e={})=>ep(eo,"settled",e),eg=(e={})=>ep(es,"motion ready",e),ef=(e={})=>ep(eu,"winner centered",e),eE=(e={})=>ep(ec,"result revealed",e);e.s(["areAllRouletteItemsSettled",0,(e,t)=>e>0&&t.size>=e,"emitRouletteMotionReady",0,(e,t)=>{ed(es,e,t)},"emitRouletteResultRevealed",0,(e,t)=>{ed(ec,e,t)},"emitRouletteSettled",0,(e,t)=>{ed(eo,e,t)},"emitRouletteWinnerCentered",0,(e,t)=>{ed(eu,e,t)},"waitForRouletteMotionReady",0,eg,"waitForRouletteResultRevealed",0,eE,"waitForRouletteSettled",0,em,"waitForRouletteWinnerCentered",0,ef],557538);let eh=[1,2,3,4,5],eS=e=>"number"==typeof e&&Number.isInteger(e)&&eh.includes(e),eC=e=>{let t=eS(e)?e:1;return{phase:"stable",stableCount:t,targetCount:t,transition:null,transitionSequence:0}};eC();let ey=(e,t)=>{switch(t.type){case"COUNT_CHANGE_REQUEST":{if(!["idle","error","resultShown"].includes(t.openingPhase))return e;let n=t.countOpen;if(n===e.targetCount)return e;let r="changingCount"===e.phase?e.targetCount:e.stableCount,a=e.transitionSequence+1;return{phase:"changingCount",stableCount:e.stableCount,targetCount:n,transition:{key:`case-count:${a}`,fromCount:r,toCount:n,direction:n>r?"increase":"decrease"},transitionSequence:a}}case"COUNT_TRANSITION_DONE":if("changingCount"!==e.phase||null==e.transition||t.transitionKey!==e.transition.key)return e;return{...e,phase:"stable",stableCount:e.targetCount,transition:null};case"RESET":return eC(t.countOpen);default:return e}};e.s(["caseCountReducer",0,ey,"createInitialCaseCountState",0,eC,"isCaseCountOpen",0,eS],189574);let eb=[1,2,3,4,5],ew=e=>["idle","error"].includes(e.phase),eR=e=>ew(e),eM=e=>"spinning"===e.phase&&e.context.currentOpening?.animationMode!=="off",eO=e=>["revealingResult","resultShown"].includes(e.phase)&&e.context.currentOpening?.isDemo!==!0&&"pending"!==e.context.sellStatus&&e.context.wonGameIds.length>1,eT=e=>["revealingResult","resultShown"].includes(e.phase)&&null!=e.context.resultSnapshot,ev=e=>["resultExitingSell","resultExitingNewGame"].includes(e.phase),eI=e=>e.context.currentOpening?.openingKey??null,e_=e=>["casesExiting","requestingOpen","prewarmingRoulette","rouletteOpening","spinning","quickStopping"].includes(e.phase),ex=e=>["revealingResult","resultShown","sellingResult","resultExitingSell","resultExitingNewGame"].includes(e.phase),eA=e=>ex(e)&&null!=e.context.resultSnapshot;e.s(["canChangeAnimationMode",0,e=>!0,"canChangeCount",0,e=>["idle","error"].includes(e.phase)||"resultShown"===e.phase&&null!=e.context.resultSnapshot&&"pending"!==e.context.sellStatus,"canChangeGameSelection",0,eO,"canExitResultForUi",0,eT,"canOpen",0,ew,"canQuickStop",0,eM,"canSell",0,e=>["revealingResult","resultShown"].includes(e.phase)&&e.context.currentOpening?.isDemo!==!0&&null!=e.context.resultSnapshot&&"pending"!==e.context.sellStatus&&e.context.selectedGameIds.length>0,"canStartNewGame",0,e=>["revealingResult","resultShown"].includes(e.phase)&&null!=e.context.resultSnapshot&&"pending"!==e.context.sellStatus,"canStartOpeningForUi",0,eR,"getFastStopSequence",0,e=>e.context.fastStopSequence,"getGameSelectionState",0,(e,t)=>{let{currentOpening:n,selectedGameIds:r,wonGameIds:a}=e.context;return{visible:eA(e)&&n?.isDemo!==!0&&a.length>1&&a.includes(t),selected:r.includes(t),disabled:!eO(e)}},"getGamesSnapshot",0,e=>e.context.gamesSnapshot,"getOpeningKey",0,eI,"getPreferredCountOpen",0,e=>e.context.preferences.countOpen,"getReturnDirection",0,e=>
1e.context.returnDirection,"getRouletteRenderer",0,e=>e.context.renderer,"getRouletteScenePhase",0,e=>["rouletteOpening","spinning","quickStopping"].includes(e.phase)?"motion":["settlingWinner","revealingResult","resultShown","sellingResult","resultExitingSell","resultExitingNewGame"].includes(e.phase)?"result":"idle","getSelectedGameIds",0,e=>e.context.selectedGameIds,"getSpinDurationMs",0,e=>e.context.spinDurationMs,"isOpeningBeforeResult",0,e=>["casesExiting","requestingOpen","prewarmingRoulette","rouletteOpening","spinning","quickStopping","settlingWinner"].includes(e.phase),"isResultExitingToOpen",0,ev,"isResultVisibleForUi",0,eA,"shouldAbortOpeningOnUnmount",0,e_,"shouldPlayCasePreviewExit",0,e=>["casesExiting","requestingOpen","prewarmingRoulette"].includes(e.phase),"shouldShowCaseActions",0,e=>!ex(e),"shouldShowCasePreview",0,e=>["idle","error","casesExiting","requestingOpen","prewarmingRoulette","casesEntering"].includes(e.phase),"shouldShowResult",0,ex],889295);let eD=e=>({message:e instanceof Error?e.message:"UNEXPECTED_ERROR",cause:e}),eN=(e,t)=>null!=t&&e.context.currentOpening?.requestKey===t,ek=(e,t)=>null!=t&&e.context.currentOpening?.openingKey===t,eL=e=>({...e,currentOpening:null,gamesSnapshot:[],resultSnapshot:null,wonGameIds:[],selectedGameIds:[],error:null,returnDirection:null,rouletteOpened:!1,spinDurationMs:null,spinEasingPoints:null,renderer:"dom",fastStopSequence:0,sellStatus:"idle",lastLifecycleBoundary:null}),eP=e=>({phase:"idle",context:{preferences:{countOpen:e?.countOpen??1,animationMode:e?.animationMode??"on",isDemo:e?.isDemo??!1,caseId:e?.caseId??null},currentOpening:null,gamesSnapshot:[],resultSnapshot:null,wonGameIds:[],selectedGameIds:[],openingSequence:0,error:null,returnDirection:null,rouletteOpened:!1,spinDurationMs:null,spinEasingPoints:null,renderer:"dom",fastStopSequence:0,sellStatus:"idle",lastLifecycleBoundary:null}});eP();let eF=(t=eP(),n=new Set,{getSnapshot:()=>t,setState:e=>{let r="function"==typeof e?e(t):e;r!==t&&(t=r,n.forEach(e=>e()))},subscribe:e=>(n.add(e),()=>{n.delete(e)})}),eK=["idle","casesExiting","requestingOpen","prewarmingRoulette","rouletteOpening","spinning","quickStopping","settlingWinner","revealingResult","resultShown","sellingResult","resultExitingSell","resultExitingNewGame","casesEntering","error"],eU={OPEN_CLICK:["idle","error"],OPEN_SUCCESS:["requestingOpen"],OPEN_ERROR:["requestingOpen"],CASES_EXITED:["casesExiting"],PREWARM_DONE:["prewarmingRoulette"],PREWARM_TIMEOUT:["prewarmingRoulette"],ROULETTE_OPENED:["rouletteOpening"],SPIN_STARTED:["rouletteOpening"],FAST_STOP_CLICK:["spinning"],ROULETTE_SETTLED:["spinning","quickStopping"],WINNER_CENTERED:["settlingWinner"],RESULT_REVEALED:["revealingResult"],SELL_CLICK:["revealingResult","resultShown"],SELL_SUCCESS:["sellingResult","resultExitingSell"],SELL_ERROR:["revealingResult","resultShown","sellingResult"],GAME_SELECTION_TOGGLED:["revealingResult","resultShown"],NEW_GAME_CLICK:["revealingResult","resultShown"],RESULT_EXITED:["resultExitingSell","resultExitingNewGame"],CASES_ENTERED:["casesEntering"],COUNT_CHANGED:["idle","error","resultShown"],ANIMATION_MODE_CHANGED:eK,ABORT:eK.filter(e=>"idle"!==e),RESET:eK},eG=e=>eU[e];var eq=e.i(702745);e.i(629588);var eJ=e.i(681759);let e$=(0,ei.createEvent)("opencase:case-jackpot"),eH=(0,ei.createEvent)("opencase:case-jackpot-cancel"),eB={beatMs:150,stingerMs:150,crackMs:150,crackDurationMs:260,burstMs:150,burstDurationMs:480,shockwaveMs:150,shockwaveDurationMs:720,haloMs:150,haloDurationMs:7800,headlineMs:150,headlineDurationMs:550,headlineOutMs:8600,headlineOutDurationMs:600,announceMs:400,scanMs:400,scanDurationMs:720,countMs:500,countDurationMs:2200,oneInMs:2700,oneInDurationMs:300,landingMs:3500,landingDurationMs:720,particlesStartMs:300,particlesEndMs:7e3,overlayFadeMs:8600,overlayFadeDurationMs:600,totalMs:9200,rimRotationMs:2400},eW={minMs:2e3,minResizePx:8,restMs:100,restPx:3,fallbackMs:eB.landingMs,maxMs:4500},ej=["sliver","shard","spark"],eV={shard:10,sliver:16,spark:6,streak:26},eX=e=>{if("number"!=typeof e&&"string"!=typeof e)return null;let t=Number(e);return Number.isFinite(t)?t:null},eQ=e=>{let t=eX(e);return null===t||t<=0?null:Math.round(t)},ez=e=>"string"==typeof e&&e.trim().length>0?e:null,eY=e=>e.flatMap(e=>{let t,n=(e=>{let t;if(!e||"object"!=typeof e)return null;let n=eQ(e.amount);
1if(null===n||"item"!==(t=e.kind)&&"money"!==t)return null;let r=eX(e.oneIn),a=eX(e.poolBalanceAfter);return{amountMinor:n,itemId:eQ(e.itemId),itemImage:ez(e.itemImage),itemName:ez(e.itemName),kind:e.kind,oneIn:null!==r&&r>0?r:null,poolBalanceAfter:null!==a?Math.round(a):null}})(e.jackpot),r=null===(t=eX(e.getGame?.id))||0===Math.round(t)?null:Math.round(t);if(!n||null===r)return[];let a=e.jackpot.devAnimationVariant,l=r<0&&("variant-1"===a||"variant-2"===a||"variant-3"===a||"variant-7"===a||"variant-8"===a||"variant-9"===a)?a:null;return[{...l?{animationVariant:l}:{},amountMinor:n.amountMinor,gameId:r,itemName:n.itemName,kind:n.kind,oneIn:n.oneIn}]}),eZ=({amountMinor:e,durationMs:t,elapsedMs:n})=>{let r;if(t<=0||n>=t)return e;if(n<=0)return 0;let a=10**(2-(0==(r=Math.round(e)%100)?0:r%10==0?1:2)),l=Math.round(e*(1-(1-n/t)**3)/a)*a;return a<100&&l%(10*a)==0?l+a:l},e0=null,e1=()=>e0,e5=e=>{e0=e,e$.dispatch(e)},e2=()=>{e0=null,eH.dispatch()},e8=e=>eH.subscribe(e),e6=e=>e$.subscribe(t=>{t&&e(t)}),e4=(e,t)=>e?.cards.find(e=>e.gameId===t)??null;e.s(["CASE_JACKPOT_HEADLINE_GAP_PX",0,24,"CASE_JACKPOT_LANDING",0,eW,"CASE_JACKPOT_LANE_SELECTOR",0,".case-play-slider","CASE_JACKPOT_TIMELINE",0,eB,"CASE_RESULT_CARD_ATTR",0,"data-case-result-card","buildCaseJackpotCelebrationPresentation",0,({cardRect:e,effectKey:t,isMobile:n,laneRect:r,prefersReducedMotion:a,viewportWidth:l})=>{let i=e.left+e.width/2,o=e.top+e.height/2,s={cx:i,cy:o,radiusX:.75*e.width,radiusY:.75*e.height},u={left:r?.left??0,top:o,width:r?.width??l},c=n?{cx:i,placement:"below",top:e.top+e.height+24}:{cx:i,placement:"above",top:e.top-24};return a?{announceAtMs:0,card:e,crack:u,headline:c,isMobile:n,isStatic:!0,particles:[],spotlight:s,stingerAtMs:0,totalMs:eB.headlineOutMs}:{announceAtMs:eB.announceMs,card:e,crack:u,headline:c,isMobile:n,isStatic:!1,particles:(({cardRect:e,effectKey:t,isMobile:n,viewportWidth:r})=>{let a=n?.8:1,l=e=>e%6==5?"streak":ej[e%ej.length],i=Math.min(14,.08*e.width);return(0,eq.buildTopLandingParticles)({count:n?30:72,durationMs:e=>900+e%4*120,effectKey:t,getDelayMs:e=>eB.particlesStartMs+7*e%48*120,getSizePx:(e,t)=>Math.round(eV[l(t)]*a),maxX:r-8,minX:8,rect:e,rotateDeg:(e,t)=>t*(24+e%6*11),startTopOffsetPx:n?90:140}).map((n,a)=>{let o=a%2==0?1:-1,s=Math.max(0,e.width-2*i),u=e.left+i+61*a%97/97*s,c=e.top+e.height*(.35+29*a%41/41*.4),d=Math.min(r-8,Math.max(8,u+o*(10+a%5*6))),p=d+(u-d)*.54+n.arcX,m=n.fromY+(c-n.fromY)*.58;return{...n,fromX:d,id:`${t}:particle:${a}`,midX:p,midY:m,shape:l(a),toX:u,toY:c}})})({cardRect:e,effectKey:t,isMobile:n,viewportWidth:l}),spotlight:s,stingerAtMs:eB.stingerMs,totalMs:eB.totalMs}},"cancelCaseJackpotCelebration",0,e2,"createCaseJackpotLandingDetector",0,(e=eW)=>{let t=[],n=null,r=0,a=!1,l=!1;return{push:(i,o)=>{let s;if(l)return null;for(n&&o>=e.minMs&&(r+=Math.abs(i.width-n.width)+Math.abs(i.height-n.height),!a&&r>=e.minResizePx&&(a=!0)),n=i,t.push({at:o,rect:i});t.length>1&&t[1].at<=o-e.restMs;)t.shift();let u=t[0],c=u.at<=o-e.restMs&&(s=u.rect,Math.max(Math.abs(s.left-i.left),Math.abs(s.top-i.top),Math.abs(s.width-i.width),Math.abs(s.height-i.height))<=e.restPx);return o>=e.maxMs||(a?c:o>=e.fallbackMs&&c)?(l=!0,o):null}}},"emitCaseJackpotCelebration",0,e5,"findCaseJackpotCard",0,e4,"formatCaseItemChance",0,e=>{let t="number"==typeof e?e:"string"==typeof e&&""!==e.trim()?Number(e):NaN;return!Number.isFinite(t)||t<=0?null:t<.001?"< 0.001":String(Number(t.toFixed(3)))},"formatCaseJackpotAmount",0,({amountMinor:e,currency:t,locale:n})=>(0,eJ.formatPriceText)({sum:Math.max(0,e),currency:t,locale:n,separator:""}),"getCaseJackpotCelebrationCards",0,eY,"getCaseJackpotCountUpValue",0,eZ,"getCaseJackpotParticleFrame",0,(e,t)=>{if(e.durationMs<=0)return null;let n=(t-e.delayMs)/e.durationMs;if(n<0||n>=1)return null;let r=n**1.7,a=1-r,l=a*a*e.fromX+2*a*r*e.midX+r*r*e.toX,i=a*a*e.fromY+2*a*r*e.midY+r*r*e.toY;return{opacity:Math.max(0,Math.min(1,n<.1?n/.1*.85:n<.78?.85+(n-.1)/.68*.15:(1-n)/.21999999999999997)),rotateDeg:e.rotateDeg*a,scale:.6+.5*r,x:l,y:i}},"getLastCaseJackpotCelebration",0,e1,"subscribeCaseJackpotCancel",0,e8,"subscribeCaseJackpotCelebration",0,e6],109918);let e9=({openCases:e,openingKey:t})=>{if(!t)return!1;let n=eY(e);return 0!==n.length&&(e5({cards:n,effectKey:`${t}:jackpot`,openingKey:t}),!0)};e.s(["WINNER_SLIDER_FIX_OFFSET",0,55,"WINNER_SLOT_INDEX",0,70,"calcOffsetFromMeasuredSlotCenter",0,(e,t)=>e-t,"calcPrizeIndexOffset",0,({prizeItemSize:e,wripperSize:t,countOpen:n,isMobile:r=!1})=>{let a=72*e-(t/2-e/2);return n<=5&&(a-=e/1.5),r&&n>2&&(a+=e+10),a}],891003);let e3=e=>({id:Number(e.id??0),getName:String(e.getName??""),getImage:String(e.getImage??""),color:e.color??null,quality:e.quality??null,price:Number(e.price??0),skeletonShape:e.skeletonShape??null}),e7=(e,t)=>{let n=[...e];for(let e=n.length-1;e>0;e-=1){let r=Math.floor(t()*(e+1));[n[e],n[r]]=[n[r],n[e]]}return n}
1,te=(e,t,n)=>e7(e,n).slice(0,t),tt=({caseItems:e,casePrice:t,seed:n,winningItem:r})=>{let a,l=r?[e3(r)]:[],i=(e.length?e:l).map(e3).filter(e=>e.id>0&&e.getImage&&e.getName);if(0===i.length)return[];let o=Number(t)||0,s=(a=(e=>{let t=0x811c9dc5;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,0x1000193);return t>>>0})(n),()=>{let e=a=a+0x6d2b79f5>>>0;return e=Math.imul(e^e>>>15,1|e),(((e^=e+Math.imul(e^e>>>7,61|e))^e>>>14)>>>0)/0x100000000}),u=i.filter(e=>e.price<o),c=i.filter(e=>e.price>=o&&e.price<2*o),d=i.filter(e=>e.price>=2*o),p=u.length?u:i,m=c.length?c:i,g=d.length?d:i,f=[];for(;f.length<80;)f=f.concat(te(p,10,s),te(m,15,s),te(g,8,s));let E=e7(f.slice(0,80).concat(te(g,5,s)),s),h=[];for(;E.length<=70;){0===h.length&&(h=e7(i,s));let e=h.pop();e&&E.push(e)}return r&&(E[70]=e3(r)),E},tn=({caseId:e,caseItems:t,casePrice:n,openCases:r})=>r.map((r,a)=>({...r,rouletteItems:tt({caseItems:t??[],casePrice:n,seed:`${e}:${r.getGame.id}:${a}`,winningItem:r.getGame.getItem})})),tr=({rouletteItems:e,winningItem:t,isMobile:n})=>{if(!n)return[...e];let r=t?e3(t):e[70]??e[0];if(!r)return[];let a=e.length?e:[r],l=Array.from({length:48},(e,t)=>a[t%a.length]??r);return l[42]=r,l};e.s(["buildDisplayRouletteItems",0,tr,"buildOpenCaseRouletteItems",0,tn,"buildRouletteItems",0,tt,"getRouletteWinnerSlotIndex",0,({isMobile:e})=>e?42:70],182128);let ta={countClick:{policy:"allow-repeat",src:"case/case_quantity_button_click.ogg",volume:.42},countAdd:{policy:"allow-repeat",src:"upgrade/pick-target-item.mp3",volume:.38},countRemove:{policy:"allow-repeat",src:"upgrade/remove.mp3",volume:.32},openClick:{policy:"once-per-opening",src:"ui/12.mp3",volume:.2},rouletteTick:{policy:"allow-repeat",src:"case/roulette-start-2-tight.wav",volume:.1},rouletteStop:{critical:!0,policy:"once-per-opening",src:"case/cs_stinger.wav",volume:.58},resultSellSuccess:{critical:!0,policy:"once-per-opening",src:"upgrade/sold.mp3",volume:.9},resultNewGame:{policy:"once-per-opening",src:"case/new-game.mp3",volume:.7}},tl=[...new Set([...Object.values(ta).map(({src:e})=>e),W,"ui/2.mp3","ui/4.wav","ui/7.mp3","upgrade/5.wav"])],ti=new Set,to=null,ts=null,tu=null,tc=!1,td=()=>{let e=window,t=window.AudioContext??e.webkitAudioContext;return t?to??=new t:null},tp=()=>{if(ts||tu||tc||"function"!=typeof window.fetch)return tu;let e=td();if(!e)return null;let{src:t}=ta.rouletteTick;return tu=window.fetch(`/audio/${t}`,{cache:"force-cache"}).then(e=>e.arrayBuffer()).then(t=>new Promise((n,r)=>{let a=e.decodeAudioData(t.slice(0),n,r);a?.then(n,r)})).then(e=>(ts=e,e),()=>(tc=!0,null)).finally(()=>{tu=null})},tm=()=>{let e=window;return{cancelIdleCallback:e.cancelIdleCallback?.bind(e),clearTimeout:window.clearTimeout.bind(window),requestIdleCallback:e.requestIdleCallback?.bind(e),setTimeout:window.setTimeout.bind(window)}},tg=()=>{(0,B.prefetchAudio)(...tl),tp()},tf=({prefetchSounds:e=tg,scheduler:t=tm()}={})=>{if(!t)return;let n=!1,r=null,a=null,l=()=>{n||e()};return"function"==typeof t.requestIdleCallback&&"function"==typeof t.cancelIdleCallback?r=t.requestIdleCallback(l,{timeout:1200}):a=t.setTimeout(l,250),()=>{n||(n=!0,null!==r&&t.cancelIdleCallback&&t.cancelIdleCallback(r),null!==a&&t.clearTimeout(a))}},tE=(e,t)=>{var n;let r=ta[e],a=null!=t&&"object"==typeof t&&("event"in t||"force"in t||"openingKey"in t)?t:{event:t??null},l=(n=a.openingKey,"allow-repeat"!==r.policy&&n?`${n}:${e}`:null);if(l&&!a.force&&ti.has(l))return!1;if("rouletteTick"===e){let e=(e=>{let t=td();if(!t)return null;if(!ts)return tc?null:(tp(),!1);"suspended"===t.state&&t.resume();let n=t.createBufferSource(),r=t.createGain();return n.buffer=ts,r.gain.value=e,n.connect(r),r.connect(t.destination),n.onended=()=>{n.disconnect(),r.disconnect()},n.start(),!0})(r.volume);if(null!==e)return e}if(r.critical&&(0,B.playCriticalAudio)(r.src,r.volume))return l&&ti.add(l),!0;let i=(0,B.playAudio)(a.event??null,r.src,r.volume);return!1!==i&&l&&ti.add(l),!1!==i};e.s(["CASE_OPENING_PREFETCH_AUDIO",0,tl,"playCaseOpeningSound",0,tE,"prefetchCaseOpeningSounds",0,tg,"scheduleCaseOpeningRouletteTicks",0,e=>{let t=new Set;
1return e.forEach(e=>{let n=globalThis.setTimeout(()=>{t.delete(n),tE("rouletteTick")},e);t.add(n)}),()=>{t.forEach(e=>{globalThis.clearTimeout(e)}),t.clear()}},"scheduleCaseOpeningSoundPrewarm",0,tf],416513);let th={concurrency:6,deadlineMs:5e3,fallbackDelayMs:250,idleTimeoutMs:1200,requireCancelableIdle:!1},tS={concurrency:3,deadlineMs:1600,fallbackDelayMs:0,idleTimeoutMs:1e3,requireCancelableIdle:!0},tC=()=>{let e=window;return{cancelIdleCallback:e.cancelIdleCallback?.bind(e),clearTimeout:window.clearTimeout.bind(window),requestIdleCallback:e.requestIdleCallback?.bind(e),setTimeout:window.setTimeout.bind(window)}},ty=({imageSize:e,imageSuffix:t,items:n,predecodeImages:r=el,scheduler:a=tC()},l)=>{let i=et(n,t);if(0===i.length||!a)return;let o=new AbortController,s=null,u=null,c=()=>{o.signal.aborted||r(i,{concurrency:l.concurrency,deadlineMs:l.deadlineMs,imageSize:e,signal:o.signal})};"function"==typeof a.requestIdleCallback&&(!l.requireCancelableIdle||"function"==typeof a.cancelIdleCallback)&&a.requestIdleCallback?s=a.requestIdleCallback(c,{timeout:l.idleTimeoutMs}):u=a.setTimeout(c,l.fallbackDelayMs);let d=!1;return()=>{d||(d=!0,o.abort(),null!==s&&a.cancelIdleCallback&&a.cancelIdleCallback(s),null!==u&&a.clearTimeout(u))}},tb=async({imageSize:e,imageSuffix:t,isMobile:n,openCases:r,predecodeImages:a=el,previewExitMs:l,previewExitStartedAt:i,signal:o,sleep:s})=>{let u=ee(n?r.map(e=>({...e,rouletteItems:tr({rouletteItems:e.rouletteItems,winningItem:e.getGame.getItem,isMobile:n})})):r,t),c=Math.min(90,Math.max(0,l-Math.max(0,(globalThis.performance?.now?.()??Date.now())-i)));if(c<=0)return"timeout";let d=a(u,{deadlineMs:c,imageSize:e,signal:o}).then(()=>"done").catch(e=>{if(o.aborted)throw e;return"timeout"});return(async()=>{let e=await Promise.race([d,Promise.resolve("pending")]);return"pending"!==e?e:Promise.race([d,s(c,o).then(()=>"timeout")])})()};e.s(["predecodeRouletteOpeningImages",0,tb,"scheduleCasePageOpeningPrewarm",0,({scheduleSoundPrewarm:e=tf,...t})=>{let n=ty(t,th),r=e();if(n||r)return()=>{n?.(),r?.()}},"scheduleCasePreviewRouletteImagePrewarm",0,e=>ty(e,tS)],261841);let tw=null,tR=(0,l.createGlobalState)(eC());e.s(["useCaseCountMachine",0,()=>{var e;let t,[n,a]=tR();e=n.transition,t=(0,r.useRef)(null),(0,r.useEffect)(()=>{if(null==e){tw=null;return}t.current!==e.key&&tw!==e.key&&(t.current=e.key,tw=e.key,tE("increase"===e.direction?"countAdd":"countRemove"))},[e]);let l=(0,r.useCallback)(e=>{a(t=>ey(t,e))},[a]),i=(0,r.useCallback)((e,t)=>{l({type:"COUNT_CHANGE_REQUEST",countOpen:e,openingPhase:t})},[l]),o=(0,r.useCallback)(e=>{l({type:"COUNT_TRANSITION_DONE",transitionKey:e})},[l]),s=(0,r.useCallback)(e=>{l({type:"RESET",countOpen:e})},[l]);return{completeTransition:o,dispatch:l,requestChange:i,reset:s,state:n}}],171992);let tM=new Set(["0","false","off","disabled"]),tO=new Set(["1","true","on","enabled"]),tT={transitionLoggingEnabled:((e,t=!0)=>{let n=String(e??"").trim().toLowerCase();return!tM.has(n)&&(!!tO.has(n)||t)})(y.default.env.NEXT_PUBLIC_CASE_OPENING_MACHINE_TRANSITION_LOG,!1)},tv=()=>{let e=(0,r.useSyncExternalStore)(eF.subscribe,eF.getSnapshot,eF.getSnapshot);return{state:e,dispatch:(0,r.useCallback)(e=>{eF.setState(t=>((e,t,n={})=>{var r;let a,l,i,o=function(e,t){switch(t.type){case"COUNT_CHANGED":if(!["idle","error","resultShown"].includes(e.phase))return e;return{...e,context:{...e.context,preferences:{...e.context.preferences,countOpen:t.countOpen}}};case"ANIMATION_MODE_CHANGED":return{...e,context:{...e.context,preferences:{...e.context.preferences,animationMode:t.animationMode}}};case"OPEN_CLICK":{var n;let r,a,l;if(!["idle","error"].includes(e.phase))return e;let i=e.context.openingSequence+1,o=t.isDemo??e.context.preferences.isDemo,s={countOpen:"number"==typeof(r=n=t.countOpen??e.context.preferences.countOpen)&&Number.isInteger(r)&&eb.includes(r)?n:1,animationMode:t.animationMode??e.context.preferences.animationMode,isDemo:o,caseId:void 0!==t.caseId?t.caseId:e.context.preferences.caseId},u={...s,requestKey:t.requestKey??(a=e.context.openingSequence,`request:${a+1}`),openingKey:t.openingKey??(l=e.context.openingSequence,`opening:${l+1}`)};return{phase:"casesExiting",context:{...e.context,preferences:s,currentOpening:u,gamesSnapshot:[],resultSnapshot:null,wonGameIds:[],selectedGameIds:[],openingSequence:i,error:null,returnDirection:null,rouletteOpened:!1,spinDurationMs:null,spinEasingPoints:null,renderer:t.renderer??"dom",fastStopSequence:0,sellStatus:"idle",lastLifecycleBoundary:null}}}case"CASES_EXITED":if("casesExiting"!==e.phase)return e;return{...e,phase:"requestingOpen"};case"OPEN_SUCCESS":{if("requestingOpen"!==e.phase||!eN(e,t.requestKey)||null==e.context.currentOpening)return e;let n=e.context.currentOpening,r=t.selectedGameIds??t.gamesSnapshot.map(e=>Number(e.gameId)).filter(e=>Number.isSafeInteger(e)&&e>0);return{phase:"off"===n.animationMode?"revealingResult":"prewarmingRoulette",context:{...e.context,currentOpening:n,gamesSnapshot:t.gamesSnapshot,resultSnapshot:t.resultSnapshot,wonGameIds:r,selectedGameIds:r,error:null,rouletteOpened:!1}}}case"OPEN_ERROR":if("requestingOpen"!==e.phase||!eN(e,t.requestKey))return e;return{phase:"error",context:{...e.context,error:eD(t.error)}};case"PREWARM_DONE":case"PREWARM_TIMEOUT":if("prewarmingRoulette"!==e.phase||!ek(e,t.openingKey))return e;return{...e,phase:"rouletteOpening"};case"ROULETTE_OPENED":if("rouletteOpening"!==e.phase||!ek(e,t.openingKey))return e;return{...e,context:{...e.context,rouletteOpened:!0}};case"SPIN_STARTED":if("rouletteOpening"!==e.phase||!e.context.rouletteOpened||!ek(e,t.openingKey))return e;return{...e,phase:"spinning",context:{...e.context,spinDurationMs:t.spinDurationMs??null,spinEasingPoints:t.spinEasingPoints??null,lastLifecycleBoundary:{type:t.type,openingKey:t.openingKey??null,source:t.source??"event"}}};case"FAST_STOP_CLICK":if("spinning"!==e.phase)return e;return{phase:"quickStopping",context:{...e.context,fastStopSequence:e.context.fastStopSequence+1}};case"ROULETTE_SETTLED":if(!["spinning","quickStopping"].includes(e.phase)||!ek(e,t.openingKey))return e;return{...e,phase:"settlingWinner",context:{...e.context,lastLifecycleBoundary:{type:t.type,openingKey:t.openingKey??null,source:t.source??"event"}}};case"WINNER_CENTERED":if("settlingWinner"!==e.phase||!ek(e,t.openingKey))return e;
1return{...e,phase:"revealingResult",context:{...e.context,lastLifecycleBoundary:{type:t.type,openingKey:t.openingKey??null,source:t.source??"event"}}};case"RESULT_REVEALED":if("revealingResult"!==e.phase||!ek(e,t.openingKey))return e;return{...e,phase:"resultShown",context:{...e.context,lastLifecycleBoundary:{type:t.type,openingKey:t.openingKey??null,source:t.source??"event"}}};case"SELL_CLICK":if(!["revealingResult","resultShown"].includes(e.phase)||!ek(e,t.openingKey)||e.context.currentOpening?.isDemo===!0||0===e.context.selectedGameIds.length)return e;return{phase:"sellingResult",context:{...e.context,returnDirection:"sell",sellStatus:"pending"}};case"SELL_SUCCESS":if(!["sellingResult","resultExitingSell"].includes(e.phase)||!ek(e,t.openingKey))return e;return{phase:"resultExitingSell",context:{...e.context,sellStatus:"succeeded"}};case"SELL_ERROR":if(!["revealingResult","resultShown","sellingResult"].includes(e.phase)||!ek(e,t.openingKey))return e;return{phase:"resultShown",context:{...e.context,error:eD(t.error),returnDirection:null,sellStatus:"failed"}};case"GAME_SELECTION_TOGGLED":{let{wonGameIds:n}=e.context;if(!eO(e)||!ek(e,t.openingKey)||!n.includes(t.gameId))return e;let r=e.context.selectedGameIds,a=r.includes(t.gameId);return{...e,context:{...e.context,selectedGameIds:n.filter(e=>e===t.gameId?!a:r.includes(e))}}}case"NEW_GAME_CLICK":if(!["revealingResult","resultShown"].includes(e.phase)||!ek(e,t.openingKey))return e;return{phase:"resultExitingNewGame",context:{...e.context,returnDirection:"new-game",sellStatus:"idle"}};case"RESULT_EXITED":if(!["resultExitingSell","resultExitingNewGame"].includes(e.phase)||!ek(e,t.openingKey))return e;return{...e,phase:"casesEntering"};case"CASES_ENTERED":if("casesEntering"!==e.phase||!ek(e,t.openingKey))return e;return{phase:"idle",context:eL(e.context)};case"ABORT":if("idle"===e.phase)return e;return{phase:"idle",context:eL(e.context)};case"RESET":return eP();default:return e}}(e,t),s={...i={eventType:t.type,fromPhase:e.phase,toPhase:o.phase,accepted:o!==e,allowedFromPhases:eG(t.type),currentOpeningKey:e.context.currentOpening?.openingKey??null,eventOpeningKey:(e=>{if(!("openingKey"in e))return null;let{openingKey:t}=e;return"string"==typeof t?t:null}
1)(t),currentRequestKey:e.context.currentOpening?.requestKey??null,eventRequestKey:(e=>{if(!("requestKey"in e))return null;let{requestKey:t}=e;return"string"==typeof t?t:null})(t)},reason:(r=i).accepted?"accepted":(a=r.eventType,l=r.fromPhase,eG(a).includes(l))?null!=r.eventOpeningKey&&r.currentOpeningKey!==r.eventOpeningKey||null!=r.eventRequestKey&&r.currentRequestKey!==r.eventRequestKey?"stale-key":"guard-blocked":"invalid-phase"};return!0!==n.enabled||s.accepted&&!0!==n.logAccepted||(n.logger??(e=>{"u">typeof console&&console.debug("[case-opening-machine] transition",e)}))(s),o})(t,e,{enabled:tT.transitionLoggingEnabled}))},[]),reset:(0,r.useCallback)(e=>{eF.setState(eP(e))},[])}};e.s(["useCaseOpeningMachine",0,tv],81762);var tI=e.i(276320),t_=e.i(514089),tx=e.i(678626),tA=e.i(948148);let tD="cscasedev.dev",tN=e=>{let t=Number(e);return Number.isFinite(t)&&t>0?t:null},tk=e=>null!==tN(e.id)&&!!e.getImage&&!!e.getName,tL=(e,t)=>{let n=((e,t)=>{let n=e.filter(tk);if(void 0!==t.itemId)return n.find(e=>Number(e.id)===t.itemId)??null;if(void 0!==t.itemName){let e=t.itemName.trim().toLowerCase();return n.find(t=>String(t.getName).toLowerCase().includes(e))??null}return n.reduce((e,t)=>null===e||Number(t.price??0)>Number(e.price??0)?t:e,null)})(e,t);if(!n)return null;let r=Number(n.id),a=Math.max(0,Math.round(Number(n.price??0))),l=tN(t.amount),i=tN(t.oneIn);return{item:{id:r,name:String(n.getName),price:a,quality:n.quality??null},itemId:r,jackpot:{...t.animationVariant?{devAnimationVariant:t.animationVariant}:{},amount:null!==l?Math.round(l):a,itemId:r,itemImage:n.getImage??null,itemName:String(n.getName),kind:t.kind??"item",oneIn:i,poolBalanceAfter:null}}},tP=null,tF=e=>{tP=e},tK=()=>{let e=tP;return tP=null,e},tU=()=>{let e=null!==tP;return tP=null,e};e.s(["armCaseJackpotDevDrop",0,tF,"buildCaseJackpotDevDrop",0,tL,"consumeCaseJackpotDevDrop",0,tK,"disarmCaseJackpotDevDrop",0,tU,"isCaseJackpotDevToolsEnabled",0,({hostname:e,nodeEnv:t})=>{if("production"!==t)return!0;let n=String(e??"").trim().toLowerCase().split(":")[0];return"localhost"===n||n===tD||n.endsWith(`.${tD}`)}],617180);var tG=e.i(527348),tq=e.i(958462),tJ=e.i(625305),t$=e.i(218238),tH=e.i(515102);let tB=e=>{let t=Number(e);return Number.isFinite(t)?t:0},tW=({countOpen:e,needToOpenForFree:t,userOpenForFree:n})=>{let r=Math.max(0,Math.trunc(tB(e))),a=Math.max(0,Math.trunc(tB(t)));if(0===r||0===a)return r;let l=Math.floor((Math.max(0,Math.trunc(tB(n)))+r)/a);return Math.max(0,r-l)};e.i(506744);var tj=e.i(162685),tV=e.i(197206),tX=e.i(556624),tQ=e.i(892805),tz=e.i(138413),tY=e.i(922691),tZ=e.i(462115),t0=e.i(678616);function t1(e,t){let n=e?.type===8&&t?.enabled!==!1,{data:r}=(0,tY.useGetFreeCasesInfo)({enabled:n}),a=(0,t0.useMountedAfterHydration)(),{data:l}=(0,tz.useQuery)(tZ.GET_FREE_CASES_PERSONAL_STATE_QUERY,{skip:!n||!a,fetchPolicy:"cache-only"});return function(e){let{getCase:t,info:n,personalState:r}=e,a=t?.type===8,l=n?.cases?.find(e=>e.id===t?.id)??void 0,i=r?.cases?.find(e=>e.id===t?.id)??void 0,o=n?.deposit48h??r?.deposit48h??0,s=l?.depositThreshold??t?.depositThreshold??0,u=o>=s,c=l?.promoAvailable??i?.promoAvailable??t?.promoAvailable,d=l?.opened??i?.opened??t?.opened,p=l?.canOpen??i?.canOpen;return{alreadyOpened:d,canOpen:null!=p?p:u&&!d,deposit48h:o,depositThreshold:s,freeCaseDetails:l,hasEnoughDeposit:u,isFreeDepositCase:a,isPersonalStateResolved:!!(l||i),promoAvailable:c}}({getCase:e,info:r?.getFreeCasesInfo,personalState:l?.getFreeCasesPersonalState})}e.s(["useFreeDepositCaseState",0,t1],147521);var t5=e.i(765036);let t2=async(e,t)=>{try{return await e??"event"}catch(e){if(t.aborted)throw e;return"timeout"}}
1,t8=async({dispatchOpeningEvent:e,openingKey:t,playStopAudio:n,playStopAudioBeforeSettledDispatch:r=!0,resultRevealTimeoutMs:a,settledTimeoutMs:l,signal:i,stopAudioDelayMs:o,waitForResultRevealed:s=eE,waitForSettled:u=em,waitForWinnerCentered:c=ef,winnerCenterTimeoutMs:d,onSettled:p})=>{let m=null,g=!1,f=()=>{null!==m&&(globalThis.clearTimeout(m),m=null)},E=()=>{g||!1!==n()&&(g=!0)};null!=o&&r&&(m=globalThis.setTimeout(()=>{m=null,E()},o));try{let n=await t2(u({openingKey:t,signal:i,timeoutMs:l}),i);f(),r&&E(),e({type:"ROULETTE_SETTLED",openingKey:t,source:n}),r||E(),p?.();let o=await t2(c({openingKey:t,signal:i,timeoutMs:d}),i);E(),e({type:"WINNER_CENTERED",openingKey:t,source:o});let m=await t2(s({openingKey:t,signal:i,timeoutMs:a}),i);e({type:"RESULT_REVEALED",openingKey:t,source:m})}finally{f()}};var t6=e.i(814416);e.i(543596);var t4=e.i(532548);let t9=new Set([0,1,2]),t3=({caseCategory:e,casePrice:t,openCases:n})=>{let r=Number(t);return!!t9.has("number"==typeof e?e:NaN)&&!!Number.isFinite(r)&&!(r<=0)&&n.some(e=>{let t=Number(e.getGame?.getItem?.price);return Number.isFinite(t)&&100*t>115*r})},t7=async({caseCategory:e,casePrice:t,caseType:n,isDemo:r,openCases:a,showModal:l,refetch:i,setDemoCookie:o})=>{try{if(r){let[e]=a;e&&l("DemoPrizeModal",{getGame:e,getGames:a});return}(({isDemo:e,caseType:t})=>!e&&3===t)({isDemo:r,caseType:n})?(t3({caseCategory:e,casePrice:t,openCases:a})&&l("LuckyShotDepositModal"),await i()):t3({caseCategory:e,casePrice:t,openCases:a})&&l("LuckyShotDepositModal")}finally{o(!1)}},ne=e=>{let t=Number(e);return Number.isFinite(t)?t:0};class nt extends Error{constructor(){super("Case open flow aborted"),this.name="AbortError"}}let nn=e=>e instanceof nt||e instanceof Error&&"AbortError"===e.name,nr=(e,t)=>t?.aborted?Promise.reject(new nt):new Promise((n,r)=>{let a={},l=!1;function i(){null!=a.id&&globalThis.clearTimeout(a.id),t?.removeEventListener("abort",o)}function o(){l||(l=!0,i(),r(new nt))}(t?.addEventListener("abort",o,{once:!0}),t?.aborted)?o():a.id=globalThis.setTimeout(()=>{l||(l=!0,i(),n())},e)}),na=e=>{if(e.aborted)throw new nt},nl=async(e,t)=>{try{return await e??"event"}catch(e){if(t.aborted)throw e;return"timeout"}};e.s(["useCaseOpeningOrchestrator",0,function({getCase:e,isDemo:t,isDemoDisabled:n,showModal:a,takeRecommendationAttribution:l}){let[i]=h(),{isFreeDepositCase:o}=t1(e),s=(({animationMode:e,isFreeCase:t})=>t?"normal":e)({animationMode:i,isFreeCase:o}),u="fast"===s,c="off"===s,d=u||c,[p,m]=(0,tX.useCookies)(["isDemo"]),g=(0,tI.useApolloClient)(),f=(0,tV.useProfileMoneyChannel)("case-open"),E=(0,tQ.useCaseInputFromRoute)(),S=(0,b.useConfig)(),y=(0,w.useIsMobile)(),R=q(),M=(0,tA.useTranslations)("common"),O=(0,tA.useTranslations)("errors"),T=(0,r.useRef)(new AbortController),v=(0,r.useRef)(!1),I=(0,r.useRef)(!1),_=(0,r.useRef)(0),x=(0,r.useRef)(!1),A=(0,r.useRef)(null),D=(0,r.useRef)(!1),N=(0,r.useRef)(void 0),k=(0,r.useRef)(null),{state:L,dispatch:P}=tv(),F=(0,r.useRef)(L),K=(0,r.useRef)(P),U=L.context.currentOpening?.openingKey,[G]=(0,t_.useMutation)(tJ.OPEN_CASE_MUTATION),[J]=(0,r.useState)(()=>(0,tG.createRequestKeys)()),$=(0,r.useCallback)(e=>m("isDemo",e),[m]),B=(0,r.useCallback)(e=>tE("rouletteStop",{openingKey:e??F.current.context.currentOpening?.openingKey}),[]),W=(0,r.useCallback)(()=>{let e=F.current.context.currentOpening?.openingKey;return null!=A.current&&e===A.current&&e_(F.current)&&!x.current},[]),j=(0,r.useCallback)(()=>{D.current=!0,(0,tj.dispatchUpgradeHeaderInventoryFreeze)(!0)},[]),V=(0,r.useCallback)(()=>{D.current&&(D.current=!1,(0,tj.dispatchUpgradeHeaderInventoryFreeze)(!1))},[]),X=(0,r.useCallback)(()=>{let e=k.current;k.current=null,e?.cancel("unknown")},[]),Q=(0,r.useCallback)(({isDemoOpening:e,openingKey:t,openCases:n,particleCount:r})=>{e||H({openingKey:t,openCases:n,particleCount:r}),V()},[V]);(0,r.useEffect)(()=>{F.current=L},[L]),(0,r.useEffect)(()=>{K.current=P},[P]),(0,r.useEffect)(()=>{if(!eR(L)){v.current=!0;return}v.current=!1},[L]),(0,r.useEffect)(()=>{let t=e?.id;null!=t&&(void 0!==N.current&&N.current!==t&&(x.current=!1,X(),T.current.signal.aborted||T.current.abort(),P({type:"ABORT"}),V()),N.current=t)},[X,P,e?.id,V]),(0,r.useEffect)(()=>{"spinning"!==L.phase&&(I.current=!1)},[L.phase]),(0,r.useEffect)(()=>()=>{let e=W();e&&!T.current.signal.aborted&&K.current({type:"ABORT"}),e&&!T.current.signal.aborted&&T.current.abort(),e&&(X(),V())},[X,V,W]);let z=(0,r.useCallback)(e=>(_.current+=1,`case-open:${e}:${Date.now()}:${_.current}`),[]),Y=(0,r.useCallback)(async()=>{let t={};return("number"==typeof e?.id&&Number.isFinite(e.id)?t.id=e.id:"number"==typeof E.id&&Number.isFinite(E.id)?t.id=E.id:"string"==typeof E.url&&E.url.length>0&&(t.url=E.url),t.id||t.url)?g.query({query:t$.GET_CASE_QUERY,variables:{input:t},fetchPolicy:"network-only",errorPolicy:"all"}):null},[g,e?.id,E.id,E.url]),Z=(0,r.useCallback)(async e=>{if(I.current||!eM(L))return;I.current=!0,P({type:"FAST_STOP_CLICK"}
1),T.current.signal.aborted||T.current.abort(),T.current=new AbortController;let t=T.current.signal;if(!U){I.current=!1;return}try{await t8({dispatchOpeningEvent:P,openingKey:U,playStopAudio:()=>B(U),playStopAudioBeforeSettledDispatch:!0,resultRevealTimeoutMs:2400,settledTimeoutMs:2500,signal:t,winnerCenterTimeoutMs:3600,onSettled:()=>{x.current=!0,e9({openCases:F.current.context.gamesSnapshot,openingKey:U})}});let e=F.current.context.currentOpening;Q({isDemoOpening:e?.isDemo,openingKey:U,openCases:F.current.context.gamesSnapshot,particleCount:e?.countOpen}),m("isDemo",!1)}catch(e){if(t.aborted||nn(e)){I.current=!1,V();return}throw I.current=!1,V(),e}},[U,P,Q,L,B,V,m]);return{onOpenCase:(0,r.useCallback)(async n=>{if(!e?.id||v.current||!eR(L))return;v.current=!0;let i=tK(),p=!!t||null!==i,g=z(e.id),E=g.replace(/^case-open:/,"case-opening:"),h=L.context.preferences.countOpen,b=8===e.type?1:h,w=R(b)?"canvas":"dom";T.current.signal.aborted||(W()&&P({type:"ABORT"}),X(),T.current.abort()),T.current=new AbortController;let _=T.current.signal;x.current=!1,A.current=E,e2();try{P({type:"OPEN_CLICK",countOpen:b,animationMode:"normal"===s?"on":s,isDemo:p,caseId:e.id,requestKey:g,openingKey:E,renderer:w}),p||j();let t=globalThis.performance?.now?.()??Date.now();tE("openClick",{event:n,openingKey:E}),p&&!i?m("isDemo",!0):m("isDemo",!1);let r=(({countOpen:e})=>e??1)({countOpen:b});P({type:"CASES_EXITED"});let h=async()=>{let t=tW({countOpen:r,needToOpenForFree:e.needToOpenForFree,userOpenForFree:e.userOpenForFree}),n=Math.max(0,Math.trunc(Number(e.userFreeOpen)||0)),a=o?0:Math.max(0,t-n),l=f.begin({expectedDeltaMinor:a>0?-(e.price??0)*a:0});k.current=l;try{let t=(({caseId:e,countOpen:t,useFastBackendPath:n,isDemo:r})=>({caseId:e,countOpen:t??1,isFastGame:n,isDemo:!!r}))({caseId:e.id,countOpen:r,useFastBackendPath:d,isDemo:!1}),n=await G({variables:{input:{...t,requestKey:J.keyFor(t)}},refetchQueries:[...(0,t5.buildFreeCaseOpenRefetchQueries)({isFreeDepositCase:o}),t$.GET_RECOMMENDED_CASES_QUERY],update:(t,n)=>{n.data?.openCase&&(({cache:e,caseId:t,countOpen:n,needToOpenForFree:r,userOpenForFree:a})=>{let l=Math.trunc(tB(t)),i=tW({countOpen:n,needToOpenForFree:r,userOpenForFree:a});l<=0||i<=0||(e.modify({id:e.identify({__typename:"Case",id:l}),fields:{userFreeOpen:e=>Math.max(0,tB(e)-i)}}),e.updateQuery({query:t$.GET_USER_CASE_FREE_OPENS_QUERY},e=>{let t=e?.getUserCaseFreeOpens;if(!t?.length)return;let n=!1,r=t.flatMap(e=>{if(e.caseId!==l)return[e];let t=Math.max(0,tB(e.freeOpen)-i);return t===e.freeOpen?[e]:(n=!0,t>0?[{...e,freeOpen:t}]:[])});return n?{...e,getUserCaseFreeOpens:r}:void 0}))})({cache:t,caseId:e.id,countOpen:r,needToOpenForFree:e.needToOpenForFree,userOpenForFree:e.userOpenForFree})}});return J.answered(),na(_),l.complete(),k.current===l&&(k.current=null),n.data?.openCase}catch(e){throw(0,tq.keepsRequestKey)(e)||J.answered(),l.cancel(_.aborted?"unknown":"rejected"),k.current===l&&(k.current=null),e}},R=p?(({caseId:e,casePrice:t,countOpen:n,openingKey:r,showcaseItems:a,showcaseItemsOdds:l,random:i=Math.random,forced:o=null})=>{let s=[1,2,3,4,5].includes(n)?n:1,u=(({showcaseItems:e,showcaseItemsOdds:t})=>{let n=new Map;for(let e of t??[]){let t=Number(e.id);Number.isSafeInteger(t)&&t>0&&n.set(t,e)}return e.filter(e=>Number(e.id)>0&&!!e.getImage&&!!e.getName).map(e=>{let t,r=n.get(Number(e.id));return{item:e,chance:(t=Number(r?.chance),Number.isFinite(t)&&t>0?t:0),price:ne(e.price??r?.price)}})})({showcaseItems:a,showcaseItemsOdds:l});if(0===u.length)throw Error("No demo items available");let c=o?u.find(e=>Number(e.item.id)===o.itemId):void 0;if(o&&!c)throw Error("Forced demo item is not in the showcase");return Array.from({length:s},(n,a)=>{let l=0===a&&void 0!==c,s=l?c:((e,t)=>{let n=e.reduce((e,t)=>e+t.chance,0);if(n<=0)return e[Math.floor(t()*e.length)];let r=t()*n;for(let t of e)if((r-=t.chance)<=0)return t;return e[e.length-1]})(u,i),d=s.item,p=Number(d.id),m=s.price;return{...l&&o?.jackpot!=null?{jackpot:o.jackpot}:{},getCategory:null,getGame:{id:-(1+(e=>{let t=0x811c9dc5;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,0x1000193);return t>>>0})(r)%1e9+a),status:1,price:m,priceSell:m,chance:s.chance,getCase:{id:e,price:ne(t)},getItem:{id:p,getName:String(d.getName),getImage:String(d.getImage),color:d.color??null,quality:d.quality??null,price:m}}}})})({forced:i?{itemId:i.itemId,jackpot:i.jackpot}:null,caseId:e.id,casePrice:e.price,countOpen:r,openingKey:E,showcaseItems:e.showcaseItems??[],showcaseItemsOdds:e.showcaseItemsOdds??[]}):await h();if(na(_),!R)throw Error("Failed to open case: No games returned");let{openCases:M,resultSnapshot:O,selectedGameIds:T}=(({caseId:e,caseItems:t,casePrice:n,openCases:r})=>{let a=tn({caseId:e,caseItems:t,casePrice:n,openCases:r}),l=a.map(e=>Number(e.getGame.id)),i=a.map(e=>e.getGame.getItem?.id==null?null:Number(e.getGame.getItem.id));return{openCases:a,resultSnapshot:{caseId:e,gameIds:[...l],itemIds:i},selectedGameIds:[...l]}})({caseId:e.id,caseItems:e.showcaseItems??[],casePrice:e.price??0,openCases:R});if(c&&(x.current=!0),P({type:"OPEN_SUCCESS",gamesSnapshot:M,resultSnapshot:O,selectedGameIds:T,requestKey:g,openingKey:E}),p||(({caseOpenCount:e,currencyChar:t,getCase:n,openCases:r,takeRecommendationAttribution:a=()=>null})=>{if(!n)return;let l=t||"$",i=n.price??0,o=a(n.id);for(let{getGame:t,getCategory:a}of(o&&(0,t4.pushEcommerceEvent)({event:"case_recommendation_open",algorithmVersion:o.algorithmVersion,strategy:o.strategy,reason:o.reason,position:o.position,caseId:o.caseId,priceRatio:o.priceRatio,ecommerce:{currency:l,value:(0,t6.toMajorMoneyAmount)(i*e),items:[{item_name:n.getName,item_id:String(n.id),price:(0,t6.toMajorMoneyAmount)(i),quantity:e,currency:l}]}}),(0,t4.pushEcommerceEvent)({event:"add_to_cart",ecommerce:{currency:l,value:(0,t6.toMajorMoneyAmount)(i*e),items:[{item_name:n.getName,item_id:String(n.id),price:(0,t6.toMajorMoneyAmount)(i),item_category:String(n.category),quantity:e,currency:l}]}}),r))t?.id!=null&&(0,t4.pushEcommerceEvent)({event:"playCase",ecommerce:{transaction_id:String(t.id),value:(0,t6.toMajorMoneyAmount)(i),currency:l,affiliation:"onOpenCase",items:[{item_name:n.getName,item_id:String(n.id),item_category:a?.getName,price:(0,t6.toMajorMoneyAmount)(i),quantity:1}]}})})({caseOpenCount:r,currencyChar:S?.getCurrency?.char,getCase:e,openCases:M,takeRecommendationAttribution:l}),c){B(E),await nr(80,_),na(_),P({type:"RESULT_REVEALED",openingKey:E}),Q({isDemoOpening:p,openingKey:E,openCases:M,particleCount:b}),e9({openCases:M,openingKey:E});return}let v=await tb({imageSize:384,imageSuffix:C,isMobile:y,openCases:M,previewExitMs:430,previewExitStartedAt:t,signal:_,sleep:nr});na(_),P({type:"done"===v?"PREWARM_DONE":"PREWARM_TIMEOUT",openingKey:E});let I=(({isFastAnimationMode:e,isMobile:t,normalDurationMs:n,fastDurationMs:r,mobileNormalDurationMs:a,mobileFastDurationMs:l})=>e?t&&null!=l?l:r:t&&null!=a?a:n)({isFastAnimationMode:u,isMobile:y,normalDurationMs:6500,fastDurationMs:2800,mobileNormalDurationMs:7800,mobileFastDurationMs:3400}),A=eg({openingKey:E,signal:_,timeoutMs:2400});P({type:"ROULETTE_OPENED",openingKey:E});let D=await nl(A,_);if(P({type:"SPIN_STARTED",openingKey:E,spinDurationMs:I,source:D}),await t8({dispatchOpeningEvent:P,openingKey:E,playStopAudio:()=>B(E),playStopAudioBeforeSettledDispatch:"canvas"!==w,resultRevealTimeoutMs:2400,settledTimeoutMs:I+1e3,signal:_,stopAudioDelayMs:I,winnerCenterTimeoutMs:3600,onSettled:()=>{x.current=!0,e9({openCases:M,openingKey:E})}}),Q({isDemoOpening:p,openingKey:E,openCases:M,particleCount:b}),i)return;await t7({caseCategory:e?.category,casePrice:e?.price,caseType:e?.type,isDemo:p,openingKey:E,openCases:M,showModal:a,refetch:Y,setDemoCookie:$})}catch(a){if(_.aborted||nn(a)){$(!1),I.current||V();return}$(!1),V(),P({type:"OPEN_ERROR",error:a,requestKey:g,openingKey:E});let{code:e,params:t}=(0,tH.resolveGraphQLError)(a),n=O.has(e)?O(e,t):O("Unknown error occurred");tx.toast.error((0,r.createElement)("div",null,(0,r.createElement)("div",{className:"notify-title"},M("Error"),"!"),(0,r.createElement)("div",{className:"notify-text"},n)))}},[s,X,z,P,e,S?.getCurrency?.char,t,c,u,o,y,Q,j,a,G,L,B,f,Y,J,m,$,d,R,W,V,M,O,l]),onQuickStop:Z,isDemoDisabled:!!(n||p.isDemo||L.c
1ontext.currentOpening?.isDemo)}}],516947);let ni=560,no=560;e.s(["useCaseResultReturnController",0,({dispatchOpeningEvent:e,onCasesEntered:t,openingMachineState:n,shouldEnterThroughPrimary:a,shouldShowNewGame:l=!0})=>{let[i,o]=(0,r.useState)(a),s=(0,r.useRef)(null),u=(0,r.useRef)(null),c=(0,r.useRef)(!1),d=(0,r.useRef)(n.phase),p=(0,r.useRef)(eI(n)??void 0),m=(0,r.useRef)(null),g=(0,r.useRef)(null),f=eI(n)??void 0,E=eA(n),h=eT(n),S=ev(n);(0,r.useEffect)(()=>{d.current=n.phase,p.current=f},[f,n.phase]),(0,r.useEffect)(()=>{"resultExitingSell"===n.phase&&"succeeded"===n.context.sellStatus&&f&&m.current!==f&&(m.current=f,tE("resultSellSuccess",{openingKey:f}))},[f,n.context.sellStatus,n.phase]);let C=(0,r.useCallback)(()=>{null!==u.current&&(window.clearTimeout(u.current),u.current=null)},[]),y=(0,r.useCallback)(()=>{s.current?.(),s.current=null},[]),b=(0,r.useCallback)((t,{event:n,sellClickAlreadyDispatched:r,sellSoundAlreadyPlayed:a,sellSucceeded:l}={})=>{let i=d.current,o=p.current;if("sell"===t){r||["sellingResult","resultExitingSell"].includes(i)||e({type:"SELL_CLICK",openingKey:o}),l&&(o&&(m.current=o),a||tE("resultSellSuccess",{openingKey:o}),e({type:"SELL_SUCCESS",openingKey:o}));return}"resultExitingNewGame"!==i&&(tE("resultNewGame",{event:n,openingKey:o}),e({type:"NEW_GAME_CLICK",openingKey:o}))},[e]),w=(0,r.useCallback)(()=>{["revealingResult","resultShown"].includes(d.current)&&e({type:"SELL_CLICK",openingKey:p.current})},[e]),R=(0,r.useCallback)(t=>{e({type:"SELL_ERROR",openingKey:p.current,error:t})},[e]);(0,r.useEffect)(()=>()=>{C(),y()},[C,y]),(0,r.useEffect)(()=>{if(C(),!E){c.current=!1,o(a);return}if(o(a),a)return u.current=window.setTimeout(()=>{o(!1),u.current=null},40),C},[C,E,a]),(0,r.useEffect)(()=>{if(!S){g.current=null,"casesEntering"!==n.phase&&y();return}if(!l)return;let r=`${n.phase}:${eI(n)??""}`;g.current!==r&&(g.current=r,y(),o(!1),s.current=(({casesEnterMs:e=no,clearTimeoutFn:t=globalThis.clearTimeout,dispatchOpeningEvent:n,onCasesEntered:r,openingKey:a,resetMs:l=ni,setTimeoutFn:i=globalThis.setTimeout})=>{let o=!1,s=null,u=i(()=>{o||(n({type:"RESULT_EXITED",openingKey:a}),s=i(()=>{o||(o=!0,n({type:"CASES_ENTERED",openingKey:a}),r?.())},e))},l);return()=>{o||(o=!0,t(u),null!==s&&t(s))}})({dispatchOpeningEvent:e,onCasesEntered:t,openingKey:f}))},[y,e,S,t,f,n,n.phase,l]);let M=(0,r.useCallback)((n,r)=>{let a="sell"===n&&r?.sellSucceeded===!0&&"sellingResult"===d.current;if(!c.current&&!S&&(h||a)){if(c.current=!0,!l){b(n,r),e({type:"RESULT_EXITED",openingKey:p.current}),e({type:"CASES_ENTERED",openingKey:p.current}),t?.(),r?.onComplete?.();return}y(),o(!1),b(n,r),r?.onComplete?.()}},[y,h,e,b,S,t,l]);return{completeStartedSellReturn:(0,r.useCallback)(e=>{M("sell",{...e,sellClickAlreadyDispatched:!0,sellSucceeded:!0})},[M]),failSellAction:R,isEnteringResult:i,isTransitioningToOpen:S,startSellAction:w,startReturnToOpen:M}}],761501);let ns=e=>[{openingKey:e,type:"NEW_GAME_CLICK"},{openingKey:e,type:"RESULT_EXITED"},{openingKey:e,type:"CASES_ENTERED"}];e.s(["useDismissCaseResultOnLeave",0,()=>{let{dispatch:e,state:t}=tv(),n=(0,r.useRef)(t);n.current=t;let a=(0,r.useRef)(e);a.current=e,(0,r.useEffect)(()=>()=>{let e=n.current;if("resultShown"===e.phase&&e.context.currentOpening?.openingKey!=null)for(let t of ns(e.context.currentOpening?.openingKey))a.current(t)},[])},"useResetCaseOpeningOnRouteChange",0,e=>{let{dispatch:t,state:n}=tv(),a=(0,r.useRef)(e),l=(0,r.useRef)(t);l.current=t;let i=(0,r.useRef)(n.context.currentOpening?.openingKey);i.current=n.context.currentOpening?.openingKey,(0,r.useEffect)(()=>{let t=a.current;if(a.current=e,t&&/(^|\/)case\/[^/]+/.test(t)&&t!==e)for(let e of ns(i.current))l.current(e)},[e])}],662864),e.s(["useCaseJackpotDevDropCommand",0,({enabled:e,showcaseItems:t})=>{let n=(0,r.useRef)(t);n.current=t,(0,r.useEffect)(()=>{if(!e)return;let t=window,r=(e={})=>{let t=tL(n.current,e);return t?(tF(t),{drop:t,hint:"СледÑÑÑее оÑкÑÑÑие пÑойдÑÑ ÐºÐ°Ðº демо: без ÑпиÑаниÑ, без инвенÑаÑÑ. ÐÑмениÑÑ â window.__opencaseCase.disarmJackpotDrop().",ok:!0}
1):{ok:!1,reason:"NO_SHOWCASE_ITEM"}},a=()=>({ok:!0,wasArmed:tU()}),l={armJackpotDrop1:(e={})=>r({...e,animationVariant:"variant-1"}),armJackpotDrop2:(e={})=>r({...e,animationVariant:"variant-2"}),armJackpotDrop3:(e={})=>r({...e,animationVariant:"variant-3"}),armJackpotDrop7:(e={})=>r({...e,animationVariant:"variant-7"}),armJackpotDrop8:(e={})=>r({...e,animationVariant:"variant-8"}),armJackpotDrop9:(e={})=>r({...e,animationVariant:"variant-9"})};return t.__opencaseCase={...t.__opencaseCase,...l,armJackpotDrop:r,disarmJackpotDrop:a},()=>{let e=t.__opencaseCase;for(let[t,n]of Object.entries(l))e?.[t]===n&&delete e[t];e?.armJackpotDrop===r&&delete e.armJackpotDrop,e?.disarmJackpotDrop===a&&delete e.disarmJackpotDrop,tU()}},[e])}],594621),e.s(["useCaseJackpotCelebrationCard",0,e=>{let[t,n]=(0,r.useState)(()=>{let t=e1(),n=e4(t,e);return t&&n?{card:n,effectKey:t.effectKey}:null});return(0,r.useEffect)(()=>{let t=e6(t=>{let r=e4(t,e);r&&n({card:r,effectKey:t.effectKey})}),r=e8(()=>{n(null)});return()=>{t(),r()}},[e]),t}],139619),e.s(["useCaseJackpotCountUp",0,({amountMinor:e,isStatic:t})=>{let[n,a]=(0,r.useState)(t?e:0),[l,i]=(0,r.useState)(t);return(0,r.useEffect)(()=>{if(t){a(e),i(!0);return}a(0),i(!1);let n=null,r=null,l="function"==typeof window.requestAnimationFrame?window.requestAnimationFrame.bind(window):e=>window.setTimeout(()=>e(performance.now()),16),o="function"==typeof window.cancelAnimationFrame?window.cancelAnimationFrame.bind(window):window.clearTimeout.bind(window),s=t=>{r??=t;let o=t-r;if(a(eZ({amountMinor:e,durationMs:eB.countDurationMs,elapsedMs:o})),o>=eB.countDurationMs){n=null,i(!0);return}n=l(s)},u=window.setTimeout(()=>{n=l(s)},eB.countMs);return()=>{window.clearTimeout(u),null!==n&&o(n)}},[e,t]),{isSettled:l,value:n}}],833624),e.s([],571003)}]);
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.