const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["static/arrow-left-n7w8BOwo.js","static/vendor-DWiUHYZz.js","static/page-FortuneWheel.ts-CaqHFvhq.js","static/vendor-CV3Dtpuz.css","static/page-index.tsx-GO22z0Zp.js","static/page-FortuneWheelWinModalContent.tsx-D5IycUpP.js","static/page-FortuneWheelErrorModalContent.tsx-BcFUEOoT.js","static/page-FortuneWheelConditionsItem.tsx-u47WopXb.js","static/page-styles-CLvUmTNl.css","static/page-FortuneWheelContainer.tsx-BarZ5U6a.js","static/page-useConfigWheel.tsx-6Dft0d7F.js","static/page-fortuneWheel.ts-B2ztcL_U.js","static/page-useWheelAvailable.tsx-dZiG75mt.js","static/page-FortuneWheelErrorModalContent-BFVkXo22.css","static/page-FortuneWheelWinModalContent-nEuHBONv.css","static/page-hooks.ts-x8AorngF.js","static/page-FortuneWheelConditionsModal.tsx-BR_U697m.js","static/page-FortuneWheelConditionsModalContent.tsx-BIs0vMMF.js","static/page-FortuneWheelConditionsModal-BW25NRgp.css","static/page-RewardsItem.skeleton.tsx-CwzrNyeh.js","static/page-useWheelSpin.ts-CR8ZGR7x.js","static/page-easing.ts-qWcoVlrb.js","static/page-animation.ts-s8nj4IKz.js","static/page-math.ts-ELjSTDm6.js","static/page-geometry.ts-DTjSgsdU.js","static/page-useFortuneWheelSpinMutation.ts-B0nw1Ml6.js","static/page-wheel.ts-iP8trLQk.js","static/page-index-BgWFFKxn.css","static/page-styley-CfBxOYOg.css"])))=>i.map(i=>d[i]);
import{r as u,e as V,f as M,s as K,b as R,c as y,j as i,g as G,a as W,h as j,i as J,k as Q}from"./vendor-DWiUHYZz.js";import"./page-FortuneWheel.ts-CaqHFvhq.js";import{P as X}from"./page-FortuneWheelConditionsModal.tsx-BR_U697m.js";import{u as Z}from"./page-FortuneWheelConditionsItem.tsx-u47WopXb.js";import{F as ee}from"./page-FortuneWheelConditionsModalContent.tsx-BIs0vMMF.js";/* empty css */try{let n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new n.Error().stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="87353417-43ab-4944-a99b-ee1c8b779b81",n._sentryDebugIdIdentifier="sentry-dbid-87353417-43ab-4944-a99b-ee1c8b779b81")}catch{}const te="modulepreload",ne=function(n){return"/"+n},D={},A=function(t,o,m){let f=Promise.resolve();if(o&&o.length>0){document.getElementsByTagName("link");const e=document.querySelector("meta[property=csp-nonce]"),l=(e==null?void 0:e.nonce)||(e==null?void 0:e.getAttribute("nonce"));f=Promise.allSettled(o.map(r=>{if(r=ne(r),r in D)return;D[r]=!0;const h=r.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${r}"]${p}`))return;const d=document.createElement("link");if(d.rel=h?"stylesheet":te,h||(d.as="script"),d.crossOrigin="",d.href=r,l&&d.setAttribute("nonce",l),document.head.appendChild(d),h)return new Promise((w,b)=>{d.addEventListener("load",w),d.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${r}`)))})}))}function a(e){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=e,window.dispatchEvent(l),!l.defaultPrevented)throw e}return f.then(e=>{for(const l of e||[])l.status==="rejected"&&a(l.reason);return t().catch(a)})},se=n=>{const{refs:t=[],handler:o,isDisable:m=!1}=n;u.useEffect(()=>{if(!m){const f=a=>{var l;let e=!1;for(let r=0;r<t.length;r++)(!t[r].current||t[r].current&&((l=t[r].current)!=null&&l.contains(a.target)))&&(e=!0);e||o(a)};return document.addEventListener("mousedown",f),document.addEventListener("touchstart",f),()=>{document.removeEventListener("mousedown",f),document.removeEventListener("touchstart",f)}}},[t,o,m])},oe=V()(M(n=>({isOpen:!1,isDialogWindowOpen:!1,setIsOpen:t=>{n({isOpen:t})},setIsDialogWindowOpen:t=>{n({isDialogWindowOpen:t})}}),{name:"DialogWindowStore"}),K),re=u.lazy(()=>A(()=>import("./arrow-left-n7w8BOwo.js"),__vite__mapDeps([0,1,2,3]))),ie=u.lazy(()=>A(()=>import("./page-index.tsx-GO22z0Zp.js").then(n=>n.cP),__vite__mapDeps([4,2,1,3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28]))),ae=n=>{const{backText:t,title:o,titleComponent:m,className:f,onBack:a,onClose:e}=n,l=Z(),r=R(),h=_=>{_.preventDefault(),a&&a()},p=_=>{_.preventDefault(),e&&e()},d=y("PageTitle",f,{withBackText:!!t,withoutClose:!e&&!a,withTitle:!!o&&(!!a||!!e),onlyTitle:!a&&!e}),w=y("PageTitle__title",{onlyTitle:!a&&!e}),b=y("PageTitle__back",{onlyTitle:!a&&!e}),x=o!=="wheel.popup.again.header"&&(r==null?void 0:r.pathname.includes("chicks-azerbaijan"));return i.jsxs("div",{className:d,children:[i.jsxs("button",{type:"button",className:b,onClick:h,children:[a&&i.jsx(u.Suspense,{fallback:"",children:i.jsx(re,{})})," ",t&&i.jsx("div",{className:"PageTitle__back_text",children:l(t)})]}),i.jsx("div",{className:w,children:o&&(typeof o=="string"?l(o):o)}),!!m&&m,!e&&a&&i.jsx("div",{className:"PageTitle__back_placeholder"}),(e||x)&&i.jsx("button",{type:"button",className:"PageTitle__close",onClick:p,children:i.jsx(u.Suspense,{fallback:"",children:i.jsx(ie,{})})})]})},N="ReactModal__Body--open",le=n=>{const{children:t,height:o="max",variation:m="primary",title:f,onClose:a,className:e,classNameHeader:l,classNameChildren:r,lock:h=!1,bottomOffset:p=76,closeOnOutsideClick:d=!1}=n,w=R(),[b,x]=u.useState(()=>typeof o=="number"?o:0),[_,H]=u.useState(0),I=oe(s=>s.isDialogWindowOpen);u.useEffect(()=>{L({canceled:!0})},[]),u.useEffect(()=>(document.body.classList.add(N),()=>{document.body.classList.remove(N)}),[]);const S=u.useMemo(()=>o==="max"?window.innerHeight-85:b+p,[o,b,p]),[{y:k},C]=G(()=>({y:S})),$=W(),P=u.useRef(null),c=u.useRef(null);u.useEffect(()=>{if(o==="auto"&&t){const s=c.current.childNodes;let g=0;for(let v=0;v<s.length;v++)g+=s[v].clientHeight;x(g)}},[o,t]);const L=({canceled:s})=>{C.start({y:0,immediate:!1,config:s?j.default:j.stiff})},E=(s=0)=>{h||(C.start({y:S,immediate:!1,config:{...j.stiff,velocity:s}}),setTimeout(()=>{a?a():$(w.pathname)},500))};u.useEffect(()=>{const s=g=>{H(g.target.scrollTop)};return c.current&&c.current.addEventListener("scroll",s),()=>{c.current&&c.current.removeEventListener("scroll",s)}},[]);const O=s=>{if(!s.touches||s.touches.length<1||!s.touches[0].clientY)return;const g=s.touches[0].clientY;c.current&&_===c.current.scrollHeight-c.current.clientHeight&&g<s.touches[0].clientY&&s.preventDefault()};u.useEffect(()=>(c.current&&c.current.addEventListener("touchmove",O,{passive:!1}),()=>{c.current&&c.current.removeEventListener("touchmove",O)}),[_]);const z=J(({event:s,last:g,velocity:[,v],direction:[,q],offset:[,T],cancel:B,canceled:U})=>{if(c.current&&c.current.contains(s.target)||h){B();return}T<-70&&B(),g?T>S*.5||v>.5&&q>0?E(v):L({canceled:U}):C.start({y:T,immediate:!0})},{from:()=>[0,k.get()],filterTaps:!0,bounds:{top:0},rubberband:!0}),F=y("BottomSheet__content",e,{[`BottomSheet__content_${m}`]:m});se({refs:[P],handler:()=>{!d||I||E(0)}});const Y=()=>navigator.userAgent.toLowerCase().indexOf("samsungbrowser")!==-1;return i.jsx(X,{children:i.jsx("div",{className:"BottomSheet",children:i.jsxs(Q.div,{className:F,ref:P,...z(),style:{height:`${Y()?window.innerHeight-85:S}px`,bottom:"0px",y:k},children:[!h&&i.jsx("div",{className:"BottomSheet__swipe"}),i.jsx("div",{className:y("BottomSheet__header",l),children:i.jsx(ae,{title:f,onClose:h?null:()=>E(0)})}),i.jsx("div",{ref:c,className:y("BottomSheet__children",r),children:t})]})})})},ce=()=>{const n=W(),t=()=>{n(-1)};return i.jsx(le,{title:"wheel.fortune.faq.header",height:"auto",onClose:t,children:i.jsx(ee,{})})},pe=Object.freeze(Object.defineProperty({__proto__:null,default:ce},Symbol.toStringTag,{value:"Module"}));export{le as B,pe as F,ae as P,A as _,oe as a,se as u};