1import{r as t,K as F,j as s,N as P,O as V,Q as q,T as A,V as D,W as K,X as U,m as M,Y as W,Z as B,_ as H,B as X,$ as Y}from"./index-CKZfkHs8.js";function T(e,o){if(typeof e=="function")return e(o);e!=null&&(e.current=o)}function G(...e){return o=>{let n=!1;const i=e.map(c=>{const a=T(c,o);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let c=0;c<i.length;c++){const a=i[c];typeof a=="function"?a():T(e[c],null)}}}}function Z(...e){return t.useCallback(G(...e),e)}class J extends t.Component{getSnapshotBeforeUpdate(o){const n=this.props.childRef.current;if(P(n)&&o.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const i=n.offsetParent,c=P(i)&&i.offsetWidth||0,a=P(i)&&i.offsetHeight||0,p=getComputedStyle(n),r=this.props.sizeRef.current;r.height=parseFloat(p.height),r.width=parseFloat(p.width),r.top=n.offsetTop,r.left=n.offsetLeft,r.right=c-r.width-r.left,r.bottom=a-r.height-r.top}return null}componentDidUpdate(){}render(){return this.props.children}}function Q({children:e,isPresent:o,anchorX:n,anchorY:i,root:c,pop:a}){const p=t.useId(),r=t.useRef(null),j=t.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:y}=t.useContext(F),d=e.props?.ref??e?.ref,v=Z(r,d);return t.useInsertionEffect(()=>{const{width:l,height:m,top:x,left:g,right:C,bottom:f}=j.current;if(o||a===!1||!r.current||!l||!m)return;const w=n==="left"?`left: ${g}`:`right: ${C}`,N=i==="bottom"?`bottom: ${f}`:`top: ${x}`;r.current.dataset.motionPopId=p;const h=document.createElement("style");y&&(h.nonce=y);const R=c??document.head;return R.appendChild(h),h.sheet&&h.sheet.insertRule(` 2 [data-motion-pop-id="${p}"] { 3 position: absolute !important; 4 width: ${l}px !important; 5 height: ${m}px !important; 6 ${w}px !important; 7 ${N}px !important; 8 } 9 `),()=>{R.contains(h)&&R.removeChild(h)}},[o]),s.jsx(J,{isPresent:o,childRef:r,sizeRef:j,pop:a,children:a===!1?e:t.cloneElement(e,{ref:v})})}const ee=({children:e,initial:o,isPresent:n,onExitComplete:i,custom:c,presenceAffectsLayout:a,mode:p,anchorX:r,anchorY:j,root:y})=>{const d=V(te),v=t.useId();let l=!0,m=t.useMemo(()=>(l=!1,{id:v,initial:o,isPresent:n,custom:c,onExitComplete:x=>{d.set(x,!0);for(const g of d.values())if(!g)return;i&&i()},register:x=>(d.set(x,!1),()=>d.delete(x))}),[n,d,i]);return a&&l&&(m={...m}),t.useMemo(()=>{d.forEach((x,g)=>d.set(g,!1))},[n]),t.useEffect(()=>{!n&&!d.size&&i&&i()},[n]),e=s.jsx(Q,{pop:p==="popLayout",isPresent:n,anchorX:r,anchorY:j,root:y,children:e}),s.jsx(q.Provider,{value:m,children:e})};function te(){return new Map}const _=e=>e.key||"";function $(e){const o=[];return t.Children.forEach(e,n=>{t.isValidElement(n)&&o.push(n)}),o}const se=({children:e,custom:o,initial:n=!0,onExitComplete:i,presenceAffectsLayout:c=!0,mode:a="sync",propagate:p=!1,anchorX:r="left",anchorY:j="top",root:y})=>{const[d,v]=A(p),l=t.useMemo(()=>$(e),[e]),m=p&&!d?[]:l.map(_),x=t.useRef(!0),g=t.useRef(l),C=V(()=>new Map),f=t.useRef(new Set),[w,N]=t.useState(l),[h,R]=t.useState(l);D(()=>{x.current=!1,g.current=l;for(let b=0;b<h.length;b++){const u=_(h[b]);m.includes(u)?(C.delete(u),f.current.delete(u)):C.get(u)!==!0&&C.set(u,!1)}},[h,m.length,m.join("-")]);const S=[];if(l!==w){let b=[...l];for(let u=0;u<h.length;u++){const E=h[u],k=_(E);m.includes(k)||(b.splice(u,0,E),S.push(E))}return a==="wait"&&S.length&&(b=S),R($(b)),N(l),null}const{forceRender:L}=t.useContext(K);return s.jsx(s.Fragment,{children:h.map(b=>{const u=_(b),E=p&&!d?!1:l===h||m.includes(u),k=()=>{if(f.current.has(u))return;if(f.current.add(u),C.has(u))C.set(u,!0);else return;let z=!0;C.forEach(O=>{O||(z=!1)}),z&&(L?.(),R(g.current),p&&v?.(),i&&i())};return s.jsx(ee,{isPresent:E,initial:!x.current||n?void 0:!1,custom:o,presenceAffectsLayout:c,mode:a,root:y,onExitComplete:E?void 0:k,anchorX:r,anchorY:j,children:b},u)})})},ne=1,re="f2089aae-6a37-4033-abf1-8c5f23fe5dd0",oe="42069f03-7056-4c9d-a683-5f767b76fee5",ie="/__l5e/assets-v1/f2089aae-6a37-4033-abf1-8c5f23fe5dd0/Vignette_1.png",ae="a/v1/42069f03-7056-4c9d-a683-5f767b76fee5/f2089aae-6a37-4033-abf1-8c5f23fe5dd0/Vignette_1.png",ce="Vignette_1.png",le=20577,ue="image/png",de="2026-08-27T17:06:41Z",fe={version:ne,asset_id:re,project_id:oe,url:ie,r2_key:ae,original_filename:ce,size:le,content_type:ue,created_at:de},I="ora_popup_seen",pe=U().trim().email().max(255),he=()=>{const[e,o]=t.useState(!1),[n,i]=t.useState(""),[c,a]=t.useState(!1),[p,r]=t.useState(!1),[j,y]=t.useState(null),[d,v]=t.useState(null),[l,m]=t.useState(!1);t.useEffect(()=>{if(typeof window>"u"||localStorage.getItem(I)==="true")return;const f=setTimeout(()=>
9o(!0),3e3);return()=>clearTimeout(f)},[]);const x=()=>{try{localStorage.setItem(I,"true")}catch{}},g=()=>{x(),o(!1)},C=async f=>{f.preventDefault(),y(null),v(null);const w=pe.safeParse(n);if(!w.success){y("Merci d'entrer une adresse email valide.");return}if(!c){v("Veuillez accepter pour continuer.");return}r(!0);const{error:N}=await Y.functions.invoke("submit-newsletter",{body:{email:w.data,consent:!0,source:"Popup surprise"}});if(r(!1),N){y("Une erreur est survenue, merci de réessayer.");return}m(!0),x(),setTimeout(()=>o(!1),2e3)};return s.jsx(se,{children:e&&s.jsx(M.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",onClick:g,children:s.jsxs(M.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.25,ease:"easeOut"},onClick:f=>f.stopPropagation(),className:"relative w-full max-w-md rounded-2xl bg-card text-card-foreground shadow-xl p-8",children:[s.jsx("button",{onClick:g,"aria-label":"Fermer",className:"absolute top-3 right-3 p-2 rounded-full hover:bg-muted transition-colors",children:s.jsx(W,{className:"h-5 w-5"})}),s.jsxs("div",{className:"flex flex-col items-center text-center",children:[s.jsx("div",{className:"flex h-14 w-14 items-center justify-center rounded-full bg-secondary text-secondary-foreground mb-4 overflow-hidden",children:s.jsx("img",{src:fe.url,alt:"",className:"h-10 w-10 object-contain",width:40,height:40})}),s.jsx("h2",{className:"text-2xl mb-2",children:"Une surprise vous attend"}),s.jsx("p",{className:"text-muted-foreground mb-6",children:"Reçois une surprise en rejoignant la communauté ORA"}),l?s.jsx("p",{className:"text-primary font-medium py-4",children:"C'est noté ! Vérifiez votre boîte mail ð"}):s.jsxs("form",{onSubmit:C,className:"w-full space-y-3",children:[s.jsx(B,{type:"email",required:!0,value:n,onChange:f=>i(f.target.value),placeholder:"[email protected]",className:"w-full rounded-full h-11 px-5"}),j&&s.jsx("p",{className:"text-sm text-destructive",children:j}),s.jsxs("div",{className:"flex items-start gap-2 text-left",children:[s.jsx(H,{id:"newsletter-consent",checked:c,onCheckedChange:f=>{a(f===!0),f===!0&&v(null)},className:"mt-1"}),s.jsxs("label",{htmlFor:"newsletter-consent",className:"text-sm text-muted-foreground leading-snug cursor-pointer",children:["J'accepte de recevoir des emails de l'école ORA et comprends que je peux me désinscrire à tout moment. Voir notre"," ",s.jsx("a",{href:"/politique-de-confidentialite",className:"underline hover:text-foreground",children:"politique de confidentialité"}),"."]})]}),d&&s.jsx("p",{className:"text-sm text-destructive text-left",children:d}),s.jsx(X,{type:"submit",disabled:p,className:"w-full rounded-full h-11",children:p?"Envoiâ¦":"Découvrir ma surprise â"}),s.jsx("button",{type:"button",onClick:g,className:"text-sm text-muted-foreground underline-offset-4 hover:underline",children:"Non merci"})]})]})]})})})};export{he 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.