import{n as e}from"./priceUtils-CA1fL8Ds.js";import{a as t}from"./dateUtils-CSFYcBZ0.js";var n=e=>e.toLowerCase().trim().normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).substring(0,50).replace(/-+$/g,``),r=e=>{if(e)try{let t=new URL(e,window.location.origin);return t.protocol===`http:`||t.protocol===`https:`?t.href:void 0}catch{return}},i=e=>{if(e)try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`?t.href:void 0}catch{return}},a=(e,t,r=`recommended`)=>{let i=n(t);switch(r){case`recommended`:return`/events/${e}/${i}`;case`legacy`:return`/event/evenements/${e}`;case`short`:return`/events/${e}`;default:return`/events/${e}/${i}`}},o=(e,t)=>{let r=n(t);return r?`/associations/${e}/${r}`:`/associations/${e}`},s=e=>{let t=e.match(/^\/events\/([^/]+)\/[^/]+$/);if(t)return t[1];let n=e.match(/^\/event\/evenements\/([^/]+)$/);if(n)return n[1];let r=e.match(/^\/events\/([^/]+)$/);return r?r[1]:null},c=n=>{let r=window.location.origin,i=t(n.start_date)?.toISOString(),o=n.end_date?t(n.end_date)?.toISOString():void 0,s=`${r}${a(n.id,n.title,`recommended`)}`,c=(e=>e?/^https?:\/\//.test(e)?e:`${r}${e.startsWith(`/`)?``:`/`}${e}`:void 0)(n.images?.[0]?.url)||`${r}/images/img-reload-airsoft.webp`,l=`${n.description.substring(0,140)}... | Partie airsoft le ${n.start_date} à ${n.location.city||n.location.country||`TBD`} - ${e(n.price||0)}`,u=[`airsoft`,`partie`,`simulation militaire`,n.location.city,n.location.country,`réservation`,`jeu d'équipe`].filter(Boolean).join(`, `);return{title:`${n.title} - Partie Airsoft | Reload Airsoft`,description:l,keywords:u,canonical:s,openGraph:{title:n.title,description:l,url:s,type:`event`,image:c,site_name:`Reload Airsoft`},structured:{"@context":`https://schema.org`,"@type":`Event`,name:n.title,description:n.description,...i&&{startDate:i},...o&&{endDate:o},location:{"@type":`Place`,name:n.location.city||`Location TBD`,address:{"@type":`PostalAddress`,addressLocality:n.location.city,addressCountry:n.location.country}},offers:{"@type":`Offer`,price:(n.price||0)/100,priceCurrency:`EUR`,availability:`https://schema.org/InStock`,url:s},image:c,url:s,eventAttendanceMode:`https://schema.org/OfflineEventAttendanceMode`,eventStatus:`https://schema.org/EventScheduled`,...n.max_participants!=null&&{maximumAttendeeCapacity:n.max_participants},...n.organizer_name&&{organizer:{"@type":`Organization`,name:n.organizer_name}}}}};export{n as a,a as i,o as n,i as o,c as r,r as s,s as t};