diff --git a/app/Helpers/ImporterHelper.php b/app/Helpers/ImporterHelper.php index 81f1b9d0e..9e2a50207 100644 --- a/app/Helpers/ImporterHelper.php +++ b/app/Helpers/ImporterHelper.php @@ -14,7 +14,7 @@ class ImporterHelper public static function getGermanCities() { - return ['niedersachsen','hamburg', 'baden', 'bonn', 'berlin', 'leipzig', 'thueringen', 'bremen', 'muensterland', 'nordhessen', 'bayern']; + return ['niedersachsen','hamburg', 'baden', 'berlin', 'bremen', 'muensterland', 'nordhessen', 'bayern']; } //Create or load Technical user based on username diff --git a/public/build/assets/app-Np9HQlJr.js b/public/build/assets/app-Hu-6rhL7.js similarity index 98% rename from public/build/assets/app-Np9HQlJr.js rename to public/build/assets/app-Hu-6rhL7.js index 577080562..c3547060d 100644 --- a/public/build/assets/app-Np9HQlJr.js +++ b/public/build/assets/app-Hu-6rhL7.js @@ -220,7 +220,7 @@ function print() { __p += __j.call(arguments, '') } } .v3ti .v3ti-new-tag--error { color: #F56C6C; -}`;Rw(q8);Pw.render=j8;var W8=(()=>{const e=Pw;return e.install=t=>{t.component("Vue3TagsInput",e)},e})();const Y8=fn({components:{Vue3TagsInput:W8},props:{value:{type:String,default:""}},data(){return{tags:this.value?this.value.split(","):[]}},methods:{handleChangeTag(e){this.tags=e}}}),z8={class:"input-tag-wrapper"},K8=["value"];function G8(e,t,n,r,s,a){const o=at("vue3-tags-input");return k(),P("div",z8,[he(o,{tags:e.tags,placeholder:"enter some tags","add-tag-on-keys":[9,13,188],onOnTagsChanged:e.handleChangeTag},null,8,["tags","onOnTagsChanged"]),v("input",{type:"hidden",name:"tags",value:e.tags},null,8,K8)])}const J8=vt(Y8,[["render",G8]]),Z8={props:["event"],data(){return{reported_at:this.event.reported_at,certificate_url:this.event.certificate_url,status:this.event.status}},methods:{report(){window.location.href="/event/report/"+this.event.id},download(){window.location.href=this.event.certificate_url}}},X8={key:0},Q8={key:0},eH={class:"report-event"},tH={style:{"text-align":"right"}},nH={class:"actions"},rH={key:1},sH={class:"event-already-reported"},iH={class:"actions"};function aH(e,t,n,r,s,a){return s.status==="APPROVED"?(k(),P("div",X8,[s.reported_at==null||s.certificate_url==null?(k(),P("div",Q8,[v("div",eH,[v("div",tH,se(e.$t("event.submit_event_and_report")),1),v("div",nH,[v("button",{onClick:t[0]||(t[0]=(...o)=>a.report&&a.report(...o)),class:"codeweek-action-button"},se(e.$t("event.report_and_claim")),1)])])])):(k(),P("div",rH,[v("div",sH,[v("div",null,se(e.$t("event.certificate_ready")),1),v("div",iH,[v("button",{onClick:t[1]||(t[1]=(...o)=>a.download&&a.download(...o)),class:"codeweek-action-button"},se(e.$t("event.view_your_certificate")),1)])])]))])):ae("",!0)}const lH=vt(Z8,[["render",aH]]),oH={props:{event:{type:Object,default:()=>({})}},setup(e){const{recurringFrequentlyMap:t}=Hi(),n=pe(()=>{var o,u;const a=[];return e.event.highlighted_status==="FEATURED"&&a.push({title:"Featured",highlight:!0}),["daily","weekly","monthly"].includes((o=e.event)==null?void 0:o.recurring_event)&&a.push({title:t.value[(u=e.event)==null?void 0:u.recurring_event]}),a}),r=pe(()=>{const a=c=>{if(!c)return"";const h=new Date(c),f=h.getDate(),p=h.toLocaleString("en-US",{month:"short"}),m=h.getFullYear();return h.toLocaleString("en-US",{hour:"numeric",hour12:!0}),`${f}, ${p} ${m}`},o=e.event.start_date;if(!o)return"";const u=new Date(o);return u.getDate(),u.toLocaleString("en-US",{month:"short"}),u.getFullYear(),u.toLocaleString("en-US",{hour:"numeric",hour12:!0}),`${a(e.event.start_date)} - ${a(e.event.end_date)}`});return{eventTags:n,eventStartDateText:r,limit:a=>a.length>400?a.substring(0,400)+"...":a}}},uH={class:"flex flex-col bg-white rounded-lg overflow-hidden"},cH={class:"flex-shrink-0"},dH=["src"],fH={class:"flex-grow flex flex-col gap-2 px-6 py-4"},hH={class:"text-default text-slate-500 mb-2 flex items-center font-semibold"},pH={class:"text-sm font-semibold ml-1 w-fit px-4 py-1.5 bg-[#CCF0F9] rounded-full flex items-center"},mH={key:0,class:"flex gap-2 flex-wrap mb-2"},gH={key:0,class:"inline-block w-4 h-4 text-white",src:"/images/star-white.svg"},vH={class:"text-dark-blue font-semibold font-['Montserrat'] text-base leading-6"},yH={class:"text-slate-500 text-[16px] leading-[22px] font-semibold"},_H=["innerHTML"],bH={class:""},wH=["href"];function xH(e,t,n,r,s,a){return k(),P("div",uH,[v("div",cH,[v("img",{src:n.event.picture_path,class:"w-full object-cover aspect-[1.5]"},null,8,dH)]),v("div",fH,[v("div",hH,[t[0]||(t[0]=ft(" Organizer: ")),v("span",pH,se(n.event.organizer||"Unknown"),1)]),r.eventTags.length?(k(),P("div",mH,[(k(!0),P(Ve,null,Qe(r.eventTags,({title:o,highlight:u})=>(k(),P("span",{class:Be(["flex items-center gap-2 py-1 px-3 text-sm font-semibold rounded-full whitespace-nowrap leading-4",[u?"bg-dark-blue text-white":"bg-light-blue-100 text-slate-500"]])},[u?(k(),P("img",gH)):ae("",!0),v("span",null,[(k(!0),P(Ve,null,Qe(o.split(" "),c=>(k(),P(Ve,null,[c?(k(),P("span",{key:0,class:Be(["mr-[2px]",{"font-sans":c==="&"}])},se(c),3)):ae("",!0)],64))),256))])],2))),256))])):ae("",!0),v("div",vH,se(n.event.title),1),v("div",yH,se(r.eventStartDateText),1),v("div",{class:"flex-grow text-slate-500 text-[16px] leading-[22px] mb-2 [&_p]:p-0",innerHTML:r.limit(n.event.description)},null,8,_H),v("div",bH,[v("a",{class:"flex justify-center items-center gap-2 text-[#1C4DA1] border-solid border-2 border-[#1C4DA1] rounded-full py-3 px-8 font-semibold text-lg transition-all duration-300 hover:bg-[#E8EDF6] group",href:"/view/"+n.event.id+"/"+n.event.slug},t[1]||(t[1]=[v("span",null,"View activity",-1),v("div",{class:"flex gap-2 w-4 overflow-hidden"},[v("img",{src:"/images/arrow-right-icon.svg",class:"min-w-4 duration-500 transform -translate-x-6 group-hover:translate-x-0 text-[#1C4DA1]"}),v("img",{src:"/images/arrow-right-icon.svg",class:"min-w-4 duration-500 transform -translate-x-6 group-hover:translate-x-0 text-[#1C4DA1]"})],-1)]),8,wH)])])])}const Lw=vt(oH,[["render",xH]]),kH={props:{event:{type:Object,default:()=>({})},mapTileUrl:String,canApprove:Boolean,canEdit:Boolean,fromText:String,toText:String,lastUpdateText:String,eventPath:String,appUrl:String,shareUrl:String,emailHref:String},setup(e){console.log(e.event);const{activityFormatOptionsMap:t,durationOptionsMap:n,ageOptions:r,ageOptionsMap:s,recurringFrequentlyMap:a,recurringTypeOptionsMap:o}=Hi(),u=fe(null),c=pe(()=>{var p;return(p=e.event.ages)==null?void 0:p.split(",").map(m=>{var y,_;return(_=(y=r.value)==null?void 0:y.find(({id:b})=>b===m))==null?void 0:_.name})}),h=p=>{const m=u.value;if(!m)return;const y="fixed left-0 top-[139px] md:top-[123px] z-[110] h-[calc(100dvh-139px)] md:h-[calc(100dvh-123px)]";p?m.classList.add(...y.split(" ")):m.classList.remove(...y.split(" "))},f=()=>{const p=L.map("mapid");L.tileLayer(e.mapTileUrl,{maxZoom:18,attribution:'© Mapbox',tileSize:512,zoomOffset:-1,zoomControl:!1}).addTo(p),p.setView([51,10],5);let m=[51,10];e.event.latitude&&e.event.longitude&&(m=[e.event.latitude,e.event.longitude]);const y=L.icon({iconUrl:"/images/marker-orange.svg",iconSize:[44,62],iconAnchor:[22,62],popupAnchor:[0,-60]});L.marker(m,{icon:y}).addTo(p),p.setView(m,5)};return Ft(()=>{setTimeout(()=>{f()},2e3)}),{activityFormatOptionsMap:t,eventAges:c,durationOptionsMap:n,ageOptionsMap:s,recurringFrequentlyMap:a,recurringTypeOptionsMap:o,mapContainerRef:u,handleToggleMapFullScreen:h}}},SH={class:"relative z-10"},TH={class:"flex relative z-10 justify-center py-10 md:py-20 codeweek-container-lg"},CH={class:"w-full max-w-[880px] gap-2 text-xl"},AH={class:"text-dark-blue text-[22px] md:text-4xl leading-7 md:leading-[44px] font-medium font-['Montserrat'] mb-2"},EH={class:"text-[#20262C] font-normal p-0 mb-6"},OH={class:"mb-6"},MH={class:"text-[#20262C] font-normal p-0 mb-6"},RH={key:0,class:"mb-6"},DH={class:"flex flex-wrap gap-2"},PH={class:"flex gap-2 items-center px-4 py-1 bg-light-blue-100 rounded-full w-fit"},LH={class:"p-0 text-base font-semibold text-slate-500"},IH={class:"mb-6"},NH={class:"p-0 mb-2 font-semibold text-slate-500"},VH={class:"text-[#20262C] font-normal p-0 mb-6"},FH={key:1,class:"mb-6"},$H={class:"p-0 mb-2 font-semibold text-slate-500"},BH={class:"flex flex-wrap gap-2"},HH={class:"flex gap-2 items-center px-4 py-1 bg-light-blue-100 rounded-full w-fit"},UH={class:"p-0 text-base font-semibold text-slate-500"},jH={key:2,class:"mb-6"},qH={class:"flex flex-wrap gap-2"},WH={class:"flex gap-2 items-center px-4 py-1 bg-light-blue-100 rounded-full w-fit"},YH={class:"p-0 text-base font-semibold text-slate-500"},zH={key:0,class:"flex gap-2 items-center px-4 py-1 bg-light-blue-100 rounded-full w-fit"},KH={class:"p-0 text-base font-semibold text-slate-500"},GH={key:1,class:"flex gap-2 items-center px-4 py-1 bg-light-blue-100 rounded-full w-fit"},JH={class:"p-0 text-base font-semibold text-slate-500"},ZH={key:3,class:"mb-6"},XH={class:"p-0 mb-2 font-semibold text-slate-500"},QH={class:"flex flex-wrap gap-2"},eU={class:"flex gap-2 items-center px-4 py-1 bg-light-blue-100 rounded-full w-fit"},tU={class:"p-0 text-base font-semibold text-slate-500"},nU={key:4,class:"mb-6"},rU={class:"flex flex-wrap gap-2"},sU={class:"flex gap-2 items-center px-4 py-1 bg-light-blue-100 rounded-full w-fit"},iU={class:"p-0 text-base font-semibold text-slate-500"},aU={key:5,class:"mb-6"},lU={class:"flex flex-wrap gap-2"},oU={class:"flex gap-2 items-center px-4 py-1 bg-light-blue-100 rounded-full w-fit"},uU={class:"p-0 text-base font-semibold text-slate-500"},cU={class:"mb-6"},dU={class:"p-0 mb-2 font-semibold text-slate-500"},fU={class:"text-[#20262C] font-normal p-0 mb-6"},hU={class:"mb-6 [&_p]:empty:hidden"},pU=["innerHTML"],mU={class:"mb-6"},gU={class:"text-[#20262C] font-normal p-0 mb-6"},vU={key:6,class:"mb-6"},yU={class:"p-0 mb-2 font-semibold text-slate-500"},_U=["href"],bU={ref:"mapContainerRef",class:"w-full h-[520px] top-0 left-0 mb-6 rounded-lg overflow-hidden"},wU={id:"mapid",class:"relative w-full h-full"},xU={style:{"z-index":"999"},id:"map-controls",class:"flex absolute left-2 top-4 z-50 flex-col"},kU={class:"flex gap-4 items-center"},SU=["data-href"],TU=["data-href","data-text"],CU=["title","href"],AU=["data-href"];function EU(e,t,n,r,s,a){var o,u,c;return k(),P("section",SH,[v("div",TH,[v("div",CH,[v("h2",AH,se(n.event.title),1),v("p",EH,se(n.fromText)+" - "+se(n.toText),1),v("div",OH,[t[2]||(t[2]=v("p",{class:"text-slate-500 font-semibold p-0 mb-2"}," Organizer: ",-1)),v("p",MH,se(n.event.organizer||"Unknown"),1)]),n.event.activity_format?(k(),P("div",RH,[t[3]||(t[3]=v("p",{class:"p-0 mb-2 font-semibold text-slate-500"}," Format of the activity: ",-1)),v("div",DH,[(k(!0),P(Ve,null,Qe(n.event.activity_format,h=>(k(),P("div",PH,[v("p",LH,se(r.activityFormatOptionsMap[h]),1)]))),256))])])):ae("",!0),v("div",IH,[v("p",NH,se(e.$t("event.activitytype.label"))+": ",1),v("p",VH,[n.event.activity_type?(k(),P(Ve,{key:0},[ft(se(e.$t(`event.activitytype.${n.event.activity_type}`)),1)],64)):ae("",!0)])]),n.event.language?(k(),P("div",FH,[v("p",$H,se(e.$t("resources.Languages"))+": ",1),v("div",BH,[(k(!0),P(Ve,null,Qe(n.event.languages,h=>(k(),P("div",HH,[v("p",UH,se(e.$t(`base.languages.${h}`)),1)]))),256))])])):ae("",!0),n.event.recurring_event&&r.recurringFrequentlyMap[n.event.recurring_event]?(k(),P("div",jH,[t[4]||(t[4]=v("p",{class:"p-0 mb-2 font-semibold text-slate-500"},"Recurring event:",-1)),v("div",qH,[v("div",WH,[v("p",YH,se(r.recurringFrequentlyMap[n.event.recurring_event]),1)]),n.event.duration?(k(),P("div",zH,[v("p",KH,se(r.durationOptionsMap[n.event.duration]),1)])):ae("",!0),n.event.recurring_type?(k(),P("div",GH,[v("p",JH,se(r.recurringTypeOptionsMap[n.event.recurring_type]),1)])):ae("",!0)])])):ae("",!0),(o=n.event.audiences)!=null&&o.length?(k(),P("div",ZH,[v("p",XH,se(e.$t("event.audience_title"))+": ",1),v("div",QH,[(k(!0),P(Ve,null,Qe(n.event.audiences,h=>(k(),P("div",eU,[v("p",tU,se(e.$t(`event.audience.${h.name}`)),1)]))),256))])])):ae("",!0),(u=n.event.ages)!=null&&u.length?(k(),P("div",nU,[t[5]||(t[5]=v("p",{class:"p-0 mb-2 font-semibold text-slate-500"},"Age range:",-1)),v("div",rU,[(k(!0),P(Ve,null,Qe(n.event.ages,h=>(k(),P("div",sU,[v("p",iU,se(r.ageOptionsMap[h]),1)]))),256))])])):ae("",!0),(c=n.event.themes)!=null&&c.length?(k(),P("div",aU,[t[6]||(t[6]=v("p",{class:"p-0 mb-2 font-semibold text-slate-500"},"Themes:",-1)),v("div",lU,[(k(!0),P(Ve,null,Qe(n.event.themes,h=>(k(),P("div",oU,[v("p",uU,se(e.$t(`event.theme.${h.name}`)),1)]))),256))])])):ae("",!0),v("div",cU,[v("p",dU,se(e.$t("event.address.label"))+": ",1),v("p",fU,se(n.event.location),1)]),v("div",hU,[v("div",{class:"text-[#20262C] font-normal p-0 mb-6 space-y-2 [&_p]:py-0",innerHTML:n.event.description},null,8,pU)]),v("div",mU,[t[7]||(t[7]=v("p",{class:"p-0 mb-2 font-semibold text-slate-500"},"Email address:",-1)),v("p",gU,se(n.event.contact_person),1)]),n.event.event_url?(k(),P("div",vU,[v("p",yU,se(e.$t("eventdetails.more_info")),1),v("a",{href:n.event.event_url,class:"p-0 mb-6 font-normal text-dark-blue"},se(n.event.event_url),9,_U)])):ae("",!0),v("div",bU,[v("div",wU,[v("div",xU,[v("button",{class:"pb-2 group",onClick:t[0]||(t[0]=h=>r.handleToggleMapFullScreen(!1))},t[8]||(t[8]=[v("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[v("rect",{width:"40",height:"40",rx:"8",class:"fill-white transition-colors duration-300 group-hover:fill-[#1C4DA1]"}),v("path",{d:"M13 20H27",class:"stroke-[#414141] group-hover:stroke-[#ffffff]","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])),v("button",{class:"pb-2 group",onClick:t[1]||(t[1]=h=>r.handleToggleMapFullScreen(!0))},t[9]||(t[9]=[v("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[v("rect",{width:"40",height:"40",rx:"8",class:"fill-white transition-colors duration-300 group-hover:fill-[#1C4DA1]"}),v("path",{class:"stroke-[#414141] group-hover:stroke-[#ffffff]",d:"M16 11H13C12.4696 11 11.9609 11.2107 11.5858 11.5858C11.2107 11.9609 11 12.4696 11 13V16M29 16V13C29 12.4696 28.7893 11.9609 28.4142 11.5858C28.0391 11.2107 27.5304 11 27 11H24M24 29H27C27.5304 29 28.0391 28.7893 28.4142 28.4142C28.7893 28.0391 29 27.5304 29 27V24M11 24V27C11 27.5304 11.2107 28.0391 11.5858 28.4142C11.9609 28.7893 12.4696 29 13 29H16","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)]))])])],512),v("div",null,[t[12]||(t[12]=v("p",{class:"p-0 mb-2 font-semibold text-slate-500"}," Share activity on: ",-1)),v("div",kU,[v("div",{class:"fb-like","data-href":n.shareUrl,"data-layout":"button_count","data-action":"recommend","data-show-faces":"false","data-share":"true"},null,8,SU),v("a",{href:"https://twitter.com/share",class:"twitter-share-button","data-href":n.shareUrl,"data-text":`Check out ${n.event.title} at`,"data-via":"CodeWeekEU","data-hashtags":"codeEU"},t[10]||(t[10]=[v("img",{src:"/images/social/twitter.svg"},null,-1)]),8,TU),v("a",{class:"block [&_path]:!fill-dark-blue",title:e.$t("eventdetails.email.tooltip"),href:n.emailHref},t[11]||(t[11]=[v("img",{class:"block",src:"/images/mail.svg"},null,-1)]),8,CU),v("div",{class:"g-plusone","data-size":"medium","data-href":n.appUrl},null,8,AU)])])])]),t[13]||(t[13]=v("div",{class:"animation-element move-background duration-[1.5s] absolute z-0 bottom-10 md:bottom-auto md:top-48 -right-14 md:-right-40 w-28 md:w-72 h-28 md:h-72 bg-[#FFEF99] rounded-full hidden lg:block",style:{transform:"translate(-16px, -24px)"}},null,-1)),t[14]||(t[14]=v("div",{class:"animation-element move-background duration-[1.5s] absolute z-0 lg:top-96 right-40 w-28 h-28 hidden lg:block bg-[#FFEF99] rounded-full",style:{transform:"translate(-16px, -24px)"}},null,-1))])}const OU=vt(kH,[["render",EU]]),MU=()=>{const e=new URLSearchParams(window.location.search);console.log("urlParams",e);const t=fe({});for(const[r,s]of e)t.value[r]=s;return{queryParams:t,onChangeQueryParams:r=>{const s=Bn.cloneDeep(r);console.log(">>> params",s);const a=new URLSearchParams(window.location.search);for(const u in s){const c=s[u];typeof c=="number"?Bn.isNil(c)?a.delete(u):a.set(u,c):Bn.isEmpty(c)?a.delete(u):a.set(u,c)}t.value=s;const o=a.toString()?`${window.location.pathname}?${a.toString()}`:window.location.pathname;window.history.replaceState({},"",o)}}},RU={name:"SearchPageComponent",components:{EventCard:Lw,Pagination:dd,FieldWrapper:od,SelectField:Fo,InputField:ud},props:{mapTileUrl:String,prpQuery:String,prpSelectedCountry:Array,name:String,years:Array,countrieslist:Array,audienceslist:Array,themeslist:Array,typeslist:Array,languagesObject:{type:Object,default:()=>({})}},setup(e){const{activityFormatOptions:t,activityTypeOptions:n,ageOptions:r}=Hi(),{queryParams:s,onChangeQueryParams:a}=MU(),o=fe(!0),u=fe(null),c=fe(null),h=fe(null),f=fe([]),p=fe({}),m=fe(null),y={query:e.prpQuery||"",languages:[],countries:[],start_date:"",formats:[],types:[],audiences:[],ages:[],themes:[],year:{id:new Date().getFullYear(),name:new Date().getFullYear()},countries:e.prpSelectedCountry||[]},_=fe({...y}),b=fe({current_page:1,per_page:0,from:null,last_page:0,last_page_url:null,next_page_url:null,prev_page:null,prev_page_url:null,to:null,total:0}),A=pe(()=>e.years.map(Y=>({id:Y,name:Y}))),H=pe(()=>Object.entries(e.languagesObject).map(([Y,me])=>({id:Y,name:me}))),V=pe(()=>(e.countrieslist||[]).map(Y=>({...Y,name:Y.translation&&String(Y.translation).trim()?Y.translation:Y.name})).sort((Y,me)=>Y.name.localeCompare(me.name,void 0,{sensitivity:"base"}))),x=()=>{var me,Ae,Pe,q,re,O,ne,_e;const Y={page:b.value.current_page,query:_.value.query,year:(me=_.value.year)==null?void 0:me.id,start_date:_.value.start_date,languages:(Ae=_.value.languages)==null?void 0:Ae.map(j=>j.id).join(","),countries:(Pe=_.value.countries)==null?void 0:Pe.map(j=>j.iso).join(","),formats:(q=_.value.formats)==null?void 0:q.map(j=>j.id).join(","),types:(re=_.value.types)==null?void 0:re.map(j=>j.id).join(","),audiences:(O=_.value.audiences)==null?void 0:O.map(j=>j.id).join(","),ages:(ne=_.value.ages)==null?void 0:ne.map(j=>j.id).join(","),themes:(_e=_.value.themes)==null?void 0:_e.map(j=>j.id).join(",")};console.log("updatedParams",Y),a(Y)},E=()=>{const Y=s.value;console.log("init params",Y);const me=(Ae,Pe,q="id")=>(Ae||"").split(",").map(re=>Pe.find(O=>String(O[q])===String(re))).filter(re=>!!re);Y.page&&(b.value.current_page=Y.page),_.value={...y,query:Y.query||"",start_date:Y.start_date||"",year:Y.year?{id:Y.year,name:Y.year}:y.year,languages:me(Y.languages,H.value),countries:me(Y.countries,V.value,"iso"),formats:me(Y.formats,t.value),types:me(Y.types,n.value),audiences:me(Y.audiences,e.audienceslist),ages:me(Y.ages,r.value),themes:me(Y.themes,e.themeslist)}},B=pe(()=>{const Y=[..._.value.languages,..._.value.countries,..._.value.formats,..._.value.types,..._.value.audiences,..._.value.ages,..._.value.themes];return _.value.start_date&&Y.push({id:"start_date",name:_.value.start_date.slice(0,10)}),Y}),U=Y=>{if(Y.id==="start_date"){_.value.start_date="";return}const me=Ae=>Ae.id!==Y.id;_.value.languages=_.value.languages.filter(me),_.value.countries=_.value.countries.filter(Ae=>Ae.iso!==Y.iso),_.value.formats=_.value.formats.filter(me),_.value.audiences=_.value.audiences.filter(me),_.value.themes=_.value.themes.filter(me),F()},$=()=>{_.value={...y},F()},M=()=>{window.scrollTo(0,0)},S=()=>{M(),F(!0)},F=(Y=!1)=>{var Pe;f.value=[],o.value=!0;let me="/search";Y&&(me=`/search?page=${b.value.current_page}`),x();const Ae={..._.value,year:(Pe=_.value.year)==null?void 0:Pe.id,start_date:_.value.start_date?new Date(_.value.start_date).toISOString().slice(0,10):"",pagination:{current_page:b.current_page}};Tt.post(me,Ae).then(q=>{const re=q.data;console.log("🔥 Full response:",re);let O,ne;if(Array.isArray(re))O=re[0],ne=re[1]||null;else if(re.events)O=re.events,ne=re.map||null;else{console.warn("❌ Unexpected response structure:",re),m.value="Unexpected response format from server.",o.value=!1;return}b.value={per_page:O.per_page,current_page:O.current_page,from:O.from,last_page:O.last_page,last_page_url:O.last_page_url,next_page_url:O.next_page_url,prev_page:O.prev_page,prev_page_url:O.prev_page_url,to:O.to,total:O.total},O.data?f.value=Array.isArray(O.data)?O.data:Object.values(O.data):f.value=[],console.log("✅ Events loaded:",f.value.length),!Y&&ne?(window.getEvents?window.getEvents(ne):window.eventsToMap=ne,p.value=ne,te()):ne||console.warn("⚠️ mapData is null, skipping map update"),ie(),o.value=!1}).catch(q=>{console.error("❌ Request failed:",q),m.value=q.response?q.response.data:"Unknown error",o.value=!1})},ie=()=>{var me;if(!c.value)return;let Y={latitude:51,longitude:4};if(((me=_.value.countries)==null?void 0:me.length)===1){const{latitude:Ae,longitude:Pe}=_.value.countries[0]||{};Ae&&Pe&&(Y={latitude:Ae,longitude:Pe,zoom:4})}c.value.setView(new L.LatLng(Y.latitude,Y.longitude),4,{animation:!0})},ee=Y=>Y.length>400?Y.substring(0,400)+"...":Y;var de=async Y=>{const me=Y.target.options.id;try{const{data:Ae}=await Tt.get(`/api/event/detail?id=${me}`),Pe=Ae.data;console.log("event/detail",Pe);const q=` +}`;Rw(q8);Pw.render=j8;var W8=(()=>{const e=Pw;return e.install=t=>{t.component("Vue3TagsInput",e)},e})();const Y8=fn({components:{Vue3TagsInput:W8},props:{value:{type:String,default:""}},data(){return{tags:this.value?this.value.split(","):[]}},methods:{handleChangeTag(e){this.tags=e}}}),z8={class:"input-tag-wrapper"},K8=["value"];function G8(e,t,n,r,s,a){const o=at("vue3-tags-input");return k(),P("div",z8,[he(o,{tags:e.tags,placeholder:"enter some tags","add-tag-on-keys":[9,13,188],onOnTagsChanged:e.handleChangeTag},null,8,["tags","onOnTagsChanged"]),v("input",{type:"hidden",name:"tags",value:e.tags},null,8,K8)])}const J8=vt(Y8,[["render",G8]]),Z8={props:["event"],data(){return{reported_at:this.event.reported_at,certificate_url:this.event.certificate_url,status:this.event.status}},methods:{report(){window.location.href="/event/report/"+this.event.id},download(){window.location.href=this.event.certificate_url}}},X8={key:0},Q8={key:0},eH={class:"report-event"},tH={style:{"text-align":"right"}},nH={class:"actions"},rH={key:1},sH={class:"event-already-reported"},iH={class:"actions"};function aH(e,t,n,r,s,a){return s.status==="APPROVED"?(k(),P("div",X8,[s.reported_at==null||s.certificate_url==null?(k(),P("div",Q8,[v("div",eH,[v("div",tH,se(e.$t("event.submit_event_and_report")),1),v("div",nH,[v("button",{onClick:t[0]||(t[0]=(...o)=>a.report&&a.report(...o)),class:"codeweek-action-button"},se(e.$t("event.report_and_claim")),1)])])])):(k(),P("div",rH,[v("div",sH,[v("div",null,se(e.$t("event.certificate_ready")),1),v("div",iH,[v("button",{onClick:t[1]||(t[1]=(...o)=>a.download&&a.download(...o)),class:"codeweek-action-button"},se(e.$t("event.view_your_certificate")),1)])])]))])):ae("",!0)}const lH=vt(Z8,[["render",aH]]),oH={props:{event:{type:Object,default:()=>({})}},setup(e){const{recurringFrequentlyMap:t}=Hi(),n=pe(()=>{var o,u;const a=[];return e.event.highlighted_status==="FEATURED"&&a.push({title:"Featured",highlight:!0}),["daily","weekly","monthly"].includes((o=e.event)==null?void 0:o.recurring_event)&&a.push({title:t.value[(u=e.event)==null?void 0:u.recurring_event]}),a}),r=pe(()=>{const a=c=>{if(!c)return"";const h=new Date(c),f=h.getDate(),p=h.toLocaleString("en-US",{month:"short"}),m=h.getFullYear();return h.toLocaleString("en-US",{hour:"numeric",hour12:!0}),`${f}, ${p} ${m}`},o=e.event.start_date;if(!o)return"";const u=new Date(o);return u.getDate(),u.toLocaleString("en-US",{month:"short"}),u.getFullYear(),u.toLocaleString("en-US",{hour:"numeric",hour12:!0}),`${a(e.event.start_date)} - ${a(e.event.end_date)}`});return{eventTags:n,eventStartDateText:r,limit:a=>a.length>400?a.substring(0,400)+"...":a}}},uH={class:"flex flex-col bg-white rounded-lg overflow-hidden"},cH={class:"flex-shrink-0"},dH=["src"],fH={class:"flex-grow flex flex-col gap-2 px-6 py-4"},hH={class:"text-default text-slate-500 mb-2 flex items-center font-semibold"},pH={class:"text-sm font-semibold ml-1 w-fit px-4 py-1.5 bg-[#CCF0F9] rounded-full flex items-center"},mH={key:0,class:"flex gap-2 flex-wrap mb-2"},gH={key:0,class:"inline-block w-4 h-4 text-white",src:"/images/star-white.svg"},vH={class:"text-dark-blue font-semibold font-['Montserrat'] text-base leading-6"},yH={class:"text-slate-500 text-[16px] leading-[22px] font-semibold"},_H=["innerHTML"],bH={class:""},wH=["href"];function xH(e,t,n,r,s,a){return k(),P("div",uH,[v("div",cH,[v("img",{src:n.event.picture_path,class:"w-full object-cover aspect-[1.5]"},null,8,dH)]),v("div",fH,[v("div",hH,[t[0]||(t[0]=ft(" Organizer: ")),v("span",pH,se(n.event.organizer||"Unknown"),1)]),r.eventTags.length?(k(),P("div",mH,[(k(!0),P(Ve,null,Qe(r.eventTags,({title:o,highlight:u})=>(k(),P("span",{class:Be(["flex items-center gap-2 py-1 px-3 text-sm font-semibold rounded-full whitespace-nowrap leading-4",[u?"bg-dark-blue text-white":"bg-light-blue-100 text-slate-500"]])},[u?(k(),P("img",gH)):ae("",!0),v("span",null,[(k(!0),P(Ve,null,Qe(o.split(" "),c=>(k(),P(Ve,null,[c?(k(),P("span",{key:0,class:Be(["mr-[2px]",{"font-sans":c==="&"}])},se(c),3)):ae("",!0)],64))),256))])],2))),256))])):ae("",!0),v("div",vH,se(n.event.title),1),v("div",yH,se(r.eventStartDateText),1),v("div",{class:"flex-grow text-slate-500 text-[16px] leading-[22px] mb-2 [&_p]:p-0",innerHTML:r.limit(n.event.description)},null,8,_H),v("div",bH,[v("a",{class:"flex justify-center items-center gap-2 text-[#1C4DA1] border-solid border-2 border-[#1C4DA1] rounded-full py-3 px-8 font-semibold text-lg transition-all duration-300 hover:bg-[#E8EDF6] group",href:"/view/"+n.event.id+"/"+n.event.slug},t[1]||(t[1]=[v("span",null,"View activity",-1),v("div",{class:"flex gap-2 w-4 overflow-hidden"},[v("img",{src:"/images/arrow-right-icon.svg",class:"min-w-4 duration-500 transform -translate-x-6 group-hover:translate-x-0 text-[#1C4DA1]"}),v("img",{src:"/images/arrow-right-icon.svg",class:"min-w-4 duration-500 transform -translate-x-6 group-hover:translate-x-0 text-[#1C4DA1]"})],-1)]),8,wH)])])])}const Lw=vt(oH,[["render",xH]]),kH={props:{event:{type:Object,default:()=>({})},mapTileUrl:String,canApprove:Boolean,canEdit:Boolean,fromText:String,toText:String,lastUpdateText:String,eventPath:String,appUrl:String,shareUrl:String,emailHref:String},setup(e){console.log(e.event);const{activityFormatOptionsMap:t,durationOptionsMap:n,ageOptions:r,ageOptionsMap:s,recurringFrequentlyMap:a,recurringTypeOptionsMap:o}=Hi(),u=fe(null),c=pe(()=>{var p;return(p=e.event.ages)==null?void 0:p.split(",").map(m=>{var y,_;return(_=(y=r.value)==null?void 0:y.find(({id:b})=>b===m))==null?void 0:_.name})}),h=p=>{const m=u.value;if(!m)return;const y="fixed left-0 top-[139px] md:top-[123px] z-[110] h-[calc(100dvh-139px)] md:h-[calc(100dvh-123px)]";p?m.classList.add(...y.split(" ")):m.classList.remove(...y.split(" "))},f=()=>{const p=L.map("mapid");L.tileLayer(e.mapTileUrl,{maxZoom:18,attribution:'© Mapbox',tileSize:512,zoomOffset:-1,zoomControl:!1}).addTo(p),p.setView([51,10],5);let m=[51,10];e.event.latitude&&e.event.longitude&&(m=[e.event.latitude,e.event.longitude]);const y=L.icon({iconUrl:"/images/marker-orange.svg",iconSize:[44,62],iconAnchor:[22,62],popupAnchor:[0,-60]});L.marker(m,{icon:y}).addTo(p),p.setView(m,5)};return Ft(()=>{setTimeout(()=>{f()},2e3)}),{activityFormatOptionsMap:t,eventAges:c,durationOptionsMap:n,ageOptionsMap:s,recurringFrequentlyMap:a,recurringTypeOptionsMap:o,mapContainerRef:u,handleToggleMapFullScreen:h}}},SH={class:"relative z-10"},TH={class:"flex relative z-10 justify-center py-10 md:py-20 codeweek-container-lg"},CH={class:"w-full max-w-[880px] gap-2 text-xl"},AH={class:"text-dark-blue text-[22px] md:text-4xl leading-7 md:leading-[44px] font-medium font-['Montserrat'] mb-2"},EH={class:"text-[#20262C] font-normal p-0 mb-6"},OH={class:"mb-6"},MH={class:"text-[#20262C] font-normal p-0 mb-6"},RH={key:0,class:"mb-6"},DH={class:"flex flex-wrap gap-2"},PH={class:"flex gap-2 items-center px-4 py-1 bg-light-blue-100 rounded-full w-fit"},LH={class:"p-0 text-base font-semibold text-slate-500"},IH={class:"mb-6"},NH={class:"p-0 mb-2 font-semibold text-slate-500"},VH={class:"text-[#20262C] font-normal p-0 mb-6"},FH={key:1,class:"mb-6"},$H={class:"p-0 mb-2 font-semibold text-slate-500"},BH={class:"flex flex-wrap gap-2"},HH={class:"flex gap-2 items-center px-4 py-1 bg-light-blue-100 rounded-full w-fit"},UH={class:"p-0 text-base font-semibold text-slate-500"},jH={key:2,class:"mb-6"},qH={class:"flex flex-wrap gap-2"},WH={class:"flex gap-2 items-center px-4 py-1 bg-light-blue-100 rounded-full w-fit"},YH={class:"p-0 text-base font-semibold text-slate-500"},zH={key:0,class:"flex gap-2 items-center px-4 py-1 bg-light-blue-100 rounded-full w-fit"},KH={class:"p-0 text-base font-semibold text-slate-500"},GH={key:1,class:"flex gap-2 items-center px-4 py-1 bg-light-blue-100 rounded-full w-fit"},JH={class:"p-0 text-base font-semibold text-slate-500"},ZH={key:3,class:"mb-6"},XH={class:"p-0 mb-2 font-semibold text-slate-500"},QH={class:"flex flex-wrap gap-2"},eU={class:"flex gap-2 items-center px-4 py-1 bg-light-blue-100 rounded-full w-fit"},tU={class:"p-0 text-base font-semibold text-slate-500"},nU={key:4,class:"mb-6"},rU={class:"flex flex-wrap gap-2"},sU={class:"flex gap-2 items-center px-4 py-1 bg-light-blue-100 rounded-full w-fit"},iU={class:"p-0 text-base font-semibold text-slate-500"},aU={key:5,class:"mb-6"},lU={class:"flex flex-wrap gap-2"},oU={class:"flex gap-2 items-center px-4 py-1 bg-light-blue-100 rounded-full w-fit"},uU={class:"p-0 text-base font-semibold text-slate-500"},cU={class:"mb-6"},dU={class:"p-0 mb-2 font-semibold text-slate-500"},fU={class:"text-[#20262C] font-normal p-0 mb-6"},hU={class:"mb-6 [&_p]:empty:hidden"},pU=["innerHTML"],mU={class:"mb-6"},gU={class:"text-[#20262C] font-normal p-0 mb-6"},vU={key:6,class:"mb-6"},yU={class:"p-0 mb-2 font-semibold text-slate-500"},_U=["href"],bU={ref:"mapContainerRef",class:"w-full h-[520px] top-0 left-0 mb-6 rounded-lg overflow-hidden"},wU={id:"mapid",class:"relative w-full h-full"},xU={style:{"z-index":"999"},id:"map-controls",class:"flex absolute left-2 top-4 z-50 flex-col"},kU={class:"flex gap-4 items-center"},SU=["data-href"],TU=["data-href","data-text"],CU=["title","href"],AU=["data-href"];function EU(e,t,n,r,s,a){var o,u,c;return k(),P("section",SH,[v("div",TH,[v("div",CH,[v("h2",AH,se(n.event.title),1),v("p",EH,se(n.fromText)+" - "+se(n.toText),1),v("div",OH,[t[2]||(t[2]=v("p",{class:"text-slate-500 font-semibold p-0 mb-2"}," Organizer: ",-1)),v("p",MH,se(n.event.organizer||"Unknown"),1)]),n.event.activity_format?(k(),P("div",RH,[t[3]||(t[3]=v("p",{class:"p-0 mb-2 font-semibold text-slate-500"}," Format of the activity: ",-1)),v("div",DH,[(k(!0),P(Ve,null,Qe(n.event.activity_format,h=>(k(),P("div",PH,[v("p",LH,se(r.activityFormatOptionsMap[h]),1)]))),256))])])):ae("",!0),v("div",IH,[v("p",NH,se(e.$t("event.activitytype.label"))+": ",1),v("p",VH,[n.event.activity_type?(k(),P(Ve,{key:0},[ft(se(e.$t(`event.activitytype.${n.event.activity_type}`)),1)],64)):ae("",!0)])]),n.event.language?(k(),P("div",FH,[v("p",$H,se(e.$t("resources.Languages"))+": ",1),v("div",BH,[(k(!0),P(Ve,null,Qe(n.event.languages,h=>(k(),P("div",HH,[v("p",UH,se(e.$t(`base.languages.${h}`)),1)]))),256))])])):ae("",!0),n.event.recurring_event&&r.recurringFrequentlyMap[n.event.recurring_event]?(k(),P("div",jH,[t[4]||(t[4]=v("p",{class:"p-0 mb-2 font-semibold text-slate-500"},"Recurring event:",-1)),v("div",qH,[v("div",WH,[v("p",YH,se(r.recurringFrequentlyMap[n.event.recurring_event]),1)]),n.event.duration?(k(),P("div",zH,[v("p",KH,se(r.durationOptionsMap[n.event.duration]),1)])):ae("",!0),n.event.recurring_type?(k(),P("div",GH,[v("p",JH,se(r.recurringTypeOptionsMap[n.event.recurring_type]),1)])):ae("",!0)])])):ae("",!0),(o=n.event.audiences)!=null&&o.length?(k(),P("div",ZH,[v("p",XH,se(e.$t("event.audience_title"))+": ",1),v("div",QH,[(k(!0),P(Ve,null,Qe(n.event.audiences,h=>(k(),P("div",eU,[v("p",tU,se(e.$t(`event.audience.${h.name}`)),1)]))),256))])])):ae("",!0),(u=n.event.ages)!=null&&u.length?(k(),P("div",nU,[t[5]||(t[5]=v("p",{class:"p-0 mb-2 font-semibold text-slate-500"},"Age range:",-1)),v("div",rU,[(k(!0),P(Ve,null,Qe(n.event.ages,h=>(k(),P("div",sU,[v("p",iU,se(r.ageOptionsMap[h]),1)]))),256))])])):ae("",!0),(c=n.event.themes)!=null&&c.length?(k(),P("div",aU,[t[6]||(t[6]=v("p",{class:"p-0 mb-2 font-semibold text-slate-500"},"Themes:",-1)),v("div",lU,[(k(!0),P(Ve,null,Qe(n.event.themes,h=>(k(),P("div",oU,[v("p",uU,se(e.$t(`event.theme.${h.name}`)),1)]))),256))])])):ae("",!0),v("div",cU,[v("p",dU,se(e.$t("event.address.label"))+": ",1),v("p",fU,se(n.event.location),1)]),v("div",hU,[v("div",{class:"text-[#20262C] font-normal p-0 mb-6 space-y-2 [&_p]:py-0",innerHTML:n.event.description},null,8,pU)]),v("div",mU,[t[7]||(t[7]=v("p",{class:"p-0 mb-2 font-semibold text-slate-500"},"Email address:",-1)),v("p",gU,se(n.event.contact_person),1)]),n.event.event_url?(k(),P("div",vU,[v("p",yU,se(e.$t("eventdetails.more_info")),1),v("a",{href:n.event.event_url,target:"_blank",class:"p-0 mb-6 font-normal text-dark-blue"},se(n.event.event_url),9,_U)])):ae("",!0),v("div",bU,[v("div",wU,[v("div",xU,[v("button",{class:"pb-2 group",onClick:t[0]||(t[0]=h=>r.handleToggleMapFullScreen(!1))},t[8]||(t[8]=[v("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[v("rect",{width:"40",height:"40",rx:"8",class:"fill-white transition-colors duration-300 group-hover:fill-[#1C4DA1]"}),v("path",{d:"M13 20H27",class:"stroke-[#414141] group-hover:stroke-[#ffffff]","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])),v("button",{class:"pb-2 group",onClick:t[1]||(t[1]=h=>r.handleToggleMapFullScreen(!0))},t[9]||(t[9]=[v("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[v("rect",{width:"40",height:"40",rx:"8",class:"fill-white transition-colors duration-300 group-hover:fill-[#1C4DA1]"}),v("path",{class:"stroke-[#414141] group-hover:stroke-[#ffffff]",d:"M16 11H13C12.4696 11 11.9609 11.2107 11.5858 11.5858C11.2107 11.9609 11 12.4696 11 13V16M29 16V13C29 12.4696 28.7893 11.9609 28.4142 11.5858C28.0391 11.2107 27.5304 11 27 11H24M24 29H27C27.5304 29 28.0391 28.7893 28.4142 28.4142C28.7893 28.0391 29 27.5304 29 27V24M11 24V27C11 27.5304 11.2107 28.0391 11.5858 28.4142C11.9609 28.7893 12.4696 29 13 29H16","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)]))])])],512),v("div",null,[t[12]||(t[12]=v("p",{class:"p-0 mb-2 font-semibold text-slate-500"}," Share activity on: ",-1)),v("div",kU,[v("div",{class:"fb-like","data-href":n.shareUrl,"data-layout":"button_count","data-action":"recommend","data-show-faces":"false","data-share":"true"},null,8,SU),v("a",{href:"https://twitter.com/share",class:"twitter-share-button","data-href":n.shareUrl,"data-text":`Check out ${n.event.title} at`,"data-via":"CodeWeekEU","data-hashtags":"codeEU"},t[10]||(t[10]=[v("img",{src:"/images/social/twitter.svg"},null,-1)]),8,TU),v("a",{class:"block [&_path]:!fill-dark-blue",title:e.$t("eventdetails.email.tooltip"),href:n.emailHref},t[11]||(t[11]=[v("img",{class:"block",src:"/images/mail.svg"},null,-1)]),8,CU),v("div",{class:"g-plusone","data-size":"medium","data-href":n.appUrl},null,8,AU)])])])]),t[13]||(t[13]=v("div",{class:"animation-element move-background duration-[1.5s] absolute z-0 bottom-10 md:bottom-auto md:top-48 -right-14 md:-right-40 w-28 md:w-72 h-28 md:h-72 bg-[#FFEF99] rounded-full hidden lg:block",style:{transform:"translate(-16px, -24px)"}},null,-1)),t[14]||(t[14]=v("div",{class:"animation-element move-background duration-[1.5s] absolute z-0 lg:top-96 right-40 w-28 h-28 hidden lg:block bg-[#FFEF99] rounded-full",style:{transform:"translate(-16px, -24px)"}},null,-1))])}const OU=vt(kH,[["render",EU]]),MU=()=>{const e=new URLSearchParams(window.location.search);console.log("urlParams",e);const t=fe({});for(const[r,s]of e)t.value[r]=s;return{queryParams:t,onChangeQueryParams:r=>{const s=Bn.cloneDeep(r);console.log(">>> params",s);const a=new URLSearchParams(window.location.search);for(const u in s){const c=s[u];typeof c=="number"?Bn.isNil(c)?a.delete(u):a.set(u,c):Bn.isEmpty(c)?a.delete(u):a.set(u,c)}t.value=s;const o=a.toString()?`${window.location.pathname}?${a.toString()}`:window.location.pathname;window.history.replaceState({},"",o)}}},RU={name:"SearchPageComponent",components:{EventCard:Lw,Pagination:dd,FieldWrapper:od,SelectField:Fo,InputField:ud},props:{mapTileUrl:String,prpQuery:String,prpSelectedCountry:Array,name:String,years:Array,countrieslist:Array,audienceslist:Array,themeslist:Array,typeslist:Array,languagesObject:{type:Object,default:()=>({})}},setup(e){const{activityFormatOptions:t,activityTypeOptions:n,ageOptions:r}=Hi(),{queryParams:s,onChangeQueryParams:a}=MU(),o=fe(!0),u=fe(null),c=fe(null),h=fe(null),f=fe([]),p=fe({}),m=fe(null),y={query:e.prpQuery||"",languages:[],countries:[],start_date:"",formats:[],types:[],audiences:[],ages:[],themes:[],year:{id:new Date().getFullYear(),name:new Date().getFullYear()},countries:e.prpSelectedCountry||[]},_=fe({...y}),b=fe({current_page:1,per_page:0,from:null,last_page:0,last_page_url:null,next_page_url:null,prev_page:null,prev_page_url:null,to:null,total:0}),A=pe(()=>e.years.map(Y=>({id:Y,name:Y}))),H=pe(()=>Object.entries(e.languagesObject).map(([Y,me])=>({id:Y,name:me}))),V=pe(()=>(e.countrieslist||[]).map(Y=>({...Y,name:Y.translation&&String(Y.translation).trim()?Y.translation:Y.name})).sort((Y,me)=>Y.name.localeCompare(me.name,void 0,{sensitivity:"base"}))),x=()=>{var me,Ae,Pe,q,re,O,ne,_e;const Y={page:b.value.current_page,query:_.value.query,year:(me=_.value.year)==null?void 0:me.id,start_date:_.value.start_date,languages:(Ae=_.value.languages)==null?void 0:Ae.map(j=>j.id).join(","),countries:(Pe=_.value.countries)==null?void 0:Pe.map(j=>j.iso).join(","),formats:(q=_.value.formats)==null?void 0:q.map(j=>j.id).join(","),types:(re=_.value.types)==null?void 0:re.map(j=>j.id).join(","),audiences:(O=_.value.audiences)==null?void 0:O.map(j=>j.id).join(","),ages:(ne=_.value.ages)==null?void 0:ne.map(j=>j.id).join(","),themes:(_e=_.value.themes)==null?void 0:_e.map(j=>j.id).join(",")};console.log("updatedParams",Y),a(Y)},E=()=>{const Y=s.value;console.log("init params",Y);const me=(Ae,Pe,q="id")=>(Ae||"").split(",").map(re=>Pe.find(O=>String(O[q])===String(re))).filter(re=>!!re);Y.page&&(b.value.current_page=Y.page),_.value={...y,query:Y.query||"",start_date:Y.start_date||"",year:Y.year?{id:Y.year,name:Y.year}:y.year,languages:me(Y.languages,H.value),countries:me(Y.countries,V.value,"iso"),formats:me(Y.formats,t.value),types:me(Y.types,n.value),audiences:me(Y.audiences,e.audienceslist),ages:me(Y.ages,r.value),themes:me(Y.themes,e.themeslist)}},B=pe(()=>{const Y=[..._.value.languages,..._.value.countries,..._.value.formats,..._.value.types,..._.value.audiences,..._.value.ages,..._.value.themes];return _.value.start_date&&Y.push({id:"start_date",name:_.value.start_date.slice(0,10)}),Y}),U=Y=>{if(Y.id==="start_date"){_.value.start_date="";return}const me=Ae=>Ae.id!==Y.id;_.value.languages=_.value.languages.filter(me),_.value.countries=_.value.countries.filter(Ae=>Ae.iso!==Y.iso),_.value.formats=_.value.formats.filter(me),_.value.audiences=_.value.audiences.filter(me),_.value.themes=_.value.themes.filter(me),F()},$=()=>{_.value={...y},F()},M=()=>{window.scrollTo(0,0)},S=()=>{M(),F(!0)},F=(Y=!1)=>{var Pe;f.value=[],o.value=!0;let me="/search";Y&&(me=`/search?page=${b.value.current_page}`),x();const Ae={..._.value,year:(Pe=_.value.year)==null?void 0:Pe.id,start_date:_.value.start_date?new Date(_.value.start_date).toISOString().slice(0,10):"",pagination:{current_page:b.current_page}};Tt.post(me,Ae).then(q=>{const re=q.data;console.log("🔥 Full response:",re);let O,ne;if(Array.isArray(re))O=re[0],ne=re[1]||null;else if(re.events)O=re.events,ne=re.map||null;else{console.warn("❌ Unexpected response structure:",re),m.value="Unexpected response format from server.",o.value=!1;return}b.value={per_page:O.per_page,current_page:O.current_page,from:O.from,last_page:O.last_page,last_page_url:O.last_page_url,next_page_url:O.next_page_url,prev_page:O.prev_page,prev_page_url:O.prev_page_url,to:O.to,total:O.total},O.data?f.value=Array.isArray(O.data)?O.data:Object.values(O.data):f.value=[],console.log("✅ Events loaded:",f.value.length),!Y&&ne?(window.getEvents?window.getEvents(ne):window.eventsToMap=ne,p.value=ne,te()):ne||console.warn("⚠️ mapData is null, skipping map update"),ie(),o.value=!1}).catch(q=>{console.error("❌ Request failed:",q),m.value=q.response?q.response.data:"Unknown error",o.value=!1})},ie=()=>{var me;if(!c.value)return;let Y={latitude:51,longitude:4};if(((me=_.value.countries)==null?void 0:me.length)===1){const{latitude:Ae,longitude:Pe}=_.value.countries[0]||{};Ae&&Pe&&(Y={latitude:Ae,longitude:Pe,zoom:4})}c.value.setView(new L.LatLng(Y.latitude,Y.longitude),4,{animation:!0})},ee=Y=>Y.length>400?Y.substring(0,400)+"...":Y;var de=async Y=>{const me=Y.target.options.id;try{const{data:Ae}=await Tt.get(`/api/event/detail?id=${me}`),Pe=Ae.data;console.log("event/detail",Pe);const q=`