@qratilabs/qrati-connect 1.0.0-beta.13 → 1.0.0-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/ContentsPage-B2Rw9mzp.js +16 -0
- package/LeadersPage-Do9XUltu.js +1 -0
- package/PublicEvents-CvEdnmEO.js +1 -0
- package/RatePage-BSV_QHcK.js +1 -0
- package/UploadPage-DOkmh1AH.js +16 -0
- package/heic2any-Cxvc1Ybo.js +1 -0
- package/{index.esm.js → index-Di4l5WHY.js} +97 -89
- package/index.js +1 -0
- package/package.json +2 -1
- package/photoswipe-NmVzFLCS.js +1 -0
- package/stats.html +1 -1
- package/style-utils-p4AvuOlS.js +1 -0
- package/index.cjs.js +0 -1447
- package/index.cjs.js.map +0 -1
- package/index.esm.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [1.0.0-beta.13](https://github.com/qrati-labs/qrati-connect-js/compare/v1.0.0-beta.12...v1.0.0-beta.13) (2025-02-14)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* update header to clarify displayed base URL in QratiConnect component ([f48ba6f](https://github.com/qrati-labs/qrati-connect-js/commit/f48ba6f76ec8ee4a155422a3f98812d56102bae1))
|
|
7
|
+
|
|
1
8
|
# [1.0.0-beta.12](https://github.com/qrati-labs/qrati-connect-js/compare/v1.0.0-beta.11...v1.0.0-beta.12) (2025-02-14)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import*as t from"react";import e,{useReducer as i,useRef as n,useCallback as o,forwardRef as s,createElement as r,useMemo as a,useState as l,Fragment as c,useEffect as h,Component as p}from"react";import{Q as d,i as u,h as m,b as g,c as f,j as w,s as b,u as v,d as y,a as _,L as x,k as T}from"./index-Di4l5WHY.js";import{c as k,C as E,G as S}from"./style-utils-p4AvuOlS.js";var I=class extends d{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t,e){super.setOptions({...t,behavior:u()},e)}getOptimisticResult(t){return t.behavior=u(),super.getOptimisticResult(t)}fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,e){const{state:i}=t,n=super.createResult(t,e),{isFetching:o,isRefetching:s,isError:r,isRefetchError:a}=n,l=i.fetchMeta?.fetchMore?.direction,c=r&&"forward"===l,h=o&&"forward"===l,p=r&&"backward"===l,d=o&&"backward"===l;return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:g(e,i.data),hasPreviousPage:m(e,i.data),isFetchNextPageError:c,isFetchingNextPage:h,isFetchPreviousPageError:p,isFetchingPreviousPage:d,isRefetchError:a&&!c&&!p,isRefetching:s&&!h&&!d}}};const z=t=>t?.meta?.currentPage>1&&t.meta.currentPage-1,P=t=>t?.meta?.currentPage<t?.meta?.totalPages?t.meta.currentPage+1:void 0;function C(t,[e,i]){const[n,o]=t;return void 0!==n&&void 0!==o&&void 0!==e&&void 0!==i&&e>n&&e-n<=20&&i<o?[n,i]:n!==e||o!==i?[e,i]:t}function M(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}function L(t,e,s){const[[r],a]=i(C,[s]),l=function(t){const e=n(t);return t&&e.current&&t.length===e.current.length&&!e.current.some(((e,i)=>e!==t[i]))||(e.current=t),e.current}(e),c=n();return{containerRef:o((e=>{c.current?.disconnect(),c.current=void 0;const i=()=>a([M(e,l),window.innerWidth-document.documentElement.clientWidth]);i(),e&&"undefined"!=typeof ResizeObserver&&(c.current=new ResizeObserver(i),c.current.observe(e)),"function"==typeof t?t(e):t&&(t.current=e)}),[t,l]),containerWidth:r}}function D(t){return["react-photo-album",t].filter(Boolean).join("--")}function N({width:t,height:e}){return t/e}const O=Object.freeze([1200,600,300,0]);function q(t,e){return"function"==typeof t?t(e):t}function A(t,e){return void 0!==e?q(t,e):void 0}function F(t,e,i,n=0){if(void 0===e)return;const o=A(t,e);return Math.round(Math.max(void 0===o?function(t,e){const i=O.findIndex((t=>t<=e));return q(t[Math.max(i,0)],e)}(i,e):o,n))}function V(t,{spacing:e,padding:i,componentsProps:n,render:o}){return{spacing:F(e,t,[20,15,10,5]),padding:F(i,t,[0,0,0,0]),componentsProps:q(n,t)||{},render:q(o,t)}}function j(t,e=0){const i=10**e;return Math.round((t+Number.EPSILON)*i)/i}function R(t,e,i,n,o,s,r){let a,l;const c=t=>{const e=s*(o-1)+2*r*o;return`calc((${t.match(/^\s*calc\((.*)\)\s*$/)?.[1]??t} - ${e}px) / ${j((n-e)/i,5)})`},h=t.srcSet;return h&&h.length>0&&(a=h.concat(h.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(", ")),l=e?.size?(e.sizes||[]).map((({viewport:t,size:e})=>`${t} ${c(e)}`)).concat(c(e.size)).join(", "):`${Math.ceil(i/n*100)}vw`,{srcSet:a,sizes:l}}const B=s((function({as:t,render:e,context:i,classes:n=[],variables:o={},style:s,className:r,children:a,...l},c){const h=function(...t){return[...t].filter(Boolean).join(" ")}(...(Array.isArray(n)?n:[n]).filter((t=>"string"==typeof t)).map(D),r),p={style:{...Object.fromEntries(Object.entries(o).map((([t,e])=>{return[(i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),`--${D(i)}`),"number"==typeof e?j(e,5):e];var i}))),...s},className:h,children:a,...l};if(e){const t=e({ref:c,...p},i);if(t)return t}const d=t||"div";return w.jsx(d,{ref:c,...p})}));const $=s((function({photo:t,index:e,width:i,height:n,onClick:o,render:{wrapper:s,link:r,button:a,image:l,extras:c}={},componentsProps:{link:h,button:p,wrapper:d,image:u}={}},m){const{href:g}=t,f={photo:t,index:e,width:j(i,3),height:j(n,3)};let b;return b=g?{...h,as:"a",render:r,classes:["photo","link"],href:g,onClick:o}:o?{...p,as:"button",type:"button",render:a,classes:["photo","button"],onClick:o}:{...d,render:s,classes:"photo"},w.jsxs(B,{ref:m,variables:{photoWidth:f.width,photoHeight:f.height},...{context:f,...b},children:[w.jsx(B,{as:"img",classes:"image",render:l,context:f,...u}),c?.({},f)]})}));const U=s((function({layout:t,sizes:e,model:i,skeleton:n,onClick:o,render:{container:s,track:a,photo:l,...c}={},componentsProps:{container:h,track:p,link:d,button:u,wrapper:m,image:g}={}},f){const{spacing:b,padding:v,containerWidth:y,tracks:_,variables:x,horizontal:T}=i||{};return w.jsxs(B,{role:"group","aria-label":"Photo album",...h,variables:{spacing:b,padding:v,containerWidth:y,...x},classes:["",t],render:s,ref:f,children:[void 0!==b&&void 0!==v&&void 0!==y&&_?.map((({photos:t,variables:i},n)=>{const s=t.length,h=T?s:_.length;return r(B,{...p,key:n,render:a,classes:"track",variables:{trackSize:s,...i}},t.map((t=>{const{photo:i,index:n,width:s}=t,{key:r,src:a,alt:p,title:f,label:_}=i,x=o?t=>{o({event:t,photo:i,index:n})}:void 0;if(l){const e=l({onClick:x},t);if(e)return e}const T=t=>_?{"aria-label":_,...t}:t;return w.jsx($,{onClick:x,render:c,componentsProps:{image:{loading:"lazy",decoding:"async",src:a,alt:p,title:f,...R(i,e,s,y,h,b,v),...q(g,t)},link:T(q(d,t)),button:T(q(u,t)),wrapper:q(m,t)},...t},r??a)})))})),void 0===y&&n]})}));function W(t){let e=0;const i=[],n=(e,n)=>t(i[e],i[n])<0,o=(t,e)=>{const n=i[t];i[t]=i[e],i[e]=n};return{push:t=>{e+=1,i[e]=t,(t=>{let e=t,i=Math.floor(e/2);for(;e>1&&n(i,e);)o(i,e),e=i,i=Math.floor(e/2)})(e)},pop:()=>{if(0===e)return;o(1,e),e-=1;const t=i.pop();return(t=>{let i=t,s=2*i;for(;s<=e&&(s<e&&n(s,s+1)&&(s+=1),n(i,s));)o(i,s),i=s,s=2*i})(1),t},size:()=>e}}function Y(t,e,i){return function(t,e){if(!t)return;const i=[];for(let n=e;void 0!==n;n=t.get(n))i.push(n);return i.reverse()}(function(t,e,i){const n=new Map,o=new Set,s=new Map;s.set(e,0);const r=W((a=t=>t[1],(t,e)=>a(e)-a(t)));var a;for(r.push([e,0]);r.size()>0;){const[e,i]=r.pop();if(!o.has(e)){const a=t(e);o.add(e),a.forEach(((t,o)=>{const a=i+t,l=n.get(o),c=s.get(o);(void 0===c||c>a&&(c/a>1.005||void 0!==l&&l<e))&&(s.set(o,a),r.push([o,a]),n.set(o,e))}))}}return s.has(i)?n:void 0}(t,e,i),i)}function H(t,e,i,n){return(e-(t.length-1)*i-2*n*t.length)/t.reduce(((t,e)=>t+N(e)),0)}function Z(t,e,i,n,o,s,r){const a=t.slice(e,i),l=H(a,n,o,s);return l>0?(l-r)**2*a.length:void 0}function G(t,e,i,n,o,s,r){const a=function(t,e,i,n){return j(e/i/Math.min(...t.map((t=>N(t)))))+(n||0)+2}(t,n,o,s),l=function(t,e,i,n,o,s,r,a){return l=>{const c=new Map;c.set(l,0);const h=r||1,p=Math.min(s,a||1/0);for(let s=l+h;s<t.length+1&&!(s-l>p);s+=1){const r=Z(t,l,s,n,e,i,o);if(void 0===r)break;c.set(s,r)}return c}}(t,e,i,n,o,a,s,r),c=Y(l,0,t.length);if(!c)return;const h=[];for(let o=1;o<c.length;o+=1){const s=t.map(((t,e)=>({photo:t,index:e}))).slice(c[o-1],c[o]),r=H(s.map((({photo:t})=>t)),n,e,i);h.push({photos:s.map((({photo:t,index:e})=>({photo:t,index:e,width:r*N(t),height:r})))})}return{spacing:e,padding:i,containerWidth:n,tracks:h,horizontal:!0}}const K=s((function({photos:t,breakpoints:e,defaultContainerWidth:i,...n},o){const{containerRef:s,containerWidth:r}=L(o,e,i),{spacing:l,padding:c,targetRowHeight:h,minPhotos:p,maxPhotos:d,...u}=function(t,{photos:e,targetRowHeight:i,rowConstraints:n,...o}){const{spacing:s,padding:r,componentsProps:a,render:l}=V(t,o),{singleRowMaxHeight:c,minPhotos:h,maxPhotos:p}=A(n,t)||{};if(void 0!==c&&void 0!==s&&void 0!==r){const t=Math.floor(e.reduce(((t,{width:e,height:i})=>t+e/i*c-2*r),r*e.length*2+s*(e.length-1)));t>0&&(a.container={...a.container},a.container.style={maxWidth:t,...a.container.style})}return{...o,targetRowHeight:F(i,t,[t=>t/5,t=>t/4,t=>t/3,t=>t/2]),render:l,spacing:s,padding:r,minPhotos:h,maxPhotos:p,componentsProps:a}}(r,{photos:t,...n}),m=a((()=>void 0!==r&&void 0!==l&&void 0!==c&&void 0!==h?G(t,l,c,r,h,p,d):void 0),[t,l,c,r,h,p,d]);return w.jsx(U,{layout:"rows",ref:s,model:m,...u})}));function Q(t,e,i,n){return function(t,e,i){const n=[i];for(let o=i,s=e;s>0;s-=1)[o]=t.get(o)[s],n.push(o);return n.reverse()}(function(t,e,i,n){const o=new Map,s=new Set;s.add(i);for(let i=0;i<e;i+=1){const r=[...s.keys()];s.clear(),r.forEach((r=>{const a=i>0?o.get(r)[i][1]:0;t(r).forEach((([t,l])=>{let c=o.get(t);c||(c=[],o.set(t,c));const h=a+l,p=c[i+1];(!p||p[1]>h&&(p[1]/h>1.0001||r<p[0]))&&(c[i+1]=[r,h]),i<e-1&&t!==n&&s.add(t)}))}))}return o}(t,e,i,n),e,n)}function X(t,e,i,n,o,s,r){const a=[],l=r.reduce(((t,e)=>t+e),0);for(let c=0;c<t.length-1;c+=1){const h=e.map(((t,e)=>({photo:t,index:e}))).slice(t[c],t[c+1]),p=r.reduce(((t,e,i)=>t+(s[c]-s[i])*e),0),d=(o-(t.length-2)*i-2*(t.length-1)*n-p)*r[c]/l;a.push({photos:h.map((({photo:t,index:e})=>({photo:t,index:e,width:d,height:d/N(t)}))),variables:{adjustedGaps:p,columnRatio:r[c]}})}return{tracks:a,variables:{totalRatio:l}}}function J(t,e,i,n,o,s){const r=[],a=[];if(t.length<=s){const o=t.length>0?t.reduce(((t,e)=>t+N(e)),0)/t.length:1;for(let e=0;e<s;e+=1)r[e]=2*i,a[e]=e<t.length?N(t[e]):o;return X(Array.from({length:s+1},((e,i)=>Math.min(i,t.length))),t,e,i,n,r,a)}const l=(t.reduce(((t,e)=>t+o/N(e)),0)+e*(t.length-s)+2*i*t.length)/s,c=function(t,e,i,n,o){return s=>{const r=[],a=1.5*o;let l=n/N(t[s])+2*i;for(let c=s+1;c<t.length+1&&(r.push([c,(o-l)**2]),!(l>a||c===t.length));c+=1)l+=n/N(t[c])+e+2*i;return r}}(t,e,i,o,l),h=Q(c,s,0,t.length);for(let n=0;n<h.length-1;n+=1){const o=t.slice(h[n],h[n+1]);r[n]=e*(o.length-1)+2*i*o.length,a[n]=1/o.reduce(((t,e)=>t+1/N(e)),0)}return X(h,t,e,i,n,r,a)}function tt(t,e,i,n,o){const s=(n-e*(o-1)-2*i*o)/o,{tracks:r,variables:a}=J(t,e,i,n,s,o);return r.some((t=>t.photos.some((({width:t,height:e})=>t<0||e<0))))?o>1?tt(t,e,i,n,o-1):void 0:{tracks:r,spacing:e,padding:i,containerWidth:n,variables:{columns:o,...a}}}const et=s((function({photos:t,breakpoints:e,defaultContainerWidth:i,...n},o){const{containerRef:s,containerWidth:r}=L(o,e,i),{spacing:l,padding:c,columns:h,...p}=function(t,{columns:e,...i}){return{...i,...V(t,i),columns:F(e,t,[5,4,3,2],1)}}(r,{photos:t,...n}),d=a((()=>void 0!==r&&void 0!==l&&void 0!==c&&void 0!==h?tt(t,l,c,r,h):void 0),[t,l,c,r,h]);return w.jsx(U,{layout:"columns",ref:s,model:d,...p})}));function it(t,e,i,n,o){const s=(n-e*(o-1)-2*i*o)/o;if(s<=0)return o>1?it(t,e,i,n,o-1):void 0;const r=[];for(let t=0;t<o;t+=1)r[t]=0;const a=t.reduce(((t,n,o)=>{const a=r.reduce(((t,e,i)=>e<r[t]-1?i:t),0);return r[a]=r[a]+s/N(n)+e+2*i,t[a].push({photo:n,index:o}),t}),Array.from({length:o},(()=>[])));return{spacing:e,padding:i,containerWidth:n,variables:{columns:o},tracks:a.map((t=>({photos:t.map((({photo:t,index:e})=>({photo:t,index:e,width:s,height:s/N(t)})))})))}}const nt=s((function({photos:t,breakpoints:e,defaultContainerWidth:i,...n},o){const{containerRef:s,containerWidth:r}=L(o,e,i),{spacing:l,padding:c,columns:h,...p}=function(t,{columns:e,...i}){return{...i,...V(t,i),columns:F(e,t,[5,4,3,2],1)}}(r,{photos:t,...n}),d=a((()=>void 0!==r&&void 0!==l&&void 0!==c&&void 0!==h?it(t,l,c,r,h):void 0),[t,l,c,r,h]);return w.jsx(U,{layout:"masonry",ref:s,model:d,...p})}));function ot(t,e,i){const n=document.createElement(e);return t&&(n.className=t),i&&i.appendChild(n),n}function st(t,e){return t.x=e.x,t.y=e.y,void 0!==e.id&&(t.id=e.id),t}function rt(t){t.x=Math.round(t.x),t.y=Math.round(t.y)}function at(t,e){const i=Math.abs(t.x-e.x),n=Math.abs(t.y-e.y);return Math.sqrt(i*i+n*n)}function lt(t,e){return t.x===e.x&&t.y===e.y}function ct(t,e,i){return Math.min(Math.max(t,e),i)}function ht(t,e,i){let n=`translate3d(${t}px,${e||0}px,0)`;return void 0!==i&&(n+=` scale3d(${i},${i},1)`),n}function pt(t,e,i,n){t.style.transform=ht(e,i,n)}b(".react-photo-album{display:flex}.react-photo-album,.react-photo-album *{box-sizing:border-box}.react-photo-album--track{align-items:flex-start;display:flex}.react-photo-album--photo{padding:calc(var(--react-photo-album--padding)*1px);position:relative}.react-photo-album--image{aspect-ratio:var(--react-photo-album--photo-width)/var(--react-photo-album--photo-height);display:block;height:auto;width:100%}.react-photo-album--button{background:initial;border:initial;cursor:pointer}.react-photo-album--rows{flex-direction:column;row-gap:calc(var(--react-photo-album--spacing)*1px)}.react-photo-album--rows .react-photo-album--track{--react-photo-album--track-gaps:calc(var(--react-photo-album--spacing)*(var(--react-photo-album--track-size) - 1) + var(--react-photo-album--padding)*2*var(--react-photo-album--track-size));justify-content:space-between}.react-photo-album--rows .react-photo-album--photo{width:calc((100% - var(--react-photo-album--track-gaps)*1px)/(var(--react-photo-album--container-width) - var(--react-photo-album--track-gaps))*var(--react-photo-album--photo-width) + 2px*var(--react-photo-album--padding))}.react-photo-album--columns{justify-content:space-between}.react-photo-album--columns .react-photo-album--track{flex-direction:column;justify-content:space-between;row-gap:calc(var(--react-photo-album--spacing)*1px);width:calc((100% - 1px*(var(--react-photo-album--columns) - 1)*var(--react-photo-album--spacing) - 2px*var(--react-photo-album--columns)*var(--react-photo-album--padding) - var(--react-photo-album--adjusted-gaps)*1px)*var(--react-photo-album--column-ratio)/var(--react-photo-album--total-ratio) + 2px*var(--react-photo-album--padding))}.react-photo-album--columns .react-photo-album--photo{width:100%}.react-photo-album--masonry{justify-content:space-between}.react-photo-album--masonry .react-photo-album--track{flex-direction:column;justify-content:flex-start;row-gap:calc(var(--react-photo-album--spacing)*1px);width:calc((100% - var(--react-photo-album--spacing)*1px*(var(--react-photo-album--columns) - 1))/var(--react-photo-album--columns))}.react-photo-album--masonry .react-photo-album--photo{width:100%}");function dt(t,e,i,n){t.style.transition=e?`${e} ${i}ms ${n||"cubic-bezier(.4,0,.22,1)"}`:"none"}function ut(t,e,i){t.style.width="number"==typeof e?`${e}px`:e,t.style.height="number"==typeof i?`${i}px`:i}function mt(t){dt(t)}function gt(t){return"decode"in t?t.decode().catch((()=>{})):t.complete?Promise.resolve(t):new Promise(((e,i)=>{t.onload=()=>e(t),t.onerror=i}))}const ft="idle",wt="loading",bt="loaded",vt="error";function yt(t){return"button"in t&&1===t.button||t.ctrlKey||t.metaKey||t.altKey||t.shiftKey}function _t(t,e,i=document){let n=[];if(t instanceof Element)n=[t];else if(t instanceof NodeList||Array.isArray(t))n=Array.from(t);else{const o="string"==typeof t?t:e;o&&(n=Array.from(i.querySelectorAll(o)))}return n}function xt(){return!(!navigator.vendor||!navigator.vendor.match(/apple/i))}class Tt{constructor(t,e){if(this.element=ot("pswp__img pswp__img--placeholder",t?"img":"div",e),t){const e=this.element;e.decoding="async",e.alt="",e.src=t,e.setAttribute("role","presentation")}this.element.setAttribute("aria-hidden","true")}setDisplayedSize(t,e){this.element&&("IMG"===this.element.tagName?(ut(this.element,250,"auto"),this.element.style.transformOrigin="0 0",this.element.style.transform=ht(0,0,t/250)):ut(this.element,t,e))}destroy(){this.element?.parentNode&&this.element.remove(),this.element=null}}class kt{constructor(t,e,i){this.instance=e,this.data=t,this.index=i,this.element=void 0,this.placeholder=void 0,this.slide=void 0,this.displayedImageWidth=0,this.displayedImageHeight=0,this.width=Number(this.data.w)||Number(this.data.width)||0,this.height=Number(this.data.h)||Number(this.data.height)||0,this.isAttached=!1,this.hasSlide=!1,this.isDecoding=!1,this.state=ft,this.data.type?this.type=this.data.type:this.data.src?this.type="image":this.type="html",this.hash=this.data.hash,this.instance.dispatch("contentInit",{content:this})}removePlaceholder(){this.placeholder&&!this.keepPlaceholder()&&setTimeout((()=>{this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0)}),1e3)}load(t,e){if(this.slide&&this.usePlaceholder())if(this.placeholder){const t=this.placeholder.element;t&&!t.parentElement&&this.slide.container.prepend(t)}else{const t=this.instance.applyFilters("placeholderSrc",!(!this.data.msrc||!this.slide.isFirstSlide)&&this.data.msrc,this);this.placeholder=new Tt(t,this.slide.container)}this.element&&!e||this.instance.dispatch("contentLoad",{content:this,isLazy:t}).defaultPrevented||(this.isImageContent()?(this.element=ot("pswp__img","img"),this.displayedImageWidth&&this.loadImage(t)):(this.element=ot("pswp__content","div"),this.element.innerHTML=this.data.html||""),e&&this.slide&&this.slide.updateContentSize(!0))}loadImage(t){if(!this.isImageContent()||!this.element||this.instance.dispatch("contentLoadImage",{content:this,isLazy:t}).defaultPrevented)return;const e=this.element;this.updateSrcsetSizes(),this.data.srcset&&(e.srcset=this.data.srcset),e.src=this.data.src??"",e.alt=this.data.alt??"",this.state=wt,e.complete?this.onLoaded():(e.onload=()=>{this.onLoaded()},e.onerror=()=>{this.onError()})}setSlide(t){this.slide=t,this.hasSlide=!0,this.instance=t.pswp}onLoaded(){this.state=bt,this.slide&&this.element&&(this.instance.dispatch("loadComplete",{slide:this.slide,content:this}),this.slide.isActive&&this.slide.heavyAppended&&!this.element.parentNode&&(this.append(),this.slide.updateContentSize(!0)),this.state!==bt&&this.state!==vt||this.removePlaceholder())}onError(){this.state=vt,this.slide&&(this.displayError(),this.instance.dispatch("loadComplete",{slide:this.slide,isError:!0,content:this}),this.instance.dispatch("loadError",{slide:this.slide,content:this}))}isLoading(){return this.instance.applyFilters("isContentLoading",this.state===wt,this)}isError(){return this.state===vt}isImageContent(){return"image"===this.type||"ad"===this.type}setDisplayedSize(t,e){if(this.element&&(this.placeholder&&this.placeholder.setDisplayedSize(t,e),!this.instance.dispatch("contentResize",{content:this,width:t,height:e}).defaultPrevented&&(ut(this.element,t,e),this.isImageContent()&&!this.isError()))){const i=!this.displayedImageWidth&&t;this.displayedImageWidth=t,this.displayedImageHeight=e,i?this.loadImage(!1):this.updateSrcsetSizes(),this.slide&&this.instance.dispatch("imageSizeChange",{slide:this.slide,width:t,height:e,content:this})}}isZoomable(){return this.instance.applyFilters("isContentZoomable",this.isImageContent()&&this.state!==vt,this)}updateSrcsetSizes(){if(!this.isImageContent()||!this.element||!this.data.srcset)return;const t=this.element,e=this.instance.applyFilters("srcsetSizesWidth",this.displayedImageWidth,this);(!t.dataset.largestUsedSize||e>parseInt(t.dataset.largestUsedSize,10))&&(t.sizes=e+"px",t.dataset.largestUsedSize=String(e))}usePlaceholder(){return this.instance.applyFilters("useContentPlaceholder",this.isImageContent(),this)}lazyLoad(){this.instance.dispatch("contentLazyLoad",{content:this}).defaultPrevented||this.load(!0)}keepPlaceholder(){return this.instance.applyFilters("isKeepingPlaceholder",this.isLoading(),this)}destroy(){this.hasSlide=!1,this.slide=void 0,this.instance.dispatch("contentDestroy",{content:this}).defaultPrevented||(this.remove(),this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0),this.isImageContent()&&this.element&&(this.element.onload=null,this.element.onerror=null,this.element=void 0))}displayError(){if(this.slide){let t=ot("pswp__error-msg","div");t.innerText=this.instance.options?.errorMsg??"",t=this.instance.applyFilters("contentErrorElement",t,this),this.element=ot("pswp__content pswp__error-msg-container","div"),this.element.appendChild(t),this.slide.container.innerText="",this.slide.container.appendChild(this.element),this.slide.updateContentSize(!0),this.removePlaceholder()}}append(){if(this.isAttached||!this.element)return;if(this.isAttached=!0,this.state===vt)return void this.displayError();if(this.instance.dispatch("contentAppend",{content:this}).defaultPrevented)return;const t="decode"in this.element;this.isImageContent()?t&&this.slide&&(!this.slide.isActive||xt())?(this.isDecoding=!0,this.element.decode().catch((()=>{})).finally((()=>{this.isDecoding=!1,this.appendImage()}))):this.appendImage():this.slide&&!this.element.parentNode&&this.slide.container.appendChild(this.element)}activate(){!this.instance.dispatch("contentActivate",{content:this}).defaultPrevented&&this.slide&&(this.isImageContent()&&this.isDecoding&&!xt()?this.appendImage():this.isError()&&this.load(!1,!0),this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","false"))}deactivate(){this.instance.dispatch("contentDeactivate",{content:this}),this.slide&&this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","true")}remove(){this.isAttached=!1,this.instance.dispatch("contentRemove",{content:this}).defaultPrevented||(this.element&&this.element.parentNode&&this.element.remove(),this.placeholder&&this.placeholder.element&&this.placeholder.element.remove())}appendImage(){this.isAttached&&(this.instance.dispatch("contentAppendImage",{content:this}).defaultPrevented||(this.slide&&this.element&&!this.element.parentNode&&this.slide.container.appendChild(this.element),this.state!==bt&&this.state!==vt||this.removePlaceholder()))}}function Et(t,e){if(t.getViewportSizeFn){const i=t.getViewportSizeFn(t,e);if(i)return i}return{x:document.documentElement.clientWidth,y:window.innerHeight}}function St(t,e,i,n,o){let s=0;if(e.paddingFn)s=e.paddingFn(i,n,o)[t];else if(e.padding)s=e.padding[t];else{const i="padding"+t[0].toUpperCase()+t.slice(1);e[i]&&(s=e[i])}return Number(s)||0}function It(t,e,i,n){return{x:e.x-St("left",t,e,i,n)-St("right",t,e,i,n),y:e.y-St("top",t,e,i,n)-St("bottom",t,e,i,n)}}class zt{constructor(t,e,i,n){this.pswp=n,this.options=t,this.itemData=e,this.index=i,this.panAreaSize=null,this.elementSize=null,this.fit=1,this.fill=1,this.vFill=1,this.initial=1,this.secondary=1,this.max=1,this.min=1}update(t,e,i){const n={x:t,y:e};this.elementSize=n,this.panAreaSize=i;const o=i.x/n.x,s=i.y/n.y;this.fit=Math.min(1,o<s?o:s),this.fill=Math.min(1,o>s?o:s),this.vFill=Math.min(1,s),this.initial=this._getInitial(),this.secondary=this._getSecondary(),this.max=Math.max(this.initial,this.secondary,this._getMax()),this.min=Math.min(this.fit,this.initial,this.secondary),this.pswp&&this.pswp.dispatch("zoomLevelsUpdate",{zoomLevels:this,slideData:this.itemData})}_parseZoomLevelOption(t){const e=t+"ZoomLevel",i=this.options[e];if(i)return"function"==typeof i?i(this):"fill"===i?this.fill:"fit"===i?this.fit:Number(i)}_getSecondary(){let t=this._parseZoomLevelOption("secondary");return t||(t=Math.min(1,3*this.fit),this.elementSize&&t*this.elementSize.x>4e3&&(t=4e3/this.elementSize.x),t)}_getInitial(){return this._parseZoomLevelOption("initial")||this.fit}_getMax(){return this._parseZoomLevelOption("max")||Math.max(1,4*this.fit)}}function Pt(t,e,i){const n=e.createContentFromData(t,i);let o;const{options:s}=e;if(s){let r;o=new zt(s,t,-1),r=e.pswp?e.pswp.viewportSize:Et(s,e);const a=It(s,r,t,i);o.update(n.width,n.height,a)}return n.lazyLoad(),o&&n.setDisplayedSize(Math.ceil(n.width*o.initial),Math.ceil(n.height*o.initial)),n}function Ct(t,e){const i=e.getItemData(t);if(!e.dispatch("lazyLoadSlide",{index:t,itemData:i}).defaultPrevented)return Pt(i,e,t)}class Mt{constructor(t){this.pswp=t,this.limit=Math.max(t.options.preload[0]+t.options.preload[1]+1,5),this._cachedItems=[]}updateLazy(t){const{pswp:e}=this;if(e.dispatch("lazyLoad").defaultPrevented)return;const{preload:i}=e.options,n=void 0===t||t>=0;let o;for(o=0;o<=i[1];o++)this.loadSlideByIndex(e.currIndex+(n?o:-o));for(o=1;o<=i[0];o++)this.loadSlideByIndex(e.currIndex+(n?-o:o))}loadSlideByIndex(t){const e=this.pswp.getLoopedIndex(t);let i=this.getContentByIndex(e);i||(i=Ct(e,this.pswp),i&&this.addToCache(i))}getContentBySlide(t){let e=this.getContentByIndex(t.index);return e||(e=this.pswp.createContentFromData(t.data,t.index),this.addToCache(e)),e.setSlide(t),e}addToCache(t){if(this.removeByIndex(t.index),this._cachedItems.push(t),this._cachedItems.length>this.limit){const t=this._cachedItems.findIndex((t=>!t.isAttached&&!t.hasSlide));if(-1!==t){this._cachedItems.splice(t,1)[0].destroy()}}}removeByIndex(t){const e=this._cachedItems.findIndex((e=>e.index===t));-1!==e&&this._cachedItems.splice(e,1)}getContentByIndex(t){return this._cachedItems.find((e=>e.index===t))}destroy(){this._cachedItems.forEach((t=>t.destroy())),this._cachedItems=[]}}class Lt{constructor(t,e){this.type=t,this.defaultPrevented=!1,e&&Object.assign(this,e)}preventDefault(){this.defaultPrevented=!0}}class Dt{constructor(){this._listeners={},this._filters={},this.pswp=void 0,this.options=void 0}addFilter(t,e,i=100){this._filters[t]||(this._filters[t]=[]),this._filters[t]?.push({fn:e,priority:i}),this._filters[t]?.sort(((t,e)=>t.priority-e.priority)),this.pswp?.addFilter(t,e,i)}removeFilter(t,e){this._filters[t]&&(this._filters[t]=this._filters[t].filter((t=>t.fn!==e))),this.pswp&&this.pswp.removeFilter(t,e)}applyFilters(t,...e){return this._filters[t]?.forEach((t=>{e[0]=t.fn.apply(this,e)})),e[0]}on(t,e){this._listeners[t]||(this._listeners[t]=[]),this._listeners[t]?.push(e),this.pswp?.on(t,e)}off(t,e){this._listeners[t]&&(this._listeners[t]=this._listeners[t].filter((t=>e!==t))),this.pswp?.off(t,e)}dispatch(t,e){if(this.pswp)return this.pswp.dispatch(t,e);const i=new Lt(t,e);return this._listeners[t]?.forEach((t=>{t.call(this,i)})),i}}class Nt extends Dt{getNumItems(){let t=0;const e=this.options?.dataSource;e&&"length"in e?t=e.length:e&&"gallery"in e&&(e.items||(e.items=this._getGalleryDOMElements(e.gallery)),e.items&&(t=e.items.length));const i=this.dispatch("numItems",{dataSource:e,numItems:t});return this.applyFilters("numItems",i.numItems,e)}createContentFromData(t,e){return new kt(t,this,e)}getItemData(t){const e=this.options?.dataSource;let i={};Array.isArray(e)?i=e[t]:e&&"gallery"in e&&(e.items||(e.items=this._getGalleryDOMElements(e.gallery)),i=e.items[t]);let n=i;n instanceof Element&&(n=this._domElementToItemData(n));const o=this.dispatch("itemData",{itemData:n||{},index:t});return this.applyFilters("itemData",o.itemData,t)}_getGalleryDOMElements(t){return this.options?.children||this.options?.childSelector?_t(this.options.children,this.options.childSelector,t)||[]:[t]}_toLowerCaseFirstLetter(t){return t?t.charAt(0).toLowerCase()+t.slice(1):t}_domElementToItemData(t){const e={element:t},i="A"===t.tagName?t:t.querySelector("a");if(i){e.src=i.dataset.pswpSrc||i.href,i.dataset.pswpSrcset&&(e.srcset=i.dataset.pswpSrcset),e.width=i.dataset.pswpWidth?parseInt(i.dataset.pswpWidth,10):0,e.height=i.dataset.pswpHeight?parseInt(i.dataset.pswpHeight,10):0,i.dataset.pswpType&&(e.type=i.dataset.pswpType.toLowerCase());const n=t.querySelector("img");n&&(e.msrc=n.currentSrc||n.src,e.alt=n.getAttribute("alt")??""),(i.dataset.pswpCropped||i.dataset.cropped)&&(e.thumbCropped=!0);const o=["element","src","srcset","width","height","type","msrc","alt","thumbCropped"];Object.keys(i.dataset).filter((t=>t.startsWith("pswp")&&!o.includes(this._toLowerCaseFirstLetter(t.slice(4))))).forEach((t=>{e[this._toLowerCaseFirstLetter(t.slice(4))]=i.dataset[t]}))}return this.applyFilters("domItemData",e,t,i)}lazyLoadData(t,e){return Pt(t,this,e)}}class Ot extends Nt{constructor(t){super(),this.options=t||{},this._uid=0,this.shouldOpen=!1,this._preloadedContent=void 0,this.onThumbnailsClick=this.onThumbnailsClick.bind(this)}init(){_t(this.options.gallery,this.options.gallerySelector).forEach((t=>{t.addEventListener("click",this.onThumbnailsClick,!1)}))}onThumbnailsClick(t){if(yt(t)||window.pswp)return;let e={x:t.clientX,y:t.clientY};e.x||e.y||(e=null);let i=this.getClickedIndex(t);i=this.applyFilters("clickedIndex",i,t,this);const n={gallery:t.currentTarget};i>=0&&(t.preventDefault(),this.loadAndOpen(i,n,e))}getClickedIndex(t){if(this.options.getClickedIndexFn)return this.options.getClickedIndexFn.call(this,t);const e=t.target,i=_t(this.options.children,this.options.childSelector,t.currentTarget).findIndex((t=>t===e||t.contains(e)));return-1!==i?i:this.options.children||this.options.childSelector?-1:0}loadAndOpen(t,e,i){if(window.pswp||!this.options)return!1;if(!e&&this.options.gallery&&this.options.children){const t=_t(this.options.gallery);t[0]&&(e={gallery:t[0]})}return this.options.index=t,this.options.initialPointerPos=i,this.shouldOpen=!0,this.preload(t,e),!0}preload(t,e){const{options:i}=this;e&&(i.dataSource=e);const n=[],o=typeof i.pswpModule;if("function"==typeof(s=i.pswpModule)&&s.prototype&&s.prototype.goTo)n.push(Promise.resolve(i.pswpModule));else{if("string"===o)throw new Error("pswpModule as string is no longer supported");if("function"!==o)throw new Error("pswpModule is not valid");n.push(i.pswpModule())}var s;"function"==typeof i.openPromise&&n.push(i.openPromise()),!1!==i.preloadFirstSlide&&t>=0&&(this._preloadedContent=Ct(t,this));const r=++this._uid;Promise.all(n).then((t=>{if(this.shouldOpen){const e=t[0];this._openPhotoswipe(e,r)}}))}_openPhotoswipe(t,e){if(e!==this._uid&&this.shouldOpen)return;if(this.shouldOpen=!1,window.pswp)return;const i="object"==typeof t?new t.default(this.options):new t(this.options);this.pswp=i,window.pswp=i,Object.keys(this._listeners).forEach((t=>{this._listeners[t]?.forEach((e=>{i.on(t,e)}))})),Object.keys(this._filters).forEach((t=>{this._filters[t]?.forEach((e=>{i.addFilter(t,e.fn,e.priority)}))})),this._preloadedContent&&(i.contentLoader.addToCache(this._preloadedContent),this._preloadedContent=void 0),i.on("destroy",(()=>{this.pswp=void 0,delete window.pswp})),i.init()}destroy(){this.pswp?.destroy(),this.shouldOpen=!1,this._listeners={},_t(this.options.gallery,this.options.gallerySelector).forEach((t=>{t.removeEventListener("click",this.onThumbnailsClick,!1)}))}}b("/*! PhotoSwipe main CSS by Dmytro Semenov | photoswipe.com */.pswp{--pswp-bg:#000;--pswp-placeholder-bg:#222;--pswp-root-z-index:100000;--pswp-preloader-color:rgba(79,79,79,.4);--pswp-preloader-color-secondary:hsla(0,0%,100%,.9);--pswp-icon-color:#fff;--pswp-icon-color-secondary:#4f4f4f;--pswp-icon-stroke-color:#4f4f4f;--pswp-icon-stroke-width:2px;--pswp-error-text-color:var(--pswp-icon-color);-webkit-tap-highlight-color:rgba(0,0,0,0);contain:layout style size;display:none;height:100%;left:0;opacity:.003;position:fixed;top:0;touch-action:none;width:100%;z-index:var(--pswp-root-z-index)}.pswp,.pswp:focus{outline:0}.pswp *{box-sizing:border-box}.pswp img{max-width:none}.pswp--open{display:block}.pswp,.pswp__bg{transform:translateZ(0);will-change:opacity}.pswp__bg{background:var(--pswp-bg);opacity:.005;z-index:-2}.pswp,.pswp__scroll-wrap{overflow:hidden}.pswp__bg,.pswp__container,.pswp__content,.pswp__img,.pswp__item,.pswp__scroll-wrap,.pswp__zoom-wrap{height:100%;left:0;position:absolute;top:0;width:100%}.pswp__img,.pswp__zoom-wrap{height:auto;width:auto}.pswp--click-to-zoom.pswp--zoom-allowed .pswp__img{cursor:-webkit-zoom-in;cursor:-moz-zoom-in;cursor:zoom-in}.pswp--click-to-zoom.pswp--zoomed-in .pswp__img{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.pswp--click-to-zoom.pswp--zoomed-in .pswp__img:active{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.pswp--no-mouse-drag.pswp--zoomed-in .pswp__img,.pswp--no-mouse-drag.pswp--zoomed-in .pswp__img:active,.pswp__img{cursor:-webkit-zoom-out;cursor:-moz-zoom-out;cursor:zoom-out}.pswp__button,.pswp__container,.pswp__counter,.pswp__img{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.pswp__item{overflow:hidden;z-index:1}.pswp__hidden{display:none!important}.pswp__content{pointer-events:none}.pswp__content>*{pointer-events:auto}.pswp__error-msg-container{display:grid}.pswp__error-msg{color:var(--pswp-error-text-color);font-size:1em;line-height:1;margin:auto}.pswp .pswp__hide-on-close{opacity:.005;pointer-events:none;transition:opacity var(--pswp-transition-duration) cubic-bezier(.4,0,.22,1);will-change:opacity;z-index:10}.pswp--ui-visible .pswp__hide-on-close{opacity:1;pointer-events:auto}.pswp__button{-webkit-touch-callout:none;-webkit-appearance:none;background:none;border:0;box-shadow:none;cursor:pointer;display:block;height:60px;margin:0;opacity:.85;overflow:hidden;padding:0;position:relative;width:50px}.pswp__button:active,.pswp__button:focus,.pswp__button:hover{background:none;border:0;box-shadow:none;opacity:1;padding:0;transition:none}.pswp__button:disabled{cursor:auto;opacity:.3}.pswp__icn{fill:var(--pswp-icon-color);color:var(--pswp-icon-color-secondary);height:32px;left:9px;overflow:hidden;pointer-events:none;position:absolute;top:14px;width:32px}.pswp__icn-shadow{stroke:var(--pswp-icon-stroke-color);stroke-width:var(--pswp-icon-stroke-width);fill:none}.pswp__icn:focus{outline:0}.pswp__img--with-bg,div.pswp__img--placeholder{background:var(--pswp-placeholder-bg)}.pswp__top-bar{display:flex;flex-direction:row;height:60px;justify-content:flex-end;left:0;pointer-events:none!important;position:absolute;top:0;width:100%;z-index:10}.pswp__top-bar>*{pointer-events:auto;will-change:opacity}.pswp__button--close{margin-right:6px}.pswp__button--arrow{height:100px;margin-top:-50px;position:absolute;top:0;top:50%;width:75px}.pswp__button--arrow:disabled{cursor:default;display:none}.pswp__button--arrow .pswp__icn{background:none;border-radius:0;height:60px;margin-top:-30px;top:50%;width:60px}.pswp--one-slide .pswp__button--arrow{display:none}.pswp--touch .pswp__button--arrow{visibility:hidden}.pswp--has_mouse .pswp__button--arrow{visibility:visible}.pswp__button--arrow--prev{left:0;right:auto}.pswp__button--arrow--next{right:0}.pswp__button--arrow--next .pswp__icn{left:auto;right:14px;transform:scaleX(-1)}.pswp__button--zoom{display:none}.pswp--zoom-allowed .pswp__button--zoom{display:block}.pswp--zoomed-in .pswp__zoom-icn-bar-v{display:none}.pswp__preloader{height:60px;margin-right:auto;overflow:hidden;position:relative;width:50px}.pswp__preloader .pswp__icn{animation:pswp-clockwise .6s linear infinite;opacity:0;transition:opacity .2s linear}.pswp__preloader--active .pswp__icn{opacity:.85}@keyframes pswp-clockwise{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.pswp__counter{color:var(--pswp-icon-color);font-size:14px;height:30px;line-height:30px;margin-top:15px;margin-inline-start:20px;opacity:.85;text-shadow:1px 1px 3px var(--pswp-icon-color-secondary)}.pswp--one-slide .pswp__counter{display:none}");const qt='url("https://res.cloudinary.com/dectzk2b2/image/upload/v1736933014/black_rpie3v.png")';class At{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)}))}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=qt,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=qt,this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.pause(),this.backdropOn=!1):(this.updateBlurBackground(t),this.backdropOn=!0),document.querySelector("#pswp__icn-hide-backdrop").style.display=this.backdropOn?"none":"inline",document.querySelector("#pswp__icn-show-backdrop").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 this.backgroundElement&&(this.backgroundElement.style.backgroundImage=`url('${e.data.thumbnailUrl}')`,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}))}}class Ft{constructor(t){this.lightbox=t,t.on("init",(()=>{this.initPswpEvents(t.pswp)}))}initPswpEvents(t){t.on("uiRegister",(()=>{t.ui.registerElement({name:"download-button",order:8,isButton:!0,tagName:"a",html:{isCustomSVG:!0,inner:'<path d="M20.5 14.3 17.1 18V10h-2.2v7.9l-3.4-3.6L10 16l6 6.1 6-6.1ZM23 23H9v2h14Z" id="pswp__icn-download"/>',outlineID:"pswp__icn-download"},onInit:(t,e)=>{t.setAttribute("download",""),t.setAttribute("target","_blank"),t.setAttribute("rel","noopener"),e.on("change",(()=>{t.href=e.currSlide.data.src}))}})}))}}function Vt(){return Vt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},Vt.apply(null,arguments)}var jt=Object.defineProperty,Rt=(t,e,i)=>((t,e,i)=>e in t?jt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),Bt=new Map,$t=new WeakMap,Ut=0;function Wt(t){return Object.keys(t).sort().filter((e=>void 0!==t[e])).map((e=>{return`${e}_${"root"===e?(i=t.root,i?($t.has(i)||(Ut+=1,$t.set(i,Ut.toString())),$t.get(i)):"0"):t[e]}`;var i})).toString()}function Yt(t,e,i={},n=undefined){if(void 0===window.IntersectionObserver&&void 0!==n){const o=t.getBoundingClientRect();return e(n,{isIntersecting:n,target:t,intersectionRatio:"number"==typeof i.threshold?i.threshold:0,time:0,boundingClientRect:o,intersectionRect:o,rootBounds:o}),()=>{}}const{id:o,observer:s,elements:r}=function(t){const e=Wt(t);let i=Bt.get(e);if(!i){const n=new Map;let o;const s=new IntersectionObserver((e=>{e.forEach((e=>{var i;const s=e.isIntersecting&&o.some((t=>e.intersectionRatio>=t));t.trackVisibility&&void 0===e.isVisible&&(e.isVisible=s),null==(i=n.get(e.target))||i.forEach((t=>{t(s,e)}))}))}),t);o=s.thresholds||(Array.isArray(t.threshold)?t.threshold:[t.threshold||0]),i={id:e,observer:s,elements:n},Bt.set(e,i)}return i}(i),a=r.get(t)||[];return r.has(t)||r.set(t,a),a.push(e),s.observe(t),function(){a.splice(a.indexOf(e),1),0===a.length&&(r.delete(t),s.unobserve(t)),0===r.size&&(s.disconnect(),Bt.delete(o))}}var Ht=class extends t.Component{constructor(t){super(t),Rt(this,"node",null),Rt(this,"_unobserveCb",null),Rt(this,"handleNode",(t=>{this.node&&(this.unobserve(),t||this.props.triggerOnce||this.props.skip||this.setState({inView:!!this.props.initialInView,entry:void 0})),this.node=t||null,this.observeNode()})),Rt(this,"handleChange",((t,e)=>{t&&this.props.triggerOnce&&this.unobserve(),function(t){return"function"!=typeof t.children}(this.props)||this.setState({inView:t,entry:e}),this.props.onChange&&this.props.onChange(t,e)})),this.state={inView:!!t.initialInView,entry:void 0}}componentDidMount(){this.unobserve(),this.observeNode()}componentDidUpdate(t){t.rootMargin===this.props.rootMargin&&t.root===this.props.root&&t.threshold===this.props.threshold&&t.skip===this.props.skip&&t.trackVisibility===this.props.trackVisibility&&t.delay===this.props.delay||(this.unobserve(),this.observeNode())}componentWillUnmount(){this.unobserve()}observeNode(){if(!this.node||this.props.skip)return;const{threshold:t,root:e,rootMargin:i,trackVisibility:n,delay:o,fallbackInView:s}=this.props;this._unobserveCb=Yt(this.node,this.handleChange,{threshold:t,root:e,rootMargin:i,trackVisibility:n,delay:o},s)}unobserve(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)}render(){const{children:e}=this.props;if("function"==typeof e){const{inView:t,entry:i}=this.state;return e({inView:t,entry:i,ref:this.handleNode})}const{as:i,triggerOnce:n,threshold:o,root:s,rootMargin:r,onChange:a,skip:l,trackVisibility:c,delay:h,initialInView:p,fallbackInView:d,...u}=this.props;return t.createElement(i||"div",{ref:this.handleNode,...u},e)}};const Zt=({src:t,alt:i,delayTime:o=0,threshold:s=.5,wrapperClassName:r="size-full",placeholderSrc:a="",sizeMode:c="cover",position:h="center",onClick:p})=>{const[d,u]=l(!1),[m,g]=l(!1),f=n(null),w=n(null);return e.createElement(Ht,{as:"div",className:k(r,"overflow-hidden"),threshold:s,onChange:t=>{t?w.current||(o<=0?u(!0):w.current=setTimeout((()=>u(!0)),o)):w.current&&(clearTimeout(w.current),w.current=null)}},e.createElement("div",{className:k("size-full",m?"blur-none":"blur-sm"),style:{background:`url(${a})`,backgroundSize:c,backgroundPosition:h,backgroundRepeat:"no-repeat"}},e.createElement("img",{alt:i,ref:f,src:d?t:void 0,onLoad:()=>g(!0),className:k("size-full object-center transition-opacity duration-300",m?"opacity-100":"opacity-0","contain"===c?"object-contain":"object-cover","top"===h?"object-top":"bottom"===h?"object-bottom":"object-center"),onClick:p})))},Gt=({url:t,alt:i="",thumbnailUrl:n,blurImageUrl:o,pswpData:s={},curateLink:r})=>{const a=e.createElement(c,null,e.createElement(Zt,{threshold:.1,src:n||t,placeholderSrc:o,alt:i}),s.type===E.VIDEO&&e.createElement("div",{className:"dark:bg-opacity-50 absolute top-0 left-0 flex size-full items-center justify-center opacity-75"},e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-16 text-white lg:size-24",viewBox:"0 0 24 24"},e.createElement("path",{fill:"currentColor",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"}))));return e.createElement("a",Vt({href:t,className:"pswp-item size-full"},Object.keys(s).reduce(((t,e)=>{var i;return t[`data-pswp-${i=e,i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}`]=s[e],t}),{}),{target:"_blank",rel:"noreferrer"}),a)},Kt=({content:t,style:i})=>e.createElement("div",{style:i,className:"group relative mb-1"},e.createElement(Gt,{url:t.src,thumbnailUrl:t.src,blurImageUrl:t.blurImageUrl,alt:t.caption,pswpData:{id:t._id,type:E.AD,hash:t._id,width:t.width,height:t.height,title:t.title,description:t.description,targetType:t.targetType,targetText:t.targetText,targetUrl:t.targetUrl,thumbnailUrl:t.imageUrl,blurImageUrl:t.blurImageUrl}})),Qt=({organizationId:t,event:i,content:n,style:o,timestampField:s,curateLink:r})=>e.createElement("div",{id:`content-${n._id}`,style:o,className:"group relative mb-1 overflow-hidden rounded"},e.createElement(Gt,{url:n.src,alt:n.caption,thumbnailUrl:n.thumbnailUrl,blurImageUrl:n.blurImageUrl,curateLink:r,pswpData:{id:n._id,type:E.IMAGE,hash:n._id,width:n.width,height:n.height,thumbnailUrl:n.thumbnailUrl,blurImageUrl:n.blurImageUrl,caption:n.caption}})),Xt=({organizationId:t,event:i,content:n,style:o,timestampField:s,curateLink:r})=>e.createElement("div",{id:`content-${n._id}`,className:"group relative mb-1 overflow-hidden rounded",style:o},e.createElement(Gt,{url:n.src,thumbnailUrl:n.thumbnailUrl,blurImageUrl:n.blurImageUrl,alt:n.caption,curateLink:r,pswpData:{id:n._id,type:E.VIDEO,hash:n._id,width:n.width,height:n.height,thumbnailUrl:n.thumbnailUrl,blurImageUrl:n.blurImageUrl,caption:n.caption}})),Jt=({event:t,contents:i,singleColumnMode:o,organizationId:s,timestampField:r,onQueryImageChange:l,curateLink:c})=>{const p=n(null),d=a((()=>`gallery-${t._id}`),[t]);h((()=>{if(!c){const t=new Ot({gallery:`#${d}`,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,pswpModule:()=>import("./photoswipe-NmVzFLCS.js")});p.current=t,new At(t),new Ft(t),t.init()}return()=>{p.current?.destroy(),p.current=null}}),[t.galleryLayout,c]);const u=a((()=>{switch(t.galleryLayout){default:case S.ROW:return K;case S.COLUMN:return et;case S.MASONRY:return nt}}),[t.galleryLayout]);return e.createElement(u,{spacing:o?8:4,targetRowHeight:369,columns:t=>o?1:t<400?2:t<800?3:4,photos:i.map((t=>({src:t.type===E.IMAGE||t.type===E.VIDEO?t.url:t.imageUrl,width:t.dimension?.width,height:t.dimension?.height,...t}))),render:{container:({ref:t,className:i,children:n})=>e.createElement("div",{ref:t,id:d,className:k(i,o?"w-full lg:w-1/3":"w-full")},n),photo:(i,{photo:n,width:o,height:a,index:l})=>{let h;switch(n.type){case E.IMAGE:h=Qt;break;case E.VIDEO:h=Xt;break;case E.AD:h=Kt}return h&&e.createElement(h,{key:`${n._id}-${l}`,style:{width:o,height:a},organizationId:s,event:t,content:n,timestampField:r,curateLink:c})}}})};
|
|
2
|
+
/*! *****************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
5
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
6
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
|
|
8
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
9
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
10
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
11
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
12
|
+
|
|
13
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
14
|
+
and limitations under the License.
|
|
15
|
+
***************************************************************************** */
|
|
16
|
+
var te=function(t,e){return te=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},te(t,e)};var ee=function(){return ee=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ee.apply(this,arguments)};var ie="Pixel",ne="Percent",oe={unit:ne,value:.8};function se(t){return"number"==typeof t?{unit:ne,value:100*t}:"string"==typeof t?t.match(/^(\d*(\.\d+)?)px$/)?{unit:ie,value:parseFloat(t)}:t.match(/^(\d*(\.\d+)?)%$/)?{unit:ne,value:parseFloat(t)}:(console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...'),oe):(console.warn("scrollThreshold should be string or number"),oe)}var re=function(t){function i(e){var i=t.call(this,e)||this;return i.lastScrollTop=0,i.actionTriggered=!1,i.startY=0,i.currentY=0,i.dragging=!1,i.maxPullDownDistance=0,i.getScrollableTarget=function(){return i.props.scrollableTarget instanceof HTMLElement?i.props.scrollableTarget:"string"==typeof i.props.scrollableTarget?document.getElementById(i.props.scrollableTarget):(null===i.props.scrollableTarget&&console.warn("You are trying to pass scrollableTarget but it is null. This might\n happen because the element may not have been added to DOM yet.\n See https://github.com/ankeetmaini/react-infinite-scroll-component/issues/59 for more info.\n "),null)},i.onStart=function(t){i.lastScrollTop||(i.dragging=!0,t instanceof MouseEvent?i.startY=t.pageY:t instanceof TouchEvent&&(i.startY=t.touches[0].pageY),i.currentY=i.startY,i._infScroll&&(i._infScroll.style.willChange="transform",i._infScroll.style.transition="transform 0.2s cubic-bezier(0,0,0.31,1)"))},i.onMove=function(t){i.dragging&&(t instanceof MouseEvent?i.currentY=t.pageY:t instanceof TouchEvent&&(i.currentY=t.touches[0].pageY),i.currentY<i.startY||(i.currentY-i.startY>=Number(i.props.pullDownToRefreshThreshold)&&i.setState({pullToRefreshThresholdBreached:!0}),i.currentY-i.startY>1.5*i.maxPullDownDistance||i._infScroll&&(i._infScroll.style.overflow="visible",i._infScroll.style.transform="translate3d(0px, "+(i.currentY-i.startY)+"px, 0px)")))},i.onEnd=function(){i.startY=0,i.currentY=0,i.dragging=!1,i.state.pullToRefreshThresholdBreached&&(i.props.refreshFunction&&i.props.refreshFunction(),i.setState({pullToRefreshThresholdBreached:!1})),requestAnimationFrame((function(){i._infScroll&&(i._infScroll.style.overflow="auto",i._infScroll.style.transform="none",i._infScroll.style.willChange="unset")}))},i.onScrollListener=function(t){"function"==typeof i.props.onScroll&&setTimeout((function(){return i.props.onScroll&&i.props.onScroll(t)}),0);var e=i.props.height||i._scrollableNode?t.target:document.documentElement.scrollTop?document.documentElement:document.body;i.actionTriggered||((i.props.inverse?i.isElementAtTop(e,i.props.scrollThreshold):i.isElementAtBottom(e,i.props.scrollThreshold))&&i.props.hasMore&&(i.actionTriggered=!0,i.setState({showLoader:!0}),i.props.next&&i.props.next()),i.lastScrollTop=e.scrollTop)},i.state={showLoader:!1,pullToRefreshThresholdBreached:!1,prevDataLength:e.dataLength},i.throttledOnScrollListener=function(t,e,i,n){var o,s=!1,r=0;function a(){o&&clearTimeout(o)}function l(){var l=this,c=Date.now()-r,h=arguments;function p(){r=Date.now(),i.apply(l,h)}s||(n&&!o&&p(),a(),void 0===n&&c>t?p():!0!==e&&(o=setTimeout(n?function(){o=void 0}:p,void 0===n?t-c:t)))}return"boolean"!=typeof e&&(n=i,i=e,e=void 0),l.cancel=function(){a(),s=!0},l}(150,i.onScrollListener).bind(i),i.onStart=i.onStart.bind(i),i.onMove=i.onMove.bind(i),i.onEnd=i.onEnd.bind(i),i}return function(t,e){function i(){this.constructor=t}te(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(i,t),i.prototype.componentDidMount=function(){if(void 0===this.props.dataLength)throw new Error('mandatory prop "dataLength" is missing. The prop is needed when loading more content. Check README.md for usage');if(this._scrollableNode=this.getScrollableTarget(),this.el=this.props.height?this._infScroll:this._scrollableNode||window,this.el&&this.el.addEventListener("scroll",this.throttledOnScrollListener),"number"==typeof this.props.initialScrollY&&this.el&&this.el instanceof HTMLElement&&this.el.scrollHeight>this.props.initialScrollY&&this.el.scrollTo(0,this.props.initialScrollY),this.props.pullDownToRefresh&&this.el&&(this.el.addEventListener("touchstart",this.onStart),this.el.addEventListener("touchmove",this.onMove),this.el.addEventListener("touchend",this.onEnd),this.el.addEventListener("mousedown",this.onStart),this.el.addEventListener("mousemove",this.onMove),this.el.addEventListener("mouseup",this.onEnd),this.maxPullDownDistance=this._pullDown&&this._pullDown.firstChild&&this._pullDown.firstChild.getBoundingClientRect().height||0,this.forceUpdate(),"function"!=typeof this.props.refreshFunction))throw new Error('Mandatory prop "refreshFunction" missing.\n Pull Down To Refresh functionality will not work\n as expected. Check README.md for usage\'')},i.prototype.componentWillUnmount=function(){this.el&&(this.el.removeEventListener("scroll",this.throttledOnScrollListener),this.props.pullDownToRefresh&&(this.el.removeEventListener("touchstart",this.onStart),this.el.removeEventListener("touchmove",this.onMove),this.el.removeEventListener("touchend",this.onEnd),this.el.removeEventListener("mousedown",this.onStart),this.el.removeEventListener("mousemove",this.onMove),this.el.removeEventListener("mouseup",this.onEnd)))},i.prototype.componentDidUpdate=function(t){this.props.dataLength!==t.dataLength&&(this.actionTriggered=!1,this.setState({showLoader:!1}))},i.getDerivedStateFromProps=function(t,e){return t.dataLength!==e.prevDataLength?ee(ee({},e),{prevDataLength:t.dataLength}):null},i.prototype.isElementAtTop=function(t,e){void 0===e&&(e=.8);var i=t===document.body||t===document.documentElement?window.screen.availHeight:t.clientHeight,n=se(e);return n.unit===ie?t.scrollTop<=n.value+i-t.scrollHeight+1:t.scrollTop<=n.value/100+i-t.scrollHeight+1},i.prototype.isElementAtBottom=function(t,e){void 0===e&&(e=.8);var i=t===document.body||t===document.documentElement?window.screen.availHeight:t.clientHeight,n=se(e);return n.unit===ie?t.scrollTop+i>=t.scrollHeight-n.value:t.scrollTop+i>=n.value/100*t.scrollHeight},i.prototype.render=function(){var t=this,i=ee({height:this.props.height||"auto",overflow:"auto",WebkitOverflowScrolling:"touch"},this.props.style),n=this.props.hasChildren||!!(this.props.children&&this.props.children instanceof Array&&this.props.children.length),o=this.props.pullDownToRefresh&&this.props.height?{overflow:"auto"}:{};return e.createElement("div",{style:o,className:"infinite-scroll-component__outerdiv"},e.createElement("div",{className:"infinite-scroll-component "+(this.props.className||""),ref:function(e){return t._infScroll=e},style:i},this.props.pullDownToRefresh&&e.createElement("div",{style:{position:"relative"},ref:function(e){return t._pullDown=e}},e.createElement("div",{style:{position:"absolute",left:0,right:0,top:-1*this.maxPullDownDistance}},this.state.pullToRefreshThresholdBreached?this.props.releaseToRefreshContent:this.props.pullDownToRefreshContent)),this.props.children,!this.state.showLoader&&!n&&this.props.hasMore&&this.props.loader,this.state.showLoader&&this.props.hasMore&&this.props.loader,!this.props.hasMore&&this.props.endMessage))},i}(p);var ae=Object.freeze({__proto__:null,default:()=>{const{organizationId:t}=v(),[i,n]=y("/event/:eventSlug"),o=n?.eventSlug,{isLoading:s,data:r,isError:l,error:c}=_({queryKey:[`contents-page-data-${t}-${o}`],queryFn:async()=>{try{const e=await T.get(`${process.env.API_BASE_URL}/${t}/contents-page-data`,{searchParams:o?{eventSlug:o}:void 0,headers:{"x-org-id":t}}).json();if(e.error)throw new Error(e.error);return e.data}catch(t){throw new Error(t?.message||"Failed to fetch public events")}}}),{event:h,ads:p}=r||{},{isLoading:d,data:u,hasNextPage:m,fetchNextPage:g,isFetchingNextPage:w}=f({queryKey:[`content-list-by-event-${h?._id}`],queryFn:async({pageParam:e=1})=>{try{const i=await T.get(`http://localhost:3000/api/content/${h?._id}`,{searchParams:{page:e},headers:{"x-org-id":t}}).json();if(i.error)throw new Error(i.error);return i.data}catch(t){throw new Error(t?.message||"Failed to fetch public events")}},enabled:!!h,initialPageParam:1,getPreviousPageParam:z,getNextPageParam:P},I);const b=a((()=>u?.pages?.flatMap((t=>t))||[]),[u]),S=a((()=>((t,e,i)=>{if(i<=0)return t;let n=0;const o=[];for(let s=0;s<t?.length;s++)o.push(t[s]),e.length>0&&i>1&&(s+1)%i==0&&(o.push({...e[n],type:E.AD,adType:e[n].type}),n=(n+1)%e.length);return o})(b,p||[],h?.adPosition||0)),[b,p,h?.adPosition]);return e.createElement("div",{className:"p-4"},e.createElement("div",{className:"flex gap-4"},e.createElement(x,{href:"/",className:"text-blue-500 hover:underline"},"Back"),e.createElement("h1",{className:"text-2xl font-bold"},h?.name)),e.createElement("h2",{className:"text-lg font-medium"},h?.description),e.createElement("h3",null,p?.length),e.createElement("h3",null,b?.length),e.createElement("nav",{className:"mt-4 flex gap-4"},e.createElement(x,{href:`/event/${o}/upload`,className:"text-blue-500 hover:underline"},"Upload"),e.createElement(x,{href:`/event/${o}/rate`,className:"text-blue-500 hover:underline"},"Rate"),e.createElement(x,{href:`/event/${o}/leaders`,className:"text-blue-500 hover:underline"},"Leaders")),b?.length>0&&e.createElement(re,{dataLength:S?.length||0,next:g,hasMore:m||!1,loader:e.createElement("div",{className:"my-3 w-full"},"Loading")},e.createElement("div",{className:k("")},e.createElement(Jt,{event:h,contents:S}))))}});export{Mt as C,Nt as P,zt as Z,pt as a,ot as b,ct as c,gt as d,st as e,St as f,at as g,It as h,dt as i,mt as j,Et as k,ae as l,lt as p,rt as r,yt as s,ht as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";import{d as t,L as a}from"./index-Di4l5WHY.js";const l=()=>{const[l,r]=t("/event/:eventSlug"),n=r?.eventSlug;return e.createElement("div",{className:"p-4"},e.createElement("h1",{className:"text-2xl font-bold"},"Event: ",n?.replace("-"," ")),e.createElement("nav",{className:"mt-4 flex gap-4"},e.createElement(a,{href:`#/event/${n}/upload`,className:"text-blue-500 hover:underline"},"Upload"),e.createElement(a,{href:`#/event/${n}/rate`,className:"text-blue-500 hover:underline"},"Rate"),e.createElement(a,{href:`#/event/${n}/leaders`,className:"text-blue-500 hover:underline"},"Leaders")))};export{l as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";import{u as r,a as t,L as a,k as n}from"./index-Di4l5WHY.js";const s=()=>{console.log("PublicEvents");const{organizationId:s,userLoading:o,user:l}=r(),{isLoading:i,data:c}=t({queryKey:[`public-events-${s}`],queryFn:async()=>{const e=await n.get(`http://localhost:3000/api/connect/${s}/public-events`,{headers:{"x-org-id":s}}).json();if(e.error)throw new Error(e.error);return e.data}});return i?e.createElement("div",null,"Loading..."):e.createElement("div",{className:"p-4"},e.createElement("h1",null,"User Loading - ",JSON.stringify(o),", User - ",JSON.stringify(l)),c?.map((r=>e.createElement(a,{key:r._id,href:`#/event/${r.slug}`,className:"block"},e.createElement("div",{className:"my-4 rounded-xl border p-4 shadow-md"},e.createElement("h2",null,r.name),e.createElement("p",null,r.description))))))};export{s as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";import{d as t,L as a}from"./index-Di4l5WHY.js";const l=()=>{const[l,r]=t("/event/:eventSlug"),{eventSlug:n}=r||{eventSlug:""};return e.createElement("div",{className:"p-4"},e.createElement("h1",{className:"text-2xl font-bold"},"Event: ",n.replace("-"," ")),e.createElement("nav",{className:"mt-4 flex gap-4"},e.createElement(a,{href:`#/event/${n}/upload`,className:"text-blue-500 hover:underline"},"Upload"),e.createElement(a,{href:`#/event/${n}/rate`,className:"text-blue-500 hover:underline"},"Rate"),e.createElement(a,{href:`#/event/${n}/leaders`,className:"text-blue-500 hover:underline"},"Leaders")))};export{l as default};
|