@qratilabs/qrati-connect 2.5.2 → 2.5.3

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.
Files changed (54) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/element/{AuthLayout-IGFGeMq5.js → AuthLayout-dLrNjfTG.js} +1 -1
  3. package/element/{ContentsPage-Bu42OF-F.js → ContentsPage-D5N_Bxqd.js} +1 -1
  4. package/element/{CuratePage-CBMluidb.js → CuratePage-Bd-mjSun.js} +1 -1
  5. package/element/{Dialog-DVSvxBn8.js → Dialog-BCT4uBAd.js} +1 -1
  6. package/element/{DotLottiePlayer-DHVhIw5H.js → DotLottiePlayer-CAuE83oi.js} +1 -1
  7. package/element/{EventHeaderAdminButtons-zE3NbEUA.js → EventHeaderAdminButtons-CF3CCL_D.js} +1 -1
  8. package/element/{FolderBreadcrumb-1w72I1FP.js → FolderBreadcrumb-DNjgRkum.js} +1 -1
  9. package/element/{ForgotPasswordPage-CIw8RrkZ.js → ForgotPasswordPage-d4qE75sD.js} +1 -1
  10. package/element/{InputField-XP30segE.js → InputField-DzVZ8doF.js} +1 -1
  11. package/element/{LazyLoadImage-n94OUygV.js → LazyLoadImage-D3GY3Wjr.js} +1 -1
  12. package/element/{LeaderboardPage-CGuP207i.js → LeaderboardPage-C_VE9Ci4.js} +1 -1
  13. package/element/{LoginPage-B15CMpYe.js → LoginPage-Cg8pF-HK.js} +1 -1
  14. package/element/{NCMVHL6D-D_O5jdHL.js → NCMVHL6D-cxuYBLSe.js} +1 -1
  15. package/element/{PublicEvents-DOp9N4xU.js → PublicEvents-A6FN3YA_.js} +1 -1
  16. package/element/{RegisterPage-D-6uVKjj.js → RegisterPage-C3Zm2pLv.js} +1 -1
  17. package/element/{SocialLoginButton-BuZ03WV-.js → SocialLoginButton-B_JXlwJD.js} +1 -1
  18. package/element/{UploadPage-Dhjmh06j.js → UploadPage-BBNlsruc.js} +1 -1
  19. package/element/{VideoPlayer-cWSLl4fO.js → VideoPlayer-bxfQ_8-7.js} +1 -1
  20. package/element/element.es.js +1 -1
  21. package/element/{heic2any-Dui1sz1X.js → heic2any-DhrJ4jGE.js} +1 -1
  22. package/element/{index-jzNVBihK.js → index-B07nTRSZ.js} +1 -1
  23. package/element/{index-DsN-W6V_.js → index-B7W6Qazn.js} +1 -1
  24. package/element/{index.esm-CsbPHPGO.js → index.esm-nbz30aE_.js} +1 -1
  25. package/element/{photoswipe-5mcef1lI.js → photoswipe-uy_xfi0k.js} +1 -1
  26. package/element/{tslib.es6-Dp_1P0Dk.js → tslib.es6-D07ckMAp.js} +1 -1
  27. package/element/{useOrgAccess-B1cbGHT_.js → useOrgAccess-Bc4D_9qX.js} +1 -1
  28. package/element/web.es.js +1 -1
  29. package/package.json +1 -1
  30. package/react/{VOx0knsi.js → B4U_edoH.js} +1 -1
  31. package/react/{BZvhXg2G.js → BXUUE4i8.js} +1 -1
  32. package/react/{CE-MbwCB.js → BgO9hwgt.js} +1 -1
  33. package/react/{cWB0y40v.js → BjeC9muX.js} +1 -1
  34. package/react/{DS2UD7gV.js → BsbGC0mb.js} +1 -1
  35. package/react/{6xRxF6pz.js → BtS27Hrp.js} +1 -1
  36. package/react/{Dyk2_V8r.js → BvPG5WOQ.js} +1 -1
  37. package/react/{jM4FWKDA.js → CCcmkpg2.js} +1 -1
  38. package/react/{Bebe5T7J.js → CVCROaIm.js} +1 -1
  39. package/react/{CS7icy9d.js → DDKdRpJD.js} +1 -1
  40. package/react/{C565I04Q.js → DEeNislJ.js} +1 -1
  41. package/react/{LMErjmPc.js → DFu2hVZT.js} +1 -1
  42. package/react/{Cp86U6va.js → DIbZ1HTT.js} +1 -1
  43. package/react/{vmkon26e.js → DKIOd50z.js} +1 -1
  44. package/react/{D1emifDo.js → DR1lh2_F.js} +1 -1
  45. package/react/{W8TabW9M.js → Dc_aR8k5.js} +1 -1
  46. package/react/{DPtqYlwJ.js → DhHfT-f_.js} +1 -1
  47. package/react/{DjmC7CGh.js → Dso7YRKD.js} +1 -1
  48. package/react/{CIlaT7eJ.js → Dv6l17gK.js} +1 -1
  49. package/react/{BaA7RHRf.js → DzIjyaQc.js} +1 -1
  50. package/react/{DwNWOPAY.js → XORV3RdW.js} +1 -1
  51. package/react/{DZitaH5o.js → YDJF25E_.js} +1 -1
  52. package/react/index.es.js +1 -1
  53. package/react/{Cv7EiFQU.js → zaA1B6UI.js} +1 -1
  54. package/umd/web.umd.js +1 -1
@@ -1 +1 @@
1
- import{u as a,j as s,E as r,c as t,T as l,A as e,a as c,I as n,b as i,d as o,N as f,P as d,e as h,S as m,f as x,g as j,h as q,F as g,k as p,i as u}from"./BaA7RHRf.js";import{useMemo as v,Fragment as z}from"react";import{F as b,g as w}from"./VOx0knsi.js";import{L as y}from"./DS2UD7gV.js";import{u as N,T as L}from"./DwNWOPAY.js";const A=a=>a===r.UPCOMING?"qc:bg-warning":a===r.CLOSED?"qc:bg-destructive":"qc:bg-success",E=({event:e})=>{const{organization:c}=a(),n=e?.coverImageUrl?e?.coverImageUrl:e?.contents?.length>0?e.contents[0].thumbnailUrl||e.contents[0].url:void 0;return s.jsxs("div",{className:"qc:space-y-4",children:[s.jsxs("div",{className:"qc:relative qc:h-72 qc:overflow-hidden qc:rounded qc:sm:h-80",children:[n?s.jsx(y,{wrapperClassName:"qc:size-full qc:sm:hover:scale-105 qc:sm:transition-transform",src:e?.coverImageUrl?e?.coverImageUrl:e?.contents?.length>0?e.contents[0].thumbnailUrl||e.contents[0].url:`https://placehold.co/600x400/${c?.color?.slice(1)}/white`,blurhash:e?.coverBlurHash?e?.coverBlurHash:e?.contents?.length>0?e.contents[0].blurHash:void 0}):s.jsx("div",{className:"qc:bg-primary qc:flex qc:size-full qc:items-center qc:justify-center",children:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"qc:text-primary-foreground qc:size-16",viewBox:"0 0 24 24",children:s.jsx("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"})})}),!c?.integrationSettings?.hideEventStatus&&e?.status!==r.CLOSED&&s.jsx("span",{className:t("qc:absolute qc:right-4 qc:top-4 qc:inline-flex qc:items-center qc:rounded-full qc:px-3 qc:py-2",A(e.status)),children:s.jsx(l,{variant:"h6",color:"white",children:e.status})})]}),s.jsx(l,{variant:"h4",immutable:!0,lines:"2",children:e.name})]})},I=({folder:a})=>s.jsxs("div",{className:"qc:shadow-outer qc:border-border qc:flex qc:items-center qc:gap-4 qc:rounded qc:border qc:p-2 qc:transition-colors qc:duration-200",onMouseEnter:s=>{s.currentTarget.style.backgroundColor=`${a.color}3A`},onMouseLeave:a=>{a.currentTarget.style.backgroundColor=""},children:[s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",style:{color:a.color},children:s.jsx("path",{fill:"currentColor",d:"M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h5.175q.4 0 .763.15t.637.425L12 6h8q.825 0 1.413.588T22 8v10q0 .825-.587 1.413T20 20z"})}),s.jsx(l,{variant:"h5",children:a.name})]}),T=({organization:a})=>{const{role:r,isSuper:t}=N(),l=v(()=>{const s=[];return(t||r&&(r===e.OWNER||r===e.ADMIN))&&(s.push({label:"Analytics",icon:"material-symbols:analytics-outline-rounded",href:c.ORGANIZATION_DASHBOARD(a?._id)}),s.push({label:"Admins",icon:"material-symbols:supervised-user-circle-outline",href:c.ORGANIZATION_ADMINS(a?._id)}),s.push({label:"Settings",icon:"material-symbols:settings-outline-rounded",href:c.ORGANIZATION_SETTINGS(a?._id)})),s},[r,t]);return l?.length>0?s.jsx("div",{className:"qc:text-muted qc:sm:text-foreground qc:flex qc:flex-row qc:items-center qc:justify-end qc:gap-8 qc:pr-4",children:l.map(a=>s.jsx(L,{content:a?.label,children:s.jsx("a",{target:"_blank",href:a.href,rel:"noreferrer",children:s.jsx(n,{name:a.icon,size:"lg"})})},a.label))}):null},S=()=>{const{folderId:r=""}=i(),t=o(),{folders:l,organization:e,props:{organizationId:c}}=a();if(!t?.state?.internalNavigation)try{const a=new URLSearchParams(window?.location?.search);let r=a.get("event"),t=a.get("page");if(!r&&!t&&window?.location?.hash){const a=window.location.hash.split("?");if(a.length>1){const s=new URLSearchParams(a[1]);r=s.get("event"),t=s.get("page")}}if(r){if(t)switch(t.toLowerCase()){case"upload":return s.jsx(f,{to:d.UPLOAD(r)});case"curate":return s.jsx(f,{to:d.CURATE(r)});case"leaderboard":return s.jsx(f,{to:d.LEADERBOARD(r)});default:return s.jsx(f,{to:d.GALLERY(r)})}return s.jsx(f,{to:d.GALLERY(r)})}}catch(a){console.error("Error parsing URL parameters:",a)}const n=l?.filter(a=>a.parentFolderId===(r?.length>0?r:null)||a.parentFolderId===(r?.length>0?r:void 0)),{isLoading:v,data:y}=h({queryKey:[`public-events-${c}`,r],queryFn:async()=>(await p.get(u.PUBLIC_EVENTS,{headers:{"x-org-id":c},searchParams:{folderId:r,sort:"-createdAt"}}).json()).data});return v?s.jsx("div",{className:"qc:grid qc:grid-cols-1 qc:gap-4 qc:sm:grid-cols-3 qc-mt-4",children:Array.from({length:3}).map((a,r)=>s.jsxs("div",{className:"qc:space-y-4",children:[s.jsx(m,{className:"qc:h-72 qc:overflow-hidden qc:rounded qc:sm:h-80"}),s.jsx(m,{className:"qc:h-6 qc:w-64 qc:rounded"})]},r))}):s.jsxs(z,{children:[e?.navigationSettings?.enableNavbar&&s.jsx(x,{}),s.jsxs("div",{className:"qc:min-h-screen qc:w-full",children:[s.jsx(T,{organization:e}),r&&s.jsx("div",{className:"qc:mt-4",children:s.jsx(b,{homeLink:d.PUBLIC_EVENTS,data:w(l,r)})}),n?.length>0&&s.jsx("div",{className:"qc:mt-4 qc:grid qc:grid-cols-2 qc:gap-3 qc:md:grid-cols-2 qc:lg:grid-cols-4 qc:lg:gap-6",children:n?.map(a=>s.jsx(j,{to:d.FOLDER_EVENTS(a?._id),children:s.jsx(I,{folder:a},a._id)},a?._id))}),y?.length<=0&&s.jsx("div",{className:"min-h-[80vh]",children:s.jsx(q,{title:l?.length>0?"Empty folder":"No events",description:l?.length>0?"Browse other folders for events":"Check back later for our awesome events!",className:"qc:mt-24 qc:md:mt-36",iconSvg:s.jsxs("svg",{"data-name":"Layer 1",className:"qc:size-full",viewBox:"0 0 858.76 581.93",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m982.6 738.67a198.59 198.59 0 0 1 16.436-62.675q3.7094-8.2865 8.1655-16.208a1.2103 1.2103 0 0 0-2.0886-1.2208 201.33 201.33 0 0 0-22.403 61.805q-1.682 9.0855-2.5283 18.299c-0.14337 1.5493 2.2763 1.5396 2.4188 0z",fill:"#f2f2f2"}),s.jsx("circle",{cx:"842.44",cy:"489.32",r:"15.319",fill:"#f2f2f2"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m984.17 739.08a128.83 128.83 0 0 1 10.662-40.66q2.4064-5.3758 5.2973-10.515a0.78518 0.78518 0 0 0-1.355-0.792 130.61 130.61 0 0 0-14.534 40.096q-1.0912 5.8942-1.6402 11.872c-0.093 1.0051 1.4768 0.99878 1.5692 0z",fill:"#f2f2f2"}),s.jsx("circle",{cx:"833.31",cy:"521.45",r:"9.9382",fill:"#f2f2f2"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m982.19 738.14a128.83 128.83 0 0 1-16.601-38.618q-1.409-5.7188-2.2905-11.549a0.78518 0.78518 0 0 0-1.5555 0.2089 130.61 130.61 0 0 0 13.202 40.554q2.7649 5.3186 6.0085 10.369c0.54487 0.84972 1.7787-0.12078 1.2373-0.96515z",fill:"#f2f2f2"}),s.jsx("circle",{cx:"791.11",cy:"520.75",r:"9.9382",fill:"#f2f2f2"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m341.05 738.67a198.59 198.59 0 0 0-16.436-62.675q-3.7094-8.2865-8.1655-16.208a1.2103 1.2103 0 0 1 2.0886-1.2208 201.33 201.33 0 0 1 22.403 61.805q1.682 9.0855 2.5283 18.299c0.14338 1.5493-2.2763 1.5396-2.4188 0z",fill:"#f2f2f2"}),s.jsx("circle",{cx:"139.97",cy:"489.32",r:"15.319",fill:"#f2f2f2"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m339.48 739.08a128.83 128.83 0 0 0-10.662-40.66q-2.4064-5.3758-5.2973-10.515a0.78518 0.78518 0 0 1 1.355-0.792 130.61 130.61 0 0 1 14.534 40.096q1.0912 5.8942 1.6402 11.872c0.093 1.0051-1.4768 0.99878-1.5692 0z",fill:"#f2f2f2"}),s.jsx("circle",{cx:"149.1",cy:"521.45",r:"9.9382",fill:"#f2f2f2"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m341.46 738.14a128.83 128.83 0 0 0 16.601-38.618q1.409-5.7188 2.2905-11.549a0.78518 0.78518 0 0 1 1.5555 0.2089 130.61 130.61 0 0 1-13.202 40.554q-2.7649 5.3186-6.0084 10.369c-0.54487 0.84972-1.7787-0.12078-1.2373-0.96515z",fill:"#f2f2f2"}),s.jsx("circle",{cx:"191.3",cy:"520.75",r:"9.9382",fill:"#f2f2f2"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m925.02 538.41 0.2391 180.11a12.626 12.626 0 0 1-12.593 12.63l-74.817 0.10967c21.062-39.4 32.987-101.41 32.917-149.22a281.27 281.27 0 0 0-5.721-56.161l47.345-0.0694a12.626 12.626 0 0 1 12.63 12.593z",fill:"currentColor"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m1028.2 740.97h-738.29a1.1907 1.1907 0 0 1 0-2.3814h738.29a1.1907 1.1907 0 0 1 0 2.3814z",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m815.39 513.79-133.34-0.52295 12.966-43.137a16.599 16.599 0 0 1 15.804-11.75h0.06274l76.106 0.29883a16.597 16.597 0 0 1 15.774 11.875z",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m889.83 499.03a14 14 0 0 0-14 14h28a14 14 0 0 0-14-14z",fill:"currentColor"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m932.83 740.03h-368a17.019 17.019 0 0 1-17-17v-194a17.019 17.019 0 0 1 17-17h368a17.019 17.019 0 0 1 17 17v194a17.019 17.019 0 0 1-17 17zm-368-226a15.017 15.017 0 0 0-15 15v194a15.017 15.017 0 0 0 15 15h368a15.017 15.017 0 0 0 15-15v-194a15.017 15.017 0 0 0-15-15z",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m764.83 497.53h-32a8.5 8.5 0 0 1 0-17h32a8.5 8.5 0 0 1 0 17z",fill:"#fff"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m748.83 702.03a76 76 0 1 1 76-76 76.086 76.086 0 0 1-76 76zm0-150a74 74 0 1 0 74 74 74.084 74.084 0 0 0-74-74z",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m748.83 676.03a50 50 0 1 1 50-50 50.056 50.056 0 0 1-50 50zm0-98a48 48 0 1 0 48 48 48.054 48.054 0 0 0-48-48z",fill:"#3f3d56"}),s.jsx("circle",{cx:"578.2",cy:"467",r:"38",fill:"#ccc"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m725.83 626.03a25.001 25.001 0 0 1 21.5-24.751 25 25 0 1 0 0 49.502 25.001 25.001 0 0 1-21.5-24.751z",fill:"#fff"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m914.83 514.03h-50v-1a25 25 0 0 1 50 0zm-47.979-2h45.957a23 23 0 0 0-45.957 0z",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m572.83 542.03a10 10 0 1 1 10-10 10.011 10.011 0 0 1-10 10zm0-18a8 8 0 1 0 8 8 8.0092 8.0092 0 0 0-8-8z",fill:"#3f3d56"}),s.jsx("circle",{cx:"402.2",cy:"373",r:"5",fill:"currentColor"}),s.jsx("circle",{cx:"428.2",cy:"373",r:"5",fill:"#ccc"}),s.jsx("circle",{cx:"454.2",cy:"373",r:"5",fill:"#ccc"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m598.83 542.03a10 10 0 1 1 10-10 10.011 10.011 0 0 1-10 10zm0-18a8 8 0 1 0 8 8 8.0092 8.0092 0 0 0-8-8z",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m624.83 542.03a10 10 0 1 1 10-10 10.011 10.011 0 0 1-10 10zm0-18a8 8 0 1 0 8 8 8.0092 8.0092 0 0 0-8-8z",fill:"#3f3d56"}),s.jsx("rect",{x:"378.2",y:"439.87",width:"130",height:"2",fill:"#3f3d56"}),s.jsx("rect",{x:"378.2",y:"480.13",width:"126.77",height:"2",fill:"#3f3d56"}),s.jsx("rect",{x:"648.2",y:"439.87",width:"130",height:"2",fill:"#3f3d56"}),s.jsx("rect",{x:"651.2",y:"480.13",width:"126.77",height:"2",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m443.45 401.51c-8.1095-3.7255-13.44-14.377-13.137-24.881s5.8315-20.329 13.456-25.338a26.649 26.649 0 0 1 25.219-1.9056c8.1825 3.483 19.169 4.4318 24.087 13.089 3.7796 6.6528 2.4181 21.495-0.25792 28.892-2.3129 6.394-7.9684 9.9966-13.483 12.013a45.34 45.34 0 0 1-37.511-3.0216",fill:"#2f2e41"}),s.jsx("polygon",{points:"223.38 568.71 211.72 564.91 220.8 518.14 238.01 523.74",fill:"#ffb8b8"}),s.jsx("path",{transform:"translate(72.575 -240.02) rotate(18.021)",d:"m372.58 718.9h23.644v14.887h-38.531a14.887 14.887 0 0 1 14.887-14.887z",fill:"#2f2e41"}),s.jsx("polygon",{points:"327.75 568.96 315.49 568.96 309.66 521.67 327.75 521.67",fill:"#ffb8b8"}),s.jsx("path",{d:"m306.73 565.46h23.644v14.887h-38.531a14.887 14.887 0 0 1 14.887-14.887z",fill:"#2f2e41"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m497.75 708.65c-0.07373 0-0.14746-2e-3 -0.22168-0.00585l-13.586-0.64747a4.5061 4.5061 0 0 1-4.2854-4.4326l-1.8411-134.39a1.5 1.5 0 0 0-2.8267-0.67871l-71.958 136.44a4.4762 4.4762 0 0 1-4.822 2.3213l-13.521-2.5752a4.4992 4.4992 0 0 1-3.4014-5.918l52.43-148.55 4.0344-43.943a4.4698 4.4698 0 0 1 3.936-4.0498c15.277-1.877 36.624-14.395 45.092-19.689a4.446 4.446 0 0 1 3.5305-0.53125 4.5558 4.5558 0 0 1 2.8308 2.2451 202.75 202.75 0 0 1 22.277 123.98l-13.217 96.54a4.4752 4.4752 0 0 1-4.4507 3.8907z",fill:"#2f2e41"}),s.jsx("circle",{cx:"290.56",cy:"228.24",r:"24.561",fill:"#ffb8b8"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m436.71 516.82-7.3955-52.845a31.045 31.045 0 0 1 60.574-13.635c2.106 9.7686 6.385 21.66 4.8218 34.479-10.953 30.399-30.835 39.772-58 32z",fill:"#b3b3b3"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m469.21 434.82h-18a4.5051 4.5051 0 0 1-4.5-4.5v-6a4.5051 4.5051 0 0 1 4.5-4.5h18a4.5051 4.5051 0 0 1 4.5 4.5v6a4.5051 4.5051 0 0 1-4.5 4.5z",fill:"#b3b3b3"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m560.44 534.7a10.743 10.743 0 0 0-8.7149-13.979l-56.029-80.214-16.614 16.425 60.299 73.683a10.801 10.801 0 0 0 21.059 4.0847z",fill:"#ffb8b8"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m513.22 465.05-20.234 13.507a4.8169 4.8169 0 0 1-7.0291-1.9475l-10.365-21.928a13.377 13.377 0 0 1 22.295-14.789l16.229 17.919a4.8169 4.8169 0 0 1-0.8968 7.2386z",fill:"#b3b3b3"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m362.5 426.92a10.526 10.526 0 0 1 0.2393 1.6401l42.957 24.782 10.441-6.0109 11.131 14.572-17.45 12.438a8 8 0 0 1-9.5982-0.23384l-44.297-34.946a10.497 10.497 0 1 1 6.5757-12.241z",fill:"#ffb8b8"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m418.18 471.35-10.794-21.802a4.8169 4.8169 0 0 1 2.835-6.7204l23.078-7.4597a13.377 13.377 0 0 1 11.8 24.012l-19.857 13.79a4.8169 4.8169 0 0 1-7.0632-1.82z",fill:"#b3b3b3"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m477.67 356.34a4.0633 4.0633 0 0 0 4.3168-2.4094 5.8506 5.8506 0 0 0-0.41558-5.1377 10.736 10.736 0 0 0-3.7759-3.7034 12.406 12.406 0 0 0-5.9816-2.0579 7.4612 7.4612 0 0 0-5.7939 2.1993 5.3768 5.3768 0 0 0-0.97171 5.9276c0.89811 1.7319 2.7825 2.7031 4.6186 3.3625a27.094 27.094 0 0 0 11.378 1.4944",fill:"#2f2e41"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m485.52 398.45c-4.2928 0.20179-3.5536-8.9072-4.8971-12.989s-3.1955-8.9513-7.4212-9.734c-3.463-0.6414-6.5925 1.8908-9.609 3.7086-5.3764 3.24-12.336 4.4352-17.981 1.6906s-9.0786-10.078-6.3329-15.723a12.876 12.876 0 0 1 8.049-6.3415 25.906 25.906 0 0 1 10.462-0.50253 53.527 53.527 0 0 1 21.886 7.7574c4.5819 2.8736 8.9417 6.7864 10.306 12.02s1.9198 19.465-3.413 20.366z",fill:"#2f2e41"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m474.29 343.67c-3.2427-4.1108-2.0213-10.588 1.7582-14.211s9.3995-4.7529 14.615-4.292a29.621 29.621 0 0 1 24.025 17.275c3.2959 7.5393 3.2687 16.163 6.2494 23.832a32.137 32.137 0 0 0 43.41 17.543c5.1881-2.3921 10.128-7.0763 9.8321-12.782 3.2802 12.646-2.6276 27.112-13.823 33.847-6.5573 3.9448-14.323 5.284-21.92 6.2056-4.9507 0.60059-10.039 1.0474-14.87-0.18987-6.7592-1.731-12.418-6.7198-15.845-12.798s-4.7748-13.161-4.827-20.138c-0.04071-5.4353 0.67085-10.873 0.29483-16.296s-2.0061-11.031-5.9367-14.785-10.564-4.9899-14.878-1.6831c-1.7337 1.329-3.0043 3.2697-4.9563 4.2502s-5.036 0.21793-5.1666-1.9626z",fill:"#2f2e41"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m380.18 427.1h-202.58a6.9935 6.9935 0 0 1-6.9854-6.9854v-114.1a6.9936 6.9936 0 0 1 6.9854-6.9854h202.58a6.9933 6.9933 0 0 1 6.9854 6.9854v114.1a6.9933 6.9933 0 0 1-6.9854 6.9854zm-202.58-126.51a5.4392 5.4392 0 0 0-5.4331 5.4331v114.1a5.4392 5.4392 0 0 0 5.4331 5.4331h202.58a5.4395 5.4395 0 0 0 5.4331-5.4331v-114.1a5.4394 5.4394 0 0 0-5.4331-5.4331z",fill:"#3f3d56"}),s.jsx("circle",{cx:"73.768",cy:"191.12",r:"28.967",fill:"#e6e6e6"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m356.01 401.31-34.003-58.895a2.4215 2.4215 0 0 0-4.1941 0l-20.751 35.942-30.936-53.582a3.1047 3.1047 0 0 0-5.3774 0l-43.596 75.511a3.1046 3.1046 0 0 0 2.6887 4.657h134.07a2.4215 2.4215 0 0 0 2.0971-3.6322z",fill:"currentColor"}),s.jsx("rect",{x:"14.747",y:"153.97",width:"12.419",height:"12.419",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m459.04 259.1h-158.29a5.4645 5.4645 0 0 1-5.4581-5.4582v-89.15a5.4645 5.4645 0 0 1 5.4581-5.4582h158.29a5.4643 5.4643 0 0 1 5.4582 5.4582v89.15a5.4643 5.4643 0 0 1-5.4582 5.4582zm-158.29-98.853a4.25 4.25 0 0 0-4.2452 4.2452v89.15a4.25 4.25 0 0 0 4.2452 4.2452h158.29a4.2502 4.2502 0 0 0 4.2452-4.2452v-89.15a4.2502 4.2502 0 0 0-4.2452-4.2452z",fill:"#ccc"}),s.jsx("circle",{cx:"182.31",cy:"39.947",r:"22.634",fill:"#f2f2f2"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m440.15 238.95-26.569-46.018a1.892 1.892 0 0 0-3.2771 0l-16.214 28.084-24.172-41.867a2.4259 2.4259 0 0 0-4.2017 0l-34.064 59.001a2.4258 2.4258 0 0 0 2.1008 3.6388h104.76a1.8921 1.8921 0 0 0 1.6386-2.8381z",fill:"#e6e6e6"}),s.jsx("rect",{x:"136.2",y:"10.916",width:"9.7034",height:"9.7034",fill:"#ccc"})]})})}),y?.length>0&&s.jsx("div",{className:"qc:grid qc:grid-cols-1 qc:gap-4 qc:gap-y-6 qc:pb-16 qc:sm:grid-cols-3 qc:mt-4",children:y?.map(a=>s.jsx(j,{to:d.GALLERY(a.slug),children:s.jsx(E,{event:a})},a._id))})]}),s.jsx(g,{})]})};export{S as default};
1
+ import{u as a,j as s,E as r,c as t,T as l,A as e,a as c,I as n,b as i,d as o,N as f,P as d,e as h,S as m,f as x,g as j,h as q,F as g,k as p,i as u}from"./DzIjyaQc.js";import{useMemo as v,Fragment as z}from"react";import{F as b,g as w}from"./B4U_edoH.js";import{L as y}from"./BsbGC0mb.js";import{u as N,T as L}from"./XORV3RdW.js";const A=a=>a===r.UPCOMING?"qc:bg-warning":a===r.CLOSED?"qc:bg-destructive":"qc:bg-success",E=({event:e})=>{const{organization:c}=a(),n=e?.coverImageUrl?e?.coverImageUrl:e?.contents?.length>0?e.contents[0].thumbnailUrl||e.contents[0].url:void 0;return s.jsxs("div",{className:"qc:space-y-4",children:[s.jsxs("div",{className:"qc:relative qc:h-72 qc:overflow-hidden qc:rounded qc:sm:h-80",children:[n?s.jsx(y,{wrapperClassName:"qc:size-full qc:sm:hover:scale-105 qc:sm:transition-transform",src:e?.coverImageUrl?e?.coverImageUrl:e?.contents?.length>0?e.contents[0].thumbnailUrl||e.contents[0].url:`https://placehold.co/600x400/${c?.color?.slice(1)}/white`,blurhash:e?.coverBlurHash?e?.coverBlurHash:e?.contents?.length>0?e.contents[0].blurHash:void 0}):s.jsx("div",{className:"qc:bg-primary qc:flex qc:size-full qc:items-center qc:justify-center",children:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"qc:text-primary-foreground qc:size-16",viewBox:"0 0 24 24",children:s.jsx("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"})})}),!c?.integrationSettings?.hideEventStatus&&e?.status!==r.CLOSED&&s.jsx("span",{className:t("qc:absolute qc:right-4 qc:top-4 qc:inline-flex qc:items-center qc:rounded-full qc:px-3 qc:py-2",A(e.status)),children:s.jsx(l,{variant:"h6",color:"white",children:e.status})})]}),s.jsx(l,{variant:"h4",immutable:!0,lines:"2",children:e.name})]})},I=({folder:a})=>s.jsxs("div",{className:"qc:shadow-outer qc:border-border qc:flex qc:items-center qc:gap-4 qc:rounded qc:border qc:p-2 qc:transition-colors qc:duration-200",onMouseEnter:s=>{s.currentTarget.style.backgroundColor=`${a.color}3A`},onMouseLeave:a=>{a.currentTarget.style.backgroundColor=""},children:[s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",style:{color:a.color},children:s.jsx("path",{fill:"currentColor",d:"M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h5.175q.4 0 .763.15t.637.425L12 6h8q.825 0 1.413.588T22 8v10q0 .825-.587 1.413T20 20z"})}),s.jsx(l,{variant:"h5",children:a.name})]}),T=({organization:a})=>{const{role:r,isSuper:t}=N(),l=v(()=>{const s=[];return(t||r&&(r===e.OWNER||r===e.ADMIN))&&(s.push({label:"Analytics",icon:"material-symbols:analytics-outline-rounded",href:c.ORGANIZATION_DASHBOARD(a?._id)}),s.push({label:"Admins",icon:"material-symbols:supervised-user-circle-outline",href:c.ORGANIZATION_ADMINS(a?._id)}),s.push({label:"Settings",icon:"material-symbols:settings-outline-rounded",href:c.ORGANIZATION_SETTINGS(a?._id)})),s},[r,t]);return l?.length>0?s.jsx("div",{className:"qc:text-muted qc:sm:text-foreground qc:flex qc:flex-row qc:items-center qc:justify-end qc:gap-8 qc:pr-4",children:l.map(a=>s.jsx(L,{content:a?.label,children:s.jsx("a",{target:"_blank",href:a.href,rel:"noreferrer",children:s.jsx(n,{name:a.icon,size:"lg"})})},a.label))}):null},S=()=>{const{folderId:r=""}=i(),t=o(),{folders:l,organization:e,props:{organizationId:c}}=a();if(!t?.state?.internalNavigation)try{const a=new URLSearchParams(window?.location?.search);let r=a.get("event"),t=a.get("page");if(!r&&!t&&window?.location?.hash){const a=window.location.hash.split("?");if(a.length>1){const s=new URLSearchParams(a[1]);r=s.get("event"),t=s.get("page")}}if(r){if(t)switch(t.toLowerCase()){case"upload":return s.jsx(f,{to:d.UPLOAD(r)});case"curate":return s.jsx(f,{to:d.CURATE(r)});case"leaderboard":return s.jsx(f,{to:d.LEADERBOARD(r)});default:return s.jsx(f,{to:d.GALLERY(r)})}return s.jsx(f,{to:d.GALLERY(r)})}}catch(a){console.error("Error parsing URL parameters:",a)}const n=l?.filter(a=>a.parentFolderId===(r?.length>0?r:null)||a.parentFolderId===(r?.length>0?r:void 0)),{isLoading:v,data:y}=h({queryKey:[`public-events-${c}`,r],queryFn:async()=>(await p.get(u.PUBLIC_EVENTS,{headers:{"x-org-id":c},searchParams:{folderId:r,sort:"-createdAt"}}).json()).data});return v?s.jsx("div",{className:"qc:grid qc:grid-cols-1 qc:gap-4 qc:sm:grid-cols-3 qc-mt-4",children:Array.from({length:3}).map((a,r)=>s.jsxs("div",{className:"qc:space-y-4",children:[s.jsx(m,{className:"qc:h-72 qc:overflow-hidden qc:rounded qc:sm:h-80"}),s.jsx(m,{className:"qc:h-6 qc:w-64 qc:rounded"})]},r))}):s.jsxs(z,{children:[e?.navigationSettings?.enableNavbar&&s.jsx(x,{}),s.jsxs("div",{className:"qc:min-h-screen qc:w-full",children:[s.jsx(T,{organization:e}),r&&s.jsx("div",{className:"qc:mt-4",children:s.jsx(b,{homeLink:d.PUBLIC_EVENTS,data:w(l,r)})}),n?.length>0&&s.jsx("div",{className:"qc:mt-4 qc:grid qc:grid-cols-2 qc:gap-3 qc:md:grid-cols-2 qc:lg:grid-cols-4 qc:lg:gap-6",children:n?.map(a=>s.jsx(j,{to:d.FOLDER_EVENTS(a?._id),children:s.jsx(I,{folder:a},a._id)},a?._id))}),y?.length<=0&&s.jsx("div",{className:"min-h-[80vh]",children:s.jsx(q,{title:l?.length>0?"Empty folder":"No events",description:l?.length>0?"Browse other folders for events":"Check back later for our awesome events!",className:"qc:mt-24 qc:md:mt-36",iconSvg:s.jsxs("svg",{"data-name":"Layer 1",className:"qc:size-full",viewBox:"0 0 858.76 581.93",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m982.6 738.67a198.59 198.59 0 0 1 16.436-62.675q3.7094-8.2865 8.1655-16.208a1.2103 1.2103 0 0 0-2.0886-1.2208 201.33 201.33 0 0 0-22.403 61.805q-1.682 9.0855-2.5283 18.299c-0.14337 1.5493 2.2763 1.5396 2.4188 0z",fill:"#f2f2f2"}),s.jsx("circle",{cx:"842.44",cy:"489.32",r:"15.319",fill:"#f2f2f2"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m984.17 739.08a128.83 128.83 0 0 1 10.662-40.66q2.4064-5.3758 5.2973-10.515a0.78518 0.78518 0 0 0-1.355-0.792 130.61 130.61 0 0 0-14.534 40.096q-1.0912 5.8942-1.6402 11.872c-0.093 1.0051 1.4768 0.99878 1.5692 0z",fill:"#f2f2f2"}),s.jsx("circle",{cx:"833.31",cy:"521.45",r:"9.9382",fill:"#f2f2f2"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m982.19 738.14a128.83 128.83 0 0 1-16.601-38.618q-1.409-5.7188-2.2905-11.549a0.78518 0.78518 0 0 0-1.5555 0.2089 130.61 130.61 0 0 0 13.202 40.554q2.7649 5.3186 6.0085 10.369c0.54487 0.84972 1.7787-0.12078 1.2373-0.96515z",fill:"#f2f2f2"}),s.jsx("circle",{cx:"791.11",cy:"520.75",r:"9.9382",fill:"#f2f2f2"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m341.05 738.67a198.59 198.59 0 0 0-16.436-62.675q-3.7094-8.2865-8.1655-16.208a1.2103 1.2103 0 0 1 2.0886-1.2208 201.33 201.33 0 0 1 22.403 61.805q1.682 9.0855 2.5283 18.299c0.14338 1.5493-2.2763 1.5396-2.4188 0z",fill:"#f2f2f2"}),s.jsx("circle",{cx:"139.97",cy:"489.32",r:"15.319",fill:"#f2f2f2"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m339.48 739.08a128.83 128.83 0 0 0-10.662-40.66q-2.4064-5.3758-5.2973-10.515a0.78518 0.78518 0 0 1 1.355-0.792 130.61 130.61 0 0 1 14.534 40.096q1.0912 5.8942 1.6402 11.872c0.093 1.0051-1.4768 0.99878-1.5692 0z",fill:"#f2f2f2"}),s.jsx("circle",{cx:"149.1",cy:"521.45",r:"9.9382",fill:"#f2f2f2"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m341.46 738.14a128.83 128.83 0 0 0 16.601-38.618q1.409-5.7188 2.2905-11.549a0.78518 0.78518 0 0 1 1.5555 0.2089 130.61 130.61 0 0 1-13.202 40.554q-2.7649 5.3186-6.0084 10.369c-0.54487 0.84972-1.7787-0.12078-1.2373-0.96515z",fill:"#f2f2f2"}),s.jsx("circle",{cx:"191.3",cy:"520.75",r:"9.9382",fill:"#f2f2f2"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m925.02 538.41 0.2391 180.11a12.626 12.626 0 0 1-12.593 12.63l-74.817 0.10967c21.062-39.4 32.987-101.41 32.917-149.22a281.27 281.27 0 0 0-5.721-56.161l47.345-0.0694a12.626 12.626 0 0 1 12.63 12.593z",fill:"currentColor"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m1028.2 740.97h-738.29a1.1907 1.1907 0 0 1 0-2.3814h738.29a1.1907 1.1907 0 0 1 0 2.3814z",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m815.39 513.79-133.34-0.52295 12.966-43.137a16.599 16.599 0 0 1 15.804-11.75h0.06274l76.106 0.29883a16.597 16.597 0 0 1 15.774 11.875z",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m889.83 499.03a14 14 0 0 0-14 14h28a14 14 0 0 0-14-14z",fill:"currentColor"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m932.83 740.03h-368a17.019 17.019 0 0 1-17-17v-194a17.019 17.019 0 0 1 17-17h368a17.019 17.019 0 0 1 17 17v194a17.019 17.019 0 0 1-17 17zm-368-226a15.017 15.017 0 0 0-15 15v194a15.017 15.017 0 0 0 15 15h368a15.017 15.017 0 0 0 15-15v-194a15.017 15.017 0 0 0-15-15z",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m764.83 497.53h-32a8.5 8.5 0 0 1 0-17h32a8.5 8.5 0 0 1 0 17z",fill:"#fff"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m748.83 702.03a76 76 0 1 1 76-76 76.086 76.086 0 0 1-76 76zm0-150a74 74 0 1 0 74 74 74.084 74.084 0 0 0-74-74z",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m748.83 676.03a50 50 0 1 1 50-50 50.056 50.056 0 0 1-50 50zm0-98a48 48 0 1 0 48 48 48.054 48.054 0 0 0-48-48z",fill:"#3f3d56"}),s.jsx("circle",{cx:"578.2",cy:"467",r:"38",fill:"#ccc"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m725.83 626.03a25.001 25.001 0 0 1 21.5-24.751 25 25 0 1 0 0 49.502 25.001 25.001 0 0 1-21.5-24.751z",fill:"#fff"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m914.83 514.03h-50v-1a25 25 0 0 1 50 0zm-47.979-2h45.957a23 23 0 0 0-45.957 0z",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m572.83 542.03a10 10 0 1 1 10-10 10.011 10.011 0 0 1-10 10zm0-18a8 8 0 1 0 8 8 8.0092 8.0092 0 0 0-8-8z",fill:"#3f3d56"}),s.jsx("circle",{cx:"402.2",cy:"373",r:"5",fill:"currentColor"}),s.jsx("circle",{cx:"428.2",cy:"373",r:"5",fill:"#ccc"}),s.jsx("circle",{cx:"454.2",cy:"373",r:"5",fill:"#ccc"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m598.83 542.03a10 10 0 1 1 10-10 10.011 10.011 0 0 1-10 10zm0-18a8 8 0 1 0 8 8 8.0092 8.0092 0 0 0-8-8z",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m624.83 542.03a10 10 0 1 1 10-10 10.011 10.011 0 0 1-10 10zm0-18a8 8 0 1 0 8 8 8.0092 8.0092 0 0 0-8-8z",fill:"#3f3d56"}),s.jsx("rect",{x:"378.2",y:"439.87",width:"130",height:"2",fill:"#3f3d56"}),s.jsx("rect",{x:"378.2",y:"480.13",width:"126.77",height:"2",fill:"#3f3d56"}),s.jsx("rect",{x:"648.2",y:"439.87",width:"130",height:"2",fill:"#3f3d56"}),s.jsx("rect",{x:"651.2",y:"480.13",width:"126.77",height:"2",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m443.45 401.51c-8.1095-3.7255-13.44-14.377-13.137-24.881s5.8315-20.329 13.456-25.338a26.649 26.649 0 0 1 25.219-1.9056c8.1825 3.483 19.169 4.4318 24.087 13.089 3.7796 6.6528 2.4181 21.495-0.25792 28.892-2.3129 6.394-7.9684 9.9966-13.483 12.013a45.34 45.34 0 0 1-37.511-3.0216",fill:"#2f2e41"}),s.jsx("polygon",{points:"223.38 568.71 211.72 564.91 220.8 518.14 238.01 523.74",fill:"#ffb8b8"}),s.jsx("path",{transform:"translate(72.575 -240.02) rotate(18.021)",d:"m372.58 718.9h23.644v14.887h-38.531a14.887 14.887 0 0 1 14.887-14.887z",fill:"#2f2e41"}),s.jsx("polygon",{points:"327.75 568.96 315.49 568.96 309.66 521.67 327.75 521.67",fill:"#ffb8b8"}),s.jsx("path",{d:"m306.73 565.46h23.644v14.887h-38.531a14.887 14.887 0 0 1 14.887-14.887z",fill:"#2f2e41"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m497.75 708.65c-0.07373 0-0.14746-2e-3 -0.22168-0.00585l-13.586-0.64747a4.5061 4.5061 0 0 1-4.2854-4.4326l-1.8411-134.39a1.5 1.5 0 0 0-2.8267-0.67871l-71.958 136.44a4.4762 4.4762 0 0 1-4.822 2.3213l-13.521-2.5752a4.4992 4.4992 0 0 1-3.4014-5.918l52.43-148.55 4.0344-43.943a4.4698 4.4698 0 0 1 3.936-4.0498c15.277-1.877 36.624-14.395 45.092-19.689a4.446 4.446 0 0 1 3.5305-0.53125 4.5558 4.5558 0 0 1 2.8308 2.2451 202.75 202.75 0 0 1 22.277 123.98l-13.217 96.54a4.4752 4.4752 0 0 1-4.4507 3.8907z",fill:"#2f2e41"}),s.jsx("circle",{cx:"290.56",cy:"228.24",r:"24.561",fill:"#ffb8b8"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m436.71 516.82-7.3955-52.845a31.045 31.045 0 0 1 60.574-13.635c2.106 9.7686 6.385 21.66 4.8218 34.479-10.953 30.399-30.835 39.772-58 32z",fill:"#b3b3b3"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m469.21 434.82h-18a4.5051 4.5051 0 0 1-4.5-4.5v-6a4.5051 4.5051 0 0 1 4.5-4.5h18a4.5051 4.5051 0 0 1 4.5 4.5v6a4.5051 4.5051 0 0 1-4.5 4.5z",fill:"#b3b3b3"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m560.44 534.7a10.743 10.743 0 0 0-8.7149-13.979l-56.029-80.214-16.614 16.425 60.299 73.683a10.801 10.801 0 0 0 21.059 4.0847z",fill:"#ffb8b8"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m513.22 465.05-20.234 13.507a4.8169 4.8169 0 0 1-7.0291-1.9475l-10.365-21.928a13.377 13.377 0 0 1 22.295-14.789l16.229 17.919a4.8169 4.8169 0 0 1-0.8968 7.2386z",fill:"#b3b3b3"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m362.5 426.92a10.526 10.526 0 0 1 0.2393 1.6401l42.957 24.782 10.441-6.0109 11.131 14.572-17.45 12.438a8 8 0 0 1-9.5982-0.23384l-44.297-34.946a10.497 10.497 0 1 1 6.5757-12.241z",fill:"#ffb8b8"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m418.18 471.35-10.794-21.802a4.8169 4.8169 0 0 1 2.835-6.7204l23.078-7.4597a13.377 13.377 0 0 1 11.8 24.012l-19.857 13.79a4.8169 4.8169 0 0 1-7.0632-1.82z",fill:"#b3b3b3"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m477.67 356.34a4.0633 4.0633 0 0 0 4.3168-2.4094 5.8506 5.8506 0 0 0-0.41558-5.1377 10.736 10.736 0 0 0-3.7759-3.7034 12.406 12.406 0 0 0-5.9816-2.0579 7.4612 7.4612 0 0 0-5.7939 2.1993 5.3768 5.3768 0 0 0-0.97171 5.9276c0.89811 1.7319 2.7825 2.7031 4.6186 3.3625a27.094 27.094 0 0 0 11.378 1.4944",fill:"#2f2e41"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m485.52 398.45c-4.2928 0.20179-3.5536-8.9072-4.8971-12.989s-3.1955-8.9513-7.4212-9.734c-3.463-0.6414-6.5925 1.8908-9.609 3.7086-5.3764 3.24-12.336 4.4352-17.981 1.6906s-9.0786-10.078-6.3329-15.723a12.876 12.876 0 0 1 8.049-6.3415 25.906 25.906 0 0 1 10.462-0.50253 53.527 53.527 0 0 1 21.886 7.7574c4.5819 2.8736 8.9417 6.7864 10.306 12.02s1.9198 19.465-3.413 20.366z",fill:"#2f2e41"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m474.29 343.67c-3.2427-4.1108-2.0213-10.588 1.7582-14.211s9.3995-4.7529 14.615-4.292a29.621 29.621 0 0 1 24.025 17.275c3.2959 7.5393 3.2687 16.163 6.2494 23.832a32.137 32.137 0 0 0 43.41 17.543c5.1881-2.3921 10.128-7.0763 9.8321-12.782 3.2802 12.646-2.6276 27.112-13.823 33.847-6.5573 3.9448-14.323 5.284-21.92 6.2056-4.9507 0.60059-10.039 1.0474-14.87-0.18987-6.7592-1.731-12.418-6.7198-15.845-12.798s-4.7748-13.161-4.827-20.138c-0.04071-5.4353 0.67085-10.873 0.29483-16.296s-2.0061-11.031-5.9367-14.785-10.564-4.9899-14.878-1.6831c-1.7337 1.329-3.0043 3.2697-4.9563 4.2502s-5.036 0.21793-5.1666-1.9626z",fill:"#2f2e41"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m380.18 427.1h-202.58a6.9935 6.9935 0 0 1-6.9854-6.9854v-114.1a6.9936 6.9936 0 0 1 6.9854-6.9854h202.58a6.9933 6.9933 0 0 1 6.9854 6.9854v114.1a6.9933 6.9933 0 0 1-6.9854 6.9854zm-202.58-126.51a5.4392 5.4392 0 0 0-5.4331 5.4331v114.1a5.4392 5.4392 0 0 0 5.4331 5.4331h202.58a5.4395 5.4395 0 0 0 5.4331-5.4331v-114.1a5.4394 5.4394 0 0 0-5.4331-5.4331z",fill:"#3f3d56"}),s.jsx("circle",{cx:"73.768",cy:"191.12",r:"28.967",fill:"#e6e6e6"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m356.01 401.31-34.003-58.895a2.4215 2.4215 0 0 0-4.1941 0l-20.751 35.942-30.936-53.582a3.1047 3.1047 0 0 0-5.3774 0l-43.596 75.511a3.1046 3.1046 0 0 0 2.6887 4.657h134.07a2.4215 2.4215 0 0 0 2.0971-3.6322z",fill:"currentColor"}),s.jsx("rect",{x:"14.747",y:"153.97",width:"12.419",height:"12.419",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m459.04 259.1h-158.29a5.4645 5.4645 0 0 1-5.4581-5.4582v-89.15a5.4645 5.4645 0 0 1 5.4581-5.4582h158.29a5.4643 5.4643 0 0 1 5.4582 5.4582v89.15a5.4643 5.4643 0 0 1-5.4582 5.4582zm-158.29-98.853a4.25 4.25 0 0 0-4.2452 4.2452v89.15a4.25 4.25 0 0 0 4.2452 4.2452h158.29a4.2502 4.2502 0 0 0 4.2452-4.2452v-89.15a4.2502 4.2502 0 0 0-4.2452-4.2452z",fill:"#ccc"}),s.jsx("circle",{cx:"182.31",cy:"39.947",r:"22.634",fill:"#f2f2f2"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m440.15 238.95-26.569-46.018a1.892 1.892 0 0 0-3.2771 0l-16.214 28.084-24.172-41.867a2.4259 2.4259 0 0 0-4.2017 0l-34.064 59.001a2.4258 2.4258 0 0 0 2.1008 3.6388h104.76a1.8921 1.8921 0 0 0 1.6386-2.8381z",fill:"#e6e6e6"}),s.jsx("rect",{x:"136.2",y:"10.916",width:"9.7034",height:"9.7034",fill:"#ccc"})]})})}),y?.length>0&&s.jsx("div",{className:"qc:grid qc:grid-cols-1 qc:gap-4 qc:gap-y-6 qc:pb-16 qc:sm:grid-cols-3 qc:mt-4",children:y?.map(a=>s.jsx(j,{to:d.GALLERY(a.slug),children:s.jsx(E,{event:a})},a._id))})]}),s.jsx(g,{})]})};export{S as default};
@@ -1 +1 @@
1
- import{u as e,j as c,c as t}from"./BaA7RHRf.js";const r=({label:r,type:s="text",step:o=1,disabled:q,error:a,info:d,iconSVG:i,className:l="",...n})=>{const{props:{textClassName:m}}=e();return c.jsxs("div",{className:"qc:relative",children:[r&&c.jsx("div",{className:"qc:mb-1 qc:flex qc:items-center qc:gap-1",children:c.jsx("label",{className:t("qc:select-none qc:text-sm qc:font-medium",m,q?"qc:text-muted":"qc:text-foreground"),children:r})}),c.jsx("input",{type:s,disabled:q,step:"number"===s?o:void 0,"aria-invalid":!!a,className:t("qc:text-foreground qc:border-border qc:shadow-outer qc:focus:border-primary qc:focus:ring-primary qc:peer qc:w-full qc:rounded qc:border qc:p-2 qc:focus:outline-none",q?"qc:text-muted qc:bg-transparent":"qc:text-foreground qc:bg-white",a?"qc:border-destructive":"qc:border-border",i?"qc:pl-9":"",m,l),...n}),c.jsx("div",{className:t("qc:text-destructive qc:absolute qc:left-0 qc:flex qc:items-center qc:gap-1 qc:text-xs qc:transition-all qc:duration-300 qc:md:text-sm",a?"qc:-bottom-5 qc:opacity-100":"qc:-bottom-1 qc:opacity-0",m),children:c.jsx("label",{children:a})})]})};export{r as I};
1
+ import{u as e,j as c,c as t}from"./DzIjyaQc.js";const r=({label:r,type:s="text",step:o=1,disabled:q,error:a,info:d,iconSVG:i,className:l="",...n})=>{const{props:{textClassName:m}}=e();return c.jsxs("div",{className:"qc:relative",children:[r&&c.jsx("div",{className:"qc:mb-1 qc:flex qc:items-center qc:gap-1",children:c.jsx("label",{className:t("qc:select-none qc:text-sm qc:font-medium",m,q?"qc:text-muted":"qc:text-foreground"),children:r})}),c.jsx("input",{type:s,disabled:q,step:"number"===s?o:void 0,"aria-invalid":!!a,className:t("qc:text-foreground qc:border-border qc:shadow-outer qc:focus:border-primary qc:focus:ring-primary qc:peer qc:w-full qc:rounded qc:border qc:p-2 qc:focus:outline-none",q?"qc:text-muted qc:bg-transparent":"qc:text-foreground qc:bg-white",a?"qc:border-destructive":"qc:border-border",i?"qc:pl-9":"",m,l),...n}),c.jsx("div",{className:t("qc:text-destructive qc:absolute qc:left-0 qc:flex qc:items-center qc:gap-1 qc:text-xs qc:transition-all qc:duration-300 qc:md:text-sm",a?"qc:-bottom-5 qc:opacity-100":"qc:-bottom-1 qc:opacity-0",m),children:c.jsx("label",{children:a})})]})};export{r as I};
@@ -1 +1 @@
1
- import{c as e,T as r,P as t,a,b as s,C as o,Q as l}from"./Cp86U6va.js";import{a5 as n,a6 as c,a7 as i}from"./BaA7RHRf.js";var u=u=>{const[d,h]=e({prefix:"TanstackQueryDevtools"}),m=n(),v=c(()=>{const e=d.theme_preference||r;return"system"!==e?e:m()});return i(l.Provider,{value:u,get children(){return i(t,{disabled:!0,localStore:d,setLocalStore:h,get children(){return i(a.Provider,{value:v,get children(){return i(s,{get children(){return i(o,{localStore:d,setLocalStore:h,get onClose(){return u.onClose},showPanelViewOnly:!0})}})}})}})}})};export{u as default};
1
+ import{c as e,T as r,P as t,a,b as s,C as o,Q as l}from"./DIbZ1HTT.js";import{a5 as n,a6 as c,a7 as i}from"./DzIjyaQc.js";var u=u=>{const[d,h]=e({prefix:"TanstackQueryDevtools"}),m=n(),v=c(()=>{const e=d.theme_preference||r;return"system"!==e?e:m()});return i(l.Provider,{value:u,get children(){return i(t,{disabled:!0,localStore:d,setLocalStore:h,get children(){return i(a.Provider,{value:v,get children(){return i(s,{get children(){return i(o,{localStore:d,setLocalStore:h,get onClose(){return u.onClose},showPanelViewOnly:!0})}})}})}})}})};export{u as default};
@@ -1 +1 @@
1
- import{u as e,j as s,J as a,T as r,g as o,P as l}from"./BaA7RHRf.js";import{useState as i}from"react";import{I as n}from"./Bebe5T7J.js";import{S as d}from"./D1emifDo.js";import{u as t,C as c,o as m,c as u,a as g,b as p}from"./-74yB4f5.js";const h={fname:"",lname:"",email:"",password:"",confirmPassword:""},w=u().shape({fname:g().required("First name is required"),lname:g().required("Last name is required"),email:g().required("Please enter your Email").email("Enter a valid Email"),password:g().required("Please enter your password").min(8,"Min password length is 8"),confirmPassword:g().required("Please confirm your password").oneOf([p("password"),null],"Passwords do not match")}),f=()=>{const[u,g]=i(null),[p,f]=i(!1),[j,x]=i({google:!1,apple:!1}),[q,v]=i({showPassword:!1,showConfirmPassword:!1}),{registerUsingEmail:y,loginWithGoogle:C,loginWithApple:b}=e(),P=async(e,s)=>{x(s=>({...s,[e]:!0})),g(null);try{await s()}catch(s){g(s.message||`Failed to sign up with ${e.charAt(0).toUpperCase()+e.slice(1)}`)}finally{x(s=>({...s,[e]:!1}))}},{control:N,handleSubmit:B,formState:{errors:S}}=t({defaultValues:h,mode:"onSubmit",resolver:m(w)});return s.jsxs("div",{className:"qc:w-full qc:space-y-8 qc:bg-background",children:[s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:B(async e=>{const{email:s,password:a,fname:r,lname:o}=e;f(!0);try{const e=await y(s.toLowerCase(),a,r,o);e?.error&&g(e.error)}catch(e){g(e)}finally{f(!1)}}),className:"qc:space-y-4",children:[s.jsxs("div",{className:"qc:grid qc:grid-cols-2 qc:gap-4",children:[s.jsx(c,{name:"fname",control:N,render:({field:{value:e,onChange:a,onBlur:r}})=>s.jsx(n,{label:"First name",disabled:p,type:"text",value:e,onChange:a,onBlur:r,error:S.fname?.message})}),s.jsx(c,{name:"lname",control:N,render:({field:{value:e,onChange:a,onBlur:r}})=>s.jsx(n,{label:"Last name",disabled:p,type:"text",value:e,onChange:a,onBlur:r,error:S.lname?.message})})]}),s.jsx(c,{name:"email",control:N,render:({field:{value:e,onChange:a,onBlur:r}})=>s.jsx(n,{label:"Email",disabled:p,type:"email",value:e,onChange:a,onBlur:r,error:S.email?.message})}),s.jsxs("div",{className:"qc:relative",children:[s.jsx(c,{name:"password",control:N,render:({field:{value:e,onChange:a,onBlur:r}})=>s.jsx(n,{label:"Password",disabled:p,type:q.showPassword?"text":"password",value:e,onChange:a,onBlur:r,error:S.password?.message})}),s.jsx(a,{variant:"ghost",color:"primary",className:"qc:absolute qc:-right-5 qc:top-7",icon:q.showPassword?"mdi:eye-outline":"mdi:eye-off-outline",onClick:()=>v({...q,showPassword:!q.showPassword})})]}),s.jsxs("div",{className:"qc:relative",children:[s.jsx(c,{name:"confirmPassword",control:N,render:({field:{value:e,onChange:a,onBlur:r}})=>s.jsx(n,{label:"Confirm password",disabled:p,type:q.showConfirmPassword?"text":"password",value:e,onChange:a,onBlur:r,error:S.confirmPassword?.message})}),s.jsx(a,{variant:"ghost",color:"primary",className:"qc:absolute qc:-right-5 qc:top-7",icon:q.showConfirmPassword?"mdi:eye-outline":"mdi:eye-off-outline",onClick:()=>v({...q,showConfirmPassword:!q.showConfirmPassword})})]}),u&&s.jsx(r,{weight:"medium",color:"error",align:"center",children:u}),u&&s.jsx(r,{weight:"medium",color:"error",align:"center",children:u}),s.jsx("div",{className:"qc:flex qc:justify-end",children:s.jsx(o,{to:l.FORGOT_PASSWORD,state:location?.state,children:s.jsx(r,{variant:"h6",className:"qc:w-fit",children:"Forgot password?"})})}),s.jsx(a,{type:"submit",color:"primary",className:"qc:w-full",disabled:p,loading:p,children:"Register"})]}),s.jsxs("div",{className:"qc:grid qc:grid-cols-2 qc:gap-2",children:[s.jsx(d,{disabled:p||j.google||j.apple,loading:j.google,onClick:()=>P("google",C),provider:"google"}),s.jsx(d,{disabled:p||j.google||j.apple,loading:j.apple,onClick:()=>P("apple",b),provider:"apple"})]})]})};export{f as default};
1
+ import{u as e,j as s,J as a,T as r,g as o,P as l}from"./DzIjyaQc.js";import{useState as i}from"react";import{I as n}from"./CVCROaIm.js";import{S as d}from"./DR1lh2_F.js";import{u as t,C as c,o as m,c as u,a as g,b as p}from"./-74yB4f5.js";const h={fname:"",lname:"",email:"",password:"",confirmPassword:""},w=u().shape({fname:g().required("First name is required"),lname:g().required("Last name is required"),email:g().required("Please enter your Email").email("Enter a valid Email"),password:g().required("Please enter your password").min(8,"Min password length is 8"),confirmPassword:g().required("Please confirm your password").oneOf([p("password"),null],"Passwords do not match")}),f=()=>{const[u,g]=i(null),[p,f]=i(!1),[j,x]=i({google:!1,apple:!1}),[q,v]=i({showPassword:!1,showConfirmPassword:!1}),{registerUsingEmail:y,loginWithGoogle:C,loginWithApple:b}=e(),P=async(e,s)=>{x(s=>({...s,[e]:!0})),g(null);try{await s()}catch(s){g(s.message||`Failed to sign up with ${e.charAt(0).toUpperCase()+e.slice(1)}`)}finally{x(s=>({...s,[e]:!1}))}},{control:N,handleSubmit:B,formState:{errors:S}}=t({defaultValues:h,mode:"onSubmit",resolver:m(w)});return s.jsxs("div",{className:"qc:w-full qc:space-y-8 qc:bg-background",children:[s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:B(async e=>{const{email:s,password:a,fname:r,lname:o}=e;f(!0);try{const e=await y(s.toLowerCase(),a,r,o);e?.error&&g(e.error)}catch(e){g(e)}finally{f(!1)}}),className:"qc:space-y-4",children:[s.jsxs("div",{className:"qc:grid qc:grid-cols-2 qc:gap-4",children:[s.jsx(c,{name:"fname",control:N,render:({field:{value:e,onChange:a,onBlur:r}})=>s.jsx(n,{label:"First name",disabled:p,type:"text",value:e,onChange:a,onBlur:r,error:S.fname?.message})}),s.jsx(c,{name:"lname",control:N,render:({field:{value:e,onChange:a,onBlur:r}})=>s.jsx(n,{label:"Last name",disabled:p,type:"text",value:e,onChange:a,onBlur:r,error:S.lname?.message})})]}),s.jsx(c,{name:"email",control:N,render:({field:{value:e,onChange:a,onBlur:r}})=>s.jsx(n,{label:"Email",disabled:p,type:"email",value:e,onChange:a,onBlur:r,error:S.email?.message})}),s.jsxs("div",{className:"qc:relative",children:[s.jsx(c,{name:"password",control:N,render:({field:{value:e,onChange:a,onBlur:r}})=>s.jsx(n,{label:"Password",disabled:p,type:q.showPassword?"text":"password",value:e,onChange:a,onBlur:r,error:S.password?.message})}),s.jsx(a,{variant:"ghost",color:"primary",className:"qc:absolute qc:-right-5 qc:top-7",icon:q.showPassword?"mdi:eye-outline":"mdi:eye-off-outline",onClick:()=>v({...q,showPassword:!q.showPassword})})]}),s.jsxs("div",{className:"qc:relative",children:[s.jsx(c,{name:"confirmPassword",control:N,render:({field:{value:e,onChange:a,onBlur:r}})=>s.jsx(n,{label:"Confirm password",disabled:p,type:q.showConfirmPassword?"text":"password",value:e,onChange:a,onBlur:r,error:S.confirmPassword?.message})}),s.jsx(a,{variant:"ghost",color:"primary",className:"qc:absolute qc:-right-5 qc:top-7",icon:q.showConfirmPassword?"mdi:eye-outline":"mdi:eye-off-outline",onClick:()=>v({...q,showConfirmPassword:!q.showConfirmPassword})})]}),u&&s.jsx(r,{weight:"medium",color:"error",align:"center",children:u}),u&&s.jsx(r,{weight:"medium",color:"error",align:"center",children:u}),s.jsx("div",{className:"qc:flex qc:justify-end",children:s.jsx(o,{to:l.FORGOT_PASSWORD,state:location?.state,children:s.jsx(r,{variant:"h6",className:"qc:w-fit",children:"Forgot password?"})})}),s.jsx(a,{type:"submit",color:"primary",className:"qc:w-full",disabled:p,loading:p,children:"Register"})]}),s.jsxs("div",{className:"qc:grid qc:grid-cols-2 qc:gap-2",children:[s.jsx(d,{disabled:p||j.google||j.apple,loading:j.google,onClick:()=>P("google",C),provider:"google"}),s.jsx(d,{disabled:p||j.google||j.apple,loading:j.apple,onClick:()=>P("apple",b),provider:"apple"})]})]})};export{f as default};
@@ -1 +1 @@
1
- import{j as e,c as r,T as t,_ as a,d as c,b as s,u as n,H as i,k as o,i as l,$ as d,S as m,h as q,N as h,P as u,E as g,w as p,J as x,g as f,a0 as v,I as j}from"./BaA7RHRf.js";import{useState as b,useEffect as y,lazy as N,Fragment as w}from"react";import{D as k,a as E,b as I,c as _,d as C}from"./CIlaT7eJ.js";import{L as $}from"./DS2UD7gV.js";import{V as S}from"./DjmC7CGh.js";const T=(e,r)=>`${Number.parseFloat(e?.toFixed(r)??0)}`,A=(e,r)=>{switch(Math.floor(Math.abs(e-r))){case 0:return"qc:bg-green-500";case 1:return"qc:bg-lime-500";case 2:return"qc:bg-yellow-500";case 3:return"qc:bg-orange-500";case 4:return"qc:bg-red-500";default:return"qc:bg-background-500"}},O=(e,r)=>{switch(Math.floor(Math.abs(e-r))){case 0:return"qc:border-t-green-500";case 1:return"qc:border-t-lime-500";case 2:return"qc:border-t-yellow-500";case 3:return"qc:border-t-orange-500";case 4:return"qc:border-t-red-500";default:return"qc:border-t-color-500"}},z=({position:r,maxPosition:t=4,content:a,isOverlapping:c,colorclsx:s,borderColorclsx:n})=>{const i=r/t*100;let o="qc:transform qc:-translate-x-1/2 qc:left-1/2";r<2?o="qc:left-0":r>3&&(o="qc:right-0 qc:transform qc:-translate-x-full");const l=c?"qc:-top-1.5":"qc:bottom-full";return e.jsxs("div",{className:"qc:relative",children:[e.jsx("div",{style:{left:`${i}%`},className:`qc:absolute ${l} qc:text-primary-foreground qc:mb-0.5 qc:w-fit qc:whitespace-nowrap qc:rounded-md qc:px-2 qc:py-1 qc:text-sm qc:md:mb-1 ${o} qc:transition-all qc:duration-500 qc:ease-in-out ${s}`,children:a}),e.jsx("div",{style:{left:`${i}%`},className:`qc:absolute ${l} qc:-mb-1.5 qc:size-0 qc:border-x-4 qc:border-t-[1rem] qc:border-transparent ${o} qc:transition-all qc:duration-500 qc:ease-in-out ${n}`})]})},R=t=>{const{crowdScore:a,userScore:c}=t,[s,n]=b(0);y(()=>{setTimeout(()=>{n(c-1)},300)},[c]);const i=a-1,o=c-1,l=Math.abs(i-o)<1;return e.jsxs("div",{className:r("qc:relative qc:h-4",l?"qc:mb-3":"qc:mb-0"),children:[e.jsx("div",{className:"qc:absolute qc:top-1/2 qc:h-0.5 qc:w-full qc:bg-border-primary-light"}),e.jsx("div",{style:{left:(i<s?i:s)/4*100+"%",right:`calc(100% - ${(i<s?s:i)/4*100}%)`},className:r("qc:absolute qc:top-1/2 qc:h-1 qc:rounded",A(i,o))}),e.jsx(z,{position:i,content:`crowd · ${T(a,1)}`,isOverlapping:!1,colorclsx:"qc:bg-primary",borderColorclsx:"qc:border-t-primary"}),e.jsx(z,{position:s,content:`you · ${T(c,1)}`,isOverlapping:l,colorclsx:A(i,o),borderColorclsx:O(i,o)})]})},P=N(()=>import("./DwbNwe-K.js").then(e=>e.i)),F=N(()=>import("./Dyk2_V8r.js")),M=({feedback:r})=>{const a="#374151",[c,s]=b(10);return y(()=>{const e=(r?.parameters||[]).reduce((e,r)=>e+Math.abs(parseFloat(r.crowdRating)-parseFloat(r.userRating)),0);s(e.toFixed?e.toFixed(2):0)},[r]),r?e.jsxs("div",{className:"qc:w-full",children:[r.rateCount<=0&&e.jsxs("div",{className:"qc:-mt-4 qc:mb-4 qc:flex qc:flex-col qc:items-center",children:[e.jsx(F,{className:"qc:h-auto qc:w-72 qc:sm:h-72 qc:sm:w-auto",src:"https://res.cloudinary.com/dxtjlcra0/raw/upload/v1740374960/star-explode_h2nytb.lottie",autoplay:!0,loop:!0}),e.jsx(t,{variant:"h5",align:"center",children:"Congratulations! You are the first to rate"})]}),r.rateCount>0&&e.jsxs("div",{className:"qc:mt-4",children:[(r.parameters||[]).map(r=>e.jsxs("div",{className:"qc:mt-4 qc:space-y-4",children:[e.jsx(t,{variant:"h5",children:r.name}),e.jsx(R,{crowdScore:parseFloat(r.crowdRating),userScore:parseFloat(r.userRating)})]},r.name)),e.jsxs("div",{className:"qc:mt-4 qc:flex qc:w-full qc:flex-col qc:items-center",children:[e.jsx(P,{nrOfLevels:10,percent:(10-c)/10,colors:["#ef4444","#22c55e"],textColor:a,needleColor:a,needleBaseColor:a}),e.jsx(t,{variant:"h6",children:"Alignment with crowd"})]})]})]}):null},U=N(()=>import("./Dyk2_V8r.js")),B=({parameter:c,selected:s,onChange:n,showValues:i=!0})=>e.jsxs("div",{className:"qc:mb-8 qc:flex qc:w-full qc:flex-col qc:gap-2 qc:lg:mb-12 qc:lg:gap-4",children:[e.jsx(t,{variant:"h4",className:"qc:text-center qc:font-semibold qc:text-primary-light qc:md:text-left",children:c.name}),e.jsx("div",{className:"qc:grid qc:w-full qc:grid-cols-5 qc:gap-1 qc:lg:gap-2",children:(c.tooltips||[]).map(t=>{const o=`${c._id}-option-${t.value}`;return e.jsxs("div",{children:[e.jsxs("button",{type:"button",className:r("qc:border-primary qc:shadow-outer qc:flex qc:size-full qc:min-h-12 qc:items-center qc:justify-center qc:rounded qc:border qc:transition-all qc:duration-100 qc:active:scale-90",s===t.value?"qc:bg-primary":"qc:bg-background"),onClick:()=>{s!==t.value&&n?.(t.value)},children:[c.mode===a.TEXT&&e.jsx("div",{className:r("qc:p-1 qc:text-center qc:text-xs qc:font-semibold qc:md:p-2 qc:md:text-base",s===t.value?"qc:text-primary-foreground":"qc:text-foreground"),children:t.label}),c.mode===a.IMAGE&&e.jsx("img",{className:"qc:h-12 qc:w-auto qc:rounded-md qc:object-contain qc:lg:h-16",src:t.imageUrl,alt:t.value}),c.mode===a.LOTTIE&&e.jsx(U,{className:"qc:h-16 qc:w-auto qc:rounded-md qc:object-contain qc:lg:h-24",src:t.imageUrl,autoplay:!0,loop:!0})]}),i&&e.jsx("div",{className:"qc:mt-1 qc:w-full qc:text-center",children:e.jsx("span",{className:"qc:text-foreground qc:inline-flex qc:items-center qc:px-2 qc:py-[0.0625] qc:text-xs qc:font-medium qc:md:px-3 qc:md:py-0.5",children:t.value})})]},o)})})]});var L,D,G=function(e,r){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var a,c,s=t.call(e),n=[];try{for(;(void 0===r||r-- >0)&&!(a=s.next()).done;)n.push(a.value)}catch(e){c={error:e}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(c)throw c.error}}return n};function V(e,r,t,a,c,s,n,i,o,l,d){var m,q,h,u;if(0!==n)if(n!==t-r+(s-c)){for(var g=t-r,p=s-c,x=Math.floor(p/2),f={},v=-n-1;v<=n+1;++v)f[v]={d:1/0,segments:0,direct:L.none};for(var j=((m={})[-n-1]={d:1/0,segments:0,direct:L.none},m[n+1]={d:1/0,segments:0,direct:L.none},m),b=0;b<=x;++b){q=G([j,f],2),f=q[0],j=q[1];var y=function(t){var s=b+t;if(0===b&&0===s)return f[t]={d:0,segments:0,direct:i},"continue";var n=[{direct:L.horizontal,d:f[t-1].d+1,segments:f[t-1].segments+(f[t-1].direct&L.horizontal?0:1)},{direct:L.vertical,d:j[t+1].d+1,segments:j[t+1].segments+(j[t+1].direct&L.vertical?0:1)}];s>0&&s<=g&&b>0&&b<=p&&l(e[r+s-1],a[c+b-1])&&n.push({direct:L.diagonal,d:j[t].d,segments:j[t].segments+(j[t].direct&L.diagonal?0:1)});var o=n.reduce(function(e,r){return e.d>r.d||e.d===r.d&&e.segments>r.segments?r:e});n.forEach(function(e){o.d===e.d&&o.segments===e.segments&&(o.direct|=e.direct)}),f[t]=o};for(v=-n;v<=n;++v)y(v)}var N={};for(v=-n-1;v<=n+1;++v)N[v]={d:1/0,segments:0,direct:L.none};var w=((h={})[-n-1]={d:1/0,segments:0,direct:L.none},h[n+1]={d:1/0,segments:0,direct:L.none},h);for(b=p;b>=x;--b){u=G([w,N],2),N=u[0],w=u[1];var k=function(t){var s=b+t;if(b===p&&s===g)return N[t]={d:0,segments:0,direct:o},"continue";var n=[{direct:L.horizontal,d:N[t+1].d+1,segments:N[t+1].segments+(N[t+1].direct&L.horizontal?0:1)},{direct:L.vertical,d:w[t-1].d+1,segments:w[t-1].segments+(w[t-1].direct&L.vertical?0:1)}];s>=0&&s<g&&b>=0&&b<p&&l(e[r+s],a[c+b])&&n.push({direct:L.diagonal,d:w[t].d,segments:w[t].segments+(w[t].direct&L.diagonal?0:1)});var i=n.reduce(function(e,r){return e.d>r.d||e.d===r.d&&e.segments>r.segments?r:e});n.forEach(function(e){i.d===e.d&&i.segments===e.segments&&(i.direct|=e.direct)}),N[t]=i};for(v=n;v>=-n;--v)k(v)}var E={k:-1,d:1/0,segments:0,direct:L.none};for(v=-n;v<=n;++v){var I=f[v].d+N[v].d;if(I<E.d)E.k=v,E.d=I,E.segments=f[v].segments+N[v].segments+(f[v].segments&N[v].segments?0:1),E.direct=N[v].direct;else if(I===E.d){var _=f[v].segments+N[v].segments+(f[v].segments&N[v].segments?0:1);(_<E.segments||_===E.segments&&!(E.direct&L.diagonal)&&N[v].direct&L.diagonal)&&(E.k=v,E.d=I,E.segments=_,E.direct=N[v].direct)}}x+E.k===0&&0===x&&(x++,f[E.k].direct=N[E.k].direct,N[E.k].direct=w[E.k].direct),V(e,r,r+x+E.k,a,c,c+x,f[E.k].d,i,N[E.k].direct,l,d),V(e,r+x+E.k,t,a,c+x,s,N[E.k].d,f[E.k].direct,o,l,d)}else(i&L.horizontal?1:0)+(o&L.vertical?1:0)>=(i&L.vertical?1:0)+(o&L.horizontal?1:0)?(r!==t&&d("remove",e,r,t,a,c,c),c!==s&&d("add",e,t,t,a,c,s)):(c!==s&&d("add",e,r,r,a,c,s),r!==t&&d("remove",e,r,t,a,s,s));else d("same",e,r,t,a,c,s)}function W(e,r,t,a){var c=function(e,r,t){for(var a=e.length,c=r.length,s=a+c,n={1:0},i=0;i<=s;++i)for(var o=-i;o<=i;o+=2){for(var l=void 0,d=(l=o===-i||o!==i&&n[o-1]+1<n[o+1]?n[o+1]:n[o-1]+1)-o;l<a&&d<c&&t(e[l],r[d]);)l++,d++;if(l===a&&d===c)return i;n[o]=l}return-1}(e,r,t);V(e,0,e.length,r,0,r.length,c,L.diagonal,L.all,t,a)}(D=L||(L={}))[D.none=0]="none",D[D.horizontal=1]="horizontal",D[D.vertical=2]="vertical",D[D.diagonal=4]="diagonal",D[D.all=7]="all";const Y=()=>{const r=c(),{eventSlug:a,contentId:j}=s(),{props:{organizationId:N,loginUrl:T},user:A,loadingUser:O,organization:z}=n(),[R,P]=b(!1),[F,U]=b(null),[L,D]=b([]),[G,V]=b(null),[Y,J]=b("contain"),[X,K]=b({}),[Q,Z]=b(null),[ee,re]=b(!1),[te,ae]=b(!0),[ce,se]=b(null),{loading:ne,event:ie,parameters:oe}=i({eventSlug:a});y(()=>{ie&&A&&de(ie._id)},[ie,A]);const le=z?.navigationSettings?.showAIDescription,de=async e=>{P(!0);try{const r=await o.get(l.CONTENT_FOR_CURATION,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},searchParams:{eventId:e,page:1,limit:10,includeDescription:le}}).json();if(r.error)throw new Error(r.error);const t=j?r.data.filter(e=>e._id!==j):r.data;let a,c=t;if(j){const e=await o.get(l.ELIGIBLE_TO_CURATE,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},searchParams:{contentId:j,includeDescription:le}}).json();if(e.error)throw new Error(e.error);const r=e.data;c=r?[r,...t]:t||[],a=r&&r.userId===A?._id?"Sorry, you cannot rate your own content":r&&r.ratingStatus===d.CURATED?"Sorry, you have already rated this photo.":null}const s=await o.get(l.GET_EVENT_POINTS,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},searchParams:{eventId:e}}).json();if(s.error)throw new Error(s.error);V(s.data),D(c),U(a)}catch(e){console.error("Failed to fetch contents",e)}P(!1)},me=async e=>{try{const r=await o.get(l.CONTENT_FOR_CURATION,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},searchParams:{eventId:ie?._id,page:1,limit:10,includeDescription:le}});if(r.error)throw new Error(r.error);if(r?.data?.length>0){const t=function(e,r,t){void 0===t&&(t=function(e,r){return e===r});var a={removed:[],added:[]};return W(e,r,t,function(e,r,t,c,s,n,i){if("add"===e)for(var o=n;o<i;++o)a.added.push(s[o]);else if("remove"===e)for(o=t;o<c;++o)a.removed.push(r[o])}),a}(e,r.data,(e,r)=>e._id===r._id),a=[...e,...t.added];D(a)}}catch(e){console.error(e)}},qe=()=>{const e=L.slice(1);U(null),Z(null),K({}),e.length===v?me(e):D(e),ae(!0)};if(O)return e.jsx(m,{className:"qc:mx-auto qc:h-6 qc:w-64"});if(!A){if(!z.customAuth)return e.jsx(h,{to:u.LOGIN,state:{referrer:r.pathname}});if(!T)return e.jsx(q,{title:"Please login to upload content"});window.history.pushState({},"",T)}return e.jsx("div",{className:"qc:min-h-[80vh] qc:bg-background",children:R||ne?e.jsxs("div",{className:"qc:mt-8 qc:grid qc:grid-cols-1 qc:gap-6 qc:md:grid-cols-2",children:[e.jsx(m,{className:"qc:h-64 qc:w-full qc:md:h-[30rem] qc:md:max-h-screen qc:md:rounded"}),e.jsx("div",{className:"qc:space-y-8",children:Array.from({length:2}).map((r,t)=>e.jsxs("div",{className:"qc:space-y-4",children:[e.jsx(m,{className:"qc:h-8 qc:w-36"}),e.jsx("div",{className:"qc:flex qc:w-full qc:gap-4",children:Array.from({length:5}).map((r,t)=>e.jsx(m,{className:"qc:h-24 qc:w-full qc:sm:h-32"},t))})]},t))})]}):e.jsxs("div",{className:"qc:lg:mt-8",children:[ie?.status===g.CLOSED&&e.jsx(t,{variant:"h3",color:"primary",align:"center",children:"Event is now closed. Thank you for participating!"}),ie?.status===g.OPEN&&L.length<=0&&e.jsx(t,{variant:"h3",color:"primary",align:"center",children:"No content to rate. Please find another event to rate contents."}),ie?.status===g.OPEN&&L.length>0&&e.jsxs("div",{children:[!(oe?.length<=0&&le)&&e.jsxs("div",{className:"qc:flex qc:w-full qc:items-center qc:justify-between",children:[e.jsxs(t,{variant:"h4",children:["Rate this ",L[0].type===p.IMAGE?"image":"video"]}),e.jsxs(t,{variant:"h4",children:[ie?.pointName,":"," ",e.jsx("span",{className:"qc:text-primary",children:G.upload+G.curate})]})]}),e.jsxs("div",{className:"qc:grid qc:grid-cols-1 qc:gap-6 qc:md:grid-cols-2",children:[e.jsxs("div",{className:"qc:relative qc:mt-4 qc:w-full",children:[L[0].type===p.IMAGE&&e.jsx(w,{children:e.jsx($,{sizeMode:Y,src:L[0].url,alt:L[0].caption,blurhash:L[0].blurhash,wrapperClassName:"qc:w-full qc:h-60 qc:md:h-[30rem] qc:md:max-h-screen qc:md:rounded"})}),L[0].type===p.VIDEO&&e.jsx("div",{className:"qc:mx-auto qc:h-80 qc:w-fit qc:overflow-hidden qc:rounded qc:sm:h-[30rem]",children:e.jsx(S,{fit:Y,src:L[0].url,loop:!0,playing:te,volume:0,muted:!0,onPlay:()=>ae(!0),onPause:()=>ae(!1),onEnd:()=>ae(!1)})}),L[0].caption&&L[0].caption.length>0&&e.jsx("div",{className:"qc:bg-background qc:absolute qc:bottom-0 qc:w-full qc:bg-opacity-75 qc:p-2",children:e.jsx(t,{variant:"body3",lines:"2",children:L[0].caption})}),L.length>1&&e.jsx("img",{style:{display:"none"},src:L[1].url,alt:"Next image"})]}),e.jsxs("div",{className:"qc:px-2 qc:md:px-4",children:[!F&&oe&&oe.map(r=>e.jsx(B,{parameter:r,selected:X[r._id],onChange:e=>K({...X,[r._id]:e})},r._id)),ce&&oe?.length>0&&e.jsx(t,{variant:"h5",color:"error",children:ce}),F&&oe?.length>0&&e.jsx("div",{className:"qc:sm:pt-16",children:e.jsx(t,{variant:"h5",color:"error",align:"center",children:F})}),oe?.length>0&&e.jsx(x,{type:"button",color:"primary",className:"qc:mt-4 qc:w-full",disabled:ee,loading:ee,icon:"material-symbols:check-rounded",onClick:F?qe:async()=>{if(oe.length<1)return void se("no parameters found");if(Object.keys(X).length<oe.length)return void se("please select your ratings");se(null),re(!0);const e=await o.post(l.CURATE_CONTENT,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},json:{eventId:ie._id,contentId:L[0]._id,parameterCount:oe.length,userRatings:oe.map(e=>({parameterId:e._id,weight:e.weight,rate:X[e._id]})),inappropriate:""}}).json();if(e.error)se(e.error);else{const r=e.data,t=r.crowdRatings||{},a={parameters:oe.map(e=>({name:e.name,crowdRating:t[e._id],userRating:r.ratings?.find(r=>r.parameterId===e._id)?.rate})),similarity:r.similarity||null,points:r.points||0,rateCount:r.rateCount||0};Z(a);const c={...G};c.curate+=ie.activityScores.curate,V(c)}re(!1)},children:F?"Rate Next Image":ee?"Rating...":"Submit"}),L?.length>0&&le&&e.jsx(H,{summary:L[0].contentSummary,url:L[0].url})]})]}),e.jsx("div",{className:"qc:mt-16",children:e.jsx(f,{to:u.GALLERY(a),state:{internalNavigation:!0},children:e.jsx(t,{color:"primary",variant:"h5",align:"center",children:"Goto gallery"})})})]}),e.jsx(k,{open:!!Q,onOpenChange:e=>!e&&qe(),children:e.jsxs(E,{children:[e.jsxs(I,{children:[e.jsxs(_,{className:"qc:hidden",children:[ie?.pointName,": ",G?.upload+G?.curate]}),e.jsx(C,{className:"qc:hidden",children:"We are here to help you"})]}),e.jsxs("div",{className:"qc:w-full qc:space-y-3 qc:px-3 qc:pb-6 qc:lg:px-6",children:[e.jsx(M,{feedback:Q}),e.jsx(x,{fullWidth:!0,color:"primary",onClick:qe,children:"Next"})]})]})})]})})},H=({summary:r,url:a})=>e.jsxs("div",{className:"qc:w-full",children:[r?.subject&&e.jsx(t,{variant:"h3",className:"qc:mb-4",align:"center",children:r?.subject}),r?.labels&&e.jsx("div",{className:"qc:space-y-2",children:Object.entries(r?.labels).filter(([e,r])=>Array.isArray(r)&&r.length>0).map(([r,a])=>e.jsxs("div",{className:"",children:[e.jsx(t,{variant:"h4",className:"qc:mb-2 qc:font-semibold qc:capitalize",children:r.replace("_"," ")}),e.jsx("ul",{className:"qc:space-y-1 qc:pl-2",children:a.map((r,a)=>e.jsxs("li",{className:"qc:flex qc:items-center qc:gap-2",children:[e.jsx(j,{name:"material-symbols:check-circle-outline",className:"qc:text-primary"}),e.jsx(t,{variant:"body1",children:r}),e.jsx("a",{href:`https://www.google.com/search?q=${encodeURIComponent(r)}`,target:"_blank",rel:"noopener noreferrer",className:"qc:ml-2",children:e.jsx(x,{variant:"outlined",icon:"flat-color-icons:google",children:e.jsx(j,{name:"material-symbols:open-in-new-rounded",size:"sm"})})})]},a))})]},r))}),r?.description&&e.jsxs(w,{children:[e.jsx("hr",{className:"qc:my-4 qc:lg:my-8"}),e.jsx(t,{variant:"body2",children:r?.description})]}),e.jsx("div",{className:"qc:mt-4 qc:flex qc:justify-center qc:lg:mt-8",children:e.jsx("a",{target:"_blank",href:`https://www.bing.com/images/search?view=detailv2&iss=SBI&form=SBIIRP&sbisrc=UrlPaste&q=imgurl:${a}&idpbck=1&selectedindex=0&id=${a}&mediaurl=${a}&exph=480&expw=640&vt=3&sim=11&cal=0&cab=1&cat=0&car=1`,rel:"noopener noreferrer",children:e.jsx(x,{icon:"logos:bing",variant:"outlined",color:"info",children:"Search on Bing"})})}),r&&e.jsx(t,{variant:"caption",align:"center",color:"secondary",className:"qc:mt-4 qc:lg:mt-8",children:"These are AI generated summaries based on the content. Please verify the information before using it."})]});export{Y as default};
1
+ import{j as e,c as r,T as t,_ as a,d as c,b as s,u as n,H as i,k as o,i as l,$ as d,S as m,h as q,N as h,P as u,E as g,w as p,J as x,g as f,a0 as v,I as j}from"./DzIjyaQc.js";import{useState as b,useEffect as y,lazy as N,Fragment as w}from"react";import{D as k,a as E,b as I,c as _,d as C}from"./Dv6l17gK.js";import{L as $}from"./BsbGC0mb.js";import{V as S}from"./Dso7YRKD.js";const T=(e,r)=>`${Number.parseFloat(e?.toFixed(r)??0)}`,A=(e,r)=>{switch(Math.floor(Math.abs(e-r))){case 0:return"qc:bg-green-500";case 1:return"qc:bg-lime-500";case 2:return"qc:bg-yellow-500";case 3:return"qc:bg-orange-500";case 4:return"qc:bg-red-500";default:return"qc:bg-background-500"}},O=(e,r)=>{switch(Math.floor(Math.abs(e-r))){case 0:return"qc:border-t-green-500";case 1:return"qc:border-t-lime-500";case 2:return"qc:border-t-yellow-500";case 3:return"qc:border-t-orange-500";case 4:return"qc:border-t-red-500";default:return"qc:border-t-color-500"}},z=({position:r,maxPosition:t=4,content:a,isOverlapping:c,colorclsx:s,borderColorclsx:n})=>{const i=r/t*100;let o="qc:transform qc:-translate-x-1/2 qc:left-1/2";r<2?o="qc:left-0":r>3&&(o="qc:right-0 qc:transform qc:-translate-x-full");const l=c?"qc:-top-1.5":"qc:bottom-full";return e.jsxs("div",{className:"qc:relative",children:[e.jsx("div",{style:{left:`${i}%`},className:`qc:absolute ${l} qc:text-primary-foreground qc:mb-0.5 qc:w-fit qc:whitespace-nowrap qc:rounded-md qc:px-2 qc:py-1 qc:text-sm qc:md:mb-1 ${o} qc:transition-all qc:duration-500 qc:ease-in-out ${s}`,children:a}),e.jsx("div",{style:{left:`${i}%`},className:`qc:absolute ${l} qc:-mb-1.5 qc:size-0 qc:border-x-4 qc:border-t-[1rem] qc:border-transparent ${o} qc:transition-all qc:duration-500 qc:ease-in-out ${n}`})]})},R=t=>{const{crowdScore:a,userScore:c}=t,[s,n]=b(0);y(()=>{setTimeout(()=>{n(c-1)},300)},[c]);const i=a-1,o=c-1,l=Math.abs(i-o)<1;return e.jsxs("div",{className:r("qc:relative qc:h-4",l?"qc:mb-3":"qc:mb-0"),children:[e.jsx("div",{className:"qc:absolute qc:top-1/2 qc:h-0.5 qc:w-full qc:bg-border-primary-light"}),e.jsx("div",{style:{left:(i<s?i:s)/4*100+"%",right:`calc(100% - ${(i<s?s:i)/4*100}%)`},className:r("qc:absolute qc:top-1/2 qc:h-1 qc:rounded",A(i,o))}),e.jsx(z,{position:i,content:`crowd · ${T(a,1)}`,isOverlapping:!1,colorclsx:"qc:bg-primary",borderColorclsx:"qc:border-t-primary"}),e.jsx(z,{position:s,content:`you · ${T(c,1)}`,isOverlapping:l,colorclsx:A(i,o),borderColorclsx:O(i,o)})]})},P=N(()=>import("./DwbNwe-K.js").then(e=>e.i)),F=N(()=>import("./BvPG5WOQ.js")),M=({feedback:r})=>{const a="#374151",[c,s]=b(10);return y(()=>{const e=(r?.parameters||[]).reduce((e,r)=>e+Math.abs(parseFloat(r.crowdRating)-parseFloat(r.userRating)),0);s(e.toFixed?e.toFixed(2):0)},[r]),r?e.jsxs("div",{className:"qc:w-full",children:[r.rateCount<=0&&e.jsxs("div",{className:"qc:-mt-4 qc:mb-4 qc:flex qc:flex-col qc:items-center",children:[e.jsx(F,{className:"qc:h-auto qc:w-72 qc:sm:h-72 qc:sm:w-auto",src:"https://res.cloudinary.com/dxtjlcra0/raw/upload/v1740374960/star-explode_h2nytb.lottie",autoplay:!0,loop:!0}),e.jsx(t,{variant:"h5",align:"center",children:"Congratulations! You are the first to rate"})]}),r.rateCount>0&&e.jsxs("div",{className:"qc:mt-4",children:[(r.parameters||[]).map(r=>e.jsxs("div",{className:"qc:mt-4 qc:space-y-4",children:[e.jsx(t,{variant:"h5",children:r.name}),e.jsx(R,{crowdScore:parseFloat(r.crowdRating),userScore:parseFloat(r.userRating)})]},r.name)),e.jsxs("div",{className:"qc:mt-4 qc:flex qc:w-full qc:flex-col qc:items-center",children:[e.jsx(P,{nrOfLevels:10,percent:(10-c)/10,colors:["#ef4444","#22c55e"],textColor:a,needleColor:a,needleBaseColor:a}),e.jsx(t,{variant:"h6",children:"Alignment with crowd"})]})]})]}):null},U=N(()=>import("./BvPG5WOQ.js")),B=({parameter:c,selected:s,onChange:n,showValues:i=!0})=>e.jsxs("div",{className:"qc:mb-8 qc:flex qc:w-full qc:flex-col qc:gap-2 qc:lg:mb-12 qc:lg:gap-4",children:[e.jsx(t,{variant:"h4",className:"qc:text-center qc:font-semibold qc:text-primary-light qc:md:text-left",children:c.name}),e.jsx("div",{className:"qc:grid qc:w-full qc:grid-cols-5 qc:gap-1 qc:lg:gap-2",children:(c.tooltips||[]).map(t=>{const o=`${c._id}-option-${t.value}`;return e.jsxs("div",{children:[e.jsxs("button",{type:"button",className:r("qc:border-primary qc:shadow-outer qc:flex qc:size-full qc:min-h-12 qc:items-center qc:justify-center qc:rounded qc:border qc:transition-all qc:duration-100 qc:active:scale-90",s===t.value?"qc:bg-primary":"qc:bg-background"),onClick:()=>{s!==t.value&&n?.(t.value)},children:[c.mode===a.TEXT&&e.jsx("div",{className:r("qc:p-1 qc:text-center qc:text-xs qc:font-semibold qc:md:p-2 qc:md:text-base",s===t.value?"qc:text-primary-foreground":"qc:text-foreground"),children:t.label}),c.mode===a.IMAGE&&e.jsx("img",{className:"qc:h-12 qc:w-auto qc:rounded-md qc:object-contain qc:lg:h-16",src:t.imageUrl,alt:t.value}),c.mode===a.LOTTIE&&e.jsx(U,{className:"qc:h-16 qc:w-auto qc:rounded-md qc:object-contain qc:lg:h-24",src:t.imageUrl,autoplay:!0,loop:!0})]}),i&&e.jsx("div",{className:"qc:mt-1 qc:w-full qc:text-center",children:e.jsx("span",{className:"qc:text-foreground qc:inline-flex qc:items-center qc:px-2 qc:py-[0.0625] qc:text-xs qc:font-medium qc:md:px-3 qc:md:py-0.5",children:t.value})})]},o)})})]});var L,D,G=function(e,r){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var a,c,s=t.call(e),n=[];try{for(;(void 0===r||r-- >0)&&!(a=s.next()).done;)n.push(a.value)}catch(e){c={error:e}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(c)throw c.error}}return n};function V(e,r,t,a,c,s,n,i,o,l,d){var m,q,h,u;if(0!==n)if(n!==t-r+(s-c)){for(var g=t-r,p=s-c,x=Math.floor(p/2),f={},v=-n-1;v<=n+1;++v)f[v]={d:1/0,segments:0,direct:L.none};for(var j=((m={})[-n-1]={d:1/0,segments:0,direct:L.none},m[n+1]={d:1/0,segments:0,direct:L.none},m),b=0;b<=x;++b){q=G([j,f],2),f=q[0],j=q[1];var y=function(t){var s=b+t;if(0===b&&0===s)return f[t]={d:0,segments:0,direct:i},"continue";var n=[{direct:L.horizontal,d:f[t-1].d+1,segments:f[t-1].segments+(f[t-1].direct&L.horizontal?0:1)},{direct:L.vertical,d:j[t+1].d+1,segments:j[t+1].segments+(j[t+1].direct&L.vertical?0:1)}];s>0&&s<=g&&b>0&&b<=p&&l(e[r+s-1],a[c+b-1])&&n.push({direct:L.diagonal,d:j[t].d,segments:j[t].segments+(j[t].direct&L.diagonal?0:1)});var o=n.reduce(function(e,r){return e.d>r.d||e.d===r.d&&e.segments>r.segments?r:e});n.forEach(function(e){o.d===e.d&&o.segments===e.segments&&(o.direct|=e.direct)}),f[t]=o};for(v=-n;v<=n;++v)y(v)}var N={};for(v=-n-1;v<=n+1;++v)N[v]={d:1/0,segments:0,direct:L.none};var w=((h={})[-n-1]={d:1/0,segments:0,direct:L.none},h[n+1]={d:1/0,segments:0,direct:L.none},h);for(b=p;b>=x;--b){u=G([w,N],2),N=u[0],w=u[1];var k=function(t){var s=b+t;if(b===p&&s===g)return N[t]={d:0,segments:0,direct:o},"continue";var n=[{direct:L.horizontal,d:N[t+1].d+1,segments:N[t+1].segments+(N[t+1].direct&L.horizontal?0:1)},{direct:L.vertical,d:w[t-1].d+1,segments:w[t-1].segments+(w[t-1].direct&L.vertical?0:1)}];s>=0&&s<g&&b>=0&&b<p&&l(e[r+s],a[c+b])&&n.push({direct:L.diagonal,d:w[t].d,segments:w[t].segments+(w[t].direct&L.diagonal?0:1)});var i=n.reduce(function(e,r){return e.d>r.d||e.d===r.d&&e.segments>r.segments?r:e});n.forEach(function(e){i.d===e.d&&i.segments===e.segments&&(i.direct|=e.direct)}),N[t]=i};for(v=n;v>=-n;--v)k(v)}var E={k:-1,d:1/0,segments:0,direct:L.none};for(v=-n;v<=n;++v){var I=f[v].d+N[v].d;if(I<E.d)E.k=v,E.d=I,E.segments=f[v].segments+N[v].segments+(f[v].segments&N[v].segments?0:1),E.direct=N[v].direct;else if(I===E.d){var _=f[v].segments+N[v].segments+(f[v].segments&N[v].segments?0:1);(_<E.segments||_===E.segments&&!(E.direct&L.diagonal)&&N[v].direct&L.diagonal)&&(E.k=v,E.d=I,E.segments=_,E.direct=N[v].direct)}}x+E.k===0&&0===x&&(x++,f[E.k].direct=N[E.k].direct,N[E.k].direct=w[E.k].direct),V(e,r,r+x+E.k,a,c,c+x,f[E.k].d,i,N[E.k].direct,l,d),V(e,r+x+E.k,t,a,c+x,s,N[E.k].d,f[E.k].direct,o,l,d)}else(i&L.horizontal?1:0)+(o&L.vertical?1:0)>=(i&L.vertical?1:0)+(o&L.horizontal?1:0)?(r!==t&&d("remove",e,r,t,a,c,c),c!==s&&d("add",e,t,t,a,c,s)):(c!==s&&d("add",e,r,r,a,c,s),r!==t&&d("remove",e,r,t,a,s,s));else d("same",e,r,t,a,c,s)}function W(e,r,t,a){var c=function(e,r,t){for(var a=e.length,c=r.length,s=a+c,n={1:0},i=0;i<=s;++i)for(var o=-i;o<=i;o+=2){for(var l=void 0,d=(l=o===-i||o!==i&&n[o-1]+1<n[o+1]?n[o+1]:n[o-1]+1)-o;l<a&&d<c&&t(e[l],r[d]);)l++,d++;if(l===a&&d===c)return i;n[o]=l}return-1}(e,r,t);V(e,0,e.length,r,0,r.length,c,L.diagonal,L.all,t,a)}(D=L||(L={}))[D.none=0]="none",D[D.horizontal=1]="horizontal",D[D.vertical=2]="vertical",D[D.diagonal=4]="diagonal",D[D.all=7]="all";const Y=()=>{const r=c(),{eventSlug:a,contentId:j}=s(),{props:{organizationId:N,loginUrl:T},user:A,loadingUser:O,organization:z}=n(),[R,P]=b(!1),[F,U]=b(null),[L,D]=b([]),[G,V]=b(null),[Y,J]=b("contain"),[X,K]=b({}),[Q,Z]=b(null),[ee,re]=b(!1),[te,ae]=b(!0),[ce,se]=b(null),{loading:ne,event:ie,parameters:oe}=i({eventSlug:a});y(()=>{ie&&A&&de(ie._id)},[ie,A]);const le=z?.navigationSettings?.showAIDescription,de=async e=>{P(!0);try{const r=await o.get(l.CONTENT_FOR_CURATION,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},searchParams:{eventId:e,page:1,limit:10,includeDescription:le}}).json();if(r.error)throw new Error(r.error);const t=j?r.data.filter(e=>e._id!==j):r.data;let a,c=t;if(j){const e=await o.get(l.ELIGIBLE_TO_CURATE,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},searchParams:{contentId:j,includeDescription:le}}).json();if(e.error)throw new Error(e.error);const r=e.data;c=r?[r,...t]:t||[],a=r&&r.userId===A?._id?"Sorry, you cannot rate your own content":r&&r.ratingStatus===d.CURATED?"Sorry, you have already rated this photo.":null}const s=await o.get(l.GET_EVENT_POINTS,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},searchParams:{eventId:e}}).json();if(s.error)throw new Error(s.error);V(s.data),D(c),U(a)}catch(e){console.error("Failed to fetch contents",e)}P(!1)},me=async e=>{try{const r=await o.get(l.CONTENT_FOR_CURATION,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},searchParams:{eventId:ie?._id,page:1,limit:10,includeDescription:le}});if(r.error)throw new Error(r.error);if(r?.data?.length>0){const t=function(e,r,t){void 0===t&&(t=function(e,r){return e===r});var a={removed:[],added:[]};return W(e,r,t,function(e,r,t,c,s,n,i){if("add"===e)for(var o=n;o<i;++o)a.added.push(s[o]);else if("remove"===e)for(o=t;o<c;++o)a.removed.push(r[o])}),a}(e,r.data,(e,r)=>e._id===r._id),a=[...e,...t.added];D(a)}}catch(e){console.error(e)}},qe=()=>{const e=L.slice(1);U(null),Z(null),K({}),e.length===v?me(e):D(e),ae(!0)};if(O)return e.jsx(m,{className:"qc:mx-auto qc:h-6 qc:w-64"});if(!A){if(!z.customAuth)return e.jsx(h,{to:u.LOGIN,state:{referrer:r.pathname}});if(!T)return e.jsx(q,{title:"Please login to upload content"});window.history.pushState({},"",T)}return e.jsx("div",{className:"qc:min-h-[80vh] qc:bg-background",children:R||ne?e.jsxs("div",{className:"qc:mt-8 qc:grid qc:grid-cols-1 qc:gap-6 qc:md:grid-cols-2",children:[e.jsx(m,{className:"qc:h-64 qc:w-full qc:md:h-[30rem] qc:md:max-h-screen qc:md:rounded"}),e.jsx("div",{className:"qc:space-y-8",children:Array.from({length:2}).map((r,t)=>e.jsxs("div",{className:"qc:space-y-4",children:[e.jsx(m,{className:"qc:h-8 qc:w-36"}),e.jsx("div",{className:"qc:flex qc:w-full qc:gap-4",children:Array.from({length:5}).map((r,t)=>e.jsx(m,{className:"qc:h-24 qc:w-full qc:sm:h-32"},t))})]},t))})]}):e.jsxs("div",{className:"qc:lg:mt-8",children:[ie?.status===g.CLOSED&&e.jsx(t,{variant:"h3",color:"primary",align:"center",children:"Event is now closed. Thank you for participating!"}),ie?.status===g.OPEN&&L.length<=0&&e.jsx(t,{variant:"h3",color:"primary",align:"center",children:"No content to rate. Please find another event to rate contents."}),ie?.status===g.OPEN&&L.length>0&&e.jsxs("div",{children:[!(oe?.length<=0&&le)&&e.jsxs("div",{className:"qc:flex qc:w-full qc:items-center qc:justify-between",children:[e.jsxs(t,{variant:"h4",children:["Rate this ",L[0].type===p.IMAGE?"image":"video"]}),e.jsxs(t,{variant:"h4",children:[ie?.pointName,":"," ",e.jsx("span",{className:"qc:text-primary",children:G.upload+G.curate})]})]}),e.jsxs("div",{className:"qc:grid qc:grid-cols-1 qc:gap-6 qc:md:grid-cols-2",children:[e.jsxs("div",{className:"qc:relative qc:mt-4 qc:w-full",children:[L[0].type===p.IMAGE&&e.jsx(w,{children:e.jsx($,{sizeMode:Y,src:L[0].url,alt:L[0].caption,blurhash:L[0].blurhash,wrapperClassName:"qc:w-full qc:h-60 qc:md:h-[30rem] qc:md:max-h-screen qc:md:rounded"})}),L[0].type===p.VIDEO&&e.jsx("div",{className:"qc:mx-auto qc:h-80 qc:w-fit qc:overflow-hidden qc:rounded qc:sm:h-[30rem]",children:e.jsx(S,{fit:Y,src:L[0].url,loop:!0,playing:te,volume:0,muted:!0,onPlay:()=>ae(!0),onPause:()=>ae(!1),onEnd:()=>ae(!1)})}),L[0].caption&&L[0].caption.length>0&&e.jsx("div",{className:"qc:bg-background qc:absolute qc:bottom-0 qc:w-full qc:bg-opacity-75 qc:p-2",children:e.jsx(t,{variant:"body3",lines:"2",children:L[0].caption})}),L.length>1&&e.jsx("img",{style:{display:"none"},src:L[1].url,alt:"Next image"})]}),e.jsxs("div",{className:"qc:px-2 qc:md:px-4",children:[!F&&oe&&oe.map(r=>e.jsx(B,{parameter:r,selected:X[r._id],onChange:e=>K({...X,[r._id]:e})},r._id)),ce&&oe?.length>0&&e.jsx(t,{variant:"h5",color:"error",children:ce}),F&&oe?.length>0&&e.jsx("div",{className:"qc:sm:pt-16",children:e.jsx(t,{variant:"h5",color:"error",align:"center",children:F})}),oe?.length>0&&e.jsx(x,{type:"button",color:"primary",className:"qc:mt-4 qc:w-full",disabled:ee,loading:ee,icon:"material-symbols:check-rounded",onClick:F?qe:async()=>{if(oe.length<1)return void se("no parameters found");if(Object.keys(X).length<oe.length)return void se("please select your ratings");se(null),re(!0);const e=await o.post(l.CURATE_CONTENT,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},json:{eventId:ie._id,contentId:L[0]._id,parameterCount:oe.length,userRatings:oe.map(e=>({parameterId:e._id,weight:e.weight,rate:X[e._id]})),inappropriate:""}}).json();if(e.error)se(e.error);else{const r=e.data,t=r.crowdRatings||{},a={parameters:oe.map(e=>({name:e.name,crowdRating:t[e._id],userRating:r.ratings?.find(r=>r.parameterId===e._id)?.rate})),similarity:r.similarity||null,points:r.points||0,rateCount:r.rateCount||0};Z(a);const c={...G};c.curate+=ie.activityScores.curate,V(c)}re(!1)},children:F?"Rate Next Image":ee?"Rating...":"Submit"}),L?.length>0&&le&&e.jsx(H,{summary:L[0].contentSummary,url:L[0].url})]})]}),e.jsx("div",{className:"qc:mt-16",children:e.jsx(f,{to:u.GALLERY(a),state:{internalNavigation:!0},children:e.jsx(t,{color:"primary",variant:"h5",align:"center",children:"Goto gallery"})})})]}),e.jsx(k,{open:!!Q,onOpenChange:e=>!e&&qe(),children:e.jsxs(E,{children:[e.jsxs(I,{children:[e.jsxs(_,{className:"qc:hidden",children:[ie?.pointName,": ",G?.upload+G?.curate]}),e.jsx(C,{className:"qc:hidden",children:"We are here to help you"})]}),e.jsxs("div",{className:"qc:w-full qc:space-y-3 qc:px-3 qc:pb-6 qc:lg:px-6",children:[e.jsx(M,{feedback:Q}),e.jsx(x,{fullWidth:!0,color:"primary",onClick:qe,children:"Next"})]})]})})]})})},H=({summary:r,url:a})=>e.jsxs("div",{className:"qc:w-full",children:[r?.subject&&e.jsx(t,{variant:"h3",className:"qc:mb-4",align:"center",children:r?.subject}),r?.labels&&e.jsx("div",{className:"qc:space-y-2",children:Object.entries(r?.labels).filter(([e,r])=>Array.isArray(r)&&r.length>0).map(([r,a])=>e.jsxs("div",{className:"",children:[e.jsx(t,{variant:"h4",className:"qc:mb-2 qc:font-semibold qc:capitalize",children:r.replace("_"," ")}),e.jsx("ul",{className:"qc:space-y-1 qc:pl-2",children:a.map((r,a)=>e.jsxs("li",{className:"qc:flex qc:items-center qc:gap-2",children:[e.jsx(j,{name:"material-symbols:check-circle-outline",className:"qc:text-primary"}),e.jsx(t,{variant:"body1",children:r}),e.jsx("a",{href:`https://www.google.com/search?q=${encodeURIComponent(r)}`,target:"_blank",rel:"noopener noreferrer",className:"qc:ml-2",children:e.jsx(x,{variant:"outlined",icon:"flat-color-icons:google",children:e.jsx(j,{name:"material-symbols:open-in-new-rounded",size:"sm"})})})]},a))})]},r))}),r?.description&&e.jsxs(w,{children:[e.jsx("hr",{className:"qc:my-4 qc:lg:my-8"}),e.jsx(t,{variant:"body2",children:r?.description})]}),e.jsx("div",{className:"qc:mt-4 qc:flex qc:justify-center qc:lg:mt-8",children:e.jsx("a",{target:"_blank",href:`https://www.bing.com/images/search?view=detailv2&iss=SBI&form=SBIIRP&sbisrc=UrlPaste&q=imgurl:${a}&idpbck=1&selectedindex=0&id=${a}&mediaurl=${a}&exph=480&expw=640&vt=3&sim=11&cal=0&cab=1&cat=0&car=1`,rel:"noopener noreferrer",children:e.jsx(x,{icon:"logos:bing",variant:"outlined",color:"info",children:"Search on Bing"})})}),r&&e.jsx(t,{variant:"caption",align:"center",color:"secondary",className:"qc:mt-4 qc:lg:mt-8",children:"These are AI generated summaries based on the content. Please verify the information before using it."})]});export{Y as default};