@qratilabs/qrati-connect 2.24.2 → 2.25.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.
@@ -1,4 +1,4 @@
1
- import{D as t,E as e,T as i,_ as n,b as s,f as o,g as r,h as l,i as a,m as c,n as d,p as h,t as p,v as u,w as m,y as g}from"./DrrpB4Om.js";import{C as f,D as w,L as b,N as T,O as y,S as v,a as k,i as x,l as q,m as _,n as E,u as C,v as S}from"./CaX2xgrP.js";import{n as N,r as I,t as L}from"./dT6WSX65.js";import{t as M}from"./ChJXhA9c.js";import{t as A}from"./CATr-3VW.js";import{t as B}from"./C3dOFk9A.js";import{n as R}from"./LYboLIEU.js";import{n as V}from"./BkIDQGIs.js";import{t as z}from"./Bki5T_lb.js";import{n as F,r as O,t as P}from"./BOqkzZ92.js";import{n as H}from"./CVRTTCyF.js";import{a as D,i as U,n as $,o as j,r as W,s as G,t as K}from"./CsfDBJh72.js";import{a as Q,n as Y,o as Z,r as J,t as X}from"./DZtaQWVG2.js";function tt(t,e){const[i,n]=t;if(i===e)return t;if(void 0!==n&&void 0!==e&&void 0!==i&&e===n&&Math.abs(e-i)<=20){const s=Math.min(i,e),o=Math.max(i,e);return s===i&&o===n?t:[s,o]}return[e,i]}function et(t,e,i){const[[n],r]=s(tt,[i]),a=function(t){const[e,i]=l(t);return t===e||t&&e&&t.length===e.length&&!t.some((t,i)=>t!==e[i])?e:(i(t),t)}(e),c=o(void 0);return{containerRef:u(e=>{c.current?.disconnect(),c.current=void 0;const i=()=>r(function(t,e){let i=t?.clientWidth;if(void 0!==i&&e&&e.length>0){const t=[...e.filter(t=>t>0)].sort((t,e)=>e-t);t.push(Math.floor(t[t.length-1]/2)),i=t.find((e,n)=>e<=i||n===t.length-1)}return i}(e,a));i(),e&&"undefined"!=typeof ResizeObserver&&(c.current=new ResizeObserver(i),c.current.observe(e)),"function"==typeof t?t(e):t&&(t.current=e)},[t,a]),containerWidth:n}}function it(t){return["react-photo-album",t].filter(Boolean).join("--")}function nt({width:t,height:e}){const i=t/e;return Number.isFinite(i)?i:1}var st=Object.freeze([1200,600,300,0]);function ot(t,e){return"function"==typeof t?t(e):t}function rt(t,e){return void 0!==e?ot(t,e):void 0}function lt(t,e,i,n=0){if(void 0===e)return;const s=rt(t,e);return Math.round(Math.max(void 0===s?function(t,e){const i=st.findIndex(t=>t<=e);return ot(t[Math.max(i,0)],e)}(i,e):s,n))}function at(t,{spacing:e,padding:i,componentsProps:n,render:s}){return{spacing:lt(e,t,[20,15,10,5]),padding:lt(i,t,[0,0,0,0]),componentsProps:ot(n,t)||{},render:ot(s,t)}}function ct(t,e=0){const i=10**e;return Math.round((t+Number.EPSILON)*i)/i}function dt(t,e,i,n,s,o,r){let l,a;const c=t=>{const e=o*(s-1)+2*r*s;return`calc((${t.match(/^\s*calc\((.*)\)\s*$/)?.[1]??t} - ${e}px) / ${ct((n-e)/i,5)})`},d=t.srcSet;return d&&d.length>0&&(l=d.concat(d.some(({width:e})=>e===t.width)?[]:[{src:t.src,width:t.width,height:t.height}]).sort((t,e)=>t.width-e.width).map(t=>`${t.src} ${t.width}w`).join(", ")),a=e?.size?(e.sizes||[]).map(({viewport:t,size:e})=>`${t} ${c(e)}`).concat(c(e.size)).join(", "):`${Math.ceil(i/n*100)}vw`,{srcSet:l,sizes:a}}var ht=a(function({as:t,render:e,context:i,classes:n=[],variables:s={},style:o,className:r,children:l,...a},c){const d=function(...t){return t.filter(Boolean).join(" ")}(...(Array.isArray(n)?n:[n]).filter(t=>"string"==typeof t).map(it),r),h={style:{...Object.fromEntries(Object.entries(s).map(([t,e])=>{return[(i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),`--${it(i)}`),"number"==typeof e?ct(e,5):e];var i})),...o},className:d,children:l,...a};if(e){const t=e({ref:c,...h},i);if(t)return t}return p(t||"div",{ref:c,...h})}),pt=a(function({photo:t,index:e,width:i,height:n,onClick:s,render:{wrapper:o,link:r,button:l,image:a,extras:c}={},componentsProps:{link:d,button:h,wrapper:u,image:m}={}},g){const{href:f}=t,w={photo:t,index:e,width:ct(i,3),height:ct(n,3)};let b;return b=f?{...d,as:"a",render:r,classes:["photo","link"],href:f,onClick:s}:s?{...h,as:"button",type:"button",render:l,classes:["photo","button"],onClick:s}:{...u,render:o,classes:"photo"},p(ht,{ref:g,variables:{photoWidth:w.width,photoHeight:w.height},context:w,...b,children:[p(ht,{as:"img",classes:"image",render:a,context:w,...m}),c?.({},w)]})}),ut=a(function({layout:e,sizes:i,model:n,skeleton:s,onClick:o,render:{container:r,track:l,photo:a,...c}={},componentsProps:{container:d,track:h,link:u,button:m,wrapper:g,image:f}={}},w){const{spacing:b,padding:T,containerWidth:y,tracks:v,variables:k,horizontal:x}=n||{};return p(ht,{role:"group","aria-label":"Photo album",...d,variables:{spacing:b,padding:T,containerWidth:y,...k},classes:["",e],render:r,ref:w,children:[void 0!==b&&void 0!==T&&void 0!==y&&v?.map(({photos:e,variables:n},s)=>{const r=e.length,d=x?r:v.length;return t(ht,{...h,key:s,render:l,classes:"track",variables:{trackSize:r,...n}},e.map(t=>{const{photo:e,index:n,width:s}=t,{key:r,src:l,alt:h="",title:w,label:v}=e,k=o?t=>{o({event:t,photo:e,index:n})}:void 0;if(a){const e=a({onClick:k},t);if(e)return e}const x=t=>v?{"aria-label":v,...t}:t;return p(pt,{onClick:k,render:c,componentsProps:{image:{loading:"lazy",decoding:"async",src:l,alt:h,title:w,...dt(e,i,s,y,d,b,T),...ot(f,t)},link:x(ot(u,t)),button:x(ot(m,t)),wrapper:ot(g,t)},...t},r??n)}))}),void 0===y&&s]})});function mt(t,e,i,n){return(e-(t.length-1)*i-2*n*t.length)/t.reduce((t,e)=>t+nt(e),0)}function gt(t,e,i,n,s,o,r){const l=t.slice(e,i),a=mt(l,n,s,o);return a>0?(a-r)**2*l.length:void 0}var ft=a(function({photos:t,breakpoints:e,defaultContainerWidth:i,...n},s){const{containerRef:o,containerWidth:r}=et(s,e,i),{spacing:l,padding:a,targetRowHeight:c,minPhotos:d,maxPhotos:u,...m}=function(t,{photos:e,targetRowHeight:i,rowConstraints:n,...s}){const{spacing:o,padding:r,componentsProps:l,render:a}=at(t,s),{singleRowMaxHeight:c,minPhotos:d,maxPhotos:h}=rt(n,t)||{};if(void 0!==c&&void 0!==o&&void 0!==r){const t=Math.floor(e.reduce((t,{width:e,height:i})=>t+e/i*c+2*r,o*(e.length-1)));t>0&&(l.container={...l.container},l.container.style={maxWidth:t,...l.container.style})}return{...s,targetRowHeight:lt(i,t,[t=>t/5,t=>t/4,t=>t/3,t=>t/2]),render:a,spacing:o,padding:r,minPhotos:d,maxPhotos:h,componentsProps:l}}(r,{photos:t,...n});return p(ut,{layout:"rows",ref:o,model:h(()=>void 0!==r&&void 0!==l&&void 0!==a&&void 0!==c?function(t,e,i,n,s,o,r){const l=Math.min(function(t,e,i,n){return ct(e/i/Math.min(...t.map(t=>nt(t))))+(n||0)+2}(t,n,s,o),r||1/0),a=o||1,c=t.length,d=new Array(c+1).fill(1/0),h=new Array(c+1).fill(-1);d[0]=0;for(let m=1;m<=c;m+=1)for(let o=m-a;o>=Math.max(0,m-l);o-=1){if(d[o]===1/0)continue;const r=gt(t,o,m,n,e,i,s);if(void 0===r)break;const l=d[o]+r;(d[m]===1/0||d[m]>l&&(d[m]/l>1.005||-1!==h[m]&&h[m]<o))&&(d[m]=l,h[m]=o)}if(d[c]===1/0)return;const p=[];for(let m=c;0!==m;m=h[m])p.push(m);p.push(0),p.reverse();const u=[];for(let m=1;m<p.length;m+=1){const s=t.slice(p[m-1],p[m]).map((t,e)=>({photo:t,index:p[m-1]+e})),o=mt(s.map(({photo:t})=>t),n,e,i);u.push({photos:s.map(({photo:t,index:e})=>({photo:t,index:e,width:o*nt(t),height:o}))})}return{spacing:e,padding:i,containerWidth:n,tracks:u,horizontal:!0}}(t,l,a,r,c,d,u):void 0,[t,l,a,r,c,d,u]),...m})});function wt(t,e,i,n,s,o,r){const l=[],a=r.reduce((t,e)=>t+e,0);for(let c=0;c<t.length-1;c+=1){const d=e.slice(t[c],t[c+1]).map((e,i)=>({photo:e,index:t[c]+i})),h=r.reduce((t,e,i)=>t+(o[c]-o[i])*e,0),p=(s-(t.length-2)*i-2*(t.length-1)*n-h)*r[c]/a;l.push({photos:d.map(({photo:t,index:e})=>({photo:t,index:e,width:p,height:p/nt(t)})),variables:{adjustedGaps:h,columnRatio:r[c]}})}return{tracks:l,variables:{totalRatio:a}}}function bt(t,e,i,n,s,o){const r=[],l=[];if(t.length<=o){const s=t.length>0?t.reduce((t,e)=>t+nt(e),0)/t.length:1;for(let e=0;e<o;e+=1)r[e]=2*i,l[e]=e<t.length?nt(t[e]):s;return wt(Array.from({length:o+1},(e,i)=>Math.min(i,t.length)),t,e,i,n,r,l)}const a=(c=function(t,e,i,n,s){return o=>{const r=[],l=1.5*s;let a=n/nt(t[o])+2*i;for(let c=o+1;c<t.length+1&&(r.push([c,(s-a)**2]),!(a>l||c===t.length));c+=1)a+=n/nt(t[c])+e+2*i;return r}}(t,e,i,s,(t.reduce((t,e)=>t+s/nt(e),0)+e*(t.length-o)+2*i*t.length)/o),d=o,h=0,p=t.length,function(t,e,i){const n=[i];for(let s=i,o=e;o>0;o-=1)[s]=t.get(s)[o],n.push(s);return n.reverse()}(function(t,e,i,n){const s=/* @__PURE__ */new Map,o=/* @__PURE__ */new Set;o.add(i);for(let r=0;r<e;r+=1){const i=[...o.keys()];o.clear(),i.forEach(i=>{const l=r>0?s.get(i)[r][1]:0;t(i).forEach(([t,a])=>{let c=s.get(t);c||(c=[],s.set(t,c));const d=l+a,h=c[r+1];(!h||h[1]>d&&(h[1]/d>1.0001||i<h[0]))&&(c[r+1]=[i,d]),r<e-1&&t!==n&&o.add(t)})})}return s}(c,d,h,p),d,p));var c,d,h,p;for(let u=0;u<a.length-1;u+=1){const n=t.slice(a[u],a[u+1]);r[u]=e*(n.length-1)+2*i*n.length,l[u]=1/n.reduce((t,e)=>t+1/nt(e),0)}return wt(a,t,e,i,n,r,l)}function Tt(t,e,i,n,s){const{tracks:o,variables:r}=bt(t,e,i,n,(n-e*(s-1)-2*i*s)/s,s);return o.some(t=>t.photos.some(({width:t,height:e})=>t<=0||e<=0))?s>1?Tt(t,e,i,n,s-1):void 0:{tracks:o,spacing:e,padding:i,containerWidth:n,variables:{columns:s,...r}}}var yt=a(function({photos:t,breakpoints:e,defaultContainerWidth:i,...n},s){const{containerRef:o,containerWidth:r}=et(s,e,i),{spacing:l,padding:a,columns:c,...d}=function(t,{columns:e,...i}){return{...i,...at(t,i),columns:lt(e,t,[5,4,3,2],1)}}(r,{photos:t,...n});return p(ut,{layout:"columns",ref:o,model:h(()=>void 0!==r&&void 0!==l&&void 0!==a&&void 0!==c?Tt(t,l,a,r,c):void 0,[t,l,a,r,c]),...d})});function vt(t,e,i,n,s){const o=(n-e*(s-1)-2*i*s)/s;if(o<=0)return s>1?vt(t,e,i,n,s-1):void 0;const r=[];for(let a=0;a<s;a+=1)r[a]=0;const l=t.reduce((t,n,s)=>{const l=r.reduce((t,e,i)=>e<r[t]-1?i:t,0);return r[l]=r[l]+o/nt(n)+e+2*i,t[l].push({photo:n,index:s}),t},Array.from({length:s},()=>[]));return{spacing:e,padding:i,containerWidth:n,variables:{columns:s},tracks:l.map(t=>({photos:t.map(({photo:t,index:e})=>({photo:t,index:e,width:o,height:o/nt(t)}))}))}}var kt=a(function({photos:t,breakpoints:e,defaultContainerWidth:i,...n},s){const{containerRef:o,containerWidth:r}=et(s,e,i),{spacing:l,padding:a,columns:c,...d}=function(t,{columns:e,...i}){return{...i,...at(t,i),columns:lt(e,t,[5,4,3,2],1)}}(r,{photos:t,...n});return p(ut,{layout:"masonry",ref:o,model:h(()=>void 0!==r&&void 0!==l&&void 0!==a&&void 0!==c?vt(t,l,a,r,c):void 0,[t,l,a,r,c]),...d})}),xt='url("https://res.cloudinary.com/dectzk2b2/image/upload/v1736933014/black_rpie3v.png")',qt=class{constructor(t){this.backdropOn=!1,this.lightbox=t,this.backgroundElement=null,this.backgroundVideoElement=null,this.referenceVideoElement=null,this.options={toggleBackdropButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}initPswpEvents(t){t.on("afterInit",()=>{setTimeout(()=>{this.backgroundElement.style.display="block",this.backgroundVideoElement.style.display="block"},[500])}),t.on("uiRegister",()=>{t.ui.registerElement({name:"toggle-backdrop-button",title:"Toggle blur backdrop",order:this.options.toggleBackdropButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-show-backdrop"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-backdrop"/><path id="pswp__icn-show-backdrop" style="display:none" d="M3 14.5q-.2 0-.35-.15T2.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-4q-.2 0-.35-.15T2.5 10t.15-.35T3 9.5t.35.15t.15.35t-.15.35t-.35.15M6 19q-.425 0-.712-.288T5 18t.288-.712T6 17t.713.288T7 18t-.288.713T6 19m0-4q-.425 0-.712-.288T5 14t.288-.712T6 13t.713.288T7 14t-.288.713T6 15m0-4q-.425 0-.712-.288T5 10t.288-.712T6 9t.713.288T7 10t-.288.713T6 11m0-4q-.425 0-.712-.288T5 6t.288-.712T6 5t.713.288T7 6t-.288.713T6 7m4 8.5q-.625 0-1.062-.437T8.5 14t.438-1.062T10 12.5t1.063.438T11.5 14t-.437 1.063T10 15.5m0-4q-.625 0-1.062-.437T8.5 10t.438-1.062T10 8.5t1.063.438T11.5 10t-.437 1.063T10 11.5m0 7.5q-.425 0-.712-.288T9 18t.288-.712T10 17t.713.288T11 18t-.288.713T10 19m0-12q-.425 0-.712-.288T9 6t.288-.712T10 5t.713.288T11 6t-.288.713T10 7m0 14.5q-.2 0-.35-.15T9.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-18q-.2 0-.35-.15T9.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 12q-.625 0-1.062-.437T12.5 14t.438-1.062T14 12.5t1.063.438T15.5 14t-.437 1.063T14 15.5m0-4q-.625 0-1.062-.437T12.5 10t.438-1.062T14 8.5t1.063.438T15.5 10t-.437 1.063T14 11.5m0 7.5q-.425 0-.712-.288T13 18t.288-.712T14 17t.713.288T15 18t-.288.713T14 19m0-12q-.425 0-.712-.288T13 6t.288-.712T14 5t.713.288T15 6t-.288.713T14 7m0 14.5q-.2 0-.35-.15T13.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-18q-.2 0-.35-.15T13.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M18 19q-.425 0-.712-.288T17 18t.288-.712T18 17t.713.288T19 18t-.288.713T18 19m0-4q-.425 0-.712-.288T17 14t.288-.712T18 13t.713.288T19 14t-.288.713T18 15m0-4q-.425 0-.712-.288T17 10t.288-.712T18 9t.713.288T19 10t-.288.713T18 11m0-4q-.425 0-.712-.288T17 6t.288-.712T18 5t.713.288T19 6t-.288.713T18 7m3 7.5q-.2 0-.35-.15T20.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-4q-.2 0-.35-.15T20.5 10t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15"/><path id="pswp__icn-hide-backdrop" d="m19.1 21.9l-17-17q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l17 17q.275.275.275.7t-.275.7t-.7.275t-.7-.275m-9.1-.4q-.2 0-.35-.15T9.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 0q-.2 0-.35-.15T13.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M6 19q-.425 0-.712-.288T5 18t.288-.712T6 17t.713.288T7 18t-.288.713T6 19m4 0q-.425 0-.712-.288T9 18t.288-.712T10 17t.713.288T11 18t-.288.713T10 19m4 0q-.425 0-.712-.288T13 18t.288-.712T14 17t.713.288T15 18t-.288.713T14 19m-4-3.5q-.65 0-1.075-.425T8.5 14t.425-1.075T10 12.5t1.075.425T11.5 14t-.425 1.075T10 15.5M6 15q-.425 0-.712-.288T5 14t.288-.712T6 13t.713.288T7 14t-.288.713T6 15m11.8-.025l-.775-.775q-.1-.5.213-.85T18 13q.425 0 .713.288T19 14q0 .45-.35.763t-.85.212M3 14.5q-.2 0-.35-.15T2.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m18 0q-.2 0-.35-.15T20.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m-6.7-3.05L12.55 9.7q.125-.525.5-.862T14 8.5q.65 0 1.075.425T15.5 10q0 .575-.35.963t-.85.487M6 11q-.425 0-.712-.287T5 10t.288-.712T6 9t.713.288T7 10t-.288.713T6 11m12 0q-.425 0-.712-.288T17 10t.288-.712T18 9t.713.288T19 10t-.288.713T18 11m-15-.5q-.2 0-.35-.15T2.5 10t.15-.35T3 9.5t.35.15t.15.35t-.15.35t-.35.15m18 0q-.2 0-.35-.15T20.5 10t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M14 7q-.425 0-.712-.288T13 6t.288-.712T14 5t.713.288T15 6t-.288.713T14 7m-4.175-.025l-.8-.8q-.075-.5.225-.837T10 5q.425 0 .712.287T11 6q0 .45-.337.75t-.838.225M18 7q-.425 0-.712-.288T17 6t.288-.712T18 5t.713.288T19 6t-.288.713T18 7m-8-3.5q-.2 0-.35-.15T9.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 0q-.2 0-.35-.15T13.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15" /></svg>',onClick:()=>{this.toggleBackdrop(t)}}),this.createBlurBackground(t)}),t.on("change",()=>{this.backdropOn&&this.updateBlurBackground(t)}),t.on("close",()=>{this.removeBlurBackground(),this.backdropOn=!1})}createBlurBackground(t){const e=t.element;if(!this.backgroundElement){const t=document.createElement("div");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="100vw",t.style.height="100vh",t.style.backgroundSize="cover",t.style.backgroundPosition="center",t.style.filter="blur(44px)",t.style.zIndex=-1,t.style.transition="background-image 0.5s ease, opacity 0.5s ease",t.style.display="none",t.style.backgroundImage=xt,e.append(t),this.backgroundElement=t}if(!this.backgroundVideoElement){const t=document.createElement("video");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="100vw",t.style.height="100vh",t.style.objectFit="cover",t.style.filter="blur(44px)",t.style.zIndex=-1,t.style.display="none",t.style.transition="opacity 0.5s ease",t.muted=!0,t.loop=!0,t.autoplay=!1,t.muted=!0,t.volume=0,e.append(t),this.backgroundVideoElement=t}}toggleBackdrop(t){this.backdropOn?(this.backgroundElement.style.backgroundImage=xt,this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.pause(),this.backdropOn=!1):(this.updateBlurBackground(t),this.backdropOn=!0);const e=this.querySelector("#pswp__icn-hide-backdrop"),i=this.querySelector("#pswp__icn-show-backdrop");e&&(e.style.display=this.backdropOn?"none":"inline"),i&&(i.style.display=this.backdropOn?"inline":"none")}updateBlurBackground(t){const e=t.currSlide;if(e?.data)if("video"===e.data.type){const t=this.backgroundVideoElement,i=e.content.element;"video"===i?.tagName?.toLowerCase()&&(this.referenceVideoElement=i,this.registerVideoEvents(i,t)),t.style.opacity=0,setTimeout(()=>{t.src=e.data.src,t.load(),this.initBackgroundVideo(),t.style.opacity=1},500),this.backgroundElement&&(this.backgroundElement.style.opacity=0)}else{if(this.backgroundElement){const t=((t,e=32,i=32)=>{if(!t||t.length<6||"undefined"==typeof document)return null;try{const n=V(t,e,i),s=document.createElement("canvas");s.width=e,s.height=i;const o=s.getContext("2d");if(!o)return null;const r=o.createImageData(e,i);return r.data.set(n),o.putImageData(r,0,0),s.toDataURL()}catch(n){return console.warn("[PhotoSwipeBackdrop] Failed to decode blurhash:",n),null}})(e.data.blurhash)||e.data.thumbnailUrl||e.data.src;this.backgroundElement.style.backgroundImage=t?`url("${t}")`:xt,this.backgroundElement.style.backgroundColor="transparent",this.backgroundElement.style.opacity=1}this.backgroundVideoElement&&(this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.src="")}}initBackgroundVideo(){this.referenceVideoElement&&(this.backgroundVideoElement.currentTime=this.referenceVideoElement.currentTime,this.referenceVideoElement.currentTime>0&&!this.referenceVideoElement.paused&&!this.referenceVideoElement.ended&&this.referenceVideoElement.readyState>2&&this.backgroundVideoElement.play())}removeBlurBackground(){this.backgroundElement&&(this.backgroundElement.remove(),this.backgroundVideoElement.remove(),this.backgroundElement=null,this.backgroundVideoElement=null)}registerVideoEvents(t,e){this.foregroundVideoElement=t,t.addEventListener("play",()=>{e.currentTime=t.currentTime,e.play()}),t.addEventListener("pause",()=>{e.pause()}),t.addEventListener("ended",()=>{e.pause(),e.currentTime=0})}},_t=class{constructor(t,e={}){this.lightbox=t,this.options={filmstripButtonOrder:e.filmstripButtonOrder||7,height:e.height||112,thumbnailHeight:e.thumbnailHeight||64,thumbnailWidth:e.thumbnailWidth||96,itemMargin:e.itemMargin??4,buffer:e.buffer??5,backgroundColor:e.backgroundColor||"rgba(0, 0, 0, 0.6)",activeBorderColor:e.activeBorderColor||"#ff4800",...e},this.itemWidth=this.options.thumbnailWidth+this.options.itemMargin,this.filmstripVisible=!0,this.filmstripContainer=null,this.filmstripContent=null,this.filmstripTrack=null,this.isAnimating=!1,this.thumbnailPool=/* @__PURE__ */new Map,this.contents=[],this.scrollTickPending=!1,this.scrollHandler=this.scrollHandler.bind(this),this.handleThumbnailClick=this.handleThumbnailClick.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}getElementById(t){const e=this.getRootNode();return"function"==typeof e.getElementById?e.getElementById(t):e.querySelector?.(`#${t}`)||document.getElementById(t)}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}initPswpEvents(t){this.pswp=t,t.on("uiRegister",()=>{this.registerToggleButton(),this.registerFilmstripContainer()}),t.on("afterInit",()=>{this.filmstripContainer=this.getElementById("pswp-filmstrip-container"),this.filmstripContainer&&this.injectStyles()}),t.on("openingAnimationEnd",()=>{this.filmstripVisible&&!this.isAnimating&&requestAnimationFrame(()=>this.showFilmstrip())}),t.on("change",()=>{this.filmstripVisible&&this.filmstripContent&&this.updateActiveSlide(t.currSlide?.index??0)}),t.on("bindEvents",()=>{document.addEventListener("keydown",this.handleKeyDown)}),t.on("close",()=>{document.removeEventListener("keydown",this.handleKeyDown),this.cleanupFilmstrip()})}injectStyles(){const t="pswp-filmstrip-styles",e=this.getRootNode(),i=e.head??e;if(i.querySelector?.(`#${t}`))return;const n=document.createElement("style");n.id=t,n.textContent=`\n #pswp-filmstrip-container {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 1000;\n transform: translateY(100%);\n transition: transform 0.3s ease-in-out;\n pointer-events: none;\n }\n\n #pswp-filmstrip-container.pswp-filmstrip--visible {\n transform: translateY(0);\n pointer-events: auto;\n }\n\n .pswp-filmstrip {\n position: relative;\n height: ${this.options.height}px;\n background-color: ${this.options.backgroundColor};\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: none;\n -ms-overflow-style: none;\n scroll-behavior: auto;\n user-select: none;\n -webkit-user-select: none;\n padding: 8px 16px;\n box-sizing: border-box;\n }\n\n .pswp-filmstrip::-webkit-scrollbar {\n display: none;\n }\n\n .pswp-filmstrip__track {\n position: relative;\n height: 100%;\n min-width: 100%;\n }\n\n .pswp-filmstrip__item {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n display: inline-flex;\n flex-shrink: 0;\n padding: 0;\n border: none;\n background: none;\n cursor: pointer;\n outline: none;\n border-radius: 4px;\n overflow: hidden;\n transition: transform 0.15s ease;\n }\n\n .pswp-filmstrip__item:hover {\n transform: translateY(-50%) scale(1.05);\n }\n\n .pswp-filmstrip__item:active {\n transform: translateY(-50%) scale(0.95);\n }\n\n .pswp-filmstrip__thumb {\n width: ${this.options.thumbnailWidth}px;\n height: ${this.options.thumbnailHeight}px;\n border-radius: 4px;\n overflow: hidden;\n position: relative;\n border: 2px solid transparent;\n transition: border-color 0.2s ease;\n background-color: #333;\n }\n\n .pswp-filmstrip__thumb--active {\n border-color: ${this.options.activeBorderColor};\n }\n\n .pswp-filmstrip__img {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n object-position: center;\n z-index: 2;\n opacity: 0;\n transform: scale(0.95);\n transition: opacity 0.3s ease, transform 0.3s ease;\n }\n\n .pswp-filmstrip__img--loaded {\n opacity: 1;\n transform: scale(1);\n }\n\n .pswp-filmstrip__overlay {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 3;\n pointer-events: none;\n }\n\n .pswp-filmstrip__overlay-icon {\n width: 24px;\n height: 24px;\n opacity: 0.8;\n }\n\n .pswp-filmstrip__ad-label {\n position: absolute;\n top: 4px;\n left: 4px;\n font-size: 10px;\n color: white;\n background-color: rgba(0, 0, 0, 0.6);\n padding: 2px 6px;\n border-radius: 3px;\n z-index: 3;\n }\n\n @media (min-width: 1024px) {\n .pswp-filmstrip__thumb {\n width: 80px;\n height: 80px;\n }\n\n .pswp-filmstrip__overlay-icon {\n width: 28px;\n height: 28px;\n }\n }\n `,i.appendChild(n)}registerToggleButton(){this.pswp.ui.registerElement({name:"filmstrip-toggle-button",title:"Toggle filmstrip",order:this.options.filmstripButtonOrder,isButton:!0,html:this.getToggleButtonHtml(),onClick:()=>this.toggleFilmstrip()})}registerFilmstripContainer(){this.pswp.ui.registerElement({name:"filmstrip",isButton:!1,appendTo:"root",html:'<div id="pswp-filmstrip-container"></div>'})}getToggleButtonHtml(){return'\n <svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24" width="24" height="24" id="pswp-filmstrip-icon-show">\n <path d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4v2.85L1.35 4.2q-.3-.3-.3-.712t.3-.713t.713-.3t.712.3l18.4 18.4q.3.3.3.7t-.3.7t-.712.3t-.713-.3L17.15 20zm0-2h11.15l-10-10H4zM22 6v11q0 .5-.312.75T21 18t-.687-.262t-.313-.763V8h-8.325q-.4 0-.763-.15t-.637-.425L8.55 5.7q-.225-.25-.275-.525t.075-.55t.35-.45T9.275 4H20q.825 0 1.413.588T22 6" />\n <path d="m 5.100795,16.58464 q -0.165328,0 -0.282961,-0.116899 Q 4.700201,16.350842 4.7,16.186347 V 13.398294 Q 4.7,13.233997 4.817834,13.117098 4.935667,13.000199 5.100795,13 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n <path d="m 10.572143,16.65489 q -0.165327,0 -0.282961,-0.116899 -0.117632,-0.116899 -0.117833,-0.281394 v -2.788053 q 0,-0.164297 0.117833,-0.281196 0.117834,-0.116899 0.282961,-0.117098 h 2.805562 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n <path d="m 16.049385,16.724729 q -0.165327,0 -0.282961,-0.116899 -0.117632,-0.116899 -0.117833,-0.281394 v -2.788053 q 0,-0.164297 0.117833,-0.281196 0.117834,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117634,0.281196 v 2.788053 q 0,0.164296 -0.117634,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n </svg>\n <svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24" width="24" height="24" id="pswp-filmstrip-icon-hide" style="display:none">\n <path d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h16q.825 0 1.413.588T22 6v12q0 .825-.587 1.413T20 20zm0-2h16V8H4z" />\n <path d="m 5.100795,16.58464 q -0.165328,0 -0.282961,-0.116899 Q 4.700201,16.350842 4.7,16.186347 V 13.398294 Q 4.7,13.233997 4.817834,13.117098 4.935667,13.000199 5.100795,13 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n <path d="m 10.572144,16.65489 q -0.165329,0 -0.282961,-0.116899 -0.117633,-0.116899 -0.117834,-0.281394 v -2.788053 q 0,-0.164297 0.117834,-0.281196 0.117832,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n <path d="m 16.049385,16.724729 q -0.165328,0 -0.282961,-0.116899 -0.117633,-0.116899 -0.117834,-0.281394 v -2.788053 q 0,-0.164297 0.117834,-0.281196 0.117833,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117634,0.281196 v 2.788053 q 0,0.164296 -0.117634,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n </svg>\n '}setCaptionOffset(t){const e=this.getElementById("pswp-caption-container");e&&(e.style.bottom=t?"7rem":"0")}showFilmstrip(){if(!this.filmstripContainer||!this.pswp)return;const t=this.getContentsFromPswp().filter(t=>t&&t.thumbnailUrl);if(0===t.length)return;this.isAnimating=!0,this.contents=t;const e=this.pswp.currSlide?.index??0;this.createFilmstripContent(t,e),this.filmstripContainer.classList.add("pswp-filmstrip--visible"),this.filmstripVisible=!0;const i=this.querySelector(".pswp");i&&i.classList.add("pswp-filmstrip-active"),this.setCaptionOffset(!0),this.updateToggleIcon(),setTimeout(()=>{this.isAnimating=!1},300)}hideFilmstrip(){if(!this.filmstripContainer)return;this.isAnimating=!0,this.filmstripContainer.classList.remove("pswp-filmstrip--visible"),this.filmstripVisible=!1;const t=this.querySelector(".pswp");t&&t.classList.remove("pswp-filmstrip-active"),this.setCaptionOffset(!1),this.updateToggleIcon(),setTimeout(()=>{this.filmstripContainer&&(this.filmstripContainer.innerHTML=""),this.filmstripContent=null,this.filmstripTrack=null,this.thumbnailPool.clear(),this.contents=[],this.isAnimating=!1},300)}toggleFilmstrip(){this.isAnimating||(this.filmstripVisible?this.hideFilmstrip():this.showFilmstrip())}updateToggleIcon(){const t=this.getElementById("pswp-filmstrip-icon-show"),e=this.getElementById("pswp-filmstrip-icon-hide");t&&(t.style.display=this.filmstripVisible?"none":"block"),e&&(e.style.display=this.filmstripVisible?"block":"none")}createFilmstripContent(t,e){if(!this.filmstripContainer)return;const i=document.createElement("div");i.className="pswp-filmstrip",i.id="pswp-filmstrip-content";const n=document.createElement("div");n.className="pswp-filmstrip__track",n.style.width=t.length*this.itemWidth+"px",i.appendChild(n),this.filmstripContainer.innerHTML="",this.filmstripContainer.appendChild(i),this.filmstripContent=i,this.filmstripTrack=n,i.addEventListener("scroll",this.scrollHandler,{passive:!0}),this.renderVisibleThumbnails(e,!0)}scrollHandler(){!this.scrollTickPending&&this.filmstripContent&&(this.scrollTickPending=!0,requestAnimationFrame(()=>{this.scrollTickPending=!1,this.filmstripContent&&this.renderVisibleThumbnails(this.pswp?.currSlide?.index??0,!1)}))}renderVisibleThumbnails(t,e){if(!this.filmstripContent||!this.filmstripTrack)return;const i=this.filmstripContent,n=this.filmstripTrack,s=this.contents,o=s.length;if(0===o)return;const r=i.clientWidth,l=i.scrollLeft,a=this.options.buffer;let c=Math.floor(l/this.itemWidth)-a,d=Math.ceil((l+r)/this.itemWidth)+a;c=Math.max(0,c),d=Math.min(o-1,d);for(const[h,p]of this.thumbnailPool)(h<c||h>d)&&(p.parentNode&&p.parentNode.removeChild(p),this.thumbnailPool.delete(h));for(let h=c;h<=d;h++){const e=s[h];if(!e||!e.thumbnailUrl)continue;let i=this.thumbnailPool.get(h);const o=h===t;i?this.updateThumbnailState(i,h,o):(i=this.createThumbnailButton(e,h,o),i.style.left=h*this.itemWidth+"px",n.appendChild(i),this.thumbnailPool.set(h,i))}e&&requestAnimationFrame(()=>this.scrollToThumbnail(t))}createThumbnailButton(t,e,i){const n=document.createElement("button");n.className="pswp-filmstrip__item",n.setAttribute("data-index",e),n.setAttribute("type","button"),n.setAttribute("aria-label",`Go to slide ${e+1}`);const s=document.createElement("div");s.className="pswp-filmstrip__thumb "+(e===i?"pswp-filmstrip__thumb--active":""),s.setAttribute("data-thumb-index",e);const o=document.createElement("img");if(o.className="pswp-filmstrip__img",o.alt=t.caption||`Slide ${e+1}`,o.loading="lazy",o.decoding="async",o.onload=()=>o.classList.add("pswp-filmstrip__img--loaded"),o.src=t.thumbnailUrl,s.appendChild(o),"VIDEO"===t.type){const t=document.createElement("div");t.className="pswp-filmstrip__overlay",t.innerHTML='\n <svg class="pswp-filmstrip__overlay-icon" viewBox="0 0 24 24" fill="white">\n <path d="M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"/>\n </svg>\n ',s.appendChild(t)}return n.appendChild(s),n.addEventListener("click",this.handleThumbnailClick),n}updateThumbnailState(t,e,i){const n=t.querySelector(".pswp-filmstrip__thumb");n&&(i?(n.classList.add("pswp-filmstrip__thumb--active"),t.setAttribute("aria-current","true")):(n.classList.remove("pswp-filmstrip__thumb--active"),t.removeAttribute("aria-current")))}handleThumbnailClick(t){const e=t.currentTarget,i=parseInt(e.getAttribute("data-index"),10);this.pswp&&!isNaN(i)&&this.pswp.goTo(i)}updateActiveSlide(t){if(this.filmstripContent){for(const[e,i]of this.thumbnailPool)this.updateThumbnailState(i,e,e===t);this.scrollToThumbnail(t)}}scrollToThumbnail(t){if(!this.filmstripContent)return;const e=this.contents;if(t<0||t>=e.length)return;const i=this.filmstripContent,n=i.clientWidth/2,s=t*this.itemWidth+this.itemWidth/2;i.scrollTo({left:s-n,behavior:"smooth"})}handleKeyDown(t){this.filmstripVisible&&this.pswp&&("f"!==t.key&&"F"!==t.key||this.toggleFilmstrip())}getContentsFromPswp(){if(!this.pswp)return[];const t=this.pswp.options?.dataSource;if(t?.gallery)return this.getContentsFromDOM(t.gallery);const e="function"==typeof this.pswp.getNumItems?this.pswp.getNumItems():0;if(!e)return[];const i=[];for(let n=0;n<e;n++){let t=null;this.pswp.slides?.[n]?.data?t=this.pswp.slides[n].data:"function"==typeof this.pswp.getItemData&&(t=this.pswp.getItemData(n)),i.push(t||{})}return i.map((t,e)=>this.normalizeItem(t,e))}getContentsFromDOM(t){if(!t)return[];const e=t.querySelectorAll("a[href]");return Array.from(e).map((t,e)=>{const i=t.dataset,n=i.pswpThumbnailUrl||i.pswpMsrc||"",s=(i.pswpType||"").toString().toUpperCase(),o=i.pswpCaption||t.getAttribute("title")||"";return{id:i.pswpId||`item-${e}`,type:s,thumbnailUrl:n||i.pswpSrc||t.getAttribute("href")||"",caption:o}})}normalizeItem(t,e){try{const i=t||{},n=i.data||i,s=(n.type||n.pswpType||i.type||"").toString().toUpperCase(),o=n.thumbnailUrl||n.thumbnail||n.msrc||n.src||"";return{id:n.id||n._id||i.id||i._id||`item-${e}`,type:s,thumbnailUrl:o,caption:n.caption||n.alt||n.title||""}}catch{return{id:`item-${e}`,type:"",thumbnailUrl:"",caption:""}}}cleanupFilmstrip(){const t=this.querySelector(".pswp");t&&t.classList.remove("pswp-filmstrip-active"),this.setCaptionOffset(!1),this.filmstripContent&&(this.filmstripContent.removeEventListener("scroll",this.scrollHandler),this.filmstripContent.innerHTML=""),this.filmstripContainer&&(this.filmstripContainer.innerHTML="",this.filmstripContainer.classList.remove("pswp-filmstrip--visible")),this.filmstripContent=null,this.filmstripTrack=null,this.thumbnailPool.clear(),this.contents=[],this.filmstripVisible=!0,this.isAnimating=!1}},Et=class{constructor(t){this.lightbox=t,this.fullscreen=!1,this.options={fullScreenButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}syncFullscreenState(){const t=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;this.fullscreen=Boolean(t);const e=this.querySelector("#pswp__icn-exit-fullscreen"),i=this.querySelector("#pswp__icn-fullscreen");e&&(e.style.display=this.fullscreen?"inline":"none"),i&&(i.style.display=this.fullscreen?"none":"inline")}initPswpEvents(t){const e=()=>this.syncFullscreenState();t.events.add(document,"fullscreenchange",e),t.events.add(document,"webkitfullscreenchange",e),t.on("uiRegister",()=>{(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)&&t.ui.registerElement({name:"fullscreen-button",title:"Toggle fullscreen view",order:this.options.fullScreenButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-1" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-fullscreen"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-exit-fullscreen"/><path id="pswp__icn-fullscreen" d="M5 19h2q.425 0 .713.288T8 20t-.288.713T7 21H4q-.425 0-.712-.288T3 20v-3q0-.425.288-.712T4 16t.713.288T5 17zm14 0v-2q0-.425.288-.712T20 16t.713.288T21 17v3q0 .425-.288.713T20 21h-3q-.425 0-.712-.288T16 20t.288-.712T17 19zM5 5v2q0 .425-.288.713T4 8t-.712-.288T3 7V4q0-.425.288-.712T4 3h3q.425 0 .713.288T8 4t-.288.713T7 5zm14 0h-2q-.425 0-.712-.288T16 4t.288-.712T17 3h3q.425 0 .713.288T21 4v3q0 .425-.288.713T20 8t-.712-.288T19 7z"/><path id="pswp__icn-exit-fullscreen" style="display:none" d="M6 18H4q-.425 0-.712-.288T3 17t.288-.712T4 16h3q.425 0 .713.288T8 17v3q0 .425-.288.713T7 21t-.712-.288T6 20zm12 0v2q0 .425-.288.713T17 21t-.712-.288T16 20v-3q0-.425.288-.712T17 16h3q.425 0 .713.288T21 17t-.288.713T20 18zM6 6V4q0-.425.288-.712T7 3t.713.288T8 4v3q0 .425-.288.713T7 8H4q-.425 0-.712-.288T3 7t.288-.712T4 6zm12 0h2q.425 0 .713.288T21 7t-.288.713T20 8h-3q-.425 0-.712-.288T16 7V4q0-.425.288-.712T17 3t.713.288T18 4z"/></svg>',onClick:()=>{this.toggleFullscreen(t)}})})}toggleFullscreen(t){const e=t.element;this.fullscreen?(document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),t.options.showHideAnimationType="zoom",this.fullscreen=!1):(e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen(),t.options.showHideAnimationType="fade",this.fullscreen=!0);const i=this.querySelector("#pswp__icn-exit-fullscreen"),n=this.querySelector("#pswp__icn-fullscreen");i&&(i.style.display=this.fullscreen?"inline":"none"),n&&(n.style.display=this.fullscreen?"none":"inline")}},Ct=class{constructor(t,e={}){this.lightbox=t,this.autoHideTimer=null,this.uiVisible=!0,this.options=Object.assign({defaultDelayMs:4e3,playPauseButtonOrder:9,progressBarPosition:"top",progressBarTransition:"ease",restartOnSlideChange:!0,autoHideProgressBar:!0},e),this.setSlideshowLength(Number(localStorage.getItem("pswp_delay"))||this.options.defaultDelayMs),this.slideshowIsRunning=!1,this.slideshowTimerID=null,this.wakeLockIsRunning=!1,this.wakeLockSentinel=null,this.lightbox.on("init",()=>{this.init(this.lightbox.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}injectProgressBarStyles(){const t=this.getRootNode(),e=t===document?document.head:t;if(!e||e.querySelector("style[data-pswp-slideshow]"))return;const i=document.createElement("style");i.setAttribute("data-pswp-slideshow",""),i.textContent=`.pswp__progress-bar{position:fixed;${this.options.progressBarPosition}:0;width:0;height:0}.pswp__progress-bar.running{width:100%;height:2px;transition-property:width;background:#ff4800}`,e.appendChild(i)}init(t){t.on("uiRegister",()=>{this.injectProgressBarStyles(),t.ui.registerElement({name:"playpause-button",title:"Toggle slideshow (Space)\nChange delay with +/- while running",order:this.options.playPauseButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-play"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-stop"/><path id="pswp__icn-play" d="M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"/><path id="pswp__icn-stop" style="display:none" d="M16 19q-.825 0-1.412-.587T14 17V7q0-.825.588-1.412T16 5t1.413.588T18 7v10q0 .825-.587 1.413T16 19m-8 0q-.825 0-1.412-.587T6 17V7q0-.825.588-1.412T8 5t1.413.588T10 7v10q0 .825-.587 1.413T8 19"/></svg>',onClick:()=>{this.setSlideshowState()}}),t.ui.registerElement({name:"playtime",appendTo:"wrapper",tagName:"div",className:"pswp__progress-bar"}),t.events.add(document,"keydown",t=>{switch(t.code){case"Space":this.setSlideshowState(),t.preventDefault();break;case"ArrowUp":case"NumpadAdd":case"Equal":this.changeSlideshowLength(1e3),t.preventDefault();break;case"ArrowDown":case"NumpadSubtract":case"Minus":this.changeSlideshowLength(-1e3),t.preventDefault()}})}),this.lightbox.on("change",()=>{this.slideshowIsRunning&&this.options.restartOnSlideChange&&this.goToNextSlideAfterTimeout()}),this.lightbox.on("close",()=>{this.slideshowIsRunning&&this.setSlideshowState()})}showUI(){this.lightbox&&this.lightbox.pswp&&this.lightbox.pswp.element&&this.lightbox.pswp.element.classList.add("pswp--ui-visible"),this.uiVisible=!0}stopAutoHideTimer(){this.autoHideTimer&&(clearTimeout(this.autoHideTimer),this.autoHideTimer=null)}hideUI(){this.lightbox&&this.lightbox.pswp&&this.lightbox.pswp.element&&this.lightbox.pswp.element.classList.remove("pswp--ui-visible"),this.uiVisible=!1}resetAutoHideTimer(){this.autoHideTimer&&clearTimeout(this.autoHideTimer),this.autoHideTimer=setTimeout(()=>{this.slideshowIsRunning&&this.hideUI(),this.autoHideTimer=null},[3e3])}setSlideshowState(){this.slideshowIsRunning=!this.slideshowIsRunning,this.slideshowIsRunning?(this.goToNextSlideAfterTimeout(),this.showUI(),this.resetAutoHideTimer(),document.addEventListener("touchstart",()=>{this.stopAutoHideTimer(),this.showUI()}),document.addEventListener("touchend",()=>{this.resetAutoHideTimer()}),document.addEventListener("mousemove",()=>{this.uiVisible||this.showUI(),this.resetAutoHideTimer()})):(this.showUI(),this.resetSlideshow(),this.stopAutoHideTimer());const t=this.querySelector("#pswp__icn-stop"),e=this.querySelector("#pswp__icn-play");t&&(t.style.display=this.slideshowIsRunning?"inline":"none"),e&&(e.style.display=this.slideshowIsRunning?"none":"inline");const i=this.querySelector(".pswp__progress-bar");i&&(i.style.opacity=this.options.autoHideProgressBar?null:1),this.toggleWakeLock()}setSlideshowLength(t){this.options.defaultDelayMs=Math.min(Math.max(t,1e3),2147483647),this.options.defaultDelayMs!=t&&localStorage.setItem("pswp_delay",this.options.defaultDelayMs)}changeSlideshowLength(t){if(!this.slideshowIsRunning)return;this.setSlideshowLength(this.options.defaultDelayMs+t),localStorage.setItem("pswp_delay",this.options.defaultDelayMs);const e=this.querySelector(".pswp__counter");e&&(e.innerHTML=this.options.defaultDelayMs/1e3+"s"),this.goToNextSlideAfterTimeout()}isVideoContent(t){return"video"===t?.data?.type}getSlideTimeout(){const t=this.lightbox.pswp.currSlide.content;if(this.isVideoContent(t)){const e=t.element;if(e.paused)return this.options.defaultDelayMs;const i=e.duration,n=e.currentTime;return isNaN(i)||isNaN(n)?this.options.defaultDelayMs:1e3*(i-n)}return this.options.defaultDelayMs}slideContentHasLoaded(){const t=this.lightbox.pswp.currSlide.content;if(this.isVideoContent(t)){const e=t.element;return e.ended||e.readyState===HTMLMediaElement.HAVE_ENOUGH_DATA&&[HTMLMediaElement.NETWORK_IDLE,HTMLMediaElement.NETWORK_LOADING].includes(e.networkState)}return!t.isLoading()}goToNextSlideAfterTimeout(){if(this.resetSlideshow(),this.slideContentHasLoaded()){const t=this.getSlideTimeout();this.slideshowTimerID=setTimeout(()=>{this.lightbox.pswp.next(),this.options.restartOnSlideChange||this.goToNextSlideAfterTimeout()},t),setTimeout(()=>{this.slideshowIsRunning&&this.toggleProgressBar(t)},100)}else this.slideshowTimerID=setTimeout(()=>{this.goToNextSlideAfterTimeout()},200)}getSlideTransition(){return this.isVideoContent(this.lightbox.pswp.currSlide.content)?"linear":this.options.progressBarTransition}toggleProgressBar(t){const e=this.querySelector(".pswp__progress-bar");e&&(t?(e.style.transitionTimingFunction=this.getSlideTransition(),e.style.transitionDuration=`${t}ms`,e.classList.add("running")):e.classList.remove("running"))}toggleWakeLock(){this.wakeLockIsRunning!=this.slideshowIsRunning&&("keepAwake"in screen?screen.keepAwake=this.slideshowIsRunning:"wakeLock"in navigator&&(this.wakeLockSentinel?this.wakeLockSentinel.release().then(()=>(this.wakeLockSentinel=null,!0)).catch(t=>console.error(t)):navigator.wakeLock.request("screen").then(t=>(this.wakeLockSentinel=t,this.wakeLockSentinel.addEventListener("release",()=>{this.wakeLockSentinel=null,this.wakeLockIsRunning=!1}),!0)).catch(t=>{})),this.wakeLockIsRunning=this.slideshowIsRunning)}resetSlideshow(){this.toggleProgressBar(),this.slideshowTimerID&&(clearTimeout(this.slideshowTimerID),this.slideshowTimerID=null)}},St={[String(q.NONE)]:function({className:t}){/* @__PURE__ */
1
+ import{D as t,E as e,T as i,_ as n,b as s,f as o,g as r,h as l,i as a,m as c,n as d,p as h,t as p,v as u,w as m,y as g}from"./DrrpB4Om.js";import{C as f,D as w,L as b,N as T,O as y,S as v,a as k,i as x,l as q,m as _,n as E,u as C,v as S}from"./CaX2xgrP.js";import{n as N,r as I,t as L}from"./dT6WSX65.js";import{t as M}from"./ChJXhA9c.js";import{t as A}from"./CATr-3VW.js";import{n as B}from"./CJXPO3HP.js";import{n as R}from"./BkIDQGIs.js";import{t as V}from"./Bki5T_lb.js";import{n as z,r as F,t as O}from"./EjMoIoSK.js";import{n as P}from"./CVRTTCyF.js";import{t as H}from"./C3dOFk9A.js";import{a as D,i as U,n as $,o as j,r as W,s as G,t as K}from"./CsfDBJh72.js";import{a as Q,n as Y,o as Z,r as J,t as X}from"./DZtaQWVG2.js";function tt(t,e){const[i,n]=t;if(i===e)return t;if(void 0!==n&&void 0!==e&&void 0!==i&&e===n&&Math.abs(e-i)<=20){const s=Math.min(i,e),o=Math.max(i,e);return s===i&&o===n?t:[s,o]}return[e,i]}function et(t,e,i){const[[n],r]=s(tt,[i]),a=function(t){const[e,i]=l(t);return t===e||t&&e&&t.length===e.length&&!t.some((t,i)=>t!==e[i])?e:(i(t),t)}(e),c=o(void 0);return{containerRef:u(e=>{c.current?.disconnect(),c.current=void 0;const i=()=>r(function(t,e){let i=t?.clientWidth;if(void 0!==i&&e&&e.length>0){const t=[...e.filter(t=>t>0)].sort((t,e)=>e-t);t.push(Math.floor(t[t.length-1]/2)),i=t.find((e,n)=>e<=i||n===t.length-1)}return i}(e,a));i(),e&&"undefined"!=typeof ResizeObserver&&(c.current=new ResizeObserver(i),c.current.observe(e)),"function"==typeof t?t(e):t&&(t.current=e)},[t,a]),containerWidth:n}}function it(t){return["react-photo-album",t].filter(Boolean).join("--")}function nt({width:t,height:e}){const i=t/e;return Number.isFinite(i)?i:1}var st=Object.freeze([1200,600,300,0]);function ot(t,e){return"function"==typeof t?t(e):t}function rt(t,e){return void 0!==e?ot(t,e):void 0}function lt(t,e,i,n=0){if(void 0===e)return;const s=rt(t,e);return Math.round(Math.max(void 0===s?function(t,e){const i=st.findIndex(t=>t<=e);return ot(t[Math.max(i,0)],e)}(i,e):s,n))}function at(t,{spacing:e,padding:i,componentsProps:n,render:s}){return{spacing:lt(e,t,[20,15,10,5]),padding:lt(i,t,[0,0,0,0]),componentsProps:ot(n,t)||{},render:ot(s,t)}}function ct(t,e=0){const i=10**e;return Math.round((t+Number.EPSILON)*i)/i}function dt(t,e,i,n,s,o,r){let l,a;const c=t=>{const e=o*(s-1)+2*r*s;return`calc((${t.match(/^\s*calc\((.*)\)\s*$/)?.[1]??t} - ${e}px) / ${ct((n-e)/i,5)})`},d=t.srcSet;return d&&d.length>0&&(l=d.concat(d.some(({width:e})=>e===t.width)?[]:[{src:t.src,width:t.width,height:t.height}]).sort((t,e)=>t.width-e.width).map(t=>`${t.src} ${t.width}w`).join(", ")),a=e?.size?(e.sizes||[]).map(({viewport:t,size:e})=>`${t} ${c(e)}`).concat(c(e.size)).join(", "):`${Math.ceil(i/n*100)}vw`,{srcSet:l,sizes:a}}var ht=a(function({as:t,render:e,context:i,classes:n=[],variables:s={},style:o,className:r,children:l,...a},c){const d=function(...t){return t.filter(Boolean).join(" ")}(...(Array.isArray(n)?n:[n]).filter(t=>"string"==typeof t).map(it),r),h={style:{...Object.fromEntries(Object.entries(s).map(([t,e])=>{return[(i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),`--${it(i)}`),"number"==typeof e?ct(e,5):e];var i})),...o},className:d,children:l,...a};if(e){const t=e({ref:c,...h},i);if(t)return t}return p(t||"div",{ref:c,...h})}),pt=a(function({photo:t,index:e,width:i,height:n,onClick:s,render:{wrapper:o,link:r,button:l,image:a,extras:c}={},componentsProps:{link:d,button:h,wrapper:u,image:m}={}},g){const{href:f}=t,w={photo:t,index:e,width:ct(i,3),height:ct(n,3)};let b;return b=f?{...d,as:"a",render:r,classes:["photo","link"],href:f,onClick:s}:s?{...h,as:"button",type:"button",render:l,classes:["photo","button"],onClick:s}:{...u,render:o,classes:"photo"},p(ht,{ref:g,variables:{photoWidth:w.width,photoHeight:w.height},context:w,...b,children:[p(ht,{as:"img",classes:"image",render:a,context:w,...m}),c?.({},w)]})}),ut=a(function({layout:e,sizes:i,model:n,skeleton:s,onClick:o,render:{container:r,track:l,photo:a,...c}={},componentsProps:{container:d,track:h,link:u,button:m,wrapper:g,image:f}={}},w){const{spacing:b,padding:T,containerWidth:y,tracks:v,variables:k,horizontal:x}=n||{};return p(ht,{role:"group","aria-label":"Photo album",...d,variables:{spacing:b,padding:T,containerWidth:y,...k},classes:["",e],render:r,ref:w,children:[void 0!==b&&void 0!==T&&void 0!==y&&v?.map(({photos:e,variables:n},s)=>{const r=e.length,d=x?r:v.length;return t(ht,{...h,key:s,render:l,classes:"track",variables:{trackSize:r,...n}},e.map(t=>{const{photo:e,index:n,width:s}=t,{key:r,src:l,alt:h="",title:w,label:v}=e,k=o?t=>{o({event:t,photo:e,index:n})}:void 0;if(a){const e=a({onClick:k},t);if(e)return e}const x=t=>v?{"aria-label":v,...t}:t;return p(pt,{onClick:k,render:c,componentsProps:{image:{loading:"lazy",decoding:"async",src:l,alt:h,title:w,...dt(e,i,s,y,d,b,T),...ot(f,t)},link:x(ot(u,t)),button:x(ot(m,t)),wrapper:ot(g,t)},...t},r??n)}))}),void 0===y&&s]})});function mt(t,e,i,n){return(e-(t.length-1)*i-2*n*t.length)/t.reduce((t,e)=>t+nt(e),0)}function gt(t,e,i,n,s,o,r){const l=t.slice(e,i),a=mt(l,n,s,o);return a>0?(a-r)**2*l.length:void 0}var ft=a(function({photos:t,breakpoints:e,defaultContainerWidth:i,...n},s){const{containerRef:o,containerWidth:r}=et(s,e,i),{spacing:l,padding:a,targetRowHeight:c,minPhotos:d,maxPhotos:u,...m}=function(t,{photos:e,targetRowHeight:i,rowConstraints:n,...s}){const{spacing:o,padding:r,componentsProps:l,render:a}=at(t,s),{singleRowMaxHeight:c,minPhotos:d,maxPhotos:h}=rt(n,t)||{};if(void 0!==c&&void 0!==o&&void 0!==r){const t=Math.floor(e.reduce((t,{width:e,height:i})=>t+e/i*c+2*r,o*(e.length-1)));t>0&&(l.container={...l.container},l.container.style={maxWidth:t,...l.container.style})}return{...s,targetRowHeight:lt(i,t,[t=>t/5,t=>t/4,t=>t/3,t=>t/2]),render:a,spacing:o,padding:r,minPhotos:d,maxPhotos:h,componentsProps:l}}(r,{photos:t,...n});return p(ut,{layout:"rows",ref:o,model:h(()=>void 0!==r&&void 0!==l&&void 0!==a&&void 0!==c?function(t,e,i,n,s,o,r){const l=Math.min(function(t,e,i,n){return ct(e/i/Math.min(...t.map(t=>nt(t))))+(n||0)+2}(t,n,s,o),r||1/0),a=o||1,c=t.length,d=new Array(c+1).fill(1/0),h=new Array(c+1).fill(-1);d[0]=0;for(let m=1;m<=c;m+=1)for(let o=m-a;o>=Math.max(0,m-l);o-=1){if(d[o]===1/0)continue;const r=gt(t,o,m,n,e,i,s);if(void 0===r)break;const l=d[o]+r;(d[m]===1/0||d[m]>l&&(d[m]/l>1.005||-1!==h[m]&&h[m]<o))&&(d[m]=l,h[m]=o)}if(d[c]===1/0)return;const p=[];for(let m=c;0!==m;m=h[m])p.push(m);p.push(0),p.reverse();const u=[];for(let m=1;m<p.length;m+=1){const s=t.slice(p[m-1],p[m]).map((t,e)=>({photo:t,index:p[m-1]+e})),o=mt(s.map(({photo:t})=>t),n,e,i);u.push({photos:s.map(({photo:t,index:e})=>({photo:t,index:e,width:o*nt(t),height:o}))})}return{spacing:e,padding:i,containerWidth:n,tracks:u,horizontal:!0}}(t,l,a,r,c,d,u):void 0,[t,l,a,r,c,d,u]),...m})});function wt(t,e,i,n,s,o,r){const l=[],a=r.reduce((t,e)=>t+e,0);for(let c=0;c<t.length-1;c+=1){const d=e.slice(t[c],t[c+1]).map((e,i)=>({photo:e,index:t[c]+i})),h=r.reduce((t,e,i)=>t+(o[c]-o[i])*e,0),p=(s-(t.length-2)*i-2*(t.length-1)*n-h)*r[c]/a;l.push({photos:d.map(({photo:t,index:e})=>({photo:t,index:e,width:p,height:p/nt(t)})),variables:{adjustedGaps:h,columnRatio:r[c]}})}return{tracks:l,variables:{totalRatio:a}}}function bt(t,e,i,n,s,o){const r=[],l=[];if(t.length<=o){const s=t.length>0?t.reduce((t,e)=>t+nt(e),0)/t.length:1;for(let e=0;e<o;e+=1)r[e]=2*i,l[e]=e<t.length?nt(t[e]):s;return wt(Array.from({length:o+1},(e,i)=>Math.min(i,t.length)),t,e,i,n,r,l)}const a=(c=function(t,e,i,n,s){return o=>{const r=[],l=1.5*s;let a=n/nt(t[o])+2*i;for(let c=o+1;c<t.length+1&&(r.push([c,(s-a)**2]),!(a>l||c===t.length));c+=1)a+=n/nt(t[c])+e+2*i;return r}}(t,e,i,s,(t.reduce((t,e)=>t+s/nt(e),0)+e*(t.length-o)+2*i*t.length)/o),d=o,h=0,p=t.length,function(t,e,i){const n=[i];for(let s=i,o=e;o>0;o-=1)[s]=t.get(s)[o],n.push(s);return n.reverse()}(function(t,e,i,n){const s=/* @__PURE__ */new Map,o=/* @__PURE__ */new Set;o.add(i);for(let r=0;r<e;r+=1){const i=[...o.keys()];o.clear(),i.forEach(i=>{const l=r>0?s.get(i)[r][1]:0;t(i).forEach(([t,a])=>{let c=s.get(t);c||(c=[],s.set(t,c));const d=l+a,h=c[r+1];(!h||h[1]>d&&(h[1]/d>1.0001||i<h[0]))&&(c[r+1]=[i,d]),r<e-1&&t!==n&&o.add(t)})})}return s}(c,d,h,p),d,p));var c,d,h,p;for(let u=0;u<a.length-1;u+=1){const n=t.slice(a[u],a[u+1]);r[u]=e*(n.length-1)+2*i*n.length,l[u]=1/n.reduce((t,e)=>t+1/nt(e),0)}return wt(a,t,e,i,n,r,l)}function Tt(t,e,i,n,s){const{tracks:o,variables:r}=bt(t,e,i,n,(n-e*(s-1)-2*i*s)/s,s);return o.some(t=>t.photos.some(({width:t,height:e})=>t<=0||e<=0))?s>1?Tt(t,e,i,n,s-1):void 0:{tracks:o,spacing:e,padding:i,containerWidth:n,variables:{columns:s,...r}}}var yt=a(function({photos:t,breakpoints:e,defaultContainerWidth:i,...n},s){const{containerRef:o,containerWidth:r}=et(s,e,i),{spacing:l,padding:a,columns:c,...d}=function(t,{columns:e,...i}){return{...i,...at(t,i),columns:lt(e,t,[5,4,3,2],1)}}(r,{photos:t,...n});return p(ut,{layout:"columns",ref:o,model:h(()=>void 0!==r&&void 0!==l&&void 0!==a&&void 0!==c?Tt(t,l,a,r,c):void 0,[t,l,a,r,c]),...d})});function vt(t,e,i,n,s){const o=(n-e*(s-1)-2*i*s)/s;if(o<=0)return s>1?vt(t,e,i,n,s-1):void 0;const r=[];for(let a=0;a<s;a+=1)r[a]=0;const l=t.reduce((t,n,s)=>{const l=r.reduce((t,e,i)=>e<r[t]-1?i:t,0);return r[l]=r[l]+o/nt(n)+e+2*i,t[l].push({photo:n,index:s}),t},Array.from({length:s},()=>[]));return{spacing:e,padding:i,containerWidth:n,variables:{columns:s},tracks:l.map(t=>({photos:t.map(({photo:t,index:e})=>({photo:t,index:e,width:o,height:o/nt(t)}))}))}}var kt=a(function({photos:t,breakpoints:e,defaultContainerWidth:i,...n},s){const{containerRef:o,containerWidth:r}=et(s,e,i),{spacing:l,padding:a,columns:c,...d}=function(t,{columns:e,...i}){return{...i,...at(t,i),columns:lt(e,t,[5,4,3,2],1)}}(r,{photos:t,...n});return p(ut,{layout:"masonry",ref:o,model:h(()=>void 0!==r&&void 0!==l&&void 0!==a&&void 0!==c?vt(t,l,a,r,c):void 0,[t,l,a,r,c]),...d})}),xt='url("https://res.cloudinary.com/dectzk2b2/image/upload/v1736933014/black_rpie3v.png")',qt=class{constructor(t){this.backdropOn=!1,this.lightbox=t,this.backgroundElement=null,this.backgroundVideoElement=null,this.referenceVideoElement=null,this.options={toggleBackdropButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}initPswpEvents(t){t.on("afterInit",()=>{setTimeout(()=>{this.backgroundElement.style.display="block",this.backgroundVideoElement.style.display="block"},[500])}),t.on("uiRegister",()=>{t.ui.registerElement({name:"toggle-backdrop-button",title:"Toggle blur backdrop",order:this.options.toggleBackdropButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-show-backdrop"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-backdrop"/><path id="pswp__icn-show-backdrop" style="display:none" d="M3 14.5q-.2 0-.35-.15T2.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-4q-.2 0-.35-.15T2.5 10t.15-.35T3 9.5t.35.15t.15.35t-.15.35t-.35.15M6 19q-.425 0-.712-.288T5 18t.288-.712T6 17t.713.288T7 18t-.288.713T6 19m0-4q-.425 0-.712-.288T5 14t.288-.712T6 13t.713.288T7 14t-.288.713T6 15m0-4q-.425 0-.712-.288T5 10t.288-.712T6 9t.713.288T7 10t-.288.713T6 11m0-4q-.425 0-.712-.288T5 6t.288-.712T6 5t.713.288T7 6t-.288.713T6 7m4 8.5q-.625 0-1.062-.437T8.5 14t.438-1.062T10 12.5t1.063.438T11.5 14t-.437 1.063T10 15.5m0-4q-.625 0-1.062-.437T8.5 10t.438-1.062T10 8.5t1.063.438T11.5 10t-.437 1.063T10 11.5m0 7.5q-.425 0-.712-.288T9 18t.288-.712T10 17t.713.288T11 18t-.288.713T10 19m0-12q-.425 0-.712-.288T9 6t.288-.712T10 5t.713.288T11 6t-.288.713T10 7m0 14.5q-.2 0-.35-.15T9.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-18q-.2 0-.35-.15T9.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 12q-.625 0-1.062-.437T12.5 14t.438-1.062T14 12.5t1.063.438T15.5 14t-.437 1.063T14 15.5m0-4q-.625 0-1.062-.437T12.5 10t.438-1.062T14 8.5t1.063.438T15.5 10t-.437 1.063T14 11.5m0 7.5q-.425 0-.712-.288T13 18t.288-.712T14 17t.713.288T15 18t-.288.713T14 19m0-12q-.425 0-.712-.288T13 6t.288-.712T14 5t.713.288T15 6t-.288.713T14 7m0 14.5q-.2 0-.35-.15T13.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-18q-.2 0-.35-.15T13.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M18 19q-.425 0-.712-.288T17 18t.288-.712T18 17t.713.288T19 18t-.288.713T18 19m0-4q-.425 0-.712-.288T17 14t.288-.712T18 13t.713.288T19 14t-.288.713T18 15m0-4q-.425 0-.712-.288T17 10t.288-.712T18 9t.713.288T19 10t-.288.713T18 11m0-4q-.425 0-.712-.288T17 6t.288-.712T18 5t.713.288T19 6t-.288.713T18 7m3 7.5q-.2 0-.35-.15T20.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-4q-.2 0-.35-.15T20.5 10t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15"/><path id="pswp__icn-hide-backdrop" d="m19.1 21.9l-17-17q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l17 17q.275.275.275.7t-.275.7t-.7.275t-.7-.275m-9.1-.4q-.2 0-.35-.15T9.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 0q-.2 0-.35-.15T13.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M6 19q-.425 0-.712-.288T5 18t.288-.712T6 17t.713.288T7 18t-.288.713T6 19m4 0q-.425 0-.712-.288T9 18t.288-.712T10 17t.713.288T11 18t-.288.713T10 19m4 0q-.425 0-.712-.288T13 18t.288-.712T14 17t.713.288T15 18t-.288.713T14 19m-4-3.5q-.65 0-1.075-.425T8.5 14t.425-1.075T10 12.5t1.075.425T11.5 14t-.425 1.075T10 15.5M6 15q-.425 0-.712-.288T5 14t.288-.712T6 13t.713.288T7 14t-.288.713T6 15m11.8-.025l-.775-.775q-.1-.5.213-.85T18 13q.425 0 .713.288T19 14q0 .45-.35.763t-.85.212M3 14.5q-.2 0-.35-.15T2.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m18 0q-.2 0-.35-.15T20.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m-6.7-3.05L12.55 9.7q.125-.525.5-.862T14 8.5q.65 0 1.075.425T15.5 10q0 .575-.35.963t-.85.487M6 11q-.425 0-.712-.287T5 10t.288-.712T6 9t.713.288T7 10t-.288.713T6 11m12 0q-.425 0-.712-.288T17 10t.288-.712T18 9t.713.288T19 10t-.288.713T18 11m-15-.5q-.2 0-.35-.15T2.5 10t.15-.35T3 9.5t.35.15t.15.35t-.15.35t-.35.15m18 0q-.2 0-.35-.15T20.5 10t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M14 7q-.425 0-.712-.288T13 6t.288-.712T14 5t.713.288T15 6t-.288.713T14 7m-4.175-.025l-.8-.8q-.075-.5.225-.837T10 5q.425 0 .712.287T11 6q0 .45-.337.75t-.838.225M18 7q-.425 0-.712-.288T17 6t.288-.712T18 5t.713.288T19 6t-.288.713T18 7m-8-3.5q-.2 0-.35-.15T9.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 0q-.2 0-.35-.15T13.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15" /></svg>',onClick:()=>{this.toggleBackdrop(t)}}),this.createBlurBackground(t)}),t.on("change",()=>{this.backdropOn&&this.updateBlurBackground(t)}),t.on("close",()=>{this.removeBlurBackground(),this.backdropOn=!1})}createBlurBackground(t){const e=t.element;if(!this.backgroundElement){const t=document.createElement("div");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="100vw",t.style.height="100vh",t.style.backgroundSize="cover",t.style.backgroundPosition="center",t.style.filter="blur(44px)",t.style.zIndex=-1,t.style.transition="background-image 0.5s ease, opacity 0.5s ease",t.style.display="none",t.style.backgroundImage=xt,e.append(t),this.backgroundElement=t}if(!this.backgroundVideoElement){const t=document.createElement("video");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="100vw",t.style.height="100vh",t.style.objectFit="cover",t.style.filter="blur(44px)",t.style.zIndex=-1,t.style.display="none",t.style.transition="opacity 0.5s ease",t.muted=!0,t.loop=!0,t.autoplay=!1,t.muted=!0,t.volume=0,e.append(t),this.backgroundVideoElement=t}}toggleBackdrop(t){this.backdropOn?(this.backgroundElement.style.backgroundImage=xt,this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.pause(),this.backdropOn=!1):(this.updateBlurBackground(t),this.backdropOn=!0);const e=this.querySelector("#pswp__icn-hide-backdrop"),i=this.querySelector("#pswp__icn-show-backdrop");e&&(e.style.display=this.backdropOn?"none":"inline"),i&&(i.style.display=this.backdropOn?"inline":"none")}updateBlurBackground(t){const e=t.currSlide;if(e?.data)if("video"===e.data.type){const t=this.backgroundVideoElement,i=e.content.element;"video"===i?.tagName?.toLowerCase()&&(this.referenceVideoElement=i,this.registerVideoEvents(i,t)),t.style.opacity=0,setTimeout(()=>{t.src=e.data.src,t.load(),this.initBackgroundVideo(),t.style.opacity=1},500),this.backgroundElement&&(this.backgroundElement.style.opacity=0)}else{if(this.backgroundElement){const t=((t,e=32,i=32)=>{if(!t||t.length<6||"undefined"==typeof document)return null;try{const n=R(t,e,i),s=document.createElement("canvas");s.width=e,s.height=i;const o=s.getContext("2d");if(!o)return null;const r=o.createImageData(e,i);return r.data.set(n),o.putImageData(r,0,0),s.toDataURL()}catch(n){return console.warn("[PhotoSwipeBackdrop] Failed to decode blurhash:",n),null}})(e.data.blurhash)||e.data.thumbnailUrl||e.data.src;this.backgroundElement.style.backgroundImage=t?`url("${t}")`:xt,this.backgroundElement.style.backgroundColor="transparent",this.backgroundElement.style.opacity=1}this.backgroundVideoElement&&(this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.src="")}}initBackgroundVideo(){this.referenceVideoElement&&(this.backgroundVideoElement.currentTime=this.referenceVideoElement.currentTime,this.referenceVideoElement.currentTime>0&&!this.referenceVideoElement.paused&&!this.referenceVideoElement.ended&&this.referenceVideoElement.readyState>2&&this.backgroundVideoElement.play())}removeBlurBackground(){this.backgroundElement&&(this.backgroundElement.remove(),this.backgroundVideoElement.remove(),this.backgroundElement=null,this.backgroundVideoElement=null)}registerVideoEvents(t,e){this.foregroundVideoElement=t,t.addEventListener("play",()=>{e.currentTime=t.currentTime,e.play()}),t.addEventListener("pause",()=>{e.pause()}),t.addEventListener("ended",()=>{e.pause(),e.currentTime=0})}},_t=class{constructor(t,e={}){this.lightbox=t,this.options={filmstripButtonOrder:e.filmstripButtonOrder||7,height:e.height||112,thumbnailHeight:e.thumbnailHeight||64,thumbnailWidth:e.thumbnailWidth||96,itemMargin:e.itemMargin??4,buffer:e.buffer??5,backgroundColor:e.backgroundColor||"rgba(0, 0, 0, 0.6)",activeBorderColor:e.activeBorderColor||"#ff4800",...e},this.itemWidth=this.options.thumbnailWidth+this.options.itemMargin,this.filmstripVisible=!0,this.filmstripContainer=null,this.filmstripContent=null,this.filmstripTrack=null,this.isAnimating=!1,this.thumbnailPool=/* @__PURE__ */new Map,this.contents=[],this.scrollTickPending=!1,this.scrollHandler=this.scrollHandler.bind(this),this.handleThumbnailClick=this.handleThumbnailClick.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}getElementById(t){const e=this.getRootNode();return"function"==typeof e.getElementById?e.getElementById(t):e.querySelector?.(`#${t}`)||document.getElementById(t)}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}initPswpEvents(t){this.pswp=t,t.on("uiRegister",()=>{this.registerToggleButton(),this.registerFilmstripContainer()}),t.on("afterInit",()=>{this.filmstripContainer=this.getElementById("pswp-filmstrip-container"),this.filmstripContainer&&this.injectStyles()}),t.on("openingAnimationEnd",()=>{this.filmstripVisible&&!this.isAnimating&&requestAnimationFrame(()=>this.showFilmstrip())}),t.on("change",()=>{this.filmstripVisible&&this.filmstripContent&&this.updateActiveSlide(t.currSlide?.index??0)}),t.on("bindEvents",()=>{document.addEventListener("keydown",this.handleKeyDown)}),t.on("close",()=>{document.removeEventListener("keydown",this.handleKeyDown),this.cleanupFilmstrip()})}injectStyles(){const t="pswp-filmstrip-styles",e=this.getRootNode(),i=e.head??e;if(i.querySelector?.(`#${t}`))return;const n=document.createElement("style");n.id=t,n.textContent=`\n #pswp-filmstrip-container {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 1000;\n transform: translateY(100%);\n transition: transform 0.3s ease-in-out;\n pointer-events: none;\n }\n\n #pswp-filmstrip-container.pswp-filmstrip--visible {\n transform: translateY(0);\n pointer-events: auto;\n }\n\n .pswp-filmstrip {\n position: relative;\n height: ${this.options.height}px;\n background-color: ${this.options.backgroundColor};\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: none;\n -ms-overflow-style: none;\n scroll-behavior: auto;\n user-select: none;\n -webkit-user-select: none;\n padding: 8px 16px;\n box-sizing: border-box;\n }\n\n .pswp-filmstrip::-webkit-scrollbar {\n display: none;\n }\n\n .pswp-filmstrip__track {\n position: relative;\n height: 100%;\n min-width: 100%;\n }\n\n .pswp-filmstrip__item {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n display: inline-flex;\n flex-shrink: 0;\n padding: 0;\n border: none;\n background: none;\n cursor: pointer;\n outline: none;\n border-radius: 4px;\n overflow: hidden;\n transition: transform 0.15s ease;\n }\n\n .pswp-filmstrip__item:hover {\n transform: translateY(-50%) scale(1.05);\n }\n\n .pswp-filmstrip__item:active {\n transform: translateY(-50%) scale(0.95);\n }\n\n .pswp-filmstrip__thumb {\n width: ${this.options.thumbnailWidth}px;\n height: ${this.options.thumbnailHeight}px;\n border-radius: 4px;\n overflow: hidden;\n position: relative;\n border: 2px solid transparent;\n transition: border-color 0.2s ease;\n background-color: #333;\n }\n\n .pswp-filmstrip__thumb--active {\n border-color: ${this.options.activeBorderColor};\n }\n\n .pswp-filmstrip__img {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n object-position: center;\n z-index: 2;\n opacity: 0;\n transform: scale(0.95);\n transition: opacity 0.3s ease, transform 0.3s ease;\n }\n\n .pswp-filmstrip__img--loaded {\n opacity: 1;\n transform: scale(1);\n }\n\n .pswp-filmstrip__overlay {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 3;\n pointer-events: none;\n }\n\n .pswp-filmstrip__overlay-icon {\n width: 24px;\n height: 24px;\n opacity: 0.8;\n }\n\n .pswp-filmstrip__ad-label {\n position: absolute;\n top: 4px;\n left: 4px;\n font-size: 10px;\n color: white;\n background-color: rgba(0, 0, 0, 0.6);\n padding: 2px 6px;\n border-radius: 3px;\n z-index: 3;\n }\n\n @media (min-width: 1024px) {\n .pswp-filmstrip__thumb {\n width: 80px;\n height: 80px;\n }\n\n .pswp-filmstrip__overlay-icon {\n width: 28px;\n height: 28px;\n }\n }\n `,i.appendChild(n)}registerToggleButton(){this.pswp.ui.registerElement({name:"filmstrip-toggle-button",title:"Toggle filmstrip",order:this.options.filmstripButtonOrder,isButton:!0,html:this.getToggleButtonHtml(),onClick:()=>this.toggleFilmstrip()})}registerFilmstripContainer(){this.pswp.ui.registerElement({name:"filmstrip",isButton:!1,appendTo:"root",html:'<div id="pswp-filmstrip-container"></div>'})}getToggleButtonHtml(){return'\n <svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24" width="24" height="24" id="pswp-filmstrip-icon-show">\n <path d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4v2.85L1.35 4.2q-.3-.3-.3-.712t.3-.713t.713-.3t.712.3l18.4 18.4q.3.3.3.7t-.3.7t-.712.3t-.713-.3L17.15 20zm0-2h11.15l-10-10H4zM22 6v11q0 .5-.312.75T21 18t-.687-.262t-.313-.763V8h-8.325q-.4 0-.763-.15t-.637-.425L8.55 5.7q-.225-.25-.275-.525t.075-.55t.35-.45T9.275 4H20q.825 0 1.413.588T22 6" />\n <path d="m 5.100795,16.58464 q -0.165328,0 -0.282961,-0.116899 Q 4.700201,16.350842 4.7,16.186347 V 13.398294 Q 4.7,13.233997 4.817834,13.117098 4.935667,13.000199 5.100795,13 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n <path d="m 10.572143,16.65489 q -0.165327,0 -0.282961,-0.116899 -0.117632,-0.116899 -0.117833,-0.281394 v -2.788053 q 0,-0.164297 0.117833,-0.281196 0.117834,-0.116899 0.282961,-0.117098 h 2.805562 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n <path d="m 16.049385,16.724729 q -0.165327,0 -0.282961,-0.116899 -0.117632,-0.116899 -0.117833,-0.281394 v -2.788053 q 0,-0.164297 0.117833,-0.281196 0.117834,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117634,0.281196 v 2.788053 q 0,0.164296 -0.117634,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n </svg>\n <svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24" width="24" height="24" id="pswp-filmstrip-icon-hide" style="display:none">\n <path d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h16q.825 0 1.413.588T22 6v12q0 .825-.587 1.413T20 20zm0-2h16V8H4z" />\n <path d="m 5.100795,16.58464 q -0.165328,0 -0.282961,-0.116899 Q 4.700201,16.350842 4.7,16.186347 V 13.398294 Q 4.7,13.233997 4.817834,13.117098 4.935667,13.000199 5.100795,13 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n <path d="m 10.572144,16.65489 q -0.165329,0 -0.282961,-0.116899 -0.117633,-0.116899 -0.117834,-0.281394 v -2.788053 q 0,-0.164297 0.117834,-0.281196 0.117832,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n <path d="m 16.049385,16.724729 q -0.165328,0 -0.282961,-0.116899 -0.117633,-0.116899 -0.117834,-0.281394 v -2.788053 q 0,-0.164297 0.117834,-0.281196 0.117833,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117634,0.281196 v 2.788053 q 0,0.164296 -0.117634,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n </svg>\n '}setCaptionOffset(t){const e=this.getElementById("pswp-caption-container");e&&(e.style.bottom=t?"7rem":"0")}showFilmstrip(){if(!this.filmstripContainer||!this.pswp)return;const t=this.getContentsFromPswp().filter(t=>t&&t.thumbnailUrl);if(0===t.length)return;this.isAnimating=!0,this.contents=t;const e=this.pswp.currSlide?.index??0;this.createFilmstripContent(t,e),this.filmstripContainer.classList.add("pswp-filmstrip--visible"),this.filmstripVisible=!0;const i=this.querySelector(".pswp");i&&i.classList.add("pswp-filmstrip-active"),this.setCaptionOffset(!0),this.updateToggleIcon(),setTimeout(()=>{this.isAnimating=!1},300)}hideFilmstrip(){if(!this.filmstripContainer)return;this.isAnimating=!0,this.filmstripContainer.classList.remove("pswp-filmstrip--visible"),this.filmstripVisible=!1;const t=this.querySelector(".pswp");t&&t.classList.remove("pswp-filmstrip-active"),this.setCaptionOffset(!1),this.updateToggleIcon(),setTimeout(()=>{this.filmstripContainer&&(this.filmstripContainer.innerHTML=""),this.filmstripContent=null,this.filmstripTrack=null,this.thumbnailPool.clear(),this.contents=[],this.isAnimating=!1},300)}toggleFilmstrip(){this.isAnimating||(this.filmstripVisible?this.hideFilmstrip():this.showFilmstrip())}updateToggleIcon(){const t=this.getElementById("pswp-filmstrip-icon-show"),e=this.getElementById("pswp-filmstrip-icon-hide");t&&(t.style.display=this.filmstripVisible?"none":"block"),e&&(e.style.display=this.filmstripVisible?"block":"none")}createFilmstripContent(t,e){if(!this.filmstripContainer)return;const i=document.createElement("div");i.className="pswp-filmstrip",i.id="pswp-filmstrip-content";const n=document.createElement("div");n.className="pswp-filmstrip__track",n.style.width=t.length*this.itemWidth+"px",i.appendChild(n),this.filmstripContainer.innerHTML="",this.filmstripContainer.appendChild(i),this.filmstripContent=i,this.filmstripTrack=n,i.addEventListener("scroll",this.scrollHandler,{passive:!0}),this.renderVisibleThumbnails(e,!0)}scrollHandler(){!this.scrollTickPending&&this.filmstripContent&&(this.scrollTickPending=!0,requestAnimationFrame(()=>{this.scrollTickPending=!1,this.filmstripContent&&this.renderVisibleThumbnails(this.pswp?.currSlide?.index??0,!1)}))}renderVisibleThumbnails(t,e){if(!this.filmstripContent||!this.filmstripTrack)return;const i=this.filmstripContent,n=this.filmstripTrack,s=this.contents,o=s.length;if(0===o)return;const r=i.clientWidth,l=i.scrollLeft,a=this.options.buffer;let c=Math.floor(l/this.itemWidth)-a,d=Math.ceil((l+r)/this.itemWidth)+a;c=Math.max(0,c),d=Math.min(o-1,d);for(const[h,p]of this.thumbnailPool)(h<c||h>d)&&(p.parentNode&&p.parentNode.removeChild(p),this.thumbnailPool.delete(h));for(let h=c;h<=d;h++){const e=s[h];if(!e||!e.thumbnailUrl)continue;let i=this.thumbnailPool.get(h);const o=h===t;i?this.updateThumbnailState(i,h,o):(i=this.createThumbnailButton(e,h,o),i.style.left=h*this.itemWidth+"px",n.appendChild(i),this.thumbnailPool.set(h,i))}e&&requestAnimationFrame(()=>this.scrollToThumbnail(t))}createThumbnailButton(t,e,i){const n=document.createElement("button");n.className="pswp-filmstrip__item",n.setAttribute("data-index",e),n.setAttribute("type","button"),n.setAttribute("aria-label",`Go to slide ${e+1}`);const s=document.createElement("div");s.className="pswp-filmstrip__thumb "+(e===i?"pswp-filmstrip__thumb--active":""),s.setAttribute("data-thumb-index",e);const o=document.createElement("img");if(o.className="pswp-filmstrip__img",o.alt=t.caption||`Slide ${e+1}`,o.loading="lazy",o.decoding="async",o.onload=()=>o.classList.add("pswp-filmstrip__img--loaded"),o.src=t.thumbnailUrl,s.appendChild(o),"VIDEO"===t.type){const t=document.createElement("div");t.className="pswp-filmstrip__overlay",t.innerHTML='\n <svg class="pswp-filmstrip__overlay-icon" viewBox="0 0 24 24" fill="white">\n <path d="M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"/>\n </svg>\n ',s.appendChild(t)}return n.appendChild(s),n.addEventListener("click",this.handleThumbnailClick),n}updateThumbnailState(t,e,i){const n=t.querySelector(".pswp-filmstrip__thumb");n&&(i?(n.classList.add("pswp-filmstrip__thumb--active"),t.setAttribute("aria-current","true")):(n.classList.remove("pswp-filmstrip__thumb--active"),t.removeAttribute("aria-current")))}handleThumbnailClick(t){const e=t.currentTarget,i=parseInt(e.getAttribute("data-index"),10);this.pswp&&!isNaN(i)&&this.pswp.goTo(i)}updateActiveSlide(t){if(this.filmstripContent){for(const[e,i]of this.thumbnailPool)this.updateThumbnailState(i,e,e===t);this.scrollToThumbnail(t)}}scrollToThumbnail(t){if(!this.filmstripContent)return;const e=this.contents;if(t<0||t>=e.length)return;const i=this.filmstripContent,n=i.clientWidth/2,s=t*this.itemWidth+this.itemWidth/2;i.scrollTo({left:s-n,behavior:"smooth"})}handleKeyDown(t){this.filmstripVisible&&this.pswp&&("f"!==t.key&&"F"!==t.key||this.toggleFilmstrip())}getContentsFromPswp(){if(!this.pswp)return[];const t=this.pswp.options?.dataSource;if(t?.gallery)return this.getContentsFromDOM(t.gallery);const e="function"==typeof this.pswp.getNumItems?this.pswp.getNumItems():0;if(!e)return[];const i=[];for(let n=0;n<e;n++){let t=null;this.pswp.slides?.[n]?.data?t=this.pswp.slides[n].data:"function"==typeof this.pswp.getItemData&&(t=this.pswp.getItemData(n)),i.push(t||{})}return i.map((t,e)=>this.normalizeItem(t,e))}getContentsFromDOM(t){if(!t)return[];const e=t.querySelectorAll("a[href]");return Array.from(e).map((t,e)=>{const i=t.dataset,n=i.pswpThumbnailUrl||i.pswpMsrc||"",s=(i.pswpType||"").toString().toUpperCase(),o=i.pswpCaption||t.getAttribute("title")||"";return{id:i.pswpId||`item-${e}`,type:s,thumbnailUrl:n||i.pswpSrc||t.getAttribute("href")||"",caption:o}})}normalizeItem(t,e){try{const i=t||{},n=i.data||i,s=(n.type||n.pswpType||i.type||"").toString().toUpperCase(),o=n.thumbnailUrl||n.thumbnail||n.msrc||n.src||"";return{id:n.id||n._id||i.id||i._id||`item-${e}`,type:s,thumbnailUrl:o,caption:n.caption||n.alt||n.title||""}}catch{return{id:`item-${e}`,type:"",thumbnailUrl:"",caption:""}}}cleanupFilmstrip(){const t=this.querySelector(".pswp");t&&t.classList.remove("pswp-filmstrip-active"),this.setCaptionOffset(!1),this.filmstripContent&&(this.filmstripContent.removeEventListener("scroll",this.scrollHandler),this.filmstripContent.innerHTML=""),this.filmstripContainer&&(this.filmstripContainer.innerHTML="",this.filmstripContainer.classList.remove("pswp-filmstrip--visible")),this.filmstripContent=null,this.filmstripTrack=null,this.thumbnailPool.clear(),this.contents=[],this.filmstripVisible=!0,this.isAnimating=!1}},Et=class{constructor(t){this.lightbox=t,this.fullscreen=!1,this.options={fullScreenButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}syncFullscreenState(){const t=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;this.fullscreen=Boolean(t);const e=this.querySelector("#pswp__icn-exit-fullscreen"),i=this.querySelector("#pswp__icn-fullscreen");e&&(e.style.display=this.fullscreen?"inline":"none"),i&&(i.style.display=this.fullscreen?"none":"inline")}initPswpEvents(t){const e=()=>this.syncFullscreenState();t.events.add(document,"fullscreenchange",e),t.events.add(document,"webkitfullscreenchange",e),t.on("uiRegister",()=>{(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)&&t.ui.registerElement({name:"fullscreen-button",title:"Toggle fullscreen view",order:this.options.fullScreenButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-1" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-fullscreen"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-exit-fullscreen"/><path id="pswp__icn-fullscreen" d="M5 19h2q.425 0 .713.288T8 20t-.288.713T7 21H4q-.425 0-.712-.288T3 20v-3q0-.425.288-.712T4 16t.713.288T5 17zm14 0v-2q0-.425.288-.712T20 16t.713.288T21 17v3q0 .425-.288.713T20 21h-3q-.425 0-.712-.288T16 20t.288-.712T17 19zM5 5v2q0 .425-.288.713T4 8t-.712-.288T3 7V4q0-.425.288-.712T4 3h3q.425 0 .713.288T8 4t-.288.713T7 5zm14 0h-2q-.425 0-.712-.288T16 4t.288-.712T17 3h3q.425 0 .713.288T21 4v3q0 .425-.288.713T20 8t-.712-.288T19 7z"/><path id="pswp__icn-exit-fullscreen" style="display:none" d="M6 18H4q-.425 0-.712-.288T3 17t.288-.712T4 16h3q.425 0 .713.288T8 17v3q0 .425-.288.713T7 21t-.712-.288T6 20zm12 0v2q0 .425-.288.713T17 21t-.712-.288T16 20v-3q0-.425.288-.712T17 16h3q.425 0 .713.288T21 17t-.288.713T20 18zM6 6V4q0-.425.288-.712T7 3t.713.288T8 4v3q0 .425-.288.713T7 8H4q-.425 0-.712-.288T3 7t.288-.712T4 6zm12 0h2q.425 0 .713.288T21 7t-.288.713T20 8h-3q-.425 0-.712-.288T16 7V4q0-.425.288-.712T17 3t.713.288T18 4z"/></svg>',onClick:()=>{this.toggleFullscreen(t)}})})}toggleFullscreen(t){const e=t.element;this.fullscreen?(document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),t.options.showHideAnimationType="zoom",this.fullscreen=!1):(e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen(),t.options.showHideAnimationType="fade",this.fullscreen=!0);const i=this.querySelector("#pswp__icn-exit-fullscreen"),n=this.querySelector("#pswp__icn-fullscreen");i&&(i.style.display=this.fullscreen?"inline":"none"),n&&(n.style.display=this.fullscreen?"none":"inline")}},Ct=class{constructor(t,e={}){this.lightbox=t,this.autoHideTimer=null,this.uiVisible=!0,this.options=Object.assign({defaultDelayMs:4e3,playPauseButtonOrder:9,progressBarPosition:"top",progressBarTransition:"ease",restartOnSlideChange:!0,autoHideProgressBar:!0},e),this.setSlideshowLength(Number(localStorage.getItem("pswp_delay"))||this.options.defaultDelayMs),this.slideshowIsRunning=!1,this.slideshowTimerID=null,this.wakeLockIsRunning=!1,this.wakeLockSentinel=null,this.lightbox.on("init",()=>{this.init(this.lightbox.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}injectProgressBarStyles(){const t=this.getRootNode(),e=t===document?document.head:t;if(!e||e.querySelector("style[data-pswp-slideshow]"))return;const i=document.createElement("style");i.setAttribute("data-pswp-slideshow",""),i.textContent=`.pswp__progress-bar{position:fixed;${this.options.progressBarPosition}:0;width:0;height:0}.pswp__progress-bar.running{width:100%;height:2px;transition-property:width;background:#ff4800}`,e.appendChild(i)}init(t){t.on("uiRegister",()=>{this.injectProgressBarStyles(),t.ui.registerElement({name:"playpause-button",title:"Toggle slideshow (Space)\nChange delay with +/- while running",order:this.options.playPauseButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-play"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-stop"/><path id="pswp__icn-play" d="M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"/><path id="pswp__icn-stop" style="display:none" d="M16 19q-.825 0-1.412-.587T14 17V7q0-.825.588-1.412T16 5t1.413.588T18 7v10q0 .825-.587 1.413T16 19m-8 0q-.825 0-1.412-.587T6 17V7q0-.825.588-1.412T8 5t1.413.588T10 7v10q0 .825-.587 1.413T8 19"/></svg>',onClick:()=>{this.setSlideshowState()}}),t.ui.registerElement({name:"playtime",appendTo:"wrapper",tagName:"div",className:"pswp__progress-bar"}),t.events.add(document,"keydown",t=>{switch(t.code){case"Space":this.setSlideshowState(),t.preventDefault();break;case"ArrowUp":case"NumpadAdd":case"Equal":this.changeSlideshowLength(1e3),t.preventDefault();break;case"ArrowDown":case"NumpadSubtract":case"Minus":this.changeSlideshowLength(-1e3),t.preventDefault()}})}),this.lightbox.on("change",()=>{this.slideshowIsRunning&&this.options.restartOnSlideChange&&this.goToNextSlideAfterTimeout()}),this.lightbox.on("close",()=>{this.slideshowIsRunning&&this.setSlideshowState()})}showUI(){this.lightbox&&this.lightbox.pswp&&this.lightbox.pswp.element&&this.lightbox.pswp.element.classList.add("pswp--ui-visible"),this.uiVisible=!0}stopAutoHideTimer(){this.autoHideTimer&&(clearTimeout(this.autoHideTimer),this.autoHideTimer=null)}hideUI(){this.lightbox&&this.lightbox.pswp&&this.lightbox.pswp.element&&this.lightbox.pswp.element.classList.remove("pswp--ui-visible"),this.uiVisible=!1}resetAutoHideTimer(){this.autoHideTimer&&clearTimeout(this.autoHideTimer),this.autoHideTimer=setTimeout(()=>{this.slideshowIsRunning&&this.hideUI(),this.autoHideTimer=null},[3e3])}setSlideshowState(){this.slideshowIsRunning=!this.slideshowIsRunning,this.slideshowIsRunning?(this.goToNextSlideAfterTimeout(),this.showUI(),this.resetAutoHideTimer(),document.addEventListener("touchstart",()=>{this.stopAutoHideTimer(),this.showUI()}),document.addEventListener("touchend",()=>{this.resetAutoHideTimer()}),document.addEventListener("mousemove",()=>{this.uiVisible||this.showUI(),this.resetAutoHideTimer()})):(this.showUI(),this.resetSlideshow(),this.stopAutoHideTimer());const t=this.querySelector("#pswp__icn-stop"),e=this.querySelector("#pswp__icn-play");t&&(t.style.display=this.slideshowIsRunning?"inline":"none"),e&&(e.style.display=this.slideshowIsRunning?"none":"inline");const i=this.querySelector(".pswp__progress-bar");i&&(i.style.opacity=this.options.autoHideProgressBar?null:1),this.toggleWakeLock()}setSlideshowLength(t){this.options.defaultDelayMs=Math.min(Math.max(t,1e3),2147483647),this.options.defaultDelayMs!=t&&localStorage.setItem("pswp_delay",this.options.defaultDelayMs)}changeSlideshowLength(t){if(!this.slideshowIsRunning)return;this.setSlideshowLength(this.options.defaultDelayMs+t),localStorage.setItem("pswp_delay",this.options.defaultDelayMs);const e=this.querySelector(".pswp__counter");e&&(e.innerHTML=this.options.defaultDelayMs/1e3+"s"),this.goToNextSlideAfterTimeout()}isVideoContent(t){return"video"===t?.data?.type}getSlideTimeout(){const t=this.lightbox.pswp.currSlide.content;if(this.isVideoContent(t)){const e=t.element;if(e.paused)return this.options.defaultDelayMs;const i=e.duration,n=e.currentTime;return isNaN(i)||isNaN(n)?this.options.defaultDelayMs:1e3*(i-n)}return this.options.defaultDelayMs}slideContentHasLoaded(){const t=this.lightbox.pswp.currSlide.content;if(this.isVideoContent(t)){const e=t.element;return e.ended||e.readyState===HTMLMediaElement.HAVE_ENOUGH_DATA&&[HTMLMediaElement.NETWORK_IDLE,HTMLMediaElement.NETWORK_LOADING].includes(e.networkState)}return!t.isLoading()}goToNextSlideAfterTimeout(){if(this.resetSlideshow(),this.slideContentHasLoaded()){const t=this.getSlideTimeout();this.slideshowTimerID=setTimeout(()=>{this.lightbox.pswp.next(),this.options.restartOnSlideChange||this.goToNextSlideAfterTimeout()},t),setTimeout(()=>{this.slideshowIsRunning&&this.toggleProgressBar(t)},100)}else this.slideshowTimerID=setTimeout(()=>{this.goToNextSlideAfterTimeout()},200)}getSlideTransition(){return this.isVideoContent(this.lightbox.pswp.currSlide.content)?"linear":this.options.progressBarTransition}toggleProgressBar(t){const e=this.querySelector(".pswp__progress-bar");e&&(t?(e.style.transitionTimingFunction=this.getSlideTransition(),e.style.transitionDuration=`${t}ms`,e.classList.add("running")):e.classList.remove("running"))}toggleWakeLock(){this.wakeLockIsRunning!=this.slideshowIsRunning&&("keepAwake"in screen?screen.keepAwake=this.slideshowIsRunning:"wakeLock"in navigator&&(this.wakeLockSentinel?this.wakeLockSentinel.release().then(()=>(this.wakeLockSentinel=null,!0)).catch(t=>console.error(t)):navigator.wakeLock.request("screen").then(t=>(this.wakeLockSentinel=t,this.wakeLockSentinel.addEventListener("release",()=>{this.wakeLockSentinel=null,this.wakeLockIsRunning=!1}),!0)).catch(t=>{})),this.wakeLockIsRunning=this.slideshowIsRunning)}resetSlideshow(){this.toggleProgressBar(),this.slideshowTimerID&&(clearTimeout(this.slideshowTimerID),this.slideshowTimerID=null)}},St={[String(q.NONE)]:function({className:t}){/* @__PURE__ */
2
2
  return p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:t,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */p("path",{fill:"currentColor",d:"M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5z"})})},[q.LINK]:function({className:t}){/* @__PURE__ */
3
3
  return p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:t,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */p("path",{fill:"currentColor",d:"M7.95 21q-2.05 0-3.5-1.45T3 16.05q0-1 .375-1.9t1.075-1.6l2.625-2.625q.3-.3.713-.3t.712.3t.3.7t-.3.7l-2.65 2.65q-.425.425-.637.963T5 16.05q0 1.225.863 2.088T7.95 19q.575 0 1.125-.213t.975-.637l2.625-2.65q.3-.275.7-.275t.7.3t.3.7t-.3.7L11.45 19.55q-.7.7-1.6 1.075T7.95 21m1.25-6.2q-.3-.3-.3-.712t.3-.713L13.375 9.2q.3-.3.713-.3t.712.3t.3.713t-.3.712L10.625 14.8q-.3.3-.712.3t-.713-.3m6.3-.725q-.3-.3-.3-.7t.3-.7l2.65-2.625q.425-.425.625-.95t.2-1.1q0-1.25-.85-2.125T16.025 5q-.575 0-1.112.213t-.963.637L11.325 8.5q-.3.3-.7.3t-.7-.3t-.3-.712t.3-.713L12.55 4.45q.7-.7 1.6-1.075T16.05 3q2.05 0 3.488 1.45t1.437 3.525q0 .975-.363 1.875t-1.062 1.6l-2.625 2.625q-.3.3-.712.3t-.713-.3"})})},[q.EMAIL]:function({className:t}){/* @__PURE__ */
4
4
  return p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:t,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */p("path",{fill:"currentColor",d:"M12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12v1.45q0 1.475-1.012 2.513T18.5 17q-.875 0-1.65-.375t-1.3-1.075q-.725.725-1.638 1.088T12 17q-2.075 0-3.537-1.463T7 12t1.463-3.537T12 7t3.538 1.463T17 12v1.45q0 .65.425 1.1T18.5 15t1.075-.45t.425-1.1V12q0-3.35-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20h4q.425 0 .713.288T17 21t-.288.713T16 22zm2.125-7.875Q15 13.25 15 12t-.875-2.125T12 9t-2.125.875T9 12t.875 2.125T12 15t2.125-.875"})})},[q.PHONE]:function({className:t}){/* @__PURE__ */
@@ -16,20 +16,20 @@ return p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",view
16
16
  /* @__PURE__ */p("stop",{offset:"93.482%","stop-color":"#ff5280"}),
17
17
  /* @__PURE__ */p("stop",{offset:"100%","stop-color":"#ff7061"})]})}),
18
18
  /* @__PURE__ */p("path",{fill:"url(#SVGhphmYc3G)",d:"M128 0C55.894 0 0 52.818 0 124.16c0 37.317 15.293 69.562 40.2 91.835c2.09 1.871 3.352 4.493 3.438 7.298l.697 22.77c.223 7.262 7.724 11.988 14.37 9.054L84.111 243.9a10.22 10.22 0 0 1 6.837-.501c11.675 3.21 24.1 4.92 37.052 4.92c72.106 0 128-52.818 128-124.16S200.106 0 128 0"}),
19
- /* @__PURE__ */p("path",{fill:"#fff",d:"m51.137 160.47l37.6-59.653c5.98-9.49 18.788-11.853 27.762-5.123l29.905 22.43a7.68 7.68 0 0 0 9.252-.027l40.388-30.652c5.39-4.091 12.428 2.36 8.82 8.085l-37.6 59.654c-5.981 9.489-18.79 11.852-27.763 5.122l-29.906-22.43a7.68 7.68 0 0 0-9.25.027l-40.39 30.652c-5.39 4.09-12.427-2.36-8.818-8.085"})]})}},Nt=({open:t,ad:e,onClose:i,captureAdClick:n})=>{const s=Boolean(e?.targetType&&e.targetType!==q.NONE),o=St[e?.targetType]??St[q.LINK],r=e?.imageUrl&&z(e.imageUrl,["http:","https:"])?e.imageUrl:void 0;/* @__PURE__ */
19
+ /* @__PURE__ */p("path",{fill:"#fff",d:"m51.137 160.47l37.6-59.653c5.98-9.49 18.788-11.853 27.762-5.123l29.905 22.43a7.68 7.68 0 0 0 9.252-.027l40.388-30.652c5.39-4.091 12.428 2.36 8.82 8.085l-37.6 59.654c-5.981 9.489-18.79 11.852-27.763 5.122l-29.906-22.43a7.68 7.68 0 0 0-9.25.027l-40.39 30.652c-5.39 4.09-12.427-2.36-8.818-8.085"})]})}},Nt=({open:t,ad:e,onClose:i,captureAdClick:n})=>{const s=Boolean(e?.targetType&&e.targetType!==q.NONE),o=St[e?.targetType]??St[q.LINK],r=e?.imageUrl&&V(e.imageUrl,["http:","https:"])?e.imageUrl:void 0;/* @__PURE__ */
20
20
  return p(X,{open:Boolean(t&&e),onOpenChange:t=>!t&&i?.(),children:/* @__PURE__ */p(Y,{className:"border-none p-0",children:[/* @__PURE__ */p(Q,{className:"sr-only",children:[/* @__PURE__ */p(Z,{children:e?.title}),/* @__PURE__ */p(J,{children:e?.description})]}),/* @__PURE__ */p("div",{className:"flex max-w-2xl flex-col overflow-hidden",children:[r&&/* @__PURE__ */p("img",{className:"h-auto w-full object-contain sm:max-h-96",src:r,alt:e?.title||"Advertisement"}),
21
- /* @__PURE__ */p("div",{className:"flex flex-col gap-2 p-3",children:[/* @__PURE__ */p(A,{variant:"h4",align:"center",lines:2,children:e?.title}),/* @__PURE__ */p(A,{variant:"body3",color:"secondary",align:"center",lines:4,children:e?.description})]}),s&&/* @__PURE__ */p(B,{fullWidth:!0,className:"rounded-none",onClick:()=>{n?.(e?._id,e?.targetType??q.LINK,e?.targetUrl),i?.()},icon:/* @__PURE__ */p(o,{className:"size-5"}),children:e?.targetText})]})]})})},It=({style:t,content:e,curateLink:i,onAdClick:n,hideControls:s})=>{const{captureAdImpression:o,captureAdEngagement:r,captureAdClick:l}=$(),a=Boolean(i&&n),c=e.ctaBg||"#ff4800",d=e.ctaForeground||"#FFFFFF",h=St[e?.targetType??q.LINK];/* @__PURE__ */
21
+ /* @__PURE__ */p("div",{className:"flex flex-col gap-2 p-3",children:[/* @__PURE__ */p(A,{variant:"h4",align:"center",lines:2,children:e?.title}),/* @__PURE__ */p(A,{variant:"body3",color:"secondary",align:"center",lines:4,children:e?.description})]}),s&&/* @__PURE__ */p(H,{fullWidth:!0,className:"rounded-none",onClick:()=>{n?.(e?._id,e?.targetType??q.LINK,e?.targetUrl),i?.()},icon:/* @__PURE__ */p(o,{className:"size-5"}),children:e?.targetText})]})]})})},It=({style:t,content:e,curateLink:i,onAdClick:n,hideControls:s})=>{const{captureAdImpression:o,captureAdEngagement:r,captureAdClick:l}=$(),a=Boolean(i&&n),c=e.ctaBg||"#ff4800",d=e.ctaForeground||"#FFFFFF",h=St[e?.targetType??q.LINK];/* @__PURE__ */
22
22
  return p("div",{style:t,className:"group relative mb-1 overflow-hidden rounded",children:[
23
- /* @__PURE__ */p(R,{className:"size-full",threshold:.8,triggerOnce:!0,onChange:t=>{t&&o(e._id)},onClick:()=>r(e._id),children:/* @__PURE__ */p(O,{url:e.src||e.imageUrl,thumbnailUrl:e.src||e.imageUrl,blurhash:e.blurhash,alt:e.caption,onClick:a?n:void 0,pswpData:{id:e._id,type:_.AD,hash:e._id,width:e.width,height:e.height,title:e.title,description:e.description,targetType:e.targetType,targetText:e.targetText,targetUrl:e.targetUrl,thumbnailUrl:e.imageUrl,blurhash:e.blurhash}})}),
23
+ /* @__PURE__ */p(B,{className:"size-full",threshold:.8,triggerOnce:!0,onChange:t=>{t&&o(e._id)},onClick:()=>r(e._id),children:/* @__PURE__ */p(F,{url:e.src||e.imageUrl,thumbnailUrl:e.src||e.imageUrl,blurhash:e.blurhash,alt:e.caption,onClick:a?n:void 0,pswpData:{id:e._id,type:_.AD,hash:e._id,width:e.width,height:e.height,title:e.title,description:e.description,targetType:e.targetType,targetText:e.targetText,targetUrl:e.targetUrl,thumbnailUrl:e.imageUrl,blurhash:e.blurhash}})}),
24
24
  /* @__PURE__ */p("span",{className:"bg-background/70 absolute top-1 right-1 rounded px-1 text-xs font-medium",children:"Ad"}),!s&&(e.title||e.targetType!==q.NONE)&&/* @__PURE__ */p("div",{className:"absolute bottom-0 flex w-full flex-col lg:opacity-0 lg:transition-opacity lg:group-hover:opacity-100",children:[e.title&&/* @__PURE__ */p("div",{className:"bg-background/60 px-3 py-1",children:/* @__PURE__ */p("h3",{className:"line-clamp-1 text-sm font-medium",children:e.title})}),e?.targetType!==q.NONE&&/* @__PURE__ */p("button",{className:"flex w-full items-center justify-center gap-1 rounded-none border-0 py-2 text-nowrap sm:gap-2",style:{backgroundColor:c,color:d},onClick:()=>{a?n?.():l(e._id,e.targetType,e.targetUrl)},children:[/* @__PURE__ */p("span",{style:{color:d},children:/* @__PURE__ */p(h,{})}),e?.targetText]})]})]})},Lt=({style:t,gamConfig:e,slotIndex:i,eventId:s,organizationId:r})=>{const l=o(null),a=o(null),{trackGamAnalytics:c}=$(),d=`gam-slot-${s??"ev"}-${i}`,h=Math.max(1,Math.round(t?.width||e.sizes[0]?.[0]||300)),u=Math.max(1,Math.round(t?.height||e.sizes[0]?.[1]||250)),m=o({w:h,h:u});return n(()=>{let t=!1,i=null,n=null,o=null,h=null;return(async()=>{await D(),!t&&l.current&&window.googletag.cmd.push(()=>{if(t)return;W(d);const{w:p,h:u}=m.current,g=[[p,u],...e.sizes],w=window.googletag.defineSlot(e.adUnitPath,g,d)?.addService(window.googletag.pubads());if(!w)return;a.current=w,n=window.googletag.pubads(),s?w.setConfig({targeting:{qrati_event:s,...e.categories.length>0?{qrati_category:e.categories}:{}}}):e.categories.length>0&&w.setConfig({targeting:{qrati_category:e.categories}}),o=t=>{t.slot===w&&c({eventId:s,organizationId:r,type:f.GAM_IMPRESSION,creativeId:String(t.creativeId??""),lineItemId:String(t.lineItemId??""),advertiserId:String(t.advertiserId??""),isEmpty:t.isEmpty??!1})},n.addEventListener("slotRenderEnded",o),h=t=>{t.slot===w&&c({eventId:s,organizationId:r,type:f.GAM_VIEWABLE})},n.addEventListener("impressionViewable",h);const b=l.current;b&&(i=K({container:b,onClick:()=>{c({eventId:s,organizationId:r,type:f.GAM_CLICK})}}),U(),window.googletag.display(d))})})(),()=>{t=!0,i?.(),n&&"function"==typeof n.removeEventListener&&(o&&n.removeEventListener("slotRenderEnded",o),h&&n.removeEventListener("impressionViewable",h));const e=a.current;a.current=null,e&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([e])})}},[s,e.adUnitPath,e.categories,r,d]),/* @__PURE__ */p("div",{style:{width:h,height:u},className:"relative overflow-hidden rounded bg-neutral-100 dark:bg-neutral-800","data-gam-slot-index":i,children:/* @__PURE__ */p("div",{id:d,ref:l,style:{width:h,height:u},className:"gam-ad-slot"})})},Mt=(t,e)=>{if(!t||!e)return null;const i=e[t];if(!i)return null;try{const t=new Date(String(i)),e=/* @__PURE__ */new Date,n=t.getFullYear()===e.getFullYear(),s={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return n||(s.year="numeric"),t.toLocaleString("en-US",s).replace(","," •")}catch{return null}},At=e(null),Bt=()=>{const t=g(At);if(!t)throw new Error("Popover components must be used within a Popover");return t},Rt=({children:t,className:e,open:i,onOpenChange:n})=>{const[s,a]=l(!1),c="boolean"==typeof i,d=c?i:s,h=r(),u=`popover-trigger-${h}`,m=`popover-content-${h}`,g=o(null);/* @__PURE__ */
25
25
  return p(At.Provider,{value:{isOpen:d,setIsOpen:t=>{c||a(t),n?.(t)},triggerId:u,contentId:m,triggerRef:g},children:/* @__PURE__ */p("div",{"data-slot":"popover",className:x("relative inline-block",e),children:t})})},Vt=({children:t,asChild:e,className:n,onClick:s,...o})=>{const{isOpen:r,setIsOpen:l,triggerId:a,contentId:c,triggerRef:d}=Bt();if(e){const e=Array.isArray(t)?t[0]:t;if(e&&e.type){const t=e.props?.className;return i(e,{ref:t=>{d.current=t},id:a,className:n?t?`${t} ${n}`:n:t,"aria-haspopup":"dialog","aria-expanded":r,"aria-controls":r?c:void 0,onClick:t=>{l(!r),e.props?.onClick?.(t)},"data-state":r?"open":"closed"})}}/* @__PURE__ */
26
- return p("button",{ref:d,id:a,type:"button","aria-haspopup":"dialog","aria-expanded":r,"aria-controls":r?c:void 0,"data-slot":"popover-trigger","data-state":r?"open":"closed",className:n,onClick:t=>{l(!r),s?.(t)},...o,children:t})},zt=({children:t,className:e,align:i="center",side:s="top",sideOffset:r=4,...a})=>{const{isOpen:h,setIsOpen:u,contentId:m,triggerRef:g}=Bt(),{organization:f,portalContainer:w}=E(),b=o(null),[T,y]=l(null);if(c(()=>{if(!h)return;const t=()=>{if(!g.current||!b.current)return;const t=g.current.getBoundingClientRect(),e=b.current.getBoundingClientRect();let n=t.left,o=t.bottom+r;"center"===i&&(n=t.left+t.width/2-e.width/2),"end"===i&&(n=t.right-e.width),"top"===s&&(o=t.top-e.height-r),"left"===s&&(n=t.left-e.width-r,o=t.top+t.height/2-e.height/2),"right"===s&&(n=t.right+r,o=t.top+t.height/2-e.height/2),"bottom"===s&&(o=t.bottom+r),y({top:o,left:n})},e=requestAnimationFrame(t);return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{cancelAnimationFrame(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[i,h,s,r,g]),n(()=>{if(!h)return;const t=t=>{const e="function"==typeof t.composedPath?t.composedPath():[],i=t.target,n=b.current&&(b.current.contains(i)||e.includes(b.current)),s=g.current&&(g.current.contains(i)||e.includes(g.current));n||s||u(!1)},e=t=>{"Escape"===t.key&&(u(!1),g.current?.focus())},i=window.setTimeout(()=>{document.addEventListener("mousedown",t)},0);return document.addEventListener("keydown",e),()=>{window.clearTimeout(i),document.removeEventListener("mousedown",t),document.removeEventListener("keydown",e)}},[h,u,g]),!h)return null;const v=/* @__PURE__ */p("div",{ref:b,id:m,role:"dialog","aria-modal":"false","data-state":h?"open":"closed",className:x("bg-background text-foreground border-border shadow-outer rounded outline-none",e),style:{position:"fixed",top:T?.top??0,left:T?.left??0,zIndex:2010,...k(f)},...a,children:t});return"undefined"!=typeof document?d(v,w??document.body):v},Ft=({eventId:t,contentId:e,emojis:i=[],counts:s={},userReaction:r})=>{const{user:a,props:c,organization:d}=E(),h=c?.loginUrl,{handleReactionClick:u,isPending:m}=(()=>{const t=b(),{props:e,user:i}=E(),n=e?.organizationId,s=I({mutationFn:async({eventId:t,contentId:e,emoji:s})=>{await T.post(C.UPDATE_REACTION,{json:{eventId:t,contentId:e,reaction:s},headers:{"x-org-id":n,Authorization:`Bearer ${i?.token}`}})},onMutate:async({eventId:e,contentId:i,emoji:n})=>{const s=[y.CONTENTS_BY_EVENT(e)];await t.cancelQueries({queryKey:s});const o=t.getQueriesData({queryKey:s});return t.setQueriesData({queryKey:s},t=>((t,e,i)=>t?.pages&&Array.isArray(t.pages)?{...t,pages:t.pages.map(t=>t.data?{...t,data:t.data.map(t=>{if(t._id!==e)return t;const n={...t.reactionCounts??{}};return t.userReaction&&t.userReaction!==i&&(n[t.userReaction]=Math.max(0,(n[t.userReaction]??1)-1)),t.userReaction===i?(n[i]=Math.max(0,(n[i]??1)-1),{...t,reactionCounts:n,userReaction:void 0}):(n[i]=(n[i]??0)+1,{...t,reactionCounts:n,userReaction:i})})}:t)}:t)(t,i,n)),{previousData:o}},onError:(e,i,n)=>{n?.previousData?.forEach(([e,i])=>{t.setQueryData(e,i)}),H.error("Failed to add reaction"),console.error("Error handling reaction click:",e,i)}});return{handleReactionClick:async(t,e,n)=>{if(!t||!e||!n)return!1;if(!i)return H.error("Please login to react"),!1;try{return await s.mutateAsync({eventId:t,contentId:e,emoji:n}),!0}catch(o){return!1}},isPending:s.isPending}})(),[g,f]=l(!1),[v,k]=l(null),q=o(null),_=Object.values(s).reduce((t,e)=>t+e,0);return n(()=>()=>{q.current&&clearTimeout(q.current)},[]),/* @__PURE__ */p(Rt,{open:g,onOpenChange:f,children:[/* @__PURE__ */p(Vt,{asChild:!0,children:/* @__PURE__ */p("button",{type:"button",className:x("bg-background/50 flex items-center gap-1 rounded px-2 py-1 backdrop-blur-sm transition-transform duration-150 ease-out will-change-transform active:scale-95 sm:gap-2 sm:py-0",v&&"scale-[1.03] shadow-sm"),children:[(i||[]).slice().sort((t,e)=>(s[e]||0)-(s[t]||0)).slice(0,1).map(t=>/* @__PURE__ */p("span",{className:x("text-sm transition-transform duration-150 ease-out sm:text-lg",v===(r||t)&&"scale-125"),children:r||t},`${e}-${t}-1`)),_>0&&/* @__PURE__ */p("span",{className:"text-xs font-bold sm:text-sm",children:_||0})]})}),/* @__PURE__ */p(zt,{side:"top",align:"end",children:[a?null:/* @__PURE__ */p("div",d?.customAuth?{className:"p-2 font-semibold",children:["Please"," ",
26
+ return p("button",{ref:d,id:a,type:"button","aria-haspopup":"dialog","aria-expanded":r,"aria-controls":r?c:void 0,"data-slot":"popover-trigger","data-state":r?"open":"closed",className:n,onClick:t=>{l(!r),s?.(t)},...o,children:t})},zt=({children:t,className:e,align:i="center",side:s="top",sideOffset:r=4,...a})=>{const{isOpen:h,setIsOpen:u,contentId:m,triggerRef:g}=Bt(),{organization:f,portalContainer:w}=E(),b=o(null),[T,y]=l(null);if(c(()=>{if(!h)return;const t=()=>{if(!g.current||!b.current)return;const t=g.current.getBoundingClientRect(),e=b.current.getBoundingClientRect();let n=t.left,o=t.bottom+r;"center"===i&&(n=t.left+t.width/2-e.width/2),"end"===i&&(n=t.right-e.width),"top"===s&&(o=t.top-e.height-r),"left"===s&&(n=t.left-e.width-r,o=t.top+t.height/2-e.height/2),"right"===s&&(n=t.right+r,o=t.top+t.height/2-e.height/2),"bottom"===s&&(o=t.bottom+r),y({top:o,left:n})},e=requestAnimationFrame(t);return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{cancelAnimationFrame(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[i,h,s,r,g]),n(()=>{if(!h)return;const t=t=>{const e="function"==typeof t.composedPath?t.composedPath():[],i=t.target,n=b.current&&(b.current.contains(i)||e.includes(b.current)),s=g.current&&(g.current.contains(i)||e.includes(g.current));n||s||u(!1)},e=t=>{"Escape"===t.key&&(u(!1),g.current?.focus())},i=window.setTimeout(()=>{document.addEventListener("mousedown",t)},0);return document.addEventListener("keydown",e),()=>{window.clearTimeout(i),document.removeEventListener("mousedown",t),document.removeEventListener("keydown",e)}},[h,u,g]),!h)return null;const v=/* @__PURE__ */p("div",{ref:b,id:m,role:"dialog","aria-modal":"false","data-state":h?"open":"closed",className:x("bg-background text-foreground border-border shadow-outer rounded outline-none",e),style:{position:"fixed",top:T?.top??0,left:T?.left??0,zIndex:2010,...k(f)},...a,children:t});return"undefined"!=typeof document?d(v,w??document.body):v},Ft=({eventId:t,contentId:e,emojis:i=[],counts:s={},userReaction:r})=>{const{user:a,props:c,organization:d}=E(),h=c?.loginUrl,{handleReactionClick:u,isPending:m}=(()=>{const t=b(),{props:e,user:i}=E(),n=e?.organizationId,s=I({mutationFn:async({eventId:t,contentId:e,emoji:s})=>{await T.post(C.UPDATE_REACTION,{json:{eventId:t,contentId:e,reaction:s},headers:{"x-org-id":n,Authorization:`Bearer ${i?.token}`}})},onMutate:async({eventId:e,contentId:i,emoji:n})=>{const s=[y.CONTENTS_BY_EVENT(e)];await t.cancelQueries({queryKey:s});const o=t.getQueriesData({queryKey:s});return t.setQueriesData({queryKey:s},t=>((t,e,i)=>t?.pages&&Array.isArray(t.pages)?{...t,pages:t.pages.map(t=>t.data?{...t,data:t.data.map(t=>{if(t._id!==e)return t;const n={...t.reactionCounts??{}};return t.userReaction&&t.userReaction!==i&&(n[t.userReaction]=Math.max(0,(n[t.userReaction]??1)-1)),t.userReaction===i?(n[i]=Math.max(0,(n[i]??1)-1),{...t,reactionCounts:n,userReaction:void 0}):(n[i]=(n[i]??0)+1,{...t,reactionCounts:n,userReaction:i})})}:t)}:t)(t,i,n)),{previousData:o}},onError:(e,i,n)=>{n?.previousData?.forEach(([e,i])=>{t.setQueryData(e,i)}),P.error("Failed to add reaction"),console.error("Error handling reaction click:",e,i)}});return{handleReactionClick:async(t,e,n)=>{if(!t||!e||!n)return!1;if(!i)return P.error("Please login to react"),!1;try{return await s.mutateAsync({eventId:t,contentId:e,emoji:n}),!0}catch(o){return!1}},isPending:s.isPending}})(),[g,f]=l(!1),[v,k]=l(null),q=o(null),_=Object.values(s).reduce((t,e)=>t+e,0);return n(()=>()=>{q.current&&clearTimeout(q.current)},[]),/* @__PURE__ */p(Rt,{open:g,onOpenChange:f,children:[/* @__PURE__ */p(Vt,{asChild:!0,children:/* @__PURE__ */p("button",{type:"button",className:x("bg-background/50 flex items-center gap-1 rounded px-2 py-1 backdrop-blur-sm transition-transform duration-150 ease-out will-change-transform active:scale-95 sm:gap-2 sm:py-0",v&&"scale-[1.03] shadow-sm"),children:[(i||[]).slice().sort((t,e)=>(s[e]||0)-(s[t]||0)).slice(0,1).map(t=>/* @__PURE__ */p("span",{className:x("text-sm transition-transform duration-150 ease-out sm:text-lg",v===(r||t)&&"scale-125"),children:r||t},`${e}-${t}-1`)),_>0&&/* @__PURE__ */p("span",{className:"text-xs font-bold sm:text-sm",children:_||0})]})}),/* @__PURE__ */p(zt,{side:"top",align:"end",children:[a?null:/* @__PURE__ */p("div",d?.customAuth?{className:"p-2 font-semibold",children:["Please"," ",
27
27
  /* @__PURE__ */p("a",{className:"text-info underline",href:h,children:"Login"})," ","to react"]}:{className:"p-2 font-semibold",children:["Please"," ",
28
28
  /* @__PURE__ */p(M,{className:"text-info underline",to:w.LOGIN,children:"Login"})," ","to react"]}),a&&/* @__PURE__ */p("div",{className:"flex gap-1 p-2",children:i.map(i=>{const n=r===i;/* @__PURE__ */
29
29
  return p("div",{className:"flex flex-col items-center",children:[/* @__PURE__ */p("span",{className:"text-xs font-medium",children:s[i]||0}),/* @__PURE__ */p("button",{type:"button",disabled:m,className:x("text-3xl transition-transform duration-150 ease-out disabled:opacity-50",n?"scale-125":"hover:scale-110",v===i&&"scale-125",m&&"cursor-not-allowed"),onClick:()=>(async i=>{!m&&u&&(k(i),f(!1),q.current&&clearTimeout(q.current),q.current=setTimeout(()=>k(null),180),u(t,e,i))})(i),children:i})]},`${e}-${i}-2`)})})]})]})},Ot=({event:t={},content:e,curateLink:i})=>t.engagementStyle===S.CONTEST?/* @__PURE__ */p("button",{className:"bg-background/75 flex items-center gap-1 rounded px-2 py-1",children:[/* @__PURE__ */p(G,{className:"size-4"}),/* @__PURE__ */p("span",{className:"text-xs font-semibold",children:parseFloat(String(e.score||0)).toFixed(1)})]}):t.engagementStyle===S.REACTION&&t.reactionEmojis?.length?/* @__PURE__ */p(Ft,{eventId:t?._id,contentId:e._id,emojis:t?.reactionEmojis,engagementStyle:t?.engagementStyle,counts:e.reactionCounts||{},userReaction:e.userReaction}):null,Pt=({content:t})=>/* @__PURE__ */p("div",{className:"w-full space-y-3 px-3 pb-3",children:[t?.caption&&/* @__PURE__ */p("span",{"data-tooltip-target":"tooltip-default",className:"hidden w-full text-xs drop-shadow-[0_1.2px_1.2px_rgba(0,0,0,0.8)] sm:block",children:/* @__PURE__ */p("div",{role:"note",title:t?.caption,className:"lg:text-md line-clamp-1 text-xs text-white lg:font-medium",children:t?.caption})}),/* @__PURE__ */p("div",{className:"flex items-center justify-between",children:/* @__PURE__ */p("span",{className:"lg:text-md line-clamp-1 text-sm font-medium text-white drop-shadow-[0_1.2px_1.2px_rgba(0,0,0,0.8)]",children:t?.user?.name})})]}),Ht=({event:t,content:e,style:i,timestampField:n,curateLink:s,onChangeFaceUrl:o,hideControls:r,showQuickSearch:l})=>{const a=`content-${e._id}`,c=h(()=>Mt(n,e),[n,e]),d=u(()=>{o?.(e?.url);const t=document.getElementById("media-gallery-container");t&&t.scrollIntoView({behavior:"smooth",block:"start"})},[o,e?.url]),g=h(()=>({id:e._id,type:_.IMAGE,hash:e._id,width:e.width,height:e.height,thumbnailUrl:e.thumbnailUrl,blurhash:e.blurhash,caption:e.caption}),[e._id,e.width,e.height,e.thumbnailUrl,e.blurhash,e.caption]);/* @__PURE__ */
30
- return p("div",{id:a,style:i,className:"group relative mb-1 overflow-hidden rounded [content-visibility:auto]",children:[/* @__PURE__ */p(O,{url:e.src,alt:e.caption,blurhash:e.blurhash,thumbnailUrl:e.thumbnailUrl,curateLink:s,pswpData:g}),!r&&/* @__PURE__ */p(m,{children:[c&&/* @__PURE__ */p("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:c}),l&&(e.faces?.length??0)>0&&/* @__PURE__ */p("button",{className:"bg-primary absolute top-2 right-2 rounded-full p-1 text-gray-200 opacity-50 transition-all sm:p-1.5 sm:hover:scale-110 sm:hover:opacity-100",onClick:d,children:/* @__PURE__ */p(j,{className:"text-primary-foreground"})}),
30
+ return p("div",{id:a,style:i,className:"group relative mb-1 overflow-hidden rounded [content-visibility:auto]",children:[/* @__PURE__ */p(F,{url:e.src,alt:e.caption,blurhash:e.blurhash,thumbnailUrl:e.thumbnailUrl,curateLink:s,pswpData:g}),!r&&/* @__PURE__ */p(m,{children:[c&&/* @__PURE__ */p("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:c}),l&&(e.faces?.length??0)>0&&/* @__PURE__ */p("button",{className:"bg-primary absolute top-2 right-2 rounded-full p-1 text-gray-200 opacity-50 transition-all sm:p-1.5 sm:hover:scale-110 sm:hover:opacity-100",onClick:d,children:/* @__PURE__ */p(j,{className:"text-primary-foreground"})}),
31
31
  /* @__PURE__ */p("div",{className:"",children:[/* @__PURE__ */p("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */p(Pt,{content:e})}),/* @__PURE__ */p("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */p(Ot,{event:t,content:e,curateLink:s})})]})]})]})},Dt=({content:t,style:e,event:i,timestampField:n,curateLink:s,hideControls:o})=>{const r=h(()=>Mt(n,t),[n,t]);/* @__PURE__ */
32
- return p("div",{id:`content-${t._id}`,className:"group relative mb-1 overflow-hidden rounded [content-visibility:auto]",style:e,children:[/* @__PURE__ */p(O,{url:t.src??t.url,thumbnailUrl:t.thumbnailUrl,blurhash:t.blurhash,alt:t.caption,curateLink:s,pswpData:{id:t._id,type:_.VIDEO,hash:t._id,width:t.width,height:t.height,thumbnailUrl:t.thumbnailUrl,blurhash:t.blurhash,caption:t.caption}}),!o&&/* @__PURE__ */p("div",{className:"transition-opacity duration-500",children:[r&&/* @__PURE__ */p("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:r}),
32
+ return p("div",{id:`content-${t._id}`,className:"group relative mb-1 overflow-hidden rounded [content-visibility:auto]",style:e,children:[/* @__PURE__ */p(F,{url:t.src??t.url,thumbnailUrl:t.thumbnailUrl,blurhash:t.blurhash,alt:t.caption,curateLink:s,pswpData:{id:t._id,type:_.VIDEO,hash:t._id,width:t.width,height:t.height,thumbnailUrl:t.thumbnailUrl,blurhash:t.blurhash,caption:t.caption}}),!o&&/* @__PURE__ */p("div",{className:"transition-opacity duration-500",children:[r&&/* @__PURE__ */p("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:r}),
33
33
  /* @__PURE__ */p("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */p(Pt,{content:t})}),
34
- /* @__PURE__ */p("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */p(Ot,{event:i,content:t,curateLink:s})})]})]})},Ut=({event:t,contents:e=[],gamConfig:i,singleColumnMode:s,kioskMode:r,timestampField:a,curateLink:c,onChangeFaceUrl:d,showQuickSearch:u})=>{const g=o(null),f=o(null),w=h(()=>`gallery-${t?._id??""}`,[t?._id]),{captureAdImpression:b,captureAdClick:T}=$(),{portalContainer:y,organization:k}=E(),q=k?._id,[C,S]=l(null);n(()=>{const t=f.current;if(!c&&t){const e=new F({gallery:t,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:P,appendToEl:y??document.body});g.current=e,new L(e),new _t(e),new qt(e),new N(e,b,T),new Et(e),new Ct(e),e.init()}return()=>{g.current?.destroy?.(),g.current=null}},[t?.galleryLayout,c,T,b,w,y]);const I=h(()=>{switch(t?.galleryLayout){case v.ROW:return ft;case v.COLUMN:return yt;case v.MASONRY:return kt;default:return ft}},[t?.galleryLayout]),M=h(()=>e.map(t=>{const e=t.type===_.IMAGE||t.type===_.VIDEO?t.url:t.type===_.GAM_AD?"":t.imageUrl;return{...t,src:e??"",width:t.dimension?.width||t.width||4,height:t.dimension?.height||t.height||3}}),[e]),A=h(()=>({container:({ref:t,className:e,children:i})=>/* @__PURE__ */p("div",{ref:t,className:e??"",children:i}),photo:(e,{photo:n,width:s,height:o,index:l})=>{const h=n;let m=null;switch(h.type){case _.IMAGE:m=Ht;break;case _.VIDEO:m=Dt;break;case _.AD:m=It;break;case _.GAM_AD:return i?/* @__PURE__ */p(Lt,{style:{width:s,height:o},gamConfig:i,slotIndex:h.slotIndex??l,eventId:t?._id,organizationId:q},`${h._id??l}-${l}`):null;default:m=null}return m?/* @__PURE__ */p(m,{style:{width:s,height:o},event:t,content:h,timestampField:a,onAdClick:c?()=>S(h):void 0,hideControls:r,curateLink:c?`${c}/${h._id}`:null,onChangeFaceUrl:d,showQuickSearch:u},`${h._id??l}-${l}`):null}}),[t,i,q,a,c,r,d,u]);/* @__PURE__ */
34
+ /* @__PURE__ */p("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */p(Ot,{event:i,content:t,curateLink:s})})]})]})},Ut=({event:t,contents:e=[],gamConfig:i,singleColumnMode:s,kioskMode:r,timestampField:a,curateLink:c,onChangeFaceUrl:d,showQuickSearch:u})=>{const g=o(null),f=o(null),w=h(()=>`gallery-${t?._id??""}`,[t?._id]),{captureAdImpression:b,captureAdClick:T}=$(),{portalContainer:y,organization:k}=E(),q=k?._id,[C,S]=l(null);n(()=>{const t=f.current;if(!c&&t){const e=new z({gallery:t,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:O,appendToEl:y??document.body});g.current=e,new L(e),new _t(e),new qt(e),new N(e,b,T),new Et(e),new Ct(e),e.init()}return()=>{g.current?.destroy?.(),g.current=null}},[t?.galleryLayout,c,T,b,w,y]);const I=h(()=>{switch(t?.galleryLayout){case v.ROW:return ft;case v.COLUMN:return yt;case v.MASONRY:return kt;default:return ft}},[t?.galleryLayout]),M=h(()=>e.map(t=>{const e=t.type===_.IMAGE||t.type===_.VIDEO?t.url:t.type===_.GAM_AD?"":t.imageUrl;return{...t,src:e??"",width:t.dimension?.width||t.width||4,height:t.dimension?.height||t.height||3}}),[e]),A=h(()=>({container:({ref:t,className:e,children:i})=>/* @__PURE__ */p("div",{ref:t,className:e??"",children:i}),photo:(e,{photo:n,width:s,height:o,index:l})=>{const h=n;let m=null;switch(h.type){case _.IMAGE:m=Ht;break;case _.VIDEO:m=Dt;break;case _.AD:m=It;break;case _.GAM_AD:return i?/* @__PURE__ */p(Lt,{style:{width:s,height:o},gamConfig:i,slotIndex:h.slotIndex??l,eventId:t?._id,organizationId:q},`${h._id??l}-${l}`):null;default:m=null}return m?/* @__PURE__ */p(m,{style:{width:s,height:o},event:t,content:h,timestampField:a,onAdClick:c?()=>S(h):void 0,hideControls:r,curateLink:c?`${c}/${h._id}`:null,onChangeFaceUrl:d,showQuickSearch:u},`${h._id??l}-${l}`):null}}),[t,i,q,a,c,r,d,u]);/* @__PURE__ */
35
35
  return p(m,{children:[/* @__PURE__ */p("div",{id:w,ref:f,className:x(s?"w-full lg:w-1/3":"w-full"),children:/* @__PURE__ */p(I,{spacing:4,rowConstraints:t=>{const e={minPhotos:1,maxPhotos:4,singleRowMaxHeight:400};return s&&(e.minPhotos=1,e.maxPhotos=t<400?2:t<800?3:4),e},columns:t=>s?1:t<400?2:t<800?3:4,photos:M,render:A})}),/* @__PURE__ */p(Nt,{open:Boolean(C),ad:C,onClose:()=>S(null),captureAdClick:T})]})};export{Ut as default};
@@ -1,4 +1,4 @@
1
- import{d as e,s as r,t,v as o}from"./DrrpB4Om.js";import{D as l,n as s}from"./CaX2xgrP.js";import{l as i}from"./ChJXhA9c.js";import"./h4ZjZXfe2.js";var n=e(()=>import("./BKDqpSN62.js")),a=e(()=>import("./DN26AtHL2.js")),c=e(()=>import("./kiL9JENf2.js")),d=e(()=>import("./CHTzn6mh2.js")),p=()=>/* @__PURE__ */t("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */t("div",{class:"text-center",children:[
1
+ import{d as e,s as r,t,v as o}from"./DrrpB4Om.js";import{D as l,n as s}from"./CaX2xgrP.js";import{l as i}from"./ChJXhA9c.js";import"./h4ZjZXfe2.js";var n=e(()=>import("./C9kBlCZx2.js")),a=e(()=>import("./CZbEGemi2.js")),c=e(()=>import("./DWjheKBP2.js")),d=e(()=>import("./DRP9vxts2.js")),p=()=>/* @__PURE__ */t("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */t("div",{class:"text-center",children:[
2
2
  /* @__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"})]}),
3
3
  /* @__PURE__ */t("p",{class:"text-foreground",children:"No location data available."}),
4
4
  /* @__PURE__ */t("p",{class:"text-muted-foreground mt-1 text-xs",children:"Events need location data to appear on the map."})]})}),m=()=>/* @__PURE__ */t("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */t("div",{class:"border-primary size-8 animate-spin rounded-full border-4 border-t-transparent"})}),g=({events:e,isLoading:g=!1})=>{const{organization:x}=s(),f=i(),h=x?.integrationSettings??{},u=h.mapProvider??"openstreetmap",v=o(e=>{f(l.GALLERY(e))},[f]);if("openstreetmap_free"===u)/* @__PURE__ */return t("div",{class:"relative mt-3 h-screen sm:mt-6",children:/* @__PURE__ */t(r,{fallback:/* @__PURE__ */t(m,{}),children:/* @__PURE__ */t(n,{onExplore:v,logoUrl:x?.logoUrl})})});const y=h.mapTilerApiKey??"",b=h.googleMapsApiKey??"",w=h.mapboxApiKey??"",j=e.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);/* @__PURE__ */
@@ -1,3 +1,3 @@
1
- import{n as e}from"./Cko4QHwX.js";import{C as t,_ as o,f as l,h as r,p as a,t as n}from"./DrrpB4Om.js";import{I as i,a as f,n as c,w as p}from"./CaX2xgrP.js";import{t as s}from"./BZu3c37u.js";import{t as d}from"./DF0LxcV7.js";import{t as u}from"./Rcen6i0h.js";import{t as m}from"./h4ZjZXfe2.js";import{a as g,i as b,n as h,r as x,t as v}from"./DkG0zv7_2.js";import{t as k}from"./CfMNBPpx2.js";var y=[[90,-180],[-90,180]],w=[20,0],z="#fb8500",A={topLeft:[276,60],bottomRight:[60,60]},E=new s,L=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),R=({onExplore:s,logoUrl:R})=>{const C=l(null),T=l(null),O=l(null),M=l(null),I=l(null),W=l(null),j=l(null),S=l(!1),Z=l(!1),q=a(()=>(()=>{try{const e=sessionStorage.getItem(p);if(!e)return null;const t=JSON.parse(e);if("number"==typeof t?.center?.lat&&"number"==typeof t?.center?.lng&&"number"==typeof t?.zoom)return t}catch{}return null})(),[]),[D,B]=r(!0),[H,N]=r(!1),{folderTree:P,activeFolderId:U,activeFolder:F,visibleEvents:Y,setActiveFolderId:J,isLoadingEvents:G}=m(),{organization:Q}=c();return o(()=>{if(!C.current||T.current)return;k("leaflet",'.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;top:0;left:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:0 0}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{-webkit-transform-origin:0 0;width:1600px;height:1600px}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{width:auto;padding:0;max-width:none!important;max-height:none!important}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:#33b5e566}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{box-sizing:border-box;z-index:800;width:0;height:0}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{z-index:800;pointer-events:visiblePainted;pointer-events:auto;position:relative}.leaflet-top,.leaflet-bottom{z-index:1000;pointer-events:none;position:absolute}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{outline-offset:1px;background:#ddd}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{background:#ffffff80;border:2px dotted #38f}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:.75rem;line-height:1.5}.leaflet-bar{border-radius:4px;box-shadow:0 1px 5px #000000a6}.leaflet-bar a{text-align:center;color:#000;background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;text-decoration:none;display:block}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom:none;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.leaflet-bar a.leaflet-disabled{cursor:default;color:#bbb;background-color:#f4f4f4}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-right-radius:2px;border-bottom-left-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{text-indent:1px;font:700 18px Lucida Console,Monaco,monospace}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{background:#fff;border-radius:5px;box-shadow:0 1px 5px #0006}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{color:#333;background:#fff;padding:6px 10px 6px 6px}.leaflet-control-layers-scrollbar{padding-right:5px;overflow:hidden scroll}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{font-size:1.08333em;display:block}.leaflet-control-layers-separator{border-top:1px solid #ddd;height:0;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{color:#333;padding:0 5px;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{width:1em;height:.6669em;vertical-align:baseline!important;display:inline!important}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{white-space:nowrap;box-sizing:border-box;text-shadow:1px 1px #fff;background:#fffc;border:2px solid #777;border-top:none;padding:2px 5px 1px;line-height:1.1}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{background-clip:padding-box;border:2px solid #0003}.leaflet-popup{text-align:center;margin-bottom:20px;position:absolute}.leaflet-popup-content-wrapper{text-align:left;border-radius:12px;padding:1px}.leaflet-popup-content{min-height:1px;margin:13px 24px 13px 20px;font-size:1.08333em;line-height:1.3}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{pointer-events:none;width:40px;height:20px;margin-top:-1px;margin-left:-20px;position:absolute;left:50%;overflow:hidden}.leaflet-popup-tip{pointer-events:auto;width:17px;height:17px;margin:-10px auto 0;padding:1px;transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{color:#333;background:#fff;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button{text-align:center;color:#757575;background:0 0;border:none;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;text-decoration:none;position:absolute;top:0;right:0}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";width:24px;filter:progid:DXImageTransform.Microsoft.Matrix(M11=.707107, M12=.707107, M21=-.707107, M22=.707107);margin:0 auto}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{color:#222;white-space:nowrap;-webkit-user-select:none;user-select:none;pointer-events:none;background-color:#fff;border:1px solid #fff;border-radius:3px;padding:6px;position:absolute;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{pointer-events:none;content:"";background:0 0;border:6px solid #0000;position:absolute}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{margin-left:-6px;left:50%}.leaflet-tooltip-top:before{border-top-color:#fff;margin-bottom:-12px;bottom:0}.leaflet-tooltip-bottom:before{border-bottom-color:#fff;margin-top:-12px;margin-left:-6px;top:0}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{margin-top:-6px;top:50%}.leaflet-tooltip-left:before{border-left-color:#fff;margin-right:-12px;right:0}.leaflet-tooltip-right:before{border-right-color:#fff;margin-left:-12px;left:0}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}'),k("marker-cluster",".leaflet-cluster-anim .leaflet-marker-icon,.leaflet-cluster-anim .leaflet-marker-shadow{transition:transform .3s ease-out,opacity .3s ease-in}.leaflet-cluster-spider-leg{transition:stroke-dashoffset .3s ease-out,stroke-opacity .3s ease-in}.marker-cluster-small{background-color:#b5e28c99}.marker-cluster-small div{background-color:#6ecc3999}.marker-cluster-medium{background-color:#f1d35799}.marker-cluster-medium div{background-color:#f0c20c99}.marker-cluster-large{background-color:#fd9c7399}.marker-cluster-large div{background-color:#f1801799}.leaflet-oldie .marker-cluster-small{background-color:#b5e28c}.leaflet-oldie .marker-cluster-small div{background-color:#6ecc39}.leaflet-oldie .marker-cluster-medium{background-color:#f1d357}.leaflet-oldie .marker-cluster-medium div{background-color:#f0c20c}.leaflet-oldie .marker-cluster-large{background-color:#fd9c73}.leaflet-oldie .marker-cluster-large div{background-color:#f18017}.marker-cluster{background-clip:padding-box;border-radius:20px}.marker-cluster div{text-align:center;border-radius:15px;width:30px;height:30px;margin-top:5px;margin-left:5px}.marker-cluster span{line-height:30px}");let t,o=!1;return(async()=>{try{const l=await import("./BCTYvPrD.js").then(t=>/* @__PURE__ */e(t.default,1));if(o)return;if("undefined"!=typeof window&&(window.L=l),await Promise.all([import("./CgUphJWo.js").then(t=>/* @__PURE__ */e(t.default,1)),import("./rtH8O6Hc.js")]),o)return;const r=window.L??l;if(!C.current)return;const a=l.map(C.current,{center:q?.center?[q.center.lat??w[0],q.center.lng??w[1]]:w,zoom:q?.zoom??3,minZoom:3,zoomControl:!0,worldCopyJump:!1,maxBounds:l.latLngBounds(y),maxBoundsViscosity:1});l.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"&copy; OpenStreetMap contributors",maxZoom:19,noWrap:!0}).addTo(a);const n=l.layerGroup().addTo(a),i="function"==typeof r.heatLayer?r.heatLayer([],{radius:30,blur:30,maxZoom:10,minOpacity:.35}):null;i?.addTo(a);const f="function"==typeof r.markerClusterGroup?r.markerClusterGroup({chunkedLoading:!0,showCoverageOnHover:!1,spiderfyOnMaxZoom:!0,zoomToBoundsOnClick:!0,maxClusterRadius:48}):l.layerGroup();f.addTo(a);const c=()=>{j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{try{sessionStorage.setItem(p,JSON.stringify({center:a.getCenter(),zoom:a.getZoom()}))}catch{}},250)};let s;a.on("zoomend",c),a.on("moveend",c),T.current=a,O.current=r,M.current=n,W.current=i,I.current=f,"undefined"!=typeof ResizeObserver&&C.current&&(s=new ResizeObserver(()=>a.invalidateSize(!1)),s.observe(C.current)),requestAnimationFrame(()=>a.invalidateSize(!1)),N(!0),B(!1),t=()=>{s?.disconnect(),j.current&&clearTimeout(j.current),a.off("zoomend",c),a.off("moveend",c),a.remove(),O.current=null,T.current=null,M.current=null,W.current=null,I.current=null}}finally{o||B(!1)}})(),()=>{o=!0,t?.()}},[q]),o(()=>{if(!H)return;const e=O.current;if(!e)return;const o=T.current;if(M.current?.clearLayers(),I.current?.clearLayers(),null===U&&P.length>0){o&&W.current&&(W.current.setLatLngs?.([]),o.hasLayer(W.current)&&o.removeLayer(W.current));const t=o=>{for(const l of o)if(l.centroid){const[t,o]=l.centroid,r=e.divIcon({className:"",html:`<div style="transform:translate(-50%,-50%);background:${x(l.color,z)};color:#fff;border-radius:20px;padding:5px 10px;font-size:12px;font-weight:600;white-space:nowrap;box-shadow:0 2px 8px rgba(0,0,0,0.25);border:2px solid rgba(255,255,255,0.4);cursor:pointer;display:inline-flex;align-items:center;gap:6px;"><span>${L(l.folder.name)}</span><span style="background:rgba(0,0,0,0.18);border-radius:10px;padding:1px 5px;font-size:10px;">${l.eventCount}</span></div>`,iconSize:[0,0],iconAnchor:[0,0]});e.marker([o,t],{icon:r}).on("click",()=>J(l.folder._id)).addTo(M.current)}else l.children.length>0&&t(l.children)};t(P)}else{if(0===Y.length)return;const l=0===P.length&&null===U,r=x(F?.color,z);if(o&&W.current&&(l&&!o.hasLayer(W.current)?W.current.addTo(o):l||(W.current.setLatLngs?.([]),o.hasLayer(W.current)&&o.removeLayer(W.current))),Y.forEach(o=>{const l=o.location.x,a=o.location.y,f=e.divIcon({className:"qrati-leaflet-marker-wrapper",html:`<div style="width:36px;height:36px;cursor:pointer;background:${r};border-radius:50% 50% 50% 0;transform:rotate(-45deg);border:2px solid white;box-shadow:0 2px 8px rgba(0,0,0,0.3);display:flex;align-items:center;justify-content:center;overflow:hidden;">${b(R)?`<img src="${b(R)}" style="width:24px;height:24px;border-radius:50%;object-fit:cover;transform:rotate(45deg);" />`:""}</div>`,iconSize:[36,36],iconAnchor:[18,36],popupAnchor:[0,-36]}),c=e.marker([a,l],{icon:f}),p=document.createElement("div");p.style.width="fit-content",((e,o,l)=>{t(/* @__PURE__ */n(i,{client:E,children:/* @__PURE__ */n(g,{event:e,onExplore:l})}),o)})(o,p,s),c.bindPopup(p,{closeButton:!0,maxWidth:256}),I.current?.addLayer(c)}),l&&W.current){const e=Y.reduce((e,t)=>Math.max(e,t.views??0),1),t=Y.map(e=>[e.location.y,e.location.x,e.views??1]);W.current.setOptions?.({radius:30,blur:30,maxZoom:10,minOpacity:.35,max:e}),W.current.setLatLngs?.(t)}if(l&&!Z.current&&o&&(Z.current=!0,!q)){const t=e.latLngBounds([]);Y.forEach(e=>t.extend([e.location.y,e.location.x])),t.isValid()&&o.fitBounds(t,{paddingTopLeft:A.topLeft,paddingBottomRight:A.bottomRight,maxZoom:8})}}},[U,P,Y,H,s,R,J,F,q]),o(()=>{if(!H)return;const e=T.current,t=O.current;if(!e||!t)return;if(!S.current&&q)return void(S.current=!0);S.current=!0;const o={paddingTopLeft:A.topLeft,paddingBottomRight:A.bottomRight,duration:3,easeLinearity:1};if(U){const l=h(P,U);if(!l?.folder.boundary?.length)return;const r=t.latLngBounds([]);for(const e of l.folder.boundary)r.extend([e.y,e.x]);r.isValid()&&e.flyToBounds(r,{...o,maxZoom:14})}else{const l=t.latLngBounds([]),r=e=>{for(const t of e)t.centroid?l.extend([t.centroid[1],t.centroid[0]]):r(t.children)};r(P),l.isValid()&&e.flyToBounds(l,{...o,maxZoom:8})}},[U,P,H,q]),/* @__PURE__ */n("div",{class:"relative h-screen w-full sm:h-[calc(100vh-4rem)]",style:f(Q),children:[
2
- /* @__PURE__ */n(v,{positionClass:"absolute top-3 left-16 z-[1000]",folderTree:P,activeFolderId:U,setActiveFolderId:J}),G&&/* @__PURE__ */n("div",{class:"absolute inset-0 z-10 flex items-center justify-center bg-white/60",children:/* @__PURE__ */n("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"})}),D&&/* @__PURE__ */n("div",{class:"absolute inset-0 z-20 flex items-center justify-center bg-white/85",children:/* @__PURE__ */n("div",{class:"flex flex-col items-center gap-3",children:[/* @__PURE__ */n("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"}),/* @__PURE__ */n("p",{class:"text-sm font-medium text-slate-700",children:"Loading map…"})]})}),!G&&0===Y.length&&(0===P.length||null!==U)&&/* @__PURE__ */n("div",{class:"absolute inset-0 z-30 flex items-center justify-center bg-white/90",children:/* @__PURE__ */n(d,{title:"No Events",description:"Check back later for our awesome events!",iconSvg:/* @__PURE__ */n(u,{})})}),
3
- /* @__PURE__ */n("div",{ref:C,class:"h-full w-full rounded-xl border border-slate-200"})]})};export{R as default};
1
+ import{n as e}from"./Cko4QHwX.js";import{C as t,_ as o,f as l,h as r,p as a,t as n}from"./DrrpB4Om.js";import{I as i,a as f,n as c,w as p}from"./CaX2xgrP.js";import{t as s}from"./BZu3c37u.js";import{t as d}from"./DF0LxcV7.js";import{t as u}from"./Rcen6i0h.js";import{t as m}from"./h4ZjZXfe2.js";import{a as g,i as b,n as h,r as x,t as v}from"./BccTn5v-2.js";import{t as k}from"./CfMNBPpx2.js";var y=[[90,-180],[-90,180]],w=[20,0],z="#fb8500",A={topLeft:[276,60],bottomRight:[60,60]},E=new s,L=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),C=({onExplore:s,logoUrl:C})=>{const R=l(null),T=l(null),M=l(null),O=l(null),I=l(null),W=l(null),j=l(null),S=l(!1),Z=l(!1),q=a(()=>(()=>{try{const e=sessionStorage.getItem(p);if(!e)return null;const t=JSON.parse(e);if("number"==typeof t?.center?.lat&&"number"==typeof t?.center?.lng&&"number"==typeof t?.zoom)return t}catch{}return null})(),[]),[D,B]=r(!0),[H,N]=r(!1),{folderTree:P,activeFolderId:U,activeFolder:F,visibleEvents:Y,setActiveFolderId:J,isLoadingEvents:Q}=m(),{organization:G}=c();return o(()=>{if(!R.current||T.current)return;k("leaflet",'.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;top:0;left:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:0 0}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{-webkit-transform-origin:0 0;width:1600px;height:1600px}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{width:auto;padding:0;max-width:none!important;max-height:none!important}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:#33b5e566}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{box-sizing:border-box;z-index:800;width:0;height:0}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{z-index:800;pointer-events:visiblePainted;pointer-events:auto;position:relative}.leaflet-top,.leaflet-bottom{z-index:1000;pointer-events:none;position:absolute}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{outline-offset:1px;background:#ddd}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{background:#ffffff80;border:2px dotted #38f}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:.75rem;line-height:1.5}.leaflet-bar{border-radius:4px;box-shadow:0 1px 5px #000000a6}.leaflet-bar a{text-align:center;color:#000;background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;text-decoration:none;display:block}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom:none;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.leaflet-bar a.leaflet-disabled{cursor:default;color:#bbb;background-color:#f4f4f4}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-right-radius:2px;border-bottom-left-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{text-indent:1px;font:700 18px Lucida Console,Monaco,monospace}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{background:#fff;border-radius:5px;box-shadow:0 1px 5px #0006}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{color:#333;background:#fff;padding:6px 10px 6px 6px}.leaflet-control-layers-scrollbar{padding-right:5px;overflow:hidden scroll}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{font-size:1.08333em;display:block}.leaflet-control-layers-separator{border-top:1px solid #ddd;height:0;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{color:#333;padding:0 5px;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{width:1em;height:.6669em;vertical-align:baseline!important;display:inline!important}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{white-space:nowrap;box-sizing:border-box;text-shadow:1px 1px #fff;background:#fffc;border:2px solid #777;border-top:none;padding:2px 5px 1px;line-height:1.1}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{background-clip:padding-box;border:2px solid #0003}.leaflet-popup{text-align:center;margin-bottom:20px;position:absolute}.leaflet-popup-content-wrapper{text-align:left;border-radius:12px;padding:1px}.leaflet-popup-content{min-height:1px;margin:13px 24px 13px 20px;font-size:1.08333em;line-height:1.3}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{pointer-events:none;width:40px;height:20px;margin-top:-1px;margin-left:-20px;position:absolute;left:50%;overflow:hidden}.leaflet-popup-tip{pointer-events:auto;width:17px;height:17px;margin:-10px auto 0;padding:1px;transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{color:#333;background:#fff;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button{text-align:center;color:#757575;background:0 0;border:none;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;text-decoration:none;position:absolute;top:0;right:0}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";width:24px;filter:progid:DXImageTransform.Microsoft.Matrix(M11=.707107, M12=.707107, M21=-.707107, M22=.707107);margin:0 auto}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{color:#222;white-space:nowrap;-webkit-user-select:none;user-select:none;pointer-events:none;background-color:#fff;border:1px solid #fff;border-radius:3px;padding:6px;position:absolute;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{pointer-events:none;content:"";background:0 0;border:6px solid #0000;position:absolute}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{margin-left:-6px;left:50%}.leaflet-tooltip-top:before{border-top-color:#fff;margin-bottom:-12px;bottom:0}.leaflet-tooltip-bottom:before{border-bottom-color:#fff;margin-top:-12px;margin-left:-6px;top:0}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{margin-top:-6px;top:50%}.leaflet-tooltip-left:before{border-left-color:#fff;margin-right:-12px;right:0}.leaflet-tooltip-right:before{border-right-color:#fff;margin-left:-12px;left:0}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}'),k("marker-cluster",".leaflet-cluster-anim .leaflet-marker-icon,.leaflet-cluster-anim .leaflet-marker-shadow{transition:transform .3s ease-out,opacity .3s ease-in}.leaflet-cluster-spider-leg{transition:stroke-dashoffset .3s ease-out,stroke-opacity .3s ease-in}.marker-cluster-small{background-color:#b5e28c99}.marker-cluster-small div{background-color:#6ecc3999}.marker-cluster-medium{background-color:#f1d35799}.marker-cluster-medium div{background-color:#f0c20c99}.marker-cluster-large{background-color:#fd9c7399}.marker-cluster-large div{background-color:#f1801799}.leaflet-oldie .marker-cluster-small{background-color:#b5e28c}.leaflet-oldie .marker-cluster-small div{background-color:#6ecc39}.leaflet-oldie .marker-cluster-medium{background-color:#f1d357}.leaflet-oldie .marker-cluster-medium div{background-color:#f0c20c}.leaflet-oldie .marker-cluster-large{background-color:#fd9c73}.leaflet-oldie .marker-cluster-large div{background-color:#f18017}.marker-cluster{background-clip:padding-box;border-radius:20px}.marker-cluster div{text-align:center;border-radius:15px;width:30px;height:30px;margin-top:5px;margin-left:5px}.marker-cluster span{line-height:30px}");let t,o=!1;return(async()=>{try{const l=await import("./BCTYvPrD.js").then(t=>/* @__PURE__ */e(t.default,1));if(o)return;if("undefined"!=typeof window&&(window.L=l),await Promise.all([import("./CgUphJWo.js").then(t=>/* @__PURE__ */e(t.default,1)),import("./rtH8O6Hc.js")]),o)return;const r=window.L??l;if(!R.current)return;const a=l.map(R.current,{center:q?.center?[q.center.lat??w[0],q.center.lng??w[1]]:w,zoom:q?.zoom??3,minZoom:3,zoomControl:!0,worldCopyJump:!1,maxBounds:l.latLngBounds(y),maxBoundsViscosity:1});l.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"&copy; OpenStreetMap contributors",maxZoom:19,noWrap:!0}).addTo(a);const n=l.layerGroup().addTo(a),i="function"==typeof r.heatLayer?r.heatLayer([],{radius:30,blur:30,maxZoom:10,minOpacity:.35}):null;i?.addTo(a);const f="function"==typeof r.markerClusterGroup?r.markerClusterGroup({chunkedLoading:!0,showCoverageOnHover:!1,spiderfyOnMaxZoom:!0,zoomToBoundsOnClick:!0,maxClusterRadius:48}):l.layerGroup();f.addTo(a);const c=()=>{j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{try{sessionStorage.setItem(p,JSON.stringify({center:a.getCenter(),zoom:a.getZoom()}))}catch{}},250)};let s;a.on("zoomend",c),a.on("moveend",c),T.current=a,M.current=r,O.current=n,W.current=i,I.current=f,"undefined"!=typeof ResizeObserver&&R.current&&(s=new ResizeObserver(()=>a.invalidateSize(!1)),s.observe(R.current)),requestAnimationFrame(()=>a.invalidateSize(!1)),N(!0),B(!1),t=()=>{s?.disconnect(),j.current&&clearTimeout(j.current),a.off("zoomend",c),a.off("moveend",c),a.remove(),M.current=null,T.current=null,O.current=null,W.current=null,I.current=null}}finally{o||B(!1)}})(),()=>{o=!0,t?.()}},[q]),o(()=>{if(!H)return;const e=M.current;if(!e)return;const o=T.current;if(O.current?.clearLayers(),I.current?.clearLayers(),null===U&&P.length>0){o&&W.current&&(W.current.setLatLngs?.([]),o.hasLayer(W.current)&&o.removeLayer(W.current));const t=o=>{for(const l of o)if(l.centroid){const[t,o]=l.centroid,r=e.divIcon({className:"",html:`<div style="transform:translate(-50%,-50%);background:${x(l.color,z)};color:#fff;border-radius:20px;padding:5px 10px;font-size:12px;font-weight:600;white-space:nowrap;box-shadow:0 2px 8px rgba(0,0,0,0.25);border:2px solid rgba(255,255,255,0.4);cursor:pointer;display:inline-flex;align-items:center;gap:6px;"><span>${L(l.folder.name)}</span><span style="background:rgba(0,0,0,0.18);border-radius:10px;padding:1px 5px;font-size:10px;">${l.eventCount}</span></div>`,iconSize:[0,0],iconAnchor:[0,0]});e.marker([o,t],{icon:r}).on("click",()=>J(l.folder._id)).addTo(O.current)}else l.children.length>0&&t(l.children)};t(P)}else{if(0===Y.length)return;const l=0===P.length&&null===U,r=x(F?.color,z);if(o&&W.current&&(l&&!o.hasLayer(W.current)?W.current.addTo(o):l||(W.current.setLatLngs?.([]),o.hasLayer(W.current)&&o.removeLayer(W.current))),Y.forEach(o=>{const l=o.location.x,a=o.location.y,f=e.divIcon({className:"qrati-leaflet-marker-wrapper",html:`<div style="width:36px;height:36px;cursor:pointer;background:${r};border-radius:50% 50% 50% 0;transform:rotate(-45deg);border:2px solid white;box-shadow:0 2px 8px rgba(0,0,0,0.3);display:flex;align-items:center;justify-content:center;overflow:hidden;">${b(C)?`<img src="${b(C)}" style="width:24px;height:24px;border-radius:50%;object-fit:cover;transform:rotate(45deg);" />`:""}</div>`,iconSize:[36,36],iconAnchor:[18,36],popupAnchor:[0,-36]}),c=e.marker([a,l],{icon:f}),p=document.createElement("div");p.style.width="fit-content",((e,o,l)=>{t(/* @__PURE__ */n(i,{client:E,children:/* @__PURE__ */n(g,{event:e,onExplore:l})}),o)})(o,p,s),c.bindPopup(p,{closeButton:!0,maxWidth:256}),I.current?.addLayer(c)}),l&&W.current){const e=Y.reduce((e,t)=>Math.max(e,t.views??0),1),t=Y.map(e=>[e.location.y,e.location.x,e.views??1]);W.current.setOptions?.({radius:30,blur:30,maxZoom:10,minOpacity:.35,max:e}),W.current.setLatLngs?.(t)}if(l&&!Z.current&&o&&(Z.current=!0,!q)){const t=e.latLngBounds([]);Y.forEach(e=>t.extend([e.location.y,e.location.x])),t.isValid()&&o.fitBounds(t,{paddingTopLeft:A.topLeft,paddingBottomRight:A.bottomRight,maxZoom:8})}}},[U,P,Y,H,s,C,J,F,q]),o(()=>{if(!H)return;const e=T.current,t=M.current;if(!e||!t)return;if(!S.current&&q)return void(S.current=!0);S.current=!0;const o={paddingTopLeft:A.topLeft,paddingBottomRight:A.bottomRight,duration:3,easeLinearity:1};if(U){const l=h(P,U);if(!l?.folder.boundary?.length)return;const r=t.latLngBounds([]);for(const e of l.folder.boundary)r.extend([e.y,e.x]);r.isValid()&&e.flyToBounds(r,{...o,maxZoom:14})}else{const l=t.latLngBounds([]),r=e=>{for(const t of e)t.centroid?l.extend([t.centroid[1],t.centroid[0]]):r(t.children)};r(P),l.isValid()&&e.flyToBounds(l,{...o,maxZoom:8})}},[U,P,H,q]),/* @__PURE__ */n("div",{class:"relative h-screen w-full sm:h-[calc(100vh-4rem)]",style:f(G),children:[
2
+ /* @__PURE__ */n(v,{positionClass:"absolute top-3 left-16 z-[1000]",folderTree:P,activeFolderId:U,setActiveFolderId:J}),Q&&/* @__PURE__ */n("div",{class:"absolute inset-0 z-10 flex items-center justify-center bg-white/60",children:/* @__PURE__ */n("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"})}),D&&/* @__PURE__ */n("div",{class:"absolute inset-0 z-20 flex items-center justify-center bg-white/85",children:/* @__PURE__ */n("div",{class:"flex flex-col items-center gap-3",children:[/* @__PURE__ */n("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"}),/* @__PURE__ */n("p",{class:"text-sm font-medium text-slate-700",children:"Loading map…"})]})}),!Q&&0===Y.length&&(0===P.length||null!==U)&&/* @__PURE__ */n("div",{class:"absolute inset-0 z-30 flex items-center justify-center bg-white/90",children:/* @__PURE__ */n(d,{title:"No Events",description:"Check back later for our awesome events!",iconSvg:/* @__PURE__ */n(u,{})})}),
3
+ /* @__PURE__ */n("div",{ref:R,class:"h-full w-full rounded-xl border border-slate-200"})]})};export{C as default};
@@ -1,2 +1,2 @@
1
1
  import{D as e,_ as t,a as r,f as o,h as n,t as s}from"./DrrpB4Om.js";import{i}from"./CaX2xgrP.js";import{n as a}from"./BkIDQGIs.js";var l=({as:r="div",className:n,threshold:s=.5,rootMargin:i="0px",triggerOnce:a,onChange:l,onClick:h,children:c})=>{const u=o(null),d=o(!1),p=o(l);return p.current=l,t(()=>{const e=u.current;if(!e)return;d.current=!1;const t=new IntersectionObserver(e=>{e.forEach(e=>{a&&d.current||(e.isIntersecting&&(d.current=!0),p.current?.(e.isIntersecting))})},{threshold:s,rootMargin:i});return t.observe(e),()=>t.disconnect()},[s,i,a]),e(r,{ref:u,className:n,onClick:h},c)},h=Object.defineProperty,c=Object.defineProperties,u=Object.getOwnPropertyDescriptors,d=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,g=(e,t,r)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,m=(e,t)=>{for(var r in t||(t={}))p.call(t,r)&&g(e,r,t[r]);if(d)for(var r of d(t))f.call(t,r)&&g(e,r,t[r]);return e},b=(e,t)=>c(e,u(t)),w=(e,t)=>{var r={};for(var o in e)p.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&d)for(var o of d(e))t.indexOf(o)<0&&f.call(e,o)&&(r[o]=e[o]);return r},v=class extends r{constructor(){super(...arguments),this.canvas=null,this.handleRef=e=>{this.canvas=e,this.draw()},this.draw=()=>{let{hash:e,height:t,punch:r,width:o}=this.props;if(this.canvas){let n=a(e,o,t,r),s=this.canvas.getContext("2d"),i=s.createImageData(o,t);i.data.set(n),s.putImageData(i,0,0)}}}componentDidUpdate(){this.draw()}render(){let t=this.props,{hash:r,height:o,width:n}=t,s=w(t,["hash","height","width"]);return e("canvas",b(m({},s),{height:o,width:n,ref:this.handleRef}))}};v.defaultProps={height:128,width:128};var y={position:"absolute",top:0,bottom:0,left:0,right:0,width:"100%",height:"100%"};(class extends r{componentDidUpdate(){if(this.props.resolutionX<=0)throw new Error("resolutionX must be larger than zero");if(this.props.resolutionY<=0)throw new Error("resolutionY must be larger than zero")}render(){let t=this.props,{hash:r,height:o,width:n,punch:s,resolutionX:i,resolutionY:a,style:l}=t,h=w(t,["hash","height","width","punch","resolutionX","resolutionY","style"]);return e("div",b(m({},h),{style:b(m({display:"inline-block",height:o,width:n},l),{position:"relative"})}),e(v,{hash:r,height:a,width:i,punch:s,style:y}))}}).defaultProps={height:128,width:128,resolutionX:32,resolutionY:32};var j=v,O=({src:e,alt:r,threshold:a=.1,rootMargin:h="600px 0px",blurhash:c,containerClassName:u="size-full",wrapperClassName:d,imgClassName:p="",sizeMode:f="cover",position:g="center",delayMs:m=100,delayTime:b,onClick:w})=>{const v=c&&c.length>=6?c:"LEHV6nWB2yk8pyo0adR*.7kCMdnj",[y,O]=n(!1),[C,x]=n(!1),[N,k]=n(!1),z=o(null);t(()=>{O(!1),x(!1)},[e]);const M="number"==typeof b?b:m,P=d??u;t(()=>{if(!y)return N?z.current=window.setTimeout(()=>{x(!0)},M):z.current&&(clearTimeout(z.current),z.current=null),()=>{z.current&&clearTimeout(z.current)}},[N,y,M]);const D=C&&N||y;/* @__PURE__ */
2
- return s(l,{as:"div",className:i(P,"relative overflow-hidden"),threshold:a,rootMargin:h,onChange:e=>k(e),children:[N&&!y&&/* @__PURE__ */s(j,{className:"size-full blur-2xl",hash:v}),D&&e&&/* @__PURE__ */s("img",{alt:r,src:e,loading:"lazy",decoding:"async",onLoad:()=>O(!0),className:i("absolute top-0 left-0 size-full object-center transition-all duration-300",y?"scale-100 opacity-100":"scale-95 opacity-0","contain"===f?"object-contain":"object-cover","top"===g?"object-top":"bottom"===g?"object-bottom":"object-center",p),onClick:e=>w?.(e)})]})};export{l as n,O as t};
2
+ return s(l,{as:"div",className:i(P,"relative overflow-hidden"),threshold:a,rootMargin:h,onChange:e=>k(e),children:[N&&/* @__PURE__ */s(j,{className:"size-full blur-2xl",hash:v}),D&&e&&/* @__PURE__ */s("img",{alt:r,src:e,loading:"lazy",decoding:"async",onLoad:()=>O(!0),className:i("absolute top-0 left-0 size-full object-center transition-all duration-300",y?"scale-100 opacity-100":"scale-95 opacity-0","contain"===f?"object-contain":"object-cover","top"===g?"object-top":"bottom"===g?"object-bottom":"object-center",p),onClick:e=>w?.(e)})]})};export{l as n,O as t};
@@ -0,0 +1,9 @@
1
+ import{t}from"./DrrpB4Om.js";import{D as a,n as s}from"./CaX2xgrP.js";import{i as r,n as e,u as o}from"./ChJXhA9c.js";import{t as i}from"./DF0LxcV7.js";import{t as n}from"./DGbyGc8b.js";import{t as l}from"./DCj_fMN5.js";import{t as m}from"./DnQ6XaLR.js";import{t as c}from"./DGGc10Cy.js";import{t as d}from"./CM46vluW.js";import{t as g}from"./C3dOFk9A.js";var p=()=>{const p=o(),{props:f}=s(),v=f?.organizationId,{loading:h,event:u}=d({eventSlug:p.eventSlug});if(h)/* @__PURE__ */return t("div",{children:[
2
+ /* @__PURE__ */t(n,{className:"mx-auto mt-4 h-8 w-64"}),
3
+ /* @__PURE__ */t(n,{className:"mx-auto mt-6 h-6 w-72"}),
4
+ /* @__PURE__ */t(n,{className:"mx-auto mt-6 h-8 w-72"}),
5
+ /* @__PURE__ */t("div",{className:"mt-8 grid grid-cols-1 gap-4 sm:grid-cols-3",children:Array.from({length:8}).map((a,s)=>/* @__PURE__ */t(n,{className:"h-72"},s))})]});const N=u?.organizationId?.toString?.()||u?.organizationId,j=v?.toString?.()||v;/* @__PURE__ */
6
+ return t("div",u&&N===j?{className:"bg-background relative min-h-screen",children:/* @__PURE__ */t(c,{locale:u?.language??"en",translations:u?.translations,children:[
7
+ /* @__PURE__ */t(m,{}),
8
+ /* @__PURE__ */t(r,{}),
9
+ /* @__PURE__ */t(l,{})]})}:{className:"flex w-full flex-col items-center gap-8",children:[/* @__PURE__ */t(i,{className:"mt-16",title:"Event not found",description:"Please check the provided link",iconSvg:/* @__PURE__ */t("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-full",viewBox:"0 0 997.86122 450.8081",role:"img"})}),/* @__PURE__ */t(e,{to:a.PUBLIC_EVENTS,state:{internalNavigation:!0},children:/* @__PURE__ */t(g,{children:"All events"})})]})};export{p as default};