@qratilabs/qrati-connect 2.23.9 → 2.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +84 -54
- package/element/2CMH9VMM.js +4 -0
- package/element/{BqHk5hDM.js → BDrHm_qM.js} +3 -3
- package/element/BKDqpSN62.js +3 -0
- package/element/{lrjV8c1G2.js → BM9ujORR2.js} +1 -1
- package/element/{BYEF5Khs.js → BOqkzZ92.js} +1 -1
- package/element/{-p_JqYFM2.js → BP2rYgya2.js} +9 -9
- package/element/BZu3c37u.js +1 -0
- package/element/Bh8kXbe92.js +93 -0
- package/{umd/BvNf2yif2.js → element/Bow6F3212.js} +29 -29
- package/{umd/BkvtmX4K.js → element/BsYbcfkG.js} +1 -1
- package/element/BxErY-nv.js +7 -0
- package/element/{C8_zGNAf.js → C12iSy3L.js} +1 -1
- package/element/{D9NypPiv.js → C3dOFk9A.js} +1 -1
- package/element/C52SUIvC2.js +35 -0
- package/element/{DIYUC8M3.js → CAETItHr.js} +1 -1
- package/element/{Cb1JRT_1.js → CATr-3VW.js} +1 -1
- package/element/{Byk0pccK.js → CFnGGYmq.js} +1 -1
- package/element/CHTzn6mh2.js +4 -0
- package/element/CL_evx_l.js +1 -0
- package/element/{e_wwJ5wx2.js → CLdpUOLk2.js} +4 -4
- package/element/{qWp4ucdT.js → CM46vluW.js} +1 -1
- package/{umd/BtN9y353.js → element/CVRTTCyF.js} +1 -1
- package/{umd/9QY9BKOL2.js → element/CWhnvMey2.js} +8 -8
- package/{umd/B14kCOq8.js → element/CZ9iaxjO.js} +1 -1
- package/element/CaX2xgrP.js +41 -0
- package/element/{b6CwQBFC.js → ChJXhA9c.js} +5 -5
- package/element/{4VTPoA38.js → CqBk9L5O.js} +1 -1
- package/{umd/CiiNqDJq.js → element/CsfDBJh72.js} +1 -1
- package/element/{_ty2jtjs.js → D35mTuTT.js} +1 -1
- package/element/D5TKEdBd2.js +3 -0
- package/element/{CCLXmMXp.js → DF0LxcV7.js} +1 -1
- package/element/{DvTRhlvs.js → DGGc10Cy.js} +1 -1
- package/element/{ekog7y-V.js → DGbyGc8b.js} +1 -1
- package/element/DN26AtHL2.js +4 -0
- package/element/{DsvRTvCp.js → DWBbTgnB.js} +1 -1
- package/element/{BQuhYd4G2.js → DZtaQWVG2.js} +1 -1
- package/{umd/D0VKfxwE.js → element/DdOwRfWG.js} +2 -2
- package/element/DkG0zv7_2.js +9 -0
- package/{umd/gk4TX_a62.js → element/DlRUi0u42.js} +1 -1
- package/element/{DXx41__x2.js → DlqJDAie2.js} +1 -1
- package/element/DnIueBGr2.js +1 -0
- package/element/{BglDIiFp.js → DnQ6XaLR.js} +2 -2
- package/element/DrrpB4Om.js +1 -0
- package/element/DtRwaUYF2.js +85 -0
- package/element/{CSO2IaJ1.js → LYboLIEU.js} +2 -2
- package/{umd/DNG5BSHx2.js → element/N4HKgEC52.js} +1 -1
- package/element/Rcen6i0h.js +80 -0
- package/element/{MpvHkxaz2.js → Z0-Tddye2.js} +1 -1
- package/element/dT6WSX65.js +1 -0
- package/element/h4ZjZXfe2.js +1 -0
- package/element/kiL9JENf2.js +3 -0
- package/element/{BdOzsWR32.js → lcKuIs2T2.js} +1 -1
- package/element/{DdmVPlUC2.js → mIANlVHi2.js} +1 -1
- package/element/mQzpzQ_t.js +3 -0
- package/element/web.es.js +26 -105
- package/package.json +3 -15
- package/react/index.d.mts +182 -6
- package/react/index.d.ts +182 -6
- package/element/9QY9BKOL2.js +0 -8
- package/element/B14kCOq8.js +0 -2
- package/element/BItJQVdK.js +0 -41
- package/element/BYoa-kpQ2.js +0 -9
- package/element/Be1e_ATJ.js +0 -1
- package/element/BfkCwRAR2.js +0 -3
- package/element/BkvtmX4K.js +0 -2
- package/element/BsT0vqml.js +0 -1
- package/element/BtN9y353.js +0 -1
- package/element/BvNf2yif2.js +0 -39
- package/element/C030L_Hu2.js +0 -4
- package/element/C0MGOytI.js +0 -1
- package/element/C3tT7YRo2.js +0 -37
- package/element/C3uDEVBt.js +0 -1
- package/element/CJ5ChvJ52.js +0 -93
- package/element/CiiNqDJq.js +0 -3
- package/element/CnoPTYOO.js +0 -1
- package/element/D0VKfxwE.js +0 -10
- package/element/D4apO9G62.js +0 -4
- package/element/DB1jhaAe2.js +0 -85
- package/element/DNG5BSHx2.js +0 -2
- package/element/LJWh_4Di.js +0 -2
- package/element/gjXXuILV2.js +0 -3
- package/element/gk4TX_a62.js +0 -7
- package/element/qNDy94Dr2.js +0 -3
- package/element/srDF4VyG.js +0 -9
- package/element/styles.css +0 -288
- package/umd/-p_JqYFM2.js +0 -14
- package/umd/4VTPoA38.js +0 -1
- package/umd/BCTYvPrD.js +0 -1
- package/umd/BItJQVdK.js +0 -41
- package/umd/BQuhYd4G2.js +0 -2
- package/umd/BYEF5Khs.js +0 -1
- package/umd/BYoa-kpQ2.js +0 -9
- package/umd/BdOzsWR32.js +0 -9
- package/umd/Be1e_ATJ.js +0 -1
- package/umd/BfkCwRAR2.js +0 -3
- package/umd/BglDIiFp.js +0 -3
- package/umd/BkIDQGIs.js +0 -1
- package/umd/Bki5T_lb.js +0 -1
- package/umd/BqHk5hDM.js +0 -9
- package/umd/BsT0vqml.js +0 -1
- package/umd/Byk0pccK.js +0 -1
- package/umd/C030L_Hu2.js +0 -4
- package/umd/C0MGOytI.js +0 -1
- package/umd/C3tT7YRo2.js +0 -37
- package/umd/C3uDEVBt.js +0 -1
- package/umd/C8_zGNAf.js +0 -1
- package/umd/CCLXmMXp.js +0 -3
- package/umd/CJ5ChvJ52.js +0 -93
- package/umd/CSO2IaJ1.js +0 -2
- package/umd/Cb1JRT_1.js +0 -1
- package/umd/CfMNBPpx2.js +0 -1
- package/umd/CgUphJWo.js +0 -1
- package/umd/Cko4QHwX.js +0 -1
- package/umd/CnoPTYOO.js +0 -1
- package/umd/D4apO9G62.js +0 -4
- package/umd/D9NypPiv.js +0 -7
- package/umd/DB1jhaAe2.js +0 -85
- package/umd/DIYUC8M3.js +0 -2
- package/umd/DXx41__x2.js +0 -2
- package/umd/DdmVPlUC2.js +0 -13
- package/umd/DsvRTvCp.js +0 -8
- package/umd/DvTRhlvs.js +0 -2
- package/umd/LJWh_4Di.js +0 -2
- package/umd/MpvHkxaz2.js +0 -16
- package/umd/_ty2jtjs.js +0 -2
- package/umd/b6CwQBFC.js +0 -5
- package/umd/e_wwJ5wx2.js +0 -5
- package/umd/ekog7y-V.js +0 -1
- package/umd/gjXXuILV2.js +0 -3
- package/umd/index.d.ts +0 -14
- package/umd/lrjV8c1G2.js +0 -8
- package/umd/qNDy94Dr2.js +0 -3
- package/umd/qWp4ucdT.js +0 -1
- package/umd/rtH8O6Hc.js +0 -1
- package/umd/srDF4VyG.js +0 -9
- package/umd/web.es.js +0 -122
- package/umd/web.umd.js +0 -1
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import{
|
|
2
|
-
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5zm0 0V5zm2-2h10q.3 0 .45-.275t-.05-.525l-2.75-3.675q-.15-.2-.4-.2t-.4.2L11.25 16L9.4 13.525q-.15-.2-.4-.2t-.4.2l-2 2.675q-.2.25-.05.525T7 17"})})}function
|
|
3
|
-
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M15.188 14.688Q16.5 13.375 16.5 11.5t-1.312-3.187T12 7T8.813 8.313T7.5 11.5t1.313 3.188T12 16t3.188-1.312m-5.1-1.276Q9.3 12.625 9.3 11.5t.788-1.912T12 8.8t1.913.788t.787 1.912t-.787 1.913T12 14.2t-1.912-.787m-4.2 3.787q-2.763-1.8-4.363-4.75q-.125-.225-.187-.462t-.063-.488t.063-.488t.187-.462q1.6-2.95 4.363-4.75T12 4t6.113 1.8t4.362 4.75q.125.225.188.463t.062.487t-.062.488t-.188.462q-1.6 2.95-4.362 4.75T12 19t-6.113-1.8m11.3-1.687Q19.55 14.025 20.8 11.5q-1.25-2.525-3.613-4.012T12 6T6.813 7.488T3.2 11.5q1.25 2.525 3.613 4.013T12 17t5.188-1.487"})})}var
|
|
1
|
+
import{_ as e,d as t,f as n,h as r,p as a,s as i,t as s,v as o,w as l}from"./DrrpB4Om.js";import{C as c,D as d,L as u,M as m,N as g,O as h,P as p,S as f,_ as v,b as w,d as T,f as y,g as N,h as q,i as x,j as b,m as E,n as C,p as S,u as I,v as L,x as z,y as k}from"./CaX2xgrP.js";import{n as M,r as A,t as P}from"./C12iSy3L.js";import{t as _,u as R}from"./ChJXhA9c.js";import{n as O,t as V}from"./CATr-3VW.js";import{a as F,c as j,i as B,l as H,n as U,o as G,r as $,s as D,t as W,u as Q}from"./DdOwRfWG.js";import{t as K}from"./DF0LxcV7.js";import{t as Z}from"./DGbyGc8b.js";import{r as Y}from"./DGGc10Cy.js";import{n as J,t as X}from"./C3dOFk9A.js";import{t as ee}from"./CAETItHr.js";import{t as te}from"./CM46vluW.js";import{t as ne}from"./CZ9iaxjO.js";import{a as re,i as ae,n as ie,o as se,r as oe,s as le,t as ce}from"./CsfDBJh72.js";import{c as de,i as ue,n as me,t as ge}from"./D5TKEdBd2.js";import{n as he,t as pe}from"./DlqJDAie2.js";function fe({className:e}){/* @__PURE__ */
|
|
2
|
+
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5zm0 0V5zm2-2h10q.3 0 .45-.275t-.05-.525l-2.75-3.675q-.15-.2-.4-.2t-.4.2L11.25 16L9.4 13.525q-.15-.2-.4-.2t-.4.2l-2 2.675q-.2.25-.05.525T7 17"})})}function ve({className:e}){/* @__PURE__ */
|
|
3
|
+
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M15.188 14.688Q16.5 13.375 16.5 11.5t-1.312-3.187T12 7T8.813 8.313T7.5 11.5t1.313 3.188T12 16t3.188-1.312m-5.1-1.276Q9.3 12.625 9.3 11.5t.788-1.912T12 8.8t1.913.788t.787 1.912t-.787 1.913T12 14.2t-1.912-.787m-4.2 3.787q-2.763-1.8-4.363-4.75q-.125-.225-.187-.462t-.063-.488t.063-.488t.187-.462q1.6-2.95 4.363-4.75T12 4t6.113 1.8t4.362 4.75q.125.225.188.463t.062.487t-.062.488t-.188.462q-1.6 2.95-4.362 4.75T12 19t-6.113-1.8m11.3-1.687Q19.55 14.025 20.8 11.5q-1.25-2.525-3.613-4.012T12 6T6.813 7.488T3.2 11.5q1.25 2.525 3.613 4.013T12 17t5.188-1.487"})})}var we=({description:t,maxLines:a=2,className:i})=>{const[o,l]=r(!1),[c,d]=r(!1),u=n(null),m=n(null);return e(()=>{l(!1)},[t]),e(()=>{if(!u.current||!t)return void d(!1);const e=u.current,n=()=>{const t=window.getComputedStyle(e),r=Math.max(0,Math.floor(e.getBoundingClientRect().width));if(!r)return void(m.current=window.requestAnimationFrame(n));const i=t.lineHeight,s=parseFloat(t.fontSize)||16;let o=1.2*s;i&&"normal"!==i&&(o=i.endsWith("px")?parseFloat(i):parseFloat(i)*s);const l=document.createElement("div");l.style.position="absolute",l.style.visibility="hidden",l.style.pointerEvents="none",l.style.whiteSpace="normal",l.style.width=`${r}px`,l.style.boxSizing=t.boxSizing,l.style.padding=t.padding,l.style.margin=t.margin,l.style.fontSize=t.fontSize,l.style.fontFamily=t.fontFamily,l.style.fontWeight=t.fontWeight,l.style.lineHeight=t.lineHeight,l.style.letterSpacing=t.letterSpacing,l.style.wordBreak="break-word",l.innerText=e.innerText||"",document.body.appendChild(l);const c=l.scrollHeight;document.body.removeChild(l),d(c>o*a+1)},r=()=>{null!==m.current&&window.cancelAnimationFrame(m.current),m.current=window.requestAnimationFrame(n)};let i;r(),window.addEventListener("resize",r);try{i=new MutationObserver(r),i.observe(e,{characterData:!0,childList:!0,subtree:!0})}catch{}return()=>{window.removeEventListener("resize",r),null!==m.current&&window.cancelAnimationFrame(m.current),i?.disconnect()}},[t,a]),t?/* @__PURE__ */s("div",{className:x("relative w-full",i),children:[/* @__PURE__ */s("p",{ref:u,className:x(O({variant:"body2",color:"muted",align:"center"}),"w-full",o?void 0:`line-clamp-${a}`),children:[t,c&&o&&/* @__PURE__ */s("button",{type:"button",onClick:()=>l(!1),className:"text-primary ml-2 text-sm font-medium hover:underline cursor-pointer",children:"see less"})]}),c&&!o&&/* @__PURE__ */s("span",{className:"bg-background absolute right-0 bottom-0 inline-flex items-center pl-2",children:[/* @__PURE__ */s("span",{className:"text-muted-foreground",children:"..."}),/* @__PURE__ */s("button",{type:"button",onClick:()=>l(!0),className:"text-primary ml-1 text-sm font-medium hover:underline cursor-pointer",children:"see more"})]})]}):null},Te=()=>{const{t:e}=Y(),{eventSlug:t}=R(),{event:n}=te({eventSlug:t}),{props:r,organization:a}=C(),{curateLabel:i,leaderboardLabel:o}=r??{},{eventViews:l,contentCount:c,curationCount:u}=(({event:e})=>{const{props:t,organization:n}=C(),r=t?.organizationId,{isLoading:a,data:i}=p({queryKey:["event-stats",r??"",e?._id??""],queryFn:async()=>{try{return(await g.get(I.GET_EVENT_STATISTICS,{searchParams:{eventSlug:e?.slug},headers:{"x-org-id":r}}).json()).data}catch(t){throw new Error(t instanceof Error?t.message:String(t)||"Failed to fetch event stats")}},enabled:!!e&&Boolean(n?.integrationSettings?.showEventStats)});return{isLoading:a,eventViews:"number"==typeof i?.eventViews?i.eventViews:i?.eventViews?.views??0,contentCount:i?.contentCount||0,curationCount:i?.curationCount||0}})({event:n});/* @__PURE__ */
|
|
4
4
|
return s("div",{className:"w-full space-y-3",children:[
|
|
5
|
-
/* @__PURE__ */s("div",{className:"space-y-2 md:-mt-8",children:[/* @__PURE__ */s(
|
|
6
|
-
/* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */s(
|
|
7
|
-
/* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */s(
|
|
8
|
-
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M12.275 9H19.4q-.675-1.725-2.062-2.963T14.15 4.3l-2.3 3.95q-.15.25 0 .5t.425.25m-3.6 1.25q.15.25.425.25t.425-.25L13.1 4.1q-.275-.05-.55-.075T12 4q-1.65 0-3.075.625T6.4 6.3zM4.25 14h4.575q.275 0 .438-.25t.012-.5L5.7 7.1q-.8 1.025-1.25 2.263T4 12q0 .525.063 1.013T4.25 14m5.6 5.7l2.275-3.95q.15-.25-.012-.5t-.438-.25H4.6q.675 1.725 2.063 2.963T9.85 19.7M12 20q1.65 0 3.075-.625T17.6 17.7l-2.275-3.95q-.15-.25-.425-.25t-.425.25L10.9 19.9q.275.05.538.075T12 20m6.3-3.1q.8-1.025 1.25-2.262T20 12q0-.525-.062-1.012T19.75 10h-4.575q-.275 0-.437.25t-.013.5zM12 22q-2.05 0-3.875-.788t-3.187-2.15t-2.15-3.187T2 12q0-2.075.788-3.887t2.15-3.175t3.187-2.15T12 2q2.075 0 3.888.788t3.174 2.15t2.15 3.175T22 12q0 2.05-.788 3.875t-2.15 3.188t-3.175 2.15T12 22"})})}function
|
|
9
|
-
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M11.25 16L9.6 13.8q-.225-.3-.6-.3t-.6.3l-1.8 2.4q-.2.25-.05.525T7 17h10q.3 0 .45-.275t-.05-.525l-2.475-3.3q-.275-.05-.563-.125T13.8 12.6zM5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h4q.425 0 .713.288T10 4t-.288.713T9 5H5v14h14v-3.325q0-.425.288-.712t.712-.288t.713.288t.287.712V19q0 .825-.587 1.413T19 21zm11.05-10q-1.85 0-3.15-1.312T11.6 6.5t1.313-3.187T16.1 2t3.188 1.313T20.6 6.5q0 .675-.2 1.3t-.5 1.15l2.35 2.35q.275.275.275.7t-.275.7t-.7.275t-.7-.275l-2.4-2.4q-.525.35-1.125.525T16.05 11m.05-2q1.05 0 1.775-.725T18.6 6.5t-.725-1.775T16.1 4t-1.775.725T13.6 6.5t.725 1.775T16.1 9"})})}function
|
|
10
|
-
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M7 21q-.425 0-.712-.288T6 20t.288-.712T7 19h4v-3H4q-.825 0-1.412-.587T2 14V5q0-.825.588-1.412T4 3h16q.825 0 1.413.588T22 5v9q0 .825-.587 1.413T20 16h-7v3h4q.425 0 .713.288T18 20t-.288.713T17 21zm-3-7h16V5H4zm0 0V5z"})})}function
|
|
11
|
-
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M12 20q-.825 0-1.412-.587T10 18t.588-1.412T12 16t1.413.588T14 18t-.587 1.413T12 20m0-6q-.825 0-1.412-.587T10 12t.588-1.412T12 10t1.413.588T14 12t-.587 1.413T12 14m0-6q-.825 0-1.412-.587T10 6t.588-1.412T12 4t1.413.588T14 6t-.587 1.413T12 8"})})}function
|
|
12
|
-
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M9 20v-4q-1.275-.1-2.5-.275t-2.45-.45q-.425-.1-.675-.475T3.25 14t.513-.625t.812-.1q1.825.425 3.688.575T12 14t3.738-.15t3.687-.575q.45-.1.825.1t.5.625t-.137.8t-.688.475q-1.225.275-2.45.45T15 16v4q0 .425-.287.713T14 21h-4q-.425 0-.712-.288T9 20m3-7q-.85 0-1.425-.575T10 11q0-.825.575-1.412T12 9q.825 0 1.413.588T14 11q0 .85-.587 1.425T12 13m-7.5-3q-.65 0-1.075-.425T3 8.5q0-.625.425-1.062T4.5 7q.625 0 1.063.438T6 8.5q0 .65-.437 1.075T4.5 10m15 0q-.65 0-1.075-.425T18 8.5q0-.625.425-1.062T19.5 7q.625 0 1.063.438T21 8.5q0 .65-.437 1.075T19.5 10M7.25 6.25q-.65 0-1.075-.425T5.75 4.75q0-.625.425-1.062T7.25 3.25q.625 0 1.063.438T8.75 4.75q0 .65-.437 1.075T7.25 6.25m9.5 0q-.65 0-1.075-.425T15.25 4.75q0-.625.425-1.062t1.075-.438q.625 0 1.063.438t.437 1.062q0 .65-.437 1.075t-1.063.425M12 5q-.65 0-1.075-.425T10.5 3.5q0-.625.425-1.062T12 2q.625 0 1.063.438T13.5 3.5q0 .65-.437 1.075T12 5"})})}function
|
|
13
|
-
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M11 12q-1.65 0-2.825-1.175T7 8t1.175-2.825T11 4t2.825 1.175T15 8t-1.175 2.825T11 12m0-2q.825 0 1.413-.587T13 8t-.587-1.412T11 6t-1.412.588T9 8t.588 1.413T11 10m10.4 12.8l-2.5-2.5q-.525.3-1.125.5T16.5 21q-1.875 0-3.187-1.312T12 16.5t1.313-3.187T16.5 12t3.188 1.313T21 16.5q0 .675-.2 1.275t-.5 1.125l2.5 2.5q.275.275.275.7t-.275.7t-.7.275t-.7-.275m-3.125-4.525Q19 17.55 19 16.5t-.725-1.775T16.5 14t-1.775.725T14 16.5t.725 1.775T16.5 19t1.775-.725M3 18v-.775q0-.85.425-1.575t1.175-1.1q1.05-.55 2.338-.962t2.637-.538q.425-.05.725.25t.3.725t-.3.738t-.725.362q-1.425.175-2.4.525t-1.65.7q-.25.125-.387.363T5 17.225V18h4.6q.425 0 .713.288T10.6 19t-.287.713T9.6 20H5q-.825 0-1.412-.587T3 18m7.175 0"})})}function
|
|
14
|
-
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M5 11q-.825 0-1.412-.587T3 9V5q0-.825.588-1.412T5 3h4q.825 0 1.413.588T11 5v4q0 .825-.587 1.413T9 11zm0 10q-.825 0-1.412-.587T3 19v-4q0-.825.588-1.412T5 13h4q.825 0 1.413.588T11 15v4q0 .825-.587 1.413T9 21zm10-10q-.825 0-1.412-.587T13 9V5q0-.825.588-1.412T15 3h4q.825 0 1.413.588T21 5v4q0 .825-.587 1.413T19 11zm0 10q-.825 0-1.412-.587T13 19v-4q0-.825.588-1.412T15 13h4q.825 0 1.413.588T21 15v4q0 .825-.587 1.413T19 21zM5 9h4V5H5zm10 0h4V5h-4zm0 10h4v-4h-4zM5 19h4v-4H5zM9 9"})})}function
|
|
15
|
-
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3c4.97 0 9 4.03 9 9",children:/* @__PURE__ */s("animateTransform",{attributeName:"transform",dur:"1.5s",repeatCount:"indefinite",type:"rotate",values:"0 12 12;360 12 12"})})})}var
|
|
16
|
-
return s($,{children:[/* @__PURE__ */s(G,{children:/* @__PURE__ */s(o?Se
|
|
17
|
-
return s("div",{className:"text-muted-foreground sm:text-foreground flex flex-row items-center justify-end gap-6 pr-1 sm:justify-between sm:pr-4",children:["undefined"!=typeof document&&document?.fullscreenEnabled&&t&&/* @__PURE__ */s(j,{content:n("event.kiosk_mode","Kiosk Mode"),children:/* @__PURE__ */s("button",{onClick:t,className:"hidden sm:block",children:/* @__PURE__ */s(
|
|
18
|
-
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M4 18q-.425 0-.712-.288T3 17t.288-.712T4 16h16q.425 0 .713.288T21 17t-.288.713T20 18zm0-5q-.425 0-.712-.288T3 12t.288-.712T4 11h16q.425 0 .713.288T21 12t-.288.713T20 13zm0-5q-.425 0-.712-.288T3 7t.288-.712T4 6h16q.425 0 .713.288T21 7t-.288.713T20 8z"})})}var
|
|
19
|
-
return s("div",{className:"relative flex w-auto items-center gap-2",children:[/* @__PURE__ */s("button",{type:"button",className:"bg-background rounded p-1",onClick:i,children:/* @__PURE__ */s("svg",{xmlns:"http://www.w3.org/2000/svg",className:x("text-foreground w-7 -scale-x-100 transition-transform",n===b.ASC&&"-scale-y-100"),viewBox:"0 0 24 24",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M4 18q-.425 0-.712-.288T3 17t.288-.712T4 16h4q.425 0 .713.288T9 17t-.288.713T8 18zm0-5q-.425 0-.712-.288T3 12t.288-.712T4 11h10q.425 0 .713.288T15 12t-.288.713T14 13zm0-5q-.425 0-.712-.288T3 7t.288-.712T4 6h16q.425 0 .713.288T21 7t-.288.713T20 8z"})})}),/* @__PURE__ */s(Q,{className:"flex-1 lg:flex-none",selected:t,buttons:l,onChange:e=>r&&r(e)})]})},
|
|
20
|
-
/* @__PURE__ */s("input",{ref:c,type:"file",accept:"image/*",className:"hidden",onChange:e=>{const t=e.target?.files?.[0]??null;if(!t)return;const n=(t.name.split(".").pop()||"").toLowerCase();if(!
|
|
21
|
-
/* @__PURE__ */s("div",{className:"col-span-3 flex items-center gap-4 md:col-span-1",children:[v?.integrationSettings?.showGridViewToggle&&/* @__PURE__ */s(Q,{buttons:
|
|
22
|
-
/* @__PURE__ */s(
|
|
23
|
-
/* @__PURE__ */s("button",{className:"absolute inset-y-0 right-3 flex items-center",onClick:L,children:/* @__PURE__ */s(U,{className:"text-foreground w-5"})})]})}),v?.integrationSettings?.showFacialSearch&&/* @__PURE__ */s(
|
|
5
|
+
/* @__PURE__ */s("div",{className:"space-y-2 md:-mt-8",children:[/* @__PURE__ */s(V,{variant:"h4",align:"center",immutable:!0,className:"mx-auto max-w-2xl",children:n?.name}),/* @__PURE__ */s(we,{description:n?.description})]}),a?.integrationSettings?.showEventStats&&/* @__PURE__ */s("div",{className:"flex justify-center",children:/* @__PURE__ */s("div",{className:"flex items-center gap-6",children:[
|
|
6
|
+
/* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */s(ve,{className:"text-primary"}),/* @__PURE__ */s(V,{variant:"body1",className:"font-medium",children:l??0})]}),
|
|
7
|
+
/* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */s(fe,{className:"text-primary"}),/* @__PURE__ */s(V,{variant:"body1",className:"font-medium",children:c})]}),n?.engagementStyle===L.CONTEST&&/* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */s(le,{className:"text-primary"}),/* @__PURE__ */s(V,{variant:"body1",className:"font-medium",children:u})]})]})}),(n?.status===k.OPEN&&n?.uploadLimit&&n.uploadLimit>0||n?.status===k.OPEN&&n?.engagementStyle===L.CONTEST||n?.engagementStyle===L.REACTION&&n?.showLeaderboard||n?.engagementStyle===L.CONTEST)&&/* @__PURE__ */s("div",{className:"flex w-full flex-wrap justify-center gap-3",children:[n?.status===k.OPEN&&n?.uploadLimit&&n.uploadLimit>0&&/* @__PURE__ */s(_,{to:d.UPLOAD(n?.slug??""),children:/* @__PURE__ */s(X,{icon:/* @__PURE__ */s(de,{className:"size-5"}),children:e("content.upload","Upload")})}),n?.status===k.OPEN&&n?.engagementStyle===L.CONTEST&&/* @__PURE__ */s(_,{to:d.CURATE(n?.slug??""),children:/* @__PURE__ */s(X,{icon:/* @__PURE__ */s(le,{className:"size-5"}),children:i||e("content.curate","Curate")})}),n?.showLeaderboard&&/* @__PURE__ */s(_,{to:d.LEADERBOARD(n?.slug??""),children:/* @__PURE__ */s(X,{icon:/* @__PURE__ */s(ne,{className:"size-5"}),children:o||e("content.leaderboard","Leaderboard")})})]})]})},ye=(e,t)=>["in-review-count",e??"",t??""];function Ne({className:e}){/* @__PURE__ */
|
|
8
|
+
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M12.275 9H19.4q-.675-1.725-2.062-2.963T14.15 4.3l-2.3 3.95q-.15.25 0 .5t.425.25m-3.6 1.25q.15.25.425.25t.425-.25L13.1 4.1q-.275-.05-.55-.075T12 4q-1.65 0-3.075.625T6.4 6.3zM4.25 14h4.575q.275 0 .438-.25t.012-.5L5.7 7.1q-.8 1.025-1.25 2.263T4 12q0 .525.063 1.013T4.25 14m5.6 5.7l2.275-3.95q.15-.25-.012-.5t-.438-.25H4.6q.675 1.725 2.063 2.963T9.85 19.7M12 20q1.65 0 3.075-.625T17.6 17.7l-2.275-3.95q-.15-.25-.425-.25t-.425.25L10.9 19.9q.275.05.538.075T12 20m6.3-3.1q.8-1.025 1.25-2.262T20 12q0-.525-.062-1.012T19.75 10h-4.575q-.275 0-.437.25t-.013.5zM12 22q-2.05 0-3.875-.788t-3.187-2.15t-2.15-3.187T2 12q0-2.075.788-3.887t2.15-3.175t3.187-2.15T12 2q2.075 0 3.888.788t3.174 2.15t2.15 3.175T22 12q0 2.05-.788 3.875t-2.15 3.188t-3.175 2.15T12 22"})})}function qe({className:e}){/* @__PURE__ */
|
|
9
|
+
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M11.25 16L9.6 13.8q-.225-.3-.6-.3t-.6.3l-1.8 2.4q-.2.25-.05.525T7 17h10q.3 0 .45-.275t-.05-.525l-2.475-3.3q-.275-.05-.563-.125T13.8 12.6zM5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h4q.425 0 .713.288T10 4t-.288.713T9 5H5v14h14v-3.325q0-.425.288-.712t.712-.288t.713.288t.287.712V19q0 .825-.587 1.413T19 21zm11.05-10q-1.85 0-3.15-1.312T11.6 6.5t1.313-3.187T16.1 2t3.188 1.313T20.6 6.5q0 .675-.2 1.3t-.5 1.15l2.35 2.35q.275.275.275.7t-.275.7t-.7.275t-.7-.275l-2.4-2.4q-.525.35-1.125.525T16.05 11m.05-2q1.05 0 1.775-.725T18.6 6.5t-.725-1.775T16.1 4t-1.775.725T13.6 6.5t.725 1.775T16.1 9"})})}function xe({className:e}){/* @__PURE__ */
|
|
10
|
+
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M7 21q-.425 0-.712-.288T6 20t.288-.712T7 19h4v-3H4q-.825 0-1.412-.587T2 14V5q0-.825.588-1.412T4 3h16q.825 0 1.413.588T22 5v9q0 .825-.587 1.413T20 16h-7v3h4q.425 0 .713.288T18 20t-.288.713T17 21zm-3-7h16V5H4zm0 0V5z"})})}function be({className:e}){/* @__PURE__ */
|
|
11
|
+
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M12 20q-.825 0-1.412-.587T10 18t.588-1.412T12 16t1.413.588T14 18t-.587 1.413T12 20m0-6q-.825 0-1.412-.587T10 12t.588-1.412T12 10t1.413.588T14 12t-.587 1.413T12 14m0-6q-.825 0-1.412-.587T10 6t.588-1.412T12 4t1.413.588T14 6t-.587 1.413T12 8"})})}function Ee({className:e}){/* @__PURE__ */
|
|
12
|
+
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M9 20v-4q-1.275-.1-2.5-.275t-2.45-.45q-.425-.1-.675-.475T3.25 14t.513-.625t.812-.1q1.825.425 3.688.575T12 14t3.738-.15t3.687-.575q.45-.1.825.1t.5.625t-.137.8t-.688.475q-1.225.275-2.45.45T15 16v4q0 .425-.287.713T14 21h-4q-.425 0-.712-.288T9 20m3-7q-.85 0-1.425-.575T10 11q0-.825.575-1.412T12 9q.825 0 1.413.588T14 11q0 .85-.587 1.425T12 13m-7.5-3q-.65 0-1.075-.425T3 8.5q0-.625.425-1.062T4.5 7q.625 0 1.063.438T6 8.5q0 .65-.437 1.075T4.5 10m15 0q-.65 0-1.075-.425T18 8.5q0-.625.425-1.062T19.5 7q.625 0 1.063.438T21 8.5q0 .65-.437 1.075T19.5 10M7.25 6.25q-.65 0-1.075-.425T5.75 4.75q0-.625.425-1.062T7.25 3.25q.625 0 1.063.438T8.75 4.75q0 .65-.437 1.075T7.25 6.25m9.5 0q-.65 0-1.075-.425T15.25 4.75q0-.625.425-1.062t1.075-.438q.625 0 1.063.438t.437 1.062q0 .65-.437 1.075t-1.063.425M12 5q-.65 0-1.075-.425T10.5 3.5q0-.625.425-1.062T12 2q.625 0 1.063.438T13.5 3.5q0 .65-.437 1.075T12 5"})})}function Ce({className:e}){/* @__PURE__ */
|
|
13
|
+
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M11 12q-1.65 0-2.825-1.175T7 8t1.175-2.825T11 4t2.825 1.175T15 8t-1.175 2.825T11 12m0-2q.825 0 1.413-.587T13 8t-.587-1.412T11 6t-1.412.588T9 8t.588 1.413T11 10m10.4 12.8l-2.5-2.5q-.525.3-1.125.5T16.5 21q-1.875 0-3.187-1.312T12 16.5t1.313-3.187T16.5 12t3.188 1.313T21 16.5q0 .675-.2 1.275t-.5 1.125l2.5 2.5q.275.275.275.7t-.275.7t-.7.275t-.7-.275m-3.125-4.525Q19 17.55 19 16.5t-.725-1.775T16.5 14t-1.775.725T14 16.5t.725 1.775T16.5 19t1.775-.725M3 18v-.775q0-.85.425-1.575t1.175-1.1q1.05-.55 2.338-.962t2.637-.538q.425-.05.725.25t.3.725t-.3.738t-.725.362q-1.425.175-2.4.525t-1.65.7q-.25.125-.387.363T5 17.225V18h4.6q.425 0 .713.288T10.6 19t-.287.713T9.6 20H5q-.825 0-1.412-.587T3 18m7.175 0"})})}function Se({className:e}){/* @__PURE__ */
|
|
14
|
+
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M5 11q-.825 0-1.412-.587T3 9V5q0-.825.588-1.412T5 3h4q.825 0 1.413.588T11 5v4q0 .825-.587 1.413T9 11zm0 10q-.825 0-1.412-.587T3 19v-4q0-.825.588-1.412T5 13h4q.825 0 1.413.588T11 15v4q0 .825-.587 1.413T9 21zm10-10q-.825 0-1.412-.587T13 9V5q0-.825.588-1.412T15 3h4q.825 0 1.413.588T21 5v4q0 .825-.587 1.413T19 11zm0 10q-.825 0-1.412-.587T13 19v-4q0-.825.588-1.412T15 13h4q.825 0 1.413.588T21 15v4q0 .825-.587 1.413T19 21zM5 9h4V5H5zm10 0h4V5h-4zm0 10h4v-4h-4zM5 19h4v-4H5zM9 9"})})}function Ie({className:e}){/* @__PURE__ */
|
|
15
|
+
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3c4.97 0 9 4.03 9 9",children:/* @__PURE__ */s("animateTransform",{attributeName:"transform",dur:"1.5s",repeatCount:"indefinite",type:"rotate",values:"0 12 12;360 12 12"})})})}var Le=({event:e})=>{const t=u(),{user:n,props:a}=C(),i=a?.organizationId,[o,l]=r(!1);/* @__PURE__ */
|
|
16
|
+
return s($,{children:[/* @__PURE__ */s(G,{children:/* @__PURE__ */s(o?Ie:Se,{className:"size-6"})}),/* @__PURE__ */s(B,{align:"end",side:"bottom",className:"w-44",children:Object.values(f).map(r=>/* @__PURE__ */s(F,{onClick:()=>(async r=>{l(!0);try{const a=new FormData;a.append("eventId",e?._id??""),a.append("galleryLayout",r),await g.post(I.UPDATE_EVENT_LAYOUT,{body:a,headers:{"x-org-id":i,Authorization:n?`Bearer ${n.token}`:void 0}}),t.invalidateQueries({queryKey:[`event-data-${i??""}-${e?.slug??""}`]})}catch(a){console.error(a)}l(!1)})(r),isChecked:e?.galleryLayout===r,title:he(r)},r))})]})},ze=({event:e,onAutoscrollClick:t})=>{const{t:n}=Y(),{isSuper:r,isOwner:i,isAdmin:o,isModerator:l}=H(),{inReviewCount:c}=(e=>{const t=u(),{props:n}=C(),r=n?.organizationId,{role:a,isSuper:i}=H(),{isLoading:s,data:o,isError:l,error:c}=p({queryKey:ye(r,e?.slug),queryFn:async()=>{try{const t=await g.get(I.GET_CONTENTS_COUNT,{searchParams:{eventSlug:e?.slug,filter:`status:${S.IN_REVIEW}`},headers:{"x-org-id":r}}).json();if(t.error)throw new Error(t.error);return t.data}catch(t){throw new Error(t instanceof Error?t.message:String(t)||"Failed to fetch in review count")}},staleTime:0,enabled:Boolean(a)||Boolean(i)});return{loading:s,inReviewCount:o,error:l?c:null,increment:()=>{t.setQueryData(ye(r,e?.slug),e=>(e??0)+1)},decrement:()=>{t.setQueryData(ye(r,e?.slug),e=>Math.max(0,(e??0)-1))}}})(e),d=r||i||o||l,m=r||i||o,h=a(()=>{const t=[];return m&&t.push({title:n("event.shot_inspector","Shot Inspector"),icon:Ne,href:z.EVENT_SHOT_INSPECTOR(e?.slug??"")}),e?.visibility===w.PRIVATE&&d&&t.push({title:n("event.access_requests","Access Requests"),icon:Ce,href:z.EVENT_ACCESS_REQUESTS(e?.slug??"")}),e?.engagementStyle===L.CONTEST&&m&&t.push({title:n("event.curation_details","Curation Details"),icon:Ee,href:z.EVENT_CURATION_DETAILS(e?.slug??"")}),m&&t.push({title:n("event.edit_event","Edit Event"),icon:D,href:z.EVENT_SETTINGS_BASIC_DETAILS(e?.slug??"")}),t},[e,m,d]);/* @__PURE__ */
|
|
17
|
+
return s("div",{className:"text-muted-foreground sm:text-foreground flex flex-row items-center justify-end gap-6 pr-1 sm:justify-between sm:pr-4",children:["undefined"!=typeof document&&document?.fullscreenEnabled&&t&&/* @__PURE__ */s(j,{content:n("event.kiosk_mode","Kiosk Mode"),children:/* @__PURE__ */s("button",{onClick:t,className:"hidden sm:block",children:/* @__PURE__ */s(xe,{className:"size-6"})})}),"undefined"!=typeof document&&document?.fullscreenEnabled&&m&&/* @__PURE__ */s(Le,{event:e}),d&&/* @__PURE__ */s(j,{content:n("event.review_contents","Review Contents"),children:/* @__PURE__ */s("a",{target:"_blank",rel:"noreferrer",href:z.EVENT_REVIEW_CONTENTS(e?.slug??""),className:"relative",children:[/* @__PURE__ */s(qe,{className:"size-6"}),Number(c)>0&&/* @__PURE__ */s("div",{className:"bg-primary text-primary-foreground absolute -top-2 -right-2 rounded-lg px-1 py-0 text-xs",children:c})]})}),h.length>0&&/* @__PURE__ */s($,{children:[/* @__PURE__ */s(G,{children:/* @__PURE__ */s(be,{className:"size-6"})}),/* @__PURE__ */s(B,{align:"end",side:"bottom",className:"w-48",children:h.map(e=>/* @__PURE__ */s(F,{href:e.href,icon:/* @__PURE__ */s(e.icon,{className:"text-primary"}),title:e.title,suffix:e?.chip?/* @__PURE__ */s("span",{className:"bg-primary text-primary-foreground rounded-full px-1.5 py-0.5 text-[0.5rem] font-medium sm:text-xs",children:e.chip}):void 0,isBeta:"BETA"===e?.chip},e.href??e.title))})]})]})};function ke({className:e}){/* @__PURE__ */
|
|
18
|
+
return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M4 18q-.425 0-.712-.288T3 17t.288-.712T4 16h16q.425 0 .713.288T21 17t-.288.713T20 18zm0-5q-.425 0-.712-.288T3 12t.288-.712T4 11h16q.425 0 .713.288T21 12t-.288.713T20 13zm0-5q-.425 0-.712-.288T3 7t.288-.712T4 6h16q.425 0 .713.288T21 7t-.288.713T20 8z"})})}var Me=({engagementStyle:e,sort:t=N,order:n=v,onSortChange:r,onSortOrderChange:i})=>{const{t:o}=Y(),l=a(()=>{const t=Object.keys(y).map(e=>({text:o(`content.sortby_${y[e].label.toLowerCase()}`,y[e].label),value:e,activeClassName:"bg-primary text-primary-foreground"}));return e===L.CONTEST?t:t.filter(e=>e.value!==T.POPULAR)},[e,o]);/* @__PURE__ */
|
|
19
|
+
return s("div",{className:"relative flex w-auto items-center gap-2",children:[/* @__PURE__ */s("button",{type:"button",className:"bg-background rounded p-1",onClick:i,children:/* @__PURE__ */s("svg",{xmlns:"http://www.w3.org/2000/svg",className:x("text-foreground w-7 -scale-x-100 transition-transform",n===b.ASC&&"-scale-y-100"),viewBox:"0 0 24 24",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M4 18q-.425 0-.712-.288T3 17t.288-.712T4 16h4q.425 0 .713.288T9 17t-.288.713T8 18zm0-5q-.425 0-.712-.288T3 12t.288-.712T4 11h10q.425 0 .713.288T15 12t-.288.713T14 13zm0-5q-.425 0-.712-.288T3 7t.288-.712T4 6h16q.425 0 .713.288T21 7t-.288.713T20 8z"})})}),/* @__PURE__ */s(Q,{className:"flex-1 lg:flex-none",selected:t,buttons:l,onChange:e=>r&&r(e)})]})},Ae=["jpg","jpeg","png","webp","heic","tiff","bmp"],Pe=({value:t,onChange:i})=>{const[o,l]=r(!1),c=n(null),d=a(()=>t?URL.createObjectURL(t):null,[t]);return e(()=>()=>{d&&URL.revokeObjectURL(d)},[d]),e(()=>{!t&&c.current&&(c.current.value="")},[t]),/* @__PURE__ */s("div",{className:"flex items-center gap-3",children:[!t&&/* @__PURE__ */s("div",{className:"flex items-center gap-4",children:/* @__PURE__ */s("button",{type:"button",onClick:()=>c.current?.click(),className:"border-border flex items-center gap-2 rounded border px-3 py-2.5 "+(o?"bg-opacity-75 cursor-not-allowed":"hover:cursor-pointer"),children:/* @__PURE__ */s(o?J:se,{})})}),t&&d&&/* @__PURE__ */s("img",{src:d,alt:"Facial Search",className:"size-10 rounded object-cover"}),
|
|
20
|
+
/* @__PURE__ */s("input",{ref:c,type:"file",accept:"image/*",className:"hidden",onChange:e=>{const t=e.target?.files?.[0]??null;if(!t)return;const n=(t.name.split(".").pop()||"").toLowerCase();if(!Ae.includes(n))return i(null);(async e=>{if(!e)return;l(!0);let t=e;try{const n=await ue(e);t=n.size/1024/1024>1?await me(n,{maxSizeMB:1,maxWidthOrHeight:1600,useWebWorker:!0,preserveExif:!1,maxIteration:3}):n}catch(n){console.error(n)}l(!1),i(t)})(t)}})]})},_e={[q.GRID]:{icon:/* @__PURE__ */s(Se,{className:"size-full text-inherit"})},[q.SINGLE]:{icon:/* @__PURE__ */s(ke,{className:"size-full text-inherit"})}},Re=Object.keys(_e).map(e=>({icon:_e[e].icon,value:e})),Oe=({engagementStyle:t,disabled:a,mode:i,onModeChange:l,sort:c,onSortChange:d,sortOrder:u,onSortOrderChange:m,handleChange:g,face:h,onFaceImageChange:p})=>{const{t:f}=Y(),{organization:v}=C(),[w,T]=r(""),[y,N]=r(null),q=n(null),x=o(()=>{q.current&&(URL.revokeObjectURL(q.current),q.current=null)},[]),b=o(e=>{if(N(e),x(),e){const t=URL.createObjectURL(e);q.current=t,p?.(t)}else p?.(void 0)},[p,x]),E=o(e=>{T(e.target.value)},[]),S=o(e=>{const t=e.key;"Enter"===t?g&&g(w.length>0?w:""):"Escape"===t&&(T(""),g&&g(""))},[w,g]),I=o(()=>{T(""),g&&g("")},[g]),L=o(()=>{g&&g(w)},[w,g]);return e(()=>{h||N(null)},[h]),e(()=>()=>{x()},[x]),/* @__PURE__ */s("fieldset",{disabled:a,className:"m-0 mb-3 grid min-w-0 grid-cols-3 border-0 p-0 md:space-y-0 md:space-x-4 "+(a?"opacity-50":""),children:[
|
|
21
|
+
/* @__PURE__ */s("div",{className:"col-span-3 flex items-center gap-4 md:col-span-1",children:[v?.integrationSettings?.showGridViewToggle&&/* @__PURE__ */s(Q,{buttons:Re,selected:i,onChange:l}),v?.integrationSettings?.showKeywordSearch&&/* @__PURE__ */s("div",{className:"flex-auto",children:/* @__PURE__ */s("div",{className:"relative min-w-32 sm:min-w-48",children:[
|
|
22
|
+
/* @__PURE__ */s(pe,{placeholder:f("content.search_placeholder","Search using text"),value:w,className:"py-2",onChange:E,onKeyUp:S}),w?.length>0&&/* @__PURE__ */s("button",{className:"absolute inset-y-0 right-10 flex items-center",onClick:I,children:/* @__PURE__ */s(ee,{className:"text-foreground w-5"})}),
|
|
23
|
+
/* @__PURE__ */s("button",{className:"absolute inset-y-0 right-3 flex items-center",onClick:L,children:/* @__PURE__ */s(U,{className:"text-foreground w-5"})})]})}),v?.integrationSettings?.showFacialSearch&&/* @__PURE__ */s(Pe,{value:y,onChange:b})]}),
|
|
24
24
|
/* @__PURE__ */s("div",{className:"col-span-3 md:col-span-1"}),
|
|
25
|
-
/* @__PURE__ */s("div",{className:"col-span-3 mt-3 md:col-span-1 md:mt-0 lg:justify-self-end",children:/* @__PURE__ */s(
|
|
25
|
+
/* @__PURE__ */s("div",{className:"col-span-3 mt-3 md:col-span-1 md:mt-0 lg:justify-self-end",children:/* @__PURE__ */s(Me,{engagementStyle:t,sort:c,order:u,onSortChange:d,onSortOrderChange:m})})]})},Ve=()=>/* @__PURE__ */s("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-full",width:"800",height:"469.317",viewBox:"0 0 800 469.317",role:"img","aria-hidden":"true",children:/* @__PURE__ */s("g",{transform:"translate(-443.142 -257.876)",children:[
|
|
26
26
|
/* @__PURE__ */s("path",{d:"M898.247,664.1H371.155a30.276,30.276,0,0,1-30.241-30.241V352.525a30.276,30.276,0,0,1,30.241-30.241H898.247a30.276,30.276,0,0,1,30.241,30.241V633.862A30.276,30.276,0,0,1,898.247,664.1Z",transform:"translate(308.867 25.517)",fill:"#fff"}),
|
|
27
27
|
/* @__PURE__ */s("path",{d:"M557.334,341.82H30.241A30.276,30.276,0,0,1,0,311.578V30.241A30.276,30.276,0,0,1,30.241,0H557.334a30.276,30.276,0,0,1,30.241,30.241V311.578A30.276,30.276,0,0,1,557.334,341.82ZM30.241,1.833A28.441,28.441,0,0,0,1.833,30.241V311.578a28.441,28.441,0,0,0,28.409,28.409H557.334a28.441,28.441,0,0,0,28.409-28.409V30.241A28.441,28.441,0,0,0,557.334,1.833Z",transform:"matrix(0.999, -0.035, 0.035, 0.999, 643.995, 358.158)",fill:"#d6d6e3"}),
|
|
28
28
|
/* @__PURE__ */s("path",{d:"M754.171,630.2l-509.5-135.058a30.276,30.276,0,0,1-21.483-36.981L295.28,186.212a30.276,30.276,0,0,1,36.981-21.483l509.5,135.058a30.276,30.276,0,0,1,21.483,36.981L791.152,608.712A30.276,30.276,0,0,1,754.171,630.2Z",transform:"translate(220.958 94.156)",fill:"#f2f2f2"}),
|
|
29
29
|
/* @__PURE__ */s("path",{d:"M775.247,705.1H248.155a30.276,30.276,0,0,1-30.241-30.241V393.525a30.276,30.276,0,0,1,30.241-30.241H775.247a30.276,30.276,0,0,1,30.241,30.242V674.862A30.275,30.275,0,0,1,775.247,705.1Z",transform:"translate(319.149 22.09)",fill:"#fff"}),
|
|
30
30
|
/* @__PURE__ */s("path",{d:"M638.653,701.841H298.272c-.426,0-.852-.009-1.272-.033l160.985-90.663c3.065-1.762,9.943-2.382,15.361-1.385a13.912,13.912,0,0,1,4.26,1.385l108.041,60.842,5.176,2.911Z",transform:"translate(312.538 1.526)",fill:"#e6e6e6"}),
|
|
31
31
|
/* @__PURE__ */s("path",{d:"M760.145,704.279h-294.4l57.049-26.943L526.9,675.4l74.341-35.111c4.874-2.3,16.6-2.445,22.328-.434q.577.206,1.071.434Z",transform:"translate(298.432 -0.912)",fill:"#e6e6e6"}),
|
|
32
|
-
/* @__PURE__ */s("path",{d:"M248.322,365.284a28.441,28.441,0,0,0-28.409,28.409V675.03a28.441,28.441,0,0,0,28.409,28.409H775.415a28.441,28.441,0,0,0,28.409-28.409V393.693a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(319.149 22.09)",fill:"none",stroke:"#d6d6e3",strokeWidth:"1.833"})]})}),Oe=({position:t,gamConfig:r,eventId:a,organizationId:i})=>{const{trackGamAnalytics:o}=ie(),l=n(null),d=`gam-${t}-banner-${a??"ev"}`,u=r.placementCategories?.[t];return e(()=>{let e=!1,t=null,n=null,s=null,m=null,g=null,h=null;const p=u?[u]:[],f=document.createElement("div");f.id=d,document.body.appendChild(f);const v=()=>{const e=l.current;if(!e)return;const t=e.getBoundingClientRect(),n=t.width>0&&t.height>0;f.style.display=n?"block":"none",n&&(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 v(),window.addEventListener("scroll",v,{passive:!0}),window.addEventListener("resize",v),(async()=>{await re(),e||window.googletag.cmd.push(()=>{if(e)return;oe(d);const l=window.googletag.defineSlot(r.adUnitPath,[[728,90]],d)?.addService(window.googletag.pubads());l&&(t=l,m=window.googletag.pubads(),a?l.setConfig({targeting:{qrati_event:a,...p.length>0?{qrati_category:p}:{}}}):p.length>0&&l.setConfig({targeting:{qrati_category:p}}),g=e=>{e.slot===l&&o({eventId:a,organizationId:i,type:c.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},m.addEventListener("slotRenderEnded",g),h=e=>{e.slot===l&&o({eventId:a,organizationId:i,type:c.GAM_VIEWABLE})},m.addEventListener("impressionViewable",h),s=ce({container:f,onClick:()=>{o({eventId:a,organizationId:i,type:c.GAM_CLICK})}}),ae(),window.googletag.display(d),n=window.setTimeout(()=>{e||(v(),l.getResponseInformation?.()||window.googletag.pubads().refresh([l]))},1500))})})(),()=>{e=!0,window.removeEventListener("scroll",v),window.removeEventListener("resize",v),null!==n&&window.clearTimeout(n),s?.(),m&&"function"==typeof m.removeEventListener&&(g&&m.removeEventListener("slotRenderEnded",g),h&&m.removeEventListener("impressionViewable",h));const r=t;t=null,r&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([r])}),f.parentNode&&f.parentNode.removeChild(f)}},[a,r.adUnitPath,i,u,t,d]),/* @__PURE__ */s("div",{className:"flex w-full items-center justify-center overflow-x-auto py-2",children:/* @__PURE__ */s("div",{ref:l,style:{width:728,height:90,minWidth:728}})})},Fe=({gamConfig:t,eventId:r,organizationId:a})=>{const{trackGamAnalytics:i}=ie(),o=n(null),l=`gam-right-${r??"ev"}`,d=t.placementCategories?.right??t.placementCategories?.sidebar;return e(()=>{let e=!1,n=null,s=null,u=null,m=null,g=null,h=null;const p=d?[d]:[],f=document.createElement("div");f.id=l,document.body.appendChild(f);const v=()=>{const e=o.current;if(!e)return;const t=e.getBoundingClientRect(),n=e.parentElement?.getBoundingClientRect(),r=t.width>0&&t.height>0;if(f.style.display=r?"block":"none",!r)return;const a=t.top<=0&&n?Math.min(0,n.bottom-600):t.top;f.style.position="fixed",f.style.top=`${a}px`,f.style.left=`${t.left}px`,f.style.width="160px",f.style.height="600px",f.style.zIndex="20"};return v(),window.addEventListener("scroll",v,{passive:!0}),window.addEventListener("resize",v),(async()=>{await re(),e||window.googletag.cmd.push(()=>{if(e)return;oe(l);const o=window.googletag.defineSlot(t.adUnitPath,[[160,600]],l)?.addService(window.googletag.pubads());o&&(n=o,m=window.googletag.pubads(),r?o.setConfig({targeting:{qrati_event:r,...p.length>0?{qrati_category:p}:{}}}):p.length>0&&o.setConfig({targeting:{qrati_category:p}}),g=e=>{e.slot===o&&i({eventId:r,organizationId:a,type:c.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},m.addEventListener("slotRenderEnded",g),h=e=>{e.slot===o&&i({eventId:r,organizationId:a,type:c.GAM_VIEWABLE})},m.addEventListener("impressionViewable",h),u=ce({container:f,onClick:()=>{i({eventId:r,organizationId:a,type:c.GAM_CLICK})}}),ae(),window.googletag.display(l),s=window.setTimeout(()=>{e||(v(),o.getResponseInformation?.()||window.googletag.pubads().refresh([o]))},1500))})})(),()=>{e=!0,window.removeEventListener("scroll",v),window.removeEventListener("resize",v),null!==s&&window.clearTimeout(s),u?.(),m&&"function"==typeof m.removeEventListener&&(g&&m.removeEventListener("slotRenderEnded",g),h&&m.removeEventListener("impressionViewable",h));const t=n;n=null,t&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([t])}),f.parentNode&&f.parentNode.removeChild(f)}},[r,t.adUnitPath,a,d,l]),/* @__PURE__ */s("div",{ref:o,style:{width:160,height:600},className:"hidden shrink-0 self-start lg:block"})},je=t(()=>import("./C3tT7YRo2.js")),Be=()=>{const t=R().eventSlug,{loadingUser:c,organization:p}=C(),f=u(),[w,b]=r(""),[S,z]=r(void 0),[_,V]=r(N),[F,j]=r(v),[B,H]=r("undefined"!=typeof window&&window.innerWidth<768?q.SINGLE:q.GRID),U=n(null),{event:G,ads:$,gamConfig:D}=te({eventSlug:t}),{loading:Q,isError:Y,error:J,refetch:ne,contentsWithAds:re,hasNextPage:ae,fetchNextPage:se,isFetchingNextPage:oe}=(({event:e,ads:t=[],gamConfig:n,sort:r=N,order:i=v,keywords:s,face:o,limit:l=20})=>{const{props:c,loadingUser:d,user:u}=C(),p=c?.organizationId,{isLoading:f,isError:w,error:T,data:q,hasNextPage:x,fetchNextPage:b,isFetchingNextPage:S,refetch:L}=A({queryKey:[h.CONTENTS_BY_EVENT(e?._id??""),p??"",r,i,s,o,String(l)],queryFn:async({pageParam:t=1})=>{try{return await g.get(I.GET_CONTENTS,{searchParams:{eventId:e?._id,page:t,keywords:s,faceImageUrl:o,sort:`${m[i].sortOrder}${y[r].sortField}`,limit:l},headers:{"x-org-id":p,...u?{Authorization:`Bearer ${u.token}`}:{}}}).json()}catch(T){throw new Error(T instanceof Error?T.message:String(T)||"Failed to fetch contents")}},enabled:!d&&!!e,staleTime:6e4,gcTime:3e5,initialPageParam:1,getPreviousPageParam:e=>M(e),getNextPageParam:P}),z=a(()=>q?.pages?.flatMap(e=>e?.data??[])??[],[q]);return{contents:z,contentsWithAds:a(()=>"gam"===e?.adMode?n?.inGalleryEnabled?((e=[],t,n)=>{if(!n||n<=0)return e;const[r,a]=t.sizes[0]??[300,250];let i=0;const s=[];for(let o=0;o<e.length;o++)s.push(e[o]),n>0&&(o+1)%n===0&&(s.push({_id:`gam-ad-slot-${i}`,type:E.GAM_AD,slotIndex:i,width:r,height:a}),i++);return s})(z,n,e?.adPosition??5):z:((e=[],t=[],n)=>{if(!n||n<=0)return e;let r=0;const a=[];for(let i=0;i<(e?.length||0);i++)a.push(e[i]),t.length>0&&n>0&&(i+1)%n===0&&(a.push({...t[r],type:E.AD,adType:t[r].type}),r=(r+1)%t.length);return a})(z,t,e?.adPosition),[t,z,e?.adMode,e?.adPosition,n]),loading:f,isError:w,error:T,refetch:L,hasNextPage:x,fetchNextPage:b,isFetchingNextPage:S}})({event:G,ads:$,gamConfig:D,sort:_,order:F,keywords:w,face:S}),{incrementEventView:le}=ie(),{start:ce,initializing:de,running:ue}=(({ref:t,onBottomReached:a,hasNextPage:i,fetchNextPage:s,isFetchingNextPage:o})=>{const[l,c]=r(!1),[d,u]=r(!1),m=n(1),g=n(null),h=n(null),p=n(null),f=n(0),v=n(!1),w=n(null),T=n(null),y=n(!1),N=n(),q=n(),x=n(i),b=n(o),E=n(s),C=n(a);x.current=i,b.current=o,E.current=s,C.current=a,e(()=>{o||(v.current=!1)},[o]);const S=()=>{null!==g.current&&(window.cancelAnimationFrame(g.current),g.current=null)},I=e=>{const n=t.current;if(!n)return;null===p.current&&(p.current=e);const r=Math.min((e-p.current)/1e3,.05);p.current=e,f.current+=60*m.current*r;const a=Math.floor(f.current);a>0&&(n.scrollTop+=a,f.current-=a),x.current&&!b.current&&!v.current&&"function"==typeof E.current&&n.scrollTop+n.clientHeight>=.5*n.scrollHeight&&(v.current=!0,E.current()),Math.ceil(n.scrollTop)+n.clientHeight>=n.scrollHeight?(S(),h.current=window.setTimeout(()=>{u(!0),C.current?.(),v.current=!1,h.current=window.setTimeout(()=>{t.current&&(t.current.scrollTop=0),u(!1),f.current=0,p.current=null,g.current=window.requestAnimationFrame(I)},1e3)},1e3)):g.current=window.requestAnimationFrame(I)},L=()=>{S(),h.current&&(window.clearTimeout(h.current),h.current=null),null!==w.current&&w.current.release().catch(()=>{}).finally(()=>{w.current=null}),T.current&&(document.removeEventListener("visibilitychange",T.current),T.current=null),y.current&&(N.current&&document.removeEventListener("keydown",N.current),q.current&&document.removeEventListener("fullscreenchange",q.current),y.current=!1),c(!1),u(!1),t.current&&(t.current.scrollTop=0)},z=n(e=>{"+"===e.key&&(m.current=Math.min(m.current+1,10)),"-"===e.key&&(m.current=Math.max(m.current-1,1))}),k=n(()=>{document.fullscreenElement||L()});return k.current=()=>{document.fullscreenElement||L()},e(()=>()=>{L()},[]),{start:()=>{if(t?.current?.requestFullscreen)t.current.requestFullscreen();else{const e=t.current;e?.webkitRequestFullscreen?e.webkitRequestFullscreen():e?.mozRequestFullScreen?e.mozRequestFullScreen():e?.msRequestFullscreen&&e.msRequestFullscreen()}(async()=>{try{if(!("wakeLock"in navigator))return;const e=navigator;w.current=await e.wakeLock.request("screen");const t=async()=>{"visible"===document.visibilityState&&(w.current=await e.wakeLock.request("screen"))};T.current=t,document.addEventListener("visibilitychange",t)}catch(e){}})(),y.current||(N.current=e=>z.current(e),q.current=()=>k.current(),document.addEventListener("keydown",N.current),document.addEventListener("fullscreenchange",q.current),y.current=!0),f.current=0,p.current=null,v.current=!1,c(!0),S(),h.current=window.setTimeout(()=>{g.current=window.requestAnimationFrame(I)},300)},initializing:d,running:l}})({ref:U,hasNextPage:ae,fetchNextPage:se,isFetchingNextPage:oe,onBottomReached:()=>G?._id&&f.refetchQueries({queryKey:[h.CONTENTS_BY_EVENT(G._id)]})});e(()=>{G?.slug&&le(G.slug)},[G?.slug,le]);const ge=a(()=>B===q.SINGLE,[B]),he=a(()=>/* @__PURE__ */s(Le,{event:G,onAutoscrollClick:ce}),[G,ce]),pe=n(null),fe=n({hasNextPage:ae,isFetchingNextPage:oe,loading:Q,running:ue,fetchNextPage:se});fe.current={hasNextPage:ae,isFetchingNextPage:oe,loading:Q,running:ue,fetchNextPage:se},e(()=>(pe.current=new IntersectionObserver(e=>{const t=fe.current;t.running||e[0].isIntersecting&&t.hasNextPage&&!t.isFetchingNextPage&&!t.loading&&t.fetchNextPage()},{rootMargin:"200px"}),()=>{pe.current?.disconnect(),pe.current=null}),[]);const ve=o(e=>{const t=pe.current;t&&(t.disconnect(),e&&t.observe(e))},[]),Te=D?.bannerPositions??[],ye=p?._id,Ne=D&&Te.includes("right"),qe=Boolean(p?.integrationSettings?.showQuickSearch);/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */s("path",{d:"M248.322,365.284a28.441,28.441,0,0,0-28.409,28.409V675.03a28.441,28.441,0,0,0,28.409,28.409H775.415a28.441,28.441,0,0,0,28.409-28.409V393.693a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(319.149 22.09)",fill:"none",stroke:"#d6d6e3",strokeWidth:"1.833"})]})}),Fe=({position:t,gamConfig:r,eventId:a,organizationId:i})=>{const{trackGamAnalytics:o}=ie(),l=n(null),d=`gam-${t}-banner-${a??"ev"}`,u=r.placementCategories?.[t];return e(()=>{let e=!1,t=null,n=null,s=null,m=null,g=null,h=null;const p=u?[u]:[],f=document.createElement("div");f.id=d,document.body.appendChild(f);const v=()=>{const e=l.current;if(!e)return;const t=e.getBoundingClientRect(),n=t.width>0&&t.height>0;f.style.display=n?"block":"none",n&&(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 v(),window.addEventListener("scroll",v,{passive:!0}),window.addEventListener("resize",v),(async()=>{await re(),e||window.googletag.cmd.push(()=>{if(e)return;oe(d);const l=window.googletag.defineSlot(r.adUnitPath,[[728,90]],d)?.addService(window.googletag.pubads());l&&(t=l,m=window.googletag.pubads(),a?l.setConfig({targeting:{qrati_event:a,...p.length>0?{qrati_category:p}:{}}}):p.length>0&&l.setConfig({targeting:{qrati_category:p}}),g=e=>{e.slot===l&&o({eventId:a,organizationId:i,type:c.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},m.addEventListener("slotRenderEnded",g),h=e=>{e.slot===l&&o({eventId:a,organizationId:i,type:c.GAM_VIEWABLE})},m.addEventListener("impressionViewable",h),s=ce({container:f,onClick:()=>{o({eventId:a,organizationId:i,type:c.GAM_CLICK})}}),ae(),window.googletag.display(d),n=window.setTimeout(()=>{e||(v(),l.getResponseInformation?.()||window.googletag.pubads().refresh([l]))},1500))})})(),()=>{e=!0,window.removeEventListener("scroll",v),window.removeEventListener("resize",v),null!==n&&window.clearTimeout(n),s?.(),m&&"function"==typeof m.removeEventListener&&(g&&m.removeEventListener("slotRenderEnded",g),h&&m.removeEventListener("impressionViewable",h));const r=t;t=null,r&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([r])}),f.parentNode&&f.parentNode.removeChild(f)}},[a,r.adUnitPath,i,u,t,d]),/* @__PURE__ */s("div",{className:"flex w-full items-center justify-center overflow-x-auto py-2",children:/* @__PURE__ */s("div",{ref:l,style:{width:728,height:90,minWidth:728}})})},je=({gamConfig:t,eventId:r,organizationId:a})=>{const{trackGamAnalytics:i}=ie(),o=n(null),l=`gam-right-${r??"ev"}`,d=t.placementCategories?.right??t.placementCategories?.sidebar;return e(()=>{let e=!1,n=null,s=null,u=null,m=null,g=null,h=null;const p=d?[d]:[],f=document.createElement("div");f.id=l,document.body.appendChild(f);const v=()=>{const e=o.current;if(!e)return;const t=e.getBoundingClientRect(),n=e.parentElement?.getBoundingClientRect(),r=t.width>0&&t.height>0;if(f.style.display=r?"block":"none",!r)return;const a=t.top<=0&&n?Math.min(0,n.bottom-600):t.top;f.style.position="fixed",f.style.top=`${a}px`,f.style.left=`${t.left}px`,f.style.width="160px",f.style.height="600px",f.style.zIndex="20"};return v(),window.addEventListener("scroll",v,{passive:!0}),window.addEventListener("resize",v),(async()=>{await re(),e||window.googletag.cmd.push(()=>{if(e)return;oe(l);const o=window.googletag.defineSlot(t.adUnitPath,[[160,600]],l)?.addService(window.googletag.pubads());o&&(n=o,m=window.googletag.pubads(),r?o.setConfig({targeting:{qrati_event:r,...p.length>0?{qrati_category:p}:{}}}):p.length>0&&o.setConfig({targeting:{qrati_category:p}}),g=e=>{e.slot===o&&i({eventId:r,organizationId:a,type:c.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},m.addEventListener("slotRenderEnded",g),h=e=>{e.slot===o&&i({eventId:r,organizationId:a,type:c.GAM_VIEWABLE})},m.addEventListener("impressionViewable",h),u=ce({container:f,onClick:()=>{i({eventId:r,organizationId:a,type:c.GAM_CLICK})}}),ae(),window.googletag.display(l),s=window.setTimeout(()=>{e||(v(),o.getResponseInformation?.()||window.googletag.pubads().refresh([o]))},1500))})})(),()=>{e=!0,window.removeEventListener("scroll",v),window.removeEventListener("resize",v),null!==s&&window.clearTimeout(s),u?.(),m&&"function"==typeof m.removeEventListener&&(g&&m.removeEventListener("slotRenderEnded",g),h&&m.removeEventListener("impressionViewable",h));const t=n;n=null,t&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([t])}),f.parentNode&&f.parentNode.removeChild(f)}},[r,t.adUnitPath,a,d,l]),/* @__PURE__ */s("div",{ref:o,style:{width:160,height:600},className:"hidden shrink-0 self-start lg:block"})},Be=t(()=>import("./C52SUIvC2.js")),He=()=>{const t=R().eventSlug,{loadingUser:c,organization:p}=C(),f=u(),[w,b]=r(""),[S,z]=r(void 0),[_,O]=r(N),[F,j]=r(v),[B,H]=r("undefined"!=typeof window&&window.innerWidth<768?q.SINGLE:q.GRID),U=n(null),{event:G,ads:$,gamConfig:D}=te({eventSlug:t}),{loading:Q,isError:Y,error:J,refetch:ne,contentsWithAds:re,hasNextPage:ae,fetchNextPage:se,isFetchingNextPage:oe}=(({event:e,ads:t=[],gamConfig:n,sort:r=N,order:i=v,keywords:s,face:o,limit:l=20})=>{const{props:c,loadingUser:d,user:u}=C(),p=c?.organizationId,{isLoading:f,isError:w,error:T,data:q,hasNextPage:x,fetchNextPage:b,isFetchingNextPage:S,refetch:L}=A({queryKey:[h.CONTENTS_BY_EVENT(e?._id??""),p??"",r,i,s,o,String(l)],queryFn:async({pageParam:t=1})=>{try{return await g.get(I.GET_CONTENTS,{searchParams:{eventId:e?._id,page:t,keywords:s,faceImageUrl:o,sort:`${m[i].sortOrder}${y[r].sortField}`,limit:l},headers:{"x-org-id":p,...u?{Authorization:`Bearer ${u.token}`}:{}}}).json()}catch(T){throw new Error(T instanceof Error?T.message:String(T)||"Failed to fetch contents")}},enabled:!d&&!!e,staleTime:6e4,gcTime:3e5,refetchOnWindowFocus:"always",initialPageParam:1,getPreviousPageParam:e=>M(e),getNextPageParam:P}),z=a(()=>q?.pages?.flatMap(e=>e?.data??[])??[],[q]);return{contents:z,contentsWithAds:a(()=>"gam"===e?.adMode?n?.inGalleryEnabled?((e=[],t,n)=>{if(!n||n<=0)return e;const[r,a]=t.sizes[0]??[300,250];let i=0;const s=[];for(let o=0;o<e.length;o++)s.push(e[o]),n>0&&(o+1)%n===0&&(s.push({_id:`gam-ad-slot-${i}`,type:E.GAM_AD,slotIndex:i,width:r,height:a}),i++);return s})(z,n,e?.adPosition??5):z:((e=[],t=[],n)=>{if(!n||n<=0)return e;let r=0;const a=[];for(let i=0;i<(e?.length||0);i++)a.push(e[i]),t.length>0&&n>0&&(i+1)%n===0&&(a.push({...t[r],type:E.AD,adType:t[r].type}),r=(r+1)%t.length);return a})(z,t,e?.adPosition),[t,z,e?.adMode,e?.adPosition,n]),loading:f,isError:w,error:T,refetch:L,hasNextPage:x,fetchNextPage:b,isFetchingNextPage:S}})({event:G,ads:$,gamConfig:D,sort:_,order:F,keywords:w,face:S}),{incrementEventView:le}=ie(),{start:ce,initializing:de,running:ue}=(({ref:t,onBottomReached:a,hasNextPage:i,fetchNextPage:s,isFetchingNextPage:o})=>{const[l,c]=r(!1),[d,u]=r(!1),m=n(1),g=n(null),h=n(null),p=n(null),f=n(0),v=n(!1),w=n(null),T=n(null),y=n(!1),N=n(),q=n(),x=n(i),b=n(o),E=n(s),C=n(a);x.current=i,b.current=o,E.current=s,C.current=a,e(()=>{o||(v.current=!1)},[o]);const S=()=>{null!==g.current&&(window.cancelAnimationFrame(g.current),g.current=null)},I=e=>{const n=t.current;if(!n)return;null===p.current&&(p.current=e);const r=Math.min((e-p.current)/1e3,.05);p.current=e,f.current+=60*m.current*r;const a=Math.floor(f.current);a>0&&(n.scrollTop+=a,f.current-=a),x.current&&!b.current&&!v.current&&"function"==typeof E.current&&n.scrollTop+n.clientHeight>=.5*n.scrollHeight&&(v.current=!0,E.current()),Math.ceil(n.scrollTop)+n.clientHeight>=n.scrollHeight?(S(),h.current=window.setTimeout(()=>{u(!0),C.current?.(),v.current=!1,h.current=window.setTimeout(()=>{t.current&&(t.current.scrollTop=0),u(!1),f.current=0,p.current=null,g.current=window.requestAnimationFrame(I)},1e3)},1e3)):g.current=window.requestAnimationFrame(I)},L=()=>{S(),h.current&&(window.clearTimeout(h.current),h.current=null),null!==w.current&&w.current.release().catch(()=>{}).finally(()=>{w.current=null}),T.current&&(document.removeEventListener("visibilitychange",T.current),T.current=null),y.current&&(N.current&&document.removeEventListener("keydown",N.current),q.current&&document.removeEventListener("fullscreenchange",q.current),y.current=!1),c(!1),u(!1),t.current&&(t.current.scrollTop=0)},z=n(e=>{"+"===e.key&&(m.current=Math.min(m.current+1,10)),"-"===e.key&&(m.current=Math.max(m.current-1,1))}),k=n(()=>{document.fullscreenElement||L()});return k.current=()=>{document.fullscreenElement||L()},e(()=>()=>{L()},[]),{start:()=>{if(t?.current?.requestFullscreen)t.current.requestFullscreen();else{const e=t.current;e?.webkitRequestFullscreen?e.webkitRequestFullscreen():e?.mozRequestFullScreen?e.mozRequestFullScreen():e?.msRequestFullscreen&&e.msRequestFullscreen()}(async()=>{try{if(!("wakeLock"in navigator))return;const e=navigator;w.current=await e.wakeLock.request("screen");const t=async()=>{"visible"===document.visibilityState&&(w.current=await e.wakeLock.request("screen"))};T.current=t,document.addEventListener("visibilitychange",t)}catch(e){}})(),y.current||(N.current=e=>z.current(e),q.current=()=>k.current(),document.addEventListener("keydown",N.current),document.addEventListener("fullscreenchange",q.current),y.current=!0),f.current=0,p.current=null,v.current=!1,c(!0),S(),h.current=window.setTimeout(()=>{g.current=window.requestAnimationFrame(I)},300)},initializing:d,running:l}})({ref:U,hasNextPage:ae,fetchNextPage:se,isFetchingNextPage:oe,onBottomReached:()=>G?._id&&f.refetchQueries({queryKey:[h.CONTENTS_BY_EVENT(G._id)]})});e(()=>{G?.slug&&le(G.slug)},[G?.slug,le]);const me=a(()=>B===q.SINGLE,[B]),he=a(()=>/* @__PURE__ */s(ze,{event:G,onAutoscrollClick:ce}),[G,ce]),pe=n(null),fe=n({hasNextPage:ae,isFetchingNextPage:oe,loading:Q,running:ue,fetchNextPage:se});fe.current={hasNextPage:ae,isFetchingNextPage:oe,loading:Q,running:ue,fetchNextPage:se},e(()=>(pe.current=new IntersectionObserver(e=>{const t=fe.current;t.running||e[0].isIntersecting&&t.hasNextPage&&!t.isFetchingNextPage&&!t.loading&&t.fetchNextPage()},{rootMargin:"200px"}),()=>{pe.current?.disconnect(),pe.current=null}),[]);const ve=o(e=>{const t=pe.current;t&&(t.disconnect(),e&&t.observe(e))},[]),we=D?.bannerPositions??[],ye=p?._id,Ne=D&&we.includes("right"),qe=Boolean(p?.integrationSettings?.showQuickSearch);/* @__PURE__ */
|
|
33
33
|
return s("div",{className:"bg-background mx-auto min-h-[80vh]",children:[
|
|
34
34
|
/* @__PURE__ */s("div",{className:"flex flex-row justify-end gap-4 pt-2",children:he}),
|
|
35
|
-
/* @__PURE__ */s("div",{className:"pb-3",children:/* @__PURE__ */s(
|
|
36
|
-
/* @__PURE__ */s(
|
|
37
|
-
/* @__PURE__ */s("div",{className:"flex items-start gap-4",children:[/* @__PURE__ */s("div",{className:"min-w-0 flex-1",children:[c||Q?/* @__PURE__ */s("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3",children:Array.from({length:8}).map((e,t)=>/* @__PURE__ */s(Z,{className:"h-72"},t))}):Y?/* @__PURE__ */s("div",{className:"my-16 flex flex-col items-center gap-4",children:/* @__PURE__ */s(K,{title:J?.message?.toLowerCase().includes("timed out")?"Request timed out":"Failed to load",description:/* @__PURE__ */s("div",{className:"flex flex-col items-center gap-4",children:[/* @__PURE__ */s(
|
|
38
|
-
/* @__PURE__ */s("div",{ref:U,className:x(
|
|
39
|
-
/* @__PURE__ */s("div",{ref:ve,className:"h-4 w-full","aria-hidden":"true"}),oe&&/* @__PURE__ */s("div",{className:"mx-auto my-6 w-fit",children:/* @__PURE__ */s(W,{className:"text-2xl"})})]}),D&&
|
|
35
|
+
/* @__PURE__ */s("div",{className:"pb-3",children:/* @__PURE__ */s(Te,{})}),D&&we.includes("top")&&/* @__PURE__ */s(Fe,{position:"top",gamConfig:D,eventId:G?._id,organizationId:ye}),
|
|
36
|
+
/* @__PURE__ */s(Oe,{engagementStyle:G?.engagementStyle,disabled:c||Q,mode:B,onModeChange:e=>H(e),sort:_,sortOrder:F,onSortChange:e=>O(e),onSortOrderChange:()=>j("asc"===F?"desc":"asc"),handleChange:b,face:S,onFaceImageChange:e=>z(e)}),S&&/* @__PURE__ */s("div",{className:"flex gap-4 py-2",children:[/* @__PURE__ */s("div",{className:"space-y-2",children:[/* @__PURE__ */s(V,{variant:"h4",children:"Searching using"}),/* @__PURE__ */s("img",{src:S,alt:"face",className:"h-32 rounded"})]}),/* @__PURE__ */s("div",{className:"flex flex-col justify-end gap-2",children:/* @__PURE__ */s(X,{color:"error",icon:/* @__PURE__ */s(ee,{className:"size-5"}),onClick:()=>z(void 0),children:"Clear search"})})]}),
|
|
37
|
+
/* @__PURE__ */s("div",{className:"flex items-start gap-4",children:[/* @__PURE__ */s("div",{className:"min-w-0 flex-1",children:[c||Q?/* @__PURE__ */s("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3",children:Array.from({length:8}).map((e,t)=>/* @__PURE__ */s(Z,{className:"h-72"},t))}):Y?/* @__PURE__ */s("div",{className:"my-16 flex flex-col items-center gap-4",children:/* @__PURE__ */s(K,{title:J?.message?.toLowerCase().includes("timed out")?"Request timed out":"Failed to load",description:/* @__PURE__ */s("div",{className:"flex flex-col items-center gap-4",children:[/* @__PURE__ */s(V,{variant:"body2",color:"muted",align:"center",children:J?.message?.toLowerCase().includes("timed out")?"The search took too long to respond. Please try again.":"Something went wrong while loading content."}),/* @__PURE__ */s(X,{icon:/* @__PURE__ */s(ge,{className:"size-5"}),onClick:()=>{ne()},children:"Retry"})]})})}):re?.length<=0?/* @__PURE__ */s("div",{className:"my-16 flex flex-col items-center gap-4",children:/* @__PURE__ */s(K,{title:"No Contents",description:"Check back soon for amazing contents.",iconSvg:/* @__PURE__ */s(Ve,{})})}):/* @__PURE__ */s(l,{children:[
|
|
38
|
+
/* @__PURE__ */s("div",{ref:U,className:x(me?"flex w-full justify-center":"",de?"opacity-0":"opacity-100",ue?"scrollbar-hide pointer-events-none transition-opacity duration-300":"pointer-events-auto transition-none","relative size-full overflow-auto"),children:/* @__PURE__ */s(i,{fallback:/* @__PURE__ */s("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:Array.from({length:8}).map((e,t)=>/* @__PURE__ */s(Z,{className:"h-72"},t))}),children:/* @__PURE__ */s(Be,{event:G,contents:re,gamConfig:D,singleColumnMode:me,kioskMode:ue,timestampField:_===T.CAPTURE_TIME?"capturedAt":void 0,curateLink:G?.engagementStyle===L.CONTEST&&G.status===k.OPEN&&G.slug?d.CURATE(G.slug):void 0,onChangeFaceUrl:e=>z(e),showQuickSearch:qe})})}),
|
|
39
|
+
/* @__PURE__ */s("div",{ref:ve,className:"h-4 w-full","aria-hidden":"true"}),oe&&/* @__PURE__ */s("div",{className:"mx-auto my-6 w-fit",children:/* @__PURE__ */s(W,{className:"text-2xl"})})]}),D&&we.includes("bottom")&&/* @__PURE__ */s(Fe,{position:"bottom",gamConfig:D,eventId:G?._id,organizationId:ye})]}),Ne&&/* @__PURE__ */s(je,{gamConfig:D,eventId:G?._id,organizationId:ye})]})]})};export{He as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t}from"./
|
|
1
|
+
import{t}from"./DrrpB4Om.js";function e({className:e}){/* @__PURE__ */
|
|
2
2
|
return t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */t("path",{fill:"currentColor",d:"m9.55 15.15l8.475-8.475q.3-.3.7-.3t.7.3t.3.713t-.3.712l-9.175 9.2q-.3.3-.7.3t-.7-.3L4.55 13q-.3-.3-.288-.712t.313-.713t.713-.3t.712.3z"})})}export{e as t};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{t,w as e}from"./DrrpB4Om.js";import{D as n,n as a}from"./CaX2xgrP.js";import{c as r,l as i,t as s}from"./ChJXhA9c.js";import{t as o}from"./CATr-3VW.js";import{t as l}from"./DGbyGc8b.js";import{n as c}from"./DGGc10Cy.js";import{t as m}from"./C3dOFk9A.js";import{t as d}from"./D35mTuTT.js";function h({className:e}){/* @__PURE__ */
|
|
2
|
+
return t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */t("path",{fill:"currentColor",d:"M5 21q-.825 0-1.412-.587T3 19v-3q0-.425.288-.712T4 15t.713.288T5 16v3h14V5H5v3q0 .425-.288.713T4 9t-.712-.288T3 8V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm6.65-8H4q-.425 0-.712-.288T3 12t.288-.712T4 11h7.65L9.8 9.15q-.3-.3-.288-.7t.288-.7q.3-.3.713-.312t.712.287L14.8 11.3q.15.15.213.325t.062.375t-.062.375t-.213.325l-3.575 3.575q-.3.3-.712.288T9.8 16.25q-.275-.3-.288-.7t.288-.7z"})})}var u=()=>{const{t:e}=c(),d=r(),u=i(),{initializing:g,organization:p,loadingUser:v,user:f,signout:N}=a();/* @__PURE__ */
|
|
3
|
+
return t("div",g||v?{className:"my-2 flex justify-end",children:/* @__PURE__ */t(l,{className:"h-9 w-64"})}:{className:"mx-auto mb-4",children:[!f&&/* @__PURE__ */t("div",{className:"flex justify-end gap-4",children:/* @__PURE__ */t(s,{to:`${n.LOGIN}?ref=${encodeURIComponent(d.pathname)}`,children:/* @__PURE__ */t(m,{children:e("button.login","Login")})})}),f&&/* @__PURE__ */t("div",{className:"mt-2 flex items-center justify-end gap-4",children:[/* @__PURE__ */t(o,{variant:"h5",children:f.name}),!p?.customAuth&&/* @__PURE__ */t("button",{onClick:async()=>{await N(),u(n.PUBLIC_EVENTS)},children:/* @__PURE__ */t(h,{className:"text-destructive"})})]})]})},g=()=>{const{user:r,organization:l,signout:c}=a(),m=i(),h=l?.integrationSettings?.hideQratiBranding;/* @__PURE__ */
|
|
4
|
+
return t("div",{className:"pt-16 sm:pt-24",children:[l&&/* @__PURE__ */t("div",{className:"mx-auto py-2",children:l.customAuth?r&&/* @__PURE__ */t(o,{variant:"h6",align:"center",children:r.name}):/* @__PURE__ */t(e,{children:[!r&&/* @__PURE__ */t(o,{variant:"h6",align:"center",children:[
|
|
5
|
+
/* @__PURE__ */t(s,{className:"text-primary hover:underline",to:n.LOGIN,children:"Login"})," ","•"," ",
|
|
6
|
+
/* @__PURE__ */t(s,{className:"text-primary hover:underline",to:n.REGISTER,children:"Register"})]}),r&&/* @__PURE__ */t(o,{variant:"h6",align:"center",children:[r.name," •"," ",
|
|
7
|
+
/* @__PURE__ */t("button",{type:"button",className:"text-destructive cursor-pointer border-none bg-transparent p-0 hover:underline",onClick:async()=>{await c(),m(n.PUBLIC_EVENTS)},children:"Logout"})]})]})}),!h&&/* @__PURE__ */t(d,{})]})};export{u as n,g as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e,F as t,R as r,V as s}from"./
|
|
1
|
+
import{B as e,F as t,R as r,V as s}from"./CaX2xgrP.js";var i=class extends r{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(t,r){const{state:i}=t,a=super.createResult(t,r),{isFetching:c,isRefetching:h,isError:o,isRefetchError:n}=a,P=i.fetchMeta?.fetchMore?.direction,g=o&&"forward"===P,u=c&&"forward"===P,f=o&&"backward"===P,d=c&&"backward"===P;return{...a,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:e(r,i.data),hasPreviousPage:s(r,i.data),isFetchNextPageError:g,isFetchingNextPage:u,isFetchPreviousPageError:f,isFetchingPreviousPage:d,isRefetchError:n&&!g&&!f,isRefetching:h&&!u&&!d}}};function a(e,r){return t(e,i,r)}var c=e=>e?.meta?.currentPage>1?e.meta.currentPage-1:void 0,h=e=>e?.meta?.currentPage<e?.meta?.totalPages?e.meta.currentPage+1:void 0;export{c as n,a as r,h as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{T as r,t as e}from"./
|
|
1
|
+
import{T as r,t as e}from"./DrrpB4Om.js";import{i as t}from"./CaX2xgrP.js";import{r as a}from"./CATr-3VW.js";function i({className:r}){/* @__PURE__ */
|
|
2
2
|
return e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:r,"aria-hidden":"true",focusable:"false",children:[
|
|
3
3
|
/* @__PURE__ */e("circle",{cx:"18",cy:"12",r:"0",fill:"currentColor",children:/* @__PURE__ */e("animate",{attributeName:"r",begin:".67",calcMode:"spline",dur:"1.5s",keySplines:"0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8",repeatCount:"indefinite",values:"0;2;0;0"})}),
|
|
4
4
|
/* @__PURE__ */e("circle",{cx:"12",cy:"12",r:"0",fill:"currentColor",children:/* @__PURE__ */e("animate",{attributeName:"r",begin:".33",calcMode:"spline",dur:"1.5s",keySplines:"0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8",repeatCount:"indefinite",values:"0;2;0;0"})}),
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import{D as t,E as e,T as i,_ as n,b as s,f as o,g as r,h as l,i as a,m as c,n as d,p as h,t as p,v as u,w as m,y as g}from"./DrrpB4Om.js";import{C as f,D as w,L as b,N as T,O as y,S as v,a as k,i as x,l as q,m as _,n as E,u as C,v as S}from"./CaX2xgrP.js";import{n as N,r as I,t as L}from"./dT6WSX65.js";import{t as M}from"./ChJXhA9c.js";import{t as A}from"./CATr-3VW.js";import{t as B}from"./C3dOFk9A.js";import{n as R}from"./LYboLIEU.js";import{n as V}from"./BkIDQGIs.js";import{t as z}from"./Bki5T_lb.js";import{n as F,r as O,t as P}from"./BOqkzZ92.js";import{n as H}from"./CVRTTCyF.js";import{a as D,i as U,n as $,o as j,r as W,s as G,t as K}from"./CsfDBJh72.js";import{a as Q,n as Y,o as Z,r as J,t as X}from"./DZtaQWVG2.js";function tt(t,e){const[i,n]=t;if(i===e)return t;if(void 0!==n&&void 0!==e&&void 0!==i&&e===n&&Math.abs(e-i)<=20){const s=Math.min(i,e),o=Math.max(i,e);return s===i&&o===n?t:[s,o]}return[e,i]}function et(t,e,i){const[[n],r]=s(tt,[i]),a=function(t){const[e,i]=l(t);return t===e||t&&e&&t.length===e.length&&!t.some((t,i)=>t!==e[i])?e:(i(t),t)}(e),c=o(void 0);return{containerRef:u(e=>{c.current?.disconnect(),c.current=void 0;const i=()=>r(function(t,e){let i=t?.clientWidth;if(void 0!==i&&e&&e.length>0){const t=[...e.filter(t=>t>0)].sort((t,e)=>e-t);t.push(Math.floor(t[t.length-1]/2)),i=t.find((e,n)=>e<=i||n===t.length-1)}return i}(e,a));i(),e&&"undefined"!=typeof ResizeObserver&&(c.current=new ResizeObserver(i),c.current.observe(e)),"function"==typeof t?t(e):t&&(t.current=e)},[t,a]),containerWidth:n}}function it(t){return["react-photo-album",t].filter(Boolean).join("--")}function nt({width:t,height:e}){const i=t/e;return Number.isFinite(i)?i:1}var st=Object.freeze([1200,600,300,0]);function ot(t,e){return"function"==typeof t?t(e):t}function rt(t,e){return void 0!==e?ot(t,e):void 0}function lt(t,e,i,n=0){if(void 0===e)return;const s=rt(t,e);return Math.round(Math.max(void 0===s?function(t,e){const i=st.findIndex(t=>t<=e);return ot(t[Math.max(i,0)],e)}(i,e):s,n))}function at(t,{spacing:e,padding:i,componentsProps:n,render:s}){return{spacing:lt(e,t,[20,15,10,5]),padding:lt(i,t,[0,0,0,0]),componentsProps:ot(n,t)||{},render:ot(s,t)}}function ct(t,e=0){const i=10**e;return Math.round((t+Number.EPSILON)*i)/i}function dt(t,e,i,n,s,o,r){let l,a;const c=t=>{const e=o*(s-1)+2*r*s;return`calc((${t.match(/^\s*calc\((.*)\)\s*$/)?.[1]??t} - ${e}px) / ${ct((n-e)/i,5)})`},d=t.srcSet;return d&&d.length>0&&(l=d.concat(d.some(({width:e})=>e===t.width)?[]:[{src:t.src,width:t.width,height:t.height}]).sort((t,e)=>t.width-e.width).map(t=>`${t.src} ${t.width}w`).join(", ")),a=e?.size?(e.sizes||[]).map(({viewport:t,size:e})=>`${t} ${c(e)}`).concat(c(e.size)).join(", "):`${Math.ceil(i/n*100)}vw`,{srcSet:l,sizes:a}}var ht=a(function({as:t,render:e,context:i,classes:n=[],variables:s={},style:o,className:r,children:l,...a},c){const d=function(...t){return t.filter(Boolean).join(" ")}(...(Array.isArray(n)?n:[n]).filter(t=>"string"==typeof t).map(it),r),h={style:{...Object.fromEntries(Object.entries(s).map(([t,e])=>{return[(i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),`--${it(i)}`),"number"==typeof e?ct(e,5):e];var i})),...o},className:d,children:l,...a};if(e){const t=e({ref:c,...h},i);if(t)return t}return p(t||"div",{ref:c,...h})}),pt=a(function({photo:t,index:e,width:i,height:n,onClick:s,render:{wrapper:o,link:r,button:l,image:a,extras:c}={},componentsProps:{link:d,button:h,wrapper:u,image:m}={}},g){const{href:f}=t,w={photo:t,index:e,width:ct(i,3),height:ct(n,3)};let b;return b=f?{...d,as:"a",render:r,classes:["photo","link"],href:f,onClick:s}:s?{...h,as:"button",type:"button",render:l,classes:["photo","button"],onClick:s}:{...u,render:o,classes:"photo"},p(ht,{ref:g,variables:{photoWidth:w.width,photoHeight:w.height},context:w,...b,children:[p(ht,{as:"img",classes:"image",render:a,context:w,...m}),c?.({},w)]})}),ut=a(function({layout:e,sizes:i,model:n,skeleton:s,onClick:o,render:{container:r,track:l,photo:a,...c}={},componentsProps:{container:d,track:h,link:u,button:m,wrapper:g,image:f}={}},w){const{spacing:b,padding:T,containerWidth:y,tracks:v,variables:k,horizontal:x}=n||{};return p(ht,{role:"group","aria-label":"Photo album",...d,variables:{spacing:b,padding:T,containerWidth:y,...k},classes:["",e],render:r,ref:w,children:[void 0!==b&&void 0!==T&&void 0!==y&&v?.map(({photos:e,variables:n},s)=>{const r=e.length,d=x?r:v.length;return t(ht,{...h,key:s,render:l,classes:"track",variables:{trackSize:r,...n}},e.map(t=>{const{photo:e,index:n,width:s}=t,{key:r,src:l,alt:h="",title:w,label:v}=e,k=o?t=>{o({event:t,photo:e,index:n})}:void 0;if(a){const e=a({onClick:k},t);if(e)return e}const x=t=>v?{"aria-label":v,...t}:t;return p(pt,{onClick:k,render:c,componentsProps:{image:{loading:"lazy",decoding:"async",src:l,alt:h,title:w,...dt(e,i,s,y,d,b,T),...ot(f,t)},link:x(ot(u,t)),button:x(ot(m,t)),wrapper:ot(g,t)},...t},r??n)}))}),void 0===y&&s]})});function mt(t,e,i,n){return(e-(t.length-1)*i-2*n*t.length)/t.reduce((t,e)=>t+nt(e),0)}function gt(t,e,i,n,s,o,r){const l=t.slice(e,i),a=mt(l,n,s,o);return a>0?(a-r)**2*l.length:void 0}var ft=a(function({photos:t,breakpoints:e,defaultContainerWidth:i,...n},s){const{containerRef:o,containerWidth:r}=et(s,e,i),{spacing:l,padding:a,targetRowHeight:c,minPhotos:d,maxPhotos:u,...m}=function(t,{photos:e,targetRowHeight:i,rowConstraints:n,...s}){const{spacing:o,padding:r,componentsProps:l,render:a}=at(t,s),{singleRowMaxHeight:c,minPhotos:d,maxPhotos:h}=rt(n,t)||{};if(void 0!==c&&void 0!==o&&void 0!==r){const t=Math.floor(e.reduce((t,{width:e,height:i})=>t+e/i*c+2*r,o*(e.length-1)));t>0&&(l.container={...l.container},l.container.style={maxWidth:t,...l.container.style})}return{...s,targetRowHeight:lt(i,t,[t=>t/5,t=>t/4,t=>t/3,t=>t/2]),render:a,spacing:o,padding:r,minPhotos:d,maxPhotos:h,componentsProps:l}}(r,{photos:t,...n});return p(ut,{layout:"rows",ref:o,model:h(()=>void 0!==r&&void 0!==l&&void 0!==a&&void 0!==c?function(t,e,i,n,s,o,r){const l=Math.min(function(t,e,i,n){return ct(e/i/Math.min(...t.map(t=>nt(t))))+(n||0)+2}(t,n,s,o),r||1/0),a=o||1,c=t.length,d=new Array(c+1).fill(1/0),h=new Array(c+1).fill(-1);d[0]=0;for(let m=1;m<=c;m+=1)for(let o=m-a;o>=Math.max(0,m-l);o-=1){if(d[o]===1/0)continue;const r=gt(t,o,m,n,e,i,s);if(void 0===r)break;const l=d[o]+r;(d[m]===1/0||d[m]>l&&(d[m]/l>1.005||-1!==h[m]&&h[m]<o))&&(d[m]=l,h[m]=o)}if(d[c]===1/0)return;const p=[];for(let m=c;0!==m;m=h[m])p.push(m);p.push(0),p.reverse();const u=[];for(let m=1;m<p.length;m+=1){const s=t.slice(p[m-1],p[m]).map((t,e)=>({photo:t,index:p[m-1]+e})),o=mt(s.map(({photo:t})=>t),n,e,i);u.push({photos:s.map(({photo:t,index:e})=>({photo:t,index:e,width:o*nt(t),height:o}))})}return{spacing:e,padding:i,containerWidth:n,tracks:u,horizontal:!0}}(t,l,a,r,c,d,u):void 0,[t,l,a,r,c,d,u]),...m})});function wt(t,e,i,n,s,o,r){const l=[],a=r.reduce((t,e)=>t+e,0);for(let c=0;c<t.length-1;c+=1){const d=e.slice(t[c],t[c+1]).map((e,i)=>({photo:e,index:t[c]+i})),h=r.reduce((t,e,i)=>t+(o[c]-o[i])*e,0),p=(s-(t.length-2)*i-2*(t.length-1)*n-h)*r[c]/a;l.push({photos:d.map(({photo:t,index:e})=>({photo:t,index:e,width:p,height:p/nt(t)})),variables:{adjustedGaps:h,columnRatio:r[c]}})}return{tracks:l,variables:{totalRatio:a}}}function bt(t,e,i,n,s,o){const r=[],l=[];if(t.length<=o){const s=t.length>0?t.reduce((t,e)=>t+nt(e),0)/t.length:1;for(let e=0;e<o;e+=1)r[e]=2*i,l[e]=e<t.length?nt(t[e]):s;return wt(Array.from({length:o+1},(e,i)=>Math.min(i,t.length)),t,e,i,n,r,l)}const a=(c=function(t,e,i,n,s){return o=>{const r=[],l=1.5*s;let a=n/nt(t[o])+2*i;for(let c=o+1;c<t.length+1&&(r.push([c,(s-a)**2]),!(a>l||c===t.length));c+=1)a+=n/nt(t[c])+e+2*i;return r}}(t,e,i,s,(t.reduce((t,e)=>t+s/nt(e),0)+e*(t.length-o)+2*i*t.length)/o),d=o,h=0,p=t.length,function(t,e,i){const n=[i];for(let s=i,o=e;o>0;o-=1)[s]=t.get(s)[o],n.push(s);return n.reverse()}(function(t,e,i,n){const s=/* @__PURE__ */new Map,o=/* @__PURE__ */new Set;o.add(i);for(let r=0;r<e;r+=1){const i=[...o.keys()];o.clear(),i.forEach(i=>{const l=r>0?s.get(i)[r][1]:0;t(i).forEach(([t,a])=>{let c=s.get(t);c||(c=[],s.set(t,c));const d=l+a,h=c[r+1];(!h||h[1]>d&&(h[1]/d>1.0001||i<h[0]))&&(c[r+1]=[i,d]),r<e-1&&t!==n&&o.add(t)})})}return s}(c,d,h,p),d,p));var c,d,h,p;for(let u=0;u<a.length-1;u+=1){const n=t.slice(a[u],a[u+1]);r[u]=e*(n.length-1)+2*i*n.length,l[u]=1/n.reduce((t,e)=>t+1/nt(e),0)}return wt(a,t,e,i,n,r,l)}function Tt(t,e,i,n,s){const{tracks:o,variables:r}=bt(t,e,i,n,(n-e*(s-1)-2*i*s)/s,s);return o.some(t=>t.photos.some(({width:t,height:e})=>t<=0||e<=0))?s>1?Tt(t,e,i,n,s-1):void 0:{tracks:o,spacing:e,padding:i,containerWidth:n,variables:{columns:s,...r}}}var yt=a(function({photos:t,breakpoints:e,defaultContainerWidth:i,...n},s){const{containerRef:o,containerWidth:r}=et(s,e,i),{spacing:l,padding:a,columns:c,...d}=function(t,{columns:e,...i}){return{...i,...at(t,i),columns:lt(e,t,[5,4,3,2],1)}}(r,{photos:t,...n});return p(ut,{layout:"columns",ref:o,model:h(()=>void 0!==r&&void 0!==l&&void 0!==a&&void 0!==c?Tt(t,l,a,r,c):void 0,[t,l,a,r,c]),...d})});function vt(t,e,i,n,s){const o=(n-e*(s-1)-2*i*s)/s;if(o<=0)return s>1?vt(t,e,i,n,s-1):void 0;const r=[];for(let a=0;a<s;a+=1)r[a]=0;const l=t.reduce((t,n,s)=>{const l=r.reduce((t,e,i)=>e<r[t]-1?i:t,0);return r[l]=r[l]+o/nt(n)+e+2*i,t[l].push({photo:n,index:s}),t},Array.from({length:s},()=>[]));return{spacing:e,padding:i,containerWidth:n,variables:{columns:s},tracks:l.map(t=>({photos:t.map(({photo:t,index:e})=>({photo:t,index:e,width:o,height:o/nt(t)}))}))}}var kt=a(function({photos:t,breakpoints:e,defaultContainerWidth:i,...n},s){const{containerRef:o,containerWidth:r}=et(s,e,i),{spacing:l,padding:a,columns:c,...d}=function(t,{columns:e,...i}){return{...i,...at(t,i),columns:lt(e,t,[5,4,3,2],1)}}(r,{photos:t,...n});return p(ut,{layout:"masonry",ref:o,model:h(()=>void 0!==r&&void 0!==l&&void 0!==a&&void 0!==c?vt(t,l,a,r,c):void 0,[t,l,a,r,c]),...d})}),xt='url("https://res.cloudinary.com/dectzk2b2/image/upload/v1736933014/black_rpie3v.png")',qt=class{constructor(t){this.backdropOn=!1,this.lightbox=t,this.backgroundElement=null,this.backgroundVideoElement=null,this.referenceVideoElement=null,this.options={toggleBackdropButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}initPswpEvents(t){t.on("afterInit",()=>{setTimeout(()=>{this.backgroundElement.style.display="block",this.backgroundVideoElement.style.display="block"},[500])}),t.on("uiRegister",()=>{t.ui.registerElement({name:"toggle-backdrop-button",title:"Toggle blur backdrop",order:this.options.toggleBackdropButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-show-backdrop"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-backdrop"/><path id="pswp__icn-show-backdrop" style="display:none" d="M3 14.5q-.2 0-.35-.15T2.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-4q-.2 0-.35-.15T2.5 10t.15-.35T3 9.5t.35.15t.15.35t-.15.35t-.35.15M6 19q-.425 0-.712-.288T5 18t.288-.712T6 17t.713.288T7 18t-.288.713T6 19m0-4q-.425 0-.712-.288T5 14t.288-.712T6 13t.713.288T7 14t-.288.713T6 15m0-4q-.425 0-.712-.288T5 10t.288-.712T6 9t.713.288T7 10t-.288.713T6 11m0-4q-.425 0-.712-.288T5 6t.288-.712T6 5t.713.288T7 6t-.288.713T6 7m4 8.5q-.625 0-1.062-.437T8.5 14t.438-1.062T10 12.5t1.063.438T11.5 14t-.437 1.063T10 15.5m0-4q-.625 0-1.062-.437T8.5 10t.438-1.062T10 8.5t1.063.438T11.5 10t-.437 1.063T10 11.5m0 7.5q-.425 0-.712-.288T9 18t.288-.712T10 17t.713.288T11 18t-.288.713T10 19m0-12q-.425 0-.712-.288T9 6t.288-.712T10 5t.713.288T11 6t-.288.713T10 7m0 14.5q-.2 0-.35-.15T9.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-18q-.2 0-.35-.15T9.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 12q-.625 0-1.062-.437T12.5 14t.438-1.062T14 12.5t1.063.438T15.5 14t-.437 1.063T14 15.5m0-4q-.625 0-1.062-.437T12.5 10t.438-1.062T14 8.5t1.063.438T15.5 10t-.437 1.063T14 11.5m0 7.5q-.425 0-.712-.288T13 18t.288-.712T14 17t.713.288T15 18t-.288.713T14 19m0-12q-.425 0-.712-.288T13 6t.288-.712T14 5t.713.288T15 6t-.288.713T14 7m0 14.5q-.2 0-.35-.15T13.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-18q-.2 0-.35-.15T13.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M18 19q-.425 0-.712-.288T17 18t.288-.712T18 17t.713.288T19 18t-.288.713T18 19m0-4q-.425 0-.712-.288T17 14t.288-.712T18 13t.713.288T19 14t-.288.713T18 15m0-4q-.425 0-.712-.288T17 10t.288-.712T18 9t.713.288T19 10t-.288.713T18 11m0-4q-.425 0-.712-.288T17 6t.288-.712T18 5t.713.288T19 6t-.288.713T18 7m3 7.5q-.2 0-.35-.15T20.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-4q-.2 0-.35-.15T20.5 10t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15"/><path id="pswp__icn-hide-backdrop" d="m19.1 21.9l-17-17q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l17 17q.275.275.275.7t-.275.7t-.7.275t-.7-.275m-9.1-.4q-.2 0-.35-.15T9.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 0q-.2 0-.35-.15T13.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M6 19q-.425 0-.712-.288T5 18t.288-.712T6 17t.713.288T7 18t-.288.713T6 19m4 0q-.425 0-.712-.288T9 18t.288-.712T10 17t.713.288T11 18t-.288.713T10 19m4 0q-.425 0-.712-.288T13 18t.288-.712T14 17t.713.288T15 18t-.288.713T14 19m-4-3.5q-.65 0-1.075-.425T8.5 14t.425-1.075T10 12.5t1.075.425T11.5 14t-.425 1.075T10 15.5M6 15q-.425 0-.712-.288T5 14t.288-.712T6 13t.713.288T7 14t-.288.713T6 15m11.8-.025l-.775-.775q-.1-.5.213-.85T18 13q.425 0 .713.288T19 14q0 .45-.35.763t-.85.212M3 14.5q-.2 0-.35-.15T2.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m18 0q-.2 0-.35-.15T20.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m-6.7-3.05L12.55 9.7q.125-.525.5-.862T14 8.5q.65 0 1.075.425T15.5 10q0 .575-.35.963t-.85.487M6 11q-.425 0-.712-.287T5 10t.288-.712T6 9t.713.288T7 10t-.288.713T6 11m12 0q-.425 0-.712-.288T17 10t.288-.712T18 9t.713.288T19 10t-.288.713T18 11m-15-.5q-.2 0-.35-.15T2.5 10t.15-.35T3 9.5t.35.15t.15.35t-.15.35t-.35.15m18 0q-.2 0-.35-.15T20.5 10t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M14 7q-.425 0-.712-.288T13 6t.288-.712T14 5t.713.288T15 6t-.288.713T14 7m-4.175-.025l-.8-.8q-.075-.5.225-.837T10 5q.425 0 .712.287T11 6q0 .45-.337.75t-.838.225M18 7q-.425 0-.712-.288T17 6t.288-.712T18 5t.713.288T19 6t-.288.713T18 7m-8-3.5q-.2 0-.35-.15T9.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 0q-.2 0-.35-.15T13.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15" /></svg>',onClick:()=>{this.toggleBackdrop(t)}}),this.createBlurBackground(t)}),t.on("change",()=>{this.backdropOn&&this.updateBlurBackground(t)}),t.on("close",()=>{this.removeBlurBackground(),this.backdropOn=!1})}createBlurBackground(t){const e=t.element;if(!this.backgroundElement){const t=document.createElement("div");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="100vw",t.style.height="100vh",t.style.backgroundSize="cover",t.style.backgroundPosition="center",t.style.filter="blur(44px)",t.style.zIndex=-1,t.style.transition="background-image 0.5s ease, opacity 0.5s ease",t.style.display="none",t.style.backgroundImage=xt,e.append(t),this.backgroundElement=t}if(!this.backgroundVideoElement){const t=document.createElement("video");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="100vw",t.style.height="100vh",t.style.objectFit="cover",t.style.filter="blur(44px)",t.style.zIndex=-1,t.style.display="none",t.style.transition="opacity 0.5s ease",t.muted=!0,t.loop=!0,t.autoplay=!1,t.muted=!0,t.volume=0,e.append(t),this.backgroundVideoElement=t}}toggleBackdrop(t){this.backdropOn?(this.backgroundElement.style.backgroundImage=xt,this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.pause(),this.backdropOn=!1):(this.updateBlurBackground(t),this.backdropOn=!0);const e=this.querySelector("#pswp__icn-hide-backdrop"),i=this.querySelector("#pswp__icn-show-backdrop");e&&(e.style.display=this.backdropOn?"none":"inline"),i&&(i.style.display=this.backdropOn?"inline":"none")}updateBlurBackground(t){const e=t.currSlide;if(e?.data)if("video"===e.data.type){const t=this.backgroundVideoElement,i=e.content.element;"video"===i?.tagName?.toLowerCase()&&(this.referenceVideoElement=i,this.registerVideoEvents(i,t)),t.style.opacity=0,setTimeout(()=>{t.src=e.data.src,t.load(),this.initBackgroundVideo(),t.style.opacity=1},500),this.backgroundElement&&(this.backgroundElement.style.opacity=0)}else{if(this.backgroundElement){const t=((t,e=32,i=32)=>{if(!t||t.length<6||"undefined"==typeof document)return null;try{const n=V(t,e,i),s=document.createElement("canvas");s.width=e,s.height=i;const o=s.getContext("2d");if(!o)return null;const r=o.createImageData(e,i);return r.data.set(n),o.putImageData(r,0,0),s.toDataURL()}catch(n){return console.warn("[PhotoSwipeBackdrop] Failed to decode blurhash:",n),null}})(e.data.blurhash)||e.data.thumbnailUrl||e.data.src;this.backgroundElement.style.backgroundImage=t?`url("${t}")`:xt,this.backgroundElement.style.backgroundColor="transparent",this.backgroundElement.style.opacity=1}this.backgroundVideoElement&&(this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.src="")}}initBackgroundVideo(){this.referenceVideoElement&&(this.backgroundVideoElement.currentTime=this.referenceVideoElement.currentTime,this.referenceVideoElement.currentTime>0&&!this.referenceVideoElement.paused&&!this.referenceVideoElement.ended&&this.referenceVideoElement.readyState>2&&this.backgroundVideoElement.play())}removeBlurBackground(){this.backgroundElement&&(this.backgroundElement.remove(),this.backgroundVideoElement.remove(),this.backgroundElement=null,this.backgroundVideoElement=null)}registerVideoEvents(t,e){this.foregroundVideoElement=t,t.addEventListener("play",()=>{e.currentTime=t.currentTime,e.play()}),t.addEventListener("pause",()=>{e.pause()}),t.addEventListener("ended",()=>{e.pause(),e.currentTime=0})}},_t=class{constructor(t,e={}){this.lightbox=t,this.options={filmstripButtonOrder:e.filmstripButtonOrder||7,height:e.height||112,thumbnailHeight:e.thumbnailHeight||64,thumbnailWidth:e.thumbnailWidth||96,itemMargin:e.itemMargin??4,buffer:e.buffer??5,backgroundColor:e.backgroundColor||"rgba(0, 0, 0, 0.6)",activeBorderColor:e.activeBorderColor||"#ff4800",...e},this.itemWidth=this.options.thumbnailWidth+this.options.itemMargin,this.filmstripVisible=!0,this.filmstripContainer=null,this.filmstripContent=null,this.filmstripTrack=null,this.isAnimating=!1,this.thumbnailPool=/* @__PURE__ */new Map,this.contents=[],this.scrollTickPending=!1,this.scrollHandler=this.scrollHandler.bind(this),this.handleThumbnailClick=this.handleThumbnailClick.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}getElementById(t){const e=this.getRootNode();return"function"==typeof e.getElementById?e.getElementById(t):e.querySelector?.(`#${t}`)||document.getElementById(t)}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}initPswpEvents(t){this.pswp=t,t.on("uiRegister",()=>{this.registerToggleButton(),this.registerFilmstripContainer()}),t.on("afterInit",()=>{this.filmstripContainer=this.getElementById("pswp-filmstrip-container"),this.filmstripContainer&&this.injectStyles()}),t.on("openingAnimationEnd",()=>{this.filmstripVisible&&!this.isAnimating&&requestAnimationFrame(()=>this.showFilmstrip())}),t.on("change",()=>{this.filmstripVisible&&this.filmstripContent&&this.updateActiveSlide(t.currSlide?.index??0)}),t.on("bindEvents",()=>{document.addEventListener("keydown",this.handleKeyDown)}),t.on("close",()=>{document.removeEventListener("keydown",this.handleKeyDown),this.cleanupFilmstrip()})}injectStyles(){const t="pswp-filmstrip-styles",e=this.getRootNode(),i=e.head??e;if(i.querySelector?.(`#${t}`))return;const n=document.createElement("style");n.id=t,n.textContent=`\n #pswp-filmstrip-container {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 1000;\n transform: translateY(100%);\n transition: transform 0.3s ease-in-out;\n pointer-events: none;\n }\n\n #pswp-filmstrip-container.pswp-filmstrip--visible {\n transform: translateY(0);\n pointer-events: auto;\n }\n\n .pswp-filmstrip {\n position: relative;\n height: ${this.options.height}px;\n background-color: ${this.options.backgroundColor};\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: none;\n -ms-overflow-style: none;\n scroll-behavior: auto;\n user-select: none;\n -webkit-user-select: none;\n padding: 8px 16px;\n box-sizing: border-box;\n }\n\n .pswp-filmstrip::-webkit-scrollbar {\n display: none;\n }\n\n .pswp-filmstrip__track {\n position: relative;\n height: 100%;\n min-width: 100%;\n }\n\n .pswp-filmstrip__item {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n display: inline-flex;\n flex-shrink: 0;\n padding: 0;\n border: none;\n background: none;\n cursor: pointer;\n outline: none;\n border-radius: 4px;\n overflow: hidden;\n transition: transform 0.15s ease;\n }\n\n .pswp-filmstrip__item:hover {\n transform: translateY(-50%) scale(1.05);\n }\n\n .pswp-filmstrip__item:active {\n transform: translateY(-50%) scale(0.95);\n }\n\n .pswp-filmstrip__thumb {\n width: ${this.options.thumbnailWidth}px;\n height: ${this.options.thumbnailHeight}px;\n border-radius: 4px;\n overflow: hidden;\n position: relative;\n border: 2px solid transparent;\n transition: border-color 0.2s ease;\n background-color: #333;\n }\n\n .pswp-filmstrip__thumb--active {\n border-color: ${this.options.activeBorderColor};\n }\n\n .pswp-filmstrip__img {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n object-position: center;\n z-index: 2;\n opacity: 0;\n transform: scale(0.95);\n transition: opacity 0.3s ease, transform 0.3s ease;\n }\n\n .pswp-filmstrip__img--loaded {\n opacity: 1;\n transform: scale(1);\n }\n\n .pswp-filmstrip__overlay {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 3;\n pointer-events: none;\n }\n\n .pswp-filmstrip__overlay-icon {\n width: 24px;\n height: 24px;\n opacity: 0.8;\n }\n\n .pswp-filmstrip__ad-label {\n position: absolute;\n top: 4px;\n left: 4px;\n font-size: 10px;\n color: white;\n background-color: rgba(0, 0, 0, 0.6);\n padding: 2px 6px;\n border-radius: 3px;\n z-index: 3;\n }\n\n @media (min-width: 1024px) {\n .pswp-filmstrip__thumb {\n width: 80px;\n height: 80px;\n }\n\n .pswp-filmstrip__overlay-icon {\n width: 28px;\n height: 28px;\n }\n }\n `,i.appendChild(n)}registerToggleButton(){this.pswp.ui.registerElement({name:"filmstrip-toggle-button",title:"Toggle filmstrip",order:this.options.filmstripButtonOrder,isButton:!0,html:this.getToggleButtonHtml(),onClick:()=>this.toggleFilmstrip()})}registerFilmstripContainer(){this.pswp.ui.registerElement({name:"filmstrip",isButton:!1,appendTo:"root",html:'<div id="pswp-filmstrip-container"></div>'})}getToggleButtonHtml(){return'\n <svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24" width="24" height="24" id="pswp-filmstrip-icon-show">\n <path d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4v2.85L1.35 4.2q-.3-.3-.3-.712t.3-.713t.713-.3t.712.3l18.4 18.4q.3.3.3.7t-.3.7t-.712.3t-.713-.3L17.15 20zm0-2h11.15l-10-10H4zM22 6v11q0 .5-.312.75T21 18t-.687-.262t-.313-.763V8h-8.325q-.4 0-.763-.15t-.637-.425L8.55 5.7q-.225-.25-.275-.525t.075-.55t.35-.45T9.275 4H20q.825 0 1.413.588T22 6" />\n <path d="m 5.100795,16.58464 q -0.165328,0 -0.282961,-0.116899 Q 4.700201,16.350842 4.7,16.186347 V 13.398294 Q 4.7,13.233997 4.817834,13.117098 4.935667,13.000199 5.100795,13 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n <path d="m 10.572143,16.65489 q -0.165327,0 -0.282961,-0.116899 -0.117632,-0.116899 -0.117833,-0.281394 v -2.788053 q 0,-0.164297 0.117833,-0.281196 0.117834,-0.116899 0.282961,-0.117098 h 2.805562 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n <path d="m 16.049385,16.724729 q -0.165327,0 -0.282961,-0.116899 -0.117632,-0.116899 -0.117833,-0.281394 v -2.788053 q 0,-0.164297 0.117833,-0.281196 0.117834,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117634,0.281196 v 2.788053 q 0,0.164296 -0.117634,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n </svg>\n <svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24" width="24" height="24" id="pswp-filmstrip-icon-hide" style="display:none">\n <path d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h16q.825 0 1.413.588T22 6v12q0 .825-.587 1.413T20 20zm0-2h16V8H4z" />\n <path d="m 5.100795,16.58464 q -0.165328,0 -0.282961,-0.116899 Q 4.700201,16.350842 4.7,16.186347 V 13.398294 Q 4.7,13.233997 4.817834,13.117098 4.935667,13.000199 5.100795,13 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n <path d="m 10.572144,16.65489 q -0.165329,0 -0.282961,-0.116899 -0.117633,-0.116899 -0.117834,-0.281394 v -2.788053 q 0,-0.164297 0.117834,-0.281196 0.117832,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n <path d="m 16.049385,16.724729 q -0.165328,0 -0.282961,-0.116899 -0.117633,-0.116899 -0.117834,-0.281394 v -2.788053 q 0,-0.164297 0.117834,-0.281196 0.117833,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117634,0.281196 v 2.788053 q 0,0.164296 -0.117634,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n </svg>\n '}setCaptionOffset(t){const e=this.getElementById("pswp-caption-container");e&&(e.style.bottom=t?"7rem":"0")}showFilmstrip(){if(!this.filmstripContainer||!this.pswp)return;const t=this.getContentsFromPswp().filter(t=>t&&t.thumbnailUrl);if(0===t.length)return;this.isAnimating=!0,this.contents=t;const e=this.pswp.currSlide?.index??0;this.createFilmstripContent(t,e),this.filmstripContainer.classList.add("pswp-filmstrip--visible"),this.filmstripVisible=!0;const i=this.querySelector(".pswp");i&&i.classList.add("pswp-filmstrip-active"),this.setCaptionOffset(!0),this.updateToggleIcon(),setTimeout(()=>{this.isAnimating=!1},300)}hideFilmstrip(){if(!this.filmstripContainer)return;this.isAnimating=!0,this.filmstripContainer.classList.remove("pswp-filmstrip--visible"),this.filmstripVisible=!1;const t=this.querySelector(".pswp");t&&t.classList.remove("pswp-filmstrip-active"),this.setCaptionOffset(!1),this.updateToggleIcon(),setTimeout(()=>{this.filmstripContainer&&(this.filmstripContainer.innerHTML=""),this.filmstripContent=null,this.filmstripTrack=null,this.thumbnailPool.clear(),this.contents=[],this.isAnimating=!1},300)}toggleFilmstrip(){this.isAnimating||(this.filmstripVisible?this.hideFilmstrip():this.showFilmstrip())}updateToggleIcon(){const t=this.getElementById("pswp-filmstrip-icon-show"),e=this.getElementById("pswp-filmstrip-icon-hide");t&&(t.style.display=this.filmstripVisible?"none":"block"),e&&(e.style.display=this.filmstripVisible?"block":"none")}createFilmstripContent(t,e){if(!this.filmstripContainer)return;const i=document.createElement("div");i.className="pswp-filmstrip",i.id="pswp-filmstrip-content";const n=document.createElement("div");n.className="pswp-filmstrip__track",n.style.width=t.length*this.itemWidth+"px",i.appendChild(n),this.filmstripContainer.innerHTML="",this.filmstripContainer.appendChild(i),this.filmstripContent=i,this.filmstripTrack=n,i.addEventListener("scroll",this.scrollHandler,{passive:!0}),this.renderVisibleThumbnails(e,!0)}scrollHandler(){!this.scrollTickPending&&this.filmstripContent&&(this.scrollTickPending=!0,requestAnimationFrame(()=>{this.scrollTickPending=!1,this.filmstripContent&&this.renderVisibleThumbnails(this.pswp?.currSlide?.index??0,!1)}))}renderVisibleThumbnails(t,e){if(!this.filmstripContent||!this.filmstripTrack)return;const i=this.filmstripContent,n=this.filmstripTrack,s=this.contents,o=s.length;if(0===o)return;const r=i.clientWidth,l=i.scrollLeft,a=this.options.buffer;let c=Math.floor(l/this.itemWidth)-a,d=Math.ceil((l+r)/this.itemWidth)+a;c=Math.max(0,c),d=Math.min(o-1,d);for(const[h,p]of this.thumbnailPool)(h<c||h>d)&&(p.parentNode&&p.parentNode.removeChild(p),this.thumbnailPool.delete(h));for(let h=c;h<=d;h++){const e=s[h];if(!e||!e.thumbnailUrl)continue;let i=this.thumbnailPool.get(h);const o=h===t;i?this.updateThumbnailState(i,h,o):(i=this.createThumbnailButton(e,h,o),i.style.left=h*this.itemWidth+"px",n.appendChild(i),this.thumbnailPool.set(h,i))}e&&requestAnimationFrame(()=>this.scrollToThumbnail(t))}createThumbnailButton(t,e,i){const n=document.createElement("button");n.className="pswp-filmstrip__item",n.setAttribute("data-index",e),n.setAttribute("type","button"),n.setAttribute("aria-label",`Go to slide ${e+1}`);const s=document.createElement("div");s.className="pswp-filmstrip__thumb "+(e===i?"pswp-filmstrip__thumb--active":""),s.setAttribute("data-thumb-index",e);const o=document.createElement("img");if(o.className="pswp-filmstrip__img",o.alt=t.caption||`Slide ${e+1}`,o.loading="lazy",o.decoding="async",o.onload=()=>o.classList.add("pswp-filmstrip__img--loaded"),o.src=t.thumbnailUrl,s.appendChild(o),"VIDEO"===t.type){const t=document.createElement("div");t.className="pswp-filmstrip__overlay",t.innerHTML='\n <svg class="pswp-filmstrip__overlay-icon" viewBox="0 0 24 24" fill="white">\n <path d="M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"/>\n </svg>\n ',s.appendChild(t)}return n.appendChild(s),n.addEventListener("click",this.handleThumbnailClick),n}updateThumbnailState(t,e,i){const n=t.querySelector(".pswp-filmstrip__thumb");n&&(i?(n.classList.add("pswp-filmstrip__thumb--active"),t.setAttribute("aria-current","true")):(n.classList.remove("pswp-filmstrip__thumb--active"),t.removeAttribute("aria-current")))}handleThumbnailClick(t){const e=t.currentTarget,i=parseInt(e.getAttribute("data-index"),10);this.pswp&&!isNaN(i)&&this.pswp.goTo(i)}updateActiveSlide(t){if(this.filmstripContent){for(const[e,i]of this.thumbnailPool)this.updateThumbnailState(i,e,e===t);this.scrollToThumbnail(t)}}scrollToThumbnail(t){if(!this.filmstripContent)return;const e=this.contents;if(t<0||t>=e.length)return;const i=this.filmstripContent,n=i.clientWidth/2,s=t*this.itemWidth+this.itemWidth/2;i.scrollTo({left:s-n,behavior:"smooth"})}handleKeyDown(t){this.filmstripVisible&&this.pswp&&("f"!==t.key&&"F"!==t.key||this.toggleFilmstrip())}getContentsFromPswp(){if(!this.pswp)return[];const t=this.pswp.options?.dataSource;if(t?.gallery)return this.getContentsFromDOM(t.gallery);const e="function"==typeof this.pswp.getNumItems?this.pswp.getNumItems():0;if(!e)return[];const i=[];for(let n=0;n<e;n++){let t=null;this.pswp.slides?.[n]?.data?t=this.pswp.slides[n].data:"function"==typeof this.pswp.getItemData&&(t=this.pswp.getItemData(n)),i.push(t||{})}return i.map((t,e)=>this.normalizeItem(t,e))}getContentsFromDOM(t){if(!t)return[];const e=t.querySelectorAll("a[href]");return Array.from(e).map((t,e)=>{const i=t.dataset,n=i.pswpThumbnailUrl||i.pswpMsrc||"",s=(i.pswpType||"").toString().toUpperCase(),o=i.pswpCaption||t.getAttribute("title")||"";return{id:i.pswpId||`item-${e}`,type:s,thumbnailUrl:n||i.pswpSrc||t.getAttribute("href")||"",caption:o}})}normalizeItem(t,e){try{const i=t||{},n=i.data||i,s=(n.type||n.pswpType||i.type||"").toString().toUpperCase(),o=n.thumbnailUrl||n.thumbnail||n.msrc||n.src||"";return{id:n.id||n._id||i.id||i._id||`item-${e}`,type:s,thumbnailUrl:o,caption:n.caption||n.alt||n.title||""}}catch{return{id:`item-${e}`,type:"",thumbnailUrl:"",caption:""}}}cleanupFilmstrip(){const t=this.querySelector(".pswp");t&&t.classList.remove("pswp-filmstrip-active"),this.setCaptionOffset(!1),this.filmstripContent&&(this.filmstripContent.removeEventListener("scroll",this.scrollHandler),this.filmstripContent.innerHTML=""),this.filmstripContainer&&(this.filmstripContainer.innerHTML="",this.filmstripContainer.classList.remove("pswp-filmstrip--visible")),this.filmstripContent=null,this.filmstripTrack=null,this.thumbnailPool.clear(),this.contents=[],this.filmstripVisible=!0,this.isAnimating=!1}},Et=class{constructor(t){this.lightbox=t,this.fullscreen=!1,this.options={fullScreenButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}syncFullscreenState(){const t=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;this.fullscreen=Boolean(t);const e=this.querySelector("#pswp__icn-exit-fullscreen"),i=this.querySelector("#pswp__icn-fullscreen");e&&(e.style.display=this.fullscreen?"inline":"none"),i&&(i.style.display=this.fullscreen?"none":"inline")}initPswpEvents(t){const e=()=>this.syncFullscreenState();t.events.add(document,"fullscreenchange",e),t.events.add(document,"webkitfullscreenchange",e),t.on("uiRegister",()=>{(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)&&t.ui.registerElement({name:"fullscreen-button",title:"Toggle fullscreen view",order:this.options.fullScreenButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-1" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-fullscreen"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-exit-fullscreen"/><path id="pswp__icn-fullscreen" d="M5 19h2q.425 0 .713.288T8 20t-.288.713T7 21H4q-.425 0-.712-.288T3 20v-3q0-.425.288-.712T4 16t.713.288T5 17zm14 0v-2q0-.425.288-.712T20 16t.713.288T21 17v3q0 .425-.288.713T20 21h-3q-.425 0-.712-.288T16 20t.288-.712T17 19zM5 5v2q0 .425-.288.713T4 8t-.712-.288T3 7V4q0-.425.288-.712T4 3h3q.425 0 .713.288T8 4t-.288.713T7 5zm14 0h-2q-.425 0-.712-.288T16 4t.288-.712T17 3h3q.425 0 .713.288T21 4v3q0 .425-.288.713T20 8t-.712-.288T19 7z"/><path id="pswp__icn-exit-fullscreen" style="display:none" d="M6 18H4q-.425 0-.712-.288T3 17t.288-.712T4 16h3q.425 0 .713.288T8 17v3q0 .425-.288.713T7 21t-.712-.288T6 20zm12 0v2q0 .425-.288.713T17 21t-.712-.288T16 20v-3q0-.425.288-.712T17 16h3q.425 0 .713.288T21 17t-.288.713T20 18zM6 6V4q0-.425.288-.712T7 3t.713.288T8 4v3q0 .425-.288.713T7 8H4q-.425 0-.712-.288T3 7t.288-.712T4 6zm12 0h2q.425 0 .713.288T21 7t-.288.713T20 8h-3q-.425 0-.712-.288T16 7V4q0-.425.288-.712T17 3t.713.288T18 4z"/></svg>',onClick:()=>{this.toggleFullscreen(t)}})})}toggleFullscreen(t){const e=t.element;this.fullscreen?(document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),t.options.showHideAnimationType="zoom",this.fullscreen=!1):(e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen(),t.options.showHideAnimationType="fade",this.fullscreen=!0);const i=this.querySelector("#pswp__icn-exit-fullscreen"),n=this.querySelector("#pswp__icn-fullscreen");i&&(i.style.display=this.fullscreen?"inline":"none"),n&&(n.style.display=this.fullscreen?"none":"inline")}},Ct=class{constructor(t,e={}){this.lightbox=t,this.autoHideTimer=null,this.uiVisible=!0,this.options=Object.assign({defaultDelayMs:4e3,playPauseButtonOrder:9,progressBarPosition:"top",progressBarTransition:"ease",restartOnSlideChange:!0,autoHideProgressBar:!0},e),this.setSlideshowLength(Number(localStorage.getItem("pswp_delay"))||this.options.defaultDelayMs),this.slideshowIsRunning=!1,this.slideshowTimerID=null,this.wakeLockIsRunning=!1,this.wakeLockSentinel=null,this.lightbox.on("init",()=>{this.init(this.lightbox.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}injectProgressBarStyles(){const t=this.getRootNode(),e=t===document?document.head:t;if(!e||e.querySelector("style[data-pswp-slideshow]"))return;const i=document.createElement("style");i.setAttribute("data-pswp-slideshow",""),i.textContent=`.pswp__progress-bar{position:fixed;${this.options.progressBarPosition}:0;width:0;height:0}.pswp__progress-bar.running{width:100%;height:2px;transition-property:width;background:#ff4800}`,e.appendChild(i)}init(t){t.on("uiRegister",()=>{this.injectProgressBarStyles(),t.ui.registerElement({name:"playpause-button",title:"Toggle slideshow (Space)\nChange delay with +/- while running",order:this.options.playPauseButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-play"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-stop"/><path id="pswp__icn-play" d="M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"/><path id="pswp__icn-stop" style="display:none" d="M16 19q-.825 0-1.412-.587T14 17V7q0-.825.588-1.412T16 5t1.413.588T18 7v10q0 .825-.587 1.413T16 19m-8 0q-.825 0-1.412-.587T6 17V7q0-.825.588-1.412T8 5t1.413.588T10 7v10q0 .825-.587 1.413T8 19"/></svg>',onClick:()=>{this.setSlideshowState()}}),t.ui.registerElement({name:"playtime",appendTo:"wrapper",tagName:"div",className:"pswp__progress-bar"}),t.events.add(document,"keydown",t=>{switch(t.code){case"Space":this.setSlideshowState(),t.preventDefault();break;case"ArrowUp":case"NumpadAdd":case"Equal":this.changeSlideshowLength(1e3),t.preventDefault();break;case"ArrowDown":case"NumpadSubtract":case"Minus":this.changeSlideshowLength(-1e3),t.preventDefault()}})}),this.lightbox.on("change",()=>{this.slideshowIsRunning&&this.options.restartOnSlideChange&&this.goToNextSlideAfterTimeout()}),this.lightbox.on("close",()=>{this.slideshowIsRunning&&this.setSlideshowState()})}showUI(){this.lightbox&&this.lightbox.pswp&&this.lightbox.pswp.element&&this.lightbox.pswp.element.classList.add("pswp--ui-visible"),this.uiVisible=!0}stopAutoHideTimer(){this.autoHideTimer&&(clearTimeout(this.autoHideTimer),this.autoHideTimer=null)}hideUI(){this.lightbox&&this.lightbox.pswp&&this.lightbox.pswp.element&&this.lightbox.pswp.element.classList.remove("pswp--ui-visible"),this.uiVisible=!1}resetAutoHideTimer(){this.autoHideTimer&&clearTimeout(this.autoHideTimer),this.autoHideTimer=setTimeout(()=>{this.slideshowIsRunning&&this.hideUI(),this.autoHideTimer=null},[3e3])}setSlideshowState(){this.slideshowIsRunning=!this.slideshowIsRunning,this.slideshowIsRunning?(this.goToNextSlideAfterTimeout(),this.showUI(),this.resetAutoHideTimer(),document.addEventListener("touchstart",()=>{this.stopAutoHideTimer(),this.showUI()}),document.addEventListener("touchend",()=>{this.resetAutoHideTimer()}),document.addEventListener("mousemove",()=>{this.uiVisible||this.showUI(),this.resetAutoHideTimer()})):(this.showUI(),this.resetSlideshow(),this.stopAutoHideTimer());const t=this.querySelector("#pswp__icn-stop"),e=this.querySelector("#pswp__icn-play");t&&(t.style.display=this.slideshowIsRunning?"inline":"none"),e&&(e.style.display=this.slideshowIsRunning?"none":"inline");const i=this.querySelector(".pswp__progress-bar");i&&(i.style.opacity=this.options.autoHideProgressBar?null:1),this.toggleWakeLock()}setSlideshowLength(t){this.options.defaultDelayMs=Math.min(Math.max(t,1e3),2147483647),this.options.defaultDelayMs!=t&&localStorage.setItem("pswp_delay",this.options.defaultDelayMs)}changeSlideshowLength(t){if(!this.slideshowIsRunning)return;this.setSlideshowLength(this.options.defaultDelayMs+t),localStorage.setItem("pswp_delay",this.options.defaultDelayMs);const e=this.querySelector(".pswp__counter");e&&(e.innerHTML=this.options.defaultDelayMs/1e3+"s"),this.goToNextSlideAfterTimeout()}isVideoContent(t){return"video"===t?.data?.type}getSlideTimeout(){const t=this.lightbox.pswp.currSlide.content;if(this.isVideoContent(t)){const e=t.element;if(e.paused)return this.options.defaultDelayMs;const i=e.duration,n=e.currentTime;return isNaN(i)||isNaN(n)?this.options.defaultDelayMs:1e3*(i-n)}return this.options.defaultDelayMs}slideContentHasLoaded(){const t=this.lightbox.pswp.currSlide.content;if(this.isVideoContent(t)){const e=t.element;return e.ended||e.readyState===HTMLMediaElement.HAVE_ENOUGH_DATA&&[HTMLMediaElement.NETWORK_IDLE,HTMLMediaElement.NETWORK_LOADING].includes(e.networkState)}return!t.isLoading()}goToNextSlideAfterTimeout(){if(this.resetSlideshow(),this.slideContentHasLoaded()){const t=this.getSlideTimeout();this.slideshowTimerID=setTimeout(()=>{this.lightbox.pswp.next(),this.options.restartOnSlideChange||this.goToNextSlideAfterTimeout()},t),setTimeout(()=>{this.slideshowIsRunning&&this.toggleProgressBar(t)},100)}else this.slideshowTimerID=setTimeout(()=>{this.goToNextSlideAfterTimeout()},200)}getSlideTransition(){return this.isVideoContent(this.lightbox.pswp.currSlide.content)?"linear":this.options.progressBarTransition}toggleProgressBar(t){const e=this.querySelector(".pswp__progress-bar");e&&(t?(e.style.transitionTimingFunction=this.getSlideTransition(),e.style.transitionDuration=`${t}ms`,e.classList.add("running")):e.classList.remove("running"))}toggleWakeLock(){this.wakeLockIsRunning!=this.slideshowIsRunning&&("keepAwake"in screen?screen.keepAwake=this.slideshowIsRunning:"wakeLock"in navigator&&(this.wakeLockSentinel?this.wakeLockSentinel.release().then(()=>(this.wakeLockSentinel=null,!0)).catch(t=>console.error(t)):navigator.wakeLock.request("screen").then(t=>(this.wakeLockSentinel=t,this.wakeLockSentinel.addEventListener("release",()=>{this.wakeLockSentinel=null,this.wakeLockIsRunning=!1}),!0)).catch(t=>{})),this.wakeLockIsRunning=this.slideshowIsRunning)}resetSlideshow(){this.toggleProgressBar(),this.slideshowTimerID&&(clearTimeout(this.slideshowTimerID),this.slideshowTimerID=null)}},St={[String(q.NONE)]:function({className:t}){/* @__PURE__ */
|
|
2
|
+
return p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:t,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */p("path",{fill:"currentColor",d:"M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5z"})})},[q.LINK]:function({className:t}){/* @__PURE__ */
|
|
3
|
+
return p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:t,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */p("path",{fill:"currentColor",d:"M7.95 21q-2.05 0-3.5-1.45T3 16.05q0-1 .375-1.9t1.075-1.6l2.625-2.625q.3-.3.713-.3t.712.3t.3.7t-.3.7l-2.65 2.65q-.425.425-.637.963T5 16.05q0 1.225.863 2.088T7.95 19q.575 0 1.125-.213t.975-.637l2.625-2.65q.3-.275.7-.275t.7.3t.3.7t-.3.7L11.45 19.55q-.7.7-1.6 1.075T7.95 21m1.25-6.2q-.3-.3-.3-.712t.3-.713L13.375 9.2q.3-.3.713-.3t.712.3t.3.713t-.3.712L10.625 14.8q-.3.3-.712.3t-.713-.3m6.3-.725q-.3-.3-.3-.7t.3-.7l2.65-2.625q.425-.425.625-.95t.2-1.1q0-1.25-.85-2.125T16.025 5q-.575 0-1.112.213t-.963.637L11.325 8.5q-.3.3-.7.3t-.7-.3t-.3-.712t.3-.713L12.55 4.45q.7-.7 1.6-1.075T16.05 3q2.05 0 3.488 1.45t1.437 3.525q0 .975-.363 1.875t-1.062 1.6l-2.625 2.625q-.3.3-.712.3t-.713-.3"})})},[q.EMAIL]:function({className:t}){/* @__PURE__ */
|
|
4
|
+
return p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:t,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */p("path",{fill:"currentColor",d:"M12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12v1.45q0 1.475-1.012 2.513T18.5 17q-.875 0-1.65-.375t-1.3-1.075q-.725.725-1.638 1.088T12 17q-2.075 0-3.537-1.463T7 12t1.463-3.537T12 7t3.538 1.463T17 12v1.45q0 .65.425 1.1T18.5 15t1.075-.45t.425-1.1V12q0-3.35-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20h4q.425 0 .713.288T17 21t-.288.713T16 22zm2.125-7.875Q15 13.25 15 12t-.875-2.125T12 9t-2.125.875T9 12t.875 2.125T12 15t2.125-.875"})})},[q.PHONE]:function({className:t}){/* @__PURE__ */
|
|
5
|
+
return p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:t,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */p("path",{fill:"currentColor",d:"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"})})},[q.SMS]:function({className:t}){/* @__PURE__ */
|
|
6
|
+
return p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:t,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */p("path",{fill:"currentColor",d:"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.713-5.288Q9 10.425 9 10t-.288-.712T8 9t-.712.288T7 10t.288.713T8 11t.713-.288m4 0Q13 10.426 13 10t-.288-.712T12 9t-.712.288T11 10t.288.713T12 11t.713-.288m4 0Q17 10.426 17 10t-.288-.712T16 9t-.712.288T15 10t.288.713T16 11t.713-.288"})})},[q.WHATSAPP]:function({className:t}){/* @__PURE__ */
|
|
7
|
+
return p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 258",className:t,"aria-hidden":"true",focusable:"false",children:[
|
|
8
|
+
/* @__PURE__ */p("defs",{children:[/* @__PURE__ */p("linearGradient",{id:"SVGK3KZq49U",x1:"50%",x2:"50%",y1:"100%",y2:"0%",children:[/* @__PURE__ */p("stop",{offset:"0%","stop-color":"#1faf38"}),/* @__PURE__ */p("stop",{offset:"100%","stop-color":"#60d669"})]}),/* @__PURE__ */p("linearGradient",{id:"SVGefMkoEOd",x1:"50%",x2:"50%",y1:"100%",y2:"0%",children:[/* @__PURE__ */p("stop",{offset:"0%","stop-color":"#f9f9f9"}),/* @__PURE__ */p("stop",{offset:"100%","stop-color":"#fff"})]})]}),
|
|
9
|
+
/* @__PURE__ */p("path",{fill:"url(#SVGK3KZq49U)",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"}),
|
|
10
|
+
/* @__PURE__ */p("path",{fill:"url(#SVGefMkoEOd)",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"}),
|
|
11
|
+
/* @__PURE__ */p("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"})]})},[q.MESSENGER]:function({className:t}){/* @__PURE__ */
|
|
12
|
+
return p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 256",className:t,"aria-hidden":"true",focusable:"false",children:[
|
|
13
|
+
/* @__PURE__ */p("defs",{children:/* @__PURE__ */p("radialGradient",{id:"SVGhphmYc3G",cx:"19.247%",cy:"99.465%",r:"108.96%",fx:"19.247%",fy:"99.465%",children:[
|
|
14
|
+
/* @__PURE__ */p("stop",{offset:"0%","stop-color":"#09f"}),
|
|
15
|
+
/* @__PURE__ */p("stop",{offset:"60.975%","stop-color":"#a033ff"}),
|
|
16
|
+
/* @__PURE__ */p("stop",{offset:"93.482%","stop-color":"#ff5280"}),
|
|
17
|
+
/* @__PURE__ */p("stop",{offset:"100%","stop-color":"#ff7061"})]})}),
|
|
18
|
+
/* @__PURE__ */p("path",{fill:"url(#SVGhphmYc3G)",d:"M128 0C55.894 0 0 52.818 0 124.16c0 37.317 15.293 69.562 40.2 91.835c2.09 1.871 3.352 4.493 3.438 7.298l.697 22.77c.223 7.262 7.724 11.988 14.37 9.054L84.111 243.9a10.22 10.22 0 0 1 6.837-.501c11.675 3.21 24.1 4.92 37.052 4.92c72.106 0 128-52.818 128-124.16S200.106 0 128 0"}),
|
|
19
|
+
/* @__PURE__ */p("path",{fill:"#fff",d:"m51.137 160.47l37.6-59.653c5.98-9.49 18.788-11.853 27.762-5.123l29.905 22.43a7.68 7.68 0 0 0 9.252-.027l40.388-30.652c5.39-4.091 12.428 2.36 8.82 8.085l-37.6 59.654c-5.981 9.489-18.79 11.852-27.763 5.122l-29.906-22.43a7.68 7.68 0 0 0-9.25.027l-40.39 30.652c-5.39 4.09-12.427-2.36-8.818-8.085"})]})}},Nt=({open:t,ad:e,onClose:i,captureAdClick:n})=>{const s=Boolean(e?.targetType&&e.targetType!==q.NONE),o=St[e?.targetType]??St[q.LINK],r=e?.imageUrl&&z(e.imageUrl,["http:","https:"])?e.imageUrl:void 0;/* @__PURE__ */
|
|
20
|
+
return p(X,{open:Boolean(t&&e),onOpenChange:t=>!t&&i?.(),children:/* @__PURE__ */p(Y,{className:"border-none p-0",children:[/* @__PURE__ */p(Q,{className:"sr-only",children:[/* @__PURE__ */p(Z,{children:e?.title}),/* @__PURE__ */p(J,{children:e?.description})]}),/* @__PURE__ */p("div",{className:"flex max-w-2xl flex-col overflow-hidden",children:[r&&/* @__PURE__ */p("img",{className:"h-auto w-full object-contain sm:max-h-96",src:r,alt:e?.title||"Advertisement"}),
|
|
21
|
+
/* @__PURE__ */p("div",{className:"flex flex-col gap-2 p-3",children:[/* @__PURE__ */p(A,{variant:"h4",align:"center",lines:2,children:e?.title}),/* @__PURE__ */p(A,{variant:"body3",color:"secondary",align:"center",lines:4,children:e?.description})]}),s&&/* @__PURE__ */p(B,{fullWidth:!0,className:"rounded-none",onClick:()=>{n?.(e?._id,e?.targetType??q.LINK,e?.targetUrl),i?.()},icon:/* @__PURE__ */p(o,{className:"size-5"}),children:e?.targetText})]})]})})},It=({style:t,content:e,curateLink:i,onAdClick:n,hideControls:s})=>{const{captureAdImpression:o,captureAdEngagement:r,captureAdClick:l}=$(),a=Boolean(i&&n),c=e.ctaBg||"#ff4800",d=e.ctaForeground||"#FFFFFF",h=St[e?.targetType??q.LINK];/* @__PURE__ */
|
|
22
|
+
return p("div",{style:t,className:"group relative mb-1 overflow-hidden rounded",children:[
|
|
23
|
+
/* @__PURE__ */p(R,{className:"size-full",threshold:.8,triggerOnce:!0,onChange:t=>{t&&o(e._id)},onClick:()=>r(e._id),children:/* @__PURE__ */p(O,{url:e.src||e.imageUrl,thumbnailUrl:e.src||e.imageUrl,blurhash:e.blurhash,alt:e.caption,onClick:a?n:void 0,pswpData:{id:e._id,type:_.AD,hash:e._id,width:e.width,height:e.height,title:e.title,description:e.description,targetType:e.targetType,targetText:e.targetText,targetUrl:e.targetUrl,thumbnailUrl:e.imageUrl,blurhash:e.blurhash}})}),
|
|
24
|
+
/* @__PURE__ */p("span",{className:"bg-background/70 absolute top-1 right-1 rounded px-1 text-xs font-medium",children:"Ad"}),!s&&(e.title||e.targetType!==q.NONE)&&/* @__PURE__ */p("div",{className:"absolute bottom-0 flex w-full flex-col lg:opacity-0 lg:transition-opacity lg:group-hover:opacity-100",children:[e.title&&/* @__PURE__ */p("div",{className:"bg-background/60 px-3 py-1",children:/* @__PURE__ */p("h3",{className:"line-clamp-1 text-sm font-medium",children:e.title})}),e?.targetType!==q.NONE&&/* @__PURE__ */p("button",{className:"flex w-full items-center justify-center gap-1 rounded-none border-0 py-2 text-nowrap sm:gap-2",style:{backgroundColor:c,color:d},onClick:()=>{a?n?.():l(e._id,e.targetType,e.targetUrl)},children:[/* @__PURE__ */p("span",{style:{color:d},children:/* @__PURE__ */p(h,{})}),e?.targetText]})]})]})},Lt=({style:t,gamConfig:e,slotIndex:i,eventId:s,organizationId:r})=>{const l=o(null),a=o(null),{trackGamAnalytics:c}=$(),d=`gam-slot-${s??"ev"}-${i}`,h=Math.max(1,Math.round(t?.width||e.sizes[0]?.[0]||300)),u=Math.max(1,Math.round(t?.height||e.sizes[0]?.[1]||250)),m=o({w:h,h:u});return n(()=>{let t=!1,i=null,n=null,o=null,h=null;return(async()=>{await D(),!t&&l.current&&window.googletag.cmd.push(()=>{if(t)return;W(d);const{w:p,h:u}=m.current,g=[[p,u],...e.sizes],w=window.googletag.defineSlot(e.adUnitPath,g,d)?.addService(window.googletag.pubads());if(!w)return;a.current=w,n=window.googletag.pubads(),s?w.setConfig({targeting:{qrati_event:s,...e.categories.length>0?{qrati_category:e.categories}:{}}}):e.categories.length>0&&w.setConfig({targeting:{qrati_category:e.categories}}),o=t=>{t.slot===w&&c({eventId:s,organizationId:r,type:f.GAM_IMPRESSION,creativeId:String(t.creativeId??""),lineItemId:String(t.lineItemId??""),advertiserId:String(t.advertiserId??""),isEmpty:t.isEmpty??!1})},n.addEventListener("slotRenderEnded",o),h=t=>{t.slot===w&&c({eventId:s,organizationId:r,type:f.GAM_VIEWABLE})},n.addEventListener("impressionViewable",h);const b=l.current;b&&(i=K({container:b,onClick:()=>{c({eventId:s,organizationId:r,type:f.GAM_CLICK})}}),U(),window.googletag.display(d))})})(),()=>{t=!0,i?.(),n&&"function"==typeof n.removeEventListener&&(o&&n.removeEventListener("slotRenderEnded",o),h&&n.removeEventListener("impressionViewable",h));const e=a.current;a.current=null,e&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([e])})}},[s,e.adUnitPath,e.categories,r,d]),/* @__PURE__ */p("div",{style:{width:h,height:u},className:"relative overflow-hidden rounded bg-neutral-100 dark:bg-neutral-800","data-gam-slot-index":i,children:/* @__PURE__ */p("div",{id:d,ref:l,style:{width:h,height:u},className:"gam-ad-slot"})})},Mt=(t,e)=>{if(!t||!e)return null;const i=e[t];if(!i)return null;try{const t=new Date(String(i)),e=/* @__PURE__ */new Date,n=t.getFullYear()===e.getFullYear(),s={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return n||(s.year="numeric"),t.toLocaleString("en-US",s).replace(","," •")}catch{return null}},At=e(null),Bt=()=>{const t=g(At);if(!t)throw new Error("Popover components must be used within a Popover");return t},Rt=({children:t,className:e,open:i,onOpenChange:n})=>{const[s,a]=l(!1),c="boolean"==typeof i,d=c?i:s,h=r(),u=`popover-trigger-${h}`,m=`popover-content-${h}`,g=o(null);/* @__PURE__ */
|
|
25
|
+
return p(At.Provider,{value:{isOpen:d,setIsOpen:t=>{c||a(t),n?.(t)},triggerId:u,contentId:m,triggerRef:g},children:/* @__PURE__ */p("div",{"data-slot":"popover",className:x("relative inline-block",e),children:t})})},Vt=({children:t,asChild:e,className:n,onClick:s,...o})=>{const{isOpen:r,setIsOpen:l,triggerId:a,contentId:c,triggerRef:d}=Bt();if(e){const e=Array.isArray(t)?t[0]:t;if(e&&e.type){const t=e.props?.className;return i(e,{ref:t=>{d.current=t},id:a,className:n?t?`${t} ${n}`:n:t,"aria-haspopup":"dialog","aria-expanded":r,"aria-controls":r?c:void 0,onClick:t=>{l(!r),e.props?.onClick?.(t)},"data-state":r?"open":"closed"})}}/* @__PURE__ */
|
|
26
|
+
return p("button",{ref:d,id:a,type:"button","aria-haspopup":"dialog","aria-expanded":r,"aria-controls":r?c:void 0,"data-slot":"popover-trigger","data-state":r?"open":"closed",className:n,onClick:t=>{l(!r),s?.(t)},...o,children:t})},zt=({children:t,className:e,align:i="center",side:s="top",sideOffset:r=4,...a})=>{const{isOpen:h,setIsOpen:u,contentId:m,triggerRef:g}=Bt(),{organization:f,portalContainer:w}=E(),b=o(null),[T,y]=l(null);if(c(()=>{if(!h)return;const t=()=>{if(!g.current||!b.current)return;const t=g.current.getBoundingClientRect(),e=b.current.getBoundingClientRect();let n=t.left,o=t.bottom+r;"center"===i&&(n=t.left+t.width/2-e.width/2),"end"===i&&(n=t.right-e.width),"top"===s&&(o=t.top-e.height-r),"left"===s&&(n=t.left-e.width-r,o=t.top+t.height/2-e.height/2),"right"===s&&(n=t.right+r,o=t.top+t.height/2-e.height/2),"bottom"===s&&(o=t.bottom+r),y({top:o,left:n})},e=requestAnimationFrame(t);return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{cancelAnimationFrame(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[i,h,s,r,g]),n(()=>{if(!h)return;const t=t=>{const e="function"==typeof t.composedPath?t.composedPath():[],i=t.target,n=b.current&&(b.current.contains(i)||e.includes(b.current)),s=g.current&&(g.current.contains(i)||e.includes(g.current));n||s||u(!1)},e=t=>{"Escape"===t.key&&(u(!1),g.current?.focus())},i=window.setTimeout(()=>{document.addEventListener("mousedown",t)},0);return document.addEventListener("keydown",e),()=>{window.clearTimeout(i),document.removeEventListener("mousedown",t),document.removeEventListener("keydown",e)}},[h,u,g]),!h)return null;const v=/* @__PURE__ */p("div",{ref:b,id:m,role:"dialog","aria-modal":"false","data-state":h?"open":"closed",className:x("bg-background text-foreground border-border shadow-outer rounded outline-none",e),style:{position:"fixed",top:T?.top??0,left:T?.left??0,zIndex:2010,...k(f)},...a,children:t});return"undefined"!=typeof document?d(v,w??document.body):v},Ft=({eventId:t,contentId:e,emojis:i=[],counts:s={},userReaction:r})=>{const{user:a,props:c,organization:d}=E(),h=c?.loginUrl,{handleReactionClick:u,isPending:m}=(()=>{const t=b(),{props:e,user:i}=E(),n=e?.organizationId,s=I({mutationFn:async({eventId:t,contentId:e,emoji:s})=>{await T.post(C.UPDATE_REACTION,{json:{eventId:t,contentId:e,reaction:s},headers:{"x-org-id":n,Authorization:`Bearer ${i?.token}`}})},onMutate:async({eventId:e,contentId:i,emoji:n})=>{const s=[y.CONTENTS_BY_EVENT(e)];await t.cancelQueries({queryKey:s});const o=t.getQueriesData({queryKey:s});return t.setQueriesData({queryKey:s},t=>((t,e,i)=>t?.pages&&Array.isArray(t.pages)?{...t,pages:t.pages.map(t=>t.data?{...t,data:t.data.map(t=>{if(t._id!==e)return t;const n={...t.reactionCounts??{}};return t.userReaction&&t.userReaction!==i&&(n[t.userReaction]=Math.max(0,(n[t.userReaction]??1)-1)),t.userReaction===i?(n[i]=Math.max(0,(n[i]??1)-1),{...t,reactionCounts:n,userReaction:void 0}):(n[i]=(n[i]??0)+1,{...t,reactionCounts:n,userReaction:i})})}:t)}:t)(t,i,n)),{previousData:o}},onError:(e,i,n)=>{n?.previousData?.forEach(([e,i])=>{t.setQueryData(e,i)}),H.error("Failed to add reaction"),console.error("Error handling reaction click:",e,i)}});return{handleReactionClick:async(t,e,n)=>{if(!t||!e||!n)return!1;if(!i)return H.error("Please login to react"),!1;try{return await s.mutateAsync({eventId:t,contentId:e,emoji:n}),!0}catch(o){return!1}},isPending:s.isPending}})(),[g,f]=l(!1),[v,k]=l(null),q=o(null),_=Object.values(s).reduce((t,e)=>t+e,0);return n(()=>()=>{q.current&&clearTimeout(q.current)},[]),/* @__PURE__ */p(Rt,{open:g,onOpenChange:f,children:[/* @__PURE__ */p(Vt,{asChild:!0,children:/* @__PURE__ */p("button",{type:"button",className:x("bg-background/50 flex items-center gap-1 rounded px-2 py-1 backdrop-blur-sm transition-transform duration-150 ease-out will-change-transform active:scale-95 sm:gap-2 sm:py-0",v&&"scale-[1.03] shadow-sm"),children:[(i||[]).slice().sort((t,e)=>(s[e]||0)-(s[t]||0)).slice(0,1).map(t=>/* @__PURE__ */p("span",{className:x("text-sm transition-transform duration-150 ease-out sm:text-lg",v===(r||t)&&"scale-125"),children:r||t},`${e}-${t}-1`)),_>0&&/* @__PURE__ */p("span",{className:"text-xs font-bold sm:text-sm",children:_||0})]})}),/* @__PURE__ */p(zt,{side:"top",align:"end",children:[a?null:/* @__PURE__ */p("div",d?.customAuth?{className:"p-2 font-semibold",children:["Please"," ",
|
|
27
|
+
/* @__PURE__ */p("a",{className:"text-info underline",href:h,children:"Login"})," ","to react"]}:{className:"p-2 font-semibold",children:["Please"," ",
|
|
28
|
+
/* @__PURE__ */p(M,{className:"text-info underline",to:w.LOGIN,children:"Login"})," ","to react"]}),a&&/* @__PURE__ */p("div",{className:"flex gap-1 p-2",children:i.map(i=>{const n=r===i;/* @__PURE__ */
|
|
29
|
+
return p("div",{className:"flex flex-col items-center",children:[/* @__PURE__ */p("span",{className:"text-xs font-medium",children:s[i]||0}),/* @__PURE__ */p("button",{type:"button",disabled:m,className:x("text-3xl transition-transform duration-150 ease-out disabled:opacity-50",n?"scale-125":"hover:scale-110",v===i&&"scale-125",m&&"cursor-not-allowed"),onClick:()=>(async i=>{!m&&u&&(k(i),f(!1),q.current&&clearTimeout(q.current),q.current=setTimeout(()=>k(null),180),u(t,e,i))})(i),children:i})]},`${e}-${i}-2`)})})]})]})},Ot=({event:t={},content:e,curateLink:i})=>t.engagementStyle===S.CONTEST?/* @__PURE__ */p("button",{className:"bg-background/75 flex items-center gap-1 rounded px-2 py-1",children:[/* @__PURE__ */p(G,{className:"size-4"}),/* @__PURE__ */p("span",{className:"text-xs font-semibold",children:parseFloat(String(e.score||0)).toFixed(1)})]}):t.engagementStyle===S.REACTION&&t.reactionEmojis?.length?/* @__PURE__ */p(Ft,{eventId:t?._id,contentId:e._id,emojis:t?.reactionEmojis,engagementStyle:t?.engagementStyle,counts:e.reactionCounts||{},userReaction:e.userReaction}):null,Pt=({content:t})=>/* @__PURE__ */p("div",{className:"w-full space-y-3 px-3 pb-3",children:[t?.caption&&/* @__PURE__ */p("span",{"data-tooltip-target":"tooltip-default",className:"hidden w-full text-xs drop-shadow-[0_1.2px_1.2px_rgba(0,0,0,0.8)] sm:block",children:/* @__PURE__ */p("div",{role:"note",title:t?.caption,className:"lg:text-md line-clamp-1 text-xs text-white lg:font-medium",children:t?.caption})}),/* @__PURE__ */p("div",{className:"flex items-center justify-between",children:/* @__PURE__ */p("span",{className:"lg:text-md line-clamp-1 text-sm font-medium text-white drop-shadow-[0_1.2px_1.2px_rgba(0,0,0,0.8)]",children:t?.user?.name})})]}),Ht=({event:t,content:e,style:i,timestampField:n,curateLink:s,onChangeFaceUrl:o,hideControls:r,showQuickSearch:l})=>{const a=`content-${e._id}`,c=h(()=>Mt(n,e),[n,e]),d=u(()=>{o?.(e?.url);const t=document.getElementById("media-gallery-container");t&&t.scrollIntoView({behavior:"smooth",block:"start"})},[o,e?.url]),g=h(()=>({id:e._id,type:_.IMAGE,hash:e._id,width:e.width,height:e.height,thumbnailUrl:e.thumbnailUrl,blurhash:e.blurhash,caption:e.caption}),[e._id,e.width,e.height,e.thumbnailUrl,e.blurhash,e.caption]);/* @__PURE__ */
|
|
30
|
+
return p("div",{id:a,style:i,className:"group relative mb-1 overflow-hidden rounded [content-visibility:auto]",children:[/* @__PURE__ */p(O,{url:e.src,alt:e.caption,blurhash:e.blurhash,thumbnailUrl:e.thumbnailUrl,curateLink:s,pswpData:g}),!r&&/* @__PURE__ */p(m,{children:[c&&/* @__PURE__ */p("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:c}),l&&(e.faces?.length??0)>0&&/* @__PURE__ */p("button",{className:"bg-primary absolute top-2 right-2 rounded-full p-1 text-gray-200 opacity-50 transition-all sm:p-1.5 sm:hover:scale-110 sm:hover:opacity-100",onClick:d,children:/* @__PURE__ */p(j,{className:"text-primary-foreground"})}),
|
|
31
|
+
/* @__PURE__ */p("div",{className:"",children:[/* @__PURE__ */p("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */p(Pt,{content:e})}),/* @__PURE__ */p("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */p(Ot,{event:t,content:e,curateLink:s})})]})]})]})},Dt=({content:t,style:e,event:i,timestampField:n,curateLink:s,hideControls:o})=>{const r=h(()=>Mt(n,t),[n,t]);/* @__PURE__ */
|
|
32
|
+
return p("div",{id:`content-${t._id}`,className:"group relative mb-1 overflow-hidden rounded [content-visibility:auto]",style:e,children:[/* @__PURE__ */p(O,{url:t.src??t.url,thumbnailUrl:t.thumbnailUrl,blurhash:t.blurhash,alt:t.caption,curateLink:s,pswpData:{id:t._id,type:_.VIDEO,hash:t._id,width:t.width,height:t.height,thumbnailUrl:t.thumbnailUrl,blurhash:t.blurhash,caption:t.caption}}),!o&&/* @__PURE__ */p("div",{className:"transition-opacity duration-500",children:[r&&/* @__PURE__ */p("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:r}),
|
|
33
|
+
/* @__PURE__ */p("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */p(Pt,{content:t})}),
|
|
34
|
+
/* @__PURE__ */p("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */p(Ot,{event:i,content:t,curateLink:s})})]})]})},Ut=({event:t,contents:e=[],gamConfig:i,singleColumnMode:s,kioskMode:r,timestampField:a,curateLink:c,onChangeFaceUrl:d,showQuickSearch:u})=>{const g=o(null),f=o(null),w=h(()=>`gallery-${t?._id??""}`,[t?._id]),{captureAdImpression:b,captureAdClick:T}=$(),{portalContainer:y,organization:k}=E(),q=k?._id,[C,S]=l(null);n(()=>{const t=f.current;if(!c&&t){const e=new F({gallery:t,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:P,appendToEl:y??document.body});g.current=e,new L(e),new _t(e),new qt(e),new N(e,b,T),new Et(e),new Ct(e),e.init()}return()=>{g.current?.destroy?.(),g.current=null}},[t?.galleryLayout,c,T,b,w,y]);const I=h(()=>{switch(t?.galleryLayout){case v.ROW:return ft;case v.COLUMN:return yt;case v.MASONRY:return kt;default:return ft}},[t?.galleryLayout]),M=h(()=>e.map(t=>{const e=t.type===_.IMAGE||t.type===_.VIDEO?t.url:t.type===_.GAM_AD?"":t.imageUrl;return{...t,src:e??"",width:t.dimension?.width||t.width||4,height:t.dimension?.height||t.height||3}}),[e]),A=h(()=>({container:({ref:t,className:e,children:i})=>/* @__PURE__ */p("div",{ref:t,className:e??"",children:i}),photo:(e,{photo:n,width:s,height:o,index:l})=>{const h=n;let m=null;switch(h.type){case _.IMAGE:m=Ht;break;case _.VIDEO:m=Dt;break;case _.AD:m=It;break;case _.GAM_AD:return i?/* @__PURE__ */p(Lt,{style:{width:s,height:o},gamConfig:i,slotIndex:h.slotIndex??l,eventId:t?._id,organizationId:q},`${h._id??l}-${l}`):null;default:m=null}return m?/* @__PURE__ */p(m,{style:{width:s,height:o},event:t,content:h,timestampField:a,onAdClick:c?()=>S(h):void 0,hideControls:r,curateLink:c?`${c}/${h._id}`:null,onChangeFaceUrl:d,showQuickSearch:u},`${h._id??l}-${l}`):null}}),[t,i,q,a,c,r,d,u]);/* @__PURE__ */
|
|
35
|
+
return p(m,{children:[/* @__PURE__ */p("div",{id:w,ref:f,className:x(s?"w-full lg:w-1/3":"w-full"),children:/* @__PURE__ */p(I,{spacing:4,rowConstraints:t=>{const e={minPhotos:1,maxPhotos:4,singleRowMaxHeight:400};return s&&(e.minPhotos=1,e.maxPhotos=t<400?2:t<800?3:4),e},columns:t=>s?1:t<400?2:t<800?3:4,photos:M,render:A})}),/* @__PURE__ */p(Nt,{open:Boolean(C),ad:C,onClose:()=>S(null),captureAdClick:T})]})};export{Ut as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t}from"./
|
|
1
|
+
import{t}from"./DrrpB4Om.js";function l({className:l}){/* @__PURE__ */
|
|
2
2
|
return t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:l,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */t("path",{fill:"currentColor",d:"m12 13.4l-4.9 4.9q-.275.275-.7.275t-.7-.275t-.275-.7t.275-.7l4.9-4.9l-4.9-4.9q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l4.9 4.9l4.9-4.9q.275-.275.7-.275t.7.275t.275.7t-.275.7L13.4 12l4.9 4.9q.275.275.275.7t-.275.7t-.7.275t-.7-.275z"})})}export{l as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t}from"./
|
|
1
|
+
import{t}from"./DrrpB4Om.js";import{i as e,o as r}from"./CaX2xgrP.js";var l=t=>"boolean"==typeof t?`${t}`:0===t?"0":t,o=r,a=(t,e)=>r=>{var a;if(null==(null==e?void 0:e.variants))return o(t,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:n,defaultVariants:i}=e,s=Object.keys(n).map(t=>{const e=null==r?void 0:r[t],o=null==i?void 0:i[t];if(null===e)return null;const a=l(e)||l(o);return n[t][a]}),d=r&&Object.entries(r).reduce((t,e)=>{let[r,l]=e;return void 0===l||(t[r]=l),t},{});return o(t,s,null==e||null===(a=e.compoundVariants)||void 0===a?void 0:a.reduce((t,e)=>{let{class:r,className:l,...o}=e;return Object.entries(o).every(t=>{let[e,r]=t;return Array.isArray(r)?r.includes({...i,...d}[e]):{...i,...d}[e]===r})?[...t,r,l]:t},[]),null==r?void 0:r.class,null==r?void 0:r.className)},n={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",p:"p",blockquote:"blockquote",body1:"p",body2:"p",body3:"p",caption:"span",overline:"span",lead:"p"},i=a("antialiased",{variants:{variant:{h1:"scroll-m-20 text-4xl font-bold tracking-tight lg:text-5xl",h2:"scroll-m-20 text-3xl font-bold tracking-tight lg:text-4xl",h3:"scroll-m-20 text-2xl font-semibold tracking-tight",h4:"scroll-m-20 text-xl font-semibold",h5:"scroll-m-20 text-lg font-semibold",h6:"scroll-m-20 text-base font-semibold",body1:"text-base leading-relaxed font-medium",body2:"text-sm leading-relaxed",body3:"text-sm leading-relaxed sm:text-base",p:"text-base leading-7",lead:"text-muted-foreground text-xl leading-relaxed",blockquote:"border-primary/30 text-muted-foreground border-l-4 pl-4 text-base italic",caption:"text-muted-foreground text-xs",overline:"text-muted-foreground text-xs font-medium tracking-widest uppercase"},color:{foreground:"text-foreground",muted:"text-muted-foreground",primary:"text-primary",info:"text-info",warning:"text-warning",success:"text-success",error:"text-destructive",inherit:"text-inherit",secondary:"text-muted-foreground",white:"text-white",black:"text-black",a11y:"text-primary-foreground",light:"text-text-primary-light"},align:{left:"text-left",right:"text-right",center:"text-center",justify:"text-justify"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"}},defaultVariants:{variant:"body1",color:"foreground",align:"left"}}),s=({variant:r="body1",color:l,align:o,weight:a,transform:s,lines:d,shadow:u,noWrap:x,className:c,immutable:m,...g})=>/* @__PURE__ */t(n[r],{className:e(i({variant:r,color:l,align:o,weight:a}),s,d&&d>0?`line-clamp-${d}`:void 0,u&&"drop-shadow-[0_1px_2px_rgba(0,0,0,0.5)]",x&&"truncate",c),...g,children:g.children});export{i as n,a as r,s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E as e,
|
|
1
|
+
import{E as e,_ as t,f as n,h as r,m as i,t as o,v as a,y as l}from"./DrrpB4Om.js";var s,d="itemOne",c="--rcs-raw-position",p="--rcs-current-position",u="--rcs-bounds-padding",h="--rcs-handle-color",v={capture:!1,passive:!0},g={capture:!0,passive:!1},b=((s={}).ARROW_LEFT="ArrowLeft",s.ARROW_RIGHT="ArrowRight",s.ARROW_UP="ArrowUp",s.ARROW_DOWN="ArrowDown",s),m=(e,r,i,o)=>{let a=n(void 0);t(()=>{a.current=r},[r]),t(()=>{if(!i?.addEventListener)return;let t=e=>a.current?.(e);return i.addEventListener(e,t,o),()=>{i.removeEventListener(e,t,o)}},[e,i,o])},y=e(null),x=({children:e,...t})=>o(y.Provider,{value:t,children:e}),f=()=>{let e=l(y);if(!e)throw Error("useReactCompareSliderContext must be used within the Provider component");return e},w=({flip:e})=>o("div",{"aria-hidden":"true",className:"__rcs-handle-arrow",style:{width:"0.85rem",height:"0.85rem",clipPath:"polygon(100% 0%, 100% 100%, 30% 50%)",rotate:e?"180deg":"0deg",outline:`0.5rem solid var(${h})`,outlineOffset:"-0.5rem"}}),R=({className:e="__rcs-handle-root",buttonStyle:t,linesStyle:n,style:r,...i})=>{let{disabled:a,portrait:l}=f(),s={boxSizing:"border-box",position:"relative",display:"inline-flex",flexDirection:l?"row":"column",placeItems:"center",width:l?"100%":void 0,height:l?void 0:"100%",cursor:a?"not-allowed":l?"ns-resize":"ew-resize",pointerEvents:"none",[h]:"rgba(255, 255, 255, 1)",...r},d={flexGrow:1,height:l?2:"100%",width:l?"100%":2,outline:`1px solid var(${h})`,outlineOffset:-1,pointerEvents:"auto",boxShadow:"0 0 4px rgba(0,0,0,.5)",...n},c={direction:"ltr",display:"grid",gridAutoFlow:"column",gap:"0.5rem",placeContent:"center",flexShrink:0,width:"3.5rem",height:"3.5rem",borderRadius:"50%",border:`2px solid var(${h})`,color:"inherit",pointerEvents:"auto",backdropFilter:"blur(0.5rem)",WebkitBackdropFilter:"blur(0.5rem)",backgroundColor:"rgba(0, 0, 0, 0.125)",boxShadow:"0 0 4px rgba(0,0,0,.35)",transform:l?"rotate(90deg)":void 0,...t};return o("div",{"data-rcs":"handle",...i,className:e,style:s,children:[o("div",{className:"__rcs-handle-line",style:d}),o("div",{className:"__rcs-handle-button",style:c,children:[o(w,{}),o(w,{flip:!0})]}),o("div",{className:"__rcs-handle-line",style:d})]})},P=({style:e,...t})=>{let{disabled:n,portrait:r,position:i,handleRootRef:a,onHandleRootClick:l,onHandleRootKeyDown:s}=f(),d={WebkitAppearance:"none",MozAppearance:"none",WebkitTapHighlightColor:"transparent",boxSizing:"border-box",position:"absolute",display:"flex",flexDirection:r?"row":"column",placeItems:"center",contain:"layout",top:r?"-50%":void 0,left:r?void 0:"-50%",width:"100%",height:"100%",background:"none",border:0,padding:0,pointerEvents:"none",appearance:"none",outline:0,zIndex:1,translate:r?`0 var(${p}) 0`:`var(${p}) 0 0`,backfaceVisibility:"hidden",willChange:"translate",...e};return m("keydown",s,a.current,g),m("click",l,a.current,g),o("div",{ref:a,tabIndex:0,"aria-label":"Click and drag or focus and use arrow keys to change the position of the slider","aria-orientation":r?"vertical":"horizontal","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":i.current,"aria-disabled":n,"data-rcs":"handle-root",role:"slider",style:d,...t})},k=({itemClip:e,portrait:t})=>e===d?t?`inset(0px 0px calc(100% - var(${p})) 0px)`:`inset(0px calc(100% - var(${p})) 0px 0px)`:"itemTwo"===e?t?`inset(var(${p}) 0px 0px 0px)`:`inset(0px 0px 0px var(${p}))`:"none",C=({item:e,style:t,...n})=>{let{clip:r,portrait:i}=f(),a={KhtmlUserSelect:"none",MozUserSelect:"none",WebkitUserSelect:"none",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",gridArea:"1 / 1",maxWidth:"100%",overflow:"hidden",clipPath:k({itemClip:"all"===r||r===e?e:void 0,portrait:i}),boxSizing:"border-box",transform:"translateZ(0)",userSelect:"none",zIndex:e===d?1:void 0,willChange:"clip-path",...t};return o("div",{"data-rcs":"item","data-rcs-item":e,...n,style:a})},S=`clamp(var(${u}), var(${c}) - var(${u}) + var(${u}), calc(100% - var(${u})))`,E=({style:e,...n})=>{let{browsingContext:r,boundsPadding:i,changePositionOnHover:a,clip:l,isDragging:s,portrait:d,position:h,onTouchEnd:b,onPointerDown:y,onPointerMove:x,onPointerUp:w,interactiveTarget:R,rootRef:P,transition:k,canTransition:C}=f(),E={position:"relative",boxSizing:"border-box",display:"grid",maxWidth:"100%",maxHeight:"100%",overflow:"hidden",cursor:s?d?"ns-resize":"ew-resize":void 0,touchAction:"pan-y",userSelect:"none",KhtmlUserSelect:"none",msUserSelect:"none",MozUserSelect:"none",WebkitUserSelect:"none",transition:C&&k?`${c} ${k}`:"none",[c]:`${h.current}%`,[u]:i,[p]:S,...e};return m("touchend",b,R,g),m("pointerdown",y,R,g),t(()=>{let e=P.current,t=e=>{s||w(e)};return a&&(e.addEventListener("pointermove",x,v),e.addEventListener("pointerleave",t,v)),()=>{e.removeEventListener("pointermove",x),e.removeEventListener("pointerleave",t)}},[a,x,w,s,P]),t(()=>{if(s)return r.addEventListener("pointermove",x,v),r.addEventListener("pointerup",w,v),()=>{r?.removeEventListener("pointermove",x),r?.removeEventListener("pointerup",w)}},[x,w,s,r]),o("div",{ref:P,style:E,"data-rcs":"root","data-rcs-clip":l,...n})};(()=>{try{typeof CSS<"u"&&CSS.registerProperty({name:c,syntax:"<percentage>",inherits:!0,initialValue:"50%"})}catch(s){console.debug("[react-compare-slider] register CSS property:",s)}})();var O=()=>globalThis.matchMedia?.("(prefers-reduced-motion: no-preference)")?.matches?"0.15s ease-out":"none",$=()=>!!globalThis.matchMedia?.("(pointer: coarse)")?.matches,_=({boundsPadding:e="0px",browsingContext:o=globalThis,changePositionOnHover:l=!1,clip:s="all",defaultPosition:d=50,disabled:p=!1,keyboardIncrement:u="5%",onlyHandleDraggable:h=$(),onPositionChange:v,portrait:g=!1,transition:m=O()}={})=>{let y=n(null),x=n(null),f=n(d),[w,R]=r(!1),[P,k]=r(!0),[C,S]=r(null),E=a(e=>{let t=Math.min(Math.max(e,0),100);y.current?.style.setProperty(c,`${t}%`),x.current?.setAttribute("aria-valuenow",`${Math.round(t)}`),f.current=t,v?.(t)},[v]),_=a(function({x:e,y:t}){let{width:n,height:r,top:i,left:a}=y.current.getBoundingClientRect();0===n||0===r||E((g?t-i-o.scrollY:e-a-o.scrollX)/(g?r:n)*100)},[o,g,E]),A=a(e=>{e.preventDefault(),!p&&0===e.button&&(_({x:e.pageX,y:e.pageY}),R(!0),k(!0))},[p,_]),D=a(function(e){k(!1),_({x:e.pageX,y:e.pageY})},[_]),T=a(e=>{R(!1),k(!0)},[]),W=a(e=>{R(!1),k(!0)},[]),H=a(e=>{e.preventDefault(),e.currentTarget?.focus()},[]),z=a(e=>{if(!Object.values(b).includes(e.key))return;e.preventDefault(),k(!0);let t="string"==typeof u?Number.parseFloat(u):u/y.current?.getBoundingClientRect().width*100;E((g?e.key===b.ARROW_LEFT||e.key===b.ARROW_DOWN:e.key===b.ARROW_RIGHT||e.key===b.ARROW_UP)?f.current+t:f.current-t)},[u,g,E]);return i(()=>{S(h?x.current:y.current)},[h]),t(()=>{E(d)},[d,E]),{boundsPadding:e,browsingContext:o,changePositionOnHover:l,clip:s,defaultPosition:d,disabled:p,keyboardIncrement:u,onlyHandleDraggable:h,portrait:g,transition:m,onHandleRootKeyDown:z,onPointerDown:A,onPointerMove:D,onPointerUp:T,onTouchEnd:W,onHandleRootClick:H,canTransition:P,isDragging:w,position:f,setPosition:E,setPositionFromBounds:_,rootRef:y,handleRootRef:x,interactiveTarget:C}},A=({boundsPadding:e,browsingContext:t,changePositionOnHover:n,clip:r,defaultPosition:i,disabled:a,handle:l,itemOne:s,itemTwo:d,keyboardIncrement:c,onPositionChange:p,onlyHandleDraggable:u,portrait:h,transition:v,...g})=>o(x,{..._({boundsPadding:e,browsingContext:t,changePositionOnHover:n,clip:r,defaultPosition:i,disabled:a,keyboardIncrement:c,onPositionChange:p,onlyHandleDraggable:u,portrait:h,transition:v}),children:o(E,{...g,children:[o(C,{item:"itemOne",children:s}),o(C,{item:"itemTwo",children:d}),o(P,{children:l||o(R,{})})]})});export{A as ReactCompareSlider};
|