import{r as e,j as t,_ as r,i as n,e as i}from"./react-CuSWQC63.js";import{j as s,s as o,a$ as a,h as c,ao as l,f as u,l as p,o as d,q as h,m as f,X as x,t as m,N as g,E as y,a2 as w,b0 as j}from"./index-sxfoHTdX.js";import{i as v,g as b,D as S,G as T,V as k}from"./HelpMenu-BEjRzwyZ.js";import{u as M,g as P,o as C,f as I,I as E,c as W,T as H}from"./index-DydNkH15.js";import{F as D}from"./FAQIco-DZ7xOUXD.js";import{L as X,W as L}from"./WarningIco-BfNAqCNh.js";import{C as Y}from"./ContactContext-D-vZaj7I.js";import{L as z}from"./Link-BWdz5ksz.js";import{_ as R}from"./history-CBi_mSPs.js";import{S as B}from"./Stack-k6rHUe2m.js";import{D as A}from"./Divider-B0Cr_s9Z.js";function F(r){const{children:n,defer:i=!1,fallback:o=null}=r,[a,c]=e.useState(!1);return s((()=>{i||c(!0)}),[i]),e.useEffect((()=>{i&&c(!0)}),[i]),t.jsx(e.Fragment,{children:a?n:o})}const O=["anchor","classes","className","width","style"],N=o("div",{shouldForwardProp:a})((({theme:e,ownerState:t})=>R({position:"fixed",top:0,left:0,bottom:0,zIndex:e.zIndex.drawer-1},"left"===t.anchor&&{right:"auto"},"right"===t.anchor&&{left:"auto",right:0},"top"===t.anchor&&{bottom:"auto",right:0},"bottom"===t.anchor&&{top:"auto",bottom:0,right:0}))),V=e.forwardRef((function(e,i){const{anchor:s,classes:o={},className:a,width:l,style:u}=e,p=r(e,O),d=e;return t.jsx(N,R({className:n("PrivateSwipeArea-root",o.root,o[`anchor${c(s)}`],a),ref:i,style:R({[v(s)?"width":"height"]:l},u),ownerState:d},p))})),$=["BackdropProps"],q=["anchor","disableBackdropTransition","disableDiscovery","disableSwipeToOpen","hideBackdrop","hysteresis","allowSwipeInChildren","minFlingVelocity","ModalProps","onClose","onOpen","open","PaperProps","SwipeAreaProps","swipeAreaWidth","transitionDuration","variant"];let U=null;function _(e,t,r){return"right"===e?r.body.offsetWidth-t[0].pageX:t[0].pageX}function G(e,t,r){return"bottom"===e?r.innerHeight-t[0].clientY:t[0].clientY}function Q(e,t){return e?t.clientWidth:t.clientHeight}function Z(e,t,r,n){return Math.min(Math.max(r?t-e:n+t-e,0),n)}const J="undefined"!=typeof navigator&&/iPad|iPhone|iPod/.test(navigator.userAgent),K=e.forwardRef((function(n,o){const a=l({name:"MuiSwipeableDrawer",props:n}),c=M(),d={enter:c.transitions.duration.enteringScreen,exit:c.transitions.duration.leavingScreen},{anchor:h="left",disableBackdropTransition:f=!1,disableDiscovery:x=!1,disableSwipeToOpen:m=J,hideBackdrop:g,hysteresis:y=.52,allowSwipeInChildren:w=!1,minFlingVelocity:j=450,ModalProps:{BackdropProps:T}={},onClose:k,onOpen:E,open:W=!1,PaperProps:H={},SwipeAreaProps:D,swipeAreaWidth:X=20,transitionDuration:L=d,variant:Y="temporary"}=a,z=r(a.ModalProps,$),B=r(a,q),[A,O]=e.useState(!1),N=e.useRef({isSwiping:null}),K=e.useRef(),ee=e.useRef(),te=e.useRef(),re=u(H.ref,te),ne=e.useRef(!1),ie=e.useRef();s((()=>{ie.current=null}),[W]);const se=e.useCallback(((e,t={})=>{const{mode:r=null,changeTransition:n=!0}=t,i=b(c,h),s=-1!==["right","bottom"].indexOf(i)?1:-1,o=v(h),a=o?`translate(${s*e}px, 0)`:`translate(0, ${s*e}px)`,l=te.current.style;l.webkitTransform=a,l.transform=a;let u="";if(r&&(u=c.transitions.create("all",P({easing:void 0,style:void 0,timeout:L},{mode:r}))),n&&(l.webkitTransition=u,l.transition=u),!f&&!g){const t=ee.current.style;t.opacity=1-e/Q(o,te.current),n&&(t.webkitTransition=u,t.transition=u)}}),[h,f,g,c,L]),oe=p((e=>{if(!ne.current)return;if(U=null,ne.current=!1,i.flushSync((()=>{O(!1)})),!N.current.isSwiping)return void(N.current.isSwiping=null);N.current.isSwiping=null;const t=b(c,h),r=v(h);let n;n=r?_(t,e.changedTouches,C(e.currentTarget)):G(t,e.changedTouches,I(e.currentTarget));const s=r?N.current.startX:N.current.startY,o=Q(r,te.current),a=Z(n,s,W,o),l=a/o;Math.abs(N.current.velocity)>j&&(ie.current=1e3*Math.abs((o-a)/N.current.velocity)),W?N.current.velocity>j||l>y?k():se(0,{mode:"exit"}):N.current.velocity<-j||1-l>y?E():se(Q(r,te.current),{mode:"enter"})})),ae=(e=!1)=>{if(!A){!e&&x&&w||i.flushSync((()=>{O(!0)}));const t=v(h);!W&&te.current&&se(Q(t,te.current)+(x?15:-20),{changeTransition:!1}),N.current.velocity=0,N.current.lastTime=null,N.current.lastTranslate=null,N.current.paperHit=!1,ne.current=!0}},ce=p((e=>{if(!te.current||!ne.current)return;if(null!==U&&U!==N.current)return;ae(!0);const t=b(c,h),r=v(h),n=_(t,e.touches,C(e.currentTarget)),i=G(t,e.touches,I(e.currentTarget));if(W&&te.current.contains(e.target)&&null===U){const t=function({domTreeShapes:e,start:t,current:r,anchor:n}){const i={x:"scrollLeft",y:"scrollTop"},s={x:"scrollWidth",y:"scrollHeight"},o={x:"clientWidth",y:"clientHeight"};return e.some((e=>{let a=r>=t;"top"!==n&&"left"!==n||(a=!a);const c="left"===n||"right"===n?"x":"y",l=Math.round(e[i[c]]),u=l>0,p=l+e[o[c]]<e[s[c]];return!!(a&&p||!a&&u)}))}({domTreeShapes:function(e,t){const r=[];for(;e&&e!==t.parentElement;){const n=I(t).getComputedStyle(e);"absolute"===n.getPropertyValue("position")||"hidden"===n.getPropertyValue("overflow-x")||(e.clientWidth>0&&e.scrollWidth>e.clientWidth||e.clientHeight>0&&e.scrollHeight>e.clientHeight)&&r.push(e),e=e.parentElement}return r}(e.target,te.current),start:r?N.current.startX:N.current.startY,current:r?n:i,anchor:h});if(t)return void(U=!0);U=N.current}if(null==N.current.isSwiping){const t=Math.abs(n-N.current.startX),s=Math.abs(i-N.current.startY),o=r?t>s&&t>3:s>t&&s>3;if(o&&e.cancelable&&e.preventDefault(),!0===o||(r?s>3:t>3)){if(N.current.isSwiping=o,!o)return void oe(e);N.current.startX=n,N.current.startY=i,x||W||(r?N.current.startX-=20:N.current.startY-=20)}}if(!N.current.isSwiping)return;const s=Q(r,te.current);let o=r?N.current.startX:N.current.startY;W&&!N.current.paperHit&&(o=Math.min(o,s));const a=Z(r?n:i,o,W,s);if(W)if(N.current.paperHit)0===a&&(N.current.startX=n,N.current.startY=i);else{if(!(r?n<s:i<s))return;N.current.paperHit=!0,N.current.startX=n,N.current.startY=i}null===N.current.lastTranslate&&(N.current.lastTranslate=a,N.current.lastTime=performance.now()+1);const l=(a-N.current.lastTranslate)/(performance.now()-N.current.lastTime)*1e3;N.current.velocity=.4*N.current.velocity+.6*l,N.current.lastTranslate=a,N.current.lastTime=performance.now(),e.cancelable&&e.preventDefault(),se(a)})),le=p((e=>{if(e.defaultPrevented)return;if(e.defaultMuiPrevented)return;if(W&&(g||!ee.current.contains(e.target))&&!te.current.contains(e.target))return;const t=b(c,h),r=v(h),n=_(t,e.touches,C(e.currentTarget)),i=G(t,e.touches,I(e.currentTarget));if(!W){var s;if(m||!(e.target===K.current||null!=(s=te.current)&&s.contains(e.target)&&("function"==typeof w?w(e,K.current,te.current):w)))return;if(r){if(n>X)return}else if(i>X)return}e.defaultMuiPrevented=!0,U=null,N.current.startX=n,N.current.startY=i,ae()}));return e.useEffect((()=>{if("temporary"===Y){const e=C(te.current);return e.addEventListener("touchstart",le),e.addEventListener("touchmove",ce,{passive:!W}),e.addEventListener("touchend",oe),()=>{e.removeEventListener("touchstart",le),e.removeEventListener("touchmove",ce,{passive:!W}),e.removeEventListener("touchend",oe)}}}),[Y,W,le,ce,oe]),e.useEffect((()=>()=>{U===N.current&&(U=null)}),[]),e.useEffect((()=>{W||O(!1)}),[W]),t.jsxs(e.Fragment,{children:[t.jsx(S,R({open:!("temporary"!==Y||!A)||W,variant:Y,ModalProps:R({BackdropProps:R({},T,{ref:ee})},"temporary"===Y&&{keepMounted:!0},z),hideBackdrop:g,PaperProps:R({},H,{style:R({pointerEvents:"temporary"!==Y||W||w?"":"none"},H.style),ref:re}),anchor:h,transitionDuration:ie.current||L,onClose:k,ref:o},B)),!m&&"temporary"===Y&&t.jsx(F,{children:t.jsx(V,R({anchor:h,ref:K,width:X},D))})]})})),ee=d((function({target:e,href:r,Ico:n,intlId:i,onClick:s,component:o,margin:a,fontSize:c="small",title:l}){return t.jsx(z,{target:e,sx:{cursor:"pointer",margin:a},href:r,onClick:s,underline:"none",color:h.white,fontSize:c,fontWeight:500,component:o,children:t.jsxs(f,{sx:{display:"flex",ml:"16px",alignItems:"center"},children:[t.jsx(n,{}),t.jsx(x,{size:c,color:"gray",margin:"0 0 0 16px",weight:500,align:"center",children:m(i)+" "+(l?m(l):"")})]})})})),te=d((({open:r,setOpen:n,title:i})=>{const{onClickContactUs:s}=e.useContext(Y),o=e=>{n(!1),s(e)};return t.jsx(K,{sx:{"& .MuiPaper-root":{borderRadius:"0 0 18px 0"}},anchor:"left",open:r,onClose:()=>n(!1),onOpen:()=>n(!0),children:t.jsxs(f,{sx:{"& .MuiTypography-root":{color:"gray"}},children:[t.jsxs(f,{sx:{backgroundColor:h.red,height:"100px",pb:2,width:g.isMobile?"272px":"329px",display:"flex",flexDirection:"column",alignItems:"end"},children:[t.jsx(E,{sx:{"& .MuiSvgIcon-root":{color:"white"}},"aria-label":"close",onClick:()=>n(!1),children:t.jsx(W,{})}),t.jsx(f,{sx:{display:"flex",justifyContent:"center",width:"100%"},children:t.jsx(H,{text:m("help"),sx:{color:"white !important"}})})]}),t.jsx(B,{width:"235px",gap:"30px",children:t.jsx(ee,{Ico:D,intlId:"faq",onClick:()=>y.push(String(w("route.faq"))),component:"span",margin:"32px 0 0 0",fontSize:"micro"})}),t.jsx(A,{sx:{my:"30px",mx:"15px",width:g.isMobile?"240px":"297px",borderWidth:"2px 0 thin"}}),t.jsxs(B,{width:"235px",gap:"30px",children:[t.jsxs(f,{onClick:()=>o("oMyOpinion"),sx:{display:"flex",ml:"16px",alignItems:"center","& .like-enjoty":{textWrap:"nowrap"}},children:[t.jsx(X,{}),t.jsx(x,{className:"like-enjoty",size:"micro",color:"gray",margin:"0 0 0 16px",weight:500,align:"center",children:m("likeEnjoty")})]}),t.jsxs(f,{onClick:()=>o("oNewFeat"),sx:{display:"flex",ml:"16px",alignItems:"center"},children:[t.jsx(T,{}),t.jsx(x,{size:"micro",color:"gray",margin:"0 0 0 16px",weight:500,align:"center",children:m("shareIdeas")})]})]}),t.jsx(A,{sx:{my:"30px",mx:"15px",width:g.isMobile?"240px":"297px",borderWidth:"2px 0 thin"}}),t.jsx(B,{width:"235px",children:t.jsxs(f,{onClick:()=>o("oReport"),sx:{display:"flex",ml:"16px",alignItems:"center"},children:[t.jsx(L,{}),t.jsx(x,{size:"micro",color:"gray",margin:"0 0 0 16px",weight:500,align:"center",children:m("reportError")})]})}),t.jsx(A,{sx:{mt:"30px",mx:"15px",width:g.isMobile?"240px":"297px",borderWidth:"2px 0 thin"}}),t.jsx(f,{sx:{ml:"16px",mt:1,"& .MuiBox-root":{textAlign:"start"}},children:t.jsx(k,{})})]})})})),re=async()=>{await j({reloadIfNoUpdate:!1})},ne=()=>{const t=e.useMemo((()=>re),[]);e.useEffect((()=>{t()}),[])};export{te as H,ee as L,K as S,re as r,ne as u};