PageSourceSearch

https://www.myfidelity.ca/assets/home-B5BZ5jLU.js

js myfidelity.ca collected 2026-10-02 01:19:05 UTC 161,436 bytes, 1 lines download raw bytes

1import{j as t,c as e,u as s,r as i,a as n,s as o,d as r,L as a,m as l,b as c,e as u}from"./index--xynKbZj.js";import{C as h,A as d,X as m,x as p,N as f,c as g,m as v,p as y,b as x,a as b,v as w,d as j,u as S,S as T,M as P,s as E,e as A,f as C}from"./tooltip-qgNFnmzA.js";import{S as k}from"./StatisticsChartStatsPage-D7e3Hmp4.js";import{s as N,i as M,c as V,n as D,t as R}from"./card-D6VCTJpF.js";import{E as L}from"./ArticleModals-DCiAsNsk.js";import{C as B,F as I}from"./FeedbackWidget-e_GBziCo.js";import{e as F,u as O,a as U}from"./input-CxJY6XZJ.js";import{e as _}from"./textarea-UVESTnuw.js";import{Z as W}from"./zap-BxeUpiAF.js";import{S as z}from"./shield-BDMHJ14-.js";import{S as $}from"./save-q_Fe5lCg.js";import{E as Y,g as H,a as X,n as K,d as G,B as q,M as Z,F as J}from"./constants-MgqEKyz3.js";import{P as Q}from"./storageUtils-CyS1J0Dj.js";import{S as tt}from"./SendNotificationModal-ikubH7sZ.js";import{P as et,T as st,a as it}from"./TruncatedText-BXeA1QJT.js";import{S as nt}from"./square-pen-oUQ1t5hO.js";import"./createLucideIcon-BmbmbW8R.js";import"./mail-Xu9fiaZ9.js";import"./loader-circle-EzUJCZjh.js";import"./index-CjXoUXLc.js";import"./kpiStyles-DzaF-08W.js";import"./info-DSrPGPKA.js";import"./circle-x-DSQnmLaA.js";import"./recycle-fqma0vV9.js";function ot({name:s,image:i,calories:n,rating:o,lowCO2:r=!1,bestseller:a=!1,className:l,onClick:c}){return t.jsxs("div",{className:e("relative flex flex-col items-center justify-between bg-white rounded-lg sm:rounded-xl shadow-md p-1.5 sm:p-2 w-[90px] sm:w-[120px] h-[95px] sm:h-[110px] min-w-[90px] sm:min-w-[120px] max-w-[90px] sm:max-w-[120px] min-h-[95px] sm:min-h-[110px] max-h-[95px] sm:max-h-[110px] mx-0.5 sm:mx-1 border border-champignon/25 cursor-pointer transition-all duration-200 hover:shadow-lg hover:-translate-y-1",l),onClick:c,children:[t.jsxs("div",{className:"relative mb-1 sm:mb-2 flex-shrink-0",children:[t.jsxs("div",{className:"relative",children:[t.jsx("img",{src:i,alt:s,className:"w-10 h-10 sm:w-12 sm:h-12 rounded-full object-cover border-2 border-[#c0b7aa]/50 shadow-md"}),t.jsx("div",{className:"absolute inset-0 rounded-full bg-gradient-to-br from-transparent to-[#1d3726]/5"})]}),t.jsxs("div",{className:"absolute top-0 right-0 bg-[#ffa407] text-[#f5f4f0] text-[9px] sm:text-[10px] font-bold px-0.5 sm:px-1 py-0.5 rounded-full border border-white shadow-sm z-10",children:[o," pts"]}),a&&t.jsx("div",{className:"absolute top-0 left-0 bg-gradient-to-r from-bleuet-500 to-bleuet-600 text-white text-[9px] sm:text-[10px] w-3.5 h-3.5 sm:w-4 sm:h-4 rounded-full shadow-lg border border-white flex items-center justify-center z-20",children:"★"})]}),t.jsxs("div",{className:"flex flex-col items-center justify-end flex-1 w-full",children:[t.jsx("h4",{className:"font-bold text-center text-[10px] sm:text-xs text-[#1d3726] leading-tight line-clamp-2",children:s}),t.jsx("div",{className:"h-0.5 bg-gradient-to-r from-[#1d3726] to-[#3d6b50] rounded-full mt-0.5 sm:mt-1 w-full"})]})]})}function rt({className:l}){s();const c=i.useRef(null),[u,d]=i.useState([]),[m,p]=i.useState(!0),[f,g]=i.useState(null),{restaurants:v}=n();i.useEffect(()=>{(async()=>{var t,e;p(!0);try{const{data:{session:s}}=await o.auth.getSession();if(!(null==s?void 0:s.user))return void p(!1);const{data:i,error:n}=await r.getBootData();if(n)"PGRST116"===n.code||null==(t=n.message)||t.includes("406");else if(null==(e=null==i?void 0:i.data)?void 0:e.articles){const t=i.data.articles.sort((t,e)=>t.isbestseller&&!e.isbestseller?-1:!t.isbestseller&&e.isbestseller?1:0);d(t)}}catch{}p(!1)})()},[]);return t.jsxs(N,{className:e("w-full bg-white border border-slate-100 shadow-sm flex flex-col",l),children:[t.jsxs(M,{className:"flex flex-row items-center justify-between pb-3",children:[t.jsxs("div",{className:"flex-1 min-w-0 pr-2",children:[t.jsx(V,{className:"text-sm sm:text-lg font-bold text-gray-800 tracking-tight truncate",children:"Éco gestes populaires"}),t.jsxs("p",{className:"text-xs sm:text-sm text-gray-500 mt-0.5 sm:mt-1 truncate",children:[u.length," éco geste",u.length>1?"s":""," disponible",u.length>1?"s":""]})]}),t.jsxs("div",{className:"flex items-center gap-1 sm:gap-2",children:[t.jsxs(a,{to:"/articles",className:"text-[10px] sm:text-sm text-[#1d3726] hover:text-[#2d5240] hover:underline flex items-center gap-0.5 sm:gap-2 transition-colors duration-200 font-semibold px-2 sm:px-4 py-1 sm:py-2 rounded-lg hover:bg-[#1d3726]/5",children:[t.jsx("span",{className:"hidden sm:inline",children:"Voir plus"}),t.jsx("span",{className:"sm:hidden",children:"Plus"}),t.jsx(h,{className:"w-2.5 h-2.5 sm:w-4 sm:h-4"})]}),t.jsxs("div",{className:"flex gap-0.5 sm:gap-2",children:[t.jsx("button",{className:"h-6 w-6 sm:h-8 sm:w-8 p-0 border border-[#1d3726]/30 rounded-lg hover:bg-[#1d3726]/5 text-[#1d3726] transition-colors duration-200 flex items-center justify-center",onClick:t=>{t.stopPropagation(),c.current&&c.current.scrollBy({left:-140,behavior:"smooth"})},children:t.jsx(B,{className:"w-2.5 h-2.5 sm:w-4 sm:h-4"})}),t.jsx("button",{className:"h-6 w-6 sm:h-8 sm:w-8 p-0 border border-[#1d3726]/30 rounded-lg hover:bg-[#1d3726]/5 text-[#1d3726] transition-colors duration-200 flex items-center justify-center",onClick:t=>{t.stopPropagation(),c.current&&c.current.scrollBy({left:140,behavior:"smooth"})},children:t.jsx(h,{className:"w-2.5 h-2.5 sm:w-4 sm:h-4"})})]})]})]}),t.jsx(D,{className:"flex-1 flex items-center pb-4",children:m?t.jsx("div",{className:"w-full flex flex-col items-center justify-center py-8 text-center",children:t.jsx("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"Chargement..."})}):0===u.length?t.jsxs("div",{className:"w-full flex flex-col items-center justify-center py-8 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"Aucun éco geste populaire"}),t.jsx("p",{className:"text-sm text-gray-500 max-w-md",children:"Aucun éco geste n'est actuellement disponible ou vous n'avez pas encore créé d'éco gestes."})]}):t.jsx("div",{className:"relative overflow-hidden",children:t.jsx("div",{ref:c,className:"flex gap-2 sm:gap-3 overflow-x-auto scrollbar-hide pb-4 px-1 sm:px-2 pt-2",children:u.map(e=>t.jsx("div",{className:"flex-shrink-0 py-1",children:t.jsx(ot,{name:e.name,image:e.image,calories:e.calories,rating:e.points,lowCO2:e.islowco2,bestseller:e.isbestseller,onClick:()=>(t=>{g(t)})(e)})},e.id))})})}),f&&t.jsx(L,{article:f,onClose:()=>g(null),onSave:async()=>{var t;const{data:e}=await r.getBootData(!0);if(null==(t=null==e?void 0:e.data)?void 0:t.articles){const t=e.data.articles.sort((t,e)=>t.isbestseller&&!e.isbestseller?-1:!t.isbestseller&&e.isbestseller?1:0);d(t)}g(null)},restaurants:v||[]})]})}function at({name:e,points:s,image:i,isNew:n,status:o,onOfferClick:r}){return t.jsxs(l.div,{initial:{opacity:0,scale:.8,y:20}
1,animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:-20},whileHover:{scale:1.05,y:-5,transition:{duration:.2,ease:"easeOut"}},whileTap:{scale:.95},transition:{duration:.4,ease:[.25,.46,.45,.94]},className:"relative flex flex-col items-center justify-between bg-gradient-to-br from-white to-gray-50 rounded-lg sm:rounded-xl shadow-md p-1.5 sm:p-2 w-[90px] sm:w-[120px] h-[95px] sm:h-[110px] min-w-[90px] sm:min-w-[120px] max-w-[90px] sm:max-w-[120px] min-h-[95px] sm:min-h-[110px] max-h-[95px] sm:max-h-[110px] mx-0.5 sm:mx-1 border border-champignon/25 cursor-pointer "+("inactive"===o?"opacity-60 grayscale":""),onClick:r,children:[t.jsxs("div",{className:"relative mb-1 sm:mb-2",children:[t.jsxs("div",{className:"relative",children:[t.jsx("img",{src:i,alt:e,className:"w-10 h-10 sm:w-12 sm:h-12 rounded-full object-cover border-2 border-[#c0b7aa]/50 shadow-md"}),t.jsx("div",{className:"absolute inset-0 rounded-full bg-gradient-to-br from-transparent to-[#1d3726]/5"})]}),t.jsxs(l.span,{initial:{scale:0},animate:{scale:1},transition:{delay:.2,type:"spring",stiffness:500,damping:30},className:"absolute top-0 right-0 bg-[#ffa407] text-[#f5f4f0] text-[9px] sm:text-[10px] font-bold px-0.5 sm:px-1 py-0.5 rounded-full border border-white shadow-sm z-10",children:[s," pts"]}),n&&t.jsxs(l.span,{initial:{opacity:0,scale:0},animate:{opacity:1,scale:1},transition:{delay:.4,type:"spring",stiffness:400},className:"absolute bottom-0 left-1/2 -translate-x-1/2 bg-gradient-to-r from-bleuet-500 to-bleuet-600 text-white text-[9px] sm:text-[10px] px-1.5 sm:px-2.5 py-0.5 sm:py-1 rounded-full shadow-lg border border-white flex items-center gap-0.5 sm:gap-1 z-10",children:[t.jsx(W,{className:"w-2 h-2 sm:w-2.5 sm:h-2.5"}),t.jsx("span",{className:"hidden sm:inline",children:"Nouveau"}),t.jsx("span",{className:"sm:hidden",children:"Nv"})]})]}),t.jsxs("div",{className:"flex flex-col items-center justify-end flex-1 w-full",children:[t.jsx("h4",{className:"font-bold text-center text-[10px] sm:text-xs text-gray-800 leading-tight line-clamp-2",children:e}),t.jsx(l.div,{initial:{width:0},animate:{width:"100%"},transition:{delay:.6,duration:.3},className:"h-0.5 bg-gradient-to-r from-[#1d3726] to-[#3d6b50] rounded-full mt-0.5 sm:mt-1 w-full"})]})]})}function lt({className:r}){s();const{offers:u,refresh:p}=n(),[f,g]=i.useState(null),[v,y]=i.useState({id:null,title:"",image:"",description:"",points:"",expiry_date:"",context_tags:["Récompense"],is_active:!0,is_premium:!1,restaurant_ids:[]}),[x,b]=i.useState(null),[w,j]=i.useState(!1),S=i.useRef(null),T=(u||[]).filter(t=>t.is_active).sort((t,e)=>(e.isNew?1:0)-(t.isNew?1:0)),P=i.useRef(null),[E,A]=i.useState(0),C=t=>{if(!P.current)return;const e=P.current,s=e.children;if(s[t]){const i=s[t],n=e.clientWidth,o=i.offsetLeft-(n-i.offsetWidth)/2;e.scrollTo({left:Math.max(0,o),behavior:"smooth"})}};return t.jsxs(N,{className:e("w-full bg-white border border-slate-100 shadow-sm flex flex-col",r),children:[t.jsxs(M,{className:"flex flex-row items-center justify-between pb-3",children:[t.jsxs("div",{className:"flex-1 min-w-0 pr-2",children:[t.jsx(V,{className:"text-sm sm:text-lg font-bold text-gray-800 tracking-tight truncate",children:"Récompenses actives"}),t.jsxs("p",{className:"text-xs sm:text-sm text-gray-500 mt-0.5 sm:mt-1 truncate",children:[T.length," récompense",T.length>1?"s":""," disponible",T.length>1?"s":""]})]}),t.jsxs("div",{className:"flex items-center gap-1 sm:gap-2",children:[t.jsxs(a,{to:"/offers",className:"text-[10px] sm:text-sm text-[#1d3726] hover:text-[#2d5240] hover:underline flex items-center gap-0.5 sm:gap-2 transition-colors duration-200 font-semibold px-2 sm:px-4 py-1 sm:py-2 rounded-lg hover:bg-[#1d3726]/5",children:[t.jsx("span",{className:"hidden sm:inline",children:"Voir plus"}),t.jsx("span",{className:"sm:hidden",children:"Plus"}),t.jsx(h,{className:"w-2.5 h-2.5 sm:w-4 sm:h-4"})]}),t.jsxs("div",{className:"flex gap-0.5 sm:gap-2",children:[t.jsx("button",{className:"h-6 w-6 sm:h-8 sm:w-8 p-0 border border-gray-200 rounded-lg hover:bg-gray-50 transition-colors duration-200 flex items-center justify-center",onClick:()=>{const t=Math.max(0,E-1);
1A(t),C(t)},children:t.jsx(B,{className:"w-2.5 h-2.5 sm:w-4 sm:h-4"})}),t.jsx("button",{className:"h-6 w-6 sm:h-8 sm:w-8 p-0 border border-gray-200 rounded-lg hover:bg-gray-50 transition-colors duration-200 flex items-center justify-center",onClick:()=>{const t=Math.min(T.length-3,E+1);A(t),C(t)},children:t.jsx(h,{className:"w-2.5 h-2.5 sm:w-4 sm:h-4"})})]})]})]}),t.jsx(D,{className:"flex-1 flex items-center pb-4",children:0===T.length?t.jsxs("div",{className:"w-full flex flex-col items-center justify-center py-8 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"Aucune offre active"}),t.jsx("p",{className:"text-sm text-gray-500 max-w-md",children:"Toutes vos offres sont actuellement inactives ou vous n'avez pas encore créé d'offres."})]}):t.jsx("div",{className:"relative overflow-hidden",children:t.jsx("div",{ref:P,className:"flex gap-3 overflow-x-auto scrollbar-hide pb-4 px-2 pt-2",children:T.map((e,s)=>t.jsx("div",{className:"flex-shrink-0 py-1",children:t.jsx(at,{name:e.title,points:e.points,image:e.image,isNew:e.isNew,status:"active",onOfferClick:()=>(t=>{var e;y({id:t.id,title:t.title||"",image:t.image||"",description:t.description||"",points:(null==(e=t.points)?void 0:e.toString())||"",expiry_date:t.expiry_date?new Date(t.expiry_date).toISOString().split("T")[0]:"",context_tags:t.context_tags||["Récompense"],is_active:void 0===t.is_active||t.is_active,is_premium:t.is_premium||!1,restaurant_ids:t.restaurant_ids||[]}),g(t)})(e)})},e.id))})})}),t.jsx(d,{children:f&&t.jsxs(t.Fragment,{children:[t.jsx(l.div,{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-40",initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.4,ease:"easeOut"},onClick:()=>g(null)}),t.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto py-8 pointer-events-none",children:t.jsxs(l.div,{initial:{opacity:0,scale:.8,y:50},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:50},transition:{type:"spring",stiffness:300,damping:30,duration:.4,delay:.2},className:"bg-white rounded-2xl shadow-2xl w-full max-w-2xl relative m-4 max-h-[85vh] flex flex-col border border-champignon/25 pointer-events-auto",onClick:t=>t.stopPropagation(),children:[t.jsx("div",{className:"flex-shrink-0 p-6 pb-4 border-b border-gray-100",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h3",{className:"text-lg font-semibold text-nightblue",children:"Modifier la récompense"}),t.jsx(R,{onClick:()=>g(null),variant:"ghost",size:"icon",className:"text-gray-400 hover:text-gray-600",children:t.jsx(m,{className:"h-5 w-5"})})]})}),t.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-4 min-h-0",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium leading-none",children:"Titre"}),t.jsx(F,{value:v.title,onChange:t=>y({...v,title:t.target.value}),className:"mt-1"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium leading-none",children:"Description"}),t.jsx(_,{value:v.description,onChange:t=>y({...v,description:t.target.value}),className:"mt-1",rows:3})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium leading-none",children:"Points"}),t.jsx(F,{type:"number",value:v.points,onChange:t=>y({...v,points:t.target.value}),className:"mt-1"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium leading-none",children:"Image"}),t.jsxs("div",{className:"mt-1 space-y-2",children:[(v.image||x)&&t.jsx("div",{className:"w-full h-32 bg-gray-100 rounded-lg overflow-hidden border border-gray-200",children:t.jsx("img",{src:x?URL.createObjectURL(x):v.image,alt:"Aperçu",className:"w-full h-full object-cover"})}),t.jsx(R,{type:"button",variant:"outline",onClick:()=>{var t;return null==(t=S.current)?void 0:t.click()},children:v.image?"Changer l'image":"Ajouter une image"}),t.jsx("input",{ref:S,type:"file",accept:"image/*",onChange:t=>{var e;return b((null==(e=t.target.files)?void 0:e[0])||null)},className:"hidden"}),x&&t.jsxs("p",{className:"text-xs text-gray-500",children:["Fichier sélectionné : ",x.name]})]})]})]}),t.jsxs("div",{className:"flex-shrink-0 flex justify-end gap-2 p-6 pt-4 border-t border-gray-200",children:[t.jsx(R,{type:"button",variant:"ghost",onClick:()=>g(null),children:"Annuler"}),t.jsx(R,{type:"button",onClick:async()=>{j(!0);try{let t=v.image;if(x){const e=x.name.split(".").pop(),s=`${Date.now()}_${Math.random().toString(36).substring(2,8)}.${e}`,{data:i,error:n}=await o.storage.from("offers-images").upload(s,x,{cacheControl:"3600",upsert:!1});if(n)throw new Error(`Erreur d'upload: ${n.message}`);const{data:r}=o.storage.from("offers-images").getPublicUrl(s);t=r.publicUrl}const e={title:v.title,description:v.description,points:Number(v.points)||0,expiry_date:v.expiry_date?new Date(v.expiry_date).toISOString():null,context_tags:v.context_tags,is_active:v.is_active,is_premium:v.is_premium,restaurant_ids:v.restaurant_ids,image:t},{data:s,error:i}=await o.rpc("update_offer",{offer_id:v.id,offer_data:e});if(i)throw new Error(i.message||"Erreur lors de la mise à jour");if(!(null==s?void 0:s.success))throw new Error((null==s?void 0:s.error)||(null==s?void 0:s.message)||"Erreur lors de la mise à jour");c({title:"Succès",description:"Récompense mise à jour avec succès"}),await p(),g(null),b(null)}catch(t){c({title:"Erreur",description:t.message||"Erreur lors de la mise à jour",variant:"destructive"})}finally{j(!1)}},disabled:w,variant:"orange",children:w?"Enregistrement...":"Enregistrer"})]})]})})]})})]})}const ct=["utilisateur","administrateur","superadmin"],ut={dashboard:"Tableau de bord",statistics:"Statistiques",promotions:"Promotions",restaurants:"Stations",articles:"Éco-gestes",offers:"Récompenses",members:"Membres",polls:"Sondages"};function ht(){const{profile:e}=u(),[s,n]=i.useState([]),[r,a]=i.useState(null),[l,h]=i.useState(!0),[d,T]=i.useState(!1),[P,E]=i.useState(!1);i.useEffect(()=>{A()},[]);const A=async()=>{try{const{data:t,error:e}=await o.from("section_visibility").select("*").order("section");if(e)throw e;n(t||[])}catch{c({title:"Erreur",description:"Impossible de charger les sections",variant:"destructive"})}finally{h(!1)}};return l?t.jsx("div",{className:"flex items-center justify-center p-4",children:"Chargement..."}):e&&"superadmin"===e.role?t.jsxs(N,{className:"cursor-pointer hover:shadow-lg transition-shadow",children:[t.jsx(M,{children:t.jsxs(V,{className:"flex items-center gap-2 text-lg",children:[t.jsx(z,{className:"w-5 h-5"}),"Gestion rapide des sections"]})}),t.jsx(D,{children:t.jsxs(p,{open:P,onOpenChange:E,children:[t.jsx(f,{asChild:!0,children:t.jsxs(R,{variant:"outline",className:"w-full",children:[t.jsx(z,{className:"w-4 h-4 mr-2"}),"Gérer les permissions"]})}),t.jsxs(g,{children:[t.jsx(v,{children:t.jsx(y,{children:"Permissions des sections"})}
1),t.jsxs("div",{className:"space-y-4 mt-4",children:[t.jsxs(x,{value:(null==r?void 0:r.id)||"",onValueChange:t=>{const e=s.find(e=>e.id===t);a(e||null)},children:[t.jsx(b,{children:t.jsx(w,{placeholder:"Choisir une section"})}),t.jsx(j,{children:s.map(e=>t.jsx(S,{value:e.id,children:ut[e.section]||e.section},e.id))})]}),r&&t.jsxs("div",{className:"space-y-2",children:[t.jsx("div",{className:"text-sm font-medium",children:"Rôles avec accès :"}),t.jsx("div",{className:"grid grid-cols-2 gap-2",children:ct.map(e=>t.jsx(R,{variant:r.visible_for.includes(e)?"default":"outline",onClick:()=>(t=>{r&&n(e=>e.map(e=>{if(e.id===r.id){const s=e.visible_for.includes(t)?e.visible_for.filter(e=>e!==t):[...e.visible_for,t],i={...e,visible_for:s};return a(i),i}return e}))})(e),disabled:"administrateur"===e||"superadmin"===e,className:"justify-start",size:"sm",children:e.charAt(0).toUpperCase()+e.slice(1)},e))})]}),t.jsxs("div",{className:"flex justify-end gap-2 mt-4",children:[t.jsxs(R,{variant:"outline",onClick:()=>E(!1),disabled:d,children:[t.jsx(m,{className:"w-4 h-4 mr-1"}),"Annuler"]}),t.jsxs(R,{onClick:async()=>{if(r&&e){T(!0);try{const{error:t}=await o.from("section_visibility").update({visible_for:r.visible_for,updated_by:e.id}).eq("id",r.id);if(t)throw t;c({title:"Succès",description:"Les permissions ont été mises à jour"}),E(!1)}catch{c({title:"Erreur",description:"Impossible de sauvegarder les modifications",variant:"destructive"})}finally{T(!1)}}},disabled:d||!r,children:[t.jsx($,{className:"w-4 h-4 mr-1"}),d?"Enregistrement...":"Enregistrer"]})]})]})]})]})})]}):null}const dt=i.createContext({});const mt="undefined"!=typeof window?i.useLayoutEffect:i.useEffect,pt=i.createContext(null);function ft(t,e){-1===t.indexOf(e)&&t.push(e)}function gt(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}const vt=(t,e,s)=>s>e?e:s<t?t:s;const yt={},xt=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),bt=t=>"object"==typeof t&&null!==t,wt=t=>/^0[^.\s]+$/u.test(t);function jt(t){let e;return()=>(void 0===e&&(e=t()),e)}const St=t=>t,Tt=(...t)=>t.reduce((t,e)=>s=>e(t(s))),Pt=(t,e,s)=>{const i=e-t;return i?(s-t)/i:1};class Et{constructor(){this.subscriptions=[]}add(t){return ft(this.subscriptions,t),()=>gt(this.subscriptions,t)}notify(t,e,s){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,s);else for(let n=0;n<i;n++){const i=this.subscriptions[n];i&&i(t,e,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const At=t=>1e3*t,Ct=t=>t/1e3,kt=(t,e)=>e?t*(1e3/e):0,Nt=(t,e,s)=>(((1-3*s+3*e)*t+(3*s-6*e))*t+3*e)*t;function Mt(t,e,s,i){if(t===e&&s===i)return St;const n=e=>function(t,e,s,i,n){let o,r,a=0;do{r=e+(s-e)/2,o=Nt(r,i,n)-t,o>0?s=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,s);return t=>0===t||1===t?t:Nt(n(t),e,i)}const Vt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Dt=t=>e=>1-t(1-e),Rt=Mt(.33,1.53,.69,.99),Lt=Dt(Rt),Bt=Vt(Lt),It=t=>t>=1?1:(t*=2)<1?.5*Lt(t):.5*(2-Math.pow(2,-10*(t-1))),Ft=t=>1-Math.sin(Math.acos(t)),Ot=Dt(Ft),Ut=Vt(Ft),_t=Mt(.42,0,1,1),Wt=Mt(0,0,.58,1),zt=Mt(.42,0,.58,1),$t=t=>Array.isArray(t)&&"number"==typeof t[0],Yt={linear:St,easeIn:_t,easeInOut:zt,easeOut:Wt,circIn:Ft,circInOut:Ut,circOut:Ot,backIn:Lt,backInOut:Bt,backOut:Rt,anticipate:It},Ht=t=>{if($t(t)){t.length;const[e,s,i,n]=t;return Mt(e,s,i,n)}return"string"==typeof t?Yt[t]:t},Xt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Kt(t,e){let s=!1,i=!0;const n={delta:0,timestamp:0,isProcessing:!1},o=()=>s=!0,r=Xt.reduce((t,e)=>(t[e]=function(t){let e=new Set,s=new Set,i=!1,n=!1;const o=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function a(e){o.has(e)&&(l.schedule(e),t()),e(r)}const l={schedule:(t,n=!1,r=!1)=>{const a=r&&i?e:s;return n&&o.add(t),a.add(t),t},cancel:t=>{s.delete(t),o.delete(t)},process:t=>{if(r=t,i)return void(n=!0);i=!0;const o=e;e=s,s=o,e.forEach(a),e.clear(),i=!1,n&&(n=!1,l.process(t))}};return l}(o),t),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:h,preRender:d,render:m,postRender:p}=r,f=()=>{const o=yt.useManualTiming,r=o?n.timestamp:performance.now();s=!1,o||(n.delta=i?1e3/60:Math.max(Math.min(r-n.timestamp,40),1)),n.timestamp=r,n.isProcessing=!0,a.process(n),l.process(n),c.process(n),u.process(n),h.process(n),d.process(n),m.process(n),p.process(n),n.isProcessing=!1,s&&e&&(i=!1,t(f))};return{schedule:Xt.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(s||(s=!0,i=!0,n.isProcessing||t(f)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e<Xt.length;e++)r[Xt[e]].cancel(t)},state:n,steps:r}}const{schedule:Gt,cancel:qt,state:Zt,steps:Jt}=Kt("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:St,!0);let Qt;function te(){Qt=void 0}const ee={now:()=>(void 0===Qt&&ee.set(Zt.isProcessing||yt.useManualTiming?Zt.timestamp:performance.now()),Qt),set:t=>{Qt=t,queueMicrotask(te)}},se=t=>e=>"string"==typeof e&&e.startsWith(t),ie=se("--"),ne=se("var(--"),oe=t=>!!ne(t)&&re.test(t.split("/*")[0].trim()),re=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function ae(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const le={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},ce={...le,transform:t=>vt(0,1,t)},ue={...le,default:1},he=t=>Math.round(1e5*t)/1e5,de=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const me=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,pe=(t,e)=>s=>Boolean("string"==typeof s&&me.test(s)&&s.startsWith(t)||e&&!function(t){return null==t}(s)&&Object.prototype.hasOwnProperty.call(s,e)),fe=(t,e,s)=>i=>{if("string"!=typeof i)return i;const[n,o,r,a]=i.match(de);return{[t]:parseFloat(n),[e]:parseFloat(o),[s]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},ge={...le,transform:t=>Math.round((t=>vt(0,255,t))(t))},ve={test:pe("rgb","red"),parse:fe("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:i=1})=>"rgba("+ge.transform(t)+", "+ge.transform(e)+", "+ge.transform(s)+", "+he(ce.transform(i))+")"};const ye={test:pe("#"),parse:function(t){let e="",s="",i="",n="";return t.length>5?(e=t.substring(1,3),s=t.substring(3,5),i=t.substring(5,7),n=t.substring(7,9)):(e=t.substring(1,2),s=t.substring(2,3),i=t.substring(3,4),n=t.substring(4,5),e+=e,s+=s,i+=i,n+=n),{red:parseInt(e,16),green:parseInt(s,16),blue:parseInt(i,16),alph
vendor: 4,339 bytes, line 1
1a:n?parseInt(n,16)/255:1}},transform:ve.transform},xe=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),be=xe("deg"),we=xe("%"),je=xe("px"),Se=xe("vh"),Te=xe("vw"),Pe={...we,parse:t=>we.parse(t)/100,transform:t=>we.transform(100*t)},Ee={test:pe("hsl","hue"),parse:fe("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:i=1})=>"hsla("+Math.round(t)+", "+we.transform(he(e))+", "+we.transform(he(s))+", "+he(ce.transform(i))+")"},Ae={test:t=>ve.test(t)||ye.test(t)||Ee.test(t),parse:t=>ve.test(t)?ve.parse(t):Ee.test(t)?Ee.parse(t):ye.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?ve.transform(t):Ee.transform(t),getAnimatableNone:t=>{const e=Ae.parse(t);return e.alpha=0,Ae.transform(e)}},Ce=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const ke="number",Ne="color",Me=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ve(t){const e=t.toString(),s=[],i={color:[],number:[],var:[]},n=[];let o=0;const r=e.replace(Me,t=>(Ae.test(t)?(i.color.push(o),n.push(Ne),s.push(Ae.parse(t))):t.startsWith("var(")?(i.var.push(o),n.push("var"),s.push(t)):(i.number.push(o),n.push(ke),s.push(parseFloat(t))),++o,"${}")).split("${}");return{values:s,split:r,indexes:i,types:n}}function De({split:t,types:e}){const s=t.length;return i=>{let n="";for(let o=0;o<s;o++)if(n+=t[o],void 0!==i[o]){const t=e[o];n+=t===ke?he(i[o]):t===Ne?Ae.transform(i[o]):i[o]}return n}}const Re=(t,e)=>{return"number"==typeof t?(null==e?void 0:e.trim().endsWith("/"))?t:0:"number"==typeof(s=t)?0:Ae.test(s)?Ae.getAnimatableNone(s):s;var s};const Le={test:function(t){var e,s;return isNaN(t)&&"string"==typeof t&&((null==(e=t.match(de))?void 0:e.length)||0)+((null==(s=t.match(Ce))?void 0:s.length)||0)>0},parse:function(t){return Ve(t).values},createTransformer:function(t){return De(Ve(t))},getAnimatableNone:function(t){const e=Ve(t);return De(e)(e.values.map((t,s)=>Re(t,e.split[s])))}};function Be(t,e,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?t+6*(e-t)*s:s<.5?e:s<2/3?t+(e-t)*(2/3-s)*6:t}function Ie(t,e){return s=>s>0?e:t}const Fe=(t,e,s)=>t+(e-t)*s,Oe=(t,e,s)=>{const i=t*t,n=s*(e*e-i)+i;return n<0?0:Math.sqrt(n)},Ue=[ye,ve,Ee];function _e(t){const e=(s=t,Ue.find(t=>t.test(s)));var s;if(!Boolean(e))return!1;let i=e.parse(t);return e===Ee&&(i=function({hue:t,saturation:e,lightness:s,alpha:i}){t/=360,s/=100;let n=0,o=0,r=0;if(e/=100){const i=s<.5?s*(1+e):s+e-s*e,a=2*s-i;n=Be(a,i,t+1/3),o=Be(a,i,t),r=Be(a,i,t-1/3)}else n=o=r=s;return{red:Math.round(255*n),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}(i)),i}const We=(t,e)=>{const s=_e(t),i=_e(e);if(!s||!i)return Ie(t,e);const n={...s};return t=>(n.red=Oe(s.red,i.red,t),n.green=Oe(s.green,i.green,t),n.blue=Oe(s.blue,i.blue,t),n.alpha=Fe(s.alpha,i.alpha,t),ve.transform(n))},ze=new Set(["none","hidden"]);function $e(t,e){return s=>Fe(t,e,s)}function Ye(t){return"number"==typeof t?$e:"string"==typeof t?oe(t)?Ie:Ae.test(t)?We:Ke:Array.isArray(t)?He:"object"==typeof t?Ae.test(t)?We:Xe:Ie}function He(t,e){const s=[...t],i=s.length,n=t.map((t,s)=>Ye(t)(t,e[s]));return t=>{for(let e=0;e<i;e++)s[e]=n[e](t);return s}}function Xe(t,e){const s={...t,...e},i={};for(const n in s)void 0!==t[n]&&void 0!==e[n]&&(i[n]=Ye(t[n])(t[n],e[n]));return t=>{for(const e in i)s[e]=i[e](t);return s}}const Ke=(t,e)=>{const s=Le.createTransformer(e),i=Ve(t),n=Ve(e);return i.indexes.var.length===n.indexes.var.length&&i.indexes.color.length===n.indexes.color.length&&i.indexes.number.length>=n.indexes.number.length?ze.has(t)&&!n.values.length||ze.has(e)&&!i.values.length?function(t,e){return ze.has(t)?s=>s<=0?t:e:s=>s>=1?e:t}(t,e):Tt(He(function(t,e){const s=[],i={color:0,var:0,number:0};for(let n=0;n<e.values.length;n++){const o=e.types[n],r=t.indexes[o][i[o]],a=t.values[r]??0;s[n]=a,i[o]++}return s}(i,n),n.values),s):Ie(t,e)};function Ge(t,e,s){if("number"==typeof t&&"number"==typeof e&&"number"==typeof s)return Fe(t,e,s);return Ye(t)(t,e)}const qe=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>Gt.update(e,t),stop:()=>qt(e),now:()=>
1Zt.isProcessing?Zt.timestamp:ee.now()}},Ze=(t,e,s=10)=>{let i="";const n=Math.max(Math.round(e/s),2);for(let o=0;o<n;o++)i+=Math.round(1e4*t(o/(n-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},Je=2e4;function Qe(t){let e=0;let s=t.next(e);for(;!s.done&&e<Je;)e+=50,s=t.next(e);return e>=Je?1/0:e}const ts=100,es=10,ss=1,is=0,ns=800,os=.3,rs=.3,as={granular:.01,default:2},ls={granular:.005,default:.5},cs=.01,us=10,hs=.05,ds=1;function ms(t,e){return t*Math.sqrt(1-e*e)}const ps=.001;const fs=["duration","bounce"],gs=["stiffness","damping","mass"];function vs(t,e){return e.some(e=>void 0!==t[e])}function ys(t){let e={velocity:is,stiffness:ts,damping:es,mass:ss,isResolvedFromDuration:!1,...t};if(!vs(t,gs)&&vs(t,fs))if(e.velocity=0,t.visualDuration){const s=t.visualDuration,i=2*Math.PI/(1.2*s),n=i*i,o=2*vt(.05,1,1-(t.bounce||0))*Math.sqrt(n);e={...e,mass:ss,stiffness:n,damping:o}}else{const s=function({duration:t=ns,bounce:e=os,velocity:s=is,mass:i=ss}){let n,o,r=1-e;r=vt(hs,ds,r),t=vt(cs,us,Ct(t)),r<1?(n=e
1=>{const i=e*r,n=i*t,o=i-s,a=ms(e,r),l=Math.exp(-n);return ps-o/a*l},o=e=>{const i=e*r*t,o=i*s+s,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),c=ms(Math.pow(e,2),r);return(-n(e)+ps>0?-1:1)*((o-a)*l)/c}):(n=e=>Math.exp(-e*t)*((e-s)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(s-e)));const a=function(t,e,s){let i=s;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(n,o,5/t);if(t=At(t),isNaN(a))return{stiffness:ts,damping:es,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}({...t,velocity:0});e={...e,...s,mass:ss},e.isResolvedFromDuration=!0}return e}function xs(t=rs,e=os){const s="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:n}=s;const o=s.keyframes[0],r=s.keyframes[s.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:c,mass:u,duration:h,velocity:d,isResolvedFromDuration:m}=ys({...s,velocity:-Ct(s.velocity||0)}),p=d||0,f=c/(2*Math.sqrt(l*u)),g=r-o,v=Ct(Math.sqrt(l/u)),y=Math.abs(g)<5;let x,b,w,j,S,T;if(i||(i=y?as.granular:as.default),n||(n=y?ls.granular:ls.default),f<1)w=ms(v,f),j=(p+f*v*g)/w,x=t=>{const e=Math.exp(-f*v*t);return r-e*(j*Math.sin(w*t)+g*Math.cos(w*t))},S=f*v*j+g*w,T=f*v*g-j*w,b=t=>Math.exp(-f*v*t)*(S*Math.sin(w*t)+T*Math.cos(w*t));else if(1===f){x=t=>r-Math.exp(-v*t)*(g+(p+v*g)*t);const t=p+v*g;b=e=>Math.exp(-v*e)*(v*t*e-p)}else{const t=v*Math.sqrt(f*f-1);x=e=>{const s=Math.exp(-f*v*e),i=Math.min(t*e,300);return r-s*((p+f*v*g)*Math.sinh(i)+t*g*Math.cosh(i))/t};const e=(p+f*v*g)/t,s=f*v*e-g*t,i=f*v*g-e*t;b=e=>{const n=Math.exp(-f*v*e),o=Math.min(t*e,300);return n*(s*Math.sinh(o)+i*Math.cosh(o))}}const P={calculatedDuration:m&&h||null,velocity:t=>At(b(t)),next:t=>{if(!m&&f<1){const e=Math.exp(-f*v*t),s=Math.sin(w*t),o=Math.cos(w*t),l=r-e*(j*s+g*o),c=At(e*(S*s+T*o));return a.done=Math.abs(c)<=i&&Math.abs(r-l)<=n,a.value=a.done?r:l,a}const e=x(t);if(m)a.done=t>=h;else{const s=At(b(t));a.done=Math.abs(s)<=i&&Math.abs(r-e)<=n}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(Qe(P),Je),e=Ze(e=>P.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return P}xs.applyToOptions=t=>{const e=function(t,e=100,s){const i=s({...t,keyframes:[0,e]}),n=Math.min(Qe(i),Je);return{type:"keyframes",ease:t=>i.next(n*t).value/e,duration:Ct(n)}}(t,100,xs);return t.ease=e.ease,t.duration=At(e.duration),t.type="keyframes",t};function bs(t,e,s){const i=Math.max(e-5,0);return kt(s-t(i),e-i)}function ws({keyframes:t,velocity:e=0,power:s=.8,timeConstant:i=325,bounceDamping:n=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},m=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let p=s*e;const f=h+p,g=void 0===r?f:r(f);g!==f&&(p=g-h);const v=t=>-p*Math.exp(-t/i),y=t=>g+v(t),x=t=>{const e=v(t),s=y(t);d.done=Math.abs(e)<=c,d.value=d.done?g:s};let b,w;const j=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(b=t,w=xs({keyframes:[d.value,m(d.value)],velocity:bs(y,t,d.value),damping:n,stiffness:o,restDelta:c,restSpeed:u}))};return j(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==b||(e=!0,x(t),j(t)),void 0!==b&&t>=b?w.next(t-b):(!e&&x(t),d)}}}function js(t,e,{clamp:s=!0,ease:i,mixer:n}={}){const o=t.length;if(e.length,1===o)return()=>e[0];if(2===o&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,s){const i=[],n=s||yt.mix||Ge,o=t.length-1;for(let r=0;r<o;r++){let s=n(t[r],t[r+1]);if(e){const t=Array.isArray(e)?e[r]||St:e;s=Tt(t,s)}i.push(s)}return i}(e,i,n),l=a.length,c=s=>{if(r&&s<t[0])return e[0];let i=0;if(l>1)for(;i<t.length-2&&!(s<t[i+1]);i++);const n=Pt(t[i],t[i+1],s);return a[i](n)};return s?e=>c(vt(t[0],t[o-1],e)):c}function Ss(t){const e=[0];return function(t,e){const s=t[t.length-1];for(let i=1;i<=e;i++){const n=Pt(0,e,i);t.push(Fe(s,1,n))}}(e,t.length-1),e}function Ts({duration:t=300,keyframes:e,times:s,ease:i="easeInOut"}){const n=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(Ht):Ht(i),o={done:!1,value:e[0]},r=function(t,e){return t.map(t=>t*e)}(s&&s.length===e.length?s:Ss(e),t),a=js(r,e,{ease:Array.isArray(n)?n:(l=e,c=n,l.map(()=>c||zt).splice(0,l.length-1))});var l,c;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}const Ps=t=>null!==t;function Es(t,{repeat:e,repeatType:s="loop"},i,n=1){const o=t.filter(Ps),r=n<0||e&&"loop"!==s&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const As={decay:ws,inertia:ws,tween:Ts,keyframes:Ts,spring:xs};function Cs(t){"string"==typeof t.type&&(t.type=As[t.type])}class ks{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Ns=t=>t/100;class Ms extends ks{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var t,e;const{motionValue:s}=this.options;s&&s.updatedAt!==ee.now()&&this.tick(ee.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),null==(e=(t=this.options).onStop)||e.call(t))},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Cs(t);const{type:e=Ts,repeat:s=0,repeatDelay:i=0,repeatType:n,velocity:o=0}=t;let{keyframes:r}=t;const a=e||Ts;a!==Ts&&"number"!=typeof r[0]&&(this.mixKeyframes=Tt(Ns,Ge(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===n&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=Qe(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:s,totalDuration:i,mixKeyframes:n,mirroredGenerator:o,resolvedDuration:r,calculatedDuration:a}=this;if(null===this.startTime)return s.next(0);const{delay:l=0,keyframes:c,repeat:u,repeatType:h,repeatDelay:d,type:m,onUpdate:p,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let y,x=this.currentTime,b=s;if(u){const t=Math.min(this.currentTime,i)/r;let e=Math.floor(t),s=t%1;!s&&t>=1&&(s=1),1===s&&e--,e=Math.min(e,u+1);Boolean(e%2)&&("reverse"===h?(s=1-s,d&&(s-=d/r)):"mirror"===h&&(b=o)),x=vt(0,1,s)*r}v?(this.delayState.value=c[0],y=this.delayState):y=b.next(x),n&&!v&&(y.value=n(y.value));let{done:w}=y;v||null===a||(w=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const j=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return j&&m!==ws&&(y.value=Es(c,this.options,f,this.speed)),p&&p(y.value),j&&this.finish(),y}then(t,e){return this.finished.then(t,e)}get duration(){return Ct(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Ct(t)}get time(){return Ct(this.currentTime)}set time(t){t=At(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;
1if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return bs(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(ee.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=Ct(this.currentTime))}play(){var t,e;if(this.isStopped)return;const{driver:s=qe,startTime:i}=this.options;this.driver||(this.driver=s(t=>this.tick(t))),null==(e=(t=this.options).onPlay)||e.call(t);const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=i??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ee.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,e;this.notifyFinished(),this.teardown(),this.state="finished",null==(e=(t=this.options).onComplete)||e.call(t)}cancel(){var t,e;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),null==(e=(t=this.options).onCancel)||e.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var e;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),null==(e=this.driver)||e.stop(),t.observe(this)}}const Vs=t=>180*t/Math.PI,Ds=t=>{const e=Vs(Math.atan2(t[1],t[0]));return Ls(e)},Rs={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ds,rotateZ:Ds,skewX:t=>Vs(Math.atan(t[1])),skewY:t=>Vs(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Ls=t=>((t%=360)<0&&(t+=360),t),Bs=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Is=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Fs={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Bs,scaleY:Is,scale:t=>(Bs(t)+Is(t))/2,rotateX:t=>Ls(Vs(Math.atan2(t[6],t[5]))),rotateY:t=>Ls(Vs(Math.atan2(-t[2],t[0]))),rotateZ:Ds,rotate:Ds,skewX:t=>Vs(Math.atan(t[4])),skewY:t=>Vs(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Os(t){return t.includes("scale")?1:0}function Us(t,e){if(!t||"none"===t)return Os(e);const s=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,n;if(s)i=Fs,n=s;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Rs,n=e}if(!n)return Os(e);const o=i[e],r=n[1].split(",").map(_s);return"function"==typeof o?o(r):r[o]}function _s(t){return parseFloat(t.trim())}const Ws=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],zs=new Set([...Ws,"pathRotation"]),$s=t=>t===le||t===je,Ys=new Set(["x","y","z"]),Hs=Ws.filter(t=>!Ys.has(t));const Xs={width:({x:t},{paddingLeft:e="0",paddingRight:s="0",boxSizing:i})=>{const n=t.max-t.min;return"border-box"===i?n:n-parseFloat(e)-parseFloat(s)},height:({y:t},{paddingTop:e="0",paddingBottom:s="0",boxSizing:i})=>{const n=t.max-t.min;return"border-box"===i?n:n-parseFloat(e)-parseFloat(s)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Us(e,"x"),y:(t,{transform:e})=>Us(e,"y")};Xs.translateX=Xs.x,Xs.translateY=Xs.y;const Ks=new Set;let Gs=!1,qs=!1,Zs=!1;function Js(){if(qs){const t=Array.from(Ks).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),s=new Map;e.forEach(t=>{const e=function(t){const e=[];return Hs.forEach(s=>{const i=t.getValue(s);void 0!==i&&(e.push([s,i.get()]),i.set(s.startsWith("scale")?1:0))}),e}(t);e.length&&(s.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=s.get(t);e&&e.forEach(([e,s])=>{var i;null==(i=t.getValue(e))||i.set(s)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}qs=!1,Gs=!1,Ks.forEach(t=>t.complete(Zs)),Ks.clear()}function Qs(){Ks.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(qs=!0)})}class ti{constructor(t,e,s,i,n,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=s,this.motionValue=i,this.element=n,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Ks.add(this),Gs||(Gs=!0,Gt.read(Qs),Gt.resolveKeyframes(Js))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:s,motionValue:i}=this;if(null===t[0]){const n=null==i?void 0:i.get(),o=t[t.length-1];if(void 0!==n)t[0]=n;else if(s&&e){const i=s.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===n&&i.set(t[0])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ks.delete(this)}cancel(){"scheduled"===this.state&&(Ks.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function ei(t,e,s){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,s):t.style[e]=s}const si={};function ii(t,e){const s=jt(t);return()=>si[e]??s()}const ni=ii(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),oi=ii(()=>{try{document.createElement("div").animate({opacity:0}
1,{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),ri=([t,e,s,i])=>`cubic-bezier(${t}, ${e}, ${s}, ${i})`,ai={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ri([0,.65,.55,1]),circOut:ri([.55,0,1,.45]),backIn:ri([.31,.01,.66,-.59]),backOut:ri([.33,1.53,.69,.99])};function li(t,e){return t?"function"==typeof t?oi()?Ze(t,e):"ease-out":$t(t)?ri(t):Array.isArray(t)?t.map(t=>li(t,e)||ai.easeOut):ai[t]:void 0}function ci(t,e,s,{delay:i=0,duration:n=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:s};l&&(u.offset=l);const h=li(a,n);Array.isArray(h)&&(u.easing=h);const d={delay:i,duration:n,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};return c&&(d.pseudoElement=c),t.animate(u,d)}function ui(t){return"function"==typeof t&&"applyToOptions"in t}class hi extends ks{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:s,keyframes:i,pseudoElement:n,allowFlatten:o=!1,finalKeyframe:r,onComplete:a}=t;this.isPseudoElement=Boolean(n),this.allowFlatten=o,this.options=t,t.type;const l=function({type:t,...e}){return ui(t)&&oi()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=ci(e,s,i,l,n),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!n){const t=Es(i,this.options,r,this.speed);this.updateMotionValue&&this.updateMotionValue(t),ei(e,s,t),this.animation.cancel()}null==a||a(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,e;null==(e=(t=this.animation).finish)||e.call(t)}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,e,s;const i=null==(t=this.options)?void 0:t.element;!this.isPseudoElement&&(null==i?void 0:i.isConnected)&&(null==(s=(e=this.animation).commitStyles)||s.call(e))}get duration(){var t,e;const s=(null==(e=null==(t=this.animation.effect)?void 0:t.getComputedTiming)?void 0:e.call(t).duration)||0;return Ct(Number(s))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Ct(t)}get time(){return Ct(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=At(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:s,observe:i}){var n;return this.allowFlatten&&(null==(n=this.animation.effect)||n.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&ni()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),s&&(this.animation.rangeEnd=s),St):i(this)}}const di={anticipate:It,backInOut:Bt,circInOut:Ut};function mi(t){"string"==typeof t.ease&&t.ease in di&&(t.ease=di[t.ease])}class pi extends hi{constructor(t){mi(t),Cs(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:s,onComplete:i,element:n,...o}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const r=new Ms({...o,autoplay:!1}),a=Math.max(10,ee.now()-this.startTime),l=vt(0,10,a-10),c=r.sample(a).value,{name:u}=this.options;n&&u&&ei(n,u,c),e.setWithVelocity(r.sample(Math.max(0,a-l)).value,c,l),r.stop()}}const fi=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Le.test(t)&&"0"!==t||t.startsWith("url(")));function gi(t){t.duration=0,t.type="keyframes"}const vi=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),yi=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const xi=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),bi=jt(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function wi(t){var e;
1const{motionValue:s,name:i,repeatDelay:n,repeatType:o,damping:r,type:a,keyframes:l}=t,c=null==(e=null==s?void 0:s.owner)?void 0:e.current;if(!(c instanceof HTMLElement||c instanceof SVGElement))return!1;const{onUpdate:u,transformTemplate:h}=s.owner.getProps();return bi()&&i&&(vi.has(i)||xi.has(i)&&function(t){for(let e=0;e<t.length;e++)if("string"==typeof t[e]&&yi.test(t[e]))return!0;return!1}(l))&&("transform"!==i||!h)&&!u&&!n&&"mirror"!==o&&0!==r&&"inertia"!==a}class ji extends ks{constructor({autoplay:t=!0,delay:e=0,type:s="keyframes",repeat:i=0,repeatDelay:n=0,repeatType:o="loop",keyframes:r,name:a,motionValue:l,element:c,...u}){var h;super(),this.stop=()=>{var t,e;this._animation&&(this._animation.stop(),null==(t=this.stopTimeline)||t.call(this)),null==(e=this.keyframeResolver)||e.cancel()},this.createdAt=ee.now();const d={autoplay:t,delay:e,type:s,repeat:i,repeatDelay:n,repeatType:o,name:a,motionValue:l,element:c,...u},m=(null==c?void 0:c.KeyframeResolver)||ti;this.keyframeResolver=new m(r,(t,e,s)=>this.onKeyframesResolved(t,e,d,!s),a,l,c),null==(h=this.keyframeResolver)||h.scheduleResolve()}onKeyframesResolved(t,e,s,i){var n,o;this.keyframeResolver=void 0;const{name:r,type:a,velocity:l,delay:c,isHandoff:u,onUpdate:h}=s;this.resolvedAt=ee.now();let d=!0;(function(t,e,s,i){const n=t[0];if(null===n)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=fi(n,e),a=fi(o,e);return!(!r||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let s=0;s<t.length;s++)if(t[s]!==e)return!0}(t)||("spring"===s||ui(s))&&i)})(t,r,a,l)||(d=!1,!yt.instantAnimations&&c||null==h||h(Es(t,s,e)),t[0]=t[t.length-1],gi(s),s.repeat=0);const m={startTime:i?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...s,keyframes:t},p=d&&!u&&wi(m),f=null==(o=null==(n=m.motionValue)?void 0:n.owner)?void 0:o.current;let g;if(p)try{g=new pi({...m,element:f})}catch{g=new Ms(m)}else g=new Ms(m);g.finished.then(()=>{this.notifyFinished()}).catch(St),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||(null==(t=this.keyframeResolver)||t.resume(),Zs=!0,Qs(),Js(),Zs=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),null==(t=this.keyframeResolver)||t.cancel()}}function Si(t,e,s,i=0,n=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof s?s(o,r):1===n?o*i:a-o*i}class Ti{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{var e;const s=ee.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(null==(e=this.events.change)||e.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=ee.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new Et);const s=this.events[t].add(e);return"change"===t?()=>{s(),Gt.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;null==(t=this.events.change)||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=ee.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return kt(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,e;null==(t=this.dependents)||t.clear(),null==(e=this.events.destroy)||e.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Pi(t,e){return new Ti(t,e)}function Ei(t,e){if((null==t?void 0:t.inherit)&&e){const{inherit:s,...i}=t;return{...e,...i}}return t}function Ai(t,e){const s=(null==t?void 0:t[e])??(null==t?void 0:t.default)??t;return s!==t?Ei(s,t):s}const Ci={type:"spring",stiffness:500,damping:25,restSpeed:10},ki={type:"keyframes",duration:.8},Ni={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Mi=(t,{keyframes:e})=>e.length>2?ki:zs.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Ci:Ni,Vi=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);const Di=(t,e,s,i={},n,o)=>r=>{const a=Ai(i,t)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c-=At(l);const u={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:n};(function(t){for(const e in t)if(!Vi.has(e))return!0;return!1})(a)||Object.assign(u,Mi(t,u)),u.duration&&(u.duration=At(u.duration)),u.repeatDelay&&(u.repeatDelay=At(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let h=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(gi(u),0===u.delay&&(h=!0)),(yt.instantAnimations||yt.skipAnimations||(null==n?void 0:n.shouldSkipAnimations)||a.skipAnimations)&&(h=!0,gi(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!o&&void 0!==e.get()){const t=Es(u.ke
vendor: 5,767 bytes, line 1
1yframes,a);if(void 0!==t)return void Gt.update(()=>{u.onUpdate(t),u.onComplete()})}return a.isSync?new Ms(u):new ji(u)},Ri=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Li(t,e,s=1){const[i,n]=function(t){const e=Ri.exec(t);if(!e)return[,];const[,s,i,n]=e;return[`--${s??i}`,n]}(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const t=o.trim();return xt(t)?parseFloat(t):t}return oe(n)?Li(n,e,s+1):n}function Bi(t){const e=[{},{}];return null==t||t.values.forEach((t,s)=>{e[0][s]=t.get(),e[1][s]=t.getVelocity()}),e}function Ii(t,e,s,i){if("function"==typeof e){const[n,o]=Bi(i);e=e(void 0!==s?s:t.custom,n,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[n,o]=Bi(i);e=e(void 0!==s?s:t.custom,n,o)}return e}function Fi(t,e,s){const i=t.getProps();return Ii(i,e,void 0!==s?s:i.custom,t)}const Oi=new Set(["width","height","top","left","right","bottom",...Ws]),Ui=t=>Array.isArray(t);function _i(t,e,s){t.hasValue(e)?t.getValue(e).set(s):t.addValue(e,Pi(s))}function Wi(t){return Ui(t)?t[t.length-1]||0:t}const zi=t=>Boolean(t&&t.getVelocity);function $i(t,e){const s=t.getValue("willChange");if(i=s,Boolean(zi(i)&&i.add))return s.add(e);if(!s&&yt.WillChange){const s=new yt.WillChange("auto");t.addValue("willChange",s),s.add(e)}var i}function Yi(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Hi="data-"+Yi("framerAppearId");function Xi(t){return t.props[Hi]}function Ki({protectedKeys:t,needsAnimating:e},s){const i=t.hasOwnProperty(s)&&!0!==e[s];return e[s]=!1,i}function Gi(t,e,{delay:s=0,transitionOverride:i,type:n}={}){let{transition:o,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();o=o?Ei(o,l):l;const c=null==o?void 0:o.reduceMotion,u=null==o?void 0:o.skipAnimations;i&&(o=i);const h=[],d=n&&t.animationState&&t.animationState.getState()[n],m=null==o?void 0:o.path;m&&m.animateVisualElement(t,a,o,s,h);for(const p in a){const e=t.getValue(p,t.latestValues[p]??null),i=a[p];if(void 0===i||d&&Ki(d,p))continue;const n={delay:s,...Ai(o||{},p)};u&&(n.skipAnimations=!0);const r=e.get();if(void 0!==r&&!e.isAnimating()&&!Array.isArray(i)&&i===r&&!n.velocity){Gt.update(()=>e.set(i));continue}let l=!1;if(window.MotionHandoffAnimation){const e=Xi(t);if(e){const t=window.MotionHandoffAnimation(e,p,Gt);null!==t&&(n.startTime=t,l=!0)}}$i(t,p);const m=c??t.shouldReduceMotion;e.start(Di(p,e,i,m&&Oi.has(p)?{type:!1}:n,t,l));const f=e.animation;f&&h.push(f)}if(r){const e=()=>Gt.update(()=>{r&&function(t,e){const s=Fi(t,e);let{transitionEnd:i={},transition:n={},...o}=s||{};o={...o,...i};for(const r in o)_i(t,r,Wi(o[r]))}(t,r)});h.length?Promise.all(h).then(e):e()}return h}function qi(t,e,s={}){var i;const n=Fi(t,e,"exit"===s.type?null==(i=t.presenceContext)?void 0:i.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=n||{};s.transitionOverride&&(o=s.transitionOverride);const r=n?()=>Promise.all(Gi(t,n,s)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:n=0,staggerChildren:r,staggerDirection:a}=o;return function(t,e,s=0,i=0,n=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(qi(l,e,{...r,delay:s+("function"==typeof i?0:i)+Si(t.variantChildren,l,i,n,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,n,r,a,s)}:()=>Promise.resolve(),{when:l}=o;if(l){const[t,e]="beforeChildren"===l?[r,a]:[a,r];return t().then(()=>e())}return Promise.all([r(),a(s.delay)])}const Zi=t=>e=>e.test(t),Ji=[le,je,we,be,Te,Se,{test:t=>"auto"===t,parse:t=>t}],Qi=t=>Ji.find(Zi(t));function tn(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||wt(t))}const en=new Set(["brightness","contrast","saturate","opacity"]);function sn(t){const[e,s]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=s.match(de)||[];if(!i)return t;const n=s.replace(i,"");let o=en.has(e)?1:0;return i!==s&&(o*=100),e+"("+o+n+")"}const nn=/\b([a-z-]*)\(.*?\)/gu,on={...Le,getAnimatableNone:t=>{const e=t.match(nn);return e?e.map(sn).join(" "):t}},rn={...Le,getAnimatableNone:t=>{const e=Le.parse(t);return Le.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},an={...le,transform:Math.round},ln={borderWidth:je,borderTopWidth:je,borderRightWidth:je,borderBottomWidth:je,borderLeftWidth:je,borderRadius:je,borderTopLeftRadius:je,borderTopRightRadius:je,borderBottomRightRadius:je,borderBottomLeftRadius:je,width:je,maxWidth:je,height:je,maxHeight:je,top:je,right:je,bottom:je,left:je,inset:je,insetBlock:je,insetBlockStart:je,insetBlockEnd:je,insetInline:je,insetInlineStart:je,insetInlineEnd:je,padding:je,paddingTop:je,paddingRight:je,paddingBottom:je,paddingLeft:je,paddingBlock:je,paddingBlockStart:je,paddingBlockEnd:je,paddingInline:je,paddingInlineStart:je,paddingInlineEnd:je,margin:je,marginTop:je,marginRight:je,marginBottom:je,marginLeft:je,marginBlock:je,marginBlockStart:je,marginBlockEnd:je,marginInline:je,marginInlineStart:je,marginInlineEnd:je,fontSize:je,backgroundPositionX:je,backgroundPositionY:je,...{rotate:be,pathRotation:be,rotateX:be,rotateY:be,rotateZ:be,scale:ue,scaleX:ue,scaleY:ue,scaleZ:ue,skew:be,skewX:be,skewY:be,distance:je,translateX:je,translateY:je,translateZ:je,x:je,y:je,z:je,perspective:je,transformPerspective:je,opacity:ce,originX:Pe,originY:Pe,originZ:je},zIndex:an,fillOpacity:ce,strokeOpacity:ce,numOctaves:an},cn={...ln,color:Ae,backgroundColor:Ae,outlineColor:Ae,fill:Ae,stroke:Ae,borderColor:Ae,borderTopColor:Ae,borderRightColor:Ae,borderBottomColor:Ae,borderLeftColor:Ae,filter:on,WebkitFilter:on,mask:rn,WebkitMask:rn},un=t=>cn[t],hn=new Set([on,rn]);function dn(t,e){let s=un(t);return hn.has(s)||(s=Le),s.getAnimatableNone?s.getAnimatableNone(e):void 0}
vendor: 1,709 bytes, line 1
1const mn=new Set(["auto","none","0"]);class pn extends ti{constructor(t,e,s,i,n){super(t,e,s,i,n,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:s}=this;if(!e||!e.current)return;super.readKeyframes();for(let a=0;a<t.length;a++){let s=t[a];if("string"==typeof s&&(s=s.trim(),oe(s))){const i=Li(s,e.current);void 0!==i&&(t[a]=i),a===t.length-1&&(this.finalKeyframe=s)}}if(this.resolveNoneKeyframes(),!Oi.has(s)||2!==t.length)return;const[i,n]=t,o=Qi(i),r=Qi(n);if(ae(i)!==ae(n)&&Xs[s])this.needsMeasurement=!0;else if(o!==r)if($s(o)&&$s(r))for(let a=0;a<t.length;a++){const e=t[a];"string"==typeof e&&(t[a]=parseFloat(e))}else Xs[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,s=[];for(let i=0;i<t.length;i++)(null===t[i]||tn(t[i]))&&s.push(i);s.length&&function(t,e,s){let i,n=0;for(;n<t.length&&!i;){const e=t[n];"string"==typeof e&&!mn.has(e)&&Ve(e).values.length&&(i=t[n]),n++}if(i&&s)for(const o of e)t[o]=dn(s,i)}(t,s,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:s}=this;if(!t||!t.current)return;"height"===s&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Xs[s](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(s,i).jump(i,!1)}measureEndState(){var t;const{element:e,name:s,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const n=e.getValue(s);n&&n.jump(this.measuredOrigin,!1);const o=i.length-1,r=i[o];i[o]=Xs[s](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),(null==(t=this.removedTransforms)?void 0:t.length)&&this.removedTransforms.forEac
1h(([t,s])=>{e.getValue(t).set(s)}),this.resolveNoneKeyframes()}}const fn=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function gn(t,e,s){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let e=document;const i=(null==s?void 0:s[t])??e.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(t=>null!=t)}const vn=(t,e)=>e&&"number"==typeof t?e.transform(t):t;const{schedule:yn}=Kt(queueMicrotask,!1),xn={x:!1,y:!1};function bn(){return xn.x||xn.y}function wn(t,e){const s=gn(t),i=new AbortController;return[s,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function jn(t,e,s={}){const[i,n,o]=wn(t,s);return i.forEach(t=>{let s,i=!1,o=!1;const r=e=>{s&&(s(e),s=void 0),t.removeEventListener("pointerleave",l)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),o&&(o=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(i?o=!0:r(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||bn())return;o=!1;const r=e(t,i);"function"==typeof r&&(s=r,t.addEventListener("pointerleave",l,n))},n),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,n),window.addEventListener("pointercancel",a,n)},n)}),o}const Sn=(t,e)=>!!e&&(t===e||Sn(t,e.parentElement)),Tn=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Pn=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const En=new Set(["INPUT","SELECT","TEXTAREA"]);const An=new WeakSet;function Cn(t){return e=>{"Enter"===e.key&&t(e)}}function kn(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Nn(t){return Tn(t)&&!bn()}const Mn=new WeakSet;function Vn(t,e,s={}){const[i,n,o]=wn(t,s),r=t=>{const i=t.currentTarget;if(!Nn(t))return;if(Mn.has(t))return;An.add(i),s.stopPropagation&&Mn.add(t);const o=e(i,t),r={...n,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",l,r),window.removeEventListener("pointercancel",c,r),An.has(i)&&An.delete(i),Nn(t)&&"function"==typeof o&&o(t,{success:e})},l=t=>{a(t,i===window||i===document||s.useGlobalTarget||Sn(i,t.target))},c=t=>{a(t,!1)};window.addEventListener("pointerup",l,r),window.addEventListener("pointercancel",c,r)};return i.forEach(t=>{var e;(s.useGlobalTarget?window:t).addEventListener("pointerdown",r,n),bt(e=t)&&"offsetHeight"in e&&!("ownerSVGElement"in e)&&(t.addEventListener("focus",t=>((t,e)=>{const s=t.currentTarget;if(!s)return;const i=Cn(()=>{if(An.has(s))return;kn(s,"down");const t=Cn(()=>{kn(s,"up")});s.addEventListener("keyup",t,e),s.addEventListener("blur",()=>kn(s,"cancel"),e)});s.addEventListener("keydown",i,e),s.addEventListener("blur",()=>s.removeEventListener("keydown",i),e)})(t,n)),function(t){return Pn.has(t.tagName)||!0===t.isContentEditable}(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o}function Dn(t){return bt(t)&&"ownerSVGElement"in t}const Rn=new WeakMap;let Ln;const Bn=(t,e,s)=>(i,n)=>n&&n[0]?n[0][t+"Size"]:Dn(i)&&"getBBox"in i?i.getBBox()[e]:i[s],In=Bn("inline","width","offsetWidth"),Fn=Bn("block","height","offsetHeight");function On({target:t,borderBoxSize:e}){var s;null==(s=Rn.get(t))||s.forEach(s=>{s(t,{get width(){return In(t,e)},get height(){return Fn(t,e)}})})}function Un(t){t.forEach(On)}function _n(t,e){Ln||"undefined"!=typeof ResizeObserver&&(Ln=new ResizeObserver(Un));const s=gn(t);return s.forEach(t=>{let s=Rn.get(t);s||(s=new Set,Rn.set(t,s)),s.add(e),null==Ln||Ln.observe(t)}),()=>{s.forEach(t=>{const s=Rn.get(t);null==s||s.delete(e),(null==s?void 0:s.size)||null==Ln||Ln.unobserve(t)})}}const Wn=new Set;let zn;function $n(t){return Wn.add(t),zn||(zn=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Wn.forEach(e=>e(t))},window.addEventListener("resize",zn)),()=>{Wn.delete(t),Wn.size||"function"!=typeof zn||(window.removeEventListener("resize",zn),zn=void 0)}}function Yn(t,e){return"function"==typeof t?$n(t):_n(t,e)}const Hn=[...Ji,Ae,Le],Xn=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Kn=new WeakMap;function Gn(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function qn(t){return"string"==typeof t||Array.isArray(t)}const Zn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Jn=["initial",...Zn];function Qn(t){return Gn(t.animate)||Jn.some(e=>qn(t[e]))}function to(t){return Boolean(Qn(t)||t.variants)}const eo={current:null},so={current:!1},io="undefined"!=typeof window;const no=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let oo={};function ro(t){oo=t}class ao{scrapeMotionValuesFromProps(t,e,s){return{}}constructor({parent:t,props:e,presenceContext:s,reducedMotionConfig:i,skipAnimations:n,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=ti,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=ee.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,Gt.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=r;this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=e,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=n,this.options=a,this.blockInitialAnimation=Boolean(o),this.isControllingVariants=Qn(e),this.isVariantNode=to(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...h}=this.scrapeMotionValuesFromProps(e,{},this);for(const d in h){const t=h[d];void 0!==l[d]&&zi(t)&&t.set(l[d])}}mount(t){var e,s;if(this.hasBeenMounted)for(const i in this.initialValues)null==(e=this.values.get(i))||e.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=t,Kn.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEac
vendor: 4,886 bytes, line 1
1h((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(so.current||function(){if(so.current=!0,io)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>eo.current=t.matches;t.addEventListener("change",e),e()}else eo.current=!1}(),this.shouldReduceMotion=eo.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,null==(s=this.parent)||s.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),qt(this.notifyUpdate),qt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),null==(t=this.parent)||t.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&vi.has(t)&&this.current instanceof HTMLElement){const{factory:s,keyframes:i,times:n,ease:o,duration:r}=e.accelerate,a=new hi({element:this.current,name:t,keyframes:i,times:n,ease:o,duration:At(r)}),l=s(a);return void this.valueSubscriptions.set(t,()=>{l(),a.cancel()})}const s=zs.has(t);s&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&Gt.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let n;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(n=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),n&&n()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in oo){const e=oo[t];if(!e)continue;const{isEnabled:s,Feature:i}=e;if(!this.features[t]&&i&&s(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let s=0;s<no.length;s++){const e=no[s];this.propEventSubscriptions[e]&&(this.propEventSubscriptions[e](),delete this.propEventSubscriptions[e]);const i=t["on"+e];i&&(this.propEventSubscriptions[e]=this.on(e,i))}this.prevMotionValues=function(t,e,s){for(const i in e){const n=e[i],o=s[i];if(zi(n))t.addValue(i,n);else if(zi(o))t.addValue(i,Pi(n,{owner:t}));else if(o!==n)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(n):e.hasAnimated||e.set(n)}else{const e=t.getStaticValue(i);t.addValue(i,Pi(void 0!==e?e:n,{owner:t}))}}for(const i in s)void 0===e[i]&&t.removeValue(i);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const s=this.values.get(t);e!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return void 0===s&&void 0!==e&&(s=Pi(null===e?void 0:e,{owner:this}),this.addValue(t,s)),s}readValue(t,e){let s=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var i;
vendor: 4,268 bytes, line 1
1return null!=s&&("string"==typeof s&&(xt(s)||wt(s))?s=parseFloat(s):(i=s,!Hn.find(Zi(i))&&Le.test(e)&&(s=dn(t,e))),this.setBaseTarget(t,zi(s)?s.get():s)),zi(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:s}=this.props;let i;if("string"==typeof s||"object"==typeof s){const n=Ii(this.props,s,null==(e=this.presenceContext)?void 0:e.custom);n&&(i=n[t])}if(s&&void 0!==i)return i;const n=this.getBaseTargetFromProps(this.props,t);return void 0===n||zi(n)?void 0!==this.initialValues[t]&&void 0===i?void 0:this.baseTarget[t]:n}on(t,e){return this.events[t]||(this.events[t]=new Et),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){yn.render(this.render)}}class lo extends ao{constructor(){super(...arguments),this.KeyframeResolver=pn}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const s=t.style;return s?s[e]:void 0}removeValueFromRenderState(t,{vars:e,style:s}){delete e[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;zi(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class co{constructor(t){this.isMounted=!1,this.node=t}update(){}}function uo({top:t,left:e,right:s,bottom:i}){return{x:{min:e,max:s},y:{min:t,max:i}}}function ho(t){return void 0===t||1===t}function mo({scale:t,scaleX:e,scaleY:s}){return!ho(t)||!ho(e)||!ho(s)}function po(t){return mo(t)||fo(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function fo(t){return go(t.x)||go(t.y)}function go(t){return t&&"0%"!==t}function vo(t,e,s){return s+e*(t-s)}function yo(t,e,s,i,n){return void 0!==n&&(t=vo(t,n,i)),vo(t,s,i)+e}function xo(t,e=0,s=1,i,n){t.min=yo(t.min,e,s,i,n),t.max=yo(t.max,e,s,i,n)}function bo(t,{x:e,y:s}){xo(t.x,e.translate,e.scale,e.originPoint),xo(t.y,s.translate,s.scale,s.originPoint)}const wo=.999999999999,jo=1.0000000000001;function So(t,e){t.min+=e,t.max+=e}function To(t,e,s,i,n=.5){xo(t,e,s,Fe(t.min,t.max,n),i)}function Po(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function Eo(t,e,s){const i=s??t;To(t.x,Po(e.x,i.x),e.scaleX,e.scale,e.originX),To(t.y,Po(e.y,i.y),e.scaleY,e.scale,e.originY)}function Ao(t,e){return uo(function(t,e){if(!e)return t;const s=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:s.y,left:s.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}const Co={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ko=Ws.length;function No(t,e,s){const{style:i,vars:n,transformOrigin:o}=t;let r=!1,a=!1;for(const l in e){const t=e[l];if(zs.has(l))r=!0;else if(ie(l))n[l]=t;else{const e=vn(t,ln[l]);l.startsWith("origin")?(a=!0,o[l]=e):i[l]=e}}if(e.transform||(r||s?i.transform=function(t,e,s){let i="",n=!0;for(let r=0;r<ko;r++){const o=Ws[r],a=t[o];if(void 0===a)continue;let l=!0;if("number"==typeof a)l=a===(o.startsWith("scale")?1:0);else{const t=parseFloat(a);l=o.startsWith("scale")?1===t:0===t}if(!l||s){const t=vn(a,ln[o]);l||(n=!1,i+=`${Co[o]||o}(${t}) `),s&&(e[o]=t)}}const o=t.pathRotation;return o&&(n=!1,i+=`rotate(${vn(o,ln.pathRotation)}) `),i=i.trim(),s?i=s(e,n?"":i):n&&(i="none"),i}(e,t.transform,s):i.transform&&(i.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:s=0}=o;i.transformOrigin=`${t} ${e} ${s}`}}function Mo(t,{style:e,vars:s},i,n){const o=t.style;let r;for(r in e)o[r]=e[r];for(r in null==n||n.applyProjectionStyles(o,i),s)o.setProperty(r,s[r])}function Vo(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Do={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!je.test(t))return t;t=parseFloat(t)}return`${Vo(t,e.target.x)}% ${Vo(t,e.target.y)}%`}},Ro={correct:(t,{treeScale:e,projectionDelta:s})=>{const i=t,n=Le.parse(t);if(n.length>5)return i;const o=Le.createTransformer(t),r="number"!=typeof n[0]?1:0,a=s.x.scale*e.x,l=s.y.scale*e.y;n[0+r]/=a,n[1+r]/=l;const c=Fe(a,l,.5);return"number"==typeof n[2+r]&&(n[2+r]/=c),"number"==typeof n[3+r]&&(n[3+r]/=c),o(n)}},Lo={borderRadius:{...Do,applyTo:[...fn]},borderTopLeftRadius:Do,borderTopRightRadius:Do,borderBottomLeftRadius:Do,borderBottomRightRadius:Do,boxSh
1adow:Ro};function Bo(t,{layout:e,layoutId:s}){return zs.has(t)||t.startsWith("origin")||(e||void 0!==s)&&(!!Lo[t]||"opacity"===t)}function Io(t,e,s){var i;const n=t.style,o=null==e?void 0:e.style,r={};if(!n)return r;for(const a in n)(zi(n[a])||o&&zi(o[a])||Bo(a,t)||void 0!==(null==(i=null==s?void 0:s.getValue(a))?void 0:i.liveStyle))&&(r[a]=n[a]);return r}class Fo extends lo{constructor(){super(...arguments),this.type="html",this.renderInstance=Mo}mount(t){Boolean(t.style),super.mount(t)}readValueFromInstance(t,e){var s,i;if(zs.has(e))return(null==(s=this.projection)?void 0:s.isProjecting)?Os(e):((t,e)=>{const{transform:s="none"}=getComputedStyle(t);return Us(s,e)})(t,e);{const s=(i=t,window.getComputedStyle(i)),n=(ie(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof n?n.trim():n}}measureInstanceViewportBox(t,{transformPagePoint:e}){return Ao(t,e)}build(t,e,s){No(t,e,s.transformTemplate)}scrapeMotionValuesFromProps(t,e,s){return Io(t,e,s)}}const Oo={offset:"stroke-dashoffset",array:"stroke-dasharray"},Uo={offset:"strokeDashoffset",array:"strokeDasharray"};const _o=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Wo(t,{attrX:e,attrY:s,attrScale:i,pathLength:n,pathSpacing:o=1,pathOffset:r=0,...a},l,c,u){if(No(t,a,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=(null==u?void 0:u.transformBox)??"fill-box",delete h.transformBox);for(const m of _o)void 0!==h[m]&&(d[m]=h[m],delete h[m]);void 0!==e&&(h.x=e),void 0!==s&&(h.y=s),void 0!==i&&(h.scale=i),void 0!==n&&function(t,e,s=1,i=0,n=!0){t.pathLength=1;const o=n?Oo:Uo;t[o.offset]=""+-i,t[o.array]=`${e} ${s}`}(h,n,o,r,!1)}const zo=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),$o=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Yo(t,e,s){const i=Io(t,e,s);for(const n in t)if(zi(t[n])||zi(e[n])){i[-1!==Ws.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}class Ho extends lo{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Xn}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(zs.has(e)){const t=un(e);return t&&t.default||0}return e=zo.has(e)?e:Yi(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,s){return Yo(t,e,s)}build(t,e,s){Wo(t,e,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(t,e,s,i){!function(t,e,s,i){Mo(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(zo.has(n)?n:Yi(n),e.attrs[n])}(t,e,0,i)}mount(t){this.isSVGTag=$o(t.tagName),super.mount(t)}}const Xo=Jn.length;function Ko(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&Ko(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let s=0;s<Xo;s++){const i=Jn[s],n=t.props[i];(qn(n)||!1===n)&&(e[i]=n)}return e}function Go(t,e){if(!Array.isArray(e))return!1;const s=e.length;if(s!==t.length)return!1;for(let i=0;i<s;i++)if(e[i]!==t[i])return!1;return!0}const qo=[...Zn].reverse(),Zo=Zn.length;function Jo(t){return e=>Promise.all(e.map(({animation:e,options:s})=>function(t,e,s={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const n=e.map(e=>qi(t,e,s));i=Promise.all(n)}else if("string"==typeof e)i=qi(t,e,s);else{const n="function"==typeof e?Fi(t,e,s.custom):e;i=Promise.all(Gi(t,n,s))}return i.then(()=>{t.notify("AnimationComplete",e)})}(t,e,s)))}function Qo(t){let e=Jo(t),s=sr(),i=!0,n=!1;const o=e=>(s,i)=>{var n;const o=Fi(t,i,"exit"===e?null==(n=t.presenceContext)?void 0:n.custom:void 0);if(o){const{transition:t,transitionEnd:e,...i}=o;s={...s,...i,...e}}return s};function r(r){const{props:a}=t,l=Ko(t.parent)||{},c=[],u=new Set;let h={},d=1/0;for(let e=0;e<Zo;e++){const m=qo[e],p=s[m],f=void 0!==a[m]?a[m]:l[m],g=qn(f),v=m===r?p.isActive:null;!1===v&&(d=e);let y=f===l[m]&&f!==a[m]&&g;if(y&&(i||n)&&t.manuallyAnimateOnMount&&(y=!1),p.protectedKeys={...h},!p.isActive&&null===v||!f&&!p.prevProp||Gn(f)||"boolean"==typeof f)continue;if("exit"===m&&p.isActive&&!0!==v){p.prevResolvedValues&&(h={...h,...p.prevResolvedValues});continue}const x=tr(p.prevProp,f);let b=x||m===r&&p.isActive&&!y&&g||e>d&&g,w=!1;const j=Array.isArray(f)?f:[f];let S=j.reduce(o(m),{});!1===v&&(S={});const{prevResolvedValues:T={}}=p,P={...T,...S},E=e=>{b=!0,u.has(e)&&(w=!0,u.delete(e)),p.needsAnimating[e]=!0;const s=t.getValue(e);s&&(s.liveStyle=!1)};for(const t in P){const e=S[t],s=T[t];if(h.hasOwnProperty(t))continue;let i=!1;i=Ui(e)&&Ui(s)?!Go(e,s)||x:e!==s,i?null!=e?E(t):u.add(t):void 0!==e&&u.has(t)?E(t):p.protectedKeys[t]=!0}p.prevProp=f,p.prevResolvedValues=S,p.isActive&&(h={...h,...S}),(i||n)&&t.blockInitialAnimation&&(b=!1);const A=y&&x;b&&(!A||w)&&c.push(...j.map(e=>{const s={type:m};if("string"==typeof e&&(i||n)&&!A&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,n=Fi(i,e);if(i.enteringChildren&&n){const{delayChildren:e}=n.transition||{};s.delay=Si(i.enteringChildren,t,e)}}return{animation:e,options:s}}))}if(u.size){const e={};if("boolean"!=typeof a.initial){const s=Fi(t,Array.isArray(a.initial)?a.initial[0]:a.initial);s&&s.transition&&(e.transition=s.transition)}u.forEach(s=>{const i=t.getBaseTarget(s),n=t.getValue(s);n&&(n.liveStyle=!0),e[s]=i??null}),c.push({animation:e})}let m=Boolean(c.length);return!i||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(m=!1),i=!1,n=!1,m?e(c):Promise.resolve()}return{animateChanges:r,setActive:function(e,i){var n;if(s[e].isActive===i)return Promise.resolve();
vendor: 4,135 bytes, line 1
1null==(n=t.variantChildren)||n.forEach(t=>{var s;return null==(s=t.animationState)?void 0:s.setActive(e,i)}),s[e].isActive=i;const o=r(e);for(const t in s)s[t].protectedKeys={};return o},setAnimateFunction:function(s){e=s(t)},getState:()=>s,reset:()=>{s=sr(),n=!0}}}function tr(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Go(e,t)}function er(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function sr(){return{animate:er(!0),whileInView:er(),whileHover:er(),whileTap:er(),whileDrag:er(),whileFocus:er(),exit:er()}}function ir(t,e){t.min=e.min,t.max=e.max}function nr(t,e){ir(t.x,e.x),ir(t.y,e.y)}function or(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function rr(t){return t.max-t.min}function ar(t,e,s,i=.5){t.origin=i,t.originPoint=Fe(e.min,e.max,t.origin),t.scale=rr(s)/rr(e),t.translate=Fe(s.min,s.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function lr(t,e,s,i){ar(t.x,e.x,s.x,i?i.originX:void 0),ar(t.y,e.y,s.y,i?i.originY:void 0)}function cr(t,e,s,i=0){const n=i?Fe(s.min,s.max,i):s.min;t.min=n+e.min,t.max=t.min+rr(e)}function ur(t,e,s,i=0){const n=i?Fe(s.min,s.max,i):s.min;t.min=e.min-n,t.max=t.min+rr(e)}function hr(t,e,s,i){ur(t.x,e.x,s.x,null==i?void 0:i.x),ur(t.y,e.y,s.y,null==i?void 0:i.y)}function dr(t,e,s,i,n){return t=vo(t-=e,1/s,i),void 0!==n&&(t=vo(t,1/n,i)),t}function mr(t,e,[s,i,n],o,r){!function(t,e=0,s=1,i=.5,n,o=t,r=t){we.test(e)&&(e=parseFloat(e),e=Fe(r.min,r.max,e/100)-r.min);if("number"!=typeof e)return;let a=Fe(o.min,o.max,i);t===o&&(a-=e),t.min=dr(t.min,e,s,a,n),t.max=dr(t.max,e,s,a,n)}(t,e[s],e[i],e[n],e.scale,o,r)}const pr=["x","scaleX","originX"],fr=["y","scaleY","originY"];function gr(t,e,s,i){mr(t.x,e,pr,s?s.x:void 0,i?i.x:void 0),mr(t.y,e,fr,s?s.y:void 0,i?i.y:void 0)}function vr(t){return 0===t.translate&&1===t.scale}function yr(t){return vr(t.x)&&vr(t.y)}function xr(t,e){return t.min===e.min&&t.max===e.max}function br(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function wr(t,e){return br(t.x,e.x)&&br(t.y,e.y)}function jr(t){return rr(t.x)/rr(t.y)}function Sr(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Tr(t){return[t("x"),t("y")]}const Pr=fn.length,Er=t=>"string"==typeof t?parseFloat(t):t,Ar=t=>"number"==typeof t||je.test(t);function Cr(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const kr=Mr(0,.5,Ot),Nr=Mr(.5,.95,St);function Mr(t,e,s){return i=>i<t?0:i>e?1:s(Pt(t,e,i))}function Vr(t,e,s,i={passive:!0}){return t.addEventListener(e,s,i),()=>t.removeEventListener(e,s,i)}const Dr=(t,e)=>t.depth-e.depth;class Rr{constructor(){this.children=[],this.isDirty=!1}add(t){ft(this.children,t),this.isDirty=!0}remove(t){gt(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Dr),this.isDirty=!1,this.children.forEach(t)}}function Lr(t){return zi(t)?t.get():t}class Br{constructor(){this.members=[]}add(t){ft(this.members,t);for(let e=this.members.length-1;e>=0;e--){const s=this.members[e];if(s===t||s===this.lead||s===this.prevLead)continue;const i=s.instance;i&&!1!==i.isConnected||s.snapshot||(gt(this.members,s),s.unmount())}t.scheduleRender()}remove(t){if(gt(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){var e;for(let s=this.members.indexOf(t)-1;s>=0;s--){const t=this.members[s];if(!1!==t.isPresent&&!1!==(null==(e=t.instance)?void 0:e.isConnected))return this.promote(t),!0}return!1}promote(t,e){var s;const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.updateSnapshot(),t.scheduleRender();const{layoutDependency:n}=i.options,{layoutDependency:o}=t.options;void 0!==n&&n===o||(t.resumeFrom=i,e&&(i.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),(null==(s=t.root)?void 0:s.isUpdating)&&(t.isLayoutDirty=!0)),!1===t.options.crossfade&&i.hide()}}
vendor: 4,780 bytes, line 1
1exitAnimationComplete(){this.members.forEach(t=>{var e,s,i,n,o;null==(s=(e=t.options).onExitComplete)||s.call(e),null==(o=null==(i=t.resumingFrom)?void 0:(n=i.options).onExitComplete)||o.call(n)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(null==(t=this.lead)?void 0:t.snapshot)&&(this.lead.snapshot=void 0)}}const Ir={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Fr=["","X","Y","Z"];let Or=0;function Ur(t,e,s,i){const{latestValues:n}=e;n[t]&&(s[t]=n[t],e.setStaticValue(t,0),i&&(i[t]=0))}function _r(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const s=Xi(e);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(s,"transform",Gt,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&_r(i)}function Wr({attachResizeListener:t,defaultParent:e,measureScroll:s,checkIsScrollRoot:i,resetTransform:n}){return class{constructor(t={},s=(null==e?void 0:e())){this.id=Or++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Yr),this.nodes.forEach(ta),this.nodes.forEach(ea),this.nodes.forEach(Hr)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new Rr)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new Et),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const s=this.eventHandlers.get(t);s&&s.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e){if(this.instance)return;var s;this.isSVG=Dn(e)&&!(Dn(s=e)&&"svg"===s.tagName),this.instance=e;const{layoutId:i,layout:n,visualElement:o}=this.options;if(o&&!o.current&&o.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(n||i)&&(this.isLayoutDirty=!0),t){let s,i=0;const n=()=>this.root.updateBlockedByResize=!1;Gt.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,s&&s(),s=function(t,e){const s=ee.now(),i=({timestamp:n})=>{const o=n-s;o>=e&&(qt(i),t(o-e))};return Gt.setup(i,!0),()=>qt(i)}(n,250),Ir.hasAnimatedSinceResize&&(Ir.hasAnimatedSinceResize=!1,this.nodes.forEach(Qr)))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&o&&(i||n)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:s,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const n=this.options.transition||o.getDefaultTransition()||aa,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!wr(this.targetLayout,i),c=!e&&s;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...Ai(n,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c,e.path)}else e||Qr(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),qt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEac
vendor: 6,002 bytes, line 1
1h(sa),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&_r(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let n=0;n<this.path.length;n++){const t=this.path[n];t.shouldResetTransform=!0,"string"!=typeof t.latestValues.x&&"string"!=typeof t.latestValues.y||(t.isLayoutDirty=!0),t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}const{layoutId:e,layout:s}=this.options;if(void 0===e&&!s)return;const i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked()){const t=this.updateBlockedByResize;return this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),t&&this.nodes.forEach(Gr),void this.nodes.forEach(Kr)}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(qr);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Zr),this.nodes.forEach(Jr),this.nodes.forEach(zr),this.nodes.forEach($r)):this.nodes.forEach(qr),this.clearAllSnapshots();const t=ee.now();Zt.delta=vt(0,1e3/60,t-Zt.timestamp),Zt.timestamp=t,Zt.isProcessing=!0,Jt.update.process(Zt),Jt.preRender.process(Zt),Jt.render.process(Zt),Zt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,yn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Xr),this.sharedNodes.forEach(ia)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Gt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Gt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||rr(this.snapshot.measuredBox.x)||rr(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let s=0;s<this.path.length;s++){this.path[s].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}}),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&this.instance){const e=i(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!n)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!yr(this.projectionDelta),s=this.getTransformTemplate(),i=s?s(this.latestValues,""):void 0,o=i!==this.prevTransformTemplateValue;t&&this.instance&&(e||po(this.latestValues)||o)&&(n(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let s=this.removeElementScroll(e);var i;return t&&(s=this.removeTransform(s)),ua((i=s).x),ua(i.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:s,latestValues:{},source:this.id}}measurePageBox(){var t;const{visualElement:e}=this.options;if(!e)return{x:{min:0,max:0},y:{min:0,max:0}};const s=e.measureViewportBox();if(!((null==(t=this.scroll)?void 0:t.wasRoot)||this.path.some(da))){const{scroll:t}=this.root;t&&(So(s.x,t.offset.x),So(s.y,t.offset.y))}return s}removeElementScroll(t){var e;const s={x:{min:0,max:0},y:{min:0,max:0}};if(nr(s,t),null==(e=this.scroll)?void 0:e.wasRoot)return s;for(let i=0;i<this.path.length;i++){const e=this.path[i],{scroll:n,options:o}=e;e!==this.root&&n&&o.layoutScroll&&(n.wasRoot&&nr(s,t),So(s.x,n.offset.x),So(s.y,n.offset.y))}return s}applyTransform(t,e=!1,s){var i,n;const o=s||{x:{min:0,max:0},y:{min:0,max:0}};nr(o,t);for(let r=0;r<this.path.length;r++){const t=this.path[r];!e&&t.options.layoutScroll&&t.scroll&&t!==t.root&&(So(o.x,-t.scroll.offset.x),So(o.y,-t.scroll.offset.y)),po(t.latestValues)&&Eo(o,t.latestValues,null==(i=t.layout)?void 0:i.layoutBox)}return po(this.latestValues)&&Eo(o,this.latestValues,null==(n=this.layout)?void 0:n.layoutBox),o}removeTransform(t){var e;const s={x:{min:0,max:0},y:{min:0,max:0}};nr(s,t);for(let i=0;i<this.path.length;i++){const t=this.path[i];if(!po(t.latestValues))continue;let n;t.instance&&(mo(t.latestValues)&&t.updateSnapshot(),n=Xn(),nr(n,t.measurePageBox())),gr(s,t.latestValues,null==(e=t.snapshot)?void 0:e.layoutBox,n)}return po(this.latestValues)&&gr(s,this.latestValues),s}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Zt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){var e;const s=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=s.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=s.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=s.isS
1haredProjectionDirty);const i=Boolean(this.resumingFrom)||this!==s;if(!(t||i&&this.isSharedProjectionDirty||this.isProjectionDirty||(null==(e=this.parent)?void 0:e.isProjectionDirty)||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:n,layoutId:o}=this.options;if(!this.layout||!n&&!o)return;this.resolvedRelativeTargetAt=Zt.timestamp;const r=this.getClosestProjectingParent();var a,l,c,u;(r&&this.linkedParentVersion!==r.layoutVersion&&!r.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(!1!==this.options.layoutAnchor&&r&&r.layout?this.createRelativeTarget(r,this.layout.layoutBox,r.layout.layoutBox):this.removeRelativeTarget()),this.relativeTarget||this.targetDelta)&&(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),a=this.target,l=this.relativeTarget,c=this.relativeParent.target,u=this.options.layoutAnchor||void 0,cr(a.x,l.x,c.x,null==u?void 0:u.x),cr(a.y,l.y,c.y,null==u?void 0:u.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.applyTransform(this.layout.layoutBox,!1,this.target):nr(this.target,this.layout.layoutBox),bo(this.target,this.targetDelta)):nr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,!1!==this.options.layoutAnchor&&r&&Boolean(r.resumingFrom)===Boolean(this.resumingFrom)&&!r.options.layoutScroll&&r.target&&1!==this.animationProgress?this.createRelativeTarget(r,this.target,r.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(this.parent&&!mo(this.parent.latestValues)&&!fo(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(t,e,s){this.relativeParent=t,this.linkedParentVersion=t.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},hr(this.relativeTargetOrigin,e,s,this.options.layoutAnchor||void 0),nr(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var t;const e=this.getLead(),s=Boolean(this.resumingFrom)||this!==e;let i=!0;if((this.isProjectionDirty||(null==(t=this.parent)?void 0:t.isProjectionDirty))&&(i=!1),s&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(i=!1),this.resolvedRelativeTargetAt===Zt.timestamp&&(i=!1),i)return;const{layout:n,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!n&&!o)return;nr(this.layoutCorrected,this.layout.layoutBox);const r=this.treeScale.x,a=this.treeScale.y;!function(t,e,s,i=!1){var n;const o=s.length;if(!o)return;let r,a;e.x=e.y=1;for(let l=0;l<o;l++){r=s[l],a=r.projectionDelta;const{visualElement:o}=r.options;o&&o.props.style&&"contents"===o.props.style.display||(i&&r.options.layoutScroll&&r.scroll&&r!==r.root&&(So(t.x,-r.scroll.offset.x),So(t.y,-r.scroll.offset.y)),a&&(e.x*=a.x.scale,e.y*=a.y.scale,bo(t,a)),i&&po(r.latestValues)&&Eo(t,r.latestValues,null==(n=r.layout)?void 0:n.layoutBox))}e.x<jo&&e.x>wo&&(e.x=1),e.y<jo&&e.y>wo&&(e.y=1)}(this.layoutCorrected,this.treeScale,this.path,s),!e.layout||e.target||1===this.treeScale.x&&1===this.treeScale.y||(e.target=e.layout.layoutBox,e.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=e;l?(this.projectionDelta&&this.prevProjectionDelta?(or(this.prevProjectionDelta.x,this.projectionDelta.x),or(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),lr(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===r&&this.treeScale.y===a&&Sr(this.projectionDelta.x,this.prevProjectionDelta.x)&&Sr(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e;if(null==(e=this.options.visualElement)||e.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1,s){const i=this.snapshot,n=i?i.latestValues:{},o={...this.latestValues},r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const a={x:{min:0,max:0},y:{min:0,max:0}},l=(i?i.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),u=!c||c.members.length<=1,h=Boolean(l&&!u&&!0===this.options.crossfade&&!this.path.some(ra));let d;this.animationProgress=0;const m=null==s?void 0:s.interpolateProjection(t);this.mixTargetDelta=e=>{const s=e/1e3,i=null==m?void 0:m(s);var c,p,f,g,v,y;i?(r.x.translate=i.x,r.x.scale=Fe(t.x.scale,1,s),r.x.origin=t.x.origin,r.x.originPoint=t.x.originPoint,r.y.translate=i.y,r.
vendor: 6,378 bytes, line 1
1y.scale=Fe(t.y.scale,1,s),r.y.origin=t.y.origin,r.y.originPoint=t.y.originPoint):(na(r.x,t.x,s),na(r.y,t.y,s)),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(hr(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),f=this.relativeTarget,g=this.relativeTargetOrigin,v=a,y=s,oa(f.x,g.x,v.x,y),oa(f.y,g.y,v.y,y),d&&(c=this.relativeTarget,p=d,xr(c.x,p.x)&&xr(c.y,p.y))&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),nr(d,this.relativeTarget)),l&&(this.animationValues=o,function(t,e,s,i,n,o){n?(t.opacity=Fe(0,s.opacity??1,kr(i)),t.opacityExit=Fe(e.opacity??1,0,Nr(i))):o&&(t.opacity=Fe(e.opacity??1,s.opacity??1,i));for(let r=0;r<Pr;r++){const n=fn[r];let o=Cr(e,n),a=Cr(s,n);void 0===o&&void 0===a||(o||(o=0),a||(a=0),0===o||0===a||Ar(o)===Ar(a)?(t[n]=Math.max(Fe(Er(o),Er(a),i),0),(we.test(a)||we.test(o))&&(t[n]+="%")):t[n]=a)}(e.rotate||s.rotate)&&(t.rotate=Fe(e.rotate||0,s.rotate||0,i))}(o,n,this.latestValues,s,h,u)),i&&void 0!==i.rotate&&(this.animationValues||(this.animationValues=o),this.animationValues.pathRotation=i.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=s},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){var e,s,i;this.notifyListeners("animationStart"),null==(e=this.currentAnimation)||e.stop(),null==(i=null==(s=this.resumingFrom)?void 0:s.currentAnimation)||i.stop(),this.pendingAnimation&&(qt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Gt.update(()=>{Ir.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Pi(0)),this.motionValue.jump(0,!1),this.currentAnimation=function(t,e,s){const i=zi(t)?t:Pi(t);return i.start(Di("",i,e,s)),i.animation}(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:s,layout:i,latestValues:n}=t;if(e&&s&&i){if(this!==t&&this.layout&&i&&ha(this.options.animationType,this.layout.layoutBox,i.layoutBox)){s=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=rr(this.layout.layoutBox.x);s.x.min=t.target.x.min,s.x.max=s.x.min+e;const i=rr(this.layout.layoutBox.y);s.y.min=t.target.y.min,s.y.max=s.y.min+i}nr(e,s),Eo(e,n),lr(this.projectionDeltaWithTransform,this.layoutCorrected,e,n)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Br);this.sharedNodes.get(t).add(e);const s=e.options.initialPromotionConfig;e.promote({transition:s?s.transition:void 0,preserveFollowOpacity:s&&s.shouldPreserveFollowOpacity?s.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null==(t=this.getStack())?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null==(t=this.getStack())?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:s}={}){const i=this.getStack();i&&i.promote(this,s),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:s}=t;if((s.z||s.rotate||s.rotateX||s.rotateY||s.rotateZ||s.skewX||s.skewY)&&(e=!0),!e)return;const i={};s.z&&Ur("z",t,i,this.animationValues);for(let n=0;n<Fr.length;n++)Ur(`rotate${Fr[n]}`,t,i,this.animationValues),Ur(`skew${Fr[n]}`,t,i,this.animationValues);t.render();for(const n in i)t.setStaticValue(n,i[n]),this.animationValues&&(this.animationValues[n]=i[n]);t.scheduleRender()}applyProjectionStyles(t,e){if(!this.instance||this.isSVG)return;if(!this.isVisible)return void(t.visibility="hidden");const s=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,t.visibility="",t.opacity="",t.pointerEvents=Lr(null==e?void 0:e.pointerEvents)||"",void(t.transform=s?s(this.latestValues,""):"none");const i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target)return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=Lr(null==e?void 0:e.pointerEvents)||""),void(this.hasProjected&&!po(this.latestValues)&&(t.transform=s?s({},""):"none",this.hasProjected=!1));t.visibility="";const n=i.animationValues||i.latestValues;this.applyTransformsToTarget();let o=function(t,e,s){let i="";const n=t.x.translate/e.x,o=t.y.translate/e.y,r=(null==s?void 0:s.z)||0;if((n||o||r)&&(i=`translate3d(${n}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),s){const{transformPerspective:t,rotate:e,pathRotation:n,rotateX:o,rotateY:r,skewX:a,skewY:l}=s;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),n&&(i+=`rotate(${n}deg) `),o&&(i+=`rotateX(${o}deg) `),r&&(i+=`rotateY(${r}deg) `),a&&(i+=`skewX(${a}deg) `),l&&(i+=`skewY(${l}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}(this.projectionDeltaWithTransform,this.treeScale,n);s&&(o=s(n,o)),t.transform=o;const{x:r,y:a}=this.projectionDelta;t.transformOrigin=`${100*r.origin}% ${100*a.origin}% 0`,i.animationValues?t.opacity=i===this?n.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:n.opacityExit:t.opacity=i===this?void 0!==n.opacity?n.opacity:"":void 0!==n.opacityExit?n.opacityExit:0;for(const l in Lo){if(void 0===n[l])continue;const{correct:e,applyTo:s,isCSSVariable:r}=Lo[l],a="none"===o?n[l]:e(n[l],i);if(s){const e=s.length;for(let i=0;i<e;i++)t[s[i]]=a}
1else r?this.options.visualElement.renderState.vars[l]=a:t[l]=a}this.options.layoutId&&(t.pointerEvents=i===this?Lr(null==e?void 0:e.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null==(e=t.currentAnimation)?void 0:e.stop()}),this.root.nodes.forEach(Kr),this.root.sharedNodes.clear()}}}function zr(t){t.updateLayout()}function $r(t){var e;const s=(null==(e=t.resumeFrom)?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&s&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:i}=t.layout,{animationType:n}=t.options,o=s.source!==t.layout.source;if("size"===n)Tr(t=>{const i=o?s.measuredBox[t]:s.layoutBox[t],n=rr(i);i.min=e[t].min,i.max=i.min+n});else if("x"===n||"y"===n){const t="x"===n?"y":"x";ir(o?s.measuredBox[t]:s.layoutBox[t],e[t])}else ha(n,s.layoutBox,e)&&Tr(i=>{const n=o?s.measuredBox[i]:s.layoutBox[i],r=rr(e[i]);n.max=n.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};lr(r,e,s.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?lr(a,t.applyTransform(i,!0),s.measuredBox):lr(a,e,s.layoutBox);const l=!yr(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:n,layout:o}=i;if(n&&o){const r=t.options.layoutAnchor||void 0,a={x:{min:0,max:0},y:{min:0,max:0}};hr(a,s.layoutBox,n.layoutBox,r);const l={x:{min:0,max:0},y:{min:0,max:0}};hr(l,e,o.layoutBox,r),wr(a,l)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=a,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:s,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Yr(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Hr(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Xr(t){t.clearSnapshot()}function Kr(t){t.clearMeasurements()}function Gr(t){t.isLayoutDirty=!0,t.updateLayout()}function qr(t){t.isLayoutDirty=!1}function Zr(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function Jr(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Qr(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function ta(t){t.resolveTargetDelta()}function ea(t){t.calcProjection()}function sa(t){t.resetSkewAndRotation()}function ia(t){t.removeLeadSnapshot()}function na(t,e,s){t.translate=Fe(e.translate,0,s),t.scale=Fe(e.scale,1,s),t.origin=e.origin,t.originPoint=e.originPoint}function oa(t,e,s,i){t.min=Fe(e.min,s.min,i),t.max=Fe(e.max,s.max,i)}function ra(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const aa={duration:.45,ease:[.4,0,.1,1]},la=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),ca=la("applewebkit/")&&!la("chrome/")?Math.round:St;function ua(t){t.min=ca(t.min),t.max=ca(t.max)}function ha(t,e,s){return"position"===t||"preserve-aspect"===t&&(i=jr(e),n=jr(s),o=.2,!(Math.abs(i-n)<=o));var i,n,o}function da(t){var e;return t!==t.root&&(null==(e=t.scroll)?void 0:e.wasRoot)}const ma=Wr({attachResizeListener:(t,e)=>Vr(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||(null==(t=document.body)?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||(null==(e=document.body)?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),pa={current:void 0},fa=Wr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!pa.current){const t=new ma({});t.mount(window),t.setOptions({layoutScroll:!0}),pa.current=t}return pa.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),ga=i.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});const va=i.createContext({strict:!1}),ya={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let xa=!1;function ba(){return function(){if(xa)return;const t={};for(const e in ya)t[e]={isEnabled:t=>ya[e].some(e=>!!t[e])};ro(t),xa=!0}(),oo}const wa=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function ja(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||wa.has(t)}let Sa=t=>!ja(t);try{"function"==typeof(Ta=require("@emotion/is-prop-valid").default)&&(Sa=t=>t.startsWith("on")?!ja(t):Ta(t))}catch{}var Ta;const Pa=i.createContext({});function Ea(t){const{initial:e,animate:s}=function(t,e){if(Qn(t)){const{initial:e,animate:s}=t;return{initial:!1===e||qn(e)?e:void 0,animate:qn(s)?s:void 0}}return!1!==t.inherit?e:{}}(t,i.useContext(Pa));return i.useMemo(()=>({initial:e,animate:s}),[Aa(e),Aa(s)])}function Aa(t){return Array.isArray(t)?t.join(" "):t}const Ca=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ka(t,e,s){for(const i in e)zi(e[i])||Bo(i,s)||(t[i]=e[i])}function Na(t,e){const s={};return ka(s,t.style||{},t),Object.assign(s,function({transformTemplate:t},e){return i.useMemo(()=>{const s={style:{},transform:{},transformOrigin:{},vars:{}};return No(s,e,t),Object.assign({},s.vars,s.style)},[e])}(t,e)),s}function Ma(t,e){const s={},i=Na(t,e);return t.drag&&!1!==t.dragListener&&(s.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(s.tabIndex=0),s.style=i,s}const Va=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function Da(t,e,s,n){const o=i.useMemo(()=>{const s={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Wo(s,e,$o(n),t.transformTemplate,t.style),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const e={};ka(e,t.style,t),o.style={...e,...o.style}}return o}const Ra=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function La(t){return"string"==typeof t&&!t.includes("-")&&!!(Ra.indexOf(t)>-1||/[A-Z]/u.test(t))}function Ba(t,e,s,{latestValues:n},o,r=!1,a){const l=(a??La(t)?Da:Ma)(e,n,o,t),c=function(t,e,s){const i={};for(const n in t)"values"===n&&"object"==typeof t.values||zi(t[n])||(Sa(n)||!0===s&&ja(n)||!e&&!ja(n)||t.draggable&&n.startsWith("onDrag"))&&(i[n]=t[n]);return i}(e,"string"==typeof t,r),u=t!==i.Fragment?{...c,...l,ref:s}:{},{children:h}=e,d=i.useMemo(()=>zi(h)?h.get():h,[h]);return i.createElement(t,{...u,children:d})}function Ia(t,e,s,i){const n={},o=i(t,{});for(const d in o)n[d]=Lr(o[d]);let{initial:r,animate:a}=t;const l=Qn(t),c=to(t);e&&c&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let u=!!s&&!1===s.initial;u=u||!1===r;const h=u?a:r;if(h&&"boolean"!=typeof h&&!Gn(h)){const e=Array.isArray(h)?h:[h];for(let s=0;s<e.length;s++){const i=Ii(t,e[s]);if(i){const{transitionEnd:t,transition:e,...s}=i;for(const i in s){let t=s[i];if(Array.isArray(t)){t=t[u?t.length-1:0]}null!==t&&(n[i]=t)}for(const i in t)n[i]=t[i]}}}return n}const Fa=t=>(e,s)=>{const n=i.useContext(Pa),o=i.useContext(pt),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e},s,i,n){return{latestValues:Ia(s,i,n,t),renderState:e()}}(t,e,n,o);return s?r():function(t){const e=i.useRef(null);return null===e.current&&(e.current=t()),e.current}(r)},Oa=Fa({scrapeMotionValuesFromProps:Io,createRenderState:Ca}),Ua=Fa({scrapeMotionValuesFromProps:Yo,createRenderState:Va}),_a=Symbol.for("motionComponentSymbol");function Wa(t,e,s){const n=i.useRef(s);i.useInsertionEffect(()=>{n.current=s});const o=i.useRef(null);return i.useCallback(s=>{var i;s&&(null==(i=t.onMount)||i.call(t,s)),e&&(s?e.mount(s):e.unmount());const r=n.current;if("function"==typeof r)if(s){const t=r(s);"function"==typeof t&&(o.current=t)}else o.current?(o.current(),o.current=null):r(s);else r&&(r.current=s)},[e])}const za=i.createContext({});function $a(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function Ya(t,e,s,n,o,r){var a,l;const{visualElement:c}=i.useContext(Pa),u=i.useContext(va),h=i.useContext(pt),d=i.useContext(ga),m=d.reducedMotion,p=d.skipAnimations,f=i.useRef(null),g=i.useRef(!1);n=n||u.renderer,!f.current&&n&&(f.current=n(t,{visualState:e,parent:c,props:s,presenceContext:h,blockInitialAnimation:!!h&&!1===h.initial,reducedMotionConfig:m,skipAnimations:p,isSVG:r}),g.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const v=f.current,y=i.useContext(za);!v||v.projection||!o||"html"!==v.type&&"svg"!==v.type||function(t,e,s,i){const{layoutId:n,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutAnchor:u,layoutCrossfade:h}=e;t.projection=new s(t.latestValues,e["data-framer-portal-id"]?void 0:Ha(t.parent)),t.projection.setOptions({layoutId:n,layout:o,alwaysMeasureLayout:Boolean(r)||a&&$a(a),visualElement:t,animationType:"string"==typeof o?o:"both",initialPromotionConfig:i,crossfade:h,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}(f.current,s,o,y);const x=i.useRef(!1);i.useInsertionEffect(()=>{v&&x.current&&v.update(s,h)});const b=s[Hi],w=i.useRef(Boolean(b)&&"undefined"!=typeof window&&!(null==(a=window.MotionHandoffIsComplete)?void 0:a.call(window,b))&&(null==(l=window.MotionHasOptimisedAnimation)?void 0:l.call(window,b)));return mt(()=>{g.current=!0,v&&(x.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),v.scheduleRenderMicrotask(),w.current&&v.animationState&&v.animationState.animateChanges())}),i.useEffect(()=>{v&&(!w.current&&v.animationState&&v.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var t;null==(t=window.MotionHandoffMarkAsComplete)||t.call(window,b)}),w.current=!1),v.enteringChildren=void 0)}),v}function Ha(t){if(t)return!1!==t.options.allowProjection?t.projection:Ha(t.parent)}function Xa(e,{forwardMotionProps:s=!1,type:n}={},o,r){o&&function(t){const e=ba();for(const s in t)e[s]={...e[s],...t[s]};ro(e)}(o);const a=n?"svg"===n:La(e),l=a?Ua:Oa;function c(n,o){let c;const u={...i.useContext(ga),...n,layoutId:Ka(n)},{isStatic:h}=u,d=Ea(n),m=l(n,h);if(!h&&"undefined"!=typeof window){i.useContext(va).strict;const t=function(t){const e=ba(),{drag:s,layout:i}=e;if(!s&&!i)return{};const n={...s,...i};return{MeasureLayout:(null==s?void 0:s.isEnabled(t))||(null==i?void 0:i.isEnabled(t))?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}
1(u);c=t.MeasureLayout,d.visualElement=Ya(e,m,u,r,t.ProjectionNode,a)}return t.jsxs(Pa.Provider,{value:d,children:[c&&d.visualElement?t.jsx(c,{visualElement:d.visualElement,...u}):null,Ba(e,n,Wa(m,d.visualElement,o),m,h,s,a)]})}c.displayName=`motion.${"string"==typeof e?e:`create(${e.displayName??e.name??""})`}`;const u=i.forwardRef(c);return u[_a]=e,u}function Ka({layoutId:t}){const e=i.useContext(dt).id;return e&&void 0!==t?e+"-"+t:t}let Ga=0;const qa={animation:{Feature:class extends co{constructor(t){super(t),t.animationState||(t.animationState=Qo(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Gn(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),null==(t=this.unmountControls)||t.call(this)}}},exit:{Feature:class extends co{constructor(){super(...arguments),this.id=Ga++,this.isExitComplete=!1}update(){var t;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:s}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;if(e&&!1===i){if(this.isExitComplete){const{initial:e,custom:s}=this.node.getProps();if("string"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)){const i=Fi(this.node,e,s);if(i){const{transition:e,transitionEnd:s,...n}=i;for(const i in n)null==(t=this.node.getValue(i))||t.jump(n[i])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);return void(this.isExitComplete=!1)}const n=this.node.animationState.setActive("exit",!e);s&&!e&&n.then(()=>{this.isExitComplete=!0,s(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};
vendor: 16,538 bytes, line 1
1e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function Za(t){return{point:{x:t.pageX,y:t.pageY}}}function Ja(t,e,s,i){return Vr(t,e,(t=>e=>Tn(e)&&t(e,Za(e)))(s),i)}const Qa=({current:t})=>t?t.ownerDocument.defaultView:null,tl=(t,e)=>Math.abs(t-e);const el=new Set(["auto","scroll"]);class sl{constructor(t,e,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:n=!1,distanceThreshold:o=3,element:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=il(this.lastRawMoveEventInfo,this.transformPagePoint));const t=ol(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,s=function(t,e){const s=tl(t.x,e.x),i=tl(t.y,e.y);return Math.sqrt(s**2+i**2)}(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!s)return;const{point:i}=t,{timestamp:n}=Zt;this.history.push({...i,timestamp:n});const{onStart:o,onMove:r}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastRawMoveEventInfo=e,this.lastMoveEventInfo=il(e,this.transformPagePoint),Gt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:s,onSessionEnd:i,resumeAnimation:n}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||n&&n(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=ol("pointercancel"===t.type?this.lastMoveEventInfo:il(e,this.transformPagePoint),this.history);this.startEvent&&s&&s(t,o),i&&i(t,o)},!Tn(t))return;this.dragSnapToOrigin=n,this.handlers=e,this.transformPagePoint=s,this.distanceThreshold=o,this.contextWindow=i||window;const a=il(Za(t),this.transformPagePoint),{point:l}=a,{timestamp:c}=Zt;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=e;u&&u(t,ol(a,this.history));const h={passive:!0,capture:!0};this.removeListeners=Tt(Ja(this.contextWindow,"pointermove",this.handlePointerMove,h),Ja(this.contextWindow,"pointerup",this.handlePointerUp,h),Ja(this.contextWindow,"pointercancel",this.handlePointerUp,h)),r&&this.startScrollTracking(r)}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(el.has(t.overflowX)||el.has(t.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const s=t===window,i=s?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},n=i.x-e.x,o=i.y-e.y;0===n&&0===o||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=n,this.lastMoveEventInfo.point.y+=o):this.history.length>0&&(this.history[0].x-=n,this.history[0].y-=o),this.scrollPositions.set(t,i),Gt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),qt(this.updatePoint)}}function il(t,e){return e?{point:e(t.point)}:t}function nl(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ol({point:t},e){return{point:t,delta:nl(t,al(e)),offset:nl(t,rl(e)),velocity:ll(e,.1)}}function rl(t){return t[0]}function al(t){return t[t.length-1]}function ll(t,e){if(t.length<2)return{x:0,y:0};let s=t.length-1,i=null;const n=al(t);for(;s>=0&&(i=t[s],!(n.timestamp-i.timestamp>At(e)));)s--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&n.timestamp-i.timestamp>2*At(e)&&(i=t[1]);const o=Ct(n.timestamp-i.timestamp);if(0===o)return{x:0,y:0};const r={x:(n.x-i.x)/o,y:(n.y-i.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function cl(t,e,s){return{min:void 0!==e?t.min+e:void 0,max:void 0!==s?t.max+s-(t.max-t.min):void 0}}function ul(t,e){let s=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([s,i]=[i,s]),{min:s,max:i}}const hl=.35;function dl(t,e,s){return{min:ml(t,e),max:ml(t,s)}}function ml(t,e){return"number"==typeof t?t:t[e]||0}const pl=new WeakMap;class fl{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:e=!1,distanceThreshold:s}={}){const{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;const{dragSnapToOrigin:n}=this.getProps();this.panSession=new sl(t,{onSessionStart:t=>{e&&this.snapToCursor(Za(t).point),this.stopAnimation()},onStart:(t,e)=>{const{drag:s,dragPropagation:i,onDragStart:n}=this.getProps();if(s&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(o=s)||"y"===o?xn[o]?null:(xn[o]=!0,()=>{xn[o]=!1}):xn.x||xn.y?null:(xn.x=xn.y=!0,()=>{xn.x=xn.y=!1}),!this.openDragLock))return;var o;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Tr(t=>{let e=this.getAxisMotionValue(t).get()||0;if(we.test(e)){const{projection:s}=this.visualElement;if(s&&s.layout){const i=s.layout.layoutBox[t];if(i){e=rr(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),n&&Gt.update(()=>n(t,e),!1,!0),$i(this.visualElement,"transform");const{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},onMove:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e;const{dragPropagation:s,dragDirectionLock:i,onDirectionLock:n,onDrag:o}=this.getProps();if(!s&&!this.openDragLock)return;const{offset:r}=e;if(i&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let s=null;Math.abs(t.y)>e?s="y":Math.abs(t.x)>e&&(s="x");return s}(r),void(null!==this.currentDirection&&n&&n(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&Gt.update(()=>o(t,e),!1,!0)},onSessionEnd:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:t}=this.getProps();(t||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:n,distanceThreshold:s,contextWindow:Qa(this.visualElement),element:this.visualElement.current})}stop(t,e){const s=t||this.latestPointerEvent,i=e||this.latestPanInfo,n=this.isDragging;if(this.cancel(),!n||!i||!s)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:r}=this.getProps();r&&Gt.postRender(()=>r(s,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,e,s){const{drag:i}=this.getProps();if(!s||!vl(t,i,this.currentDirection))return;const n=this.getAxisMotionValue(t);let o=this.originPoint[t]+s[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:s},i){return void 0!==e&&t<e?t=i?Fe(e,t,i.min):Math.max(t,e):void 0!==s&&t>s&&(t=i?Fe(s,t,i.max):Math.min(t,s)),t}(o,this.constraints[t],this.elastic[t])),n.set(o)}resolveConstraints(){var t;const{dragConstraints:e,dragElastic:s}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null==(t=this.visualElement.projection)?void 0:t.layout,n=this.constraints;e&&$a(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!e||!i)&&function(t,{top:e,left:s,bottom:i,right:n}){return{x:cl(t.x,s,n),y:cl(t.y,e,i)}}(i.layoutBox,e),this.elastic=function(t=hl){return!1===t?t=0:!0===t&&(t=hl),{x:dl(t,"left","right"),y:dl(t,"top","bottom")}}(s),n!==this.constraints&&!$a(e)&&i&&this.constraints&&!this.hasMutatedConstraints&&Tr(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const s={};return void 0!==e.min&&(s.min=e.min-t.min),void 0!==e.max&&(s.max=e.max-t.min),s}(i.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!$a(t))return!1;const s=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;i.root&&(i.root.scroll=void 0,i.root.updateScroll());const n=function(t,e,s){const i=Ao(t,s),{scroll:n}=e;return n&&(So(i.x,n.offset.x),So(i.y,n.offset.y)),i}(s,i.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:ul(t.x,e.x),y:ul(t.y,e.y)}}(i.layout.layoutBox,n);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=uo(t))}return o}startAnimation(t){const{drag:e,dragMomentum:s,dragElastic:i,dragTransition:n,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Tr(r=>{if(!vl(r,e,this.currentDirection))return;let l=a&&a[r]||{};!0!==o&&o!==r||(l={min:0,max:0});const c=i?200:1e6,u=i?40:1e7,h={type:"inertia",velocity:s?t[r]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...n,...l};return this.startAxisValueAnimation(r,h)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const s=this.getAxisMotionValue(t);return $i(this.visualElement,t),s.start(Di(t,s,0,e,this.visualElement,!1))}stopAnimation(){Tr(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps()[e];return s||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){Tr(e=>{const{drag:s}=this.getProps();if(!vl(e,s,this.currentDirection))return;const{projection:i}=this.visualElement,n=this.getAxisMotionValue(e);if(i&&i.layout){const{min:s,max:o}=i.layout.layoutBox[e],r=n.get()||0;n.set(t[e]-Fe(s,o,.5)+r)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:s}=this.visualElement;if(!$a(e)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Tr(t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const s=e.get();i[t]=function(t,e){let s=.5;const i=rr(t),n=rr(e);return n>i?s=Pt(e.min,e.max-i,t.min):i>n&&(s=Pt(t.min,t.max-n,e.min)),vt(0,1,s)}({min:s,max:s},this.constraints[t])}});const{transformTemplate:n}=this.visualElement.getProps();this.visualElement.current.style.transform=n?n({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.constraints=!1,this.resolveConstraints(),Tr(e=>{if(!vl(e,t,null))return;const s=this.getAxisMotionValue(e),{min:n,max:o}=this.constraints[e];s.set(Fe(n,o,i[e]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;pl.set(this.visualElement,this);const t=this.visualElement.current,e=Ja(t,"pointerdown",e=>{const{drag:s,dragListener:i=!0}=this.getProps(),n=e.target,o=n!==t&&function(t){return En.has(t.tagName)||!0===t.isContentEditable}(n);s&&i&&!o&&this.start(e)});let s;const i=()=>{const{dragConstraints:e}=this.getProps();$a(e)&&e.current&&(this.constraints=this.resolveRefConstraints(),s||(s=function(t,e,s){const i=Yn(t,gl(s)),n=Yn(e,gl(s));return()=>{i(),n()}}(t,e.current,()=>this.scalePositionWithinConstraints())))},{projection:n}=this.visualElement,o=n.addEventListener("measure",i);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),Gt.read(i);const r=Vr(window,"resize",()=>this.scalePositionWithinConstraints()),a=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Tr(e=>{const s=this.getAxisMotionValue(e);s&&(this.originPoint[e]+=t[e].translate,s.set(s.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),e(),o(),a&&a(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:n=!1,dragElastic:o=hl,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:s,dragPropagation:i,dragConstraints:n,dragElastic:o,dragMomentum:r}}}function gl(t){let e=!0;return()=>{e?e=!1:t()}}function vl(t,e,s){return!(!0!==e&&e!==t||null!==s&&s!==t)}const yl=t=>(e,s)=>{t&&Gt.update(()=>t(e,s),!1,!0)};let xl=!1;class bl extends i.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:s,layoutId:i}=this.props,{projection:n}=t;n&&(e.group&&e.group.add(n),s&&s.register&&i&&s.register(n),xl&&n.root.didUpdate(),n.addEventListener("animationComplete",()=>{this.safeToRemove()}),n.setOptions({...n.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Ir.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:s,drag:i,isPresent:n}=this.props,{projection:o}=s;return o?(o.isPresent=n,t.layoutDependency!==e&&o.setOptions({...o.options,layoutDependency:e}),xl=!0,i||t.layoutDependency!==e||void 0===e||t.isPresent!==n?o.willUpdate():this.safeToRemove(),t.isPresent!==n&&(n?o.promote():o.relegate()||Gt.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{visualElement:t,layoutAnchor:e}=this.props,{projection:s}=t;s&&(s.options.layoutAnchor=e,s.root.didUpdate(),yn.postRender(()=>{!s.currentAnimation&&s.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:s}=this.props,{projection:i}=t;xl=!0,i&&(i.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function wl(e){const[s,n]=function(t=!0){const e=i.useContext(pt);if(null===e)return[!0,null];const{isPresent:s,onExitComplete:n,register:o}=e,r=i.useId();i.useEffect(()=>{if(t)return o(r)},[t]);const a=i.useCallback(()=>t&&n&&n(r),[r,n,t]);return!s&&n?[!1,a]:[!0]}(),o=i.useContext(dt);return t.jsx(bl,{...e,layoutGroup:o,switchLayoutGroup:i.useContext(za),isPresent:s,safeToRemove:n})}const jl={pan:{Feature:class extends co{constructor(){super(...arguments),this.removePointerDownListener=St}onPointerDown(t){this.session=new sl(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Qa(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:yl(t),onStart:yl(e),onMove:yl(s),onEnd:(t,e)=>{delete this.session,i&&Gt.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=Ja(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends co{constructor(t){super(t),this.removeGroupControls=St,this.removeListeners=St,this.controls=new fl(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||St}update(){const{dragControls:t}=this.node.getProps(),{dragControls:e}=this.node.prevProps||{};t!==e&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:fa,MeasureLayout:wl}};function Sl(t,e,s){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===s);const n=i["onHover"+s];n&&Gt.postRender(()=>n(e,Za(e)))}function Tl(t,e,s){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===s);const n=i["onTap"+("End"===s?"":s)];n&&Gt.postRender(()=>n(e,Za(e)))}const Pl=new WeakMap,El=new WeakMap,Al=t=>{const e=Pl.get(t.target);e&&e(t)}
1,Cl=t=>{t.forEach(Al)};function kl(t,e,s){const i=function({root:t,...e}){const s=t||document;El.has(s)||El.set(s,{});const i=El.get(s),n=JSON.stringify(e);return i[n]||(i[n]=new IntersectionObserver(Cl,{root:t,...e})),i[n]}(e);return Pl.set(t,s),i.observe(t),()=>{Pl.delete(t),i.unobserve(t)}}const Nl={some:0,all:1};const Ml=function(t,e){if("undefined"==typeof Proxy)return Xa;const s=new Map,i=(s,i)=>Xa(s,i,t,e);return new Proxy((t,e)=>i(t,e),{get:(n,o)=>"create"===o?i:(s.has(o)||s.set(o,Xa(o,void 0,t,e)),s.get(o))})}({...qa,...{inView:{Feature:class extends co{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var t;null==(t=this.stopObserver)||t.call(this);const{viewport:e={}}=this.node.getProps(),{root:s,margin:i,amount:n="some",once:o}=e,r={root:s?s.current:void 0,rootMargin:i,threshold:"number"==typeof n?n:Nl[n]};this.stopObserver=kl(this.node.current,r,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,o&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:s,onViewportLeave:i}=this.node.getProps(),n=e?s:i;n&&n(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return s=>t[s]!==e[s]}(t,e))&&this.startObserver()}unmount(){var t;null==(t=this.stopObserver)||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends co{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:s}=this.node.props;this.unmount=Vn(t,(t,e)=>(Tl(this.node,e,"Start"),(t,{success:e})=>Tl(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:!1===(null==s?void 0:s.tap)})}unmount(){}}},focus:{Feature:class extends co{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Tt(Vr(this.node.current,"focus",()=>this.onFocus()),Vr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends co{mount(){const{current:t}=this.node;t&&(this.unmount=jn(t,(t,e)=>(Sl(this.node,e,"Start"),t=>Sl(this.node,t,"End"))))}unmount(){}}}},...jl,...{layout:{ProjectionNode:fa,MeasureLayout:wl}}},(t,e)=>e.isSVG??La(t)?new Ho(e):new Fo(e,{allowProjection:t!==i.Fragment})),Vl=({className:s,size:i=50,delay:n=0,duration:o=6,colorFrom:r="#ffaa40",colorTo:a="#9c40ff",transition:l,style:c,reverse:u=!1,initialOffset:h=0})=>t.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-[inherit] border border-transparent overflow-visible [mask-clip:padding-box,border-box] [mask-composite:intersect] [mask-image:linear-gradient(transparent,transparent),linear-gradient(#000,#000)]",children:t.jsx(Ml.div,{className:e("absolute aspect-square pointer-events-none","bg-gradient-to-l from-[var(--color-from)] via-[var(--color-to)] to-transparent",s),style:{width:i,height:i,offsetPath:`rect(0 auto auto 0 round ${i}px)`,"--color-from":r,"--color-to":a,...c},initial:{offsetDistance:`${h}%`},animate:{offsetDistance:u?[100-h+"%",-h+"%"]:[`${h}%`,`${100+h}%`]},transition:{repeat:Number.POSITIVE_INFINITY,ease:"linear",duration:o,delay:-n,...l}})});function Dl({restaurant:s,onEdit:n,onDelete:o,isDeleteMode:r,isSelected:a,onToggleSelect:c,hideActions:u=!1,onCardClick:h,isFirst:d=!1}){const[m,p]=i.useState(!1);H(X(s));const f=X(s),g=K(f).length;i.useEffect(()=>{const t=()=>{p(window.innerWidth<1250)};return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]);const v=function(t){const e=new Date,s=e.toTimeString().slice(0,5),i=e.getDay(),n=0===i?6:i-1,o=e.toISOString().slice(0,10);if(t.special_hours&&Array.isArray(t.special_hours)){const e=t.special_hours.find(t=>t.date?t.date===o:t.start_date&&o>=t.start_date&&o<=(t.end_date||t.start_date));if(e){if(e.closed)return!1;if(e.open&&e.close)return s>=e.open&&s<=e.close}}if(t.schedule&&Array.isArray(t.schedule)&&7===t.schedule.length){const e=t.schedule[n];if(e&&e.open&&e.close)return s>=e.open&&s<=e.close}return!1}(s),y=function(t,e){const s=new Date,i=s.getDay(),n=0===i?6:i-1,o=s.toISOString().slice(0,10),r=Array.isArray(t)&&7===t.length?t:[{open:"08:00",close:"18:00"},{open:"08:00",close:"18:00"},{open:"08:00",close:"18:00"},{open:"08:00",close:"18:00"},{open:"08:00",close:"18:00"},{open:"10:00",close:"16:00"},{open:"10:00",close:"16:00"}],a=(e||[]).find(t=>t.date?t.date===o:t.start_date&&o>=t.start_date&&o<=(t.end_date||t.start_date));if(a)return{open:a.closed?null:a.open,close:a.closed?null:a.close,isSpecial:!0};const{open:l,close:c}=r[n]||{open:"",close:""};return{open:l||null,close:c||null,isSpecial:!1}}(s.schedule,s.special_hours);Array.isArray(s.special_hours)&&s.special_hours.length;const{building:x,floor:b}=s.building&&s.floor?{building:s.building,floor:s.floor}:(t=>{if(!t)return{building:"",floor:""};const e=t.match(/^(.+?)\s*-\s*(.+)$/);if(e)return{building:e[1].trim(),floor:e[2].trim()};const s=t.match(/^(.+?),\s*Étage\s*(.+)$/);if(s)return{building:s[1].trim(),floor:s[2].trim()};const i=t.split(",");return i.length>=2?{building:i[0].trim(),floor:i[1].replace("Étage","").trim()}:{building:t,floor:""}}
1)(s.location);return t.jsxs(l.div,{layout:!0,initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},whileHover:m?{}:{y:-4},className:e("group relative bg-white rounded-xl sm:rounded-2xl shadow-lg hover:shadow-xl transition-all duration-300 overflow-hidden border border-gray-100 flex flex-col cursor-pointer",a&&r&&"ring-2 ring-betterave-500 ring-offset-2",m?"h-[260px] sm:h-[280px]":"h-[400px]"),onClick:h,children:[t.jsxs("div",{className:e("relative overflow-hidden flex-shrink-0",m?"h-28 sm:h-32":"h-[200px]"),style:m?{}:{height:"200px",minHeight:"200px",maxHeight:"200px"},children:[t.jsx("img",{src:s.image_url||G[s.name]||G.default,alt:s.name,className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-110",fetchPriority:d?"high":"auto",loading:d?"eager":"lazy",style:m?{}:{width:"100%",height:"200px",minHeight:"200px",maxHeight:"200px",objectFit:"cover",objectPosition:"center"}}),t.jsx("div",{className:"absolute inset-0 bg-champignon/45"}),t.jsxs("div",{className:"absolute top-2 sm:top-4 left-2 sm:left-4 flex flex-col items-start gap-1 sm:gap-2 z-40",children:[s.is_new&&t.jsxs(E,{variant:null,className:"bg-[#ffa407] text-[#f5f4f0] font-semibold border-0 text-[10px] sm:text-xs px-1.5 sm:px-2 py-0.5 sm:py-1",children:[t.jsx(W,{className:"w-2.5 h-2.5 sm:w-3 sm:h-3 mr-0.5 sm:mr-1"}),t.jsx("span",{className:"hidden sm:inline",children:s.new_status_label||"Nouveau"}),t.jsx("span",{className:"sm:hidden",children:"Nouveau"})]},"badge-new"),s.boosted&&t.jsxs(E,{variant:null,className:"bg-[#ffa407] text-[#f5f4f0] font-semibold border-0 text-[10px] sm:text-xs px-1.5 sm:px-2 py-0.5 sm:py-1",children:[t.jsx(A,{className:"w-2.5 h-2.5 sm:w-3 sm:h-3 mr-0.5 sm:mr-1"}),t.jsx("span",{className:"hidden sm:inline",children:s.boost_status_label||"Populaire"}),t.jsx("span",{className:"sm:hidden",children:"Populaire"})]},"badge-boosted")]}),t.jsxs("div",{className:"absolute top-2 sm:top-4 right-2 sm:right-4 z-30",children:[t.jsxs(R,{variant:"ghost",size:"sm",className:"h-7 sm:h-8 px-2 sm:px-3 text-[10px] sm:text-xs rounded-full bg-white/30 text-kale hover:bg-white/40 backdrop-blur-md border border-white/40 shadow-sm gap-1 sm:gap-1.5",onClick:t=>{t.stopPropagation();try{const t=(null==s?void 0:s.id)?`restaurant-edit-draft-${s.id}`:null;if(t){const e=sessionStorage.getItem(t);let s={activeTab:"menu"};if(e)try{s={...JSON.parse(e),activeTab:"menu"}}catch{}sessionStorage.setItem(t,JSON.stringify(s))}null==h||h(s)}catch{null==h||h(s)}},children:[t.jsx(et,{className:"w-3 h-3"}),t.jsx("span",{className:"hidden sm:inline",children:"Menu"})]}),g>0&&t.jsx("span",{className:"absolute -top-1 -right-1 min-w-5 h-5 px-1 rounded-full bg-[#ffa407] text-[#f5f4f0] text-[9px] sm:text-[10px] font-bold flex items-center justify-center border border-white/70 shadow pointer-events-none","aria-label":`${g} menu(x) configuré(s)`,title:`${g} menu(x) configuré(s)`,children:g})]}),t.jsx("div",{className:"absolute bottom-2 sm:bottom-4 left-2 sm:left-4 right-2 sm:right-4",children:t.jsx("h3",{className:e("text-white font-bold drop-shadow-lg",m?"text-sm sm:text-base":"text-lg mb-1"),children:s.name})}),y.isSpecial&&t.jsx("div",{className:"absolute bottom-2 sm:bottom-4 right-2 sm:right-4",children:t.jsxs(E,{variant:null,className:"text-[10px] sm:text-xs text-[#f5f4f0] bg-[#ffa407]/90 backdrop-blur-sm font-normal px-1.5 sm:px-2 py-1 sm:py-1.5 border-0 flex flex-col items-center gap-0.5",children:[t.jsx("span",{className:"hidden sm:inline",children:"Horaire spécial"}),t.jsx("span",{className:"sm:hidden",children:"Spécial"}),y.open&&y.close&&t.jsxs("span",{className:"text-[9px] sm:text-[10px] font-medium",children:[y.open," - ",y.close]})]})})]}),t.jsxs("div",{className:e("flex flex-col flex-1 min-h-0",m?"p-3 sm:p-4":"p-5"),children:[t.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[t.jsxs("div",{className:e("flex items-center gap-2 sm:gap-4 text-xs sm:text-sm text-gray-600 flex-shrink-0",m?"h-5 sm:h-6 mb-2 sm:mb-3":"h-6 mb-3"),children:[t.jsxs("div",{className:"flex items-center gap-0.5 sm:gap-1",children:[t.jsx(q,{className:"w-3 h-3 sm:w-4 sm:h-4 text-[#1d3726]"}),t.jsx("span",{className:"truncate",children:x||"Bâtiment A"})]}),t.jsxs("div",{className:"flex items-center gap-0.5 sm:gap-1",children:[t.jsx(Z,{className:"w-3 h-3 sm:w-4 sm:h-4 text-[#1d3726]"}),t.jsxs("span",{className:"truncate",children:["Étage ",b||"1"]})]})]}),t.jsx("div",{className:e("flex-shrink-0",m?"mb-2 sm:mb-3":"mb-3"),children:t.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[t.jsx(C,{className:"w-3 h-3 sm:w-4 sm:h-4 text-[#1d3726]"}),t.jsx("span",{className:e("font-medium text-gray-700",m?"text-[11px] sm:text-xs":"text-sm"),children:"Aujourd'hui"}),t.jsx(E,{variant:null,className:"text-[10px] sm:text-xs font-semibold px-1.5 sm:px-2 py-0.5 
1sm:py-1 "+(v?"bg-laitue-100 text-laitue-700 border-laitue-300":"bg-betterave-100 text-betterave-700 border-betterave-300"),children:v?"Ouvert":"Fermé"})]})}),t.jsx("div",{className:e("overflow-hidden flex-shrink-0",m?"min-h-[32px] sm:h-10 mb-2 sm:mb-3":"h-12 mb-3"),children:s.description?t.jsx(st,{text:s.description,className:e("text-gray-600 break-words",m?"text-[10px] sm:text-xs":"text-sm"),maxLines:m?3:2}):t.jsx("p",{className:e("text-gray-400",m?"text-[10px] sm:text-xs line-clamp-3":"text-sm line-clamp-2"),children:"Pas de description disponible"})})]}),(()=>{const i=H(X(s));return i?t.jsx("div",{className:e("flex-shrink-0",m?"mb-1.5 sm:mb-2":"mb-2"),children:t.jsxs(R,{onClick:t=>{t.stopPropagation(),window.open(i,"_blank")},variant:"outline",size:"sm",className:"w-full text-[10px] sm:text-xs border-[#c0b7aa] text-[#1d3726] hover:bg-[#c0b7aa]/20 h-7 sm:h-8 px-2 sm:px-3",children:[t.jsx(J,{className:"w-2.5 h-2.5 sm:w-3 sm:h-3 mr-1 sm:mr-2"}),t.jsx("span",{className:"hidden sm:inline",children:"Menu de la semaine"}),t.jsx("span",{className:"sm:hidden",children:"Menu"})]})}):null})(),!u&&t.jsx("div",{className:"flex gap-2 flex-shrink-0",onClick:t=>t.stopPropagation(),children:r?t.jsxs(R,{onClick:c,variant:a?"destructive":"destructive-outline",className:"w-full",children:[t.jsx(it,{className:"w-4 h-4 mr-2"}),a?"Annuler la sélection":"Sélectionner pour supprimer"]}):t.jsxs(t.Fragment,{children:[t.jsxs(R,{onClick:n,className:"flex-1 bg-[#c0b7aa] hover:bg-[#b0a79a] text-[#1d3726]",children:[t.jsx(nt,{className:"w-4 h-4 mr-2"}),"Modifier"]}),t.jsxs(R,{onClick:()=>
1o(s.id),variant:"outline",size:"sm",className:"flex-1 text-betterave-600 hover:text-betterave-700 hover:bg-betterave-50",children:[t.jsx(it,{className:"h-4 w-4 mr-1"}),"Supprimer"]})]})})]})]})}function Rl({restaurants:e=[],onRefresh:n,onUpdateRestaurant:o}){const[a,l]=i.useState(null),u=s(),d=i.useRef(null),[m,p]=i.useState(!1),[f,g]=i.useState(null),v=e||[];i.useEffect(()=>{if(typeof window>"u"||null!==a)return;const t=sessionStorage.getItem("restaurant-edit-active");if(!t)return;const s=(e||[]).findIndex(e=>e.id===t);-1!==s?l(s):sessionStorage.removeItem("restaurant-edit-active")},[e,a]);return 0===v.length?t.jsx(N,{className:"w-full shadow-md",children:t.jsx(D,{className:"p-8 text-center",children:t.jsx("p",{className:"text-gray-500",children:"Aucun restaurant configuré"})})}):t.jsxs("div",{className:"mb-4 sm:mb-6 md:mb-8",children:[t.jsxs("div",{className:"flex justify-between items-center mb-3 sm:mb-4 md:mb-6",children:[t.jsx("h2",{className:"text-lg sm:text-xl md:text-2xl font-bold text-nightblue",children:"Vos Stations"}),t.jsxs("div",{className:"flex items-center gap-1 sm:gap-2",children:[t.jsxs("button",{onClick:()=>u("/restaurants"),className:"text-[10px] sm:text-sm text-[#1d3726] hover:text-[#2d5240] hover:underline flex items-center gap-0.5 sm:gap-1 transition-colors duration-200 font-medium",children:[t.jsx("span",{className:"hidden sm:inline",children:"Voir plus"}),t.jsx("span",{className:"sm:hidden",children:"Plus"}),t.jsx(h,{className:"w-2.5 h-2.5 sm:w-4 sm:h-4"})]}),t.jsxs("div",{className:"flex gap-0.5 sm:gap-2",children:[t.jsx("button",{className:"h-6 w-6 sm:h-8 sm:w-8 p-0 border border-[#1d3726]/30 rounded-lg hover:bg-[#1d3726]/5 text-[#1d3726] transition-colors duration-200 flex items-center justify-center",onClick:()=>{d.current&&d.current.scrollBy({left:-350,behavior:"smooth"})},children:t.jsx(B,{className:"w-2.5 h-2.5 sm:w-4 sm:h-4"})}),t.jsx("button",{className:"h-6 w-6 sm:h-8 sm:w-8 p-0 border border-[#1d3726]/30 rounded-lg hover:bg-[#1d3726]/5 text-[#1d3726] transition-colors duration-200 flex items-center justify-center",onClick:()=>{d.current&&d.current.scrollBy({left:350,behavior:"smooth"})},children:t.jsx(h,{className:"w-2.5 h-2.5 sm:w-4 sm:h-4"})})]})]})]}),t.jsx("div",{className:"relative",children:t.jsx("div",{ref:d,className:"flex gap-3 sm:gap-4 md:gap-6 overflow-x-auto scrollbar-hide pb-3 sm:pb-4 px-1 sm:px-2 pt-1 sm:pt-2",style:{scrollBehavior:"smooth"},children:v.map((e,s)=>t.jsx("div",{className:"flex-shrink-0 py-1 sm:py-2 w-[260px] sm:w-[280px] md:w-[320px]",children:t.jsx(Dl,{restaurant:e,onEdit:()=>(t=>l(t))(s),onDelete:()=>{},isDeleteMode:!1,isSelected:!1,onToggleSelect:()=>{},hideActions:!0,onCardClick:()=>(t=>{const e=v.findIndex(e=>e.id===t.id);-1!==e&&l(e)})(e),isFirst:0===s})},e.id))})}),null!==a&&t.jsx(Y,{restaurant:v[a],onClose:()=>l(null),onSave:async t=>{const e=v[a];if(!e||!e.id)return;const{id:s,created_at:i,updated_at:n,is_open_now:u,...h}=t,d=await Q.updateRestaurant(e.id,h),m=Array.isArray(d.data)?d.data[0]:d.data,{error:p}=d;if(p)c({title:"Erreur",description:`La mise à jour a échoué : ${p.message}`,variant:"destructive"});else{const t=m?{...e,...m}:{...e,...h,id:e.id};r.updateRestaurant(e.id,t),null==o||o(t),c({title:"Restaurant mis à jour",description:`${t.name??h.name} a été mis à jour avec succès.`})}l(null)},onRemoveSpecialHour:async()=>Promise.resolve({success:!1,error:"Fonctionnalité désactivée"}),onClearMenuUrl:async t=>{const e=await Q.updateRestaurant(t,{restaurant_menu_url:[]});if(e.error)throw c({title:"Erreur",description:"Impossible de mettre à jour le restaurant.",variant:"destructive"}),e.error;const s=Array.isArray(e.data)?e.data[0]:e.data,i=v.find(e=>e.id===t),n=s&&i?{...i,...s}:i?{...i,restaurant_menu_url:[]}:{id:t,restaurant_menu_url:[]};r.updateRestaurant(t,n),null==o||o(n)}}),f&&t.jsx(tt,{isOpen:m,onClose:()=>{p(!1),g(null)},category:"horaires",initialTitle:f.title,initialBody:f.body,data:f.restaurantId?{restaurantId:f.restaurantId}:void 0})]})}function Ll(){const{user:e}=u();s();const{data:o,loading:r,error:a,restaurants:c,refresh:h,updateRestaurant:d}=n(),m=c||[];i.useEffect(()=>{var t;if(m.length>0&&(null==(t=m[0])?void 0:t.image_url)){const t=m[0].image_url;if(!document.querySelector(`link[rel="preload"][as="image"][href="${t}"]`)){const e=document.createElement("link");e.rel="preload",e.as="image",e.href=t,e.setAttribute("fetchpriority","high"),document.head.appendChild(e)}}},[m]);const p=e&&"superadmin"===e.role;if(r)return t.jsx("div",{className:"min-h-screen flex items-center justify-center bg-pate",children:t.jsxs(l.div,{initial:{opacity:0,y:20}
1,animate:{opacity:1,y:0},transition:{duration:.3},className:"flex flex-col items-center gap-4",children:[t.jsx(l.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},className:"rounded-full h-12 w-12 border-4 border-[#1d3726]/20 border-t-[#1d3726]"}),t.jsx(l.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.2,duration:.3},className:"text-sm text-gray-500 font-medium",children:"Chargement du tableau de bord..."})]})});if(a)return t.jsx("div",{className:"min-h-screen flex items-center justify-center bg-pate text-betterave-500",children:a});const{scrollY:f}=O(),g=U(f,[0,1e3],[0,300]);return t.jsxs("div",{className:"flex bg-pate min-h-screen relative overflow-hidden",children:[t.jsx(l.div,{style:{y:g},className:"fixed inset-0 w-full h-full z-0 pointer-events-none select-none",children:t.jsxs("svg",{className:"w-full h-full",viewBox:"0 0 1920 1080",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[t.jsx("polygon",{id:"poly1",points:"0,1080 400,600 800,1080",fill:"#e5e7eb",opacity:"0.5"}),t.jsx("polygon",{id:"poly2",points:"1120,1080 1520,600 1920,1080",fill:"#e5e7eb",opacity:"0.4"}),t.jsx("polygon",{id:"poly3",points:"480,1080 960,300 1440,1080",fill:"#6b7280",opacity:"0.07"}),t.jsx("polygon",{id:"poly4",points:"0,0 200,200 0,400",fill:"#6b7280",opacity:"0.10"}),t.jsx("polygon",{id:"poly5",points:"1920,0 1720,200 1920,400",fill:"#6b7280",opacity:"0.10"}),t.jsx("polygon",{id:"poly6",points:"960,0 1040,120 880,120",fill:"#e5e7eb",opacity:"0.18"}),t.jsx("polygon",{id:"poly7",points:"200,200 400,350 300,500",fill:"#fff",opacity:"0.13"}),t.jsx("polygon",{id:"poly8",points:"1720,200 1520,350 1620,500",fill:"#fff",opacity:"0.13"})]})}),t.jsx(T,{}),t.jsx(P,{}),t.jsxs("main",{className:"relative z-10 flex-1 w-full p-2 sm:p-6 lg:p-8 ml-0 sm:ml-16 md:ml-64 overflow-x-hidden pb-20 md:pb-0",children:[t.jsxs("div",{className:"mb-3 sm:mb-4 md:mb-6 relative p-3 sm:p-4 md:p-6 rounded-lg sm:rounded-xl bg-white border border-gray-200 shadow-sm",children:[t.jsx(Vl,{size:100,duration:8,colorFrom:"#1d3726",colorTo:"#152a1c",className:"rounded-lg sm:rounded-xl"}),t.jsxs("div",{className:"relative z-10",children:[t.jsx("h1",{className:"text-lg sm:text-xl md:text-2xl font-bold mb-0.5 sm:mb-1",children:"Tableau de bord"}),t.jsx("p",{className:"text-xs sm:text-sm md:text-base text-muted-foreground",children:"Bienvenue sur votre tableau de bord"})]})]}),t.jsx(Rl,{restaurants:m,onRefresh:h,onUpdateRestaurant:d}),p&&t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-3 sm:gap-4 md:gap-8 mb-4 sm:mb-6 md:mb-8 lg:items-stretch",children:[p&&t.jsx("div",{className:"lg:col-span-2 flex",children:t.jsx("div",{className:"w-full",children:t.jsx(k,{className:"h-full"})})}),t.jsx("div",{className:"space-y-3 sm:space-y-4 md:space-y-8 flex flex-col "+(p?"lg:col-span-1":"lg:col-span-3"),children:t.jsx(ht,{})})]}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3 sm:gap-4 md:gap-8 lg:items-stretch",children:[t.jsx("div",{className:"flex w-full",children:t.jsx("div",{className:"w-full",children:t.jsx(rt,{className:"h-full"})})}),t.jsx("div",{className:"flex w-full",children:t.jsx("div",{className:"w-full",children:t.jsx(lt,{className:"h-full"})})})]})]}),t.jsx(I,{})]})}export{Ll 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.