1import{r as l,j as e,i as he}from"./vendor-react-BGN68_Lp.js";import{g as i}from"./vendor-styled-pkIKgjgv.js";import{g as se}from"./getShopItemComponent-N9kyEGIO.js";import{g as y,as as pe,aa as xe,a9 as me,v as ge,ap as ue,ac as J,s as te,b as L,ab as V,at as ee,t as fe,au as ye,q as H,am as be,c as we,av as Ce,aw as ie,ax as ae}from"./index-uear5Vpj.js";import{b as je,a as ne,u as $}from"./vendor-redux-D8sX5Eqv.js";import{u as oe}from"./vendor-i18n-BWleq_Sd.js";import{I as ve}from"./Item-XnKSUaAV.js";import"./Effect-DrauBACU.js";import"./vendor-socket-DSYo_sTV.js";import"./vendor-router-CYD8mbvC.js";const ke=i.div` 2 -webkit-mask-image: linear-gradient( 3 90deg, 4 rgba(15, 20, 27, 0) 0.01%, 5 #0f141b 36.05%, 6 #0f141b 64.69%, 7 rgba(15, 20, 27, 0) 100% 8 ); 9 width: 1090px; 10 margin: 0 auto; 11 12 @media (max-width: 1000px) { 13 width: 100%; 14 display: flex; 15 justify-content: center; 16 } 17`,_e=i.div` 18 width: 1090px; 19 min-width: 1090px; 20 height: 227px; 21 border-radius: 12px; 22 overflow: hidden; 23 background: #131821; 24 margin: 26px 0; 25 26 .default-item { 27 height: 100%; 28 } 29`,ze=i.div` 30 position: absolute; 31 width: 100%; 32 height: 100%; 33 left: 0; 34 top: 0; 35 display: flex; 36 align-items: center; 37 justify-content: center; 38 background: #131821; 39 transition: opacity 0.3s ease; 40 z-index: 2; 41 42 img { 43 height: 90%; 44 } 45 46 &.isHidden { 47 opacity: 0; 48 } 49`,re=i.div` 50 height: 100%; 51 transition: opacity 0.3 ease; 52 ${t=>t.isDropCell?"opacity: 1 !important;":""} 53`,Ae=i.div` 54 display: flex; 55 align-items: center; 56 padding: 12px; 57 height: 100%; 58 position: absolute; 59 left: 0; 60 margin-left: 50%; 61 62 .item-price { 63 display: none; 64 } 65 66 & > div > div { 67 width: 172px; 68 margin-right: 8px; 69 height: 100%; 70 } 71 72 &.finished { 73 ${re} { 74 opacity: 0.4; 75 } 76 77 .item-price { 78 display: flex; 79 } 80 } 81`,Ee=i.img` 82 position: absolute; 83 left: 50%; 84 transform: translate(-50%, -50%); 85 top: 50%; 86 z-index: 1; 87 opacity: 0; 88 89 &.fadeIn { 90 opacity: 1; 91 transition: opacity 0.3s ease; 92 } 93`,Se=t=>{const{img:r,status:n,roulette:m,caseItems:C}=t;return l.useEffect(()=>{n=="ready"&&(m.current.style.transition="transform 0s ease",m.current.style.transform="translate3d(0px, 0px, 0px)",m.current.classList.remove("finished"))},[n]),l.useEffect(()=>{n=="ready"&&(m.current.style.transform="translate3d(-635px, 0px, 0px)")},[n]),e.jsx(l.Fragment,{children:e.jsxs(ke,{children:[e.jsx(Ee,{src:y("/pages/case/icons/roulette-arrows.png"),className:n!="ready"?"fadeIn":void 0}),e.jsxs(_e,{children:[e.jsx(Ae,{ref:m,children:C?.map(b=>e.jsx(re,{isDropCell:b.classList=="drop-cell",children:se(b)}))}),e.jsx(ze,{className:n=="active"||n=="finished"?"isHidden":void 0,children:e.jsx("img",{loading:"lazy",src:r,alt:""})})]})]})})},Q=i.div` 94 display: flex; 95 align-items: center; 96 justify-content: center; 97 transition: opacity 0.3s ease; 98 99 button { 100 height: 56px; 101 border-radius: 6px; 102 display: flex; 103 align-items: center; 104 justify-content: center; 105 padding: 0 30px; 106 } 107 108 &.loading { 109 opacity: 0.5; 110 pointer-events: none; 111 } 112 113 @media (max-width: 1000px) { 114 width: 100%; 115 } 116 117 @media (max-width: 650px) { 118 button { 119 height: 45px; 120 font-size: 13px; 121 } 122 } 123`,B=i.div` 124 display: flex; 125 align-items: center; 126 gap: 12px; 127 width: 100%; 128 129 @media all and (max-width: 650px) { 130 flex-direction: column; 131 132 button { 133 width: 100%; 134 } 135 } 136`,S=i.button` 137 background: #6080ff; 138 font-weight: 700; 139 font-size: 15px; 140 text-transform: uppercase; 141 142 .colored { 143 color: #ffebb9; 144 } 145 146 &.inactive { 147 background: rgb(23, 27, 37); 148 cursor: default; 149 white-space: nowrap; 150 } 151 152 img { 153 width: 18px; 154 margin-left: 6px; 155 } 156`,$e=i.div` 157 display: flex; 158 align-items: center; 159 cursor: pointer; 160 padding: 6px 8px 6px 12px; 161 background: #171b25; 162 border-radius: 8px; 163 164 span { 165 font-weight: 700; 166 font-size: 15px; 167 line-height: 18px; 168 } 169 170 svg { 171 transition: transform 0.2s ease; 172 } 173 174 @media (max-width: 650px) { 175 margin-left: 10px; 176 } 177`,R=i.button` 178 padding: 0 32px; 179 font-weight: 500; 180 font-size: 15px; 181 line-height: 18px; 182 color: #ffffff; 183 background: transparent; 184`,Ie=i.div` 185 padding: 0 24px; 186 187 @media (max-width: 650px) { 188 padding: 0; 189 display: flex; 190 align-items: center; 191 font-size: 13px; 192 color: rgba(236, 241, 248, 0.9); 193 } 194`,Le=i.div` 195 position: absolute; 196 left: 45%; 197 top: -20px; 198 transform: translate(-50%, -100%); 199 background: #11151d; 200 border-radius: 12px; 201 padding: 8px 6px 8px 8px; 202 z-index: 1; 203`,Te=i.div` 204 max-height: 200px; 205 overflow: auto; 206 padding-right: 6px; 207 208 &::-webkit-scrollbar {
209 background: transparent; 210 width: 3px; 211 } 212 213 &::-webkit-scrollbar-thumb { 214 background: #1a1f29; 215 border: none; 216 } 217`,De=i.div` 218 padding: 8px 0; 219 width: 58px; 220 display: flex; 221 justify-content: center; 222 font-weight: 400; 223 font-size: 14px; 224 color: #778597; 225 cursor: pointer; 226 transition: background 0.2s ease; 227 228 &:hover { 229 background: #161b25; 230 border-radius: 8px; 231 } 232`,Oe=i.div` 233 background: rgba(23, 27, 37, 0.6); 234 border-radius: 8px; 235 height: 56px; 236 padding: 6px; 237 display: flex; 238 239 div { 240 border-radius: 6px; 241 padding: 0 12px; 242 height: 100%; 243 display: flex; 244 align-items: center; 245 font-weight: 500; 246 font-size: 15px; 247 line-height: 18px; 248 letter-spacing: 0.01em; 249 color: #7a8697; 250 cursor: pointer; 251 transition: all 0.2s ease; 252 253 &.active { 254 background: rgba(96, 128, 255, 0.12); 255 color: #6080ff; 256 } 257 } 258 259 @media (max-width: 650px) { 260 height: 45px; 261 width: 100%; 262 display: grid; 263 grid-template-columns: 1fr 1fr 1fr 1fr 1fr; 264 265 div { 266 font-size: 13px; 267 padding: 0px; 268 display: flex; 269 justify-content: center; 270 } 271 } 272`,Ke=i.div` 273 height: 56px; 274 padding: 6px; 275 background: rgba(23, 27, 37, 0.6); 276 border-radius: 8px; 277 cursor: pointer; 278 279 @media (max-width: 650px) { 280 height: 45px; 281 } 282`,Ne=i.div` 283 background: #171b25; 284 border-radius: 6px; 285 height: 100%; 286 width: 100%; 287 padding: 0 12px; 288 display: flex; 289 align-items: center; 290 291 p { 292 margin-right: 10px; 293 font-weight: 500; 294 font-size: 15px; 295 letter-spacing: 0.01em; 296 color: #7a8697; 297 } 298`,Be=i.div` 299 width: 42px; 300 height: 24px; 301 background: #1b212d; 302 border-radius: 25px; 303 transition: background 0.2s ease; 304 305 span { 306 width: 16px; 307 height: 16px; 308 position: absolute; 309 border-radius: 50%; 310 left: 4px; 311 top: 4px; 312 background: #778597; 313 transition: all 0.2s ease; 314 } 315 316 &.active { 317 background: rgba(96, 128, 255, 0.12); 318 319 span { 320 transform: translateX(16px); 321 background: #6080ff; 322 } 323 } 324`,Me=i(B)``,Pe=i(B)` 325 @media (max-width: 650px) { 326 flex-direction: column; 327 gap: 8px; 328 329 button { 330 width: 100%; 331 } 332 } 333`,Fe=i(B)` 334 @media (max-width: 650px) { 335 flex-direction: column; 336 gap: 8px; 337 } 338`,We=t=>{const{t:r}=oe(),n=ne(),[m,C]=l.useState(!1),b=l.useRef(),T=$(a=>a.root.size.width),D=$(a=>a.auth.isAuth);pe(b,()=>g(!1));const[p,g]=l.useState(!1),[o,v]=l.useState(1),[O,U]=l.useState(!1);let k=!1,u,w;t.key_data&&(k=t.caseAmount>t.availableKeys.length||t.caseAmount>t.availableCases.length,u=t.caseAmount-t.availableKeys.length,w=t.caseAmount-t.availableCases.length);const Z=()=>{let a=u<0?0:u,x=w<0?0:w,K=[];a>0&&K.push({...t.availableKeys[0],price_client:t.key_data.price,amount:a}),x>
3380&&K.push({...t.availableCases[0],price_client:t.caseData.price,amount:x}),n(L("LOT_BUY",{items:K,buy_from_site:!0,action:()=>{V.buyAny([{hash:t.key_data.hash,count:a}],[{url_name:t.caseData.url_name,price:t.caseData.price,count:x}]).then(d=>{if(d){n(L("CASE_MODAL",{caseData:t.caseData,openAmount:t.caseAmount,key:t.key_data,items:t.items}));const P=d.data.lots?.[t.caseData.url_name],N=d.data.items?.[t.key_data.hash],F=(G,W)=>{G.forEach(X=>{n(ee({...W,hash:X,unixtime_getting:Math.trunc(new Date().getTime()/1e3)}))})};n(J({step:"decrease",summ:t.key_data.price*a+t.caseData.price*x})),P&&F(P,t.availableCases[0]),N&&F(N,t.availableKeys[0])}})}}))},M=a=>{n(ee({action:{},block_sell_market:!0,block_trade_offer:!1,in_use:0,status:0,unixtime_unlock:0,unixtime_getting:Math.trunc(new Date().getTime()/1e3),...t.key_data,hash:a}))},Y=()=>{n(L("LOT_BUY",{items:[{...t.key_data,price_client:t.key_data.price,amount:o}],buy_from_site:!0,action:()=>{V.buyItemFromSite(t.key_data.hash,o).then(a=>{a&&(te(r("Bought")),n(J({step:"decrease",summ:t.key_data.price*o})),typeof a.data.hash=="string"?M(a.data.hash):a.data.hash.forEach(x=>{M(x)}),n(L("CASE_MODAL",{caseData:t.caseData})))})}}))},q=()=>{let a=u<0?0:u,x=w<0?0:w;return t.key_data.price*a+t.caseData.price*x},_=()=>{t.generateCase(t.caseAmount),t.setStatus("ready")},E=()=>{m||(C(!0),me.inventSkinAction(t.drop.id_sell,"sell").then(a=>{a&&(a.result=="error"?ge(r(ue(Number.parseInt(a.code)))):(n(J({step:"setNew",summ:a.amount})),te(r("SkinSold")),_()))}).finally(()=>C(!1)))},z=()=>n(L(null));return t.status=="finished"?e.jsx(Q,{children:e.jsxs(B,{children:[t.availableCases.length>0&&e.jsxs(l.Fragment,{children:[e.jsx(S,{onClick:_,children:e.jsx("span",{children:r("OpenOneMoreTime")})}),t.drop.id_sell&&e.jsxs(S,{onClick:E,disabled:m,children:[e.jsx("span",{children:`${r("SellFor")} ${t.drop.price}`}),e.jsx("img",{loading:"lazy",src:y("/img/general/coin1.png")})]})]}),e.jsx(R,{onClick:z,children:r("Close")})]})}):t.status=="ready"?e.jsx(Q,{className:t.isPending&&"loading",children:e.jsx(Fe,{children:t.key_data&&t.availableKeys.length<1?e.jsxs(l.Fragment,{children:[e.jsxs(Ie,{ref:b,children:[T<650&&r("ChooueAmount"),e.jsxs($e,{onClick:()=>g(!p),children:[e.jsx("span",{children:o}),e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",style:{transform:`rotate(${p?180:0}deg)`},children:e.jsx("path",{d:"M12.1886 14.75C12.0901 14.7502 11.9925 14.7309 11.9015 14.6932C11.8105 14.6554 11.7279 14.5999 11.6586 14.53L7.65857 10.53C7.52609 10.3878 7.45396 10.1998 7.45739 10.0055C7.46082 9.81118 7.53953 9.62579 7.67695 9.48838C7.81436 9.35097 7.99974 9.27225 8.19405 9.26882C8.38835 9.2654 8.57639 9.33752 8.71857 9.47L12.1886 12.939L15.6586 9.47C15.8007 9.33752 15.9888 9.2654 16.1831 9.26882C16.3774 9.27225 16.5628 9.35097 16.7002 9.48838C16.8376 9.62579 16.9163 9.81118 16.9197 10.0055C16.9232 10.1998 16.851 10.3878 16.7186 10.53L12.7186 14.53C12.6492 14.5999 12.5666 14.6554 12.4756 14.6932C12.3847 14.7309 12.2871 14.7502 12.1886 14.75Z",fill:"white"})})]}),e.jsx(xe,{in:p,unmountOnExit:!0,timeout:200,classNames:"modal",children:e.jsx(Le,{onClick:()=>g(!1),children:e.jsx(Te,{children:Array.from({length:20},(a,x)=>x+1).map(a=>e.jsx(De,{className:a==o?"active":void 0,onClick:()=>v(a),children:a}))})})})]}),e.jsxs(B,{children:[e.jsxs(S,{onClick:Y,children:[e.jsx("span",{children:`${r("Buy")} ${r("for")} ${t.key_data.price*o}`}),e.jsx("img",{loading:"lazy",src:y("/img/general/coin1.png")})]}),e.jsx(R,{onClick:z,children:r("Close")})]})]}):D?e.jsxs(l.Fragment,{children:[e.jsxs(Me,{children:[t.key_data&&e.jsx(Oe,{children:[1,2,3,4,5].map(a=>e.jsxs("div",{className:t.caseAmount==a&&"active",onClick:()=>t.setCaseAmount(a),children:["x",a]}))}),e.jsx(Ke,{onClick:()=>U(!O),children:e.jsxs(Ne,{children:[e.jsx("p",{children:r("Fast")}),e.jsx(Be,{className:O&&"active",children:e.jsx("span",{})})]})})]}),e.jsxs(Pe,{children:[k?e.jsxs(S,{onClick:Z,children:[e.jsx("span",{children:`${r("Buy")} ${r("for")} ${q()}`}),e.jsx("img",{loading:"lazy",src:y("/img/general/coin1.png")})]}):t.disabled?e.jsx(S,{className:"inactive",children:e.jsx("span",{children:r(t.disabledText)})}):e.jsx(S,{onClick:()=>t.openCase(O),children:e.jsx("span",{children:r("Open_")})}),e.jsx(R,{onClick:z,children:r("Close")})]})]}):e.jsx(S,{onClick:()=>{fe("login_click",{source:"case_modal"}),window.open("//auth.cybershoke.net/steam")},children:e.jsx("span",{children:r("DiscordLite1Text")})})})}):e.jsx(Q,{children:e.jsx(R,{onClick:()=>{z(),clearTimeout(t.timerId)},children:r("Close")})})};let Re=t=>({steamid:t.auth.steamid64});const He=je(Re,null)(We),Ue=i.div` 339 width: 1090px; 340 margin: 0 auto; 341 342 @media (max-width: 1000px) { 343 width: 100%; 344 } 345`,Ze=i.div` 346 width: 100%; 347 height: 227px; 348 border-radius: 12px; 349 overflow: hidden; 350 background: linear-gradient( 351 270deg, 352 rgba(19, 24, 33, 0) 1.04%, 353 #131821 48.96%, 354 rgba(19, 24, 33, 0) 98.44% 355 ); 356 margin: 26px 0; 357 358 .default-item { 359 height: 100%; 360 } 361`,Ye=i.div` 362 position: absolute; 363 width: 100%; 364 height: 100%; 365 left: 0; 366 top: 0; 367 display: flex; 368 background: linear-gradient( 369 270deg, 370 rgba(19, 24, 33, 0) 1.04%, 371 #131821 48.96%, 372 rgba(19, 24, 33, 0) 98.44% 373 ); 374 transition: opacity 0.3s ease; 375 z-index: 2; 376 377 div { 378 width: ${t=>1090/t.amount}px; 379 height: 100%; 380 transition: width 0.3s ease; 381 display: flex; 382 align-items: center; 383 justify-content: center; 384 } 385 386 img { 387 height: auto; 388 transition: width 0.3s ease; 389 width: ${t=>t.amount==5?152:172}px; 390 391 &.disabled { 392 opacity: 0.5; 393 } 394 } 395 396 &.isHidden { 397 opacity: 0; 398 } 399 400 @media (max-width: 1000px) { 401 img { 402 width: 60%; 403 } 404 } 405`,le=i.div` 406 min-height: 170px; 407 width: 100%; 408 display: flex; 409 align-items: center; 410 justify-content: center; 411 transition: opacity 1s ease; 412 413 &.drop-cell { 414 transition: transform 0.3s ease; 415 opacity: 1 !important; 416 } 417 418 & > img { 419 width: 200px; 420 position: absolute; 421 left: 50%; 422 top: 48%; 423 transform: translate(-50%, -50%); 424 } 425 426 &::before { 427 content: ''; 428 width: 100%; 429 position: absolute; 430 top: 0; 431 left: 0; 432 height: 100%; 433 background: url(${y("/pages/shop/item-bg/")}${t=>t.color??"gray"}.png); 434 background-repeat: no-repeat; 435 background-position: center 13px; 436 background-size: 134px auto; 437 padding-top: 13px; 438 display: flex; 439 justify-content: center; 440 align-items: center; 441 height: 190px; 442 } 443 444 @media (max-width: 650px) { 445 min-height: 100px; 446 447 & > img { 448 width: 58px; 449 } 450 451 &::before { 452 background-position: center center; 453 background-size: 76px auto; 454 height: 100%; 455 } 456 } 457`,ce=i.div` 458 position: absolute; 459 bottom: 27px; 460 left: 32px; 461 z-index: 1; 462 display: flex; 463 flex-direction: column; 464 opacity: 0; 465 transition: opacity 1s ease; 466 467 @media (max-width: 650px) { 468 bottom: 0px; 469 left: 5px; 470 } 471`,qe=i.div` 472 display: flex; 473 align-items: center; 474 padding-top: 20px; 475 height: 100%; 476 flex-direction: column; 477 /* gap: 20px; */ 478 width: 100%; 479 transform: translate3d(0px, 300px, 0px); 480`,Ge=i.img` 481 position: absolute; 482 left: 50%; 483 transform: translate(-50%, -50%); 484 top: 50%; 485 z-index: 3; 486 opacity: 0; 487 width: calc(100% + 10px); 488 489 &.fadeIn { 490 opacity: 1; 491 transition: opacity 0.3s ease; 492 } 493`,Xe=i.div` 494 display: flex; 495 align-items: center; 496 justify-content: space-around; 497 height: 100%; 498 width: 100%; 499 500 &.finished { 501 ${le} { 502 opacity: 0.4; 503 } 504 505 .drop-cell { 506 /* transform: scale(1.1); */ 507 &::before { 508 transition: background-size 0.3s ease; 509 background-position: center center; 510 background-size: 154px auto; 511 } 512 } 513 514 ${ce} { 515 opacity: 1; 516 } 517 } 518 519 @media (max-width: 650px) { 520 &.finished { 521 .drop-cell { 522 &::before { 523 background-size: 100px auto; 524 } 525 } 526 } 527 } 528`,Je=i.span` 529 font-weight: 400; 530 font-size: 11px; 531 text-transform: uppercase; 532 color: #71798e; 533 opacity: 0.9; 534 535 @media (max-width: 650px) { 536 font-size: 9px; 537 } 538`,Qe=i.span` 539 margin: 2px 0 5px 0; 540 font-weight: 400; 541 font-size: 14px; 542 color: #e8ecf4; 543 opacity: 0.9; 544 545 @media (max-width: 650px) { 546 margin: 0px 0 1px 0; 547 font-size: 12px; 548 } 549`,Ve=i.div` 550 font-weight: 700; 551 font-size: 16px; 552 color: rgba(255, 171, 62, 0.9); 553 display: flex; 554 align-items: center; 555 556 img { 557 height: 14px; 558 width: auto; 559 margin-left: 6px; 560 } 561 562 @media (max-width: 650px) { 563 font-size: 12px; 564 } 565`,et=i.div` 566 position: absolute; 567 left: 0; 568 top: 0; 569 width: 100%; 570 height: 100%; 571 display: flex; 572 align-items: center; 573 justify-content: space-around; 574 z-index: 3; 575 576 div { 577 height: 100%; 578 width: ${t=>1090/t.amount}px; 579 transition: width 0.3s ease; 580 581 &:not(:last-child) { 582 &:after { 583 content: ''; 584 width: 2px; 585 height: 100%; 586 position: absolute; 587 right: 0; 588 top: 0; 589 background: #10151c; 590 } 591 } 592 } 593`,tt=t=>{const{img:r,status:n,roulette:m,caseItems:C,caseAmount:b,availableKeysLength:T,availableCasesLength:D}=t,p=ye();return l.useEffect(()=>{},[p]),l.useEffect(()=>{if(n=="ready"){m.current.classList.remove("finished");const g=m.current.children;for(let o=0;o<g.length;o++)g[o].style.transition="transform 0s ease",g[o].style.transform="translate3d(0px, 300px, 0px)"}},[n]),e.jsx(l.Fragment,{children:e.jsxs(Ue,{children:[e.jsx(Ge,{src:y("/pages/case/icons/roulette-arrows2.png"),className:n!="ready"?"fadeIn":void 0}),e.jsxs(Ze,{children:[e.jsxs("div",{style:{height:"100%"},children:[e.jsx(et,{amount:b,children:C.map(()=>e.jsx("div",{}))}),e.jsx(Xe,{ref:m,children:C.map(g=>e.jsx(qe,{children:g.map(o=>e.jsxs(le,{className:o.classList,color:be(o.rarity),children:[o.classList=="drop-cell"&&e.jsxs(ce,{children:[e.jsx(Je,{children:H(o.title)}),e.jsx(Qe,{children:H(o.subtitle)}),e.jsxs(Ve,{children:[o.price,e.jsx("img",{loading:"lazy",src:y("/img/general/coin1.png"),alt:""})]})]}),e.jsx("img",{loading:"lazy",src:o.web_assets.cell,alt:""})]}))}))})]}),e.jsx(Ye,{className:we((n=="active"||n=="finished")&&"isHidden"),amount:b,children:Array(b).fill(void 0).map((g,o)=>e.jsx("div",{children:e.jsx("img",{loading:"lazy",src:r,alt:"",className:(o+1>T||o+1>D)&&"disabled"})}))})]})]})})},it=i.div` 594 width: 100%; 595 height: 100%; 596 position: fixed; 597 inset: 0; 598 z-index: 99999; 599 display: flex; 600 align-items: center; 601 justify-content: center; 602 mix-blend-mode: normal; 603 background: rgba(15, 20, 27, 0.85); 604 backdrop-filter: blur(15px); 605`,at=i.div` 606 width: 1090px; 607 overflow: hidden; 608 609 @media (max-width: 1000px) { 610 width: 90%; 611 max-height: 90%; 612 overflow-y: auto; 613 614 &::-webkit-scrollbar {
615 display: none; 616 } 617 } 618`,st=i.h2` 619 margin-bottom: 48px; 620 font-weight: 500; 621 font-size: 32px; 622 line-height: 38px; 623 color: rgba(236, 241, 248, 0.9); 624 text-align: center; 625 626 @media (max-width: 650px) { 627 margin-bottom: 24px; 628 font-size: 25px; 629 } 630`,nt=i.div` 631 h3 { 632 font-weight: 300; 633 font-size: 18px; 634 text-transform: uppercase; 635 color: #aab5c6; 636 margin-bottom: 24px; 637 } 638 639 @media (max-width: 650px) { 640 h3 { 641 font-size: 15px; 642 margin-bottom: 12px; 643 } 644 } 645`,ot=i.div` 646 display: grid; 647 grid-gap: 8px; 648 height: 360px; 649 overflow: auto; 650 padding-right: 15px; 651 grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); 652 653 & > div { 654 height: 246px; 655 } 656 657 @media all and (max-height: 850px) { 658 height: 166px; 659 } 660 661 @media (max-width: 650px) { 662 height: auto; 663 } 664`,rt=i.div` 665 margin-top: 32px; 666 height: 56px; 667 background: linear-gradient( 668 273.57deg, 669 rgba(34, 40, 55, 0) 42.94%, 670 rgba(23, 27, 37, 0.6) 97.02% 671 ); 672 border-radius: 12px; 673 display: flex; 674 align-items: center; 675 justify-content: space-between; 676 padding-left: 12px; 677 678 @media (max-width: 1000px) { 679 margin: 0 0 32px 0; 680 flex-direction: column; 681 height: auto; 682 background: transparent; 683 gap: 8px; 684 } 685`,lt=i.div` 686 font-weight: 500; 687 font-size: 14px; 688 color: rgba(236, 241, 248, 0.9); 689 display: flex; 690 align-items: center; 691 692 img { 693 max-height: 35px; 694 margin-right: 8px; 695 } 696 697 @media (max-width: 1000px) { 698 width: 100%; 699 border-radius: 10px; 700 background: linear-gradient( 701 270deg, 702 rgba(34, 40, 55, 0) 0%, 703 rgba(23, 27, 37, 0.6) 100% 704 ); 705 padding: 8px 12px; 706 } 707 708 @media (max-width: 650px) { 709 font-size: 12px; 710 } 711`,ct=i.div` 712 @media (max-width: 1000px) { 713 display: flex; 714 flex-direction: column-reverse; 715 } 716`,dt=i.div` 717 display: flex; 718 align-items: center; 719 color: rgba(236, 241, 248, 0.9); 720 font-weight: 500; 721 722 img { 723 width: 14px; 724 margin-left: 4px; 725 } 726`,ht=i.div` 727 .info { 728 position: absolute; 729 top: 12px; 730 right: 12px; 731 z-index: 2; 732 } 733`,jt=()=>{const{t}=oe(),r=ne(),n=l.useRef(),[m,C]=l.useState(!1),b=$(s=>s.root.size.width),{stages:T,tournament:D}=$(s=>s.pickem),{caseData:p,openAmount:g,key:o,items:v,type:O,callback:U}=$(s=>s.modals.data.CASE_MODAL),k=$(s=>s.inventory.items.cases?.filter(h=>h.type==p.type_item_open)),u=$(s=>s.inventory.items.cases?.filter(h=>h.item=="case"&&h.url_name==p.url_name)),[w]=l.useState(new Audio(y("/audio/s1.mp3"))),[Z]=l.useState(new Audio(y("/audio/s1-fast.mp3"))),[M]=l.useState(new Audio(y("/audio/s2.mp3"))),[Y,q]=l.useState({}),[_,E]=l.useState("ready"),[z,a]=l.useState([]),[x,K]=l.useState(null),[d,P]=l.useState(g??1);l.useEffect(()=>()=>{w&&(w.pause(),w.currentTime=0)},[w]),l.useEffect(()=>()=>{x&&clearTimeout(x)},[x]),l.useEffect(()=>{d&&v&&W(d)},[d,v]);const N=s=>{C(!0),V.openCase(s.casesToOpen,s.keysToOpen).then(h=>{if(C(!1),h){const f=h.data.hash?[h.data]:h.data.map(c=>c.data.data);s.sideEffect&&s.sideEffect(f);let j=[];for(let c=0;c<d;c++)j.push(z[c].map((I,de)=>de==31?{...f[c],classList:"drop-cell"}:I));if(a(j),n.current)if(d>1){const c=n.current.children;for(let I=0;I<c.length;I++)c[I].style.transform=`translate3d(0px, ${b<650?"-3049px":"-5259px"}, 0px)`,c[I].style.transition=`transform ${s.fast?2:8}s ease`}else n.current.style.transform="translate3d(-5678px, 0px, 0px)",n.current.style.transition=`transform ${s.fast?2:8}s ease`;E("active"),s.fast?Z.play():w.play();const A=setTimeout(()=>{E("finished"),M.play(),n.current?.classList.add("finished")},s.fast?2e3:8e3);K(A)}else E("ready")})},F=s=>N({sideEffect:h=>{U?.(),q(h[0])},casesToOpen:[{hash:p.hash}],fast:s}),G=s=>{if(E(null),k.length>=d&&u.length>=d){const h=u.slice(0,d),f=k.slice(0,d);N({sideEffect:A=>{A.forEach(c=>{r(ee({...c,unixtime_getting:Math.trunc(new Date().getTime()/1e3)}))}),h.forEach(c=>
733{r(ae({type:"cases",id:c.hash}))}),f.forEach(c=>{r(ae({type:"cases",id:c.hash}))})},casesToOpen:h,keysToOpen:f,fast:s})}},W=s=>{let h=[];for(let f=1;f<=s;f++){let j=[];for(let A=0;A<50;A++)j.push(v[Math.floor(Math.random()*v.length)]);h.push(j)}a(h)},X=()=>{if(_=="active")return t("Opening")+"...";if(_=="finished")return t("YouOpenedCase");const s=d>u.length,h=d>k.length;if(s||h){let f="",j="";if(s){const c=d-u.length;f=`${c} ${ie("case",c)}`.toLowerCase()}if(h){const c=d-k.length;j=`${c} ${ie("key",c)}`.toLowerCase()}const A=f&&j?", ":" ";return t("BuyEnough")+" "+f+A+j}return t("UseKey",{key:H(o.subtitle)})};if(v)return e.jsx(it,{onClick:s=>s.target.classList.contains("wrapper")&&r(L(null)),className:"wrapper",children:e.jsxs(at,{children:[e.jsx(st,{children:H(p.subtitle)}),d>1?e.jsx(tt,{img:p.web_assets.cell,status:_,caseItems:z,roulette:n,caseAmount:d,availableKeysLength:k.length,availableCasesLength:u.length}):e.jsx(Se,{img:p.web_assets.cell,status:_,caseItems:z[0],roulette:n}),e.jsxs(ct,{children:[e.jsxs(nt,{children:[e.jsx("h3",{children:t("CaseContent")}),e.jsxs(ot,{className:"grey-scroll",children:[p.random_item&&e.jsxs(ht,{children:[e.jsx(he,{placement:"bottom",content:t("I-INFO-CASE-W"),children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",className:"info",children:[e.jsx("g",{clipPath:"url(#clip0_9373_50220)",children:e.jsx("path",{d:"M10.4996 0C4.97746 0 0.5 4.47746 0.5 9.99958C0.5 15.5217 4.97746 20 10.4996 20C16.0217 20 20.5 15.5217 20.5 9.99958C20.5 4.47746 16.0217 0 10.4996 0ZM12.5813 15.498C12.0666 15.7012 11.6568 15.8552 11.3495 15.9619C11.0431 16.0686 10.6867 16.1219 10.2812 16.1219C9.6581 16.1219 9.17302 15.9695 8.82762 15.6656C8.48222 15.3617 8.31037 14.9765 8.31037 14.5084C8.31037 14.3263 8.32307 14.1401 8.34847 13.9505C8.37471 13.7608 8.41619 13.5475 8.47291 13.3079L9.11714 11.0324C9.17386 10.814 9.22296 10.6066 9.2619 10.4135C9.30085 10.2188 9.31947 10.0402 9.31947 9.87767C9.31947 9.58815 9.25937 9.38497 9.14 9.27069C9.01894 9.1564 8.79122 9.10053 8.45175 9.10053C8.28582 9.10053 8.11481 9.12508 7.93958 9.17672C7.76603 9.23005 7.61534 9.27831 7.49175 9.32571L7.6619 8.62476C8.08349 8.45291 8.4873 8.30561 8.87249 8.1837C9.25767 8.06011 9.62169 7.99915 9.96455 7.99915C10.5834 7.99915 11.0608 8.14984 11.3969 8.44783C11.7313 8.74667 11.8998 9.13524 11.8998 9.6127C11.8998 9.71175 11.8879 9.88614 11.8651 10.135C11.8422 10.3848 11.799 10.6125 11.7364 10.8216L11.0956 13.0904C11.0431 13.2724 10.9965 13.4806 10.9542 13.7134C10.9127 13.9462 10.8924 14.124 10.8924 14.2434C10.8924 14.5448 10.9593 14.7505 11.0947 14.8597C11.2285 14.9689 11.463 15.0239 11.7948 15.0239C11.9514 15.0239 12.1267 14.996 12.3248 14.9418C12.5212 14.8876 12.6634 14.8394 12.7531 14.7979L12.5813 15.498ZM12.4678 6.2891C12.169 6.56677 11.8092 6.70561 11.3885 6.70561C10.9686 6.70561 10.6062 6.56677 10.3049 6.2891C10.0052 6.01143 9.85365 5.67365 9.85365 5.27915C9.85365 4.8855 10.006 4.54688 10.3049 4.26667C10.6062 3.98561 10.9686 3.84593 11.3885 3.84593C11.8092 3.84593 12.1698 3.98561 12.4678 4.26667C12.7667 4.54688 12.9165 4.8855 12.9165 5.27915C12.9165 5.6745 12.7667 6.01143 12.4678 6.2891Z",fill:"#384256"})}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_9373_50220",children:e.jsx("rect",{width:"20",height:"20",fill:"white",transform:"translate(0.5)"})})})]})}),e.jsx(ve,{data:{rarity:"sef",web_assets:{cell:y("/pages/case/icons/random.svg")},title:t("Random"),subtitle:t("Skin")},disabled:!0})]}),v.map(s=>se({...s,price:null},{disabled:!0}))]})]}),e.jsxs(rt,{children:[o?e.jsxs(lt,{children:[e.jsx("img",{loading:"lazy",src:o.web_assets.cell,alt:""}),X()]}):e.jsxs(dt,{children:[t("OpeningPrice"),": ",p.price,e.jsx("img",{loading:"lazy",src:y(`/pages/missions/icons/${Ce[p.currency]}.svg`),alt:""})]}),e.jsx(He,{isPending:m,openCase:o?G:F,status:_,key_data:o,generateCase:W,setStatus:E,caseData:p,timerId:x,caseAmount:d,setCaseAmount:P,availableKeys:k,availableCases:o?u:[{}],items:v,drop:Y,disabled:p.notEnough||O==="predictor"&&(!T.every(s=>!s.active)||Math.floor(Date.now()/1e3)<D.unixtime_end),disabledText:p.notEnough?"notEnoughBalance":"waitCupEnd"})]})]})]})})};export{jt as default};
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.