import{r as t,_ as e,j as n,h as o}from"./react-B_SyE9nW.js";import{g as i,a as r,s as a,a3 as s,c as l,e as c,f as u,o as p,y as d,V as m,n as x,w as h,a4 as g,R as f,m as j,B as C,N as b,j as y}from"./index-Flm6m8Wj.js";import{u as k,b as w,e as v,P as S,c as M,d as B,C as L,M as O,a as E,S as z}from"./index-C6Ujt1Uk.js";import{G as P,F as R}from"./styles-BKX5ijFq.js";import{C as T}from"./Checkbox-BITrmcY_.js";import{L as W}from"./Link-CWS9S-dL.js";import{B as D}from"./BtnSave-CKs5DUDn.js";import{B as F}from"./BtnGeneric-hJRP5-Ca.js";import{_ as A}from"./history-CBi_mSPs.js";import{C as N}from"./ClickAwayListener-BuHM2Upy.js";import{S as I}from"./Stack-CZ7Wid7r.js";import"./styled-components-D7wwngcN.js";import"./sentry-Br0bWdGN.js";import"./index-CWdensOV.js";import"./createSvgIcon-CaFwfqRU.js";import"./GlobalStyles-BvG5Cuz8.js";import"./SwitchBase-3Y_6lBhY.js";function H(t){return i("MuiSnackbarContent",t)}r("MuiSnackbarContent",["root","message","action"]);const G=["action","className","message","role"],$=a(S,{name:"MuiSnackbarContent",slot:"Root",overridesResolver:(t,e)=>e.root})((({theme:t})=>{const e="light"===t.palette.mode?.8:.98,n=s(t.palette.background.default,e);return A({},t.typography.body2,{color:t.vars?t.vars.palette.SnackbarContent.color:t.palette.getContrastText(n),backgroundColor:t.vars?t.vars.palette.SnackbarContent.bg:n,display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",borderRadius:(t.vars||t).shape.borderRadius,flexGrow:1,[t.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}})})),_=a("div",{name:"MuiSnackbarContent",slot:"Message",overridesResolver:(t,e)=>e.message})({padding:"8px 0"}),q=a("div",{name:"MuiSnackbarContent",slot:"Action",overridesResolver:(t,e)=>e.action})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),K=t.forwardRef((function(t,i){const r=l({props:t,name:"MuiSnackbarContent"}),{action:a,className:s,message:u,role:p="alert"}=r,d=e(r,G),m=r,x=(t=>{const{classes:e}=t;return c({root:["root"],action:["action"],message:["message"]},H,e)})(m);return n.jsxs($,A({role:p,square:!0,elevation:6,className:o(x.root,s),ownerState:m,ref:i},d,{children:[n.jsx(_,{className:x.message,ownerState:m,children:u}),a?n.jsx(q,{className:x.action,ownerState:m,children:a}):null]}))}));function Q(t){return i("MuiSnackbar",t)}r("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const U=["onEnter","onExited"],V=["action","anchorOrigin","autoHideDuration","children","className","ClickAwayListenerProps","ContentProps","disableWindowBlurListener","message","onBlur","onClose","onFocus","onMouseEnter","onMouseLeave","open","resumeHideDuration","TransitionComponent","transitionDuration","TransitionProps"],X=a("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`anchorOrigin${u(n.anchorOrigin.vertical)}${u(n.anchorOrigin.horizontal)}`]]}})((({theme:t,ownerState:e})=>A({zIndex:(t.vars||t).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center"},"top"===e.anchorOrigin.vertical?{top:8}:{bottom:8},"left"===e.anchorOrigin.horizontal&&{justifyContent:"flex-start"},"right"===e.anchorOrigin.horizontal&&{justifyContent:"flex-end"},{[t.breakpoints.up("sm")]:A({},"top"===e.anchorOrigin.vertical?{top:24}:{bottom:24},"center"===e.anchorOrigin.horizontal&&{left:"50%",right:"auto",transform:"translateX(-50%)"},"left"===e.anchorOrigin.horizontal&&{left:24,right:"auto"},"right"===e.anchorOrigin.horizontal&&{right:24,left:"auto"})}))),J=t.forwardRef((function(o,i){const r=l({props:o,name:"MuiSnackbar"}),a=M(),s={enter:a.transitions.duration.enteringScreen,exit:a.transitions.duration.leavingScreen},{action:p,anchorOrigin:{vertical:d,horizontal:m}={vertical:"bottom",horizontal:"left"},autoHideDuration:x=null,children:h,className:g,ClickAwayListenerProps:f,ContentProps:j,disableWindowBlurListener:C=!1,message:b,open:y,TransitionComponent:S=P,transitionDuration:L=s,TransitionProps:{onEnter:O,onExited:E}={}}=r,z=e(r.TransitionProps,U),R=e(r,V),T=A({},r,{anchorOrigin:{vertical:d,horizontal:m},autoHideDuration:x,disableWindowBlurListener:C,TransitionComponent:S,transitionDuration:L}),W=(t=>{const{classes:e,anchorOrigin:n}=t,o={root:["root",`anchorOrigin${u(n.vertical)}${u(n.horizontal)}`]};return c(o,Q,e)})(T),{getRootProps:D,onClickAway:F}=function(e={}){const{autoHideDuration:n=null,disableWindowBlurListener:o=!1,onClose:i,open:r,resumeHideDuration:a}=e,s=k();t.useEffect((()=>{if(r)return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)};function t(t){t.defaultPrevented||"Escape"!==t.key&&"Esc"!==t.key||null==i||i(t,"escapeKeyDown")}}),[r,i]);const l=w(((t,e)=>{null==i||i(t,e)})),c=w((t=>{i&&null!=t&&s.start(t,(()=>{l(null,"timeout")}))}));t.useEffect((()=>(r&&c(n),s.clear)),[r,n,c,s]);const u=s.clear,p=t.useCallback((()=>{null!=n&&c(null!=a?a:.5*n)}),[n,a,c]),d=t=>e=>{const n=t.onFocus;null==n||n(e),u()},m=t=>e=>{const n=t.onMouseEnter;null==n||n(e),u()},x=t=>e=>{const n=t.onMouseLeave;null==n||n(e),p()};return t.useEffect((()=>{if(!o&&r)return window.addEventListener("focus",p),window.addEventListener("blur",u),()=>{window.removeEventListener("focus",p),window.removeEventListener("blur",u)}}),[o,r,p,u]),{getRootProps:(t={})=>{const n=A({},v(e),v(t));return A({role:"presentation"},t,n,{onBlur:(o=n,t=>{const e=o.onBlur;null==e||e(t),p()}),onFocus:d(n),onMouseEnter:m(n),onMouseLeave:x(n)});var o},onClickAway:t=>{null==i||i(t,"clickaway")}}}(A({},T)),[I,H]=t.useState(!0),G=B({elementType:X,getSlotProps:D,externalForwardedProps:R,ownerState:T,additionalProps:{ref:i},className:[W.root,g]});return!y&&I?null:n.jsx(N,A({onClickAway:F},f,{children:n.jsx(X,A({},G,{children:n.jsx(S,A({appear:!0,in:y,timeout:L,direction:"top"===d?"down":"up",onEnter:(t,e)=>{H(!1),O&&O(t,e)},onExited:t=>{H(!0),E&&E(t)}},z,{children:h||n.jsx(K,A({message:b,action:p},j))}))}))}))}));const Y=p((function({control:t=n.jsx(T,{}),...e}){return n.jsx(R,{...e,control:t,labelPlacement:"start"})})),Z={"&":{fontSize:"12px",cursor:"pointer",m:"36px 0 20px","@media(min-width:768px)":{mt:"5px"},"@media(min-width:1366px)":{mb:"0"}}};const tt=p((function(){const e=t.useCallback((()=>{d.push(String(m("route.privacy")))}),[]);return n.jsx(W,{sx:Z,onClick:e,component:"span",children:x("privacyPolicy")})})),et=p((function({label:t,state:e}){return n.jsx(Y,{label:x(t),checked:e.value,onChange:(t,n)=>e.onChange(n)})}));const nt=p((function(){const{onAcceptCookies:e,form:{analytics:o}}=t.useContext(L),i=t.useCallback(((t,e)=>{!e&&h()}),[]),r=g.current!==m(String(f.Privacy));return n.jsxs(O,{open:j.isCookieConfig,onClose:i,title:x("cookieSettings"),titleSx:{"& .MuiTypography-root":{m:0}},sx:{"& .MuiPaper-root":{m:"10px",maxWidth:"355px"},"& .MuiDialogContent-root":{p:"20px","& label.MuiFormControlLabel-root":{pl:0,"& > span.MuiButtonBase-root":{p:"5px 0"}}}},footer:n.jsxs(C,{sx:{p:"0 20px 20px",display:"flex",justifyContent:r?"space-between":"end",alignItems:"center"},children:[r&&n.jsx(tt,{}),n.jsx(D,{onClick:()=>e(!0),sx:{"&&.MuiButton-root":{m:0}}})]}),children:[n.jsx(Y,{sx:{"&":{minHeight:"36px"}},label:x("essential"),checked:!0,control:n.jsxs(n.Fragment,{children:[n.jsx(T,{checked:!0,disabled:!0,sx:{"&":{visibility:"hidden",position:"absolute"}}}),n.jsx(b,{margin:"0 2px 0 0",align:"end",color:"green",children:x("alwaysOn")})]})}),n.jsx(et,{label:"analytics",state:o})]})})),ot={"&":{zIndex:1300,bottom:"78px","@media(min-width:1366px)":{bottom:"40px"},".MuiPaper-root":{color:y.white,maxWidth:"324px",width:"100%",p:"20px",display:"grid",gridTemplateColumns:"1fr","& img":{width:"auto",height:"77px"},"@media(min-width:768px)":{minWidth:"608px",gridTemplateColumns:"auto 1fr",columnGap:"30px",p:"36px 40px","& .MuiBox-root:first-of-type":{gridRow:"1/3"},"& img":{height:"127px"}},"@media(min-width:1366px)":{minWidth:"802px",gridTemplateColumns:"auto 1fr auto",columnGap:"16px",p:"20px 40px","& .MuiBox-root:first-of-type":{gridRow:"unset"},"& img":{height:"86px"}}}}};function it({children:t,...e}){return n.jsx(z,{...e,direction:"up",unmountOnExit:!0,children:t})}const rt=p((function(){const e=t.useContext(L);return n.jsx(J,{"data-test":"enj-modal-cookies",TransitionComponent:it,open:e.showNotice,anchorOrigin:{vertical:"bottom",horizontal:"center"},sx:ot,children:n.jsxs(S,{elevation:4,children:[n.jsx(C,{sx:{"&":{alignSelf:"center"}},children:n.jsx("img",{alt:"cookies config",src:"/assets/cookie-BSgtlPQU.svg",decoding:"async",loading:"lazy"})}),n.jsxs(I,{children:[n.jsx(E,{text:x("cookieManage"),color:"black",sx:{m:"0 0 7px"}}),n.jsx(E,{text:x("cookieDescription"),color:"gray",sx:{m:0,"@media(min-width:1366px)":{minWidth:"376px"}},size:"mini"}),n.jsx(tt,{})]}),n.jsxs(C,{sx:{"&":{display:"flex",alignItems:"center",justifyContent:"space-between","& > button.MuiButton-root":{m:0,minWidth:"120px",height:"32px",fontSize:"12px",fontWeight:"normal"},"@media(min-width:768px)":{justifyContent:"flex-start","& > button.MuiButton-root":{minWidth:"131px",height:"35px",fontSize:"14px","&:first-of-type":{mr:"10px"}}},"@media(min-width:1366px)":{flexDirection:"column-reverse",justifyContent:"center","& > button.MuiButton-root":{minWidth:"132px",height:"36px","&:first-of-type":{m:"10px 0 0"}}}}},children:[n.jsx(F,{onClick:e.onClickConfig,variant:"outlined",children:x("cookieConf")}),n.jsx(F,{"data-test":"enj-modal-cookies-button-accept",onClick:()=>e.onAcceptCookies(),children:x("acceptAll")})]})]})})}));const at=p((function(){const e=t.useContext(L);return t.useEffect((()=>{const t=setTimeout(e.init,2e3);return()=>clearTimeout(t)}),[]),/Enjoty-Rendertron|HeadlessChrome/.test(navigator.userAgent)?n.jsx(n.Fragment,{children:n.jsx(n.Fragment,{})}):n.jsxs(n.Fragment,{children:[e.form?n.jsx(nt,{}):n.jsx(n.Fragment,{}),n.jsx(rt,{})]})}));export{at as default};