const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["static/arrow-left-M6ND7etQ.js","static/vendor-CmAScyG3.js","static/page-FortuneWheel.ts-CaqHFvhq.js","static/vendor-CV3Dtpuz.css","static/page-index.tsx-D0oEuWOa.js","static/page-FortuneWheelWinModalContent.tsx-DESnY6qd.js","static/page-FortuneWheelErrorModalContent.tsx-Co-GL7n3.js","static/page-FortuneWheelConditionsItem.tsx-uvuttlGf.js","static/page-styles-CSMityW2.css","static/page-FortuneWheelContainer.tsx-BbtPZTCU.js","static/page-useConfigWheel.tsx-CttGGJtP.js","static/page-fortuneWheel.ts-BU2wXqek.js","static/page-useWheelAvailable.tsx-DKmHJibQ.js","static/page-FortuneWheelErrorModalContent-DIIzmEwQ.css","static/page-FortuneWheelWinModalContent-nEuHBONv.css","static/page-hooks.ts-B3LIko35.js","static/page-FortuneWheelConditionsModal.tsx-D_uhAHZD.js","static/page-FortuneWheelConditionsModalContent.tsx-DvuGHagd.js","static/page-FortuneWheelConditionsModal-BJVxOTnN.css","static/page-RewardsItem.skeleton.tsx-CqQjsubz.js","static/page-useWheelSpin.ts-DuvCtVSh.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-DO-x7GCP.js","static/page-wheel.ts-iP8trLQk.js","static/page-index-CdUZZLLp.css","static/page-styley-Dgu-T8SG.css"])))=>i.map(i=>d[i]);
import{r as u,e as Y,f as U,s as V,b as O,c as b,j as i,g as M,a as W,h as j,i as G,k as J}from"./vendor-CmAScyG3.js";import"./page-FortuneWheel.ts-CaqHFvhq.js";import{P as K}from"./page-FortuneWheelConditionsModal.tsx-D_uhAHZD.js";import{u as Q}from"./page-FortuneWheelConditionsItem.tsx-uvuttlGf.js";import{F as X}from"./page-FortuneWheelConditionsModalContent.tsx-DvuGHagd.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]="b2ff2196-e455-4f64-83ee-f4987fa4a50f",n._sentryDebugIdIdentifier="sentry-dbid-b2ff2196-e455-4f64-83ee-f4987fa4a50f")}catch{}const Z="modulepreload",ee=function(n){return"/"+n},B={},R=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=ee(r),r in B)return;B[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":Z,h||(d.as="script"),d.crossOrigin="",d.href=r,l&&d.setAttribute("nonce",l),document.head.appendChild(d),h)return new Promise((v,y)=>{d.addEventListener("load",v),d.addEventListener("error",()=>y(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)})},te=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])},ne=Y()(U(n=>({isOpen:!1,isDialogWindowOpen:!1,setIsOpen:t=>{n({isOpen:t})},setIsDialogWindowOpen:t=>{n({isDialogWindowOpen:t})}}),{name:"DialogWindowStore"}),V),se=u.lazy(()=>R(()=>import("./arrow-left-M6ND7etQ.js"),__vite__mapDeps([0,1,2,3]))),oe=u.lazy(()=>R(()=>import("./page-index.tsx-D0oEuWOa.js").then(n=>n.cF),__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]))),re=n=>{const{backText:t,title:o,titleComponent:m,className:f,onBack:a,onClose:e}=n,l=Q(),r=O(),h=w=>{w.preventDefault(),a&&a()},p=w=>{w.preventDefault(),e&&e()},d=b("PageTitle",f,{withBackText:!!t,withoutClose:!e&&!a,withTitle:!!o&&(!!a||!!e),onlyTitle:!a&&!e}),v=b("PageTitle__title",{onlyTitle:!a&&!e}),y=b("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:y,onClick:h,children:[a&&i.jsx(u.Suspense,{fallback:"",children:i.jsx(se,{})})," ",t&&i.jsx("div",{className:"PageTitle__back_text",children:l(t)})]}),i.jsx("div",{className:v,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(oe,{})})})]})},ie=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}=n,d=O(),[v,y]=u.useState(()=>typeof o=="number"?o:0),[x,w]=u.useState(0),H=ne(s=>s.isDialogWindowOpen);u.useEffect(()=>{D({canceled:!0})},[]);const E=u.useMemo(()=>o==="max"?window.innerHeight-85:v+p,[o,v,p]),[{y:k},S]=M(()=>({y:E})),I=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 _=0;_<s.length;_++)g+=s[_].clientHeight;y(g)}},[o,t]);const D=({canceled:s})=>{S.start({y:0,immediate:!1,config:s?j.default:j.stiff})},C=(s=0)=>{h||(S.start({y:E,immediate:!1,config:{...j.stiff,velocity:s}}),setTimeout(()=>{a?a():I(d.pathname)},500))};u.useEffect(()=>{const s=g=>{w(g.target.scrollTop)};return c.current&&c.current.addEventListener("scroll",s),()=>{c.current&&c.current.removeEventListener("scroll",s)}},[]);const L=s=>{if(!s.touches||s.touches.length<1||!s.touches[0].clientY)return;const g=s.touches[0].clientY;c.current&&x===c.current.scrollHeight-c.current.clientHeight&&g<s.touches[0].clientY&&s.preventDefault()};u.useEffect(()=>(c.current&&c.current.addEventListener("touchmove",L,{passive:!1}),()=>{c.current&&c.current.removeEventListener("touchmove",L)}),[x]);const A=G(({event:s,last:g,velocity:[,_],direction:[,z],offset:[,T],cancel:N,canceled:q})=>{if(c.current&&c.current.contains(s.target)||h){N();return}T<-70&&N(),g?T>E*.5||_>.5&&z>0?C(_):D({canceled:q}):S.start({y:T,immediate:!0})},{from:()=>[0,k.get()],filterTaps:!0,bounds:{top:0},rubberband:!0}),F=b("BottomSheet__content",e,{[`BottomSheet__content_${m}`]:m});te({refs:[P],handler:()=>{H||C(0)}});const $=()=>navigator.userAgent.toLowerCase().indexOf("samsungbrowser")!==-1;return i.jsx(K,{children:i.jsx("div",{className:"BottomSheet",children:i.jsxs(J.div,{className:F,ref:P,...A(),style:{height:`${$()?window.innerHeight-85:E}px`,bottom:"0px",y:k},children:[!h&&i.jsx("div",{className:"BottomSheet__swipe"}),i.jsx("div",{className:b("BottomSheet__header",l),children:i.jsx(re,{title:f,onClose:h?null:()=>C(0)})}),i.jsx("div",{ref:c,className:b("BottomSheet__children",r),children:t})]})})})},ae=()=>{const n=W(),t=()=>{n(-1)};return i.jsx(ie,{title:"wheel.fortune.faq.header",height:"auto",onClose:t,children:i.jsx(X,{})})},me=Object.freeze(Object.defineProperty({__proto__:null,default:ae},Symbol.toStringTag,{value:"Module"}));export{ie as B,me as F,re as P,R as _,ne as a,te as u};
//# sourceMappingURL=page-FortuneWheelConditionsSheet.tsx-CL4TGGoF.js.map