@qratilabs/qrati-connect 2.22.1-beta.1 → 2.22.1-beta.2

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{A as t,C as e,D as n,O as i,S as s,_ as o,b as r,g as a,i as l,j as c,k as d,n as u,r as h,t as p,v as m,w as g,x as f,y as w}from"./iDVNWJcT.js";import{C as y,H as v,N as b,O as T,R as x,S as _,V as q,Z as k,at as S,dt as I,g as E,h as C,ht as N,mt as L,n as M,p as A,q as B,st as O,vt as R,x as V,z}from"./82Hs8bOb.js";import{i as P,o as D,r as $,t as H}from"./iHYhFGS-.js";import{a as F,d as U,f as j,g as W,h as G,i as K,l as Y,m as Q,n as Z,o as J,p as X,r as tt,s as et,t as nt,u as it,v as st,y as ot}from"./BIcJV2_v.js";var rt=class extends R{#t;#e=void 0;#n;#i;constructor(t,e){super(),this.#t=t,this.setOptions(e),this.bindMethods(),this.#s()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const e=this.options;this.options=this.#t.defaultMutationOptions(t),L(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),e?.mutationKey&&this.options.mutationKey&&O(e.mutationKey)!==O(this.options.mutationKey)?this.reset():"pending"===this.#n?.state.status&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#s(),this.#o(t)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#s(),this.#o()}mutate(t,e){return this.#i=e,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(t)}#s(){const t=this.#n?.state??D();this.#e={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#o(t){S.batch(()=>{if(this.#i&&this.hasListeners()){const n=this.#e.variables,i=this.#e.context,s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if("success"===t?.type){try{this.#i.onSuccess?.(t.data,n,i,s)}catch(e){Promise.reject(e)}try{this.#i.onSettled?.(t.data,null,n,i,s)}catch(e){Promise.reject(e)}}else if("error"===t?.type){try{this.#i.onError?.(t.error,n,i,s)}catch(e){Promise.reject(e)}try{this.#i.onSettled?.(void 0,t.error,n,i,s)}catch(e){Promise.reject(e)}}}this.listeners.forEach(t=>{t(this.#e)})})}};function at(t){return["react-photo-album",t].filter(Boolean).join("--")}function lt({width:t,height:e}){const n=t/e;return Number.isFinite(n)?n:1}var ct=Object.freeze([1200,600,300,0]);function dt(t,e){return"function"==typeof t?t(e):t}function ut(t,e){return void 0!==e?dt(t,e):void 0}function ht(t,e,n,i=0){if(void 0===e)return;const s=ut(t,e);return Math.round(Math.max(void 0===s?function(t,e){const n=ct.findIndex(t=>t<=e);return dt(t[Math.max(n,0)],e)}(n,e):s,i))}function pt(t,{spacing:e,padding:n,componentsProps:i,render:s}){return{spacing:ht(e,t,[20,15,10,5]),padding:ht(n,t,[0,0,0,0]),componentsProps:dt(i,t)||{},render:dt(s,t)}}function mt(t,e=0){const n=10**e;return Math.round((t+Number.EPSILON)*n)/n}function gt(t,e,n,i,s,o,r){let a,l;const c=t=>{const e=o*(s-1)+2*r*s;return`calc((${t.match(/^\s*calc\((.*)\)\s*$/)?.[1]??t} - ${e}px) / ${mt((i-e)/n,5)})`},d=t.srcSet;return d&&d.length>0&&(a=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(", ")),l=e?.size?(e.sizes||[]).map(({viewport:t,size:e})=>`${t} ${c(e)}`).concat(c(e.size)).join(", "):`${Math.ceil(n/i*100)}vw`,{srcSet:a,sizes:l}}var ft=l(function({as:t,render:e,context:n,classes:i=[],variables:s={},style:o,className:r,children:a,...l},c){const d=function(...t){return t.filter(Boolean).join(" ")}(...(Array.isArray(i)?i:[i]).filter(t=>"string"==typeof t).map(at),r),u={style:{...Object.fromEntries(Object.entries(s).map(([t,e])=>{return[(n=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),`--${at(n)}`),"number"==typeof e?mt(e,5):e];var n})),...o},className:d,children:a,...l};if(e){const t=e({ref:c,...u},n);if(t)return t}return p(t||"div",{ref:c,...u})}),wt=l(function({photo:t,index:e,width:n,height:i,onClick:s,render:{wrapper:o,link:r,button:a,image:l,extras:c}={},componentsProps:{link:d,button:u,wrapper:h,image:m}={}},g){const{href:f}=t,w={photo:t,index:e,width:mt(n,3),height:mt(i,3)};let y;return y=f?{...d,as:"a",render:r,classes:["photo","link"],href:f,onClick:s}:s?{...u,as:"button",type:"button",render:a,classes:["photo","button"],onClick:s}:{...h,render:o,classes:"photo"},p(ft,{ref:g,variables:{photoWidth:w.width,photoHeight:w.height},context:w,...y,children:[p(ft,{as:"img",classes:"image",render:l,context:w,...m}),c?.({},w)]})}),yt=l(function({layout:t,sizes:e,model:n,skeleton:i,onClick:s,render:{container:o,track:r,photo:a,...l}={},componentsProps:{container:d,track:u,link:h,button:m,wrapper:g,image:f}={}},w){const{spacing:y,padding:v,containerWidth:b,tracks:T,variables:x,horizontal:_}=n||{};return p(ft,{role:"group","aria-label":"Photo album",...d,variables:{spacing:y,padding:v,containerWidth:b,...x},classes:["",t],render:o,ref:w,children:[void 0!==y&&void 0!==v&&void 0!==b&&T?.map(({photos:t,variables:n},i)=>{const o=t.length,d=_?o:T.length;return c(ft,{...u,key:i,render:r,classes:"track",variables:{trackSize:o,...n}},t.map(t=>{const{photo:n,index:i,width:o}=t,{key:r,src:c,alt:u="",title:w,label:T}=n,x=s?t=>{s({event:t,photo:n,index:i})}:void 0;if(a){const e=a({onClick:x},t);if(e)return e}const _=t=>T?{"aria-label":T,...t}:t;return p(wt,{onClick:x,render:l,componentsProps:{image:{loading:"lazy",decoding:"async",src:c,alt:u,title:w,...gt(n,e,o,b,d,y,v),...dt(f,t)},link:_(dt(h,t)),button:_(dt(m,t)),wrapper:dt(g,t)},...t},r??i)}))}),void 0===b&&i]})});function vt(t,e,n,i){return(e-(t.length-1)*n-2*i*t.length)/t.reduce((t,e)=>t+lt(e),0)}function bt(t,e,n,i,s,o,r){const a=t.slice(e,n),l=vt(a,i,s,o);return l>0?(l-r)**2*a.length:void 0}function Tt(t,e){const[n,i]=t;if(n===e)return t;if(void 0!==i&&void 0!==e&&void 0!==n&&e===i&&Math.abs(e-n)<=20){const s=Math.min(n,e),o=Math.max(n,e);return s===n&&o===i?t:[s,o]}return[e,n]}function xt(t,e,n){const[[i],o]=f(Tt,[n]),r=function(t){const[e,n]=w(t);return t===e||t&&e&&t.length===e.length&&!t.some((t,n)=>t!==e[n])?e:(n(t),t)}(e),l=a(void 0);return{containerRef:s(e=>{l.current?.disconnect(),l.current=void 0;const n=()=>o(function(t,e){let n=t?.clientWidth;if(void 0!==n&&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)),n=t.find((e,i)=>e<=n||i===t.length-1)}return n}(e,r));n(),e&&"undefined"!=typeof ResizeObserver&&(l.current=new ResizeObserver(n),l.current.observe(e)),"function"==typeof t?t(e):t&&(t.current=e)},[t,r]),containerWidth:i}}var _t=l(function({photos:t,breakpoints:e,defaultContainerWidth:n,...i},s){const{containerRef:r,containerWidth:a}=xt(s,e,n),{spacing:l,padding:c,targetRowHeight:d,minPhotos:u,maxPhotos:h,...m}=function(t,{photos:e,targetRowHeight:n,rowConstraints:i,...s}){const{spacing:o,padding:r,componentsProps:a,render:l}=pt(t,s),{singleRowMaxHeight:c,minPhotos:d,maxPhotos:u}=ut(i,t)||{};if(void 0!==c&&void 0!==o&&void 0!==r){const t=Math.floor(e.reduce((t,{width:e,height:n})=>t+e/n*c+2*r,o*(e.length-1)));t>0&&(a.container={...a.container},a.container.style={maxWidth:t,...a.container.style})}return{...s,targetRowHeight:ht(n,t,[t=>t/5,t=>t/4,t=>t/3,t=>t/2]),render:l,spacing:o,padding:r,minPhotos:d,maxPhotos:u,componentsProps:a}}(a,{photos:t,...i});return p(yt,{layout:"rows",ref:r,model:o(()=>void 0!==a&&void 0!==l&&void 0!==c&&void 0!==d?function(t,e,n,i,s,o,r){const a=Math.min(function(t,e,n,i){return mt(e/n/Math.min(...t.map(t=>lt(t))))+(i||0)+2}(t,i,s,o),r||1/0),l=o||1,c=t.length,d=new Array(c+1).fill(1/0),u=new Array(c+1).fill(-1);d[0]=0;for(let m=1;m<=c;m+=1)for(let o=m-l;o>=Math.max(0,m-a);o-=1){if(d[o]===1/0)continue;const r=bt(t,o,m,i,e,n,s);if(void 0===r)break;const a=d[o]+r;(d[m]===1/0||d[m]>a&&(d[m]/a>1.005||-1!==u[m]&&u[m]<o))&&(d[m]=a,u[m]=o)}if(d[c]===1/0)return;const h=[];for(let m=c;0!==m;m=u[m])h.push(m);h.push(0),h.reverse();const p=[];for(let m=1;m<h.length;m+=1){const s=t.slice(h[m-1],h[m]).map((t,e)=>({photo:t,index:h[m-1]+e})),o=vt(s.map(({photo:t})=>t),i,e,n);p.push({photos:s.map(({photo:t,index:e})=>({photo:t,index:e,width:o*lt(t),height:o}))})}return{spacing:e,padding:n,containerWidth:i,tracks:p,horizontal:!0}}(t,l,c,a,d,u,h):void 0,[t,l,c,a,d,u,h]),...m})});function qt(t,e,n,i,s,o,r){const a=[],l=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,n)=>({photo:e,index:t[c]+n})),u=r.reduce((t,e,n)=>t+(o[c]-o[n])*e,0),h=(s-(t.length-2)*n-2*(t.length-1)*i-u)*r[c]/l;a.push({photos:d.map(({photo:t,index:e})=>({photo:t,index:e,width:h,height:h/lt(t)})),variables:{adjustedGaps:u,columnRatio:r[c]}})}return{tracks:a,variables:{totalRatio:l}}}function kt(t,e,n,i,s,o){const r=[],a=[];if(t.length<=o){const s=t.length>0?t.reduce((t,e)=>t+lt(e),0)/t.length:1;for(let e=0;e<o;e+=1)r[e]=2*n,a[e]=e<t.length?lt(t[e]):s;return qt(Array.from({length:o+1},(e,n)=>Math.min(n,t.length)),t,e,n,i,r,a)}const l=(c=function(t,e,n,i,s){return o=>{const r=[],a=1.5*s;let l=i/lt(t[o])+2*n;for(let c=o+1;c<t.length+1&&(r.push([c,(s-l)**2]),!(l>a||c===t.length));c+=1)l+=i/lt(t[c])+e+2*n;return r}}(t,e,n,s,(t.reduce((t,e)=>t+s/lt(e),0)+e*(t.length-o)+2*n*t.length)/o),d=o,u=0,h=t.length,function(t,e,n){const i=[n];for(let s=n,o=e;o>0;o-=1)[s]=t.get(s)[o],i.push(s);return i.reverse()}(function(t,e,n,i){const s=/* @__PURE__ */new Map,o=/* @__PURE__ */new Set;o.add(n);for(let r=0;r<e;r+=1){const n=[...o.keys()];o.clear(),n.forEach(n=>{const a=r>0?s.get(n)[r][1]:0;t(n).forEach(([t,l])=>{let c=s.get(t);c||(c=[],s.set(t,c));const d=a+l,u=c[r+1];(!u||u[1]>d&&(u[1]/d>1.0001||n<u[0]))&&(c[r+1]=[n,d]),r<e-1&&t!==i&&o.add(t)})})}return s}(c,d,u,h),d,h));var c,d,u,h;for(let p=0;p<l.length-1;p+=1){const i=t.slice(l[p],l[p+1]);r[p]=e*(i.length-1)+2*n*i.length,a[p]=1/i.reduce((t,e)=>t+1/lt(e),0)}return qt(l,t,e,n,i,r,a)}function St(t,e,n,i,s){const{tracks:o,variables:r}=kt(t,e,n,i,(i-e*(s-1)-2*n*s)/s,s);return o.some(t=>t.photos.some(({width:t,height:e})=>t<=0||e<=0))?s>1?St(t,e,n,i,s-1):void 0:{tracks:o,spacing:e,padding:n,containerWidth:i,variables:{columns:s,...r}}}var It=l(function({photos:t,breakpoints:e,defaultContainerWidth:n,...i},s){const{containerRef:r,containerWidth:a}=xt(s,e,n),{spacing:l,padding:c,columns:d,...u}=function(t,{columns:e,...n}){return{...n,...pt(t,n),columns:ht(e,t,[5,4,3,2],1)}}(a,{photos:t,...i});return p(yt,{layout:"columns",ref:r,model:o(()=>void 0!==a&&void 0!==l&&void 0!==c&&void 0!==d?St(t,l,c,a,d):void 0,[t,l,c,a,d]),...u})});function Et(t,e,n,i,s){const o=(i-e*(s-1)-2*n*s)/s;if(o<=0)return s>1?Et(t,e,n,i,s-1):void 0;const r=[];for(let l=0;l<s;l+=1)r[l]=0;const a=t.reduce((t,i,s)=>{const a=r.reduce((t,e,n)=>e<r[t]-1?n:t,0);return r[a]=r[a]+o/lt(i)+e+2*n,t[a].push({photo:i,index:s}),t},Array.from({length:s},()=>[]));return{spacing:e,padding:n,containerWidth:i,variables:{columns:s},tracks:a.map(t=>({photos:t.map(({photo:t,index:e})=>({photo:t,index:e,width:o,height:o/lt(t)}))}))}}var Ct=l(function({photos:t,breakpoints:e,defaultContainerWidth:n,...i},s){const{containerRef:r,containerWidth:a}=xt(s,e,n),{spacing:l,padding:c,columns:d,...u}=function(t,{columns:e,...n}){return{...n,...pt(t,n),columns:ht(e,t,[5,4,3,2],1)}}(a,{photos:t,...i});return p(yt,{layout:"masonry",ref:r,model:o(()=>void 0!==a&&void 0!==l&&void 0!==c&&void 0!==d?Et(t,l,c,a,d):void 0,[t,l,c,a,d]),...u})});function Nt(t){return t?String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"):""}var Lt=class{constructor(t,e={}){this.lightbox=t,this.aiSummaryVisible=!1,this.currentSummary=null,this.options={aiSummaryButtonOrder:7,width:"400px",height:"300px",transition:"0.3s ease",...e},document.head.insertAdjacentHTML("beforeend",`<style>\n .pswp__ai-summary-panel {\n background: rgba(30, 30, 30, 0.9);\n color: white;\n position: absolute;\n overflow-y: auto;\n z-index: 1;\n transition: transform ${this.options.transition};\n box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);\n padding: 20px;\n }\n\n /* Desktop styles */\n @media (min-width: 768px) {\n .pswp__ai-summary-panel {\n top: 0;\n right: 0;\n height: 100%;\n width: ${this.options.width};\n transform: translateX(100%);\n }\n\n .pswp__ai-summary-panel.visible {\n transform: translateX(0);\n }\n\n .pswp__container.shifted-for-ai-summary {\n transform: translateX(-${this.options.width});\n transition: transform ${this.options.transition};\n }\n }\n\n /* Mobile styles */\n @media (max-width: 767px) {\n .pswp__ai-summary-panel {\n bottom: 0;\n left: 0;\n width: 100%;\n height: ${this.options.height};\n transform: translateY(100%);\n }\n\n .pswp__ai-summary-panel.visible {\n transform: translateY(0);\n }\n\n .pswp__container.shifted-for-ai-summary {\n transform: translateY(-${this.options.height});\n transition: transform ${this.options.transition};\n }\n }\n\n .pswp__ai-summary-close {\n position: absolute;\n top: 10px;\n right: 10px;\n width: 32px;\n height: 32px;\n opacity: 0.6;\n cursor: pointer;\n z-index: 2;\n background: rgba(0, 0, 0, 0.3);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: opacity 0.3s;\n }\n\n .pswp__ai-summary-close:hover {\n opacity: 1;\n }\n\n .pswp__ai-summary-close:before,\n .pswp__ai-summary-close:after {\n position: absolute;\n content: '';\n width: 16px;\n height: 2px;\n background-color: white;\n }\n\n .pswp__ai-summary-close:before {\n transform: rotate(45deg);\n }\n\n .pswp__ai-summary-close:after {\n transform: rotate(-45deg);\n }\n\n .pswp__ai-summary-content {\n margin-top: 20px;\n }\n\n .pswp__ai-summary-title {\n margin-bottom: 16px;\n font-size: 18px;\n font-weight: bold;\n padding-right: 30px; /* Add space for the close button */\n }\n\n .pswp__ai-summary-section {\n margin-bottom: 16px;\n }\n\n .pswp__ai-summary-section-title {\n font-weight: bold;\n margin-bottom: 8px;\n }\n\n .pswp__ai-summary-label {\n display: inline-flex;\n align-items: center;\n background: rgba(255, 255, 255, 0.1);\n border-radius: 12px;\n padding: 4px 12px;\n margin-right: 8px;\n margin-bottom: 8px;\n font-size: 14px;\n }\n\n .pswp__ai-summary-description {\n font-size: 14px;\n line-height: 1.5;\n }\n\n .pswp__ai-summary-empty {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n color: rgba(255, 255, 255, 0.6);\n font-style: italic;\n }\n\n .pswp__ai-summary-bing-search {\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 8px;\n z-index: 2;\n }\n\n .pswp__ai-summary-bing-button {\n height: 32px;\n background: rgba(255, 255, 255, 0.2);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: background-color 0.3s;\n }\n\n .pswp__ai-summary-bing-button:hover {\n background: rgba(255, 255, 255, 0.4);\n }\n\n .pswp__ai-summary-bing-icon {\n width: 20px;\n height: 20px;\n }\n\n .pswp__ai-summary-disclaimer {\n font-size: 12px;\n color: rgba(255, 255, 255, 0.7);\n text-align: center;\n margin-top: 32px;\n padding: 0 10px;\n line-height: 1.4;\n font-style: italic;\n }\n </style>`),t.on("init",()=>{this.initPswpEvents(t.pswp)})}initPswpEvents(t){t.on("uiRegister",()=>{t.ui.registerElement({name:"ai-summary-toggle-button",title:"Toggle AI summary view",order:this.options.aiSummaryButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24">\n <use class="pswp__icn-shadow" xlink:href="#pswp__icn-ai-summary"/>\n <path d="M12 17q.425 0 .713-.288T13 16v-4q0-.425-.288-.712T12 11t-.712.288T11 12v4q0 .425.288.713T12 17m0-8q.425 0 .713-.288T13 8t-.288-.712T12 7t-.712.288T11 8t.288.713T12 9m0 13q-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 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22m0-2q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20m0-8"/>\n </svg>',onClick:()=>{this.toggleAISummary(t)}}),t.ui.registerElement({name:"ai-summary-panel",isButton:!1,appendTo:"root",html:'<div class="pswp__ai-summary-panel"><div class="pswp__ai-summary-close"></div></div>'})}),t.on("change",()=>{this.aiSummaryVisible&&this.updateAISummary(t)}),t.on("close",()=>{this.hideAISummary(t)}),t.on("firstUpdate",()=>{const e=t.element.querySelector(".pswp__ai-summary-close");e&&e.addEventListener("click",()=>{this.hideAISummary(t)})})}toggleAISummary(t){this.aiSummaryVisible?this.hideAISummary(t):this.showAISummary(t)}showAISummary(t){const e=t.container,n=t.element.querySelector(".pswp__ai-summary-panel");n&&(this.aiSummaryVisible=!0,n.classList.add("visible"),e.classList.add("shifted-for-ai-summary"),this.updateAISummary(t))}hideAISummary(t){const e=t.container,n=t.element.querySelector(".pswp__ai-summary-panel");n&&(this.aiSummaryVisible=!1,n.classList.remove("visible"),e.classList.remove("shifted-for-ai-summary"))}updateAISummary(t){if(!t.currSlide)return;const e=t.element.querySelector(".pswp__ai-summary-panel");if(!e)return;const n=t.currSlide.data,i=n.src||n.url||"";let s=null;try{n.contentSummary&&(s=JSON.parse(n.contentSummary),this.currentSummary=s)}catch(r){console.error("Error parsing AI summary data:",r)}const o=i?`<a class="pswp__ai-summary-bing-search" href="https://www.bing.com/images/search?view=detailv2&iss=SBI&form=SBIIRP&sbisrc=UrlPaste&q=imgurl:${encodeURIComponent(i)}&idpbck=1&selectedindex=0&id=${encodeURIComponent(i)}&mediaurl=${encodeURIComponent(i)}" target="_blank" rel="noopener noreferrer" class="pswp__ai-summary-bing-button">\n <svg xmlns="http://www.w3.org/2000/svg" style="height:24px;width:24px" width="256" height="388" viewBox="0 0 256 388"><defs><radialGradient id="logosBing0" cx="93.717%" cy="77.818%" r="143.121%" fx="93.717%" fy="77.818%" gradientTransform="scale(-1 -.71954)rotate(49.091 2.036 -2.204)"><stop offset="0%" stop-color="#00cacc"/><stop offset="100%" stop-color="#048fce"/></radialGradient><radialGradient id="logosBing1" cx="13.893%" cy="71.448%" r="150.086%" fx="13.893%" fy="71.448%" gradientTransform="matrix(.55155 -.39387 .23634 .91917 -.107 .112)"><stop offset="0%" stop-color="#00bbec"/><stop offset="100%" stop-color="#2756a9"/></radialGradient><linearGradient id="logosBing2" x1="50%" x2="50%" y1="0%" y2="100%"><stop offset="0%" stop-color="#00bbec"/><stop offset="100%" stop-color="#2756a9"/></linearGradient></defs><path fill="url(#logosBing0)" d="M129.424 122.047c-7.133.829-12.573 6.622-13.079 13.928c-.218 3.147-.15 3.36 6.986 21.722c16.233 41.774 20.166 51.828 20.827 53.243c1.603 3.427 3.856 6.65 6.672 9.544c2.16 2.22 3.585 3.414 5.994 5.024c4.236 2.829 6.337 3.61 22.818 8.49c16.053 4.754 24.824 7.913 32.381 11.664c9.791 4.86 16.623 10.387 20.944 16.946c3.1 4.706 5.846 13.145 7.04 21.64c.468 3.321.47 10.661.006 13.663c-1.008 6.516-3.021 11.976-6.101 16.545c-1.638 2.43-1.068 2.023 1.313-.939c6.74-8.379 13.605-22.7 17.108-35.687c4.24-15.718 4.817-32.596 1.66-48.57c-6.147-31.108-25.786-57.955-53.444-73.06c-1.738-.95-8.357-4.42-17.331-9.085a1633 1633 0 0 1-4.127-2.154c-.907-.477-2.764-1.447-4.126-2.154c-1.362-.708-5.282-2.75-8.711-4.539l-8.528-4.446a6021 6021 0 0 1-8.344-4.357c-8.893-4.655-12.657-6.537-13.73-6.863c-1.125-.343-3.984-.782-4.701-.723c-.152.012-.838.088-1.527.168"/><path fill="url(#logosBing1)" d="M148.81 277.994c-.493.292-1.184.714-1.537.938c-.354.225-1.137.712-1.743 1.083a8315 8315 0 0 0-13.204 8.137a2848 2848 0 0 0-8.07 4.997a388 388 0 0 1-3.576 2.198c-.454.271-2.393 1.465-4.31 2.654a2652 2652 0 0 1-7.427 4.586a3958 3958 0 0 0-8.62 5.316a3011 3011 0 0 1-7.518 4.637c-1.564.959-3.008 1.885-3.21 2.058c-.3.257-14.205 8.87-21.182 13.121c-5.3 3.228-11.43 5.387-17.705 6.235c-2.921.395-8.45.396-11.363.003c-7.9-1.067-15.176-4.013-21.409-8.666c-2.444-1.826-7.047-6.425-8.806-8.8c-4.147-5.598-6.829-11.602-8.218-18.396c-.32-1.564-.622-2.884-.672-2.935c-.13-.13.105 2.231.528 5.319c.44 3.211 1.377 7.856 2.387 11.829c7.814 30.743 30.05 55.749 60.15 67.646c8.668 3.424 17.415 5.582 26.932 6.64c3.576.4 13.699.56 17.43.276c17.117-1.296 32.02-6.334 47.308-15.996c1.362-.86 3.92-2.474 5.685-3.585a877 877 0 0 0 4.952-3.14c.958-.615 2.114-1.341 2.567-1.614a91 91 0 0 0 2.018-1.268c.656-.424 3.461-2.2 6.235-3.944l11.092-7.006l3.809-2.406l.137-.086l.42-.265l.199-.126l2.804-1.771l9.69-6.121c12.348-7.759 16.03-10.483 21.766-16.102c2.392-2.342 5.997-6.34 6.176-6.848c.037-.104.678-1.092 1.424-2.197c3.036-4.492 5.06-9.995 6.064-16.484c.465-3.002.462-10.342-.005-13.663c-.903-6.42-2.955-13.702-5.167-18.339c-3.627-7.603-11.353-14.512-22.453-20.076c-3.065-1.537-6.23-2.943-6.583-2.924c-.168.009-10.497 6.322-22.954 14.03c-12.457 7.71-23.268 14.4-24.025 14.87s-2.056 1.263-2.888 1.764z"/><path fill="url(#logosBing2)" d="m.053 241.013l.054 53.689l.695 3.118c2.172 9.747 5.937 16.775 12.482 23.302c3.078 3.07 5.432 4.922 8.768 6.896c7.06 4.177 14.657 6.238 22.978 6.235c8.716-.005 16.256-2.179 24.025-6.928c1.311-.801 6.449-3.964 11.416-7.029l9.032-5.572v-127.4l-.002-58.273c-.002-37.177-.07-59.256-.188-60.988c-.74-10.885-5.293-20.892-12.948-28.461c-2.349-2.323-4.356-3.875-10.336-7.99a25160 25160 0 0 1-12.104-8.336L28.617 5.835C22.838 1.85 22.386 1.574 20.639.949C18.367.136 15.959-.163 13.67.084C6.998.804 1.657 5.622.269 12.171C.053 13.191.013 26.751.01 100.35l-.003 86.975H0z"/></svg>\n <span>Search on Bing</span>\n </a>\n <div class="pswp__ai-summary-disclaimer">\n These are AI generated summaries based on the content. Please verify the information before using it.\n </div>`:"";if(s){e.innerHTML=`<div class="pswp__ai-summary-close"></div>${this.renderAISummary(s)}${o}`;const n=e.querySelector(".pswp__ai-summary-close");n&&n.addEventListener("click",()=>{this.hideAISummary(t)})}else{e.innerHTML=`<div class="pswp__ai-summary-close"></div><div class="pswp__ai-summary-empty">No AI summary available for this content</div>${o}`;const n=e.querySelector(".pswp__ai-summary-close");n&&n.addEventListener("click",()=>{this.hideAISummary(t)})}}renderAISummary(t){let e='<div class="pswp__ai-summary-content">';return t.subject&&(e+=`<div class="pswp__ai-summary-title">${Nt(t.subject)}</div>`),t.labels&&Object.entries(t.labels).filter(([t,e])=>Array.isArray(e)&&e.length>0).forEach(([t,n])=>{e+=`\n <div class="pswp__ai-summary-section">\n <div class="pswp__ai-summary-section-title">${Nt(t.replace("_"," ").replace(/\b\w/g,t=>t.toUpperCase()))}</div>\n <div class="pswp__ai-summary-labels space-y-2">\n ${n.map(t=>`<span class="pswp__ai-summary-label">${Nt(t)}</span>`).join("")}\n </div>\n </div>\n `}),t.description&&(e+=`\n <div class="pswp__ai-summary-section">\n <div class="pswp__ai-summary-description">${Nt(t.description)}</div>\n </div>\n `),e+="</div>",e}},Mt='url("https://res.cloudinary.com/dectzk2b2/image/upload/v1736933014/black_rpie3v.png")',At=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)})}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=Mt,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=Mt,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,n=e.content.element;"video"===n?.tagName?.toLowerCase()&&(this.referenceVideoElement=n,this.registerVideoEvents(n,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,n=32)=>{if(!t||t.length<6||"undefined"==typeof document)return null;try{const i=$(t,e,n),s=document.createElement("canvas");s.width=e,s.height=n;const o=s.getContext("2d");if(!o)return null;const r=o.createImageData(e,n);return r.data.set(i),o.putImageData(r,0,0),s.toDataURL()}catch(i){return console.warn("[PhotoSwipeBackdrop] Failed to decode blurhash:",i),null}})(e.data.blurhash)||e.data.thumbnailUrl||e.data.src;this.backgroundElement.style.backgroundImage=t?`url("${t}")`:Mt,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})}};function Bt(t){return t?String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"):""}var Ot={[V.LINK]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h6q.425 0 .713.288T12 4t-.288.713T11 5H5v14h14v-6q0-.425.288-.712T20 12t.713.288T21 13v6q0 .825-.587 1.413T19 21zM19 6.4L10.4 15q-.275.275-.7.275T9 15t-.275-.7t.275-.7L17.6 5H15q-.425 0-.712-.288T14 4t.288-.712T15 3h5q.425 0 .713.288T21 4v5q0 .425-.288.713T20 10t-.712-.288T19 9z"/></svg>',[V.EMAIL]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><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 22zm0-7q1.25 0 2.125-.875T15 12t-.875-2.125T12 9t-2.125.875T9 12t.875 2.125T12 15"/></svg>',[V.PHONE]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M19.95 21q-3.125 0-6.175-1.362t-5.55-3.863t-3.862-5.55T3 4.05q0-.45.3-.75t.75-.3H8.1q.35 0 .625.238t.325.562l.65 3.5q.05.4-.025.675T9.4 8.45L6.975 10.9q.5.925 1.187 1.787t1.513 1.663q.775.775 1.625 1.438T13.1 17l2.35-2.35q.225-.225.588-.337t.712-.063l3.45.7q.35.1.575.363T21 15.9v4.05q0 .45-.3.75t-.75.3M6.025 9l1.65-1.65L7.25 5H5.025q.125 1.025.35 2.025T6.025 9m8.95 8.95q.975.425 1.988.675T19 18.95v-2.2l-2.35-.475zm0 0"/></svg>',[V.SMS]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="m6 18l-2.3 2.3q-.475.475-1.088.213T2 19.575V4q0-.825.588-1.412T4 2h16q.825 0 1.413.588T22 4v12q0 .825-.587 1.413T20 18zm-.85-2H20V4H4v13.125zM4 16V4zm4-5q.425 0 .713-.288T9 10t-.288-.712T8 9t-.712.288T7 10t.288.713T8 11m4 0q.425 0 .713-.288T13 10t-.288-.712T12 9t-.712.288T11 10t.288.713T12 11m4 0q.425 0 .713-.288T17 10t-.288-.712T16 9t-.712.288T15 10t.288.713T16 11"/></svg>',[V.WHATSAPP]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 258"><defs><linearGradient id="logosWhatsappIcon0" x1="50%" x2="50%" y1="100%" y2="0%"><stop offset="0%" stop-color="#1faf38"/><stop offset="100%" stop-color="#60d669"/></linearGradient><linearGradient id="logosWhatsappIcon1" x1="50%" x2="50%" y1="100%" y2="0%"><stop offset="0%" stop-color="#f9f9f9"/><stop offset="100%" stop-color="#fff"/></linearGradient></defs><path fill="url(#logosWhatsappIcon0)" d="M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004"/><path fill="url(#logosWhatsappIcon1)" d="M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z"/><path fill="#fff" d="M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64"/></svg>',[V.MESSENGER]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256"><defs><radialGradient id="logosMessenger0" cx="19.247%" cy="99.465%" r="108.96%" fx="19.247%" fy="99.465%"><stop offset="0%" stop-color="#09f"/><stop offset="60.975%" stop-color="#a033ff"/><stop offset="93.482%" stop-color="#ff5280"/><stop offset="100%" stop-color="#ff7061"/></radialGradient></defs><path fill="url(#logosMessenger0)" 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"/><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"/></svg>'},Rt=class{constructor(t,e,n){this.lightbox=t,this.captureAdImpression=e,this.captureAdClick=n,this.captionOn=!0,this.options={captionButtonOrder:8},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){t.on("uiRegister",()=>{t.ui.registerElement({name:"caption-toggle-button",title:"Toggle caption view",order:this.options.captionButtonOrder,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-caption"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-caption"/><path id="pswp__icn-show-caption" d="M5 20q-.825 0-1.412-.587T3 18V6q0-.825.588-1.412T5 4h14q.825 0 1.413.588T21 6v12q0 .825-.587 1.413T19 20zm0-2h14V6H5zm2-3h3q.425 0 .713-.288T11 14v-.5q0-.225-.15-.375t-.375-.15h-.45q-.225 0-.375.15t-.15.375h-2v-3h2q0 .225.15.375t.375.15h.45q.225 0 .375-.15T11 10.5V10q0-.425-.288-.712T10 9H7q-.425 0-.712.288T6 10v4q0 .425.288.713T7 15m10-6h-3q-.425 0-.712.288T13 10v4q0 .425.288.713T14 15h3q.425 0 .713-.288T18 14v-.5q0-.225-.15-.375t-.375-.15h-.45q-.225 0-.375.15t-.15.375h-2v-3h2q0 .225.15.375t.375.15h.45q.225 0 .375-.15T18 10.5V10q0-.425-.288-.712T17 9M5 18V6z"/><path id="pswp__icn-hide-caption" style="display:none" d="m9.025 9l1.5 1.5H7.5v3h2q0-.225.15-.375t.375-.15h.45q.225 0 .375.15t.15.375v.5q0 .425-.288.713T10 15H7q-.425 0-.712-.288T6 14v-4q0-.425.288-.712T7 9zM21 6v10q0 .5-.325.763t-.7.262t-.675-.262T19 16V6H8.975q-.5 0-.75-.312T7.975 5t.25-.687t.75-.313H19q.825 0 1.413.588T21 6m-3 8q0 .225-.088.438t-.262.337L16.375 13.5h.125q0-.225.15-.375t.375-.15h.45q.225 0 .375.15t.15.375zm-1-5q.425 0 .713.288T18 10v.5q0 .225-.15.375t-.375.15h-.45q-.225 0-.375-.15t-.15-.375h-2v1.125l-1.5-1.5V10q0-.425.288-.712T14 9zM5 20q-.825 0-1.412-.587T3 18V6q0-.625.338-1.112t.862-.713L6.025 6H5v12h10.175L1.375 4.225q-.3-.3-.3-.712t.3-.713t.713-.3t.712.3l18.375 18.375q.3.3.3.713t-.3.712t-.712.3t-.713-.3L17.175 20z"/></svg>',onClick:()=>{this.toggleCaption(t)}}),t.ui.registerElement({name:"custom-caption",isButton:!1,appendTo:"root",html:'<div id="pswp-caption-container" class=" absolute bottom-0 w-full bg-transparent"></div>'})}),t.on("change",()=>{this.captionOn&&this.updateCaption(t)}),t.on("close",()=>{this.clearCaption()})}toggleCaption(t){this.captionOn?this.clearCaption():this.updateCaption(t),this.captionOn=!this.captionOn;const e=this.querySelector("#pswp__icn-show-caption"),n=this.querySelector("#pswp__icn-hide-caption");e&&(e.style.display=this.captionOn?"inline":"none"),n&&(n.style.display=this.captionOn?"none":"inline")}createCaptionHTML(t){const{id:e,type:n,caption:i,title:s,description:o,targetType:r,targetText:a,targetUrl:l}=t||{},c=Boolean(r)&&String(r)!==String(V.NONE),d=c?r:V.LINK;switch("ad"===n&&this.captureAdImpression&&this.captureAdImpression(e),n){case"image":case"video":return i?.length>0?`\n <div class=" w-full bg-black/50 p-4 text-gray-300">\n <h3 class=" text-center sm:text-lg">${Bt(i)}</h3>\n </div>\n `:"";case"ad":return`\n <div class=" w-full bg-black/85 p-4 text-white">\n <div class=" mx-auto w-full max-w-2xl space-y-2 text-center">\n <h3 class=" text-center sm:text-lg">${Bt(s)}</h3>\n <h4 class=" pb-2 text-center text-sm sm:text-base">${Bt(o)}</h4>\n ${c?`<button\n class=" flex w-full items-center justify-center gap-3 rounded-md bg-white py-1 text-lg text-black caption-action-button"\n data-id="${Bt(e)}"\n data-target-type="${Bt(d)}"\n data-target-url="${Bt(l)}">\n ${Ot[d]}\n ${Bt(a)}\n </button>`:""}\n </div>\n </div>\n `;default:return""}}updateCaption(t){try{const e=this.getElementById("pswp-caption-container");if(!e)return;const n=t.currSlide?.data;e.innerHTML=this.createCaptionHTML(n);const i=e.querySelector(".caption-action-button");i&&i.addEventListener("click",t=>{const e=t.currentTarget.dataset.id,n=t.currentTarget.dataset.targetType,i=t.currentTarget.dataset.targetUrl;this.captureAdClick&&e&&this.captureAdClick(e,n,i)})}catch(e){console.error("Error rendering caption:",e)}}clearCaption(){const t=this.getElementById("pswp-caption-container");t&&(t.innerHTML="")}},Vt=({contents:t=[],selectedIndex:e,onClick:n})=>{const i=a(null);g(()=>{i.current&&s(e)},[e,i.current]);const s=t=>{if(!i.current)return;const e=i.current,n=e.children;if(t<0||t>=n.length)return;const s=n[t],o=e.offsetWidth/2,r=s.offsetLeft+s.offsetWidth/2-o;e.scrollTo({left:r,behavior:"smooth"})};/* @__PURE__ */
1
+ import{A as t,C as e,D as n,O as i,S as s,_ as o,b as r,g as a,i as l,j as c,k as d,n as h,r as u,t as p,v as m,w as g,x as f,y as w}from"./iDVNWJcT.js";import{C as y,H as v,N as b,O as T,R as x,S as _,V as q,Z as k,at as S,dt as I,g as E,h as C,ht as N,mt as L,n as M,p as A,q as B,st as O,vt as R,x as V,z}from"./82Hs8bOb.js";import{i as P,o as D,r as $,t as H}from"./iHYhFGS-.js";import{a as F,d as U,f as j,g as W,h as G,i as K,l as Y,m as Q,n as Z,o as J,p as X,r as tt,s as et,t as nt,u as it,v as st,y as ot}from"./BIcJV2_v.js";var rt=class extends R{#t;#e=void 0;#n;#i;constructor(t,e){super(),this.#t=t,this.setOptions(e),this.bindMethods(),this.#s()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const e=this.options;this.options=this.#t.defaultMutationOptions(t),L(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),e?.mutationKey&&this.options.mutationKey&&O(e.mutationKey)!==O(this.options.mutationKey)?this.reset():"pending"===this.#n?.state.status&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#s(),this.#o(t)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#s(),this.#o()}mutate(t,e){return this.#i=e,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(t)}#s(){const t=this.#n?.state??D();this.#e={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#o(t){S.batch(()=>{if(this.#i&&this.hasListeners()){const n=this.#e.variables,i=this.#e.context,s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if("success"===t?.type){try{this.#i.onSuccess?.(t.data,n,i,s)}catch(e){Promise.reject(e)}try{this.#i.onSettled?.(t.data,null,n,i,s)}catch(e){Promise.reject(e)}}else if("error"===t?.type){try{this.#i.onError?.(t.error,n,i,s)}catch(e){Promise.reject(e)}try{this.#i.onSettled?.(void 0,t.error,n,i,s)}catch(e){Promise.reject(e)}}}this.listeners.forEach(t=>{t(this.#e)})})}};function at(t){return["react-photo-album",t].filter(Boolean).join("--")}function lt({width:t,height:e}){const n=t/e;return Number.isFinite(n)?n:1}var ct=Object.freeze([1200,600,300,0]);function dt(t,e){return"function"==typeof t?t(e):t}function ht(t,e){return void 0!==e?dt(t,e):void 0}function ut(t,e,n,i=0){if(void 0===e)return;const s=ht(t,e);return Math.round(Math.max(void 0===s?function(t,e){const n=ct.findIndex(t=>t<=e);return dt(t[Math.max(n,0)],e)}(n,e):s,i))}function pt(t,{spacing:e,padding:n,componentsProps:i,render:s}){return{spacing:ut(e,t,[20,15,10,5]),padding:ut(n,t,[0,0,0,0]),componentsProps:dt(i,t)||{},render:dt(s,t)}}function mt(t,e=0){const n=10**e;return Math.round((t+Number.EPSILON)*n)/n}function gt(t,e,n,i,s,o,r){let a,l;const c=t=>{const e=o*(s-1)+2*r*s;return`calc((${t.match(/^\s*calc\((.*)\)\s*$/)?.[1]??t} - ${e}px) / ${mt((i-e)/n,5)})`},d=t.srcSet;return d&&d.length>0&&(a=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(", ")),l=e?.size?(e.sizes||[]).map(({viewport:t,size:e})=>`${t} ${c(e)}`).concat(c(e.size)).join(", "):`${Math.ceil(n/i*100)}vw`,{srcSet:a,sizes:l}}var ft=l(function({as:t,render:e,context:n,classes:i=[],variables:s={},style:o,className:r,children:a,...l},c){const d=function(...t){return t.filter(Boolean).join(" ")}(...(Array.isArray(i)?i:[i]).filter(t=>"string"==typeof t).map(at),r),h={style:{...Object.fromEntries(Object.entries(s).map(([t,e])=>{return[(n=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),`--${at(n)}`),"number"==typeof e?mt(e,5):e];var n})),...o},className:d,children:a,...l};if(e){const t=e({ref:c,...h},n);if(t)return t}return p(t||"div",{ref:c,...h})}),wt=l(function({photo:t,index:e,width:n,height:i,onClick:s,render:{wrapper:o,link:r,button:a,image:l,extras:c}={},componentsProps:{link:d,button:h,wrapper:u,image:m}={}},g){const{href:f}=t,w={photo:t,index:e,width:mt(n,3),height:mt(i,3)};let y;return y=f?{...d,as:"a",render:r,classes:["photo","link"],href:f,onClick:s}:s?{...h,as:"button",type:"button",render:a,classes:["photo","button"],onClick:s}:{...u,render:o,classes:"photo"},p(ft,{ref:g,variables:{photoWidth:w.width,photoHeight:w.height},context:w,...y,children:[p(ft,{as:"img",classes:"image",render:l,context:w,...m}),c?.({},w)]})}),yt=l(function({layout:t,sizes:e,model:n,skeleton:i,onClick:s,render:{container:o,track:r,photo:a,...l}={},componentsProps:{container:d,track:h,link:u,button:m,wrapper:g,image:f}={}},w){const{spacing:y,padding:v,containerWidth:b,tracks:T,variables:x,horizontal:_}=n||{};return p(ft,{role:"group","aria-label":"Photo album",...d,variables:{spacing:y,padding:v,containerWidth:b,...x},classes:["",t],render:o,ref:w,children:[void 0!==y&&void 0!==v&&void 0!==b&&T?.map(({photos:t,variables:n},i)=>{const o=t.length,d=_?o:T.length;return c(ft,{...h,key:i,render:r,classes:"track",variables:{trackSize:o,...n}},t.map(t=>{const{photo:n,index:i,width:o}=t,{key:r,src:c,alt:h="",title:w,label:T}=n,x=s?t=>{s({event:t,photo:n,index:i})}:void 0;if(a){const e=a({onClick:x},t);if(e)return e}const _=t=>T?{"aria-label":T,...t}:t;return p(wt,{onClick:x,render:l,componentsProps:{image:{loading:"lazy",decoding:"async",src:c,alt:h,title:w,...gt(n,e,o,b,d,y,v),...dt(f,t)},link:_(dt(u,t)),button:_(dt(m,t)),wrapper:dt(g,t)},...t},r??i)}))}),void 0===b&&i]})});function vt(t,e,n,i){return(e-(t.length-1)*n-2*i*t.length)/t.reduce((t,e)=>t+lt(e),0)}function bt(t,e,n,i,s,o,r){const a=t.slice(e,n),l=vt(a,i,s,o);return l>0?(l-r)**2*a.length:void 0}function Tt(t,e){const[n,i]=t;if(n===e)return t;if(void 0!==i&&void 0!==e&&void 0!==n&&e===i&&Math.abs(e-n)<=20){const s=Math.min(n,e),o=Math.max(n,e);return s===n&&o===i?t:[s,o]}return[e,n]}function xt(t,e,n){const[[i],o]=f(Tt,[n]),r=function(t){const[e,n]=w(t);return t===e||t&&e&&t.length===e.length&&!t.some((t,n)=>t!==e[n])?e:(n(t),t)}(e),l=a(void 0);return{containerRef:s(e=>{l.current?.disconnect(),l.current=void 0;const n=()=>o(function(t,e){let n=t?.clientWidth;if(void 0!==n&&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)),n=t.find((e,i)=>e<=n||i===t.length-1)}return n}(e,r));n(),e&&"undefined"!=typeof ResizeObserver&&(l.current=new ResizeObserver(n),l.current.observe(e)),"function"==typeof t?t(e):t&&(t.current=e)},[t,r]),containerWidth:i}}var _t=l(function({photos:t,breakpoints:e,defaultContainerWidth:n,...i},s){const{containerRef:r,containerWidth:a}=xt(s,e,n),{spacing:l,padding:c,targetRowHeight:d,minPhotos:h,maxPhotos:u,...m}=function(t,{photos:e,targetRowHeight:n,rowConstraints:i,...s}){const{spacing:o,padding:r,componentsProps:a,render:l}=pt(t,s),{singleRowMaxHeight:c,minPhotos:d,maxPhotos:h}=ht(i,t)||{};if(void 0!==c&&void 0!==o&&void 0!==r){const t=Math.floor(e.reduce((t,{width:e,height:n})=>t+e/n*c+2*r,o*(e.length-1)));t>0&&(a.container={...a.container},a.container.style={maxWidth:t,...a.container.style})}return{...s,targetRowHeight:ut(n,t,[t=>t/5,t=>t/4,t=>t/3,t=>t/2]),render:l,spacing:o,padding:r,minPhotos:d,maxPhotos:h,componentsProps:a}}(a,{photos:t,...i});return p(yt,{layout:"rows",ref:r,model:o(()=>void 0!==a&&void 0!==l&&void 0!==c&&void 0!==d?function(t,e,n,i,s,o,r){const a=Math.min(function(t,e,n,i){return mt(e/n/Math.min(...t.map(t=>lt(t))))+(i||0)+2}(t,i,s,o),r||1/0),l=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-l;o>=Math.max(0,m-a);o-=1){if(d[o]===1/0)continue;const r=bt(t,o,m,i,e,n,s);if(void 0===r)break;const a=d[o]+r;(d[m]===1/0||d[m]>a&&(d[m]/a>1.005||-1!==h[m]&&h[m]<o))&&(d[m]=a,h[m]=o)}if(d[c]===1/0)return;const u=[];for(let m=c;0!==m;m=h[m])u.push(m);u.push(0),u.reverse();const p=[];for(let m=1;m<u.length;m+=1){const s=t.slice(u[m-1],u[m]).map((t,e)=>({photo:t,index:u[m-1]+e})),o=vt(s.map(({photo:t})=>t),i,e,n);p.push({photos:s.map(({photo:t,index:e})=>({photo:t,index:e,width:o*lt(t),height:o}))})}return{spacing:e,padding:n,containerWidth:i,tracks:p,horizontal:!0}}(t,l,c,a,d,h,u):void 0,[t,l,c,a,d,h,u]),...m})});function qt(t,e,n,i,s,o,r){const a=[],l=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,n)=>({photo:e,index:t[c]+n})),h=r.reduce((t,e,n)=>t+(o[c]-o[n])*e,0),u=(s-(t.length-2)*n-2*(t.length-1)*i-h)*r[c]/l;a.push({photos:d.map(({photo:t,index:e})=>({photo:t,index:e,width:u,height:u/lt(t)})),variables:{adjustedGaps:h,columnRatio:r[c]}})}return{tracks:a,variables:{totalRatio:l}}}function kt(t,e,n,i,s,o){const r=[],a=[];if(t.length<=o){const s=t.length>0?t.reduce((t,e)=>t+lt(e),0)/t.length:1;for(let e=0;e<o;e+=1)r[e]=2*n,a[e]=e<t.length?lt(t[e]):s;return qt(Array.from({length:o+1},(e,n)=>Math.min(n,t.length)),t,e,n,i,r,a)}const l=(c=function(t,e,n,i,s){return o=>{const r=[],a=1.5*s;let l=i/lt(t[o])+2*n;for(let c=o+1;c<t.length+1&&(r.push([c,(s-l)**2]),!(l>a||c===t.length));c+=1)l+=i/lt(t[c])+e+2*n;return r}}(t,e,n,s,(t.reduce((t,e)=>t+s/lt(e),0)+e*(t.length-o)+2*n*t.length)/o),d=o,h=0,u=t.length,function(t,e,n){const i=[n];for(let s=n,o=e;o>0;o-=1)[s]=t.get(s)[o],i.push(s);return i.reverse()}(function(t,e,n,i){const s=/* @__PURE__ */new Map,o=/* @__PURE__ */new Set;o.add(n);for(let r=0;r<e;r+=1){const n=[...o.keys()];o.clear(),n.forEach(n=>{const a=r>0?s.get(n)[r][1]:0;t(n).forEach(([t,l])=>{let c=s.get(t);c||(c=[],s.set(t,c));const d=a+l,h=c[r+1];(!h||h[1]>d&&(h[1]/d>1.0001||n<h[0]))&&(c[r+1]=[n,d]),r<e-1&&t!==i&&o.add(t)})})}return s}(c,d,h,u),d,u));var c,d,h,u;for(let p=0;p<l.length-1;p+=1){const i=t.slice(l[p],l[p+1]);r[p]=e*(i.length-1)+2*n*i.length,a[p]=1/i.reduce((t,e)=>t+1/lt(e),0)}return qt(l,t,e,n,i,r,a)}function St(t,e,n,i,s){const{tracks:o,variables:r}=kt(t,e,n,i,(i-e*(s-1)-2*n*s)/s,s);return o.some(t=>t.photos.some(({width:t,height:e})=>t<=0||e<=0))?s>1?St(t,e,n,i,s-1):void 0:{tracks:o,spacing:e,padding:n,containerWidth:i,variables:{columns:s,...r}}}var It=l(function({photos:t,breakpoints:e,defaultContainerWidth:n,...i},s){const{containerRef:r,containerWidth:a}=xt(s,e,n),{spacing:l,padding:c,columns:d,...h}=function(t,{columns:e,...n}){return{...n,...pt(t,n),columns:ut(e,t,[5,4,3,2],1)}}(a,{photos:t,...i});return p(yt,{layout:"columns",ref:r,model:o(()=>void 0!==a&&void 0!==l&&void 0!==c&&void 0!==d?St(t,l,c,a,d):void 0,[t,l,c,a,d]),...h})});function Et(t,e,n,i,s){const o=(i-e*(s-1)-2*n*s)/s;if(o<=0)return s>1?Et(t,e,n,i,s-1):void 0;const r=[];for(let l=0;l<s;l+=1)r[l]=0;const a=t.reduce((t,i,s)=>{const a=r.reduce((t,e,n)=>e<r[t]-1?n:t,0);return r[a]=r[a]+o/lt(i)+e+2*n,t[a].push({photo:i,index:s}),t},Array.from({length:s},()=>[]));return{spacing:e,padding:n,containerWidth:i,variables:{columns:s},tracks:a.map(t=>({photos:t.map(({photo:t,index:e})=>({photo:t,index:e,width:o,height:o/lt(t)}))}))}}var Ct=l(function({photos:t,breakpoints:e,defaultContainerWidth:n,...i},s){const{containerRef:r,containerWidth:a}=xt(s,e,n),{spacing:l,padding:c,columns:d,...h}=function(t,{columns:e,...n}){return{...n,...pt(t,n),columns:ut(e,t,[5,4,3,2],1)}}(a,{photos:t,...i});return p(yt,{layout:"masonry",ref:r,model:o(()=>void 0!==a&&void 0!==l&&void 0!==c&&void 0!==d?Et(t,l,c,a,d):void 0,[t,l,c,a,d]),...h})});function Nt(t){return t?String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"):""}var Lt=class{constructor(t,e={}){this.lightbox=t,this.aiSummaryVisible=!1,this.currentSummary=null,this.options={aiSummaryButtonOrder:7,width:"400px",height:"300px",transition:"0.3s ease",...e},document.head.insertAdjacentHTML("beforeend",`<style>\n .pswp__ai-summary-panel {\n background: rgba(30, 30, 30, 0.9);\n color: white;\n position: absolute;\n overflow-y: auto;\n z-index: 1;\n transition: transform ${this.options.transition};\n box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);\n padding: 20px;\n }\n\n /* Desktop styles */\n @media (min-width: 768px) {\n .pswp__ai-summary-panel {\n top: 0;\n right: 0;\n height: 100%;\n width: ${this.options.width};\n transform: translateX(100%);\n }\n\n .pswp__ai-summary-panel.visible {\n transform: translateX(0);\n }\n\n .pswp__container.shifted-for-ai-summary {\n transform: translateX(-${this.options.width});\n transition: transform ${this.options.transition};\n }\n }\n\n /* Mobile styles */\n @media (max-width: 767px) {\n .pswp__ai-summary-panel {\n bottom: 0;\n left: 0;\n width: 100%;\n height: ${this.options.height};\n transform: translateY(100%);\n }\n\n .pswp__ai-summary-panel.visible {\n transform: translateY(0);\n }\n\n .pswp__container.shifted-for-ai-summary {\n transform: translateY(-${this.options.height});\n transition: transform ${this.options.transition};\n }\n }\n\n .pswp__ai-summary-close {\n position: absolute;\n top: 10px;\n right: 10px;\n width: 32px;\n height: 32px;\n opacity: 0.6;\n cursor: pointer;\n z-index: 2;\n background: rgba(0, 0, 0, 0.3);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: opacity 0.3s;\n }\n\n .pswp__ai-summary-close:hover {\n opacity: 1;\n }\n\n .pswp__ai-summary-close:before,\n .pswp__ai-summary-close:after {\n position: absolute;\n content: '';\n width: 16px;\n height: 2px;\n background-color: white;\n }\n\n .pswp__ai-summary-close:before {\n transform: rotate(45deg);\n }\n\n .pswp__ai-summary-close:after {\n transform: rotate(-45deg);\n }\n\n .pswp__ai-summary-content {\n margin-top: 20px;\n }\n\n .pswp__ai-summary-title {\n margin-bottom: 16px;\n font-size: 18px;\n font-weight: bold;\n padding-right: 30px; /* Add space for the close button */\n }\n\n .pswp__ai-summary-section {\n margin-bottom: 16px;\n }\n\n .pswp__ai-summary-section-title {\n font-weight: bold;\n margin-bottom: 8px;\n }\n\n .pswp__ai-summary-label {\n display: inline-flex;\n align-items: center;\n background: rgba(255, 255, 255, 0.1);\n border-radius: 12px;\n padding: 4px 12px;\n margin-right: 8px;\n margin-bottom: 8px;\n font-size: 14px;\n }\n\n .pswp__ai-summary-description {\n font-size: 14px;\n line-height: 1.5;\n }\n\n .pswp__ai-summary-empty {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n color: rgba(255, 255, 255, 0.6);\n font-style: italic;\n }\n\n .pswp__ai-summary-bing-search {\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 8px;\n z-index: 2;\n }\n\n .pswp__ai-summary-bing-button {\n height: 32px;\n background: rgba(255, 255, 255, 0.2);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: background-color 0.3s;\n }\n\n .pswp__ai-summary-bing-button:hover {\n background: rgba(255, 255, 255, 0.4);\n }\n\n .pswp__ai-summary-bing-icon {\n width: 20px;\n height: 20px;\n }\n\n .pswp__ai-summary-disclaimer {\n font-size: 12px;\n color: rgba(255, 255, 255, 0.7);\n text-align: center;\n margin-top: 32px;\n padding: 0 10px;\n line-height: 1.4;\n font-style: italic;\n }\n </style>`),t.on("init",()=>{this.initPswpEvents(t.pswp)})}initPswpEvents(t){t.on("uiRegister",()=>{t.ui.registerElement({name:"ai-summary-toggle-button",title:"Toggle AI summary view",order:this.options.aiSummaryButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24">\n <use class="pswp__icn-shadow" xlink:href="#pswp__icn-ai-summary"/>\n <path d="M12 17q.425 0 .713-.288T13 16v-4q0-.425-.288-.712T12 11t-.712.288T11 12v4q0 .425.288.713T12 17m0-8q.425 0 .713-.288T13 8t-.288-.712T12 7t-.712.288T11 8t.288.713T12 9m0 13q-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 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22m0-2q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20m0-8"/>\n </svg>',onClick:()=>{this.toggleAISummary(t)}}),t.ui.registerElement({name:"ai-summary-panel",isButton:!1,appendTo:"root",html:'<div class="pswp__ai-summary-panel"><div class="pswp__ai-summary-close"></div></div>'})}),t.on("change",()=>{this.aiSummaryVisible&&this.updateAISummary(t)}),t.on("close",()=>{this.hideAISummary(t)}),t.on("firstUpdate",()=>{const e=t.element.querySelector(".pswp__ai-summary-close");e&&e.addEventListener("click",()=>{this.hideAISummary(t)})})}toggleAISummary(t){this.aiSummaryVisible?this.hideAISummary(t):this.showAISummary(t)}showAISummary(t){const e=t.container,n=t.element.querySelector(".pswp__ai-summary-panel");n&&(this.aiSummaryVisible=!0,n.classList.add("visible"),e.classList.add("shifted-for-ai-summary"),this.updateAISummary(t))}hideAISummary(t){const e=t.container,n=t.element.querySelector(".pswp__ai-summary-panel");n&&(this.aiSummaryVisible=!1,n.classList.remove("visible"),e.classList.remove("shifted-for-ai-summary"))}updateAISummary(t){if(!t.currSlide)return;const e=t.element.querySelector(".pswp__ai-summary-panel");if(!e)return;const n=t.currSlide.data,i=n.src||n.url||"";let s=null;try{n.contentSummary&&(s=JSON.parse(n.contentSummary),this.currentSummary=s)}catch(r){console.error("Error parsing AI summary data:",r)}const o=i?`<a class="pswp__ai-summary-bing-search" href="https://www.bing.com/images/search?view=detailv2&iss=SBI&form=SBIIRP&sbisrc=UrlPaste&q=imgurl:${encodeURIComponent(i)}&idpbck=1&selectedindex=0&id=${encodeURIComponent(i)}&mediaurl=${encodeURIComponent(i)}" target="_blank" rel="noopener noreferrer" class="pswp__ai-summary-bing-button">\n <svg xmlns="http://www.w3.org/2000/svg" style="height:24px;width:24px" width="256" height="388" viewBox="0 0 256 388"><defs><radialGradient id="logosBing0" cx="93.717%" cy="77.818%" r="143.121%" fx="93.717%" fy="77.818%" gradientTransform="scale(-1 -.71954)rotate(49.091 2.036 -2.204)"><stop offset="0%" stop-color="#00cacc"/><stop offset="100%" stop-color="#048fce"/></radialGradient><radialGradient id="logosBing1" cx="13.893%" cy="71.448%" r="150.086%" fx="13.893%" fy="71.448%" gradientTransform="matrix(.55155 -.39387 .23634 .91917 -.107 .112)"><stop offset="0%" stop-color="#00bbec"/><stop offset="100%" stop-color="#2756a9"/></radialGradient><linearGradient id="logosBing2" x1="50%" x2="50%" y1="0%" y2="100%"><stop offset="0%" stop-color="#00bbec"/><stop offset="100%" stop-color="#2756a9"/></linearGradient></defs><path fill="url(#logosBing0)" d="M129.424 122.047c-7.133.829-12.573 6.622-13.079 13.928c-.218 3.147-.15 3.36 6.986 21.722c16.233 41.774 20.166 51.828 20.827 53.243c1.603 3.427 3.856 6.65 6.672 9.544c2.16 2.22 3.585 3.414 5.994 5.024c4.236 2.829 6.337 3.61 22.818 8.49c16.053 4.754 24.824 7.913 32.381 11.664c9.791 4.86 16.623 10.387 20.944 16.946c3.1 4.706 5.846 13.145 7.04 21.64c.468 3.321.47 10.661.006 13.663c-1.008 6.516-3.021 11.976-6.101 16.545c-1.638 2.43-1.068 2.023 1.313-.939c6.74-8.379 13.605-22.7 17.108-35.687c4.24-15.718 4.817-32.596 1.66-48.57c-6.147-31.108-25.786-57.955-53.444-73.06c-1.738-.95-8.357-4.42-17.331-9.085a1633 1633 0 0 1-4.127-2.154c-.907-.477-2.764-1.447-4.126-2.154c-1.362-.708-5.282-2.75-8.711-4.539l-8.528-4.446a6021 6021 0 0 1-8.344-4.357c-8.893-4.655-12.657-6.537-13.73-6.863c-1.125-.343-3.984-.782-4.701-.723c-.152.012-.838.088-1.527.168"/><path fill="url(#logosBing1)" d="M148.81 277.994c-.493.292-1.184.714-1.537.938c-.354.225-1.137.712-1.743 1.083a8315 8315 0 0 0-13.204 8.137a2848 2848 0 0 0-8.07 4.997a388 388 0 0 1-3.576 2.198c-.454.271-2.393 1.465-4.31 2.654a2652 2652 0 0 1-7.427 4.586a3958 3958 0 0 0-8.62 5.316a3011 3011 0 0 1-7.518 4.637c-1.564.959-3.008 1.885-3.21 2.058c-.3.257-14.205 8.87-21.182 13.121c-5.3 3.228-11.43 5.387-17.705 6.235c-2.921.395-8.45.396-11.363.003c-7.9-1.067-15.176-4.013-21.409-8.666c-2.444-1.826-7.047-6.425-8.806-8.8c-4.147-5.598-6.829-11.602-8.218-18.396c-.32-1.564-.622-2.884-.672-2.935c-.13-.13.105 2.231.528 5.319c.44 3.211 1.377 7.856 2.387 11.829c7.814 30.743 30.05 55.749 60.15 67.646c8.668 3.424 17.415 5.582 26.932 6.64c3.576.4 13.699.56 17.43.276c17.117-1.296 32.02-6.334 47.308-15.996c1.362-.86 3.92-2.474 5.685-3.585a877 877 0 0 0 4.952-3.14c.958-.615 2.114-1.341 2.567-1.614a91 91 0 0 0 2.018-1.268c.656-.424 3.461-2.2 6.235-3.944l11.092-7.006l3.809-2.406l.137-.086l.42-.265l.199-.126l2.804-1.771l9.69-6.121c12.348-7.759 16.03-10.483 21.766-16.102c2.392-2.342 5.997-6.34 6.176-6.848c.037-.104.678-1.092 1.424-2.197c3.036-4.492 5.06-9.995 6.064-16.484c.465-3.002.462-10.342-.005-13.663c-.903-6.42-2.955-13.702-5.167-18.339c-3.627-7.603-11.353-14.512-22.453-20.076c-3.065-1.537-6.23-2.943-6.583-2.924c-.168.009-10.497 6.322-22.954 14.03c-12.457 7.71-23.268 14.4-24.025 14.87s-2.056 1.263-2.888 1.764z"/><path fill="url(#logosBing2)" d="m.053 241.013l.054 53.689l.695 3.118c2.172 9.747 5.937 16.775 12.482 23.302c3.078 3.07 5.432 4.922 8.768 6.896c7.06 4.177 14.657 6.238 22.978 6.235c8.716-.005 16.256-2.179 24.025-6.928c1.311-.801 6.449-3.964 11.416-7.029l9.032-5.572v-127.4l-.002-58.273c-.002-37.177-.07-59.256-.188-60.988c-.74-10.885-5.293-20.892-12.948-28.461c-2.349-2.323-4.356-3.875-10.336-7.99a25160 25160 0 0 1-12.104-8.336L28.617 5.835C22.838 1.85 22.386 1.574 20.639.949C18.367.136 15.959-.163 13.67.084C6.998.804 1.657 5.622.269 12.171C.053 13.191.013 26.751.01 100.35l-.003 86.975H0z"/></svg>\n <span>Search on Bing</span>\n </a>\n <div class="pswp__ai-summary-disclaimer">\n These are AI generated summaries based on the content. Please verify the information before using it.\n </div>`:"";if(s){e.innerHTML=`<div class="pswp__ai-summary-close"></div>${this.renderAISummary(s)}${o}`;const n=e.querySelector(".pswp__ai-summary-close");n&&n.addEventListener("click",()=>{this.hideAISummary(t)})}else{e.innerHTML=`<div class="pswp__ai-summary-close"></div><div class="pswp__ai-summary-empty">No AI summary available for this content</div>${o}`;const n=e.querySelector(".pswp__ai-summary-close");n&&n.addEventListener("click",()=>{this.hideAISummary(t)})}}renderAISummary(t){let e='<div class="pswp__ai-summary-content">';return t.subject&&(e+=`<div class="pswp__ai-summary-title">${Nt(t.subject)}</div>`),t.labels&&Object.entries(t.labels).filter(([t,e])=>Array.isArray(e)&&e.length>0).forEach(([t,n])=>{e+=`\n <div class="pswp__ai-summary-section">\n <div class="pswp__ai-summary-section-title">${Nt(t.replace("_"," ").replace(/\b\w/g,t=>t.toUpperCase()))}</div>\n <div class="pswp__ai-summary-labels space-y-2">\n ${n.map(t=>`<span class="pswp__ai-summary-label">${Nt(t)}</span>`).join("")}\n </div>\n </div>\n `}),t.description&&(e+=`\n <div class="pswp__ai-summary-section">\n <div class="pswp__ai-summary-description">${Nt(t.description)}</div>\n </div>\n `),e+="</div>",e}},Mt='url("https://res.cloudinary.com/dectzk2b2/image/upload/v1736933014/black_rpie3v.png")',At=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)})}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=Mt,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=Mt,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,n=e.content.element;"video"===n?.tagName?.toLowerCase()&&(this.referenceVideoElement=n,this.registerVideoEvents(n,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,n=32)=>{if(!t||t.length<6||"undefined"==typeof document)return null;try{const i=$(t,e,n),s=document.createElement("canvas");s.width=e,s.height=n;const o=s.getContext("2d");if(!o)return null;const r=o.createImageData(e,n);return r.data.set(i),o.putImageData(r,0,0),s.toDataURL()}catch(i){return console.warn("[PhotoSwipeBackdrop] Failed to decode blurhash:",i),null}})(e.data.blurhash)||e.data.thumbnailUrl||e.data.src;this.backgroundElement.style.backgroundImage=t?`url("${t}")`:Mt,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})}};function Bt(t){return t?String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"):""}var Ot={[V.LINK]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h6q.425 0 .713.288T12 4t-.288.713T11 5H5v14h14v-6q0-.425.288-.712T20 12t.713.288T21 13v6q0 .825-.587 1.413T19 21zM19 6.4L10.4 15q-.275.275-.7.275T9 15t-.275-.7t.275-.7L17.6 5H15q-.425 0-.712-.288T14 4t.288-.712T15 3h5q.425 0 .713.288T21 4v5q0 .425-.288.713T20 10t-.712-.288T19 9z"/></svg>',[V.EMAIL]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><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 22zm0-7q1.25 0 2.125-.875T15 12t-.875-2.125T12 9t-2.125.875T9 12t.875 2.125T12 15"/></svg>',[V.PHONE]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M19.95 21q-3.125 0-6.175-1.362t-5.55-3.863t-3.862-5.55T3 4.05q0-.45.3-.75t.75-.3H8.1q.35 0 .625.238t.325.562l.65 3.5q.05.4-.025.675T9.4 8.45L6.975 10.9q.5.925 1.187 1.787t1.513 1.663q.775.775 1.625 1.438T13.1 17l2.35-2.35q.225-.225.588-.337t.712-.063l3.45.7q.35.1.575.363T21 15.9v4.05q0 .45-.3.75t-.75.3M6.025 9l1.65-1.65L7.25 5H5.025q.125 1.025.35 2.025T6.025 9m8.95 8.95q.975.425 1.988.675T19 18.95v-2.2l-2.35-.475zm0 0"/></svg>',[V.SMS]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="m6 18l-2.3 2.3q-.475.475-1.088.213T2 19.575V4q0-.825.588-1.412T4 2h16q.825 0 1.413.588T22 4v12q0 .825-.587 1.413T20 18zm-.85-2H20V4H4v13.125zM4 16V4zm4-5q.425 0 .713-.288T9 10t-.288-.712T8 9t-.712.288T7 10t.288.713T8 11m4 0q.425 0 .713-.288T13 10t-.288-.712T12 9t-.712.288T11 10t.288.713T12 11m4 0q.425 0 .713-.288T17 10t-.288-.712T16 9t-.712.288T15 10t.288.713T16 11"/></svg>',[V.WHATSAPP]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 258"><defs><linearGradient id="logosWhatsappIcon0" x1="50%" x2="50%" y1="100%" y2="0%"><stop offset="0%" stop-color="#1faf38"/><stop offset="100%" stop-color="#60d669"/></linearGradient><linearGradient id="logosWhatsappIcon1" x1="50%" x2="50%" y1="100%" y2="0%"><stop offset="0%" stop-color="#f9f9f9"/><stop offset="100%" stop-color="#fff"/></linearGradient></defs><path fill="url(#logosWhatsappIcon0)" d="M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004"/><path fill="url(#logosWhatsappIcon1)" d="M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z"/><path fill="#fff" d="M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64"/></svg>',[V.MESSENGER]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256"><defs><radialGradient id="logosMessenger0" cx="19.247%" cy="99.465%" r="108.96%" fx="19.247%" fy="99.465%"><stop offset="0%" stop-color="#09f"/><stop offset="60.975%" stop-color="#a033ff"/><stop offset="93.482%" stop-color="#ff5280"/><stop offset="100%" stop-color="#ff7061"/></radialGradient></defs><path fill="url(#logosMessenger0)" 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"/><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"/></svg>'},Rt=class{constructor(t,e,n){this.lightbox=t,this.captureAdImpression=e,this.captureAdClick=n,this.captionOn=!0,this.options={captionButtonOrder:8},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){t.on("uiRegister",()=>{t.ui.registerElement({name:"caption-toggle-button",title:"Toggle caption view",order:this.options.captionButtonOrder,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-caption"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-caption"/><path id="pswp__icn-show-caption" d="M5 20q-.825 0-1.412-.587T3 18V6q0-.825.588-1.412T5 4h14q.825 0 1.413.588T21 6v12q0 .825-.587 1.413T19 20zm0-2h14V6H5zm2-3h3q.425 0 .713-.288T11 14v-.5q0-.225-.15-.375t-.375-.15h-.45q-.225 0-.375.15t-.15.375h-2v-3h2q0 .225.15.375t.375.15h.45q.225 0 .375-.15T11 10.5V10q0-.425-.288-.712T10 9H7q-.425 0-.712.288T6 10v4q0 .425.288.713T7 15m10-6h-3q-.425 0-.712.288T13 10v4q0 .425.288.713T14 15h3q.425 0 .713-.288T18 14v-.5q0-.225-.15-.375t-.375-.15h-.45q-.225 0-.375.15t-.15.375h-2v-3h2q0 .225.15.375t.375.15h.45q.225 0 .375-.15T18 10.5V10q0-.425-.288-.712T17 9M5 18V6z"/><path id="pswp__icn-hide-caption" style="display:none" d="m9.025 9l1.5 1.5H7.5v3h2q0-.225.15-.375t.375-.15h.45q.225 0 .375.15t.15.375v.5q0 .425-.288.713T10 15H7q-.425 0-.712-.288T6 14v-4q0-.425.288-.712T7 9zM21 6v10q0 .5-.325.763t-.7.262t-.675-.262T19 16V6H8.975q-.5 0-.75-.312T7.975 5t.25-.687t.75-.313H19q.825 0 1.413.588T21 6m-3 8q0 .225-.088.438t-.262.337L16.375 13.5h.125q0-.225.15-.375t.375-.15h.45q.225 0 .375.15t.15.375zm-1-5q.425 0 .713.288T18 10v.5q0 .225-.15.375t-.375.15h-.45q-.225 0-.375-.15t-.15-.375h-2v1.125l-1.5-1.5V10q0-.425.288-.712T14 9zM5 20q-.825 0-1.412-.587T3 18V6q0-.625.338-1.112t.862-.713L6.025 6H5v12h10.175L1.375 4.225q-.3-.3-.3-.712t.3-.713t.713-.3t.712.3l18.375 18.375q.3.3.3.713t-.3.712t-.712.3t-.713-.3L17.175 20z"/></svg>',onClick:()=>{this.toggleCaption(t)}}),t.ui.registerElement({name:"custom-caption",isButton:!1,appendTo:"root",html:'<div id="pswp-caption-container" class=" absolute bottom-0 w-full bg-transparent"></div>'})}),t.on("change",()=>{this.captionOn&&this.updateCaption(t)}),t.on("close",()=>{this.clearCaption()})}toggleCaption(t){this.captionOn?this.clearCaption():this.updateCaption(t),this.captionOn=!this.captionOn;const e=this.querySelector("#pswp__icn-show-caption"),n=this.querySelector("#pswp__icn-hide-caption");e&&(e.style.display=this.captionOn?"inline":"none"),n&&(n.style.display=this.captionOn?"none":"inline")}createCaptionHTML(t){const{id:e,type:n,caption:i,title:s,description:o,targetType:r,targetText:a,targetUrl:l}=t||{},c=Boolean(r)&&String(r)!==String(V.NONE),d=c?r:V.LINK;switch("ad"===n&&this.captureAdImpression&&this.captureAdImpression(e),n){case"image":case"video":return i?.length>0?`\n <div class=" w-full bg-black/50 p-4 text-gray-300">\n <h3 class=" text-center sm:text-lg">${Bt(i)}</h3>\n </div>\n `:"";case"ad":return`\n <div class=" w-full bg-black/85 p-4 text-white">\n <div class=" mx-auto w-full max-w-2xl space-y-2 text-center">\n <h3 class=" text-center sm:text-lg">${Bt(s)}</h3>\n <h4 class=" pb-2 text-center text-sm sm:text-base">${Bt(o)}</h4>\n ${c?`<button\n class=" flex w-full items-center justify-center gap-3 rounded-md bg-white py-1 text-lg text-black caption-action-button"\n data-id="${Bt(e)}"\n data-target-type="${Bt(d)}"\n data-target-url="${Bt(l)}">\n ${Ot[d]}\n ${Bt(a)}\n </button>`:""}\n </div>\n </div>\n `;default:return""}}updateCaption(t){try{const e=this.getElementById("pswp-caption-container");if(!e)return;const n=t.currSlide?.data;e.innerHTML=this.createCaptionHTML(n);const i=e.querySelector(".caption-action-button");i&&i.addEventListener("click",t=>{const e=t.currentTarget.dataset.id,n=t.currentTarget.dataset.targetType,i=t.currentTarget.dataset.targetUrl;this.captureAdClick&&e&&this.captureAdClick(e,n,i)})}catch(e){console.error("Error rendering caption:",e)}}clearCaption(){const t=this.getElementById("pswp-caption-container");t&&(t.innerHTML="")}},Vt=({contents:t=[],selectedIndex:e,onClick:n})=>{const i=a(null);g(()=>{i.current&&s(e)},[e,i.current]);const s=t=>{if(!i.current)return;const e=i.current,n=e.children;if(t<0||t>=n.length)return;const s=n[t],o=e.offsetWidth/2,r=s.offsetLeft+s.offsetWidth/2-o;e.scrollTo({left:r,behavior:"smooth"})};/* @__PURE__ */
2
2
  return p("div",{ref:i,className:"scrollbar-hide flex h-28 w-auto items-center justify-center overflow-x-auto bg-black/50",style:{scrollBehavior:"smooth",userSelect:"none",whiteSpace:"nowrap"},children:t.map((t,i)=>/* @__PURE__ */p("button",{className:"relative mx-0.5 inline-block lg:mx-1.5",onClick:()=>((t,e)=>{n(e)})(0,i),children:[
3
3
  /* @__PURE__ */p(H,{wrapperClassName:C("h-16 w-24 rounded-md lg:h-20 lg:w-20",i===e&&"border-2 border-[#ff4800]"),src:t.thumbnailUrl,placeholderSrc:t.blurImageUrl,alt:t.caption}),t.type===T.VIDEO&&/* @__PURE__ */p("div",{className:"absolute top-0 left-0 flex size-full items-center justify-center opacity-75",children:/* @__PURE__ */p("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-6 text-white lg:size-9",viewBox:"0 0 24 24",children:/* @__PURE__ */p("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"})})}),t.type===T.AD&&/* @__PURE__ */p("div",{className:"absolute top-1 left-1 text-xs",children:"Ad"})]},`filmstrip-thumbnail-${i}`))})},zt=class{constructor(t){this.lightbox=t,this.filmstripVisible=!0,this.options={filmstripButtonOrder:7},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){t.on("uiRegister",()=>{t.ui.registerElement({name:"filmstrip-toggle-button",title:"Toggle filmstrip view",order:this.options.filmstripButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24" id="pswp__icn-show-filmstrip"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-show-filmstrip"/>\n <path\n 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\n 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"\n\n style="stroke-width:0.199771" />\n <path\n\n 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"\n\n style="stroke-width:0.199771" />\n <path\n\n 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"\n\n style="stroke-width:0.199771" />\n </svg>\n <svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24" id="pswp__icn-hide-filmstrip" style="display:none"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-filmstrip"/>\n <path\n 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 />\n <path\n\n 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"\n\n style="stroke-width:0.199771" />\n <path\n\n 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"\n\n style="stroke-width:0.199771" />\n <path\n\n 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"\n\n style="stroke-width:0.199771" />\n </svg>\n\n ',onClick:()=>{this.toggleFilmstrip()}}),t.ui.registerElement({name:"filmstrip",isButton:!1,appendTo:"root",html:'\n <div id="filmstrip-container" class="w-full absolute bottom-0">\n </div>\n '})}),t.on("change",()=>{this.filmstripVisible&&this.updateFilmstrip(t)}),t.on("close",()=>{this.cleanupFilmstrip()})}onThumbnailClcik(t){this.lightbox.pswp.goTo(t)}updateFilmstrip(t){const e=this.getElementById("filmstrip-container");if(!e)return;n(/* @__PURE__ */p(Vt,{contents:t?.options?.dataSource?.items?.map(t=>({id:t.getAttribute("data-pswp-id"),type:t.getAttribute("data-pswp-type"),thumbnailUrl:t.getAttribute("data-pswp-thumbnail-url"),blurImageUrl:t.getAttribute("data-pswp-blur-image-url")||t.getAttribute("data-pswp-blurhash")})),selectedIndex:t.currSlide.index,onClick:t=>this.onThumbnailClcik(t)}),e);const i=this.getElementById("pswp-caption-container");i&&"7rem"!==i.style.bottom&&(i.style.bottom="7rem")}toggleFilmstrip(){this.filmstripVisible?this.cleanupFilmstrip():this.updateFilmstrip(this.lightbox.pswp),this.filmstripVisible=!this.filmstripVisible;const t=this.querySelector("#pswp__icn-show-filmstrip"),e=this.querySelector("#pswp__icn-hide-filmstrip");t&&(t.style.display=this.filmstripVisible?"inline":"none"),e&&(e.style.display=this.filmstripVisible?"none":"inline")}cleanupFilmstrip(){const t=this.getElementById("filmstrip-container"),e=this.getElementById("pswp-caption-container");e&&(e.style.bottom="0"),t&&n(null,t)}},Pt=class{constructor(t){this.lightbox=t,this.fullscreen=!1,this.options={fullScreenButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}initPswpEvents(t){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),document.querySelector("#pswp__icn-exit-fullscreen").style.display=this.fullscreen?"inline":"none",document.querySelector("#pswp__icn-fullscreen").style.display=this.fullscreen?"none":"inline"}},Dt=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),document.head.insertAdjacentHTML("beforeend",`<style>.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}</style>`),this.slideshowIsRunning=!1,this.slideshowTimerID=null,this.wakeLockIsRunning=!1,this.wakeLockSentinel=null,this.lightbox.on("init",()=>{this.init(this.lightbox.pswp)})}init(t){t.on("uiRegister",()=>{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()),document.querySelector("#pswp__icn-stop").style.display=this.slideshowIsRunning?"inline":"none",document.querySelector("#pswp__icn-play").style.display=this.slideshowIsRunning?"none":"inline",document.querySelector(".pswp__progress-bar").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=document.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 n=e.duration,i=e.currentTime;return isNaN(n)||isNaN(i)?this.options.defaultDelayMs:1e3*(n-i)}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=document.querySelector(".pswp__progress-bar");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)}},$t={videoAttributes:{controls:"",playsinline:"",muted:"",preload:"auto"},autoplay:!0,preventDragOffset:40};function Ht(t){return t&&t.data&&"video"===t.data.type}var Ft=class{constructor(t,e){this.options=e,this.initLightboxEvents(t),t.on("init",()=>{this.initPswpEvents(t.pswp)})}initLightboxEvents(t){t.on("contentLoad",this.onContentLoad.bind(this)),t.on("contentDestroy",this.onContentDestroy.bind(this)),t.on("contentActivate",this.onContentActivate.bind(this)),t.on("contentDeactivate",this.onContentDeactivate.bind(this)),t.on("contentAppend",this.onContentAppend.bind(this)),t.on("contentResize",this.onContentResize.bind(this)),t.addFilter("isKeepingPlaceholder",this.isKeepingPlaceholder.bind(this)),t.addFilter("isContentZoomable",this.isContentZoomable.bind(this)),t.addFilter("useContentPlaceholder",this.useContentPlaceholder.bind(this)),t.addFilter("domItemData",(t,e,n)=>("video"===t.type&&n&&(n.dataset.pswpVideoSources?t.videoSources=JSON.parse(n.dataset.pswpVideoSources):n.dataset.pswpVideoSrc?t.videoSrc=n.dataset.pswpVideoSrc:t.videoSrc=n.href),t))}initPswpEvents(t){t.on("pointerDown",e=>{const n=t.currSlide;if(Ht(n)&&this.options.preventDragOffset){const i=e.originalEvent;if("pointerdown"===i.type){const s=Math.ceil(n.height*n.currZoomLevel)+n.bounds.center.y,o=i.pageY-t.offset.y;o>s-this.options.preventDragOffset&&o<s&&e.preventDefault()}}}),t.on("appendHeavy",t=>{Ht(t.slide)&&!t.slide.isActive&&t.preventDefault()}),t.on("close",()=>{Ht(t.currSlide.content)&&this.pauseVideo(t.currSlide.content)})}onContentDestroy({content:t}){Ht(t)&&t._videoPosterImg&&(t._videoPosterImg.onload=t._videoPosterImg.onerror=null,t._videoPosterImg=null)}onContentResize(t){if(Ht(t.content)){t.preventDefault();const e=t.width,n=t.height,i=t.content;if(i.element&&(i.element.style.width=`${e}px`,i.element.style.height=`${n}px`),i.slide&&i.slide.placeholder){const t=i.slide.placeholder.element.style;t.transform="none",t.width=`${e}px`,t.height=`${n}px`}}}isKeepingPlaceholder(t,e){return!Ht(e)&&t}isContentZoomable(t,e){return!Ht(e)&&t}onContentActivate({content:t}){Ht(t)&&this.options.autoplay&&this.playVideo(t)}onContentDeactivate({content:t}){Ht(t)&&this.pauseVideo(t)}onContentAppend(t){Ht(t.content)&&(t.preventDefault(),t.content.isAttached=!0,t.content.appendImage())}onContentLoad(t){const e=t.content;if(Ht(t.content)&&(t.preventDefault(),!e.element)){if(e.state="loading",e.type="video",e.element=document.createElement("video"),this.options.videoAttributes)for(let t in this.options.videoAttributes)e.element.setAttribute(t,this.options.videoAttributes[t]||"");e.element.setAttribute("poster",e.data.msrc),this.preloadVideoPoster(e,e.data.msrc),e.element.style.position="relative",e.element.style.left=0,e.element.style.top=0,e.data.videoSources?e.data.videoSources.forEach(t=>{let n=document.createElement("source");n.src=t.src,n.type=t.type,e.element.appendChild(n)}):e.data.videoSrc&&(e.element.src=e.data.videoSrc)}}preloadVideoPoster(t,e){!t._videoPosterImg&&e&&(t._videoPosterImg=new Image,t._videoPosterImg.src=e,t._videoPosterImg.complete?t.onLoaded():t._videoPosterImg.onload=t._videoPosterImg.onerror=()=>{t.onLoaded()})}playVideo(t){t.element&&t.element.play()}pauseVideo(t){t.element&&t.element.pause()}useContentPlaceholder(t,e){return!!Ht(e)||t}},Ut=class{constructor(t,e={}){new Ft(t,{...$t,...e})}},jt=({open:t,ad:e,onClose:n,captureAdClick:i})=>{const s=Boolean(e?.targetType&&e.targetType!==V.NONE);/* @__PURE__ */
4
4
  return p(F,{open:Boolean(t&&e),onOpenChange:t=>!t&&n?.(),children:/* @__PURE__ */p(J,{className:"border-none p-0",children:[/* @__PURE__ */p(Y,{className:"hidden",children:[/* @__PURE__ */p(it,{children:e?.title}),/* @__PURE__ */p(et,{children:e?.description})]}),/* @__PURE__ */p("div",{className:"flex max-w-2xl flex-col overflow-hidden",children:[
@@ -6,15 +6,15 @@ return p(F,{open:Boolean(t&&e),onOpenChange:t=>!t&&n?.(),children:/* @__PURE__ *
6
6
  /* @__PURE__ */p("div",{className:"flex flex-col gap-2 p-3",children:[/* @__PURE__ */p(W,{variant:"h4",align:"center",lines:2,children:e?.title}),/* @__PURE__ */p(W,{variant:"body3",color:"secondary",align:"center",lines:4,children:e?.description})]}),s&&/* @__PURE__ */p(st,{fullWidth:!0,className:"rounded-none",onClick:()=>{i?.(e?._id,e?.targetType??V.LINK,e?.targetUrl),n?.()},iconName:_[e?.targetType]??_[V.LINK],children:e?.targetText})]})]})})},Wt=({style:t,content:e,curateLink:n,onAdClick:i})=>{const{captureAdImpression:s,captureAdEngagement:o,captureAdClick:r}=j(),a=Boolean(n&&i),l=e.ctaBg||"#ff4800",c=e.ctaForeground||"#FFFFFF";/* @__PURE__ */
7
7
  return p("div",{style:t,className:"group relative mb-1 overflow-hidden rounded",children:[
8
8
  /* @__PURE__ */p(P,{className:"size-full",threshold:.8,triggerOnce:!0,onChange:t=>{t&&s(e._id)},onClick:()=>o(e._id),children:/* @__PURE__ */p(tt,{url:e.src||e.imageUrl,thumbnailUrl:e.src||e.imageUrl,blurhash:e.blurhash,alt:e.caption,onClick:a?i:void 0,pswpData:{id:e._id,type:T.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}})}),
9
- /* @__PURE__ */p("span",{className:"bg-background/70 absolute top-1 right-1 rounded px-1 text-xs font-medium",children:"Ad"}),(e.title||e.targetType!==V.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 leading-snug font-medium",children:e.title})}),e?.targetType!==V.NONE&&/* @__PURE__ */p("button",{className:"flex w-full items-center justify-center gap-2 rounded-none border-0 py-2 text-nowrap",style:{backgroundColor:l,color:c},onClick:()=>{a?i?.():r(e._id,e.targetType,e.targetUrl)},children:[/* @__PURE__ */p(ot,{style:{color:c},icon:_[e?.targetType??V.LINK]}),e?.targetText]})]})]})},Gt=({style:t,gamConfig:e,slotIndex:n,eventId:i,organizationId:s})=>{const o=a(null),r=a(null),{trackGamAnalytics:l}=j(),c=`gam-slot-${i??"ev"}-${n}`,d=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)),h=a({w:d,h:u});return g(()=>{let t=!1,n=null,a=null,d=null,u=null;return(async()=>{await G(),!t&&o.current&&window.googletag.cmd.push(()=>{if(t)return;X(c);const{w:p,h:m}=h.current,g=[[p,m],...e.sizes],f=window.googletag.defineSlot(e.adUnitPath,g,c)?.addService(window.googletag.pubads());if(!f)return;r.current=f,a=window.googletag.pubads(),i?f.setConfig({targeting:{qrati_event:i,...e.categories.length>0?{qrati_category:e.categories}:{}}}):e.categories.length>0&&f.setConfig({targeting:{qrati_category:e.categories}}),d=t=>{t.slot===f&&l({eventId:i,organizationId:s,type:z.GAM_IMPRESSION,creativeId:String(t.creativeId??""),lineItemId:String(t.lineItemId??""),advertiserId:String(t.advertiserId??""),isEmpty:t.isEmpty??!1})},a.addEventListener("slotRenderEnded",d),u=t=>{t.slot===f&&l({eventId:i,organizationId:s,type:z.GAM_VIEWABLE})},a.addEventListener("impressionViewable",u);const w=o.current;w&&(n=U({container:w,onClick:()=>{l({eventId:i,organizationId:s,type:z.GAM_CLICK})}}),Q(),window.googletag.display(c))})})(),()=>{t=!0,n?.(),a&&"function"==typeof a.removeEventListener&&(d&&a.removeEventListener("slotRenderEnded",d),u&&a.removeEventListener("impressionViewable",u));const e=r.current;r.current=null,e&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([e])})}},[i,e.adUnitPath,e.categories,s,c]),/* @__PURE__ */p("div",{style:{width:d,height:u},className:"relative overflow-hidden rounded bg-neutral-100 dark:bg-neutral-800","data-gam-slot-index":n,children:/* @__PURE__ */p("div",{id:c,ref:o,style:{width:d,height:u},className:"gam-ad-slot"})})},Kt=t(null),Yt=()=>{const t=e(Kt);if(!t)throw new Error("Popover components must be used within a Popover");return t},Qt=({children:t,className:e,open:n,onOpenChange:i})=>{const[s,o]=w(!1),l="boolean"==typeof n,c=l?n:s,d=r(),u=`popover-trigger-${d}`,h=`popover-content-${d}`,m=a(null);/* @__PURE__ */
10
- return p(Kt.Provider,{value:{isOpen:c,setIsOpen:t=>{l||o(t),i?.(t)},triggerId:u,contentId:h,triggerRef:m},children:/* @__PURE__ */p("div",{"data-slot":"popover",className:C("relative inline-block",e),children:t})})},Zt=({children:t,asChild:e,className:n,onClick:i,...s})=>{const{isOpen:o,setIsOpen:r,triggerId:a,contentId:l,triggerRef:c}=Yt();if(g(()=>{if(!e)return;const t=document.getElementById(a);return c.current=t,()=>{c.current===t&&(c.current=null)}},[e,a,c]),e){const e=Array.isArray(t)?t[0]:t;if(e&&e.type){const t=e.props?.className;return d(e,{id:a,className:n?t?`${t} ${n}`:n:t,"aria-haspopup":"dialog","aria-expanded":o,"aria-controls":o?l:void 0,onClick:t=>{r(!o),e.props?.onClick?.(t)},"data-state":o?"open":"closed"})}}/* @__PURE__ */
11
- return p("button",{ref:c,id:a,type:"button","aria-haspopup":"dialog","aria-expanded":o,"aria-controls":o?l:void 0,"data-slot":"popover-trigger","data-state":o?"open":"closed",className:n,onClick:t=>{r(!o),i?.(t)},...s,children:t})},Jt=({children:t,className:e,align:n="center",side:i="top",sideOffset:s=4,...o})=>{const{isOpen:r,setIsOpen:l,contentId:c,triggerRef:d}=Yt(),{organization:h,portalContainer:f}=A(),y=a(null),[v,b]=w(null);if(m(()=>{if(!r)return;const t=()=>{if(!d.current||!y.current)return;const t=d.current.getBoundingClientRect(),e=y.current.getBoundingClientRect();let o=t.left,r=t.bottom+s;"center"===n&&(o=t.left+t.width/2-e.width/2),"end"===n&&(o=t.right-e.width),"top"===i&&(r=t.top-e.height-s),"left"===i&&(o=t.left-e.width-s,r=t.top+t.height/2-e.height/2),"right"===i&&(o=t.right+s,r=t.top+t.height/2-e.height/2),"bottom"===i&&(r=t.bottom+s),b({top:r,left:o})},e=requestAnimationFrame(t);return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{cancelAnimationFrame(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[n,r,i,s,d]),g(()=>{if(!r)return;const t=t=>{const e=t.target;y.current&&!y.current.contains(e)&&d.current&&!d.current.contains(e)&&l(!1)},e=t=>{"Escape"===t.key&&(l(!1),d.current?.focus())},n=window.setTimeout(()=>{document.addEventListener("mousedown",t)},0);return document.addEventListener("keydown",e),()=>{window.clearTimeout(n),document.removeEventListener("mousedown",t),document.removeEventListener("keydown",e)}},[r,l,d]),!r)return null;const T=/* @__PURE__ */p("div",{ref:y,id:c,role:"dialog","aria-modal":"false","data-state":r?"open":"closed",className:C("bg-background text-foreground border-border shadow-outer rounded outline-none",e),style:{position:"fixed",top:v?.top??0,left:v?.left??0,zIndex:2010,...E(h)},...o,children:t});return"undefined"!=typeof document?u(T,f??document.body):T},Xt=({eventId:t,contentId:e,emojis:n=[],counts:i={},userReaction:o})=>{const{user:r,props:l,organization:c}=A(),d=l?.loginUrl,{handleReactionClick:u,isPending:m}=(()=>{const t=k(),{props:e,user:n}=A(),i=e?.organizationId,o=function(t){const e=k(void 0),[n]=w(()=>new rt(e,t));g(()=>{n.setOptions(t)},[n,t]);const i=h(s(t=>n.subscribe(S.batchCalls(t)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),o=s((t,e)=>{n.mutate(t,e).catch(I)},[n]);if(i.error&&N(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}({mutationFn:async({eventId:t,contentId:e,emoji:s})=>{await B.post(y.UPDATE_REACTION,{json:{eventId:t,contentId:e,reaction:s},headers:{"x-org-id":i,Authorization:`Bearer ${n?.token}`}})},onMutate:async({eventId:e,contentId:n,emoji:i})=>{const s=[v.CONTENTS_BY_EVENT(e)];await t.cancelQueries({queryKey:s});const o=t.getQueriesData({queryKey:s});return t.setQueriesData({queryKey:s},t=>((t,e,n)=>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 i={...t.reactionCounts??{}};return t.userReaction&&t.userReaction!==n&&(i[t.userReaction]=Math.max(0,(i[t.userReaction]??1)-1)),t.userReaction===n?(i[n]=Math.max(0,(i[n]??1)-1),{...t,reactionCounts:i,userReaction:void 0}):(i[n]=(i[n]??0)+1,{...t,reactionCounts:i,userReaction:n})})}:t)}:t)(t,n,i)),{previousData:o}},onError:(e,n,i)=>{i?.previousData?.forEach(([e,n])=>{t.setQueryData(e,n)}),K.error("Failed to add reaction"),console.error("Error handling reaction click:",e,n)},onSettled:async(e,n,i)=>{await t.invalidateQueries({queryKey:[v.CONTENTS_BY_EVENT(i.eventId)]})}});return{handleReactionClick:async(t,e,i)=>{if(!t||!e||!i)return!1;if(!n)return K.error("Please login to react"),!1;try{return await o.mutateAsync({eventId:t,contentId:e,emoji:i}),!0}catch(s){return!1}},isPending:o.isPending}})(),[f,b]=w(!1),[T,x]=w(null),_=a(null),E=Object.values(i).reduce((t,e)=>t+e,0);return g(()=>()=>{_.current&&clearTimeout(_.current)},[]),/* @__PURE__ */p(Qt,{open:f,onOpenChange:b,children:[/* @__PURE__ */p(Zt,{asChild:!0,children:/* @__PURE__ */p("button",{type:"button",className:C("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",T&&"scale-[1.03] shadow-sm"),children:[(n||[]).slice().sort((t,e)=>(i[e]||0)-(i[t]||0)).slice(0,1).map(t=>/* @__PURE__ */p("span",{className:C("text-sm transition-transform duration-150 ease-out sm:text-lg",T===(o||t)&&"scale-125"),children:o||t},`${e}-${t}-1`)),E>0&&/* @__PURE__ */p("span",{className:"text-xs font-bold sm:text-sm",children:E||0})]})}),/* @__PURE__ */p(Jt,{side:"top",align:"end",children:[r?null:/* @__PURE__ */p("div",c?.customAuth?{className:"p-2 font-semibold",children:["Please"," ",
9
+ /* @__PURE__ */p("span",{className:"bg-background/70 absolute top-1 right-1 rounded px-1 text-xs font-medium",children:"Ad"}),(e.title||e.targetType!==V.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 leading-snug font-medium",children:e.title})}),e?.targetType!==V.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:l,color:c},onClick:()=>{a?i?.():r(e._id,e.targetType,e.targetUrl)},children:[/* @__PURE__ */p(ot,{style:{color:c},icon:_[e?.targetType??V.LINK]}),e?.targetText]})]})]})},Gt=({style:t,gamConfig:e,slotIndex:n,eventId:i,organizationId:s})=>{const o=a(null),r=a(null),{trackGamAnalytics:l}=j(),c=`gam-slot-${i??"ev"}-${n}`,d=Math.max(1,Math.round(t?.width||e.sizes[0]?.[0]||300)),h=Math.max(1,Math.round(t?.height||e.sizes[0]?.[1]||250)),u=a({w:d,h:h});return g(()=>{let t=!1,n=null,a=null,d=null,h=null;return(async()=>{await G(),!t&&o.current&&window.googletag.cmd.push(()=>{if(t)return;X(c);const{w:p,h:m}=u.current,g=[[p,m],...e.sizes],f=window.googletag.defineSlot(e.adUnitPath,g,c)?.addService(window.googletag.pubads());if(!f)return;r.current=f,a=window.googletag.pubads(),i?f.setConfig({targeting:{qrati_event:i,...e.categories.length>0?{qrati_category:e.categories}:{}}}):e.categories.length>0&&f.setConfig({targeting:{qrati_category:e.categories}}),d=t=>{t.slot===f&&l({eventId:i,organizationId:s,type:z.GAM_IMPRESSION,creativeId:String(t.creativeId??""),lineItemId:String(t.lineItemId??""),advertiserId:String(t.advertiserId??""),isEmpty:t.isEmpty??!1})},a.addEventListener("slotRenderEnded",d),h=t=>{t.slot===f&&l({eventId:i,organizationId:s,type:z.GAM_VIEWABLE})},a.addEventListener("impressionViewable",h);const w=o.current;w&&(n=U({container:w,onClick:()=>{l({eventId:i,organizationId:s,type:z.GAM_CLICK})}}),Q(),window.googletag.display(c))})})(),()=>{t=!0,n?.(),a&&"function"==typeof a.removeEventListener&&(d&&a.removeEventListener("slotRenderEnded",d),h&&a.removeEventListener("impressionViewable",h));const e=r.current;r.current=null,e&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([e])})}},[i,e.adUnitPath,e.categories,s,c]),/* @__PURE__ */p("div",{style:{width:d,height:h},className:"relative overflow-hidden rounded bg-neutral-100 dark:bg-neutral-800","data-gam-slot-index":n,children:/* @__PURE__ */p("div",{id:c,ref:o,style:{width:d,height:h},className:"gam-ad-slot"})})},Kt=t(null),Yt=()=>{const t=e(Kt);if(!t)throw new Error("Popover components must be used within a Popover");return t},Qt=({children:t,className:e,open:n,onOpenChange:i})=>{const[s,o]=w(!1),l="boolean"==typeof n,c=l?n:s,d=r(),h=`popover-trigger-${d}`,u=`popover-content-${d}`,m=a(null);/* @__PURE__ */
10
+ return p(Kt.Provider,{value:{isOpen:c,setIsOpen:t=>{l||o(t),i?.(t)},triggerId:h,contentId:u,triggerRef:m},children:/* @__PURE__ */p("div",{"data-slot":"popover",className:C("relative inline-block",e),children:t})})},Zt=({children:t,asChild:e,className:n,onClick:i,...s})=>{const{isOpen:o,setIsOpen:r,triggerId:a,contentId:l,triggerRef:c}=Yt();if(e){const e=Array.isArray(t)?t[0]:t;if(e&&e.type){const t=e.props?.className;return d(e,{ref:t=>{c.current=t},id:a,className:n?t?`${t} ${n}`:n:t,"aria-haspopup":"dialog","aria-expanded":o,"aria-controls":o?l:void 0,onClick:t=>{r(!o),e.props?.onClick?.(t)},"data-state":o?"open":"closed"})}}/* @__PURE__ */
11
+ return p("button",{ref:c,id:a,type:"button","aria-haspopup":"dialog","aria-expanded":o,"aria-controls":o?l:void 0,"data-slot":"popover-trigger","data-state":o?"open":"closed",className:n,onClick:t=>{r(!o),i?.(t)},...s,children:t})},Jt=({children:t,className:e,align:n="center",side:i="top",sideOffset:s=4,...o})=>{const{isOpen:r,setIsOpen:l,contentId:c,triggerRef:d}=Yt(),{organization:u,portalContainer:f}=A(),y=a(null),[v,b]=w(null);if(m(()=>{if(!r)return;const t=()=>{if(!d.current||!y.current)return;const t=d.current.getBoundingClientRect(),e=y.current.getBoundingClientRect();let o=t.left,r=t.bottom+s;"center"===n&&(o=t.left+t.width/2-e.width/2),"end"===n&&(o=t.right-e.width),"top"===i&&(r=t.top-e.height-s),"left"===i&&(o=t.left-e.width-s,r=t.top+t.height/2-e.height/2),"right"===i&&(o=t.right+s,r=t.top+t.height/2-e.height/2),"bottom"===i&&(r=t.bottom+s),b({top:r,left:o})},e=requestAnimationFrame(t);return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{cancelAnimationFrame(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[n,r,i,s,d]),g(()=>{if(!r)return;const t=t=>{const e="function"==typeof t.composedPath?t.composedPath():[],n=t.target,i=y.current&&(y.current.contains(n)||e.includes(y.current)),s=d.current&&(d.current.contains(n)||e.includes(d.current));i||s||l(!1)},e=t=>{"Escape"===t.key&&(l(!1),d.current?.focus())},n=window.setTimeout(()=>{document.addEventListener("mousedown",t)},0);return document.addEventListener("keydown",e),()=>{window.clearTimeout(n),document.removeEventListener("mousedown",t),document.removeEventListener("keydown",e)}},[r,l,d]),!r)return null;const T=/* @__PURE__ */p("div",{ref:y,id:c,role:"dialog","aria-modal":"false","data-state":r?"open":"closed",className:C("bg-background text-foreground border-border shadow-outer rounded outline-none",e),style:{position:"fixed",top:v?.top??0,left:v?.left??0,zIndex:2010,...E(u)},...o,children:t});return"undefined"!=typeof document?h(T,f??document.body):T},Xt=({eventId:t,contentId:e,emojis:n=[],counts:i={},userReaction:o})=>{const{user:r,props:l,organization:c}=A(),d=l?.loginUrl,{handleReactionClick:h,isPending:m}=(()=>{const t=k(),{props:e,user:n}=A(),i=e?.organizationId,o=function(t){const e=k(void 0),[n]=w(()=>new rt(e,t));g(()=>{n.setOptions(t)},[n,t]);const i=u(s(t=>n.subscribe(S.batchCalls(t)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),o=s((t,e)=>{n.mutate(t,e).catch(I)},[n]);if(i.error&&N(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}({mutationFn:async({eventId:t,contentId:e,emoji:s})=>{await B.post(y.UPDATE_REACTION,{json:{eventId:t,contentId:e,reaction:s},headers:{"x-org-id":i,Authorization:`Bearer ${n?.token}`}})},onMutate:async({eventId:e,contentId:n,emoji:i})=>{const s=[v.CONTENTS_BY_EVENT(e)];await t.cancelQueries({queryKey:s});const o=t.getQueriesData({queryKey:s});return t.setQueriesData({queryKey:s},t=>((t,e,n)=>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 i={...t.reactionCounts??{}};return t.userReaction&&t.userReaction!==n&&(i[t.userReaction]=Math.max(0,(i[t.userReaction]??1)-1)),t.userReaction===n?(i[n]=Math.max(0,(i[n]??1)-1),{...t,reactionCounts:i,userReaction:void 0}):(i[n]=(i[n]??0)+1,{...t,reactionCounts:i,userReaction:n})})}:t)}:t)(t,n,i)),{previousData:o}},onError:(e,n,i)=>{i?.previousData?.forEach(([e,n])=>{t.setQueryData(e,n)}),K.error("Failed to add reaction"),console.error("Error handling reaction click:",e,n)},onSettled:async(e,n,i)=>{await t.invalidateQueries({queryKey:[v.CONTENTS_BY_EVENT(i.eventId)]})}});return{handleReactionClick:async(t,e,i)=>{if(!t||!e||!i)return!1;if(!n)return K.error("Please login to react"),!1;try{return await o.mutateAsync({eventId:t,contentId:e,emoji:i}),!0}catch(s){return!1}},isPending:o.isPending}})(),[f,b]=w(!1),[T,x]=w(null),_=a(null),E=Object.values(i).reduce((t,e)=>t+e,0);return g(()=>()=>{_.current&&clearTimeout(_.current)},[]),/* @__PURE__ */p(Qt,{open:f,onOpenChange:b,children:[/* @__PURE__ */p(Zt,{asChild:!0,children:/* @__PURE__ */p("button",{type:"button",className:C("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",T&&"scale-[1.03] shadow-sm"),children:[(n||[]).slice().sort((t,e)=>(i[e]||0)-(i[t]||0)).slice(0,1).map(t=>/* @__PURE__ */p("span",{className:C("text-sm transition-transform duration-150 ease-out sm:text-lg",T===(o||t)&&"scale-125"),children:o||t},`${e}-${t}-1`)),E>0&&/* @__PURE__ */p("span",{className:"text-xs font-bold sm:text-sm",children:E||0})]})}),/* @__PURE__ */p(Jt,{side:"top",align:"end",children:[r?null:/* @__PURE__ */p("div",c?.customAuth?{className:"p-2 font-semibold",children:["Please"," ",
12
12
  /* @__PURE__ */p("a",{className:"text-info underline",href:d,children:"Login"})," ","to react"]}:{className:"p-2 font-semibold",children:["Please"," ",
13
13
  /* @__PURE__ */p(M,{className:"text-info underline",to:q.LOGIN,children:"Login"})," ","to react"]}),r&&/* @__PURE__ */p("div",{className:"flex gap-1 p-2",children:n.map(n=>{const s=o===n;/* @__PURE__ */
14
- return p("div",{className:"flex flex-col items-center",children:[/* @__PURE__ */p("span",{className:"text-xs font-medium",children:i[n]||0}),/* @__PURE__ */p("button",{type:"button",disabled:m,className:C("text-3xl transition-transform duration-150 ease-out disabled:opacity-50",s?"scale-125":"hover:scale-110",T===n&&"scale-125",m&&"cursor-not-allowed"),onClick:()=>(async n=>{!m&&u&&(x(n),b(!1),_.current&&clearTimeout(_.current),_.current=setTimeout(()=>x(null),180),u(t,e,n))})(n),children:n})]},`${e}-${n}-2`)})})]})]})},te=({event:t={},content:e,curateLink:n})=>t.engagementStyle===b.CONTEST?/* @__PURE__ */p("button",{className:"bg-background/75 flex items-center gap-1 rounded px-2 py-1",children:[/* @__PURE__ */p(ot,{name:"material-symbols:star-half-rounded",className:"size-4"}),/* @__PURE__ */p("span",{className:"text-xs font-semibold",children:parseFloat(String(e.score||0)).toFixed(1)})]}):t.engagementStyle===b.REACTION&&t.reactionEmojis?.length?/* @__PURE__ */p(Xt,{eventId:t?._id,contentId:e._id,emojis:t?.reactionEmojis,engagementStyle:t?.engagementStyle,counts:e.reactionCounts||{},userReaction:e.userReaction}):null,ee=({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})})]}),ne=({event:t,content:e,style:n,timestampField:s,curateLink:o,onChangeFaceUrl:r,hideControls:a})=>{const{organization:l}=A(),c=`content-${e._id}`,d=((t,e)=>{if(!t||!e)return null;const n=e?.[t];if(!n)return null;try{const t=new Date(String(n)),e=/* @__PURE__ */new Date,i=t.getFullYear()===e.getFullYear(),s={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return i||(s.year="numeric"),t.toLocaleString("en-US",s).replace(","," •")}catch{return null}})(s,e);/* @__PURE__ */
14
+ return p("div",{className:"flex flex-col items-center",children:[/* @__PURE__ */p("span",{className:"text-xs font-medium",children:i[n]||0}),/* @__PURE__ */p("button",{type:"button",disabled:m,className:C("text-3xl transition-transform duration-150 ease-out disabled:opacity-50",s?"scale-125":"hover:scale-110",T===n&&"scale-125",m&&"cursor-not-allowed"),onClick:()=>(async n=>{!m&&h&&(x(n),b(!1),_.current&&clearTimeout(_.current),_.current=setTimeout(()=>x(null),180),h(t,e,n))})(n),children:n})]},`${e}-${n}-2`)})})]})]})},te=({event:t={},content:e,curateLink:n})=>t.engagementStyle===b.CONTEST?/* @__PURE__ */p("button",{className:"bg-background/75 flex items-center gap-1 rounded px-2 py-1",children:[/* @__PURE__ */p(ot,{name:"material-symbols:star-half-rounded",className:"size-4"}),/* @__PURE__ */p("span",{className:"text-xs font-semibold",children:parseFloat(String(e.score||0)).toFixed(1)})]}):t.engagementStyle===b.REACTION&&t.reactionEmojis?.length?/* @__PURE__ */p(Xt,{eventId:t?._id,contentId:e._id,emojis:t?.reactionEmojis,engagementStyle:t?.engagementStyle,counts:e.reactionCounts||{},userReaction:e.userReaction}):null,ee=({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})})]}),ne=({event:t,content:e,style:n,timestampField:s,curateLink:o,onChangeFaceUrl:r,hideControls:a})=>{const{organization:l}=A(),c=`content-${e._id}`,d=((t,e)=>{if(!t||!e)return null;const n=e?.[t];if(!n)return null;try{const t=new Date(String(n)),e=/* @__PURE__ */new Date,i=t.getFullYear()===e.getFullYear(),s={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return i||(s.year="numeric"),t.toLocaleString("en-US",s).replace(","," •")}catch{return null}})(s,e);/* @__PURE__ */
15
15
  return p("div",{id:c,style:n,className:"group relative mb-1 overflow-hidden rounded",children:[/* @__PURE__ */p(tt,{url:e.src,alt:e.caption,blurhash:e.blurhash,thumbnailUrl:e.thumbnailUrl,curateLink:o,pswpData:{id:e._id,type:T.IMAGE,hash:e._id,width:e.width,height:e.height,thumbnailUrl:e.thumbnailUrl,blurhash:e.blurhash,caption:e.caption,contentSummary:JSON.stringify(e.contentSummary)}}),!a&&/* @__PURE__ */p(i,{children:[d&&/* @__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:d}),l?.integrationSettings?.showQuickSearch&&(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:()=>{r?.(e?.url);const t=document.getElementById("media-gallery-container");t&&t.scrollIntoView({behavior:"smooth",block:"start"})},children:/* @__PURE__ */p(ot,{color:"a11y",name:"material-symbols:familiar-face-and-zone-outline-rounded"})}),
16
16
  /* @__PURE__ */p("div",{className:"",children:[/* @__PURE__ */p("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */p(ee,{content:e})}),/* @__PURE__ */p("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */p(te,{event:t,content:e,curateLink:o})})]})]})]})},ie=({content:t,style:e,event:n,timestampField:i,curateLink:s,hideControls:o})=>{const r=((t,e)=>{if(!t||!e)return null;const n=e?.[t];if(!n)return null;try{const t=new Date(String(n)),e=/* @__PURE__ */new Date,i=t.getFullYear()===e.getFullYear(),s={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return i||(s.year="numeric"),t.toLocaleString("en-US",s).replace(","," •")}catch{return null}})(i,t);/* @__PURE__ */
17
17
  return p("div",{id:`content-${t._id}`,className:"group relative mb-1 overflow-hidden rounded",style:e,children:[/* @__PURE__ */p(tt,{url:t.src??t.url,thumbnailUrl:t.thumbnailUrl,blurhash:t.blurhash,alt:t.caption,curateLink:s,pswpData:{id:t._id,type:T.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}),
18
18
  /* @__PURE__ */p("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */p(ee,{content:t})}),
19
- /* @__PURE__ */p("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */p(te,{event:n,content:t,curateLink:s})})]})]})},se=({event:t,contents:e=[],gamConfig:n,singleColumnMode:s,kioskMode:r,timestampField:l,curateLink:c,onChangeFaceUrl:d})=>{const u=a(null),h=a(null),m=o(()=>`gallery-${t?._id??""}`,[t]),{captureAdImpression:f,captureAdClick:y}=j(),{organization:v,portalContainer:b}=A(),_=v?._id,[q,k]=w(null);g(()=>{const t=h.current;if(!c&&t){const e=new Z({gallery:t,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:nt,appendToEl:b??document.body});u.current=e,new Ut(e),new zt(e),new At(e),new Rt(e,f,y),new Pt(e),new Dt(e),v?.integrationSettings?.showAIDescription&&new Lt(e,{width:"400px",height:"40%"}),e.init()}return()=>{u.current?.destroy?.(),u.current=null}},[t?.galleryLayout,c,y,f,m,v]);const S=o(()=>{switch(t?.galleryLayout){case x.ROW:return _t;case x.COLUMN:return It;case x.MASONRY:return Ct;default:return _t}},[s,t?.galleryLayout]);/* @__PURE__ */
20
- return p(i,{children:[/* @__PURE__ */p("div",{id:m,ref:h,className:C(s?"w-full lg:w-1/3":"w-full"),children:/* @__PURE__ */p(S,{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:e.map(t=>({src:t.type===T.IMAGE||t.type===T.VIDEO?t.url:t.type===T.GAM_AD?"":t.imageUrl,width:t.dimension?.width,height:t.dimension?.height,...t})),render:{container:({ref:t,className:e,children:n})=>/* @__PURE__ */p("div",{ref:t,className:e??"",children:n}),photo:(e,{photo:i,width:s,height:o,index:a})=>{const u=i;let h=null;switch(u.type){case T.IMAGE:h=ne;break;case T.VIDEO:h=ie;break;case T.AD:h=Wt;break;case T.GAM_AD:return n?/* @__PURE__ */p(Gt,{style:{width:s,height:o},gamConfig:n,slotIndex:u.slotIndex??a,eventId:t?._id,organizationId:_},`${u._id??a}-${a}`):null;default:h=null}return h&&/* @__PURE__ */p(h,{style:{width:s,height:o},event:t,content:u,timestampField:l,onAdClick:c?()=>k(u):void 0,hideControls:r,curateLink:c?`${c}/${u._id}`:null,onChangeFaceUrl:d},`${u._id??a}-${a}`)}}})}),/* @__PURE__ */p(jt,{open:Boolean(q),ad:q,onClose:()=>k(null),captureAdClick:y})]})};export{se as default};
19
+ /* @__PURE__ */p("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */p(te,{event:n,content:t,curateLink:s})})]})]})},se=({event:t,contents:e=[],gamConfig:n,singleColumnMode:s,kioskMode:r,timestampField:l,curateLink:c,onChangeFaceUrl:d})=>{const h=a(null),u=a(null),m=o(()=>`gallery-${t?._id??""}`,[t]),{captureAdImpression:f,captureAdClick:y}=j(),{organization:v,portalContainer:b}=A(),_=v?._id,[q,k]=w(null);g(()=>{const t=u.current;if(!c&&t){const e=new Z({gallery:t,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:nt,appendToEl:b??document.body});h.current=e,new Ut(e),new zt(e),new At(e),new Rt(e,f,y),new Pt(e),new Dt(e),v?.integrationSettings?.showAIDescription&&new Lt(e,{width:"400px",height:"40%"}),e.init()}return()=>{h.current?.destroy?.(),h.current=null}},[t?.galleryLayout,c,y,f,m,v]);const S=o(()=>{switch(t?.galleryLayout){case x.ROW:return _t;case x.COLUMN:return It;case x.MASONRY:return Ct;default:return _t}},[s,t?.galleryLayout]);/* @__PURE__ */
20
+ return p(i,{children:[/* @__PURE__ */p("div",{id:m,ref:u,className:C(s?"w-full lg:w-1/3":"w-full"),children:/* @__PURE__ */p(S,{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:e.map(t=>({src:t.type===T.IMAGE||t.type===T.VIDEO?t.url:t.type===T.GAM_AD?"":t.imageUrl,width:t.dimension?.width,height:t.dimension?.height,...t})),render:{container:({ref:t,className:e,children:n})=>/* @__PURE__ */p("div",{ref:t,className:e??"",children:n}),photo:(e,{photo:i,width:s,height:o,index:a})=>{const h=i;let u=null;switch(h.type){case T.IMAGE:u=ne;break;case T.VIDEO:u=ie;break;case T.AD:u=Wt;break;case T.GAM_AD:return n?/* @__PURE__ */p(Gt,{style:{width:s,height:o},gamConfig:n,slotIndex:h.slotIndex??a,eventId:t?._id,organizationId:_},`${h._id??a}-${a}`):null;default:u=null}return u&&/* @__PURE__ */p(u,{style:{width:s,height:o},event:t,content:h,timestampField:l,onAdClick:c?()=>k(h):void 0,hideControls:r,curateLink:c?`${c}/${h._id}`:null,onChangeFaceUrl:d},`${h._id??a}-${a}`)}}})}),/* @__PURE__ */p(jt,{open:Boolean(q),ad:q,onClose:()=>k(null),captureAdClick:y})]})};export{se as default};
package/element/web.es.js CHANGED
@@ -83,7 +83,7 @@ return x("div",{className:"relative flex w-auto items-center gap-2",children:[/*
83
83
  /* @__PURE__ */x(ss,{placeholder:u("content.search_placeholder","Search using text"),value:h,className:"py-2",onChange:e=>m(e.target.value),onKeyUp:e=>{const t=e.key;"Enter"===t?l&&l(h.length>0?h:""):"Escape"===t&&(m(""),l&&l(""))}}),h?.length>0&&/* @__PURE__ */x("button",{className:"absolute inset-y-0 right-10 flex items-center",onClick:()=>{m(""),l&&l("")},children:/* @__PURE__ */x(He,{name:"material-symbols:close-rounded",className:"text-foreground w-5"})}),
84
84
  /* @__PURE__ */x("button",{className:"absolute inset-y-0 right-3 flex items-center",onClick:()=>l&&l(h),children:/* @__PURE__ */x(He,{name:"material-symbols:search-rounded",className:"text-foreground w-5"})})]})}),p?.integrationSettings?.showFacialSearch&&/* @__PURE__ */x(Gs,{value:f,onChange:e=>{g(e),d?.(e?URL.createObjectURL(e):void 0)}})]}),
85
85
  /* @__PURE__ */x("div",{className:"col-span-3 md:col-span-1"}),
86
- /* @__PURE__ */x("div",{className:"col-span-3 mt-3 md:col-span-1 md:mt-0 lg:justify-self-end",children:/* @__PURE__ */x(ls,{engagementStyle:e,sort:o,order:a,onSortChange:i,onSortOrderChange:s})})]})},Vs=({position:e,gamConfig:t,eventId:r,organizationId:n})=>{const{trackGamAnalytics:o}=Me(),i=m(null),a=`gam-${e}-banner-${r??"ev"}`,s=t.placementCategories?.[e];return k(()=>{let e=!1,l=null,c=null,d=null,u=null,p=null,h=null;const m=s?[s]:[],f=document.createElement("div");f.id=a,document.body.appendChild(f);const g=()=>{const e=i.current;if(!e)return;const t=e.getBoundingClientRect(),r=t.width>0&&t.height>0;f.style.display=r?"block":"none",r&&(f.style.position="fixed",f.style.top=`${t.top}px`,f.style.left=`${t.left}px`,f.style.width="728px",f.style.height="90px",f.style.zIndex="20")};return g(),window.addEventListener("scroll",g,{passive:!0}),window.addEventListener("resize",g),(async()=>{await Te(),e||window.googletag.cmd.push(()=>{if(e)return;Oe(a);const i=window.googletag.defineSlot(t.adUnitPath,[[728,90]],a)?.addService(window.googletag.pubads());i&&(l=i,u=window.googletag.pubads(),r?i.setConfig({targeting:{qrati_event:r,...m.length>0?{qrati_category:m}:{}}}):m.length>0&&i.setConfig({targeting:{qrati_category:m}}),p=e=>{e.slot===i&&o({eventId:r,organizationId:n,type:ye.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},u.addEventListener("slotRenderEnded",p),h=e=>{e.slot===i&&o({eventId:r,organizationId:n,type:ye.GAM_VIEWABLE})},u.addEventListener("impressionViewable",h),d=Ae({container:f,onClick:()=>{o({eventId:r,organizationId:n,type:ye.GAM_CLICK})}}),Fe(),window.googletag.display(a),c=window.setTimeout(()=>{e||(g(),i.getResponseInformation?.()||window.googletag.pubads().refresh([i]))},1500))})})(),()=>{e=!0,window.removeEventListener("scroll",g),window.removeEventListener("resize",g),null!==c&&window.clearTimeout(c),d?.(),u&&"function"==typeof u.removeEventListener&&(p&&u.removeEventListener("slotRenderEnded",p),h&&u.removeEventListener("impressionViewable",h));const t=l;l=null,t&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([t])}),f.parentNode&&f.parentNode.removeChild(f)}},[r,t.adUnitPath,n,s,e,a]),/* @__PURE__ */x("div",{className:"flex w-full items-center justify-center overflow-x-auto py-2",children:/* @__PURE__ */x("div",{ref:i,style:{width:728,height:90,minWidth:728}})})},Ks=({gamConfig:e,eventId:t,organizationId:r})=>{const{trackGamAnalytics:n}=Me(),o=m(null),i=`gam-right-${t??"ev"}`,a=e.placementCategories?.right??e.placementCategories?.sidebar;return k(()=>{let s=!1,l=null,c=null,d=null,u=null,p=null,h=null;const m=a?[a]:[],f=document.createElement("div");f.id=i,document.body.appendChild(f);const g=()=>{const e=o.current;if(!e)return;const t=e.getBoundingClientRect(),r=e.parentElement?.getBoundingClientRect(),n=t.width>0&&t.height>0;if(f.style.display=n?"block":"none",!n)return;const i=t.top<=0&&r?Math.min(0,r.bottom-600):t.top;f.style.position="fixed",f.style.top=`${i}px`,f.style.left=`${t.left}px`,f.style.width="160px",f.style.height="600px",f.style.zIndex="20"};return g(),window.addEventListener("scroll",g,{passive:!0}),window.addEventListener("resize",g),(async()=>{await Te(),s||window.googletag.cmd.push(()=>{if(s)return;Oe(i);const o=window.googletag.defineSlot(e.adUnitPath,[[160,600]],i)?.addService(window.googletag.pubads());o&&(l=o,u=window.googletag.pubads(),t?o.setConfig({targeting:{qrati_event:t,...m.length>0?{qrati_category:m}:{}}}):m.length>0&&o.setConfig({targeting:{qrati_category:m}}),p=e=>{e.slot===o&&n({eventId:t,organizationId:r,type:ye.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},u.addEventListener("slotRenderEnded",p),h=e=>{e.slot===o&&n({eventId:t,organizationId:r,type:ye.GAM_VIEWABLE})},u.addEventListener("impressionViewable",h),d=Ae({container:f,onClick:()=>{n({eventId:t,organizationId:r,type:ye.GAM_CLICK})}}),Fe(),window.googletag.display(i),c=window.setTimeout(()=>{s||(g(),o.getResponseInformation?.()||window.googletag.pubads().refresh([o]))},1500))})})(),()=>{s=!0,window.removeEventListener("scroll",g),window.removeEventListener("resize",g),null!==c&&window.clearTimeout(c),d?.(),u&&"function"==typeof u.removeEventListener&&(p&&u.removeEventListener("slotRenderEnded",p),h&&u.removeEventListener("impressionViewable",h));const e=l;l=null,e&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([e])}),f.parentNode&&f.parentNode.removeChild(f)}},[t,e.adUnitPath,r,a,i]),/* @__PURE__ */x("div",{ref:o,style:{width:160,height:600},className:"hidden shrink-0 self-start lg:block"})},$s=e=>e?.meta?.currentPage<e?.meta?.totalPages?e.meta.currentPage+1:void 0,Zs=f(()=>import("./DgDxE5DM.js")),Xs=()=>{const e=J().eventSlug,{loadingUser:t,organization:r}=de(),n=X(),[o,i]=E(""),[s,l]=E(void 0),[d,p]=E(ie),[h,f]=E(D),[g,v]=E("undefined"!=typeof window&&window.innerWidth<768?I.SINGLE:I.GRID),b=m(null),{event:w,ads:y,gamConfig:_}=et({eventSlug:e}),{loading:C,isError:S,error:M,refetch:T,contentsWithAds:N,hasNextPage:F,fetchNextPage:U,isFetchingNextPage:O}=(({event:e,ads:t=[],gamConfig:r,sort:n=ie,order:o=D,keywords:i,face:a,limit:s=20,includeSummary:l=!1})=>{const{props:d,loadingUser:u,user:p}=de(),h=d?.organizationId,{isLoading:m,isError:f,error:g,data:v,hasNextPage:b,fetchNextPage:w,isFetchingNextPage:y,refetch:x}=function(e){return Z(e,qe,void 0)}({queryKey:[L.CONTENTS_BY_EVENT(e?._id??""),n,o,i,a],queryFn:async({pageParam:t=1})=>{try{return await ue.get(A.GET_CONTENTS,{searchParams:{eventId:e?._id,page:t,keywords:i,faceImageUrl:a,sort:`${R[o].sortOrder}${P[n].sortField}`,limit:s,includeSummary:l},headers:{"x-org-id":h,Authorization:p?`Bearer ${p.token}`:void 0}}).json()}catch(g){throw new Error(g instanceof Error?g.message:String(g)||"Failed to fetch contents")}},enabled:!u&&!!e,initialPageParam:1,getPreviousPageParam:e=>(e=>e?.meta?.currentPage>1?e.meta.currentPage-1:void 0)(e),getNextPageParam:$s}),_=c(()=>v?.pages?.flatMap(e=>e?.data??[])??[],[v]);return{contents:_,contentsWithAds:c(()=>"gam"===e?.adMode?r?.inGalleryEnabled?((e=[],t,r)=>{if(!r||r<=0)return e;const[n,o]=t.sizes[0]??[300,250];let i=0;const a=[];for(let s=0;s<e.length;s++)a.push(e[s]),r>0&&(s+1)%r===0&&(a.push({_id:`gam-ad-slot-${i}`,type:j.GAM_AD,slotIndex:i,width:n,height:o}),i++);return a})(_,r,e?.adPosition??5):_:((e=[],t=[],r)=>{if(!r||r<=0)return e;let n=0;const o=[];for(let i=0;i<(e?.length||0);i++)o.push(e[i]),t.length>0&&r>0&&(i+1)%r===0&&(o.push({...t[n],type:j.AD,adType:t[n].type}),n=(n+1)%t.length);return o})(_,t,e?.adPosition),[t,_,e?.adMode,e?.adPosition,r]),loading:m,isError:f,error:g,refetch:x,hasNextPage:b,fetchNextPage:w,isFetchingNextPage:y}})({event:w,ads:y,gamConfig:_,sort:d,order:h,keywords:o,face:s,includeSummary:r?.integrationSettings?.showAIDescription}),{incrementEventView:G}=Me(),{start:H,initializing:W,running:K}=(({ref:e,onBottomReached:t,hasNextPage:r,fetchNextPage:n,isFetchingNextPage:o})=>{const i=m(1),a=m(null),s=m(null),l=m(null),[c,d]=E(!1),[u,p]=E(!1);k(()=>(c&&(s.current&&window.clearTimeout(s.current),s.current=window.setTimeout(()=>{a.current=window.requestAnimationFrame(h)},300)),()=>{a.current&&window.cancelAnimationFrame(a.current)}),[c,r,o,n,t]);const h=()=>{e.current&&(e.current.scrollTop+=i.current,r&&!o&&n&&e.current.scrollTop+e.current.clientHeight>=.5*e.current.scrollHeight&&n(),e.current.scrollTop+e.current.clientHeight>=e.current.scrollHeight?(d(!1),a.current&&window.cancelAnimationFrame(a.current),s.current=window.setTimeout(()=>{p(!0),t?.(),s.current=window.setTimeout(()=>{e.current&&(e.current.scrollTop=0),p(!1),d(!0)},1e3)},1e3)):a.current=window.requestAnimationFrame(h))},f=e=>{"+"===e.key&&(i.current=Math.min(i.current+1,10)),"-"===e.key&&(i.current=Math.max(i.current-1,1))},g=()=>{document.fullscreenElement||(null!==l.current?l.current.release().then(()=>(l.current=null,!0)).catch(e=>console.error(`Failed to release wake lock: ${e instanceof Error?e.message:String(e)}`)):console.error("No Wake Lock to release."),d(!1),p(!1),e.current&&(e.current.scrollTop=0),a.current&&window.cancelAnimationFrame(a.current),s.current&&window.clearTimeout(s.current),document.removeEventListener("keydown",f),document.removeEventListener("fullscreenchange",g))};return{start:()=>{if(e?.current?.requestFullscreen)e.current.requestFullscreen();else{const t=e.current;t?.webkitRequestFullscreen?t.webkitRequestFullscreen():t?.mozRequestFullScreen?t.mozRequestFullScreen():t?.msRequestFullscreen&&t.msRequestFullscreen()}(async()=>{try{"wakeLock"in navigator?(l.current=await navigator.wakeLock.request("screen"),document.addEventListener("visibilitychange",async()=>{null!==l.current&&"visible"===document.visibilityState&&(l.current=await navigator.wakeLock.request("screen"))})):console.error("Wake Lock API is not supported in this browser.")}catch(ky){console.error(`Failed to acquire wake lock: ${ky instanceof Error?ky.message:String(ky)}`)}})(),d(!0),document.addEventListener("keydown",f),document.addEventListener("fullscreenchange",g)},initializing:u,running:c}})({ref:b,hasNextPage:F,fetchNextPage:U,isFetchingNextPage:O,onBottomReached:()=>w?._id&&n.refetchQueries({queryKey:[L.CONTENTS_BY_EVENT(w._id)]})});k(()=>{w?.slug&&G(w.slug)},[w]);const $=c(()=>g===I.SINGLE,[g]),Q=c(()=>/* @__PURE__ */x(os,{event:w,onAutoscrollClick:H}),[w?.galleryLayout,H]),Y=m(null),ee=m(null);k(()=>(Y.current&&Y.current.disconnect(),Y.current=new IntersectionObserver(e=>{e[0].isIntersecting&&F&&!O&&!C&&U()},{rootMargin:"200px"}),ee.current&&Y.current.observe(ee.current),()=>{Y.current&&Y.current.disconnect()}),[F,O,C,U]);const te=_?.bannerPositions??[],re=r?._id,oe=_&&te.includes("right");/* @__PURE__ */
86
+ /* @__PURE__ */x("div",{className:"col-span-3 mt-3 md:col-span-1 md:mt-0 lg:justify-self-end",children:/* @__PURE__ */x(ls,{engagementStyle:e,sort:o,order:a,onSortChange:i,onSortOrderChange:s})})]})},Vs=({position:e,gamConfig:t,eventId:r,organizationId:n})=>{const{trackGamAnalytics:o}=Me(),i=m(null),a=`gam-${e}-banner-${r??"ev"}`,s=t.placementCategories?.[e];return k(()=>{let e=!1,l=null,c=null,d=null,u=null,p=null,h=null;const m=s?[s]:[],f=document.createElement("div");f.id=a,document.body.appendChild(f);const g=()=>{const e=i.current;if(!e)return;const t=e.getBoundingClientRect(),r=t.width>0&&t.height>0;f.style.display=r?"block":"none",r&&(f.style.position="fixed",f.style.top=`${t.top}px`,f.style.left=`${t.left}px`,f.style.width="728px",f.style.height="90px",f.style.zIndex="20")};return g(),window.addEventListener("scroll",g,{passive:!0}),window.addEventListener("resize",g),(async()=>{await Te(),e||window.googletag.cmd.push(()=>{if(e)return;Oe(a);const i=window.googletag.defineSlot(t.adUnitPath,[[728,90]],a)?.addService(window.googletag.pubads());i&&(l=i,u=window.googletag.pubads(),r?i.setConfig({targeting:{qrati_event:r,...m.length>0?{qrati_category:m}:{}}}):m.length>0&&i.setConfig({targeting:{qrati_category:m}}),p=e=>{e.slot===i&&o({eventId:r,organizationId:n,type:ye.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},u.addEventListener("slotRenderEnded",p),h=e=>{e.slot===i&&o({eventId:r,organizationId:n,type:ye.GAM_VIEWABLE})},u.addEventListener("impressionViewable",h),d=Ae({container:f,onClick:()=>{o({eventId:r,organizationId:n,type:ye.GAM_CLICK})}}),Fe(),window.googletag.display(a),c=window.setTimeout(()=>{e||(g(),i.getResponseInformation?.()||window.googletag.pubads().refresh([i]))},1500))})})(),()=>{e=!0,window.removeEventListener("scroll",g),window.removeEventListener("resize",g),null!==c&&window.clearTimeout(c),d?.(),u&&"function"==typeof u.removeEventListener&&(p&&u.removeEventListener("slotRenderEnded",p),h&&u.removeEventListener("impressionViewable",h));const t=l;l=null,t&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([t])}),f.parentNode&&f.parentNode.removeChild(f)}},[r,t.adUnitPath,n,s,e,a]),/* @__PURE__ */x("div",{className:"flex w-full items-center justify-center overflow-x-auto py-2",children:/* @__PURE__ */x("div",{ref:i,style:{width:728,height:90,minWidth:728}})})},Ks=({gamConfig:e,eventId:t,organizationId:r})=>{const{trackGamAnalytics:n}=Me(),o=m(null),i=`gam-right-${t??"ev"}`,a=e.placementCategories?.right??e.placementCategories?.sidebar;return k(()=>{let s=!1,l=null,c=null,d=null,u=null,p=null,h=null;const m=a?[a]:[],f=document.createElement("div");f.id=i,document.body.appendChild(f);const g=()=>{const e=o.current;if(!e)return;const t=e.getBoundingClientRect(),r=e.parentElement?.getBoundingClientRect(),n=t.width>0&&t.height>0;if(f.style.display=n?"block":"none",!n)return;const i=t.top<=0&&r?Math.min(0,r.bottom-600):t.top;f.style.position="fixed",f.style.top=`${i}px`,f.style.left=`${t.left}px`,f.style.width="160px",f.style.height="600px",f.style.zIndex="20"};return g(),window.addEventListener("scroll",g,{passive:!0}),window.addEventListener("resize",g),(async()=>{await Te(),s||window.googletag.cmd.push(()=>{if(s)return;Oe(i);const o=window.googletag.defineSlot(e.adUnitPath,[[160,600]],i)?.addService(window.googletag.pubads());o&&(l=o,u=window.googletag.pubads(),t?o.setConfig({targeting:{qrati_event:t,...m.length>0?{qrati_category:m}:{}}}):m.length>0&&o.setConfig({targeting:{qrati_category:m}}),p=e=>{e.slot===o&&n({eventId:t,organizationId:r,type:ye.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},u.addEventListener("slotRenderEnded",p),h=e=>{e.slot===o&&n({eventId:t,organizationId:r,type:ye.GAM_VIEWABLE})},u.addEventListener("impressionViewable",h),d=Ae({container:f,onClick:()=>{n({eventId:t,organizationId:r,type:ye.GAM_CLICK})}}),Fe(),window.googletag.display(i),c=window.setTimeout(()=>{s||(g(),o.getResponseInformation?.()||window.googletag.pubads().refresh([o]))},1500))})})(),()=>{s=!0,window.removeEventListener("scroll",g),window.removeEventListener("resize",g),null!==c&&window.clearTimeout(c),d?.(),u&&"function"==typeof u.removeEventListener&&(p&&u.removeEventListener("slotRenderEnded",p),h&&u.removeEventListener("impressionViewable",h));const e=l;l=null,e&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([e])}),f.parentNode&&f.parentNode.removeChild(f)}},[t,e.adUnitPath,r,a,i]),/* @__PURE__ */x("div",{ref:o,style:{width:160,height:600},className:"hidden shrink-0 self-start lg:block"})},$s=e=>e?.meta?.currentPage<e?.meta?.totalPages?e.meta.currentPage+1:void 0,Zs=f(()=>import("./DvcD7LLO.js")),Xs=()=>{const e=J().eventSlug,{loadingUser:t,organization:r}=de(),n=X(),[o,i]=E(""),[s,l]=E(void 0),[d,p]=E(ie),[h,f]=E(D),[g,v]=E("undefined"!=typeof window&&window.innerWidth<768?I.SINGLE:I.GRID),b=m(null),{event:w,ads:y,gamConfig:_}=et({eventSlug:e}),{loading:C,isError:S,error:M,refetch:T,contentsWithAds:N,hasNextPage:F,fetchNextPage:U,isFetchingNextPage:O}=(({event:e,ads:t=[],gamConfig:r,sort:n=ie,order:o=D,keywords:i,face:a,limit:s=20,includeSummary:l=!1})=>{const{props:d,loadingUser:u,user:p}=de(),h=d?.organizationId,{isLoading:m,isError:f,error:g,data:v,hasNextPage:b,fetchNextPage:w,isFetchingNextPage:y,refetch:x}=function(e){return Z(e,qe,void 0)}({queryKey:[L.CONTENTS_BY_EVENT(e?._id??""),n,o,i,a],queryFn:async({pageParam:t=1})=>{try{return await ue.get(A.GET_CONTENTS,{searchParams:{eventId:e?._id,page:t,keywords:i,faceImageUrl:a,sort:`${R[o].sortOrder}${P[n].sortField}`,limit:s,includeSummary:l},headers:{"x-org-id":h,Authorization:p?`Bearer ${p.token}`:void 0}}).json()}catch(g){throw new Error(g instanceof Error?g.message:String(g)||"Failed to fetch contents")}},enabled:!u&&!!e,initialPageParam:1,getPreviousPageParam:e=>(e=>e?.meta?.currentPage>1?e.meta.currentPage-1:void 0)(e),getNextPageParam:$s}),_=c(()=>v?.pages?.flatMap(e=>e?.data??[])??[],[v]);return{contents:_,contentsWithAds:c(()=>"gam"===e?.adMode?r?.inGalleryEnabled?((e=[],t,r)=>{if(!r||r<=0)return e;const[n,o]=t.sizes[0]??[300,250];let i=0;const a=[];for(let s=0;s<e.length;s++)a.push(e[s]),r>0&&(s+1)%r===0&&(a.push({_id:`gam-ad-slot-${i}`,type:j.GAM_AD,slotIndex:i,width:n,height:o}),i++);return a})(_,r,e?.adPosition??5):_:((e=[],t=[],r)=>{if(!r||r<=0)return e;let n=0;const o=[];for(let i=0;i<(e?.length||0);i++)o.push(e[i]),t.length>0&&r>0&&(i+1)%r===0&&(o.push({...t[n],type:j.AD,adType:t[n].type}),n=(n+1)%t.length);return o})(_,t,e?.adPosition),[t,_,e?.adMode,e?.adPosition,r]),loading:m,isError:f,error:g,refetch:x,hasNextPage:b,fetchNextPage:w,isFetchingNextPage:y}})({event:w,ads:y,gamConfig:_,sort:d,order:h,keywords:o,face:s,includeSummary:r?.integrationSettings?.showAIDescription}),{incrementEventView:G}=Me(),{start:H,initializing:W,running:K}=(({ref:e,onBottomReached:t,hasNextPage:r,fetchNextPage:n,isFetchingNextPage:o})=>{const i=m(1),a=m(null),s=m(null),l=m(null),[c,d]=E(!1),[u,p]=E(!1);k(()=>(c&&(s.current&&window.clearTimeout(s.current),s.current=window.setTimeout(()=>{a.current=window.requestAnimationFrame(h)},300)),()=>{a.current&&window.cancelAnimationFrame(a.current)}),[c,r,o,n,t]);const h=()=>{e.current&&(e.current.scrollTop+=i.current,r&&!o&&n&&e.current.scrollTop+e.current.clientHeight>=.5*e.current.scrollHeight&&n(),e.current.scrollTop+e.current.clientHeight>=e.current.scrollHeight?(d(!1),a.current&&window.cancelAnimationFrame(a.current),s.current=window.setTimeout(()=>{p(!0),t?.(),s.current=window.setTimeout(()=>{e.current&&(e.current.scrollTop=0),p(!1),d(!0)},1e3)},1e3)):a.current=window.requestAnimationFrame(h))},f=e=>{"+"===e.key&&(i.current=Math.min(i.current+1,10)),"-"===e.key&&(i.current=Math.max(i.current-1,1))},g=()=>{document.fullscreenElement||(null!==l.current?l.current.release().then(()=>(l.current=null,!0)).catch(e=>console.error(`Failed to release wake lock: ${e instanceof Error?e.message:String(e)}`)):console.error("No Wake Lock to release."),d(!1),p(!1),e.current&&(e.current.scrollTop=0),a.current&&window.cancelAnimationFrame(a.current),s.current&&window.clearTimeout(s.current),document.removeEventListener("keydown",f),document.removeEventListener("fullscreenchange",g))};return{start:()=>{if(e?.current?.requestFullscreen)e.current.requestFullscreen();else{const t=e.current;t?.webkitRequestFullscreen?t.webkitRequestFullscreen():t?.mozRequestFullScreen?t.mozRequestFullScreen():t?.msRequestFullscreen&&t.msRequestFullscreen()}(async()=>{try{"wakeLock"in navigator?(l.current=await navigator.wakeLock.request("screen"),document.addEventListener("visibilitychange",async()=>{null!==l.current&&"visible"===document.visibilityState&&(l.current=await navigator.wakeLock.request("screen"))})):console.error("Wake Lock API is not supported in this browser.")}catch(ky){console.error(`Failed to acquire wake lock: ${ky instanceof Error?ky.message:String(ky)}`)}})(),d(!0),document.addEventListener("keydown",f),document.addEventListener("fullscreenchange",g)},initializing:u,running:c}})({ref:b,hasNextPage:F,fetchNextPage:U,isFetchingNextPage:O,onBottomReached:()=>w?._id&&n.refetchQueries({queryKey:[L.CONTENTS_BY_EVENT(w._id)]})});k(()=>{w?.slug&&G(w.slug)},[w]);const $=c(()=>g===I.SINGLE,[g]),Q=c(()=>/* @__PURE__ */x(os,{event:w,onAutoscrollClick:H}),[w?.galleryLayout,H]),Y=m(null),ee=m(null);k(()=>(Y.current&&Y.current.disconnect(),Y.current=new IntersectionObserver(e=>{e[0].isIntersecting&&F&&!O&&!C&&U()},{rootMargin:"200px"}),ee.current&&Y.current.observe(ee.current),()=>{Y.current&&Y.current.disconnect()}),[F,O,C,U]);const te=_?.bannerPositions??[],re=r?._id,oe=_&&te.includes("right");/* @__PURE__ */
87
87
  return x("div",{className:"bg-background mx-auto min-h-[80vh]",children:[
88
88
  /* @__PURE__ */x("div",{className:"flex flex-row justify-end gap-4 pt-2",children:Q}),
89
89
  /* @__PURE__ */x("div",{className:"pb-3",children:/* @__PURE__ */x(lt,{})}),_&&te.includes("top")&&/* @__PURE__ */x(Vs,{position:"top",gamConfig:_,eventId:w?._id,organizationId:re}),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qratilabs/qrati-connect",
3
- "version": "2.22.1-beta.1",
3
+ "version": "2.22.1-beta.2",
4
4
  "description": "Qrati Connect - A React-based micro frontend component",
5
5
  "author": "Qrati Labs",
6
6
  "license": "MIT",
@@ -1,7 +1,7 @@
1
1
  import{d as e,h as t,j as r,p as o}from"./iDVNWJcT-D4oCSCPP.js";import{dt as l,et as s,ft as i}from"./82Hs8bOb-Q_nSRDXk.js";var n=t(()=>import("./BGErizzh-Duu4C4g5.js")),a=t(()=>import("./BhplmPQ6-BQhZP1f1.js")),c=t(()=>import("./fbHfEZm7-BF36A8_j.js")),d=t(()=>import("./DkX6v-39-CYAsrDKo.js")),p=()=>/* @__PURE__ */e("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */e("div",{class:"text-center",children:[
2
2
  /* @__PURE__ */e("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__ */e("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__ */e("circle",{cx:"12",cy:"9",r:"2.5"})]}),
3
3
  /* @__PURE__ */e("p",{class:"text-foreground",children:"No location data available."}),
4
- /* @__PURE__ */e("p",{class:"text-muted-foreground mt-1 text-xs",children:"Events need location data to appear on the map."})]})}),m=()=>/* @__PURE__ */e("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */e("div",{class:"border-primary size-8 animate-spin rounded-full border-4 border-t-transparent"})}),g=({events:t,isLoading:g=!1})=>{const{organization:h}=l(),x=i(),f=h?.integrationSettings??{},u=f.mapProvider??"openstreetmap",v=r(e=>{x(s.GALLERY(e))},[x]);if("openstreetmap_free"===u)/* @__PURE__ */return e("div",{class:"relative mt-3 h-screen sm:mt-6",children:/* @__PURE__ */e(o,{fallback:/* @__PURE__ */e(m,{}),children:/* @__PURE__ */e(n,{onExplore:v,logoUrl:h?.logoUrl})})});const y=f.mapTilerApiKey??"",b=f.googleMapsApiKey??"",w=f.mapboxApiKey??"",j=t.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);return e("div",{class:"relative mt-3 h-screen sm:mt-6",children:g?/* @__PURE__ */e(m,{}):"openstreetmap"===u&&!y||"google"===u&&!b||"mapbox"===u&&!w?/* @__PURE__ */e("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */e("div",{class:"text-center",children:[
4
+ /* @__PURE__ */e("p",{class:"text-muted-foreground mt-1 text-xs",children:"Events need location data to appear on the map."})]})}),m=()=>/* @__PURE__ */e("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */e("div",{class:"border-primary size-8 animate-spin rounded-full border-4 border-t-transparent"})}),g=({events:t,isLoading:g=!1})=>{const{organization:f}=l(),h=i(),x=f?.integrationSettings??{},u=x.mapProvider??"openstreetmap",v=r(e=>{h(s.GALLERY(e))},[h]);if("openstreetmap_free"===u)/* @__PURE__ */return e("div",{class:"relative mt-3 h-screen sm:mt-6",children:/* @__PURE__ */e(o,{fallback:/* @__PURE__ */e(m,{}),children:/* @__PURE__ */e(n,{onExplore:v,logoUrl:f?.logoUrl})})});const y=x.mapTilerApiKey??"",b=x.googleMapsApiKey??"",w=x.mapboxApiKey??"",j=t.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);return e("div",{class:"relative mt-3 h-screen sm:mt-6",children:g?/* @__PURE__ */e(m,{}):"openstreetmap"===u&&!y||"google"===u&&!b||"mapbox"===u&&!w?/* @__PURE__ */e("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */e("div",{class:"text-center",children:[
5
5
  /* @__PURE__ */e("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__ */e("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__ */e("circle",{cx:"12",cy:"9",r:"2.5"})]}),
6
6
  /* @__PURE__ */e("p",{class:"text-foreground",children:"API key is required to display the map."}),
7
- /* @__PURE__ */e("p",{class:"text-muted-foreground mt-1 text-xs",children:"Provide a map API key in your organization settings."})]})}):0===j.length?/* @__PURE__ */e(p,{}):/* @__PURE__ */e(o,{fallback:/* @__PURE__ */e(m,{}),children:["openstreetmap"===u&&/* @__PURE__ */e(a,{is3D:!1,apiKey:y,onExplore:v,logoUrl:h?.logoUrl}),"mapbox"===u&&/* @__PURE__ */e(d,{onExplore:v,apiKey:w,is3D:!1,logoUrl:h?.logoUrl}),"google"===u&&/* @__PURE__ */e(c,{apiKey:b,onExplore:v,logoUrl:h?.logoUrl})]})})};export{g as default};
7
+ /* @__PURE__ */e("p",{class:"text-muted-foreground mt-1 text-xs",children:"Provide a map API key in your organization settings."})]})}):0===j.length?/* @__PURE__ */e(p,{}):/* @__PURE__ */e(o,{fallback:/* @__PURE__ */e(m,{}),children:["openstreetmap"===u&&/* @__PURE__ */e(a,{is3D:!1,apiKey:y,onExplore:v,logoUrl:f?.logoUrl}),"mapbox"===u&&/* @__PURE__ */e(d,{onExplore:v,apiKey:w,is3D:!1,logoUrl:f?.logoUrl}),"google"===u&&/* @__PURE__ */e(c,{apiKey:b,onExplore:v,logoUrl:f?.logoUrl})]})})};export{g as default};
@@ -1 +1 @@
1
- const e=require("./iDVNWJcT-Bf_I6ltO.js"),r=require("./82Hs8bOb-BYqErIYg.js");var n=e.Qe(()=>Promise.resolve().then(()=>require("./BGErizzh-BKDPCruO.js"))),t=e.Qe(()=>Promise.resolve().then(()=>require("./BhplmPQ6-CHCeCrpF.js"))),o=e.Qe(()=>Promise.resolve().then(()=>require("./fbHfEZm7-pJdAJ_97.js"))),l=e.Qe(()=>Promise.resolve().then(()=>require("./DkX6v-39-Dmwf0YBd.js"))),s=()=>e.Hn("div",{class:"flex h-full items-center justify-center",children:e.Hn("div",{class:"text-center",children:[e.Hn("svg",{xmlns:"http://www.w3.org/2000/svg",class:"text-muted-foreground mx-auto mb-3 size-10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",children:[e.Hn("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z"}),e.Hn("circle",{cx:"12",cy:"9",r:"2.5"})]}),e.Hn("p",{class:"text-foreground",children:"No location data available."}),e.Hn("p",{class:"text-muted-foreground mt-1 text-xs",children:"Events need location data to appear on the map."})]})}),i=()=>e.Hn("div",{class:"flex h-full items-center justify-center",children:e.Hn("div",{class:"border-primary size-8 animate-spin rounded-full border-4 border-t-transparent"})});exports.default=({events:a,isLoading:c=!1})=>{const{organization:d}=r.vn(),p=r.vo(),m=d?.integrationSettings??{},h=m.mapProvider??"openstreetmap",u=e.ye(e=>{p(r.nt.GALLERY(e))},[p]);if("openstreetmap_free"===h)return e.Hn("div",{class:"relative mt-3 h-screen sm:mt-6",children:e.Hn(e.Je,{fallback:e.Hn(i,{}),children:e.Hn(n,{onExplore:u,logoUrl:d?.logoUrl})})});const g=m.mapTilerApiKey??"",x=m.googleMapsApiKey??"",H=m.mapboxApiKey??"",v=a.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);return e.Hn("div",{class:"relative mt-3 h-screen sm:mt-6",children:c?e.Hn(i,{}):"openstreetmap"===h&&!g||"google"===h&&!x||"mapbox"===h&&!H?e.Hn("div",{class:"flex h-full items-center justify-center",children:e.Hn("div",{class:"text-center",children:[e.Hn("svg",{xmlns:"http://www.w3.org/2000/svg",class:"text-muted-foreground mx-auto mb-3 size-10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",children:[e.Hn("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z"}),e.Hn("circle",{cx:"12",cy:"9",r:"2.5"})]}),e.Hn("p",{class:"text-foreground",children:"API key is required to display the map."}),e.Hn("p",{class:"text-muted-foreground mt-1 text-xs",children:"Provide a map API key in your organization settings."})]})}):0===v.length?e.Hn(s,{}):e.Hn(e.Je,{fallback:e.Hn(i,{}),children:["openstreetmap"===h&&e.Hn(t,{is3D:!1,apiKey:g,onExplore:u,logoUrl:d?.logoUrl}),"mapbox"===h&&e.Hn(l,{onExplore:u,apiKey:H,is3D:!1,logoUrl:d?.logoUrl}),"google"===h&&e.Hn(o,{apiKey:x,onExplore:u,logoUrl:d?.logoUrl})]})})};
1
+ const e=require("./iDVNWJcT-Bf_I6ltO.js"),r=require("./82Hs8bOb-BYqErIYg.js");var n=e.Qe(()=>Promise.resolve().then(()=>require("./BGErizzh-BKDPCruO.js"))),t=e.Qe(()=>Promise.resolve().then(()=>require("./BhplmPQ6-CHCeCrpF.js"))),o=e.Qe(()=>Promise.resolve().then(()=>require("./fbHfEZm7-pJdAJ_97.js"))),l=e.Qe(()=>Promise.resolve().then(()=>require("./DkX6v-39-Dmwf0YBd.js"))),s=()=>e.Hn("div",{class:"flex h-full items-center justify-center",children:e.Hn("div",{class:"text-center",children:[e.Hn("svg",{xmlns:"http://www.w3.org/2000/svg",class:"text-muted-foreground mx-auto mb-3 size-10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",children:[e.Hn("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z"}),e.Hn("circle",{cx:"12",cy:"9",r:"2.5"})]}),e.Hn("p",{class:"text-foreground",children:"No location data available."}),e.Hn("p",{class:"text-muted-foreground mt-1 text-xs",children:"Events need location data to appear on the map."})]})}),i=()=>e.Hn("div",{class:"flex h-full items-center justify-center",children:e.Hn("div",{class:"border-primary size-8 animate-spin rounded-full border-4 border-t-transparent"})});exports.default=({events:a,isLoading:c=!1})=>{const{organization:d}=r.vn(),p=r.vo(),m=d?.integrationSettings??{},h=m.mapProvider??"openstreetmap",u=e.ye(e=>{p(r.nt.GALLERY(e))},[p]);if("openstreetmap_free"===h)return e.Hn("div",{class:"relative mt-3 h-screen sm:mt-6",children:e.Hn(e.Je,{fallback:e.Hn(i,{}),children:e.Hn(n,{onExplore:u,logoUrl:d?.logoUrl})})});const g=m.mapTilerApiKey??"",x=m.googleMapsApiKey??"",H=m.mapboxApiKey??"",f=a.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);return e.Hn("div",{class:"relative mt-3 h-screen sm:mt-6",children:c?e.Hn(i,{}):"openstreetmap"===h&&!g||"google"===h&&!x||"mapbox"===h&&!H?e.Hn("div",{class:"flex h-full items-center justify-center",children:e.Hn("div",{class:"text-center",children:[e.Hn("svg",{xmlns:"http://www.w3.org/2000/svg",class:"text-muted-foreground mx-auto mb-3 size-10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",children:[e.Hn("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z"}),e.Hn("circle",{cx:"12",cy:"9",r:"2.5"})]}),e.Hn("p",{class:"text-foreground",children:"API key is required to display the map."}),e.Hn("p",{class:"text-muted-foreground mt-1 text-xs",children:"Provide a map API key in your organization settings."})]})}):0===f.length?e.Hn(s,{}):e.Hn(e.Je,{fallback:e.Hn(i,{}),children:["openstreetmap"===h&&e.Hn(t,{is3D:!1,apiKey:g,onExplore:u,logoUrl:d?.logoUrl}),"mapbox"===h&&e.Hn(l,{onExplore:u,apiKey:H,is3D:!1,logoUrl:d?.logoUrl}),"google"===h&&e.Hn(o,{apiKey:x,onExplore:u,logoUrl:d?.logoUrl})]})})};
@@ -3,7 +3,7 @@ import{C as t,D as e,E as n,O as i,S as s,b as o,d as r,f as a,j as l,l as c,n a
3
3
  /* @__PURE__ */r("img",{className:"h-auto w-full object-contain sm:max-h-96",src:e?.imageUrl,alt:"Image not found"}),
4
4
  /* @__PURE__ */r("div",{className:"flex flex-col gap-2 p-3",children:[/* @__PURE__ */r(et,{variant:"h4",align:"center",lines:2,children:e?.title}),/* @__PURE__ */r(et,{variant:"body3",color:"secondary",align:"center",lines:4,children:e?.description})]}),s&&/* @__PURE__ */r(nt,{fullWidth:!0,className:"rounded-none",onClick:()=>{i?.(e?._id,e?.targetType??M.LINK,e?.targetUrl),n?.()},iconName:I[e?.targetType]??I[M.LINK],children:e?.targetText})]})]})})},jt=({style:t,content:e,curateLink:n,onAdClick:i})=>{const{captureAdImpression:s,captureAdEngagement:o,captureAdClick:a}=j(),l=Boolean(n&&i),c=e.ctaBg||"#ff4800",d=e.ctaForeground||"#FFFFFF";return r("div",{style:t,className:"group relative mb-1 overflow-hidden rounded",children:[
5
5
  /* @__PURE__ */r(D,{className:"size-full",threshold:.8,triggerOnce:!0,onChange:t=>{t&&s(e._id)},onClick:()=>o(e._id),children:/* @__PURE__ */r(Z,{url:e.src||e.imageUrl,thumbnailUrl:e.src||e.imageUrl,blurhash:e.blurhash,alt:e.caption,onClick:l?i:void 0,pswpData:{id:e._id,type:v.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}})}),
6
- /* @__PURE__ */r("span",{className:"bg-background/70 absolute top-1 right-1 rounded px-1 text-xs font-medium",children:"Ad"}),(e.title||e.targetType!==M.NONE)&&/* @__PURE__ */r("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__ */r("div",{className:"bg-background/60 px-3 py-1",children:/* @__PURE__ */r("h3",{className:"line-clamp-1 text-sm leading-snug font-medium",children:e.title})}),e?.targetType!==M.NONE&&/* @__PURE__ */r("button",{className:"flex w-full items-center justify-center gap-2 rounded-none border-0 py-2 text-nowrap",style:{backgroundColor:c,color:d},onClick:()=>{l?i?.():a(e._id,e.targetType,e.targetUrl)},children:[/* @__PURE__ */r(J,{style:{color:d},icon:I[e?.targetType??M.LINK]}),e?.targetText]})]})]})},Wt=({style:t,gamConfig:n,slotIndex:i,eventId:s,organizationId:o})=>{const a=g(null),l=g(null),{trackGamAnalytics:c}=j(),d=`gam-slot-${s??"ev"}-${i}`,h=Math.max(1,Math.round(t?.width||n.sizes[0]?.[0]||300)),p=Math.max(1,Math.round(t?.height||n.sizes[0]?.[1]||250)),u=g({w:h,h:p});return e(()=>{let t=!1,e=null,i=null,r=null,h=null;return(async()=>{await W(),!t&&a.current&&window.googletag.cmd.push(()=>{if(t)return;U(d);const{w:p,h:m}=u.current,g=[[p,m],...n.sizes],f=window.googletag.defineSlot(n.adUnitPath,g,d)?.addService(window.googletag.pubads());if(!f)return;l.current=f,i=window.googletag.pubads(),s?f.setConfig({targeting:{qrati_event:s,...n.categories.length>0?{qrati_category:n.categories}:{}}}):n.categories.length>0&&f.setConfig({targeting:{qrati_category:n.categories}}),r=t=>{t.slot===f&&c({eventId:s,organizationId:o,type:C.GAM_IMPRESSION,creativeId:String(t.creativeId??""),lineItemId:String(t.lineItemId??""),advertiserId:String(t.advertiserId??""),isEmpty:t.isEmpty??!1})},i.addEventListener("slotRenderEnded",r),h=t=>{t.slot===f&&c({eventId:s,organizationId:o,type:C.GAM_VIEWABLE})},i.addEventListener("impressionViewable",h);const w=a.current;w&&(e=K({container:w,onClick:()=>{c({eventId:s,organizationId:o,type:C.GAM_CLICK})}}),Q(),window.googletag.display(d))})})(),()=>{t=!0,e?.(),i&&"function"==typeof i.removeEventListener&&(r&&i.removeEventListener("slotRenderEnded",r),h&&i.removeEventListener("impressionViewable",h));const n=l.current;l.current=null,n&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([n])})}},[s,n.adUnitPath,n.categories,o,d]),/* @__PURE__ */r("div",{style:{width:h,height:p},className:"relative overflow-hidden rounded bg-neutral-100 dark:bg-neutral-800","data-gam-slot-index":i,children:/* @__PURE__ */r("div",{id:d,ref:a,style:{width:h,height:p},className:"gam-ad-slot"})})},Gt=a(null),Kt=()=>{const e=t(Gt);if(!e)throw new Error("Popover components must be used within a Popover");return e},Yt=({children:t,className:e,open:n,onOpenChange:i})=>{const[o,a]=s(!1),l="boolean"==typeof n,c=l?n:o,d=p(),h=`popover-trigger-${d}`,u=`popover-content-${d}`,m=g(null);return r(Gt.Provider,{value:{isOpen:c,setIsOpen:t=>{l||a(t),i?.(t)},triggerId:h,contentId:u,triggerRef:m},children:/* @__PURE__ */r("div",{"data-slot":"popover",className:S("relative inline-block",e),children:t})})},Qt=({children:t,asChild:n,className:i,onClick:s,...o})=>{const{isOpen:a,setIsOpen:l,triggerId:d,contentId:h,triggerRef:p}=Kt();if(e(()=>{if(!n)return;const t=document.getElementById(d);return p.current=t,()=>{p.current===t&&(p.current=null)}},[n,d,p]),n){const e=Array.isArray(t)?t[0]:t;if(e&&e.type){const t=e.props?.className;return c(e,{id:d,className:i?t?`${t} ${i}`:i:t,"aria-haspopup":"dialog","aria-expanded":a,"aria-controls":a?h:void 0,onClick:t=>{l(!a),e.props?.onClick?.(t)},"data-state":a?"open":"closed"})}}return r("button",{ref:p,id:d,type:"button","aria-haspopup":"dialog","aria-expanded":a,"aria-controls":a?h:void 0,"data-slot":"popover-trigger","data-state":a?"open":"closed",className:i,onClick:t=>{l(!a),s?.(t)},...o,children:t})},Jt=({children:t,className:n,align:i="center",side:a="top",sideOffset:l=4,...c})=>{const{isOpen:d,setIsOpen:h,contentId:p,triggerRef:u}=Kt(),{organization:m,portalContainer:w}=L(),y=g(null),[v,b]=s(null);if(f(()=>{if(!d)return;const t=()=>{if(!u.current||!y.current)return;const t=u.current.getBoundingClientRect(),e=y.current.getBoundingClientRect();let n=t.left,s=t.bottom+l;"center"===i&&(n=t.left+t.width/2-e.width/2),"end"===i&&(n=t.right-e.width),"top"===a&&(s=t.top-e.height-l),"left"===a&&(n=t.left-e.width-l,s=t.top+t.height/2-e.height/2),"right"===a&&(n=t.right+l,s=t.top+t.height/2-e.height/2),"bottom"===a&&(s=t.bottom+l),b({top:s,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,d,a,l,u]),e(()=>{if(!d)return;const t=t=>{const e=t.target;y.current&&!y.current.contains(e)&&u.current&&!u.current.contains(e)&&h(!1)},e=t=>{"Escape"===t.key&&(h(!1),u.current?.focus())},n=window.setTimeout(()=>{document.addEventListener("mousedown",t)},0);return document.addEventListener("keydown",e),()=>{window.clearTimeout(n),document.removeEventListener("mousedown",t),document.removeEventListener("keydown",e)}},[d,h,u]),!d)return null;const x=/* @__PURE__ */r("div",{ref:y,id:p,role:"dialog","aria-modal":"false","data-state":d?"open":"closed",className:S("bg-background text-foreground border-border shadow-outer rounded outline-none",n),style:{position:"fixed",top:v?.top??0,left:v?.left??0,zIndex:2010,...T(m)},...c,children:t});return"undefined"!=typeof document?o(x,w??document.body):x},Zt=({eventId:t,contentId:n,emojis:i=[],counts:o={},userReaction:a})=>{const{user:c,props:d,organization:h}=L(),p=d?.loginUrl,{handleReactionClick:u,isPending:f}=(()=>{const t=x(),{props:n,user:i}=L(),o=n?.organizationId,r=function(t){const n=x(void 0),[i]=s(()=>new rt(n,t));e(()=>{i.setOptions(t)},[i,t]);const o=m(l(t=>i.subscribe(V.batchCalls(t)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),r=l((t,e)=>{i.mutate(t,e).catch(k)},[i]);if(o.error&&R(i.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:r,mutateAsync:o.mutate}}({mutationFn:async({eventId:t,contentId:e,emoji:n})=>{await B.post(y.UPDATE_REACTION,{json:{eventId:t,contentId:e,reaction:n},headers:{"x-org-id":o,Authorization:`Bearer ${i?.token}`}})},onMutate:async({eventId:e,contentId:n,emoji:i})=>{const s=[E.CONTENTS_BY_EVENT(e)];await t.cancelQueries({queryKey:s});const o=t.getQueriesData({queryKey:s});return t.setQueriesData({queryKey:s},t=>((t,e,n)=>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 i={...t.reactionCounts??{}};return t.userReaction&&t.userReaction!==n&&(i[t.userReaction]=Math.max(0,(i[t.userReaction]??1)-1)),t.userReaction===n?(i[n]=Math.max(0,(i[n]??1)-1),{...t,reactionCounts:i,userReaction:void 0}):(i[n]=(i[n]??0)+1,{...t,reactionCounts:i,userReaction:n})})}:t)}:t)(t,n,i)),{previousData:o}},onError:(e,n,i)=>{i?.previousData?.forEach(([e,n])=>{t.setQueryData(e,n)}),tt.error("Failed to add reaction"),console.error("Error handling reaction click:",e,n)},onSettled:async(e,n,i)=>{await t.invalidateQueries({queryKey:[E.CONTENTS_BY_EVENT(i.eventId)]})}});return{handleReactionClick:async(t,e,n)=>{if(!t||!e||!n)return!1;if(!i)return tt.error("Please login to react"),!1;try{return await r.mutateAsync({eventId:t,contentId:e,emoji:n}),!0}catch(s){return!1}},isPending:r.isPending}})(),[w,v]=s(!1),[T,_]=s(null),q=g(null),I=Object.values(o).reduce((t,e)=>t+e,0);return e(()=>()=>{q.current&&clearTimeout(q.current)},[]),/* @__PURE__ */r(Yt,{open:w,onOpenChange:v,children:[/* @__PURE__ */r(Qt,{asChild:!0,children:/* @__PURE__ */r("button",{type:"button",className:S("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",T&&"scale-[1.03] shadow-sm"),children:[(i||[]).slice().sort((t,e)=>(o[e]||0)-(o[t]||0)).slice(0,1).map(t=>/* @__PURE__ */r("span",{className:S("text-sm transition-transform duration-150 ease-out sm:text-lg",T===(a||t)&&"scale-125"),children:a||t},`${n}-${t}-1`)),I>0&&/* @__PURE__ */r("span",{className:"text-xs font-bold sm:text-sm",children:I||0})]})}),/* @__PURE__ */r(Jt,{side:"top",align:"end",children:[c?null:/* @__PURE__ */r("div",h?.customAuth?{className:"p-2 font-semibold",children:["Please"," ",
6
+ /* @__PURE__ */r("span",{className:"bg-background/70 absolute top-1 right-1 rounded px-1 text-xs font-medium",children:"Ad"}),(e.title||e.targetType!==M.NONE)&&/* @__PURE__ */r("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__ */r("div",{className:"bg-background/60 px-3 py-1",children:/* @__PURE__ */r("h3",{className:"line-clamp-1 text-sm leading-snug font-medium",children:e.title})}),e?.targetType!==M.NONE&&/* @__PURE__ */r("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:()=>{l?i?.():a(e._id,e.targetType,e.targetUrl)},children:[/* @__PURE__ */r(J,{style:{color:d},icon:I[e?.targetType??M.LINK]}),e?.targetText]})]})]})},Wt=({style:t,gamConfig:n,slotIndex:i,eventId:s,organizationId:o})=>{const a=g(null),l=g(null),{trackGamAnalytics:c}=j(),d=`gam-slot-${s??"ev"}-${i}`,h=Math.max(1,Math.round(t?.width||n.sizes[0]?.[0]||300)),p=Math.max(1,Math.round(t?.height||n.sizes[0]?.[1]||250)),u=g({w:h,h:p});return e(()=>{let t=!1,e=null,i=null,r=null,h=null;return(async()=>{await W(),!t&&a.current&&window.googletag.cmd.push(()=>{if(t)return;U(d);const{w:p,h:m}=u.current,g=[[p,m],...n.sizes],f=window.googletag.defineSlot(n.adUnitPath,g,d)?.addService(window.googletag.pubads());if(!f)return;l.current=f,i=window.googletag.pubads(),s?f.setConfig({targeting:{qrati_event:s,...n.categories.length>0?{qrati_category:n.categories}:{}}}):n.categories.length>0&&f.setConfig({targeting:{qrati_category:n.categories}}),r=t=>{t.slot===f&&c({eventId:s,organizationId:o,type:C.GAM_IMPRESSION,creativeId:String(t.creativeId??""),lineItemId:String(t.lineItemId??""),advertiserId:String(t.advertiserId??""),isEmpty:t.isEmpty??!1})},i.addEventListener("slotRenderEnded",r),h=t=>{t.slot===f&&c({eventId:s,organizationId:o,type:C.GAM_VIEWABLE})},i.addEventListener("impressionViewable",h);const w=a.current;w&&(e=K({container:w,onClick:()=>{c({eventId:s,organizationId:o,type:C.GAM_CLICK})}}),Q(),window.googletag.display(d))})})(),()=>{t=!0,e?.(),i&&"function"==typeof i.removeEventListener&&(r&&i.removeEventListener("slotRenderEnded",r),h&&i.removeEventListener("impressionViewable",h));const n=l.current;l.current=null,n&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([n])})}},[s,n.adUnitPath,n.categories,o,d]),/* @__PURE__ */r("div",{style:{width:h,height:p},className:"relative overflow-hidden rounded bg-neutral-100 dark:bg-neutral-800","data-gam-slot-index":i,children:/* @__PURE__ */r("div",{id:d,ref:a,style:{width:h,height:p},className:"gam-ad-slot"})})},Gt=a(null),Kt=()=>{const e=t(Gt);if(!e)throw new Error("Popover components must be used within a Popover");return e},Yt=({children:t,className:e,open:n,onOpenChange:i})=>{const[o,a]=s(!1),l="boolean"==typeof n,c=l?n:o,d=p(),h=`popover-trigger-${d}`,u=`popover-content-${d}`,m=g(null);return r(Gt.Provider,{value:{isOpen:c,setIsOpen:t=>{l||a(t),i?.(t)},triggerId:h,contentId:u,triggerRef:m},children:/* @__PURE__ */r("div",{"data-slot":"popover",className:S("relative inline-block",e),children:t})})},Qt=({children:t,asChild:e,className:n,onClick:i,...s})=>{const{isOpen:o,setIsOpen:a,triggerId:l,contentId:d,triggerRef:h}=Kt();if(e){const e=Array.isArray(t)?t[0]:t;if(e&&e.type){const t=e.props?.className;return c(e,{ref:t=>{h.current=t},id:l,className:n?t?`${t} ${n}`:n:t,"aria-haspopup":"dialog","aria-expanded":o,"aria-controls":o?d:void 0,onClick:t=>{a(!o),e.props?.onClick?.(t)},"data-state":o?"open":"closed"})}}return r("button",{ref:h,id:l,type:"button","aria-haspopup":"dialog","aria-expanded":o,"aria-controls":o?d:void 0,"data-slot":"popover-trigger","data-state":o?"open":"closed",className:n,onClick:t=>{a(!o),i?.(t)},...s,children:t})},Jt=({children:t,className:n,align:i="center",side:a="top",sideOffset:l=4,...c})=>{const{isOpen:d,setIsOpen:h,contentId:p,triggerRef:u}=Kt(),{organization:m,portalContainer:w}=L(),y=g(null),[v,b]=s(null);if(f(()=>{if(!d)return;const t=()=>{if(!u.current||!y.current)return;const t=u.current.getBoundingClientRect(),e=y.current.getBoundingClientRect();let n=t.left,s=t.bottom+l;"center"===i&&(n=t.left+t.width/2-e.width/2),"end"===i&&(n=t.right-e.width),"top"===a&&(s=t.top-e.height-l),"left"===a&&(n=t.left-e.width-l,s=t.top+t.height/2-e.height/2),"right"===a&&(n=t.right+l,s=t.top+t.height/2-e.height/2),"bottom"===a&&(s=t.bottom+l),b({top:s,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,d,a,l,u]),e(()=>{if(!d)return;const t=t=>{const e="function"==typeof t.composedPath?t.composedPath():[],n=t.target,i=y.current&&(y.current.contains(n)||e.includes(y.current)),s=u.current&&(u.current.contains(n)||e.includes(u.current));i||s||h(!1)},e=t=>{"Escape"===t.key&&(h(!1),u.current?.focus())},n=window.setTimeout(()=>{document.addEventListener("mousedown",t)},0);return document.addEventListener("keydown",e),()=>{window.clearTimeout(n),document.removeEventListener("mousedown",t),document.removeEventListener("keydown",e)}},[d,h,u]),!d)return null;const x=/* @__PURE__ */r("div",{ref:y,id:p,role:"dialog","aria-modal":"false","data-state":d?"open":"closed",className:S("bg-background text-foreground border-border shadow-outer rounded outline-none",n),style:{position:"fixed",top:v?.top??0,left:v?.left??0,zIndex:2010,...T(m)},...c,children:t});return"undefined"!=typeof document?o(x,w??document.body):x},Zt=({eventId:t,contentId:n,emojis:i=[],counts:o={},userReaction:a})=>{const{user:c,props:d,organization:h}=L(),p=d?.loginUrl,{handleReactionClick:u,isPending:f}=(()=>{const t=x(),{props:n,user:i}=L(),o=n?.organizationId,r=function(t){const n=x(void 0),[i]=s(()=>new rt(n,t));e(()=>{i.setOptions(t)},[i,t]);const o=m(l(t=>i.subscribe(V.batchCalls(t)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),r=l((t,e)=>{i.mutate(t,e).catch(k)},[i]);if(o.error&&R(i.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:r,mutateAsync:o.mutate}}({mutationFn:async({eventId:t,contentId:e,emoji:n})=>{await B.post(y.UPDATE_REACTION,{json:{eventId:t,contentId:e,reaction:n},headers:{"x-org-id":o,Authorization:`Bearer ${i?.token}`}})},onMutate:async({eventId:e,contentId:n,emoji:i})=>{const s=[E.CONTENTS_BY_EVENT(e)];await t.cancelQueries({queryKey:s});const o=t.getQueriesData({queryKey:s});return t.setQueriesData({queryKey:s},t=>((t,e,n)=>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 i={...t.reactionCounts??{}};return t.userReaction&&t.userReaction!==n&&(i[t.userReaction]=Math.max(0,(i[t.userReaction]??1)-1)),t.userReaction===n?(i[n]=Math.max(0,(i[n]??1)-1),{...t,reactionCounts:i,userReaction:void 0}):(i[n]=(i[n]??0)+1,{...t,reactionCounts:i,userReaction:n})})}:t)}:t)(t,n,i)),{previousData:o}},onError:(e,n,i)=>{i?.previousData?.forEach(([e,n])=>{t.setQueryData(e,n)}),tt.error("Failed to add reaction"),console.error("Error handling reaction click:",e,n)},onSettled:async(e,n,i)=>{await t.invalidateQueries({queryKey:[E.CONTENTS_BY_EVENT(i.eventId)]})}});return{handleReactionClick:async(t,e,n)=>{if(!t||!e||!n)return!1;if(!i)return tt.error("Please login to react"),!1;try{return await r.mutateAsync({eventId:t,contentId:e,emoji:n}),!0}catch(s){return!1}},isPending:r.isPending}})(),[w,v]=s(!1),[T,_]=s(null),q=g(null),I=Object.values(o).reduce((t,e)=>t+e,0);return e(()=>()=>{q.current&&clearTimeout(q.current)},[]),/* @__PURE__ */r(Yt,{open:w,onOpenChange:v,children:[/* @__PURE__ */r(Qt,{asChild:!0,children:/* @__PURE__ */r("button",{type:"button",className:S("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",T&&"scale-[1.03] shadow-sm"),children:[(i||[]).slice().sort((t,e)=>(o[e]||0)-(o[t]||0)).slice(0,1).map(t=>/* @__PURE__ */r("span",{className:S("text-sm transition-transform duration-150 ease-out sm:text-lg",T===(a||t)&&"scale-125"),children:a||t},`${n}-${t}-1`)),I>0&&/* @__PURE__ */r("span",{className:"text-xs font-bold sm:text-sm",children:I||0})]})}),/* @__PURE__ */r(Jt,{side:"top",align:"end",children:[c?null:/* @__PURE__ */r("div",h?.customAuth?{className:"p-2 font-semibold",children:["Please"," ",
7
7
  /* @__PURE__ */r("a",{className:"text-info underline",href:p,children:"Login"})," ","to react"]}:{className:"p-2 font-semibold",children:["Please"," ",
8
8
  /* @__PURE__ */r(b,{className:"text-info underline",to:N.LOGIN,children:"Login"})," ","to react"]}),c&&/* @__PURE__ */r("div",{className:"flex gap-1 p-2",children:i.map(e=>{const i=a===e;return r("div",{className:"flex flex-col items-center",children:[/* @__PURE__ */r("span",{className:"text-xs font-medium",children:o[e]||0}),/* @__PURE__ */r("button",{type:"button",disabled:f,className:S("text-3xl transition-transform duration-150 ease-out disabled:opacity-50",i?"scale-125":"hover:scale-110",T===e&&"scale-125",f&&"cursor-not-allowed"),onClick:()=>(async e=>{!f&&u&&(_(e),v(!1),q.current&&clearTimeout(q.current),q.current=setTimeout(()=>_(null),180),u(t,n,e))})(e),children:e})]},`${n}-${e}-2`)})})]})]})},Xt=({event:t={},content:e,curateLink:n})=>t.engagementStyle===_.CONTEST?/* @__PURE__ */r("button",{className:"bg-background/75 flex items-center gap-1 rounded px-2 py-1",children:[/* @__PURE__ */r(J,{name:"material-symbols:star-half-rounded",className:"size-4"}),/* @__PURE__ */r("span",{className:"text-xs font-semibold",children:parseFloat(String(e.score||0)).toFixed(1)})]}):t.engagementStyle===_.REACTION&&t.reactionEmojis?.length?/* @__PURE__ */r(Zt,{eventId:t?._id,contentId:e._id,emojis:t?.reactionEmojis,engagementStyle:t?.engagementStyle,counts:e.reactionCounts||{},userReaction:e.userReaction}):null,te=({content:t})=>/* @__PURE__ */r("div",{className:"w-full space-y-3 px-3 pb-3",children:[t?.caption&&/* @__PURE__ */r("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__ */r("div",{role:"note",title:t?.caption,className:"lg:text-md line-clamp-1 text-xs text-white lg:font-medium",children:t?.caption})}),/* @__PURE__ */r("div",{className:"flex items-center justify-between",children:/* @__PURE__ */r("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})})]}),ee=({event:t,content:e,style:n,timestampField:i,curateLink:s,onChangeFaceUrl:o,hideControls:a})=>{const{organization:l}=L(),c=`content-${e._id}`,d=((t,e)=>{if(!t||!e)return null;const n=e?.[t];if(!n)return null;try{const t=new Date(String(n)),e=/* @__PURE__ */new Date,i=t.getFullYear()===e.getFullYear(),s={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return i||(s.year="numeric"),t.toLocaleString("en-US",s).replace(","," •")}catch{return null}})(i,e);return r("div",{id:c,style:n,className:"group relative mb-1 overflow-hidden rounded",children:[/* @__PURE__ */r(Z,{url:e.src,alt:e.caption,blurhash:e.blurhash,thumbnailUrl:e.thumbnailUrl,curateLink:s,pswpData:{id:e._id,type:v.IMAGE,hash:e._id,width:e.width,height:e.height,thumbnailUrl:e.thumbnailUrl,blurhash:e.blurhash,caption:e.caption,contentSummary:JSON.stringify(e.contentSummary)}}),!a&&/* @__PURE__ */r(h,{children:[d&&/* @__PURE__ */r("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:d}),l?.integrationSettings?.showQuickSearch&&(e.faces?.length??0)>0&&/* @__PURE__ */r("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:()=>{o?.(e?.url);const t=document.getElementById("media-gallery-container");t&&t.scrollIntoView({behavior:"smooth",block:"start"})},children:/* @__PURE__ */r(J,{color:"a11y",name:"material-symbols:familiar-face-and-zone-outline-rounded"})}),
9
9
  /* @__PURE__ */r("div",{className:"",children:[/* @__PURE__ */r("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */r(te,{content:e})}),/* @__PURE__ */r("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */r(Xt,{event:t,content:e,curateLink:s})})]})]})]})},ne=({content:t,style:e,event:n,timestampField:i,curateLink:s,hideControls:o})=>{const a=((t,e)=>{if(!t||!e)return null;const n=e?.[t];if(!n)return null;try{const t=new Date(String(n)),e=/* @__PURE__ */new Date,i=t.getFullYear()===e.getFullYear(),s={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return i||(s.year="numeric"),t.toLocaleString("en-US",s).replace(","," •")}catch{return null}})(i,t);return r("div",{id:`content-${t._id}`,className:"group relative mb-1 overflow-hidden rounded",style:e,children:[/* @__PURE__ */r(Z,{url:t.src??t.url,thumbnailUrl:t.thumbnailUrl,blurhash:t.blurhash,alt:t.caption,curateLink:s,pswpData:{id:t._id,type:v.VIDEO,hash:t._id,width:t.width,height:t.height,thumbnailUrl:t.thumbnailUrl,blurhash:t.blurhash,caption:t.caption}}),!o&&/* @__PURE__ */r("div",{className:"transition-opacity duration-500",children:[a&&/* @__PURE__ */r("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:a}),