@qratilabs/qrati-connect 2.8.0 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/element/BYUKR-E7.js +1 -0
- package/element/CS_11SIt.js +1 -0
- package/element/{nSrWCryV.js → CcQBfXBZ.js} +3 -3
- package/element/{BDQCQkX_.js → CpQsvHTX.js} +1 -1
- package/element/{C8NFfssj.js → Iz_T2O-5.js} +2 -2
- package/element/NLCtVOsK.js +1 -0
- package/element/web.es.js +2 -2
- package/package.json +1 -1
- package/react/{u07nHbMK.js → 8wZBDRWe.js} +1 -1
- package/react/B6z3ifcO.js +1 -0
- package/react/BK-Th6NY.js +1 -0
- package/react/Bb2iDZ1p.js +1 -0
- package/react/BnGBrZlU.js +1 -0
- package/react/{CIEA9OWd.js → CeR0kSft.js} +1 -1
- package/react/Cu4v-rqS.js +1 -0
- package/react/{-Gc1XJZE.js → D-1o-2C0.js} +2 -2
- package/react/DKx9EV67.js +1 -0
- package/react/DvaUOLqe.js +1 -0
- package/react/{C72dPYhQ.js → F4EaFenB.js} +3 -3
- package/react/{CjSSZsql.js → MHmBPkBq.js} +1 -1
- package/react/index.cjs +1 -1
- package/react/index.mjs +2 -2
- package/umd/web.umd.js +1 -1
- package/element/BVN_VOhG.js +0 -1
- package/element/DQu7AGsF.js +0 -1
- package/element/hkAPI6mV.js +0 -1
- package/react/BHul_-9n.js +0 -1
- package/react/BfMBYO4b.js +0 -1
- package/react/CX7kEcm7.js +0 -1
- package/react/Ca2GW-tU.js +0 -1
- package/react/CbCxF_PL.js +0 -1
- package/react/CzkP4JdG.js +0 -1
- package/react/D3gIYCSb.js +0 -1
- /package/element/{Ccwm5LwS.js → CqWvjfKA.js} +0 -0
- /package/element/{DMDEuqn7.js → DHsBzJ-x.js} +0 -0
- /package/element/{Bajer8z8.js → DsQr_vB4.js} +0 -0
- /package/react/{DvZVbBR7.js → BXOAVvhC.js} +0 -0
- /package/react/{bYucjLbl.js → BeV2ILRt.js} +0 -0
- /package/react/{C83WiqkM.js → C-ZaLJv-.js} +0 -0
- /package/react/{BxS4S1Bm.js → COCwvQDi.js} +0 -0
- /package/react/{DFgDBn6O.js → Dr4BZwRl.js} +0 -0
- /package/react/{DYyT8DeU.js → fLndMErv.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# [2.8.0](https://github.com/qrati-labs/qrati-connect-ts/compare/v2.7.3...v2.8.0) (2026-04-01)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* (Task [#871](https://github.com/qrati-labs/qrati-connect-ts/issues/871)) add folderId to EventData type and update ContentsPage to display full path ([0d4ec62](https://github.com/qrati-labs/qrati-connect-ts/commit/0d4ec6256408904713e1042b8062caf7c3f0cce3))
|
|
7
|
+
* correct import name for Iconify component and simplify conditional rendering in PublicEventsPage ([098360f](https://github.com/qrati-labs/qrati-connect-ts/commit/098360f589c971f0bfe4532f1b1b781054a303b7))
|
|
8
|
+
* enhance font handling by adding proxy URL builders and updating font CSS retrieval ([f8e4713](https://github.com/qrati-labs/qrati-connect-ts/commit/f8e4713a32b2804a244d1a3b8591e8a5223e2af0))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* add EventPreviewCard component and integrate with map views, enhancing event display and navigation ([36e366a](https://github.com/qrati-labs/qrati-connect-ts/commit/36e366abf4615273353d08cda43954d45990aa8a))
|
|
14
|
+
* implement EventPreviewCard component and integrate with map views for enhanced event display ([ffad1b1](https://github.com/qrati-labs/qrati-connect-ts/commit/ffad1b130bbf81743497d5573630e6209d95d8b4))
|
|
15
|
+
|
|
1
16
|
## [2.7.3](https://github.com/qrati-labs/qrati-connect-ts/compare/v2.7.2...v2.7.3) (2026-03-30)
|
|
2
17
|
|
|
3
18
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./2R3GoXB1.js";import{B as t,j as r,r as n,v as o,z as i}from"./EgsEX4Mk.js";import"./Dqtdp5CD.js";import{t as a}from"./CcQBfXBZ.js";var s=(e,r,i)=>{t(/* @__PURE__ */o(n,{children:/* @__PURE__ */o(a,{event:e,onExplore:i})}),r)},l=({events:t,apiKey:n,is3D:a,onExplore:l,logoUrl:c})=>{const d=r(null),u=r(null),p=r(a);return i(()=>{if(!d.current||u.current)return;let r;return(async()=>{const o=(await import("./DHsBzJ-x.js").then(t=>/* @__PURE__ */e(t.default,1))).default;if(!document.querySelector("link[data-qrati-maplibre-css]")){const e=document.createElement("link");e.rel="stylesheet",e.href="https://unpkg.com/maplibre-gl@5.21.0/dist/maplibre-gl.css",e.setAttribute("data-qrati-maplibre-css",""),document.head.appendChild(e)}if(!d.current)return;const i=new o.Map({container:d.current,style:`https://api.maptiler.com/maps/streets-v2/style.json?key=${n}`,center:[0,20],zoom:4,minZoom:2,pitch:0,bearing:0,projection:p.current?{type:"globe"}:{type:"mercator"},canvasContextAttributes:{antialias:!0}});u.current=i,i.on("load",()=>{const e=i.getStyle()?.layers??[];let r,n;for(const t of e){const e=t;"symbol"===e.type&&e.layout?.["text-field"]&&!r&&(r=t.id),"building"!==e["source-layer"]||n||(n=e.source)}n&&!i.getLayer("3d-buildings")&&i.addLayer({id:"3d-buildings",source:n,"source-layer":"building",filter:["has","render_height"],type:"fill-extrusion",minzoom:14,paint:{"fill-extrusion-color":["interpolate",["linear"],["get","render_height"],0,"lightgray",200,"royalblue",400,"lightblue"],"fill-extrusion-height":["interpolate",["linear"],["zoom"],14,0,15,["get","render_height"]],"fill-extrusion-base":["case",["has","render_min_height"],["get","render_min_height"],0],"fill-extrusion-opacity":.6}},r);const a=t.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);if(0===a.length)return;const d=new o.LngLatBounds;for(const t of a){const e=t.location.x,r=t.location.y;d.extend([e,r]);const n=document.createElement("div");if(n.className="qrati-map-marker",n.style.cssText="\n width: 36px; height: 36px; cursor: pointer;\n background: var(--primary, #ff4800);\n border-radius: 50% 50% 50% 0;\n transform: rotate(-45deg);\n border: 2px solid white;\n box-shadow: 0 2px 8px rgba(0,0,0,0.3);\n display: flex; align-items: center; justify-content: center; overflow: hidden;\n ",c){const e=document.createElement("img");e.src=c,e.style.cssText="width: 24px; height: 24px; border-radius: 50%; object-fit: cover; transform: rotate(45deg);",n.appendChild(e)}const a=document.createElement("div");s(t,a,l);const u=new o.Popup({closeButton:!0,closeOnClick:!1,maxWidth:"none",offset:[0,-34]}).setDOMContent(a);new o.Marker({element:n}).setLngLat([e,r]).setPopup(u).addTo(i)}d.isEmpty()||i.fitBounds(d,{padding:{top:60,bottom:60,left:60,right:60},maxZoom:14,animate:!0,duration:1200})}),r=()=>{i.remove(),u.current=null}})(),()=>{r?.()}},[n]),i(()=>{u.current&&(p.current=a,u.current.setProjection(a?{type:"globe"}:{type:"mercator"}),u.current.easeTo({pitch:0,bearing:0,duration:600}))},[a]),/* @__PURE__ */o("div",{ref:d,class:"size-full"})};export{l as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./2R3GoXB1.js";import{B as t,j as n,r,v as o,z as i}from"./EgsEX4Mk.js";import{t as s}from"./Bf4EqlE2.js";import{t as a}from"./BPMOttLj.js";import"./Dqtdp5CD.js";import{t as l}from"./CcQBfXBZ.js";var c=new a,d=(e,n,i)=>{t(/* @__PURE__ */o(s,{client:c,children:/* @__PURE__ */o(r,{children:/* @__PURE__ */o(l,{event:e,onExplore:i})})}),n)},u=({events:t,onExplore:r,apiKey:s,is3D:a,logoUrl:l})=>{const c=n(null),u=n(null),m=n(a);return i(()=>{if(!c.current||u.current)return;let n;return(async()=>{const o=(await import("./CqWvjfKA.js").then(t=>/* @__PURE__ */e(t.default,1))).default;if(!document.querySelector("link[data-qrati-mapbox-css]")){const e=document.createElement("link");e.rel="stylesheet",e.href="https://unpkg.com/mapbox-gl@3.20.0/dist/mapbox-gl.css",e.setAttribute("data-qrati-mapbox-css",""),document.head.appendChild(e)}if(!c.current)return;o.accessToken=s;const i=new o.Map({container:c.current,style:"mapbox://styles/mapbox/streets-v12",center:[0,20],zoom:4,minZoom:2,pitch:m.current?60:0,bearing:m.current?-20:0,antialias:!0});u.current=i,i.on("style.load",()=>{i.getLayer("3d-buildings")||i.addLayer({id:"3d-buildings",source:"composite","source-layer":"building",filter:["==","extrude","true"],type:"fill-extrusion",minzoom:14,paint:{"fill-extrusion-color":"#aaa","fill-extrusion-height":["interpolate",["linear"],["zoom"],14,0,14.05,["get","height"]],"fill-extrusion-base":["interpolate",["linear"],["zoom"],14,0,14.05,["get","min_height"]],"fill-extrusion-opacity":.6}})}),i.on("load",()=>{const e=t.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);if(0===e.length)return;const n=new o.LngLatBounds;for(const t of e){const e=t.location.x,s=t.location.y;n.extend([e,s]);const a=document.createElement("div");if(a.style.cssText="\n width: 36px; height: 36px; cursor: pointer;\n background: var(--primary, #ff4800);\n border-radius: 50% 50% 50% 0;\n transform: rotate(-45deg);\n border: 2px solid white;\n box-shadow: 0 2px 8px rgba(0,0,0,0.3);\n display: flex; align-items: center; justify-content: center; overflow: hidden;\n ",l){const e=document.createElement("img");e.src=l,e.style.cssText="width: 24px; height: 24px; border-radius: 50%; object-fit: cover; transform: rotate(45deg);",a.appendChild(e)}const c=document.createElement("div");d(t,c,r);const u=new o.Popup({closeButton:!0,closeOnClick:!1,maxWidth:"none",offset:[0,-20]}).setDOMContent(c);new o.Marker({element:a}).setLngLat([e,s]).setPopup(u).addTo(i)}n.isEmpty()||i.fitBounds(n,{padding:60,maxZoom:14,duration:1200})}),n=()=>{i.remove(),u.current=null}})(),()=>{n?.()}},[s]),i(()=>{u.current&&(m.current=a,u.current.easeTo({pitch:a?60:0,bearing:a?-20:0,duration:800}))},[a]),/* @__PURE__ */o("div",{ref:c,class:"size-full"})};export{u as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{G as e,P as t,f as l,v as a,z as n}from"./EgsEX4Mk.js";import{t as r}from"./Dqtdp5CD.js";var s=()=>/* @__PURE__ */a("svg",{className:"size-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:/* @__PURE__ */a("path",{d:"m15 18-6-6 6-6"})}),i=()=>/* @__PURE__ */a("svg",{className:"size-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:/* @__PURE__ */a("path",{d:"m9 18 6-6-6-6"})});function o({items:r,autoplayInterval:o=3e3,showControls:c=!1,className:d}){const[u,m]=t(0);return n(()=>{if(r.length<=1)return;const e=setInterval(()=>m(e=>(e+1)%r.length),o);return()=>clearInterval(e)},[r.length,o]),0===r.length?null:/* @__PURE__ */a("div",{className:l("relative size-full overflow-hidden",d),children:[r.map((e,t)=>/* @__PURE__ */a("div",{className:l("absolute inset-0 transition-opacity duration-500",t===u?"opacity-100":"opacity-0"),children:e},t)),r.length>1&&/* @__PURE__ */a("div",{className:"absolute bottom-2 left-1/2 z-10 flex -translate-x-1/2 gap-1",children:r.map((e,t)=>/* @__PURE__ */a("button",{onClick:()=>m(t),className:l("h-1.5 rounded-full transition-all",t===u?"w-4 bg-white":"w-1.5 bg-white/50 hover:bg-white/75"),"aria-label":`Go to slide ${t+1}`},t))}),c&&r.length>1&&/* @__PURE__ */a(e,{children:[/* @__PURE__ */a("button",{onClick:()=>m(e=>0===e?r.length-1:e-1),className:"absolute top-1/2 left-2 z-10 flex size-8 -translate-y-1/2 items-center justify-center rounded-full bg-black/40 text-white hover:bg-black/60","aria-label":"Previous",children:/* @__PURE__ */a(s,{})}),/* @__PURE__ */a("button",{onClick:()=>m(e=>(e+1)%r.length),className:"absolute top-1/2 right-2 z-10 flex size-8 -translate-y-1/2 items-center justify-center rounded-full bg-black/40 text-white hover:bg-black/60","aria-label":"Next",children:/* @__PURE__ */a(i,{})})]})]})}var c=({event:e,onExplore:t})=>/* @__PURE__ */a("div",{className:"
|
|
1
|
+
import{G as e,P as t,f as l,v as a,z as n}from"./EgsEX4Mk.js";import{t as r}from"./Dqtdp5CD.js";var s=()=>/* @__PURE__ */a("svg",{className:"size-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:/* @__PURE__ */a("path",{d:"m15 18-6-6 6-6"})}),i=()=>/* @__PURE__ */a("svg",{className:"size-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:/* @__PURE__ */a("path",{d:"m9 18 6-6-6-6"})});function o({items:r,autoplayInterval:o=3e3,showControls:c=!1,className:d}){const[u,m]=t(0);return n(()=>{if(r.length<=1)return;const e=setInterval(()=>m(e=>(e+1)%r.length),o);return()=>clearInterval(e)},[r.length,o]),0===r.length?null:/* @__PURE__ */a("div",{className:l("relative size-full overflow-hidden",d),children:[r.map((e,t)=>/* @__PURE__ */a("div",{className:l("absolute inset-0 transition-opacity duration-500",t===u?"opacity-100":"opacity-0"),children:e},t)),r.length>1&&/* @__PURE__ */a("div",{className:"absolute bottom-2 left-1/2 z-10 flex -translate-x-1/2 gap-1",children:r.map((e,t)=>/* @__PURE__ */a("button",{onClick:()=>m(t),className:l("h-1.5 rounded-full transition-all",t===u?"w-4 bg-white":"w-1.5 bg-white/50 hover:bg-white/75"),"aria-label":`Go to slide ${t+1}`},t))}),c&&r.length>1&&/* @__PURE__ */a(e,{children:[/* @__PURE__ */a("button",{onClick:()=>m(e=>0===e?r.length-1:e-1),className:"absolute top-1/2 left-2 z-10 flex size-8 -translate-y-1/2 items-center justify-center rounded-full bg-black/40 text-white hover:bg-black/60","aria-label":"Previous",children:/* @__PURE__ */a(s,{})}),/* @__PURE__ */a("button",{onClick:()=>m(e=>(e+1)%r.length),className:"absolute top-1/2 right-2 z-10 flex size-8 -translate-y-1/2 items-center justify-center rounded-full bg-black/40 text-white hover:bg-black/60","aria-label":"Next",children:/* @__PURE__ */a(i,{})})]})]})}var c=({event:e,onExplore:t})=>/* @__PURE__ */a("div",{className:"w-40 rounded pt-2 pl-1",children:[
|
|
2
2
|
/* @__PURE__ */a("div",{className:"h-32 w-full overflow-hidden rounded",children:/* @__PURE__ */a(o,{items:(e.contents||[]).map(t=>/* @__PURE__ */a(r,{alt:e.name,src:t.thumbnailUrl||t.url,containerClassName:"size-full",imgClassName:"rounded"},t._id)),autoplayInterval:3e3})}),
|
|
3
|
-
/* @__PURE__ */a("div",{className:"line-clamp-2 pt-2 pb-0.5 text-sm font-medium",children:e.name}),
|
|
4
|
-
/* @__PURE__ */a("div",{className:"
|
|
3
|
+
/* @__PURE__ */a("div",{className:"line-clamp-2 pt-2 pb-0.5 text-sm font-medium text-black",children:e.name}),
|
|
4
|
+
/* @__PURE__ */a("div",{className:"pb-2 text-xs text-gray-600",children:e.location?.label}),
|
|
5
5
|
/* @__PURE__ */a("button",{type:"button",onClick:()=>t?.(e.slug||""),className:"bg-primary text-primary-foreground flex w-full items-center justify-center rounded py-1",children:"Explore"})]});export{c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e,j as n,r as t,v as r,z as o}from"./EgsEX4Mk.js";import"./Dqtdp5CD.js";import{t as a}from"./
|
|
1
|
+
import{B as e,j as n,r as t,v as r,z as o}from"./EgsEX4Mk.js";import"./Dqtdp5CD.js";import{t as a}from"./CcQBfXBZ.js";var i=(n,o,i)=>{e(/* @__PURE__ */r(t,{children:/* @__PURE__ */r(a,{event:n,onExplore:i})}),o)},s=({events:e,apiKey:t,onExplore:a,logoUrl:s})=>{const l=n(null),c=n(null);return o(()=>{if(l.current&&!c.current)return(async()=>{const{setOptions:n,importLibrary:r}=await import("./DSjmSa7l.js");n({key:t,v:"weekly"}),await Promise.all([r("maps"),r("marker")]);const o=window.google.maps;if(!l.current)return;const d=new o.Map(l.current,{mapId:"DEMO_MAP_ID",renderingType:"VECTOR",mapTypeId:"roadmap",center:{lat:20,lng:0},zoom:2,mapTypeControl:!1,streetViewControl:!1});o.event.addListenerOnce(d,"idle",()=>{d.getRenderingType?.()!==o.RenderingType?.VECTOR&&console.warn("Google Maps fell back to raster rendering; globe view is unavailable in raster mode.")}),c.current=d;const p=e.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);if(0===p.length)return;const m=new o.LatLngBounds,u=new o.InfoWindow({maxWidth:200});for(const e of p){const n=e.location.x,t={lat:e.location.y,lng:n};m.extend(t);const r=document.createElement("div");if(r.style.cssText="\n width: 36px; height: 36px; cursor: pointer;\n background: var(--primary, #ff4800);\n border-radius: 50% 50% 50% 0;\n transform: rotate(-45deg);\n border: 2px solid white;\n box-shadow: 0 2px 8px rgba(0,0,0,0.3);\n display: flex; align-items: center; justify-content: center; overflow: hidden;\n ",s){const e=document.createElement("img");e.src=s,e.style.cssText="width: 24px; height: 24px; border-radius: 50%; object-fit: cover; transform: rotate(45deg);",r.appendChild(e)}const l=new o.marker.AdvancedMarkerElement({map:d,position:t,content:r,gmpClickable:!0});l.addListener("click",()=>{const n=document.createElement("div");i(e,n,a),u.close(),u.setContent(n),u.open(d,l)})}d.fitBounds(m)})(),()=>{c.current=null}},[t]),/* @__PURE__ */r("div",{ref:l,class:"size-full"})};export{s as default};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{A as e,u as t,v as r,w as o}from"./EgsEX4Mk.js";import{T as s,n as
|
|
1
|
+
import{A as e,u as t,v as r,w as o}from"./EgsEX4Mk.js";import{T as s,n as i}from"./ZsvY3_BP.js";var l=e(()=>import("./NLCtVOsK.js")),n=e(()=>import("./BYUKR-E7.js")),a=e(()=>import("./CpQsvHTX.js")),c=e(()=>import("./CS_11SIt.js")),p=({events:e,isLoading:p=!1})=>{const{organization:d}=i(),m=t(),g=d?.integrationSettings??{},x=g.mapProvider??"openstreetmap",u=g.mapTilerApiKey??"",f=g.googleMapsApiKey??"",h=g.mapboxApiKey??"",v=e.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y),y="openstreetmap"===x&&!u||"google"===x&&!f||"mapbox"===x&&!h,w=e=>{m(s.GALLERY(e))};/* @__PURE__ */
|
|
2
2
|
return r("div",{class:"w relative mt-3 h-screen sm:mt-6",children:p?/* @__PURE__ */r("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */r("div",{class:"border-primary bt-transparent size-8 animate-spin rounded-full"})}):y?/* @__PURE__ */r("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */r("div",{class:"text-center",children:[
|
|
3
3
|
/* @__PURE__ */r("svg",{xmlns:"http://www.w3.org/2000/svg",class:"text-muted-foreground mx-auto mb-3 size-10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",children:[/* @__PURE__ */r("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z"}),/* @__PURE__ */r("circle",{cx:"12",cy:"9",r:"2.5"})]}),
|
|
4
4
|
/* @__PURE__ */r("p",{class:"text-foreground",children:"Map API Key Required"}),
|
|
5
5
|
/* @__PURE__ */r("p",{class:"text-muted-foreground mt-1 text-xs",children:"Configure your map provider API key in the integration settings."})]})}):0===v.length?/* @__PURE__ */r("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */r("div",{class:"text-center",children:[
|
|
6
6
|
/* @__PURE__ */r("svg",{xmlns:"http://www.w3.org/2000/svg",class:"text-muted-foreground mx-auto mb-3 size-10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",children:[/* @__PURE__ */r("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z"}),/* @__PURE__ */r("circle",{cx:"12",cy:"9",r:"2.5"})]}),
|
|
7
7
|
/* @__PURE__ */r("p",{class:"text-foreground tex",children:"No events with location data"}),
|
|
8
|
-
/* @__PURE__ */r("p",{class:"text-muted-foreground mt-1 text-xs",children:"Events need a location to appear on the map."})]})}):/* @__PURE__ */r(o,{fallback:/* @__PURE__ */r("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */r("div",{class:"border-primary rounde size-8 animate-spin border-t-transparent"})}),children:["openstreetmap_free"===x&&/* @__PURE__ */r(
|
|
8
|
+
/* @__PURE__ */r("p",{class:"text-muted-foreground mt-1 text-xs",children:"Events need a location to appear on the map."})]})}):/* @__PURE__ */r(o,{fallback:/* @__PURE__ */r("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */r("div",{class:"border-primary rounde size-8 animate-spin border-t-transparent"})}),children:["openstreetmap_free"===x&&/* @__PURE__ */r(l,{events:v,onExplore:w,logoUrl:d?.logoUrl}),"openstreetmap"===x&&/* @__PURE__ */r(n,{is3D:!0,events:v,apiKey:u,onExplore:w,logoUrl:d?.logoUrl}),"mapbox"===x&&/* @__PURE__ */r(c,{events:v,onExplore:w,apiKey:h,is3D:!1,logoUrl:d?.logoUrl}),"google"===x&&/* @__PURE__ */r(a,{events:v,apiKey:f,onExplore:w,logoUrl:d?.logoUrl})]})})};export{p as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t}from"./2R3GoXB1.js";import{B as e,j as r,r as o,v as n,z as a}from"./EgsEX4Mk.js";import{t as i}from"./Bf4EqlE2.js";import{t as s}from"./BPMOttLj.js";import"./Dqtdp5CD.js";import{t as l}from"./CcQBfXBZ.js";var c=new s,d=(t,r,a)=>{e(/* @__PURE__ */n(i,{client:c,children:/* @__PURE__ */n(o,{children:/* @__PURE__ */n(l,{event:t,onExplore:a})})}),r)},p=({events:e,onExplore:o,logoUrl:i})=>{const s=r(null),l=r(null);return a(()=>{if(!s.current||l.current)return;let r;return(async()=>{const n=await import("./ZShDCNL_.js").then(e=>/* @__PURE__ */t(e.default,1));if(!document.querySelector("link[data-qrati-leaflet-css]")){const t=document.createElement("link");t.rel="stylesheet",t.href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css",t.setAttribute("data-qrati-leaflet-css",""),document.head.appendChild(t)}if(!s.current)return;const a=n.map(s.current,{center:[20,0],zoom:2,zoomControl:!0,worldCopyJump:!0});n.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap contributors",maxZoom:19}).addTo(a),l.current=a;const c=e.filter(t=>"number"==typeof t.location?.x&&"number"==typeof t.location?.y);if(c.length>0){const t=n.latLngBounds([]);for(const e of c){const r=e.location.x,s=e.location.y;t.extend([s,r]);const l=n.divIcon({className:"qrati-leaflet-marker-wrapper",html:`\n <div style="\n width: 36px;\n height: 36px;\n cursor: pointer;\n background: var(--primary, #6366f1);\n border-radius: 50% 50% 50% 0;\n transform: rotate(-45deg);\n border: 2px solid white;\n box-shadow: 0 2px 8px rgba(0,0,0,0.3);\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n ">${i?`<img src="${i}" style="width: 24px; height: 24px; border-radius: 50%; object-fit: cover; transform: rotate(45deg);" />`:""}</div>\n `,iconSize:[36,36],iconAnchor:[18,36],popupAnchor:[0,-36]}),c=n.marker([s,r],{icon:l}).addTo(a),p=document.createElement("div");p.style.width="fit-content",d(e,p,o),c.bindPopup(p,{closeButton:!0,maxWidth:256})}t.isValid()&&a.fitBounds(t,{padding:[60,60],maxZoom:14})}r=()=>{a.remove(),l.current=null}})(),()=>{r?.()}},[e]),/* @__PURE__ */n("div",{ref:s,class:"size-full"})};export{p as default};
|
package/element/web.es.js
CHANGED
|
@@ -84,7 +84,7 @@ return R("div",{className:"mb-3 grid grid-cols-3 md:space-y-0 md:space-x-4",chil
|
|
|
84
84
|
/* @__PURE__ */R(Xi,{placeholder:"Search by keywords",value:h,className:"py-2",onChange:e=>p(e.target.value),onKeyUp:e=>{const t=e.key;"Enter"===t?l&&l(h.length>0?h:""):"Escape"===t&&(p(""),l&&l(""))}}),h?.length>0&&/* @__PURE__ */R("button",{className:"absolute inset-y-0 right-10 flex items-center",onClick:()=>{p(""),l&&l("")},children:/* @__PURE__ */R(Ae,{name:"material-symbols:close-rounded",className:"text-foreground w-5"})}),
|
|
85
85
|
/* @__PURE__ */R("button",{className:"absolute inset-y-0 right-3 flex items-center",onClick:()=>l&&l(h),children:/* @__PURE__ */R(Ae,{name:"material-symbols:search-rounded",className:"text-foreground w-5"})})]})}),u?.integrationSettings?.showFacialSearch&&/* @__PURE__ */R(Ts,{value:g,onChange:e=>{f(e),d?.(e?URL.createObjectURL(e):void 0)}})]}),
|
|
86
86
|
/* @__PURE__ */R("div",{className:"col-span-3 md:col-span-1"}),
|
|
87
|
-
/* @__PURE__ */R("div",{className:"col-span-3 mt-3 md:col-span-1 md:mt-0 lg:justify-self-end",children:/* @__PURE__ */R($i,{engagementStyle:e,sort:a,order:i,onSortChange:o,onSortOrderChange:s})})]})},Os=e=>e?.meta?.currentPage<e?.meta?.totalPages?e.meta.currentPage+1:void 0,Ds=r(()=>import("./
|
|
87
|
+
/* @__PURE__ */R("div",{className:"col-span-3 mt-3 md:col-span-1 md:mt-0 lg:justify-self-end",children:/* @__PURE__ */R($i,{engagementStyle:e,sort:a,order:i,onSortChange:o,onSortOrderChange:s})})]})},Os=e=>e?.meta?.currentPage<e?.meta?.totalPages?e.meta.currentPage+1:void 0,Ds=r(()=>import("./DsQr_vB4.js")),Us=()=>{const e=x().eventSlug,{loadingUser:t,organization:r,folders:n}=ce(),a=U(),[o,s]=m(""),[l,c]=m(void 0),[d,h]=m(J),[p,g]=m(pe),[f,v]=m("undefined"!=typeof window&&window.innerWidth<768?re.SINGLE:re.GRID),w=S(null),{event:b,ads:_}=Be({eventSlug:e}),{loading:y,contentsWithAds:k,hasNextPage:E,fetchNextPage:M,isFetchingNextPage:A}=(({event:e,ads:t=[],sort:r=J,order:n=pe,keywords:a,face:o,limit:i=20,includeSummary:s=!1})=>{const{props:l,loadingUser:c,user:d}=ce(),h=l?.organizationId,{isLoading:p,data:m,hasNextPage:g,fetchNextPage:f,isFetchingNextPage:v}=function(e){return G(e,Oe,void 0)}({queryKey:[H.CONTENTS_BY_EVENT(e?._id??""),r,n,a,o],queryFn:async({pageParam:t=1})=>{try{return await oe.get(se.GET_CONTENTS,{searchParams:{eventId:e?._id,page:t,keywords:a,faceImageUrl:o,sort:`${B[n].sortOrder}${te[r].sortField}`,limit:i,includeSummary:s},headers:{"x-org-id":h,Authorization:d?`Bearer ${d.token}`:void 0}}).json()}catch(l){throw new Error(l instanceof Error?l.message:String(l)||"Failed to fetch contents")}},enabled:!c&&!!e,initialPageParam:1,getPreviousPageParam:e=>(e=>e?.meta?.currentPage>1?e.meta.currentPage-1:void 0)(e),getNextPageParam:Os}),w=u(()=>m?.pages?.flatMap(e=>e?.data??[])??[],[m]);return{contents:w,contentsWithAds:u(()=>((e=[],t=[],r)=>{if(!r||r<=0)return e;let n=0;const a=[];for(let o=0;o<(e?.length||0);o++)a.push(e[o]),t.length>0&&r>0&&(o+1)%r===0&&(a.push({...t[n],type:le.AD,adType:t[n].type}),n=(n+1)%t.length);return a})(w,t,e?.adPosition),[w,t,e?.adPosition]),loading:p,hasNextPage:g,fetchNextPage:f,isFetchingNextPage:v}})({event:b,ads:_,sort:d,order:p,keywords:o,face:l,includeSummary:r?.navigationSettings?.showAIDescription}),{incrementEventView:L}=Re(),{start:N,initializing:I,running:P}=(({ref:e,onBottomReached:t,hasNextPage:r,fetchNextPage:n,isFetchingNextPage:a})=>{const o=S(1),i=S(null),s=S(null),l=S(null),[c,d]=m(!1),[u,h]=m(!1);D(()=>(c&&(s.current&&window.clearTimeout(s.current),s.current=window.setTimeout(()=>{i.current=window.requestAnimationFrame(p)},300)),()=>{i.current&&window.cancelAnimationFrame(i.current)}),[c,r,a,n,t]);const p=()=>{e.current&&(e.current.scrollTop+=o.current,r&&!a&&n&&e.current.scrollTop+e.current.clientHeight>=.5*e.current.scrollHeight&&n(),e.current.scrollTop+e.current.clientHeight>=e.current.scrollHeight?(d(!1),i.current&&window.cancelAnimationFrame(i.current),s.current=window.setTimeout(()=>{h(!0),t?.(),s.current=window.setTimeout(()=>{e.current&&(e.current.scrollTop=0),h(!1),d(!0)},1e3)},1e3)):i.current=window.requestAnimationFrame(p))},g=e=>{"+"===e.key&&(o.current=Math.min(o.current+1,10)),"-"===e.key&&(o.current=Math.max(o.current-1,1))},f=()=>{document.fullscreenElement||(null!==l.current?l.current.release().then(()=>(l.current=null,!0)).catch(e=>console.error(`Failed to release wake lock: ${e instanceof Error?e.message:String(e)}`)):console.error("No Wake Lock to release."),d(!1),h(!1),e.current&&(e.current.scrollTop=0),i.current&&window.cancelAnimationFrame(i.current),s.current&&window.clearTimeout(s.current),document.removeEventListener("keydown",g),document.removeEventListener("fullscreenchange",f))};return{start:()=>{if(e?.current?.requestFullscreen)e.current.requestFullscreen();else{const t=e.current;t?.webkitRequestFullscreen?t.webkitRequestFullscreen():t?.mozRequestFullScreen?t.mozRequestFullScreen():t?.msRequestFullscreen&&t.msRequestFullscreen()}(async()=>{try{"wakeLock"in navigator?(l.current=await navigator.wakeLock.request("screen"),document.addEventListener("visibilitychange",async()=>{null!==l.current&&"visible"===document.visibilityState&&(l.current=await navigator.wakeLock.request("screen"))})):console.error("Wake Lock API is not supported in this browser.")}catch(pd){console.error(`Failed to acquire wake lock: ${pd instanceof Error?pd.message:String(pd)}`)}})(),d(!0),document.addEventListener("keydown",g),document.addEventListener("fullscreenchange",f)},initializing:u,running:c}})({ref:w,hasNextPage:E,fetchNextPage:M,isFetchingNextPage:A,onBottomReached:()=>b?._id&&a.refetchQueries({queryKey:[H.CONTENTS_BY_EVENT(b._id)]})});D(()=>{b?.slug&&L(b.slug)},[b]);const T=u(()=>f===re.SINGLE,[f]),z=u(()=>/* @__PURE__ */R(Gi,{event:b,onAutoscrollClick:N}),[b?.galleryLayout,N]),O=S(null),j=S(null);return D(()=>(O.current&&O.current.disconnect(),O.current=new IntersectionObserver(e=>{e[0].isIntersecting&&E&&!A&&!y&&M()},{rootMargin:"200px"}),j.current&&O.current.observe(j.current),()=>{O.current&&O.current.disconnect()}),[E,A,y,M]),/* @__PURE__ */R("div",{className:"bg-background mx-auto min-h-[80vh]",children:[
|
|
88
88
|
/* @__PURE__ */R("div",{className:`flex flex-row ${b?.folderId&&r.integrationSettings?.showFullPath?"w-full justify-between":"justify-end"} gap-4 pt-2`,children:[b?.folderId&&r.integrationSettings?.showFullPath&&/* @__PURE__ */R("div",{className:"pl-8",children:/* @__PURE__ */R(Qi,{homeLink:Y.PUBLIC_EVENTS,data:Zi(n,b?.folderId)})}),z]}),
|
|
89
89
|
/* @__PURE__ */R("div",{className:"pb-2",children:/* @__PURE__ */R(Qe,{})}),
|
|
90
90
|
/* @__PURE__ */R(Fs,{engagementStyle:b?.engagementStyle,disabled:t||y,mode:f,onModeChange:e=>v(e),sort:d,sortOrder:p,onSortChange:e=>h(e),onSortOrderChange:()=>g("asc"===p?"desc":"asc"),handleChange:s,face:l,onFaceImageChange:e=>c(e)}),l&&/* @__PURE__ */R("div",{className:"flex gap-4 py-2",children:[/* @__PURE__ */R("div",{className:"space-y-2",children:[/* @__PURE__ */R(Ce,{variant:"h4",children:"Searching using"}),/* @__PURE__ */R("img",{src:l,alt:"face",className:"h-32 rounded"})]}),/* @__PURE__ */R("div",{className:"flex flex-col justify-end gap-2",children:/* @__PURE__ */R(Ie,{color:"error",iconName:"material-symbols:close-rounded",onClick:()=>c(void 0),children:"Clear search"})})]}),t||y?/* @__PURE__ */R("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3",children:Array.from({length:8}).map((e,t)=>/* @__PURE__ */R(De,{className:"h-72"},t))}):k?.length<=0?/* @__PURE__ */R("div",{className:"my-16 flex flex-col items-center gap-4",children:/* @__PURE__ */R(We,{title:"No Contents",description:"Check back soon for amazing contents.",iconSvg:/* @__PURE__ */R("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-full",width:"800",height:"469.317",viewBox:"0 0 800 469.317",role:"img",children:/* @__PURE__ */R("g",{transform:"translate(-443.142 -257.876)",children:[
|
|
@@ -259,7 +259,7 @@ return R("div",{className:"space-y-4",children:[e===p[0]&&/* @__PURE__ */R(Ce,{v
|
|
|
259
259
|
/* @__PURE__ */R("div",{className:"grid grid-cols-1 gap-4 gap-y-6 sm:grid-cols-2 lg:grid-cols-3",children:r.map(e=>/* @__PURE__ */R(C,{event:e},e._id))})]},`event-folder-${e}`)}):p.map(e=>{const r=y(e),n=f[e]||[],a=n.reduce((e,t)=>e+(t.contents?.length||0),0);/* @__PURE__ */
|
|
260
260
|
return R("div",{className:"space-y-4",children:[e===p[0]&&t&&/* @__PURE__ */R("div",{className:"mb-8 flex items-center gap-2",children:[/* @__PURE__ */R(Ce,{variant:"body1",className:"bg-primary/20 text-primary rounded px-2 py-1",children:t}),/* @__PURE__ */R("button",{type:"button","aria-label":"Clear search",className:"text-muted hover:text-primary",onClick:c,children:"×"})]}),e===p[0]&&/* @__PURE__ */R(Ce,{variant:"h3",className:"mb-4",children:["Contents (",h?.totalContentCount||u.length,") by Event (",h?.totalEventCount||g.length,")"]}),
|
|
261
261
|
/* @__PURE__ */R("div",{className:"flex items-center justify-between gap-3",children:[/* @__PURE__ */R("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */R("span",{className:"inline-block size-2 rounded-full",style:{backgroundColor:r.color||"#9ca3af"}}),/* @__PURE__ */R(Ce,{variant:"h5",className:"text-sm sm:text-base",children:r.pathLabel})]}),/* @__PURE__ */R(Ce,{variant:"body2",color:"muted",children:[a," media"]})]}),
|
|
262
|
-
/* @__PURE__ */R("div",{className:"space-y-6",children:n.map(e=>/* @__PURE__ */R("div",{className:"space-y-3",children:[/* @__PURE__ */R(C,{event:e.event}),/* @__PURE__ */R("div",{className:"grid grid-cols-3 gap-2",children:e.contents.slice(0,6).map(t=>/* @__PURE__ */R("button",{type:"button",className:"block overflow-hidden rounded",onClick:()=>_(e.event._id,t._id),children:/* @__PURE__ */R("img",{src:t.thumbnailUrl||t.url,alt:"Content preview",className:"w-full object-cover"})},t._id))})]},`content-event-${e.event._id}`))})]},`content-folder-${e}`)})),i&&o&&!a&&/* @__PURE__ */R("div",{className:"flex justify-center pt-2",children:/* @__PURE__ */R("button",{type:"button",disabled:n,className:"bg-primary text-primary-foreground disabled:bg-muted rounded px-4 py-2 text-sm font-medium disabled:cursor-not-allowed",onClick:l,children:n?"Loading...":"Load more"})})]})},mc=r(()=>import("./
|
|
262
|
+
/* @__PURE__ */R("div",{className:"space-y-6",children:n.map(e=>/* @__PURE__ */R("div",{className:"space-y-3",children:[/* @__PURE__ */R(C,{event:e.event}),/* @__PURE__ */R("div",{className:"grid grid-cols-3 gap-2",children:e.contents.slice(0,6).map(t=>/* @__PURE__ */R("button",{type:"button",className:"block overflow-hidden rounded",onClick:()=>_(e.event._id,t._id),children:/* @__PURE__ */R("img",{src:t.thumbnailUrl||t.url,alt:"Content preview",className:"w-full object-cover"})},t._id))})]},`content-event-${e.event._id}`))})]},`content-folder-${e}`)})),i&&o&&!a&&/* @__PURE__ */R("div",{className:"flex justify-center pt-2",children:/* @__PURE__ */R("button",{type:"button",disabled:n,className:"bg-primary text-primary-foreground disabled:bg-muted rounded px-4 py-2 text-sm font-medium disabled:cursor-not-allowed",onClick:l,children:n?"Loading...":"Load more"})})]})},mc=r(()=>import("./Iz_T2O-5.js")),gc={grid:{icon:/* @__PURE__ */R("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-full text-inherit",width:24,height:24,viewBox:"0 0 24 24",children:/* @__PURE__ */R("path",{fill:"currentColor",d:"M5 11q-.825 0-1.412-.587T3 9V5q0-.825.588-1.412T5 3h4q.825 0 1.413.588T11 5v4q0 .825-.587 1.413T9 11zm0 10q-.825 0-1.412-.587T3 19v-4q0-.825.588-1.412T5 13h4q.825 0 1.413.588T11 15v4q0 .825-.587 1.413T9 21zm10-10q-.825 0-1.412-.587T13 9V5q0-.825.588-1.412T15 3h4q.825 0 1.413.588T21 5v4q0 .825-.587 1.413T19 11zm0 10q-.825 0-1.412-.587T13 19v-4q0-.825.588-1.412T15 13h4q.825 0 1.413.588T21 15v4q0 .825-.587 1.413T19 21zM5 9h4V5H5zm10 0h4V5h-4zm0 10h4v-4h-4zM5 19h4v-4H5zM9 9"})})},map:{icon:/* @__PURE__ */R("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-full text-inherit",width:24,height:24,viewBox:"0 0 24 24",children:/* @__PURE__ */R("path",{fill:"currentColor",d:"M14.35 20.775L9 18.9l-4.65 1.8q-.25.1-.488.063t-.437-.163t-.312-.337T3 19.775V5.75q0-.325.188-.575T3.7 4.8l4.65-1.575q.15-.05.313-.075T9 3.125t.338.025t.312.075L15 5.1l4.65-1.8q.25-.1.488-.062t.437.162t.313.338t.112.487V18.25q0 .325-.187.575t-.513.375l-4.65 1.575q-.15.05-.312.075t-.338.025t-.337-.025t-.313-.075M14 18.55V6.85l-4-1.4v11.7zm2 0l3-1V5.7l-3 1.15zM5 18.3l3-1.15V5.45l-3 1zM16 6.85v11.7zm-8-1.4v11.7z"})})}},fc=Object.keys(gc).map(e=>({icon:gc[e].icon,value:e})),vc=()=>{const e=x().folderId??"",t=ce(),{folders:r,organization:n}=t,a=t.props?.organizationId,o=!1!==n?.integrationSettings?.enableGlobalSearch,s=((e,t)=>{const[r,n]=m(""),[a,o]=m("event"),[i,s]=m(1),[l,c]=m(!1),[d,h]=m(""),[p,g]=m(!1),[f,v]=m([]),[w,b]=m([]),[_,y]=m(null),x=S(0),C=S(null),k=S(null),E=u(()=>`org-inline-search-gallery-${e||"default"}`,[e]);D(()=>{if(!e||!r)return;const t=++x.current;(async()=>{c(!0),h("");try{const n="event"===a?se.SEARCH_EVENTS:se.SEARCH_CONTENTS,o=await oe.get(n,{headers:{"x-org-id":e},searchParams:{query:r,page:String(i),limit:"event"===a?"12":"8"}}).json();if(t!==x.current)return;const s=o?.data||[],l=o?.meta?.totalPages||0;g((o?.meta?.currentPage||0)<l),"event"===a?v(e=>1===i?s:[...e,...s]):(y({totalContentCount:o?.meta?.totalContentCount,totalEventCount:o?.meta?.totalEventCount}),b(e=>1===i?s:[...e,...s]))}catch(n){if(t!==x.current)return;h(n?.message||"Failed to search")}finally{t===x.current&&c(!1)}})()},[e,i,r,a]);const M=u(()=>{const e={};return f.forEach(t=>{const r=t.folderId||"root";e[r]||(e[r]=[]),e[r].push(t)}),Object.values(e).forEach(e=>{e.sort((e,t)=>(e.name||"").localeCompare(t.name||"",void 0,{sensitivity:"base"}))}),e},[f]),A=u(()=>{const e=/* @__PURE__ */new Map,t=/* @__PURE__ */new Set;return w.forEach(r=>{if(!r?._id||t.has(r._id))return;t.add(r._id);const n=r.event?._id||r.eventId;n&&r.event&&(e.has(n)||e.set(n,{event:r.event,contents:[]}),e.get(n)?.contents.push({_id:r._id,thumbnailUrl:r.thumbnailUrl,url:r.url,caption:r.event?.name,type:"image"}))}),Array.from(e.values()).sort((e,t)=>(e.event?.name||"").localeCompare(t.event?.name||"",void 0,{sensitivity:"base"}))},[w]),L=u(()=>{const e={};return A.forEach(t=>{const r=t.event?.folderId||"root";e[r]||(e[r]=[]),e[r].push(t)}),e},[A]),N=u(()=>{const e=Object.keys("event"===a?M:L);return e.sort((e,r)=>{if("root"===e)return-1;if("root"===r)return 1;const n=Zi(t,e).map(e=>e.name).join("/"),a=Zi(t,r).map(e=>e.name).join("/");return n.localeCompare(a)}),e},[L,M,t,a]),I=u(()=>{if("content"!==a)return[];const e=[];return N.forEach(t=>{(L[t]||[]).forEach(t=>{t.contents.forEach(r=>{e.push({event:t.event,content:r})})})}),e},[N,L,a]);return D(()=>{const e=k.current;if("content"!==a||!r||0===I.length||!e)return C.current?.destroy?.(),void(C.current=null);const t=new Le({gallery:e,children:"a.pswp-item",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:ze});return C.current=t,t.init(),()=>{C.current?.destroy?.(),C.current=null}},[I.length,E,r,a]),{handleSearch:(e,t)=>{s(1),h(""),g(!1),v([]),b([]),y(null),o(t),n(e)},clearSearch:()=>{n(""),h(""),g(!1),s(1),v([]),b([]),y(null)},isSearchActive:r.length>0,submittedQuery:r,submittedSearchType:a,isLoading:l,errorMessage:d,hasMore:p,page:i,setPage:s,eventResults:f,contentResults:w,contentMeta:_,activeFolderKeys:N,eventGroupsByFolder:M,contentGroups:A,contentGroupsByFolder:L,flattenedContentMedia:I,lightboxRef:C,galleryElementRef:k,galleryId:E,openMediaInLightbox:(e,t)=>{if(!C.current?.loadAndOpen)return;const r=I.findIndex(r=>r.event._id===e&&r.content._id===t);r>=0&&C.current.loadAndOpen(r)}}})(a,r||[]),l=!0===n?.integrationSettings?.enableMapView,[c,d]=m(()=>{try{return sessionStorage.getItem("qrati-view-mode")||"grid"}catch{return"grid"}}),{data:h,isLoading:p}=V({queryKey:[`public-events-map-${a}`,e||"all-folders"],enabled:l&&"map"===c,staleTime:3e5,queryFn:async()=>{const t=e.length>0?{folderId:e,limit:500,sort:"-views"}:{includeAllFolders:"true",limit:500,sort:"-views",contentLimit:3};return(await oe.get(se.PUBLIC_EVENTS,{headers:{"x-org-id":a},searchParams:t}).json()).data}}),g=u(()=>{if("undefined"==typeof window)return null;if(window.history.state?.internalNavigation)return null;try{const e=new URLSearchParams(window.location?.search??"");let t=e.get("event"),r=e.get("page");if(!t&&!r&&window.location?.hash){const e=window.location.hash.split("?");if(e.length>1){const n=new URLSearchParams(e[1]);t=n.get("event"),r=n.get("page")}}if(t){if(r)switch(r.toLowerCase()){case"upload":return Y.UPLOAD(t);case"curate":return Y.CURATE(t);case"leaderboard":return Y.LEADERBOARD(t);default:return Y.GALLERY(t)}return Y.GALLERY(t)}}catch(pd){console.error("Error parsing URL parameters:",pd)}return null},[]),f=(r??[]).filter(t=>t.parentFolderId===(e?.length>0?e:null)||t.parentFolderId===(e?.length>0?e:void 0)),{isLoading:v,data:w}=V({queryKey:[`public-events-${a}`,e],queryFn:async()=>(await oe.get(se.PUBLIC_EVENTS,{headers:{"x-org-id":a},searchParams:{folderId:e,sort:"-createdAt"}}).json()).data});return g?/* @__PURE__ */R(_,{to:g,replace:!0}):/* @__PURE__ */R(i,v||!n?{children:[n?.navigationSettings?.enableNavbar&&/* @__PURE__ */R(qe,{}),/* @__PURE__ */R("div",{className:"min-h-screen w-full",children:[
|
|
263
263
|
/* @__PURE__ */R(uc,{organization:n}),
|
|
264
264
|
/* @__PURE__ */R("div",{className:"mt-4 grid grid-cols-2 gap-3 md:grid-cols-3 lg:grid-cols-4 lg:gap-6",children:Array.from({length:4}).map((e,t)=>/* @__PURE__ */R(De,{className:"h-24 rounded"},`folder-${t}`))}),
|
|
265
265
|
/* @__PURE__ */R("div",{className:"mt-4 grid grid-cols-1 gap-4 sm:grid-cols-3",children:Array.from({length:6}).map((e,t)=>/* @__PURE__ */R("div",{className:"space-y-4",children:[/* @__PURE__ */R(De,{className:"h-72 overflow-hidden rounded sm:h-80"}),/* @__PURE__ */R(De,{className:"h-6 w-64 rounded"})]},t))})]})]}:{children:[n?.navigationSettings?.enableNavbar&&/* @__PURE__ */R(qe,{}),
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as e,E as n,r as t,v as r,y as o}from"./5Kn_YMsi.js";import"./2j0Uva3f.js";import{t as a}from"./
|
|
1
|
+
import{D as e,E as n,r as t,v as r,y as o}from"./5Kn_YMsi.js";import"./2j0Uva3f.js";import{t as a}from"./F4EaFenB.js";var i=(n,o,i)=>{e(/* @__PURE__ */r(t,{children:/* @__PURE__ */r(a,{event:n,onExplore:i})}),o)},s=({events:e,apiKey:t,onExplore:a,logoUrl:s})=>{const l=o(null),c=o(null);return n(()=>{if(l.current&&!c.current)return(async()=>{const{setOptions:n,importLibrary:r}=await import("./DV8H8PH6.js");n({key:t,v:"weekly"}),await Promise.all([r("maps"),r("marker")]);const o=window.google.maps;if(!l.current)return;const d=new o.Map(l.current,{mapId:"DEMO_MAP_ID",renderingType:"VECTOR",mapTypeId:"roadmap",center:{lat:20,lng:0},zoom:2,mapTypeControl:!1,streetViewControl:!1});o.event.addListenerOnce(d,"idle",()=>{d.getRenderingType?.()!==o.RenderingType?.VECTOR&&console.warn("Google Maps fell back to raster rendering; globe view is unavailable in raster mode.")}),c.current=d;const p=e.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);if(0===p.length)return;const m=new o.LatLngBounds,u=new o.InfoWindow({maxWidth:200});for(const e of p){const n=e.location.x,t={lat:e.location.y,lng:n};m.extend(t);const r=document.createElement("div");if(r.style.cssText="\n width: 36px; height: 36px; cursor: pointer;\n background: var(--primary, #ff4800);\n border-radius: 50% 50% 50% 0;\n transform: rotate(-45deg);\n border: 2px solid white;\n box-shadow: 0 2px 8px rgba(0,0,0,0.3);\n display: flex; align-items: center; justify-content: center; overflow: hidden;\n ",s){const e=document.createElement("img");e.src=s,e.style.cssText="width: 24px; height: 24px; border-radius: 50%; object-fit: cover; transform: rotate(45deg);",r.appendChild(e)}const l=new o.marker.AdvancedMarkerElement({map:d,position:t,content:r,gmpClickable:!0});l.addListener("click",()=>{const n=document.createElement("div");i(e,n,a),u.close(),u.setContent(n),u.open(d,l)})}d.fitBounds(m)})(),()=>{c.current=null}},[t]),/* @__PURE__ */r("div",{ref:l,class:"size-full"})};export{s as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./DqRj45SJ.js";import{D as t,E as n,r,v as o,y as i}from"./5Kn_YMsi.js";import{t as s}from"./BOcElY6J.js";import{t as a}from"./B_X6sOg3.js";import"./2j0Uva3f.js";import{t as l}from"./F4EaFenB.js";var c=new a,d=(e,n,i)=>{t(/* @__PURE__ */o(s,{client:c,children:/* @__PURE__ */o(r,{children:/* @__PURE__ */o(l,{event:e,onExplore:i})})}),n)},u=({events:t,onExplore:r,apiKey:s,is3D:a,logoUrl:l})=>{const c=i(null),u=i(null),m=i(a);return n(()=>{if(!c.current||u.current)return;let n;return(async()=>{const o=(await import("./fLndMErv.js").then(t=>/* @__PURE__ */e(t.default,1))).default;if(!document.querySelector("link[data-qrati-mapbox-css]")){const e=document.createElement("link");e.rel="stylesheet",e.href="https://unpkg.com/mapbox-gl@3.20.0/dist/mapbox-gl.css",e.setAttribute("data-qrati-mapbox-css",""),document.head.appendChild(e)}if(!c.current)return;o.accessToken=s;const i=new o.Map({container:c.current,style:"mapbox://styles/mapbox/streets-v12",center:[0,20],zoom:4,minZoom:2,pitch:m.current?60:0,bearing:m.current?-20:0,antialias:!0});u.current=i,i.on("style.load",()=>{i.getLayer("3d-buildings")||i.addLayer({id:"3d-buildings",source:"composite","source-layer":"building",filter:["==","extrude","true"],type:"fill-extrusion",minzoom:14,paint:{"fill-extrusion-color":"#aaa","fill-extrusion-height":["interpolate",["linear"],["zoom"],14,0,14.05,["get","height"]],"fill-extrusion-base":["interpolate",["linear"],["zoom"],14,0,14.05,["get","min_height"]],"fill-extrusion-opacity":.6}})}),i.on("load",()=>{const e=t.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);if(0===e.length)return;const n=new o.LngLatBounds;for(const t of e){const e=t.location.x,s=t.location.y;n.extend([e,s]);const a=document.createElement("div");if(a.style.cssText="\n width: 36px; height: 36px; cursor: pointer;\n background: var(--primary, #ff4800);\n border-radius: 50% 50% 50% 0;\n transform: rotate(-45deg);\n border: 2px solid white;\n box-shadow: 0 2px 8px rgba(0,0,0,0.3);\n display: flex; align-items: center; justify-content: center; overflow: hidden;\n ",l){const e=document.createElement("img");e.src=l,e.style.cssText="width: 24px; height: 24px; border-radius: 50%; object-fit: cover; transform: rotate(45deg);",a.appendChild(e)}const c=document.createElement("div");d(t,c,r);const u=new o.Popup({closeButton:!0,closeOnClick:!1,maxWidth:"none",offset:[0,-20]}).setDOMContent(c);new o.Marker({element:a}).setLngLat([e,s]).setPopup(u).addTo(i)}n.isEmpty()||i.fitBounds(n,{padding:60,maxZoom:14,duration:1200})}),n=()=>{i.remove(),u.current=null}})(),()=>{n?.()}},[s]),n(()=>{u.current&&(m.current=a,u.current.easeTo({pitch:a?60:0,bearing:a?-20:0,duration:800}))},[a]),/* @__PURE__ */o("div",{ref:c,class:"size-full"})};export{u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./DqRj45SJ.js";import{D as t,E as r,r as n,v as o,y as i}from"./5Kn_YMsi.js";import"./2j0Uva3f.js";import{t as a}from"./F4EaFenB.js";var s=(e,r,i)=>{t(/* @__PURE__ */o(n,{children:/* @__PURE__ */o(a,{event:e,onExplore:i})}),r)},l=({events:t,apiKey:n,is3D:a,onExplore:l,logoUrl:c})=>{const d=i(null),u=i(null),p=i(a);return r(()=>{if(!d.current||u.current)return;let r;return(async()=>{const o=(await import("./BXOAVvhC.js").then(t=>/* @__PURE__ */e(t.default,1))).default;if(!document.querySelector("link[data-qrati-maplibre-css]")){const e=document.createElement("link");e.rel="stylesheet",e.href="https://unpkg.com/maplibre-gl@5.21.0/dist/maplibre-gl.css",e.setAttribute("data-qrati-maplibre-css",""),document.head.appendChild(e)}if(!d.current)return;const i=new o.Map({container:d.current,style:`https://api.maptiler.com/maps/streets-v2/style.json?key=${n}`,center:[0,20],zoom:4,minZoom:2,pitch:0,bearing:0,projection:p.current?{type:"globe"}:{type:"mercator"},canvasContextAttributes:{antialias:!0}});u.current=i,i.on("load",()=>{const e=i.getStyle()?.layers??[];let r,n;for(const t of e){const e=t;"symbol"===e.type&&e.layout?.["text-field"]&&!r&&(r=t.id),"building"!==e["source-layer"]||n||(n=e.source)}n&&!i.getLayer("3d-buildings")&&i.addLayer({id:"3d-buildings",source:n,"source-layer":"building",filter:["has","render_height"],type:"fill-extrusion",minzoom:14,paint:{"fill-extrusion-color":["interpolate",["linear"],["get","render_height"],0,"lightgray",200,"royalblue",400,"lightblue"],"fill-extrusion-height":["interpolate",["linear"],["zoom"],14,0,15,["get","render_height"]],"fill-extrusion-base":["case",["has","render_min_height"],["get","render_min_height"],0],"fill-extrusion-opacity":.6}},r);const a=t.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);if(0===a.length)return;const d=new o.LngLatBounds;for(const t of a){const e=t.location.x,r=t.location.y;d.extend([e,r]);const n=document.createElement("div");if(n.className="qrati-map-marker",n.style.cssText="\n width: 36px; height: 36px; cursor: pointer;\n background: var(--primary, #ff4800);\n border-radius: 50% 50% 50% 0;\n transform: rotate(-45deg);\n border: 2px solid white;\n box-shadow: 0 2px 8px rgba(0,0,0,0.3);\n display: flex; align-items: center; justify-content: center; overflow: hidden;\n ",c){const e=document.createElement("img");e.src=c,e.style.cssText="width: 24px; height: 24px; border-radius: 50%; object-fit: cover; transform: rotate(45deg);",n.appendChild(e)}const a=document.createElement("div");s(t,a,l);const u=new o.Popup({closeButton:!0,closeOnClick:!1,maxWidth:"none",offset:[0,-34]}).setDOMContent(a);new o.Marker({element:n}).setLngLat([e,r]).setPopup(u).addTo(i)}d.isEmpty()||i.fitBounds(d,{padding:{top:60,bottom:60,left:60,right:60},maxZoom:14,animate:!0,duration:1200})}),r=()=>{i.remove(),u.current=null}})(),()=>{r?.()}},[n]),r(()=>{u.current&&(p.current=a,u.current.setProjection(a?{type:"globe"}:{type:"mercator"}),u.current.easeTo({pitch:0,bearing:0,duration:600}))},[a]),/* @__PURE__ */o("div",{ref:d,class:"size-full"})};export{l as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./D4geS7mP.js"),t=require("./BMpF19BV.js");require("./COOPnhZa.js");const r=require("./DvaUOLqe.js");var n=(e,n,o)=>{t.J(t.u(t.MemoryRouter,{children:t.u(r.EventPreviewCard,{event:e,onExplore:o})}),n)};exports.default=({events:r,apiKey:o,is3D:i,onExplore:s,logoUrl:a})=>{const l=t.A(null),c=t.A(null),u=t.A(i);return t.y(()=>{if(!l.current||c.current)return;let t;return(async()=>{const i=(await Promise.resolve().then(()=>e.__toESM(require("./BeV2ILRt.js").default,1))).default;if(!document.querySelector("link[data-qrati-maplibre-css]")){const e=document.createElement("link");e.rel="stylesheet",e.href="https://unpkg.com/maplibre-gl@5.21.0/dist/maplibre-gl.css",e.setAttribute("data-qrati-maplibre-css",""),document.head.appendChild(e)}if(!l.current)return;const d=new i.Map({container:l.current,style:`https://api.maptiler.com/maps/streets-v2/style.json?key=${o}`,center:[0,20],zoom:4,minZoom:2,pitch:0,bearing:0,projection:u.current?{type:"globe"}:{type:"mercator"},canvasContextAttributes:{antialias:!0}});c.current=d,d.on("load",()=>{const e=d.getStyle()?.layers??[];let t,o;for(const r of e){const e=r;"symbol"===e.type&&e.layout?.["text-field"]&&!t&&(t=r.id),"building"!==e["source-layer"]||o||(o=e.source)}o&&!d.getLayer("3d-buildings")&&d.addLayer({id:"3d-buildings",source:o,"source-layer":"building",filter:["has","render_height"],type:"fill-extrusion",minzoom:14,paint:{"fill-extrusion-color":["interpolate",["linear"],["get","render_height"],0,"lightgray",200,"royalblue",400,"lightblue"],"fill-extrusion-height":["interpolate",["linear"],["zoom"],14,0,15,["get","render_height"]],"fill-extrusion-base":["case",["has","render_min_height"],["get","render_min_height"],0],"fill-extrusion-opacity":.6}},t);const l=r.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);if(0===l.length)return;const c=new i.LngLatBounds;for(const r of l){const e=r.location.x,t=r.location.y;c.extend([e,t]);const o=document.createElement("div");if(o.className="qrati-map-marker",o.style.cssText="\n width: 36px; height: 36px; cursor: pointer;\n background: var(--primary, #ff4800);\n border-radius: 50% 50% 50% 0;\n transform: rotate(-45deg);\n border: 2px solid white;\n box-shadow: 0 2px 8px rgba(0,0,0,0.3);\n display: flex; align-items: center; justify-content: center; overflow: hidden;\n ",a){const e=document.createElement("img");e.src=a,e.style.cssText="width: 24px; height: 24px; border-radius: 50%; object-fit: cover; transform: rotate(45deg);",o.appendChild(e)}const l=document.createElement("div");n(r,l,s);const u=new i.Popup({closeButton:!0,closeOnClick:!1,maxWidth:"none",offset:[0,-34]}).setDOMContent(l);new i.Marker({element:o}).setLngLat([e,t]).setPopup(u).addTo(d)}c.isEmpty()||d.fitBounds(c,{padding:{top:60,bottom:60,left:60,right:60},maxZoom:14,animate:!0,duration:1200})}),t=()=>{d.remove(),c.current=null}})(),()=>{t?.()}},[o]),t.y(()=>{c.current&&(u.current=i,c.current.setProjection(i?{type:"globe"}:{type:"mercator"}),c.current.easeTo({pitch:0,bearing:0,duration:600}))},[i]),t.u("div",{ref:l,class:"size-full"})};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./D4geS7mP.js"),t=require("./BMpF19BV.js"),r=require("./BW8JB9yA.js"),n=require("./CrKuU6G6.js");require("./COOPnhZa.js");const o=require("./DvaUOLqe.js");var i=new n.QueryClient,s=(e,n,s)=>{t.J(t.u(r.QueryClientProvider,{client:i,children:t.u(t.MemoryRouter,{children:t.u(o.EventPreviewCard,{event:e,onExplore:s})})}),n)};exports.default=({events:r,onExplore:n,apiKey:o,is3D:i,logoUrl:a})=>{const l=t.A(null),c=t.A(null),u=t.A(i);return t.y(()=>{if(!l.current||c.current)return;let t;return(async()=>{const i=(await Promise.resolve().then(()=>e.__toESM(require("./COCwvQDi.js").default,1))).default;if(!document.querySelector("link[data-qrati-mapbox-css]")){const e=document.createElement("link");e.rel="stylesheet",e.href="https://unpkg.com/mapbox-gl@3.20.0/dist/mapbox-gl.css",e.setAttribute("data-qrati-mapbox-css",""),document.head.appendChild(e)}if(!l.current)return;i.accessToken=o;const d=new i.Map({container:l.current,style:"mapbox://styles/mapbox/streets-v12",center:[0,20],zoom:4,minZoom:2,pitch:u.current?60:0,bearing:u.current?-20:0,antialias:!0});c.current=d,d.on("style.load",()=>{d.getLayer("3d-buildings")||d.addLayer({id:"3d-buildings",source:"composite","source-layer":"building",filter:["==","extrude","true"],type:"fill-extrusion",minzoom:14,paint:{"fill-extrusion-color":"#aaa","fill-extrusion-height":["interpolate",["linear"],["zoom"],14,0,14.05,["get","height"]],"fill-extrusion-base":["interpolate",["linear"],["zoom"],14,0,14.05,["get","min_height"]],"fill-extrusion-opacity":.6}})}),d.on("load",()=>{const e=r.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);if(0===e.length)return;const t=new i.LngLatBounds;for(const r of e){const e=r.location.x,o=r.location.y;t.extend([e,o]);const l=document.createElement("div");if(l.style.cssText="\n width: 36px; height: 36px; cursor: pointer;\n background: var(--primary, #ff4800);\n border-radius: 50% 50% 50% 0;\n transform: rotate(-45deg);\n border: 2px solid white;\n box-shadow: 0 2px 8px rgba(0,0,0,0.3);\n display: flex; align-items: center; justify-content: center; overflow: hidden;\n ",a){const e=document.createElement("img");e.src=a,e.style.cssText="width: 24px; height: 24px; border-radius: 50%; object-fit: cover; transform: rotate(45deg);",l.appendChild(e)}const c=document.createElement("div");s(r,c,n);const u=new i.Popup({closeButton:!0,closeOnClick:!1,maxWidth:"none",offset:[0,-20]}).setDOMContent(c);new i.Marker({element:l}).setLngLat([e,o]).setPopup(u).addTo(d)}t.isEmpty()||d.fitBounds(t,{padding:60,maxZoom:14,duration:1200})}),t=()=>{d.remove(),c.current=null}})(),()=>{t?.()}},[o]),t.y(()=>{c.current&&(u.current=i,c.current.easeTo({pitch:i?60:0,bearing:i?-20:0,duration:800}))},[i]),t.u("div",{ref:l,class:"size-full"})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./BMpF19BV.js"),r=require("./DEk8rfah.js");var t=r.z(()=>Promise.resolve().then(()=>require("./
|
|
1
|
+
const e=require("./BMpF19BV.js"),r=require("./DEk8rfah.js");var t=r.z(()=>Promise.resolve().then(()=>require("./DKx9EV67.js"))),o=r.z(()=>Promise.resolve().then(()=>require("./Bb2iDZ1p.js"))),s=r.z(()=>Promise.resolve().then(()=>require("./MHmBPkBq.js"))),i=r.z(()=>Promise.resolve().then(()=>require("./BnGBrZlU.js")));exports.default=({events:n,isLoading:l=!1})=>{const{organization:a}=r.useSession(),u=e.useNavigate(),c=a?.integrationSettings??{},d=c.mapProvider??"openstreetmap",p=c.mapTilerApiKey??"",m=c.googleMapsApiKey??"",g=c.mapboxApiKey??"",h=n.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y),x="openstreetmap"===d&&!p||"google"===d&&!m||"mapbox"===d&&!g,v=e=>{u(r.PAGE_ROUTES.GALLERY(e))};return e.u("div",{class:"w relative mt-3 h-screen sm:mt-6",children:l?e.u("div",{class:"flex h-full items-center justify-center",children:e.u("div",{class:"border-primary bt-transparent size-8 animate-spin rounded-full"})}):x?e.u("div",{class:"flex h-full items-center justify-center",children:e.u("div",{class:"text-center",children:[e.u("svg",{xmlns:"http://www.w3.org/2000/svg",class:"text-muted-foreground mx-auto mb-3 size-10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",children:[e.u("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z"}),e.u("circle",{cx:"12",cy:"9",r:"2.5"})]}),e.u("p",{class:"text-foreground",children:"Map API Key Required"}),e.u("p",{class:"text-muted-foreground mt-1 text-xs",children:"Configure your map provider API key in the integration settings."})]})}):0===h.length?e.u("div",{class:"flex h-full items-center justify-center",children:e.u("div",{class:"text-center",children:[e.u("svg",{xmlns:"http://www.w3.org/2000/svg",class:"text-muted-foreground mx-auto mb-3 size-10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",children:[e.u("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z"}),e.u("circle",{cx:"12",cy:"9",r:"2.5"})]}),e.u("p",{class:"text-foreground tex",children:"No events with location data"}),e.u("p",{class:"text-muted-foreground mt-1 text-xs",children:"Events need a location to appear on the map."})]})}):e.u(r.P,{fallback:e.u("div",{class:"flex h-full items-center justify-center",children:e.u("div",{class:"border-primary rounde size-8 animate-spin border-t-transparent"})}),children:["openstreetmap_free"===d&&e.u(t,{events:h,onExplore:v,logoUrl:a?.logoUrl}),"openstreetmap"===d&&e.u(o,{is3D:!0,events:h,apiKey:p,onExplore:v,logoUrl:a?.logoUrl}),"mapbox"===d&&e.u(i,{events:h,onExplore:v,apiKey:g,is3D:!1,logoUrl:a?.logoUrl}),"google"===d&&e.u(s,{events:h,apiKey:m,onExplore:v,logoUrl:a?.logoUrl})]})})};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as t}from"./DqRj45SJ.js";import{D as e,E as r,r as o,v as n,y as a}from"./5Kn_YMsi.js";import{t as i}from"./BOcElY6J.js";import{t as s}from"./B_X6sOg3.js";import"./2j0Uva3f.js";import{t as l}from"./F4EaFenB.js";var c=new s,d=(t,r,a)=>{e(/* @__PURE__ */n(i,{client:c,children:/* @__PURE__ */n(o,{children:/* @__PURE__ */n(l,{event:t,onExplore:a})})}),r)},p=({events:e,onExplore:o,logoUrl:i})=>{const s=a(null),l=a(null);return r(()=>{if(!s.current||l.current)return;let r;return(async()=>{const n=await import("./CEEUMvOM.js").then(e=>/* @__PURE__ */t(e.default,1));if(!document.querySelector("link[data-qrati-leaflet-css]")){const t=document.createElement("link");t.rel="stylesheet",t.href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css",t.setAttribute("data-qrati-leaflet-css",""),document.head.appendChild(t)}if(!s.current)return;const a=n.map(s.current,{center:[20,0],zoom:2,zoomControl:!0,worldCopyJump:!0});n.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap contributors",maxZoom:19}).addTo(a),l.current=a;const c=e.filter(t=>"number"==typeof t.location?.x&&"number"==typeof t.location?.y);if(c.length>0){const t=n.latLngBounds([]);for(const e of c){const r=e.location.x,s=e.location.y;t.extend([s,r]);const l=n.divIcon({className:"qrati-leaflet-marker-wrapper",html:`\n <div style="\n width: 36px;\n height: 36px;\n cursor: pointer;\n background: var(--primary, #6366f1);\n border-radius: 50% 50% 50% 0;\n transform: rotate(-45deg);\n border: 2px solid white;\n box-shadow: 0 2px 8px rgba(0,0,0,0.3);\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n ">${i?`<img src="${i}" style="width: 24px; height: 24px; border-radius: 50%; object-fit: cover; transform: rotate(45deg);" />`:""}</div>\n `,iconSize:[36,36],iconAnchor:[18,36],popupAnchor:[0,-36]}),c=n.marker([s,r],{icon:l}).addTo(a),p=document.createElement("div");p.style.width="fit-content",d(e,p,o),c.bindPopup(p,{closeButton:!0,maxWidth:256})}t.isValid()&&a.fitBounds(t,{padding:[60,60],maxZoom:14})}r=()=>{a.remove(),l.current=null}})(),()=>{r?.()}},[e]),/* @__PURE__ */n("div",{ref:s,class:"size-full"})};export{p as default};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{u as e,v as t}from"./5Kn_YMsi.js";import{N as r,P as o,T as s,n as
|
|
1
|
+
import{u as e,v as t}from"./5Kn_YMsi.js";import{N as r,P as o,T as s,n as i}from"./CYLiwpjD.js";var l=o(()=>import("./Cu4v-rqS.js")),n=o(()=>import("./BK-Th6NY.js")),a=o(()=>import("./8wZBDRWe.js")),c=o(()=>import("./B6z3ifcO.js")),p=({events:o,isLoading:p=!1})=>{const{organization:d}=i(),m=e(),g=d?.integrationSettings??{},x=g.mapProvider??"openstreetmap",u=g.mapTilerApiKey??"",f=g.googleMapsApiKey??"",h=g.mapboxApiKey??"",v=o.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y),y="openstreetmap"===x&&!u||"google"===x&&!f||"mapbox"===x&&!h,w=e=>{m(s.GALLERY(e))};/* @__PURE__ */
|
|
2
2
|
return t("div",{class:"w relative mt-3 h-screen sm:mt-6",children:p?/* @__PURE__ */t("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */t("div",{class:"border-primary bt-transparent size-8 animate-spin rounded-full"})}):y?/* @__PURE__ */t("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */t("div",{class:"text-center",children:[
|
|
3
3
|
/* @__PURE__ */t("svg",{xmlns:"http://www.w3.org/2000/svg",class:"text-muted-foreground mx-auto mb-3 size-10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",children:[/* @__PURE__ */t("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z"}),/* @__PURE__ */t("circle",{cx:"12",cy:"9",r:"2.5"})]}),
|
|
4
4
|
/* @__PURE__ */t("p",{class:"text-foreground",children:"Map API Key Required"}),
|
|
5
5
|
/* @__PURE__ */t("p",{class:"text-muted-foreground mt-1 text-xs",children:"Configure your map provider API key in the integration settings."})]})}):0===v.length?/* @__PURE__ */t("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */t("div",{class:"text-center",children:[
|
|
6
6
|
/* @__PURE__ */t("svg",{xmlns:"http://www.w3.org/2000/svg",class:"text-muted-foreground mx-auto mb-3 size-10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",children:[/* @__PURE__ */t("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z"}),/* @__PURE__ */t("circle",{cx:"12",cy:"9",r:"2.5"})]}),
|
|
7
7
|
/* @__PURE__ */t("p",{class:"text-foreground tex",children:"No events with location data"}),
|
|
8
|
-
/* @__PURE__ */t("p",{class:"text-muted-foreground mt-1 text-xs",children:"Events need a location to appear on the map."})]})}):/* @__PURE__ */t(r,{fallback:/* @__PURE__ */t("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */t("div",{class:"border-primary rounde size-8 animate-spin border-t-transparent"})}),children:["openstreetmap_free"===x&&/* @__PURE__ */t(
|
|
8
|
+
/* @__PURE__ */t("p",{class:"text-muted-foreground mt-1 text-xs",children:"Events need a location to appear on the map."})]})}):/* @__PURE__ */t(r,{fallback:/* @__PURE__ */t("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */t("div",{class:"border-primary rounde size-8 animate-spin border-t-transparent"})}),children:["openstreetmap_free"===x&&/* @__PURE__ */t(l,{events:v,onExplore:w,logoUrl:d?.logoUrl}),"openstreetmap"===x&&/* @__PURE__ */t(n,{is3D:!0,events:v,apiKey:u,onExplore:w,logoUrl:d?.logoUrl}),"mapbox"===x&&/* @__PURE__ */t(c,{events:v,onExplore:w,apiKey:h,is3D:!1,logoUrl:d?.logoUrl}),"google"===x&&/* @__PURE__ */t(a,{events:v,apiKey:f,onExplore:w,logoUrl:d?.logoUrl})]})})};export{p as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./D4geS7mP.js"),t=require("./BMpF19BV.js"),r=require("./BW8JB9yA.js"),n=require("./CrKuU6G6.js");require("./COOPnhZa.js");const o=require("./DvaUOLqe.js");var i=new n.QueryClient,l=(e,n,l)=>{t.J(t.u(r.QueryClientProvider,{client:i,children:t.u(t.MemoryRouter,{children:t.u(o.EventPreviewCard,{event:e,onExplore:l})})}),n)};exports.default=({events:r,onExplore:n,logoUrl:o})=>{const i=t.A(null),s=t.A(null);return t.y(()=>{if(!i.current||s.current)return;let t;return(async()=>{const a=await Promise.resolve().then(()=>e.__toESM(require("./CCCbXwws.js").default,1));if(!document.querySelector("link[data-qrati-leaflet-css]")){const e=document.createElement("link");e.rel="stylesheet",e.href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css",e.setAttribute("data-qrati-leaflet-css",""),document.head.appendChild(e)}if(!i.current)return;const c=a.map(i.current,{center:[20,0],zoom:2,zoomControl:!0,worldCopyJump:!0});a.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap contributors",maxZoom:19}).addTo(c),s.current=c;const u=r.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);if(u.length>0){const e=a.latLngBounds([]);for(const t of u){const r=t.location.x,i=t.location.y;e.extend([i,r]);const s=a.divIcon({className:"qrati-leaflet-marker-wrapper",html:`\n <div style="\n width: 36px;\n height: 36px;\n cursor: pointer;\n background: var(--primary, #6366f1);\n border-radius: 50% 50% 50% 0;\n transform: rotate(-45deg);\n border: 2px solid white;\n box-shadow: 0 2px 8px rgba(0,0,0,0.3);\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n ">${o?`<img src="${o}" style="width: 24px; height: 24px; border-radius: 50%; object-fit: cover; transform: rotate(45deg);" />`:""}</div>\n `,iconSize:[36,36],iconAnchor:[18,36],popupAnchor:[0,-36]}),u=a.marker([i,r],{icon:s}).addTo(c),d=document.createElement("div");d.style.width="fit-content",l(t,d,n),u.bindPopup(d,{closeButton:!0,maxWidth:256})}e.isValid()&&c.fitBounds(e,{padding:[60,60],maxZoom:14})}t=()=>{c.remove(),s.current=null}})(),()=>{t?.()}},[r]),t.u("div",{ref:i,class:"size-full"})};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./BMpF19BV.js"),t=require("./COOPnhZa.js");var l=()=>e.u("svg",{className:"size-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.u("path",{d:"m15 18-6-6 6-6"})}),a=()=>e.u("svg",{className:"size-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.u("path",{d:"m9 18 6-6-6-6"})});function n({items:t,autoplayInterval:n=3e3,showControls:r=!1,className:i}){const[s,o]=e.d(0);return e.y(()=>{if(t.length<=1)return;const e=setInterval(()=>o(e=>(e+1)%t.length),n);return()=>clearInterval(e)},[t.length,n]),0===t.length?null:e.u("div",{className:e.cn("relative size-full overflow-hidden",i),children:[t.map((t,l)=>e.u("div",{className:e.cn("absolute inset-0 transition-opacity duration-500",l===s?"opacity-100":"opacity-0"),children:t},l)),t.length>1&&e.u("div",{className:"absolute bottom-2 left-1/2 z-10 flex -translate-x-1/2 gap-1",children:t.map((t,l)=>e.u("button",{onClick:()=>o(l),className:e.cn("h-1.5 rounded-full transition-all",l===s?"w-4 bg-white":"w-1.5 bg-white/50 hover:bg-white/75"),"aria-label":`Go to slide ${l+1}`},l))}),r&&t.length>1&&e.u(e.k,{children:[e.u("button",{onClick:()=>o(e=>0===e?t.length-1:e-1),className:"absolute top-1/2 left-2 z-10 flex size-8 -translate-y-1/2 items-center justify-center rounded-full bg-black/40 text-white hover:bg-black/60","aria-label":"Previous",children:e.u(l,{})}),e.u("button",{onClick:()=>o(e=>(e+1)%t.length),className:"absolute top-1/2 right-2 z-10 flex size-8 -translate-y-1/2 items-center justify-center rounded-full bg-black/40 text-white hover:bg-black/60","aria-label":"Next",children:e.u(a,{})})]})]})}var r=({event:l,onExplore:a})=>e.u("div",{className:"w-40 rounded pt-2 pl-1",children:[e.u("div",{className:"h-32 w-full overflow-hidden rounded",children:e.u(n,{items:(l.contents||[]).map(a=>e.u(t.LazyLoadImage,{alt:l.name,src:a.thumbnailUrl||a.url,containerClassName:"size-full",imgClassName:"rounded"},a._id)),autoplayInterval:3e3})}),e.u("div",{className:"line-clamp-2 pt-2 pb-0.5 text-sm font-medium text-black",children:l.name}),e.u("div",{className:"pb-2 text-xs text-gray-600",children:l.location?.label}),e.u("button",{type:"button",onClick:()=>a?.(l.slug||""),className:"bg-primary text-primary-foreground flex w-full items-center justify-center rounded py-1",children:"Explore"})]});Object.defineProperty(exports,"EventPreviewCard",{enumerable:!0,get:function(){return r}});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{E as e,M as t,S as l,f as a,v as n}from"./5Kn_YMsi.js";import{t as r}from"./2j0Uva3f.js";var s=()=>/* @__PURE__ */n("svg",{className:"size-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:/* @__PURE__ */n("path",{d:"m15 18-6-6 6-6"})}),i=()=>/* @__PURE__ */n("svg",{className:"size-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:/* @__PURE__ */n("path",{d:"m9 18 6-6-6-6"})});function o({items:r,autoplayInterval:o=3e3,showControls:c=!1,className:d}){const[u,m]=l(0);return e(()=>{if(r.length<=1)return;const e=setInterval(()=>m(e=>(e+1)%r.length),o);return()=>clearInterval(e)},[r.length,o]),0===r.length?null:/* @__PURE__ */n("div",{className:a("relative size-full overflow-hidden",d),children:[r.map((e,t)=>/* @__PURE__ */n("div",{className:a("absolute inset-0 transition-opacity duration-500",t===u?"opacity-100":"opacity-0"),children:e},t)),r.length>1&&/* @__PURE__ */n("div",{className:"absolute bottom-2 left-1/2 z-10 flex -translate-x-1/2 gap-1",children:r.map((e,t)=>/* @__PURE__ */n("button",{onClick:()=>m(t),className:a("h-1.5 rounded-full transition-all",t===u?"w-4 bg-white":"w-1.5 bg-white/50 hover:bg-white/75"),"aria-label":`Go to slide ${t+1}`},t))}),c&&r.length>1&&/* @__PURE__ */n(t,{children:[/* @__PURE__ */n("button",{onClick:()=>m(e=>0===e?r.length-1:e-1),className:"absolute top-1/2 left-2 z-10 flex size-8 -translate-y-1/2 items-center justify-center rounded-full bg-black/40 text-white hover:bg-black/60","aria-label":"Previous",children:/* @__PURE__ */n(s,{})}),/* @__PURE__ */n("button",{onClick:()=>m(e=>(e+1)%r.length),className:"absolute top-1/2 right-2 z-10 flex size-8 -translate-y-1/2 items-center justify-center rounded-full bg-black/40 text-white hover:bg-black/60","aria-label":"Next",children:/* @__PURE__ */n(i,{})})]})]})}var c=({event:e,onExplore:t})=>/* @__PURE__ */n("div",{className:"
|
|
1
|
+
import{E as e,M as t,S as l,f as a,v as n}from"./5Kn_YMsi.js";import{t as r}from"./2j0Uva3f.js";var s=()=>/* @__PURE__ */n("svg",{className:"size-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:/* @__PURE__ */n("path",{d:"m15 18-6-6 6-6"})}),i=()=>/* @__PURE__ */n("svg",{className:"size-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:/* @__PURE__ */n("path",{d:"m9 18 6-6-6-6"})});function o({items:r,autoplayInterval:o=3e3,showControls:c=!1,className:d}){const[u,m]=l(0);return e(()=>{if(r.length<=1)return;const e=setInterval(()=>m(e=>(e+1)%r.length),o);return()=>clearInterval(e)},[r.length,o]),0===r.length?null:/* @__PURE__ */n("div",{className:a("relative size-full overflow-hidden",d),children:[r.map((e,t)=>/* @__PURE__ */n("div",{className:a("absolute inset-0 transition-opacity duration-500",t===u?"opacity-100":"opacity-0"),children:e},t)),r.length>1&&/* @__PURE__ */n("div",{className:"absolute bottom-2 left-1/2 z-10 flex -translate-x-1/2 gap-1",children:r.map((e,t)=>/* @__PURE__ */n("button",{onClick:()=>m(t),className:a("h-1.5 rounded-full transition-all",t===u?"w-4 bg-white":"w-1.5 bg-white/50 hover:bg-white/75"),"aria-label":`Go to slide ${t+1}`},t))}),c&&r.length>1&&/* @__PURE__ */n(t,{children:[/* @__PURE__ */n("button",{onClick:()=>m(e=>0===e?r.length-1:e-1),className:"absolute top-1/2 left-2 z-10 flex size-8 -translate-y-1/2 items-center justify-center rounded-full bg-black/40 text-white hover:bg-black/60","aria-label":"Previous",children:/* @__PURE__ */n(s,{})}),/* @__PURE__ */n("button",{onClick:()=>m(e=>(e+1)%r.length),className:"absolute top-1/2 right-2 z-10 flex size-8 -translate-y-1/2 items-center justify-center rounded-full bg-black/40 text-white hover:bg-black/60","aria-label":"Next",children:/* @__PURE__ */n(i,{})})]})]})}var c=({event:e,onExplore:t})=>/* @__PURE__ */n("div",{className:"w-40 rounded pt-2 pl-1",children:[
|
|
2
2
|
/* @__PURE__ */n("div",{className:"h-32 w-full overflow-hidden rounded",children:/* @__PURE__ */n(o,{items:(e.contents||[]).map(t=>/* @__PURE__ */n(r,{alt:e.name,src:t.thumbnailUrl||t.url,containerClassName:"size-full",imgClassName:"rounded"},t._id)),autoplayInterval:3e3})}),
|
|
3
|
-
/* @__PURE__ */n("div",{className:"line-clamp-2 pt-2 pb-0.5 text-sm font-medium",children:e.name}),
|
|
4
|
-
/* @__PURE__ */n("div",{className:"
|
|
3
|
+
/* @__PURE__ */n("div",{className:"line-clamp-2 pt-2 pb-0.5 text-sm font-medium text-black",children:e.name}),
|
|
4
|
+
/* @__PURE__ */n("div",{className:"pb-2 text-xs text-gray-600",children:e.location?.label}),
|
|
5
5
|
/* @__PURE__ */n("button",{type:"button",onClick:()=>t?.(e.slug||""),className:"bg-primary text-primary-foreground flex w-full items-center justify-center rounded py-1",children:"Explore"})]});export{c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./BMpF19BV.js");require("./COOPnhZa.js");const n=require("./
|
|
1
|
+
const e=require("./BMpF19BV.js");require("./COOPnhZa.js");const n=require("./DvaUOLqe.js");var r=(r,t,o)=>{e.J(e.u(e.MemoryRouter,{children:e.u(n.EventPreviewCard,{event:r,onExplore:o})}),t)};exports.default=({events:n,apiKey:t,onExplore:o,logoUrl:i})=>{const a=e.A(null),s=e.A(null);return e.y(()=>{if(a.current&&!s.current)return(async()=>{const{setOptions:e,importLibrary:l}=await Promise.resolve().then(()=>require("./Bqe_56Ho.js"));e({key:t,v:"weekly"}),await Promise.all([l("maps"),l("marker")]);const c=window.google.maps;if(!a.current)return;const d=new c.Map(a.current,{mapId:"DEMO_MAP_ID",renderingType:"VECTOR",mapTypeId:"roadmap",center:{lat:20,lng:0},zoom:2,mapTypeControl:!1,streetViewControl:!1});c.event.addListenerOnce(d,"idle",()=>{d.getRenderingType?.()!==c.RenderingType?.VECTOR&&console.warn("Google Maps fell back to raster rendering; globe view is unavailable in raster mode.")}),s.current=d;const p=n.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);if(0===p.length)return;const u=new c.LatLngBounds,m=new c.InfoWindow({maxWidth:200});for(const n of p){const e=n.location.x,t={lat:n.location.y,lng:e};u.extend(t);const a=document.createElement("div");if(a.style.cssText="\n width: 36px; height: 36px; cursor: pointer;\n background: var(--primary, #ff4800);\n border-radius: 50% 50% 50% 0;\n transform: rotate(-45deg);\n border: 2px solid white;\n box-shadow: 0 2px 8px rgba(0,0,0,0.3);\n display: flex; align-items: center; justify-content: center; overflow: hidden;\n ",i){const e=document.createElement("img");e.src=i,e.style.cssText="width: 24px; height: 24px; border-radius: 50%; object-fit: cover; transform: rotate(45deg);",a.appendChild(e)}const s=new c.marker.AdvancedMarkerElement({map:d,position:t,content:a,gmpClickable:!0});s.addListener("click",()=>{const e=document.createElement("div");r(n,e,o),m.close(),m.setContent(e),m.open(d,s)})}d.fitBounds(u)})(),()=>{s.current=null}},[t]),e.u("div",{ref:a,class:"size-full"})};
|