@qratilabs/qrati-connect 2.31.1 → 2.31.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/element/{ydzHqf5r.js → 5r_0x4aK.js} +1 -1
  2. package/element/{e2mrPlw-.js → ASQv5Ahv.js} +1 -1
  3. package/element/{CS8uERGc.js → BCmdnJKF.js} +1 -1
  4. package/element/{BqPiuAuP.js → BOs_rBYA.js} +1 -1
  5. package/element/{QxKjlE-j.js → BWKUiudT.js} +1 -1
  6. package/element/{DKxH7j1t2.js → BWjYmdOz2.js} +1 -1
  7. package/element/{BALdepDv.js → BXUp7Zp4.js} +1 -1
  8. package/element/{CQMPBmQq2.js → B_SYJsyF2.js} +1 -1
  9. package/element/{Ba8sCyeC2.js → BaYMN8qa2.js} +1 -1
  10. package/element/{Clga4U4Y.js → Bc-phiG6.js} +1 -1
  11. package/element/{BgZyx8Pz.js → BpAijsfn.js} +1 -1
  12. package/element/{CXRH3zmy.js → Bq48A0Iv.js} +1 -1
  13. package/element/{cBUXG_uS.js → BszsxRY6.js} +1 -1
  14. package/element/{BxQf2Aj9.js → Bvc6t1Gu.js} +1 -1
  15. package/element/{7fZbqbYO2.js → CFRIlHtK2.js} +1 -1
  16. package/element/{BrDFXZq12.js → CHYm7f-K2.js} +1 -1
  17. package/element/{DqAzUQcH.js → CJ_l5BYI.js} +1 -1
  18. package/element/{p4NDlPrf.js → CNyy8GGA.js} +1 -1
  19. package/element/{BVxovwox.js → CQJ3AK1w.js} +1 -1
  20. package/element/{CfszNu_Q.js → CV7KmbT-.js} +1 -1
  21. package/element/{Ci9PI8hK2.js → CYGIt75r2.js} +2 -2
  22. package/element/{BGo2VsHN2.js → Cj_TL6Ks2.js} +6 -6
  23. package/element/{8QLGsYN7.js → CkBayeWW.js} +1 -1
  24. package/element/{Be3fjihP2.js → D1eaRhKY2.js} +1 -1
  25. package/element/{BwHTzCpH.js → D54cshAo.js} +1 -1
  26. package/element/{BuhJHzFX.js → D5Ja4Yts.js} +1 -1
  27. package/element/{BUd_JUBh.js → DJMlQk40.js} +1 -1
  28. package/element/{Cyknlxbq.js → DTPNRhMK.js} +1 -1
  29. package/element/{CcyeEIVb2.js → DWwbkxCM2.js} +1 -1
  30. package/element/{DIWjXG_0.js → Do4y0nPe.js} +1 -1
  31. package/element/{CdivXyOP.js → Dpwx5KMy.js} +5 -5
  32. package/element/{DLHvSz1a2.js → Te9ieH1R2.js} +1 -1
  33. package/element/{BF7pLcqs.js → V_pvG6Pc.js} +3 -3
  34. package/element/{BK_hWmGs.js → Z3MoLpu5.js} +1 -1
  35. package/element/{IK19gQaC.js → a_rT1I0D.js} +1 -1
  36. package/element/{Cnr4EYcL.js → erXAfWWY.js} +1 -1
  37. package/element/{9E5bMl4h.js → rlutojb0.js} +1 -1
  38. package/element/{B7bKBLKV2.js → tbcqJrU_2.js} +1 -1
  39. package/element/web.es.js +3 -3
  40. package/element/{Cz6OP78x2.js → xPoQq2aN2.js} +1 -1
  41. package/package.json +1 -1
@@ -1 +1 @@
1
- import{C as t,D as e,E as s,M as i,N as r,O as u,S as n,T as a,b as o,j as h,m as c,w as l,x as f,y}from"./CdivXyOP.js";import{t as d}from"./DIWjXG_0.js";var m=class extends r{constructor(t={}){super(),this.config=t,this.#t=/* @__PURE__ */new Set,this.#e=/* @__PURE__ */new Map,this.#s=0}#t;#e;#s;build(t,e,s){const i=new d({client:t,mutationCache:this,mutationId:++this.#s,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#t.add(t);const e=p(t);if("string"==typeof e){const s=this.#e.get(e);s?s.push(t):this.#e.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#t.delete(t)){const e=p(t);if("string"==typeof e){const s=this.#e.get(e);if(s)if(s.length>1){const e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&this.#e.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=p(t);if("string"==typeof e){const s=this.#e.get(e)?.find(t=>"pending"===t.state.status);return!s||s===t}return!0}runNext(t){const e=p(t);return"string"==typeof e?(this.#e.get(e)?.find(e=>e!==t&&e.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){o.batch(()=>{this.#t.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(t){const e={exact:!0,...t};return this.getAll().find(t=>l(e,t))}findAll(t={}){return this.getAll().filter(e=>l(t,e))}notify(t){o.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(t=>t.state.isPaused);return o.batch(()=>Promise.all(t.map(t=>t.continue().catch(s))))}};function p(t){return t.options.scope?.id}var q=class extends r{constructor(t={}){super(),this.config=t,this.#i=/* @__PURE__ */new Map}#i;build(e,s,i){const r=s.queryKey,u=s.queryHash??t(r,s);let n=this.get(u);return n||(n=new c({client:e,queryKey:r,queryHash:u,options:e.defaultQueryOptions(s),state:i,defaultOptions:e.getQueryDefaults(r)}),this.add(n)),n}add(t){this.#i.has(t.queryHash)||(this.#i.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#i.get(t.queryHash);e&&(t.destroy(),e===t&&this.#i.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){o.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#i.get(t)}getAll(){return[...this.#i.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(t=>a(e,t))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(e=>a(t,e)):e}notify(t){o.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){o.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){o.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},g=class{#r;#u;#n;#a;#o;#h;#c;#l;constructor(t={}){this.#r=t.queryCache||new q,this.#u=t.mutationCache||new m,this.#n=t.defaultOptions||{},this.#a=/* @__PURE__ */new Map,this.#o=/* @__PURE__ */new Map,this.#h=0}mount(){this.#h++,1===this.#h&&(this.#c=i.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#r.onFocus())}),this.#l=y.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#r.onOnline())}))}unmount(){this.#h--,0===this.#h&&(this.#c?.(),this.#c=void 0,this.#l?.(),this.#l=void 0)}isFetching(t){return this.#r.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#u.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#r.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=this.#r.build(this,e),i=s.state.data;return void 0===i?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(u(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return this.#r.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,s){const i=this.defaultQueryOptions({queryKey:t}),r=this.#r.get(i.queryHash)?.state.data,u=f(e,r);if(void 0!==u)return this.#r.build(this,i).setData(u,{...s,manual:!0})}setQueriesData(t,e,s){return o.batch(()=>this.#r.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,s)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#r.get(e.queryHash)?.state}removeQueries(t){const e=this.#r;o.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){const s=this.#r;return o.batch(()=>(s.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const i={revert:!0,...e},r=o.batch(()=>this.#r.findAll(t).map(t=>t.cancel(i)));return Promise.all(r).then(s).catch(s)}invalidateQueries(t,e={}){return o.batch(()=>(this.#r.findAll(t).forEach(t=>{t.invalidate()}),"none"===t?.refetchType?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const i={...e,cancelRefetch:e.cancelRefetch??!0},r=o.batch(()=>this.#r.findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,i);return i.throwOnError||(e=e.catch(s)),"paused"===t.state.fetchStatus?Promise.resolve():e}));return Promise.all(r).then(s)}fetchQuery(t){const e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);const s=this.#r.build(this,e);return s.isStaleByTime(u(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(s).catch(s)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(s).catch(s)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return y.isOnline()?this.#u.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#r}getMutationCache(){return this.#u}getDefaultOptions(){return this.#n}setDefaultOptions(t){this.#n=t}setQueryDefaults(t,e){this.#a.set(n(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const s=[...this.#a.values()],i={};return s.forEach(s=>{e(t,s.queryKey)&&Object.assign(i,s.defaultOptions)}),i}setMutationDefaults(t,e){this.#o.set(n(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const s=[...this.#o.values()],i={};return s.forEach(s=>{e(t,s.mutationKey)&&Object.assign(i,s.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const s={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return s.queryHash||(s.queryHash=t(s.queryKey,s)),void 0===s.refetchOnReconnect&&(s.refetchOnReconnect="always"!==s.networkMode),void 0===s.throwOnError&&(s.throwOnError=!!s.suspense),!s.networkMode&&s.persister&&(s.networkMode="offlineFirst"),s.queryFn===h&&(s.enabled=!1),s}defaultMutationOptions(t){return t?._defaulted?t:{...this.#n.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#r.clear(),this.#u.clear()}};export{g as t};
1
+ import{C as t,D as e,E as s,M as i,N as r,O as u,S as n,T as a,b as o,j as h,m as c,w as l,x as f,y}from"./Dpwx5KMy.js";import{t as d}from"./Do4y0nPe.js";var m=class extends r{constructor(t={}){super(),this.config=t,this.#t=/* @__PURE__ */new Set,this.#e=/* @__PURE__ */new Map,this.#s=0}#t;#e;#s;build(t,e,s){const i=new d({client:t,mutationCache:this,mutationId:++this.#s,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#t.add(t);const e=p(t);if("string"==typeof e){const s=this.#e.get(e);s?s.push(t):this.#e.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#t.delete(t)){const e=p(t);if("string"==typeof e){const s=this.#e.get(e);if(s)if(s.length>1){const e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&this.#e.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=p(t);if("string"==typeof e){const s=this.#e.get(e)?.find(t=>"pending"===t.state.status);return!s||s===t}return!0}runNext(t){const e=p(t);return"string"==typeof e?(this.#e.get(e)?.find(e=>e!==t&&e.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){o.batch(()=>{this.#t.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(t){const e={exact:!0,...t};return this.getAll().find(t=>l(e,t))}findAll(t={}){return this.getAll().filter(e=>l(t,e))}notify(t){o.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(t=>t.state.isPaused);return o.batch(()=>Promise.all(t.map(t=>t.continue().catch(s))))}};function p(t){return t.options.scope?.id}var q=class extends r{constructor(t={}){super(),this.config=t,this.#i=/* @__PURE__ */new Map}#i;build(e,s,i){const r=s.queryKey,u=s.queryHash??t(r,s);let n=this.get(u);return n||(n=new c({client:e,queryKey:r,queryHash:u,options:e.defaultQueryOptions(s),state:i,defaultOptions:e.getQueryDefaults(r)}),this.add(n)),n}add(t){this.#i.has(t.queryHash)||(this.#i.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#i.get(t.queryHash);e&&(t.destroy(),e===t&&this.#i.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){o.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#i.get(t)}getAll(){return[...this.#i.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(t=>a(e,t))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(e=>a(t,e)):e}notify(t){o.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){o.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){o.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},g=class{#r;#u;#n;#a;#o;#h;#c;#l;constructor(t={}){this.#r=t.queryCache||new q,this.#u=t.mutationCache||new m,this.#n=t.defaultOptions||{},this.#a=/* @__PURE__ */new Map,this.#o=/* @__PURE__ */new Map,this.#h=0}mount(){this.#h++,1===this.#h&&(this.#c=i.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#r.onFocus())}),this.#l=y.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#r.onOnline())}))}unmount(){this.#h--,0===this.#h&&(this.#c?.(),this.#c=void 0,this.#l?.(),this.#l=void 0)}isFetching(t){return this.#r.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#u.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#r.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=this.#r.build(this,e),i=s.state.data;return void 0===i?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(u(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return this.#r.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,s){const i=this.defaultQueryOptions({queryKey:t}),r=this.#r.get(i.queryHash)?.state.data,u=f(e,r);if(void 0!==u)return this.#r.build(this,i).setData(u,{...s,manual:!0})}setQueriesData(t,e,s){return o.batch(()=>this.#r.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,s)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#r.get(e.queryHash)?.state}removeQueries(t){const e=this.#r;o.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){const s=this.#r;return o.batch(()=>(s.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const i={revert:!0,...e},r=o.batch(()=>this.#r.findAll(t).map(t=>t.cancel(i)));return Promise.all(r).then(s).catch(s)}invalidateQueries(t,e={}){return o.batch(()=>(this.#r.findAll(t).forEach(t=>{t.invalidate()}),"none"===t?.refetchType?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const i={...e,cancelRefetch:e.cancelRefetch??!0},r=o.batch(()=>this.#r.findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,i);return i.throwOnError||(e=e.catch(s)),"paused"===t.state.fetchStatus?Promise.resolve():e}));return Promise.all(r).then(s)}fetchQuery(t){const e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);const s=this.#r.build(this,e);return s.isStaleByTime(u(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(s).catch(s)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(s).catch(s)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return y.isOnline()?this.#u.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#r}getMutationCache(){return this.#u}getDefaultOptions(){return this.#n}setDefaultOptions(t){this.#n=t}setQueryDefaults(t,e){this.#a.set(n(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const s=[...this.#a.values()],i={};return s.forEach(s=>{e(t,s.queryKey)&&Object.assign(i,s.defaultOptions)}),i}setMutationDefaults(t,e){this.#o.set(n(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const s=[...this.#o.values()],i={};return s.forEach(s=>{e(t,s.mutationKey)&&Object.assign(i,s.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const s={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return s.queryHash||(s.queryHash=t(s.queryKey,s)),void 0===s.refetchOnReconnect&&(s.refetchOnReconnect="always"!==s.networkMode),void 0===s.throwOnError&&(s.throwOnError=!!s.suspense),!s.networkMode&&s.persister&&(s.networkMode="offlineFirst"),s.queryFn===h&&(s.enabled=!1),s}defaultMutationOptions(t){return t?._defaulted?t:{...this.#n.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#r.clear(),this.#u.clear()}};export{g as t};
@@ -1,4 +1,4 @@
1
- import{t}from"./BXMw4kNf.js";import{n as s}from"./CdivXyOP.js";import{x as o}from"./Bb9ydqSB.js";import{d as a,i as r,n as e}from"./BK_hWmGs.js";import{t as i}from"./ydzHqf5r.js";import{t as n}from"./BxQf2Aj9.js";import{t as l}from"./p4NDlPrf.js";import{t as m}from"./BqPiuAuP.js";import{t as d}from"./JY9kGm742.js";import{t as c}from"./DLHvSz1a2.js";import{t as g}from"./DKxH7j1t2.js";var f=()=>{const f=a(),{props:p,folders:v}=s(),h=p?.organizationId,{loading:u,event:N}=c({eventSlug:f.eventSlug});if(u)/* @__PURE__ */return t("div",{children:[
1
+ import{t}from"./BXMw4kNf.js";import{n as s}from"./Dpwx5KMy.js";import{x as o}from"./Bb9ydqSB.js";import{d as a,i as r,n as e}from"./Z3MoLpu5.js";import{t as i}from"./5r_0x4aK.js";import{t as n}from"./Bvc6t1Gu.js";import{t as l}from"./CNyy8GGA.js";import{t as m}from"./BOs_rBYA.js";import{t as d}from"./JY9kGm742.js";import{t as c}from"./Te9ieH1R2.js";import{t as g}from"./BWjYmdOz2.js";var f=()=>{const f=a(),{props:p,folders:v}=s(),h=p?.organizationId,{loading:u,event:N}=c({eventSlug:f.eventSlug});if(u)/* @__PURE__ */return t("div",{children:[
2
2
  /* @__PURE__ */t(n,{className:"mx-auto mt-4 h-8 w-64"}),
3
3
  /* @__PURE__ */t(n,{className:"mx-auto mt-6 h-6 w-72"}),
4
4
  /* @__PURE__ */t(n,{className:"mx-auto mt-6 h-8 w-72"}),
package/element/web.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import{n as t}from"./DdACKOZr.js";import{C as r,_ as a,d as o,f as e,h as i,p as n,s,t as l,v as c,w as d,x as p}from"./BXMw4kNf.js";import{d as g,l as m,n as h,t as v}from"./CdivXyOP.js";import{n as f,r as u,t as b}from"./DqAzUQcH.js";import{t as w}from"./9E5bMl4h.js";import{t as y}from"./DmpmrPE5.js";import{c as x,h as k,i as _,p as T,t as z,x as N}from"./Bb9ydqSB.js";import{a as C,d as q,f as j,l as I,o as E,r as S,s as M,t as L,u as A}from"./BK_hWmGs.js";import{t as O}from"./cBUXG_uS.js";import{a as R,c as P,d as U,i as D,l as F,n as B,o as Y,r as V,s as $,t as G,u as H}from"./8QLGsYN7.js";import{t as Q}from"./Dl6jcv9I.js";import{t as X}from"./ydzHqf5r.js";import{t as Z}from"./BxQf2Aj9.js";import{t as W}from"./p4NDlPrf.js";import{t as K}from"./CTikdrXC.js";import{t as J}from"./QxKjlE-j.js";import{t as tt}from"./C0eP2utz.js";import{t as rt}from"./Dstt_bTH.js";import{n as at,r as ot,t as et}from"./BuhJHzFX.js";import{b as it,m as nt,p as st,r as lt,t as ct}from"./L4hWU3Nc.js";import{t as dt}from"./CXRH3zmy.js";var pt=class extends p{state={hasError:!1,error:null};static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t){this.props.onError?.(t);try{const r=this.base;(r instanceof Element?r:r?.parentElement||null)?.dispatchEvent(new CustomEvent("qrati-error",{detail:{error:t},bubbles:!0,composed:!0}))}catch{}}render(){return this.state.hasError?this.props.fallback??null:this.props.children}},gt=()=>{const t=I(),{props:r,sessionId:o}=h(),i=r?.organizationId,n=e(o),s=e(i);a(()=>{n.current=o,s.current=i},[o,i]);const l=e([]),d=e(null),p=e(null),g=e(!1),m=e(!0),v=c(async t=>{const r=n.current;if(r&&t.length)try{await y.post(_.UPDATE_SESSION,{headers:{"x-org-id":s.current},json:{sessionId:r,pageViews:t}})}catch(a){console.error("Failed to send page views:",a)}},[]),f=c(()=>{if(g.current)return null;g.current=!0;const t=Date.now();if(d.current&&p.current){if(t-p.current<100)return g.current=!1,null;const r={page:d.current,entryTime:p.current,exitTime:t},a=[...l.current,r];return a.length>=5?(v(a),l.current=[]):l.current=a,g.current=!1,r}return g.current=!1,null},[v]),u=c(t=>{d.current!==t&&(f(),d.current=t,p.current=Date.now())},[f]);return a(()=>{if(m.current)return m.current=!1,d.current=t.pathname,void(p.current=Date.now());const r=document.getElementById("qrati-connect-container");r&&r.scrollIntoView({behavior:"smooth",block:"start"}),u(t.pathname)},[t.pathname,u]),a(()=>{const t=()=>{f();const t=l.current;return 0===t.length?null:(l.current=[],t)},r=()=>{const r=t();if(r)try{const t={"Content-Type":"application/json"};s.current&&(t["x-org-id"]=s.current),fetch(_.UPDATE_SESSION,{method:"POST",headers:t,body:JSON.stringify({sessionId:n.current,pageViews:r}),keepalive:!0})}catch(a){console.error("Failed to send final page views with fetch keepalive:",a),v(r)}};return window.addEventListener("beforeunload",r),()=>{window.removeEventListener("beforeunload",r);const a=t();a&&v(a)}},[f]),null};function mt({className:t}){/* @__PURE__ */
1
+ import{n as t}from"./DdACKOZr.js";import{C as r,_ as a,d as o,f as e,h as i,p as n,s,t as l,v as c,w as d,x as p}from"./BXMw4kNf.js";import{d as g,l as m,n as h,t as v}from"./Dpwx5KMy.js";import{n as f,r as u,t as b}from"./CJ_l5BYI.js";import{t as w}from"./rlutojb0.js";import{t as y}from"./DmpmrPE5.js";import{c as x,h as k,i as _,p as T,t as z,x as N}from"./Bb9ydqSB.js";import{a as C,d as q,f as j,l as I,o as E,r as S,s as M,t as L,u as A}from"./Z3MoLpu5.js";import{t as O}from"./BszsxRY6.js";import{a as R,c as P,d as U,i as D,l as F,n as B,o as Y,r as V,s as $,t as G,u as H}from"./CkBayeWW.js";import{t as Q}from"./Dl6jcv9I.js";import{t as X}from"./5r_0x4aK.js";import{t as Z}from"./Bvc6t1Gu.js";import{t as W}from"./CNyy8GGA.js";import{t as K}from"./CTikdrXC.js";import{t as J}from"./BWKUiudT.js";import{t as tt}from"./C0eP2utz.js";import{t as rt}from"./Dstt_bTH.js";import{n as at,r as ot,t as et}from"./D5Ja4Yts.js";import{b as it,m as nt,p as st,r as lt,t as ct}from"./L4hWU3Nc.js";import{t as dt}from"./Bq48A0Iv.js";var pt=class extends p{state={hasError:!1,error:null};static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t){this.props.onError?.(t);try{const r=this.base;(r instanceof Element?r:r?.parentElement||null)?.dispatchEvent(new CustomEvent("qrati-error",{detail:{error:t},bubbles:!0,composed:!0}))}catch{}}render(){return this.state.hasError?this.props.fallback??null:this.props.children}},gt=()=>{const t=I(),{props:r,sessionId:o}=h(),i=r?.organizationId,n=e(o),s=e(i);a(()=>{n.current=o,s.current=i},[o,i]);const l=e([]),d=e(null),p=e(null),g=e(!1),m=e(!0),v=c(async t=>{const r=n.current;if(r&&t.length)try{await y.post(_.UPDATE_SESSION,{headers:{"x-org-id":s.current},json:{sessionId:r,pageViews:t}})}catch(a){console.error("Failed to send page views:",a)}},[]),f=c(()=>{if(g.current)return null;g.current=!0;const t=Date.now();if(d.current&&p.current){if(t-p.current<100)return g.current=!1,null;const r={page:d.current,entryTime:p.current,exitTime:t},a=[...l.current,r];return a.length>=5?(v(a),l.current=[]):l.current=a,g.current=!1,r}return g.current=!1,null},[v]),u=c(t=>{d.current!==t&&(f(),d.current=t,p.current=Date.now())},[f]);return a(()=>{if(m.current)return m.current=!1,d.current=t.pathname,void(p.current=Date.now());const r=document.getElementById("qrati-connect-container");r&&r.scrollIntoView({behavior:"smooth",block:"start"}),u(t.pathname)},[t.pathname,u]),a(()=>{const t=()=>{f();const t=l.current;return 0===t.length?null:(l.current=[],t)},r=()=>{const r=t();if(r)try{const t={"Content-Type":"application/json"};s.current&&(t["x-org-id"]=s.current),fetch(_.UPDATE_SESSION,{method:"POST",headers:t,body:JSON.stringify({sessionId:n.current,pageViews:r}),keepalive:!0})}catch(a){console.error("Failed to send final page views with fetch keepalive:",a),v(r)}};return window.addEventListener("beforeunload",r),()=>{window.removeEventListener("beforeunload",r);const a=t();a&&v(a)}},[f]),null};function mt({className:t}){/* @__PURE__ */
2
2
  return l("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__ */l("path",{fill:"currentColor",d:"M3 19q-.825 0-1.412-.587T1 17V7q0-.825.588-1.412T3 5h10q.825 0 1.413.588T15 7v10q0 .825-.587 1.413T13 19zm15-8q-.425 0-.712-.288T17 10V6q0-.425.288-.712T18 5h4q.425 0 .713.288T23 6v4q0 .425-.288.713T22 11zm1-2h2V7h-2zM3 17h10V7H3zm2-2h6q.3 0 .45-.275t-.05-.525l-1.625-2.175q-.15-.2-.4-.2t-.4.2L7.5 14l-.975-1.3q-.15-.2-.4-.2t-.4.2L4.6 14.2q-.2.25-.05.525T5 15m13 4q-.425 0-.712-.288T17 18v-4q0-.425.288-.712T18 13h4q.425 0 .713.288T23 14v4q0 .425-.288.713T22 19zm1-2h2v-2h-2zM3 17V7zm16-8V7zm0 8v-2z"})})}var ht=({event:t})=>{const{organization:r}=h(),a=n(()=>t?.contents&&0!==t.contents.length?[...t.contents].sort((t,r)=>{const a=(r.score||0)-(t.score||0);return 0!==a?a:(t.thumbnailUrl||"").localeCompare(r.thumbnailUrl||"")}):[],[t?.contents]),o=r?.advancedSettings?.defaultCoverImageUrl,e=r?.advancedSettings?.defaultCoverBlurHash;let i,s;t?.coverImageUrl?(i=t.coverImageUrl,s=t.coverBlurHash):a[0]?(i=a[0].thumbnailUrl||a[0].url,s=a[0].blurHash):o&&(i=o,s=e);const c=t?.status?.toUpperCase(),d=!r?.integrationSettings?.hideEventStatus&&c&&c!==T.CLOSED;/* @__PURE__ */
3
3
  return l("div",{className:"space-y-3",children:[/* @__PURE__ */l("div",{className:"relative h-72 overflow-hidden rounded sm:h-80",children:[i?/* @__PURE__ */l(J,{wrapperClassName:"size-full sm:hover:scale-105 sm:transition-transform",src:i,blurhash:s||void 0}):/* @__PURE__ */l("div",{className:"flex size-full items-center justify-center bg-muted",children:/* @__PURE__ */l(mt,{className:"size-16 text-white"})}),d&&/* @__PURE__ */l("div",{className:"absolute top-3 left-3",children:c===T.OPEN?/* @__PURE__ */l("span",{className:"bg-success inline-flex items-center gap-1.5 rounded-full px-3 py-1.5 text-xs font-medium text-white",children:[/* @__PURE__ */l("div",{className:"size-2 animate-pulse rounded-full bg-white"}),"Open"]}):/* @__PURE__ */l("span",{className:"bg-warning inline-flex items-center rounded-full px-3 py-1.5 text-xs font-semibold text-white",children:"Upcoming"})})]}),/* @__PURE__ */l("div",{className:"px-3 sm:px-0",children:[/* @__PURE__ */l(O,{variant:"h5",immutable:!0,lines:2,children:t.name}),t.description&&/* @__PURE__ */l(O,{variant:"body2",immutable:!0,lines:1,color:"muted",children:t.description})]})]})},vt=({folder:t})=>/* @__PURE__ */l("div",{className:"shadow-outer border-border flex min-w-0 items-center gap-3 rounded border p-2 transition-colors duration-200",onMouseEnter:r=>{const a=r.currentTarget;a&&t.color&&(a.style.backgroundColor=`${t.color}3A`)},onMouseLeave:t=>{const r=t.currentTarget;r&&(r.style.backgroundColor="")},children:[/* @__PURE__ */l("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",className:"shrink-0",style:{color:t.color},children:/* @__PURE__ */l("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"})}),/* @__PURE__ */l("span",{className:"truncate text-sm md:text-base font-semibold",children:t.name})]});function ft({className:t}){/* @__PURE__ */
4
4
  return l("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__ */l("path",{fill:"currentColor",d:"M7.288 12.288Q7 12.575 7 13v3q0 .425.288.713T8 17t.713-.288T9 16v-3q0-.425-.288-.712T8 12t-.712.288m8-5Q15 7.575 15 8v8q0 .425.288.713T16 17t.713-.288T17 16V8q0-.425-.288-.712T16 7t-.712.288m-4 7Q11 14.575 11 15v1q0 .425.288.713T12 17t.713-.288T13 16v-1q0-.425-.288-.712T12 14t-.712.288M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5zM5 5v14zm7.713 6.713Q13 11.425 13 11t-.288-.712T12 10t-.712.288T11 11t.288.713T12 12t.713-.288"})})}function ut({className:t}){/* @__PURE__ */
@@ -27,13 +27,13 @@ return l("div",{className:"mt-3 space-y-6 sm:mt-6",children:[
27
27
  /* @__PURE__ */l(O,{variant:"h3",className:"mb-2",children:"No Content Found"}),
28
28
  /* @__PURE__ */l(O,{variant:"body1",className:"mb-6 text-gray-600 dark:text-gray-400",children:"Nothing matched. Try different keywords or broaden your search."})]}),!n&&("event"===o?f.map(t=>{const r=u[t]||[];/* @__PURE__ */
29
29
  return l("div",{className:"space-y-4",children:[t===f[0]&&/* @__PURE__ */l(O,{variant:"h3",className:"mb-4",children:["Events (",m.length,")"]}),/* @__PURE__ */l("div",{className:"grid grid-cols-1 gap-4 gap-y-6 sm:grid-cols-2 lg:grid-cols-3",children:r.map(t=>/* @__PURE__ */l(q,{event:t},t._id))})]},`event-folder-${t}`)}):f.map(t=>{const a=w[t]||[];/* @__PURE__ */
30
- return l("div",{className:"space-y-4",children:[t===f[0]&&/* @__PURE__ */l(O,{variant:"h3",className:"mb-4",children:["Contents (",v?.totalContentCount||h.length,") Events (",v?.totalEventCount||b.length,")"]}),/* @__PURE__ */l("div",{className:"space-y-6",children:a.map(t=>/* @__PURE__ */l("div",{className:"space-y-3",children:[/* @__PURE__ */l(q,{event:t.event}),/* @__PURE__ */l("div",{className:"grid grid-cols-3 gap-3",children:t.contents.map(a=>/* @__PURE__ */l(Et,{content:a,timestampField:"captureTime",submittedQuery:r,onClick:r=>_(t.event._id,a._id,r)},a._id))})]},`content-event-${t.event._id}`))})]},`content-folder-${t}`)})),"content"===o&&c&&!n&&/* @__PURE__ */l("div",{ref:z,className:"h-4 w-full","aria-hidden":"true"}),"content"===o&&c&&i&&d>1&&!n&&/* @__PURE__ */l("div",{className:"flex justify-center pt-2",children:/* @__PURE__ */l(qt,{className:"text-2xl"})}),"event"===o&&c&&s&&!n&&/* @__PURE__ */l("div",{className:"flex justify-center pt-2",children:/* @__PURE__ */l("button",{type:"button",disabled:i,className:"bg-primary text-primary-foreground disabled:bg-muted rounded px-4 py-2 text-sm font-medium disabled:cursor-not-allowed",onClick:p,children:i?"Loading...":"Load More"})})]})},Mt=/* @__PURE__ */t({default:()=>Lt}),Lt=class extends ct{constructor(t){super(),this.options=t||{},this._uid=0,this.shouldOpen=!1,this._preloadedContent=void 0,this.onThumbnailsClick=this.onThumbnailsClick.bind(this)}init(){st(this.options.gallery,this.options.gallerySelector).forEach(t=>{t.addEventListener("click",this.onThumbnailsClick,!1)})}onThumbnailsClick(t){if(it(t)||window.pswp)return;let r={x:t.clientX,y:t.clientY};r.x||r.y||(r=null);let a=this.getClickedIndex(t);a=this.applyFilters("clickedIndex",a,t,this);const o={gallery:t.currentTarget};a>=0&&(t.preventDefault(),this.loadAndOpen(a,o,r))}getClickedIndex(t){if(this.options.getClickedIndexFn)return this.options.getClickedIndexFn.call(this,t);const r=t.target,a=st(this.options.children,this.options.childSelector,t.currentTarget).findIndex(t=>t===r||t.contains(r));return-1!==a?a:this.options.children||this.options.childSelector?-1:0}loadAndOpen(t,r,a){if(window.pswp||!this.options)return!1;if(!r&&this.options.gallery&&this.options.children){const t=st(this.options.gallery);t[0]&&(r={gallery:t[0]})}return this.options.index=t,this.options.initialPointerPos=a,this.shouldOpen=!0,this.preload(t,r),!0}preload(t,r){const{options:a}=this;r&&(a.dataSource=r);const o=[],e=typeof a.pswpModule;if(nt(a.pswpModule))o.push(Promise.resolve(a.pswpModule));else{if("string"===e)throw new Error("pswpModule as string is no longer supported");if("function"!==e)throw new Error("pswpModule is not valid");o.push(a.pswpModule())}"function"==typeof a.openPromise&&o.push(a.openPromise()),!1!==a.preloadFirstSlide&&t>=0&&(this._preloadedContent=lt(t,this));const i=++this._uid;Promise.all(o).then(t=>{if(this.shouldOpen){const r=t[0];this._openPhotoswipe(r,i)}})}_openPhotoswipe(t,r){if(r!==this._uid&&this.shouldOpen)return;if(this.shouldOpen=!1,window.pswp)return;const a="object"==typeof t?new t.default(this.options):new t(this.options);this.pswp=a,window.pswp=a,Object.keys(this._listeners).forEach(t=>{this._listeners[t]?.forEach(r=>{a.on(t,r)})}),Object.keys(this._filters).forEach(t=>{this._filters[t]?.forEach(r=>{a.addFilter(t,r.fn,r.priority)})}),this._preloadedContent&&(a.contentLoader.addToCache(this._preloadedContent),this._preloadedContent=void 0),a.on("destroy",()=>{this.pswp=void 0,delete window.pswp}),a.init()}destroy(){this.pswp?.destroy(),this.shouldOpen=!1,this._listeners={},st(this.options.gallery,this.options.gallerySelector).forEach(t=>{t.removeEventListener("click",this.onThumbnailsClick,!1)})}},At=/* @__PURE__ */t({loadPhotoSwipe:()=>Ot}),Ot=()=>import("./Ot24jlyb2.js"),Rt="-createdAt",Pt="qrati-global-search-sort",Ut=t=>{if("undefined"==typeof window)return Rt;try{const r=window.localStorage.getItem(`${Pt}:${t||"default"}`);return(t=>"name"===t||"-name"===t||"createdAt"===t||"-createdAt"===t)(r)?r:Rt}catch{return Rt}},Dt=(t,r,a)=>{const o=a.replace("-",""),e=a.startsWith("-")?-1:1;return"name"===o?e*(t.name||"").localeCompare(r.name||"",void 0,{sensitivity:"base"}):e*(t.createdAt||"").localeCompare(r.createdAt||"")},Ft=o(()=>import("./BUd_JUBh.js")),Bt=(t,r,a)=>(a.startsWith("-")?-1:1)*("name"===a.replace("-","")?(t.name||"").localeCompare(r.name||"",void 0,{sensitivity:"base"}):(t.createdAt||"").localeCompare(r.createdAt||"")),Yt={grid:{icon:/* @__PURE__ */l("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-full text-inherit",width:24,height:24,viewBox:"0 0 24 24",children:/* @__PURE__ */l("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"})})},map:{icon:/* @__PURE__ */l("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-full text-inherit",width:24,height:24,viewBox:"0 0 24 24",children:/* @__PURE__ */l("path",{fill:"currentColor",d:"M14.35 20.775L9 18.9l-4.65 1.8q-.25.1-.488.063t-.437-.163t-.312-.337T3 19.775V5.75q0-.325.188-.575T3.7 4.8l4.65-1.575q.15-.05.313-.075T9 3.125t.338.025t.312.075L15 5.1l4.65-1.8q.25-.1.488-.062t.437.162t.313.338t.112.487V18.25q0 .325-.187.575t-.513.375l-4.65 1.575q-.15.05-.312.075t-.338.025t-.337-.025t-.313-.075M14 18.55V6.85l-4-1.4v11.7zm2 0l3-1V5.7l-3 1.15zM5 18.3l3-1.15V5.45l-3 1zM16 6.85v11.7zm-8-1.4v11.7z"})})}},Vt=Object.keys(Yt).map(t=>({icon:Yt[t].icon,value:t})),$t=()=>{import("./Ci9PI8hK2.js").catch(()=>{}),import("./BGo2VsHN2.js").catch(()=>{})},Gt=()=>{const t=q(),r=I(),o=t.folderId??"",p=h(),{folders:g,organization:v}=p,w=p.props?.organizationId,x=!1!==v?.integrationSettings?.enableGlobalSearch,k=!0===v?.integrationSettings?.showSortControl,T=((t,r)=>{const[o,s]=i(""),[l,d]=i("event"),[p,g]=i(1),[m,h]=i(!1),[v,f]=i(""),[u,b]=i(!1),[w,x]=i(()=>Ut(t)),[k,T]=i([]),[z,N]=i([]),[C,q]=i(null),E=A(),S=I(),M=j(),L=e(0),O=e(null),R=e(null),P=e(null),U=e(-1),D=e(null),B=n(()=>`org-inline-search-gallery-${t||"default"}`,[t]),Y=c(()=>{s(""),f(""),b(!1),g(1),T([]),N([]),q(null)},[]),V=c((t,r)=>{g(1),f(""),b(!1),T([]),N([]),q(null),d(r),s(t)},[]),$=c(r=>{x(r);try{window.localStorage.setItem(`${Pt}:${t||"default"}`,r)}catch{}g(1),f(""),b(!1),T([]),N([]),q(null)},[t]);a(()=>{x(Ut(t))},[t]),a(()=>{if(!t||!o)return;const r=++L.current;(async()=>{h(!0),f("");try{const a="event"===l?_.SEARCH_EVENTS:_.SEARCH_CONTENTS,e=await y.get(a,{timeout:6e4,headers:{"x-org-id":t},searchParams:{query:o,page:String(p),limit:"event"===l?"12":"8",sort:w,projection:"connect",..."content"===l?{includeCounts:"false"}:{}}}).json();if(r!==L.current)return;const i=e?.data||[],n=e?.meta?.totalPages||0,s=e?.meta?.currentPage||0;if(b(e?.meta?.hasMore??s<n),"event"===l){const t=i;T(r=>1===p?t:[...r,...t])}else{q({totalContentCount:e?.meta?.totalContentCount,totalEventCount:e?.meta?.totalEventCount});const t=i;N(r=>1===p?t:[...r,...t])}}catch(a){if(r!==L.current)return;f(a?.message||"Failed to search")}finally{r===L.current&&h(!1)}})()},[t,p,w,o,l]);const G=n(()=>{const t={};return k.forEach(r=>{const a=r.folderId||"root";t[a]||(t[a]=[]),t[a].push(r)}),Object.values(t).forEach(t=>{t.sort((t,r)=>Dt(t,r,w))}),t},[k,w]),H=n(()=>{const t=/* @__PURE__ */new Map,r=/* @__PURE__ */new Set;return z.forEach(a=>{if(!a?._id||r.has(a._id))return;r.add(a._id);const o=a.event?._id||a.eventId;o&&a.event&&(t.has(o)||t.set(o,{event:a.event,contents:[]}),t.get(o)?.contents.push({...a}))}),Array.from(t.values()).sort((t,r)=>Dt(t.event,r.event,w))},[z,w]),Q=n(()=>{const t={};return H.forEach(r=>{const a=r.event?.folderId||"root";t[a]||(t[a]=[]),t[a].push(r)}),t},[H]),X=n(()=>{const t=Object.keys("event"===l?G:Q),a="event"===l?G:Q;return t.sort((t,o)=>{const e=(a[t]||[]).map(t=>"event"in t?t.event:t),i=(a[o]||[]).map(t=>"event"in t?t.event:t),n=e[0]||{name:"",createdAt:""},s=i[0]||{name:"",createdAt:""};if("createdAt"===w.replace("-","")){const t=Dt(n,s,w);if(0!==t)return t}const l=F(r,t).map(t=>t.name).join("/"),c=F(r,o).map(t=>t.name).join("/"),d=l.localeCompare(c,void 0,{sensitivity:"base"});return"name"===w.replace("-","")&&w.startsWith("-")?-d:d}),t},[Q,G,r,w,l]),Z=n(()=>{if("content"!==l)return[];const t=[];return X.forEach(r=>{(Q[r]||[]).forEach(r=>{r.contents.forEach(a=>{t.push({event:r.event,content:a})})})}),t},[X,Q,l]),W=c((t,r,a)=>{if(!O.current?.loadAndOpen)return;const o=Z.findIndex(a=>a.event._id===t&&a.content._id===r);o>=0&&(U.current=o,P.current=(a?.currentTarget)?.querySelector("img")??null,O.current.loadAndOpen(o))},[Z]);return a(()=>{const t=D.current;if("content"!==l||!o||0===Z.length||!t)return R.current?.destroy(),R.current=null,O.current?.destroy?.(),void(O.current=null);const r=new Lt({gallery:t,children:"a.pswp-item",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:Ot}),a=new et(()=>window.pswp,"memory"===M?{location:S.pathname,state:S.state,push:(t,r)=>E(t,{state:r}),replace:(t,r)=>E(t,{state:r,replace:!0}),go:t=>E(t)}:void 0);return R.current=a,r.addFilter("thumbEl",(t,r,a)=>a===U.current?P.current??t:t),r.on("beforeOpen",()=>a.open()),r.on("close",()=>{a.close(),R.current===a&&(R.current=null),O.current===r&&(O.current=null)}),O.current=r,r.init(),()=>{a.destroy(),O.current?.destroy?.(),O.current=null,R.current===a&&(R.current=null)}},[Z.length,B,o,l,M,S.pathname]),a(()=>{const t=R.current;"memory"===M&&t?.isActive()&&!at(S.state)&&t.handleBack()},[S.state,M]),{handleSearch:V,handleSortChange:$,clearSearch:Y,isSearchActive:o.length>0,submittedQuery:o,submittedSearchType:l,sort:w,isLoading:m,errorMessage:v,hasMore:u,page:p,setPage:g,eventResults:k,contentResults:z,contentMeta:C,activeFolderKeys:X,eventGroupsByFolder:G,contentGroups:H,contentGroupsByFolder:Q,flattenedContentMedia:Z,lightboxRef:O,galleryElementRef:D,galleryId:B,openMediaInLightbox:W}})(w,g||[]),z=T.sort||"-createdAt",C=!0===v?.integrationSettings?.enableMapView,[E,M]=i(()=>{if(!w)return"grid";try{return sessionStorage.getItem(`qrati-view-mode-${w}`)||"grid"}catch{return"grid"}}),{data:O,isLoading:R}=m({queryKey:[`public-events-map-${w}`,o||"all-folders",z],enabled:C&&"map"===E,staleTime:3e5,gcTime:6e5,queryFn:async()=>{const t=o.length>0?{folderId:o,limit:500,sort:z,projection:"connect"}:{includeAllFolders:"true",limit:500,sort:z,contentLimit:3,projection:"connect"};return(await y.get(_.PUBLIC_EVENTS,{headers:{"x-org-id":w},searchParams:t}).json()).data??[]}}),P=n(()=>{if("undefined"==typeof window)return null;if(r.state?.internalNavigation)return null;try{const t=new URLSearchParams(window.location?.search??"");let r=t.get("event"),a=t.get("page");if(!r&&!a&&window.location?.hash){const t=window.location.hash.split("?");if(t.length>1){const o=new URLSearchParams(t[1]);r=o.get("event"),a=o.get("page")}}if(r){if(a)switch(a.toLowerCase()){case"upload":return N.UPLOAD(r);case"curate":return N.CURATE(r);case"leaderboard":return N.LEADERBOARD(r);default:return N.GALLERY(r)}return N.GALLERY(r)}}catch(t){console.error("Error parsing URL parameters:",t)}return null},[]),D=n(()=>[...(g??[]).filter(t=>t.parentFolderId===(o?.length>0?o:null)||t.parentFolderId===(o?.length>0?o:void 0))].sort((t,r)=>Bt(t,r,z)),[z,g,o]),B=n(()=>F(g,o),[g,o]),{isLoading:Y,data:V,hasNextPage:$,fetchNextPage:G,isFetchingNextPage:J}=u({queryKey:[`public-events-${w}`,o,12,z],staleTime:6e4,gcTime:3e5,refetchOnWindowFocus:"always",initialPageParam:1,getNextPageParam:b,getPreviousPageParam:t=>f(t),queryFn:async({pageParam:t=1})=>await y.get(_.PUBLIC_EVENTS,{headers:{"x-org-id":w},searchParams:{folderId:o,sort:z,projection:"connect",page:t,limit:12}}).json()}),tt=n(()=>[...V?.pages?.flatMap(t=>t?.data??[])??[]].sort((t,r)=>Bt(t,r,z)),[z,V]),rt=e(null);return a(()=>{const t=rt.current;if(!t||!$)return;const r=new IntersectionObserver(t=>{t[0]?.isIntersecting&&$&&!J&&G()},{rootMargin:"200px"});return r.observe(t),()=>r.disconnect()},[$,J,G]),P?/* @__PURE__ */l(S,{to:P,replace:!0}):/* @__PURE__ */l(d,Y||!v?{children:/* @__PURE__ */l("div",{className:"min-h-screen w-full",children:[
30
+ return l("div",{className:"space-y-4",children:[t===f[0]&&/* @__PURE__ */l(O,{variant:"h3",className:"mb-4",children:["Contents (",v?.totalContentCount||h.length,") Events (",v?.totalEventCount||b.length,")"]}),/* @__PURE__ */l("div",{className:"space-y-6",children:a.map(t=>/* @__PURE__ */l("div",{className:"space-y-3",children:[/* @__PURE__ */l(q,{event:t.event}),/* @__PURE__ */l("div",{className:"grid grid-cols-3 gap-3",children:t.contents.map(a=>/* @__PURE__ */l(Et,{content:a,timestampField:"captureTime",submittedQuery:r,onClick:r=>_(t.event._id,a._id,r)},a._id))})]},`content-event-${t.event._id}`))})]},`content-folder-${t}`)})),"content"===o&&c&&!n&&/* @__PURE__ */l("div",{ref:z,className:"h-4 w-full","aria-hidden":"true"}),"content"===o&&c&&i&&d>1&&!n&&/* @__PURE__ */l("div",{className:"flex justify-center pt-2",children:/* @__PURE__ */l(qt,{className:"text-2xl"})}),"event"===o&&c&&s&&!n&&/* @__PURE__ */l("div",{className:"flex justify-center pt-2",children:/* @__PURE__ */l("button",{type:"button",disabled:i,className:"bg-primary text-primary-foreground disabled:bg-muted rounded px-4 py-2 text-sm font-medium disabled:cursor-not-allowed",onClick:p,children:i?"Loading...":"Load More"})})]})},Mt=/* @__PURE__ */t({default:()=>Lt}),Lt=class extends ct{constructor(t){super(),this.options=t||{},this._uid=0,this.shouldOpen=!1,this._preloadedContent=void 0,this.onThumbnailsClick=this.onThumbnailsClick.bind(this)}init(){st(this.options.gallery,this.options.gallerySelector).forEach(t=>{t.addEventListener("click",this.onThumbnailsClick,!1)})}onThumbnailsClick(t){if(it(t)||window.pswp)return;let r={x:t.clientX,y:t.clientY};r.x||r.y||(r=null);let a=this.getClickedIndex(t);a=this.applyFilters("clickedIndex",a,t,this);const o={gallery:t.currentTarget};a>=0&&(t.preventDefault(),this.loadAndOpen(a,o,r))}getClickedIndex(t){if(this.options.getClickedIndexFn)return this.options.getClickedIndexFn.call(this,t);const r=t.target,a=st(this.options.children,this.options.childSelector,t.currentTarget).findIndex(t=>t===r||t.contains(r));return-1!==a?a:this.options.children||this.options.childSelector?-1:0}loadAndOpen(t,r,a){if(window.pswp||!this.options)return!1;if(!r&&this.options.gallery&&this.options.children){const t=st(this.options.gallery);t[0]&&(r={gallery:t[0]})}return this.options.index=t,this.options.initialPointerPos=a,this.shouldOpen=!0,this.preload(t,r),!0}preload(t,r){const{options:a}=this;r&&(a.dataSource=r);const o=[],e=typeof a.pswpModule;if(nt(a.pswpModule))o.push(Promise.resolve(a.pswpModule));else{if("string"===e)throw new Error("pswpModule as string is no longer supported");if("function"!==e)throw new Error("pswpModule is not valid");o.push(a.pswpModule())}"function"==typeof a.openPromise&&o.push(a.openPromise()),!1!==a.preloadFirstSlide&&t>=0&&(this._preloadedContent=lt(t,this));const i=++this._uid;Promise.all(o).then(t=>{if(this.shouldOpen){const r=t[0];this._openPhotoswipe(r,i)}})}_openPhotoswipe(t,r){if(r!==this._uid&&this.shouldOpen)return;if(this.shouldOpen=!1,window.pswp)return;const a="object"==typeof t?new t.default(this.options):new t(this.options);this.pswp=a,window.pswp=a,Object.keys(this._listeners).forEach(t=>{this._listeners[t]?.forEach(r=>{a.on(t,r)})}),Object.keys(this._filters).forEach(t=>{this._filters[t]?.forEach(r=>{a.addFilter(t,r.fn,r.priority)})}),this._preloadedContent&&(a.contentLoader.addToCache(this._preloadedContent),this._preloadedContent=void 0),a.on("destroy",()=>{this.pswp=void 0,delete window.pswp}),a.init()}destroy(){this.pswp?.destroy(),this.shouldOpen=!1,this._listeners={},st(this.options.gallery,this.options.gallerySelector).forEach(t=>{t.removeEventListener("click",this.onThumbnailsClick,!1)})}},At=/* @__PURE__ */t({loadPhotoSwipe:()=>Ot}),Ot=()=>import("./Ot24jlyb2.js"),Rt="-createdAt",Pt="qrati-global-search-sort",Ut=t=>{if("undefined"==typeof window)return Rt;try{const r=window.localStorage.getItem(`${Pt}:${t||"default"}`);return(t=>"name"===t||"-name"===t||"createdAt"===t||"-createdAt"===t)(r)?r:Rt}catch{return Rt}},Dt=(t,r,a)=>{const o=a.replace("-",""),e=a.startsWith("-")?-1:1;return"name"===o?e*(t.name||"").localeCompare(r.name||"",void 0,{sensitivity:"base"}):e*(t.createdAt||"").localeCompare(r.createdAt||"")},Ft=o(()=>import("./DJMlQk40.js")),Bt=(t,r,a)=>(a.startsWith("-")?-1:1)*("name"===a.replace("-","")?(t.name||"").localeCompare(r.name||"",void 0,{sensitivity:"base"}):(t.createdAt||"").localeCompare(r.createdAt||"")),Yt={grid:{icon:/* @__PURE__ */l("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-full text-inherit",width:24,height:24,viewBox:"0 0 24 24",children:/* @__PURE__ */l("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"})})},map:{icon:/* @__PURE__ */l("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-full text-inherit",width:24,height:24,viewBox:"0 0 24 24",children:/* @__PURE__ */l("path",{fill:"currentColor",d:"M14.35 20.775L9 18.9l-4.65 1.8q-.25.1-.488.063t-.437-.163t-.312-.337T3 19.775V5.75q0-.325.188-.575T3.7 4.8l4.65-1.575q.15-.05.313-.075T9 3.125t.338.025t.312.075L15 5.1l4.65-1.8q.25-.1.488-.062t.437.162t.313.338t.112.487V18.25q0 .325-.187.575t-.513.375l-4.65 1.575q-.15.05-.312.075t-.338.025t-.337-.025t-.313-.075M14 18.55V6.85l-4-1.4v11.7zm2 0l3-1V5.7l-3 1.15zM5 18.3l3-1.15V5.45l-3 1zM16 6.85v11.7zm-8-1.4v11.7z"})})}},Vt=Object.keys(Yt).map(t=>({icon:Yt[t].icon,value:t})),$t=()=>{import("./CYGIt75r2.js").catch(()=>{}),import("./Cj_TL6Ks2.js").catch(()=>{})},Gt=()=>{const t=q(),r=I(),o=t.folderId??"",p=h(),{folders:g,organization:v}=p,w=p.props?.organizationId,x=!1!==v?.integrationSettings?.enableGlobalSearch,k=!0===v?.integrationSettings?.showSortControl,T=((t,r)=>{const[o,s]=i(""),[l,d]=i("event"),[p,g]=i(1),[m,h]=i(!1),[v,f]=i(""),[u,b]=i(!1),[w,x]=i(()=>Ut(t)),[k,T]=i([]),[z,N]=i([]),[C,q]=i(null),E=A(),S=I(),M=j(),L=e(0),O=e(null),R=e(null),P=e(null),U=e(-1),D=e(null),B=n(()=>`org-inline-search-gallery-${t||"default"}`,[t]),Y=c(()=>{s(""),f(""),b(!1),g(1),T([]),N([]),q(null)},[]),V=c((t,r)=>{g(1),f(""),b(!1),T([]),N([]),q(null),d(r),s(t)},[]),$=c(r=>{x(r);try{window.localStorage.setItem(`${Pt}:${t||"default"}`,r)}catch{}g(1),f(""),b(!1),T([]),N([]),q(null)},[t]);a(()=>{x(Ut(t))},[t]),a(()=>{if(!t||!o)return;const r=++L.current;(async()=>{h(!0),f("");try{const a="event"===l?_.SEARCH_EVENTS:_.SEARCH_CONTENTS,e=await y.get(a,{timeout:6e4,headers:{"x-org-id":t},searchParams:{query:o,page:String(p),limit:"event"===l?"12":"8",sort:w,projection:"connect",..."content"===l?{includeCounts:"false"}:{}}}).json();if(r!==L.current)return;const i=e?.data||[],n=e?.meta?.totalPages||0,s=e?.meta?.currentPage||0;if(b(e?.meta?.hasMore??s<n),"event"===l){const t=i;T(r=>1===p?t:[...r,...t])}else{q({totalContentCount:e?.meta?.totalContentCount,totalEventCount:e?.meta?.totalEventCount});const t=i;N(r=>1===p?t:[...r,...t])}}catch(a){if(r!==L.current)return;f(a?.message||"Failed to search")}finally{r===L.current&&h(!1)}})()},[t,p,w,o,l]);const G=n(()=>{const t={};return k.forEach(r=>{const a=r.folderId||"root";t[a]||(t[a]=[]),t[a].push(r)}),Object.values(t).forEach(t=>{t.sort((t,r)=>Dt(t,r,w))}),t},[k,w]),H=n(()=>{const t=/* @__PURE__ */new Map,r=/* @__PURE__ */new Set;return z.forEach(a=>{if(!a?._id||r.has(a._id))return;r.add(a._id);const o=a.event?._id||a.eventId;o&&a.event&&(t.has(o)||t.set(o,{event:a.event,contents:[]}),t.get(o)?.contents.push({...a}))}),Array.from(t.values()).sort((t,r)=>Dt(t.event,r.event,w))},[z,w]),Q=n(()=>{const t={};return H.forEach(r=>{const a=r.event?.folderId||"root";t[a]||(t[a]=[]),t[a].push(r)}),t},[H]),X=n(()=>{const t=Object.keys("event"===l?G:Q),a="event"===l?G:Q;return t.sort((t,o)=>{const e=(a[t]||[]).map(t=>"event"in t?t.event:t),i=(a[o]||[]).map(t=>"event"in t?t.event:t),n=e[0]||{name:"",createdAt:""},s=i[0]||{name:"",createdAt:""};if("createdAt"===w.replace("-","")){const t=Dt(n,s,w);if(0!==t)return t}const l=F(r,t).map(t=>t.name).join("/"),c=F(r,o).map(t=>t.name).join("/"),d=l.localeCompare(c,void 0,{sensitivity:"base"});return"name"===w.replace("-","")&&w.startsWith("-")?-d:d}),t},[Q,G,r,w,l]),Z=n(()=>{if("content"!==l)return[];const t=[];return X.forEach(r=>{(Q[r]||[]).forEach(r=>{r.contents.forEach(a=>{t.push({event:r.event,content:a})})})}),t},[X,Q,l]),W=c((t,r,a)=>{if(!O.current?.loadAndOpen)return;const o=Z.findIndex(a=>a.event._id===t&&a.content._id===r);o>=0&&(U.current=o,P.current=(a?.currentTarget)?.querySelector("img")??null,O.current.loadAndOpen(o))},[Z]);return a(()=>{const t=D.current;if("content"!==l||!o||0===Z.length||!t)return R.current?.destroy(),R.current=null,O.current?.destroy?.(),void(O.current=null);const r=new Lt({gallery:t,children:"a.pswp-item",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:Ot}),a=new et(()=>window.pswp,"memory"===M?{location:S.pathname,state:S.state,push:(t,r)=>E(t,{state:r}),replace:(t,r)=>E(t,{state:r,replace:!0}),go:t=>E(t)}:void 0);return R.current=a,r.addFilter("thumbEl",(t,r,a)=>a===U.current?P.current??t:t),r.on("beforeOpen",()=>a.open()),r.on("close",()=>{a.close(),R.current===a&&(R.current=null),O.current===r&&(O.current=null)}),O.current=r,r.init(),()=>{a.destroy(),O.current?.destroy?.(),O.current=null,R.current===a&&(R.current=null)}},[Z.length,B,o,l,M,S.pathname]),a(()=>{const t=R.current;"memory"===M&&t?.isActive()&&!at(S.state)&&t.handleBack()},[S.state,M]),{handleSearch:V,handleSortChange:$,clearSearch:Y,isSearchActive:o.length>0,submittedQuery:o,submittedSearchType:l,sort:w,isLoading:m,errorMessage:v,hasMore:u,page:p,setPage:g,eventResults:k,contentResults:z,contentMeta:C,activeFolderKeys:X,eventGroupsByFolder:G,contentGroups:H,contentGroupsByFolder:Q,flattenedContentMedia:Z,lightboxRef:O,galleryElementRef:D,galleryId:B,openMediaInLightbox:W}})(w,g||[]),z=T.sort||"-createdAt",C=!0===v?.integrationSettings?.enableMapView,[E,M]=i(()=>{if(!w)return"grid";try{return sessionStorage.getItem(`qrati-view-mode-${w}`)||"grid"}catch{return"grid"}}),{data:O,isLoading:R}=m({queryKey:[`public-events-map-${w}`,o||"all-folders",z],enabled:C&&"map"===E,staleTime:3e5,gcTime:6e5,queryFn:async()=>{const t=o.length>0?{folderId:o,limit:500,sort:z,projection:"connect"}:{includeAllFolders:"true",limit:500,sort:z,contentLimit:3,projection:"connect"};return(await y.get(_.PUBLIC_EVENTS,{headers:{"x-org-id":w},searchParams:t}).json()).data??[]}}),P=n(()=>{if("undefined"==typeof window)return null;if(r.state?.internalNavigation)return null;try{const t=new URLSearchParams(window.location?.search??"");let r=t.get("event"),a=t.get("page");if(!r&&!a&&window.location?.hash){const t=window.location.hash.split("?");if(t.length>1){const o=new URLSearchParams(t[1]);r=o.get("event"),a=o.get("page")}}if(r){if(a)switch(a.toLowerCase()){case"upload":return N.UPLOAD(r);case"curate":return N.CURATE(r);case"leaderboard":return N.LEADERBOARD(r);default:return N.GALLERY(r)}return N.GALLERY(r)}}catch(t){console.error("Error parsing URL parameters:",t)}return null},[]),D=n(()=>[...(g??[]).filter(t=>t.parentFolderId===(o?.length>0?o:null)||t.parentFolderId===(o?.length>0?o:void 0))].sort((t,r)=>Bt(t,r,z)),[z,g,o]),B=n(()=>F(g,o),[g,o]),{isLoading:Y,data:V,hasNextPage:$,fetchNextPage:G,isFetchingNextPage:J}=u({queryKey:[`public-events-${w}`,o,12,z],staleTime:6e4,gcTime:3e5,refetchOnWindowFocus:"always",initialPageParam:1,getNextPageParam:b,getPreviousPageParam:t=>f(t),queryFn:async({pageParam:t=1})=>await y.get(_.PUBLIC_EVENTS,{headers:{"x-org-id":w},searchParams:{folderId:o,sort:z,projection:"connect",page:t,limit:12}}).json()}),tt=n(()=>[...V?.pages?.flatMap(t=>t?.data??[])??[]].sort((t,r)=>Bt(t,r,z)),[z,V]),rt=e(null);return a(()=>{const t=rt.current;if(!t||!$)return;const r=new IntersectionObserver(t=>{t[0]?.isIntersecting&&$&&!J&&G()},{rootMargin:"200px"});return r.observe(t),()=>r.disconnect()},[$,J,G]),P?/* @__PURE__ */l(S,{to:P,replace:!0}):/* @__PURE__ */l(d,Y||!v?{children:/* @__PURE__ */l("div",{className:"min-h-screen w-full",children:[
31
31
  /* @__PURE__ */l(bt,{organization:v}),
32
32
  /* @__PURE__ */l("div",{className:"mt-4 grid grid-cols-2 gap-3 md:grid-cols-3 lg:grid-cols-4 lg:gap-6",children:Array.from({length:4}).map((t,r)=>/* @__PURE__ */l(Z,{className:"h-24 rounded"},`folder-${r}`))}),
33
33
  /* @__PURE__ */l("div",{className:"mt-4 grid grid-cols-1 gap-4 sm:grid-cols-3",children:Array.from({length:6}).map((t,r)=>/* @__PURE__ */l("div",{className:"space-y-4",children:[/* @__PURE__ */l(Z,{className:"h-72 overflow-hidden rounded sm:h-80"}),/* @__PURE__ */l(Z,{className:"h-6 w-64 rounded"})]},r))})]})}:{children:[/* @__PURE__ */l("div",{className:"min-h-screen w-full",children:[
34
34
  /* @__PURE__ */l("div",{className:"flex items-end justify-between",children:[/* @__PURE__ */l("div",{className:"mt-4 flex justify-end",children:C&&/* @__PURE__ */l(U,{className:"flex-1 lg:flex-none",selected:E,buttons:Vt,onChange:t=>(t=>{M(t);try{w&&sessionStorage.setItem(`qrati-view-mode-${w}`,t)}catch(r){}})(t)})}),/* @__PURE__ */l("div",{className:"flex flex-col items-end gap-4",children:[/* @__PURE__ */l(bt,{organization:v}),x&&/* @__PURE__ */l(Nt,{onSearch:T.handleSearch,onSortChange:T.handleSortChange,sort:T.sort,onClear:T.clearSearch,hasActiveSearch:T.isSearchActive,showSortControl:k})]})]}),T.isSearchActive&&/* @__PURE__ */l(St,{folders:g||[],submittedQuery:T.submittedQuery,submittedSearchType:T.submittedSearchType,isLoading:T.isLoading,errorMessage:T.errorMessage,hasMore:T.hasMore,isSearchActive:T.isSearchActive,page:T.page,onLoadMore:()=>T.setPage(t=>t+1),onBack:T.clearSearch,eventResults:T.eventResults,contentResults:T.contentResults,contentMeta:T.contentMeta,activeFolderKeys:T.activeFolderKeys,eventGroupsByFolder:T.eventGroupsByFolder,contentGroups:T.contentGroups,contentGroupsByFolder:T.contentGroupsByFolder,flattenedContentMedia:T.flattenedContentMedia,galleryElementRef:T.galleryElementRef,galleryId:T.galleryId,openMediaInLightbox:T.openMediaInLightbox}),!T.isSearchActive&&/* @__PURE__ */l(d,{children:["grid"===E&&o&&/* @__PURE__ */l("div",{className:"mt-4",children:/* @__PURE__ */l(H,{homeLink:N.PUBLIC_EVENTS,data:B})}),"grid"===E&&D.length>0&&/* @__PURE__ */l("div",{className:"mt-4 grid grid-cols-2 gap-3 md:grid-cols-3 lg:grid-cols-4 lg:gap-6",children:D.map(t=>/* @__PURE__ */l(L,{to:N.FOLDER_EVENTS(String(t?._id)),children:/* @__PURE__ */l(vt,{folder:t},String(t._id))},String(t?._id)))}),"map"!==E&&(tt?.length??0)<=0&&/* @__PURE__ */l("div",{className:"min-h-[80vh]",children:/* @__PURE__ */l(X,{title:((g??[]).length??0)>0?"Empty Folder":"No Events",description:((g??[]).length??0)>0?"Browse other folders for events":"Check back later for our awesome events!",className:"mt-24 md:mt-36",iconSvg:/* @__PURE__ */l(K,{})})}),"map"===E&&C?/* @__PURE__ */l(s,{fallback:/* @__PURE__ */l(Z,{className:"mt-4 h-[70vh] w-full rounded-lg"}),children:/* @__PURE__ */l(Ft,{events:O??[],isLoading:R})}):(tt?.length??0)>0&&/* @__PURE__ */l(d,{children:[
35
35
  /* @__PURE__ */l("div",{className:"mt-4 grid grid-cols-1 gap-4 gap-y-6 pb-16 sm:grid-cols-2 lg:grid-cols-3",children:(tt??[]).map(t=>/* @__PURE__ */l(L,{to:N.GALLERY(String(t.slug)),onMouseEnter:$t,onFocus:$t,onTouchStart:$t,children:/* @__PURE__ */l(ht,{event:t})},t._id))}),
36
- /* @__PURE__ */l("div",{ref:rt,className:"h-px w-full"}),J&&/* @__PURE__ */l("div",{className:"mb-6 flex w-full justify-center",children:/* @__PURE__ */l(Q,{})})]})]})]}),/* @__PURE__ */l(W,{})]})},Ht=()=>/* @__PURE__ */l("div",{className:"text-primary flex animate-pulse items-center gap-2",role:"status","aria-label":"Loading Qrati",children:[/* @__PURE__ */l("svg",{viewBox:"0 0 32 32",className:"size-12","aria-hidden":"true",children:[/* @__PURE__ */l("circle",{cx:"16",cy:"16",r:"12",fill:"currentColor",opacity:"0.15"}),/* @__PURE__ */l("path",{d:"M16 7a9 9 0 1 0 6.36 15.36L25 25",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-width":"3"})]}),/* @__PURE__ */l("span",{className:"text-2xl font-semibold tracking-tight",children:"Qrati"})]}),Qt=o(()=>import("./BwHTzCpH.js")),Xt=o(()=>import("./B7bKBLKV2.js")),Zt=o(()=>import("./Ci9PI8hK2.js")),Wt=o(()=>import("./Ba8sCyeC2.js")),Kt=o(()=>import("./CcyeEIVb2.js")),Jt=o(()=>import("./Cz6OP78x2.js")),tr=o(()=>import("./7fZbqbYO2.js")),rr=o(()=>import("./Cyknlxbq.js")),ar=o(()=>import("./BF7pLcqs.js")),or=o(()=>import("./CfszNu_Q.js")),er=()=>/* @__PURE__ */l("div",{className:"flex h-screen w-screen items-center justify-center",children:/* @__PURE__ */l(Ht,{})}),ir=({router:t="memory"})=>{const r="hash"===t.toLowerCase()?"hash":"memory";return a(()=>{const t=()=>{import("./Ci9PI8hK2.js").catch(()=>{}),import("./BGo2VsHN2.js").catch(()=>{}),import("./Ba8sCyeC2.js").catch(()=>{}),import("./BF7pLcqs.js").catch(()=>{}),import("./Cz6OP78x2.js").catch(()=>{})};if("undefined"!=typeof requestIdleCallback){const r=requestIdleCallback(t,{timeout:5e3});return()=>cancelIdleCallback(r)}const r=setTimeout(t,2e3);return()=>clearTimeout(r)},[]),/* @__PURE__ */l(E,{mode:r,children:[/* @__PURE__ */l(gt,{}),/* @__PURE__ */l(s,{fallback:/* @__PURE__ */l(er,{}),children:/* @__PURE__ */l(M,{children:[
36
+ /* @__PURE__ */l("div",{ref:rt,className:"h-px w-full"}),J&&/* @__PURE__ */l("div",{className:"mb-6 flex w-full justify-center",children:/* @__PURE__ */l(Q,{})})]})]})]}),/* @__PURE__ */l(W,{})]})},Ht=()=>/* @__PURE__ */l("div",{className:"text-primary flex animate-pulse items-center gap-2",role:"status","aria-label":"Loading Qrati",children:[/* @__PURE__ */l("svg",{viewBox:"0 0 32 32",className:"size-12","aria-hidden":"true",children:[/* @__PURE__ */l("circle",{cx:"16",cy:"16",r:"12",fill:"currentColor",opacity:"0.15"}),/* @__PURE__ */l("path",{d:"M16 7a9 9 0 1 0 6.36 15.36L25 25",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-width":"3"})]}),/* @__PURE__ */l("span",{className:"text-2xl font-semibold tracking-tight",children:"Qrati"})]}),Qt=o(()=>import("./D54cshAo.js")),Xt=o(()=>import("./tbcqJrU_2.js")),Zt=o(()=>import("./CYGIt75r2.js")),Wt=o(()=>import("./BaYMN8qa2.js")),Kt=o(()=>import("./DWwbkxCM2.js")),Jt=o(()=>import("./xPoQq2aN2.js")),tr=o(()=>import("./CFRIlHtK2.js")),rr=o(()=>import("./DTPNRhMK.js")),ar=o(()=>import("./V_pvG6Pc.js")),or=o(()=>import("./CV7KmbT-.js")),er=()=>/* @__PURE__ */l("div",{className:"flex h-screen w-screen items-center justify-center",children:/* @__PURE__ */l(Ht,{})}),ir=({router:t="memory"})=>{const r="hash"===t.toLowerCase()?"hash":"memory";return a(()=>{const t=()=>{import("./CYGIt75r2.js").catch(()=>{}),import("./Cj_TL6Ks2.js").catch(()=>{}),import("./BaYMN8qa2.js").catch(()=>{}),import("./V_pvG6Pc.js").catch(()=>{}),import("./xPoQq2aN2.js").catch(()=>{})};if("undefined"!=typeof requestIdleCallback){const r=requestIdleCallback(t,{timeout:5e3});return()=>cancelIdleCallback(r)}const r=setTimeout(t,2e3);return()=>clearTimeout(r)},[]),/* @__PURE__ */l(E,{mode:r,children:[/* @__PURE__ */l(gt,{}),/* @__PURE__ */l(s,{fallback:/* @__PURE__ */l(er,{}),children:/* @__PURE__ */l(M,{children:[
37
37
  /* @__PURE__ */l(C,{path:"/my-uploads",element:or}),
38
38
  /* @__PURE__ */l(C,{path:"/:folderId?",element:Gt}),
39
39
  /* @__PURE__ */l(C,{path:"/event/:eventSlug",element:Xt,children:[
@@ -1,4 +1,4 @@
1
- import{t as e,v as r}from"./BXMw4kNf.js";import{i as a,l as t,n as l}from"./CdivXyOP.js";import{t as i}from"./DmpmrPE5.js";import{f as o,i as n,x as s}from"./Bb9ydqSB.js";import{d,n as c}from"./BK_hWmGs.js";import{t as m}from"./cBUXG_uS.js";import{t as g}from"./ydzHqf5r.js";import{t as h}from"./BxQf2Aj9.js";import{n as f}from"./JY9kGm742.js";import{t as b}from"./DLHvSz1a2.js";import{t as p}from"./fQmLbYcp2.js";import{t as x}from"./DMnbtDXS2.js";function u({className:r}){/* @__PURE__ */
1
+ import{t as e,v as r}from"./BXMw4kNf.js";import{i as a,l as t,n as l}from"./Dpwx5KMy.js";import{t as i}from"./DmpmrPE5.js";import{f as o,i as n,x as s}from"./Bb9ydqSB.js";import{d,n as c}from"./Z3MoLpu5.js";import{t as m}from"./BszsxRY6.js";import{t as g}from"./5r_0x4aK.js";import{t as h}from"./Bvc6t1Gu.js";import{n as f}from"./JY9kGm742.js";import{t as b}from"./Te9ieH1R2.js";import{t as p}from"./fQmLbYcp2.js";import{t as x}from"./DMnbtDXS2.js";function u({className:r}){/* @__PURE__ */
2
2
  return e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 256",className:r,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */e("path",{fill:"currentColor",d:"M128 24a104 104 0 1 0 104 104A104.11 104.11 0 0 0 128 24m12 152a8 8 0 0 1-16 0V95l-11.56 7.71a8 8 0 1 1-8.88-13.32l24-16A8 8 0 0 1 140 80Z"})})}function v({className:r}){/* @__PURE__ */
3
3
  return e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 256",className:r,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */e("path",{fill:"currentColor",d:"M128 24a104 104 0 1 0 104 104A104.11 104.11 0 0 0 128 24m-4 164a35.7 35.7 0 0 1-25.71-10.81A8 8 0 1 1 109.71 166A20 20 0 1 0 124 132a8 8 0 0 1-6.55-12.59L136.63 92H104a8 8 0 0 1 0-16h48a8 8 0 0 1 6.55 12.59l-21 30A36 36 0 0 1 124 188"})})}function N({className:r}){/* @__PURE__ */
4
4
  return e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 256",className:r,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */e("path",{fill:"currentColor",d:"M128 24a104 104 0 1 0 104 104A104.11 104.11 0 0 0 128 24m24 144a8 8 0 0 1 0 16h-48a8 8 0 0 1-6.4-12.8l43.17-57.56a16 16 0 1 0-27.86-15a8 8 0 0 1-15.09-5.34a32 32 0 1 1 55.74 29.93L120 168Z"})})}var w=e=>{if(!e)return"";const r=e.trim().split(/\s+/);return 1===r.length?r[0]:`${r[0]} ${r[1]?.[0]?`${r[1][0]}.`:""}`},y={first:{size:"size-28",imageSize:"size-24",borderColor:"border-amber-400",gradient:"from-amber-400/20 via-yellow-300/10 to-transparent"},second:{size:"size-20",imageSize:"size-16",borderColor:"border-slate-400",gradient:"from-slate-400/20 via-slate-300/10 to-transparent"},third:{size:"size-20",imageSize:"size-16",borderColor:"border-amber-600",gradient:"from-amber-600/20 via-amber-500/10 to-transparent"}},j=(e,r)=>{const a=void 0===e.totalPoint?e.maxScore:e.totalPoint;return void 0===a?"—":a.toFixed(r?2:0)},z=({entry:t,position:l,showFloatingPoint:i,hidePictures:o})=>{const n=1===l?y.first:2===l?y.second:y.third,s={1:u,2:N,3:v}[l],d={1:{bg:"bg-amber-400",border:"border-amber-600",text:"text-amber-900"},2:{bg:"bg-slate-300",border:"border-slate-500",text:"text-slate-700"},3:{bg:"bg-amber-600",border:"border-amber-800",text:"text-amber-100"}},c=r(e=>{e.currentTarget.style.display="none"},[]);/* @__PURE__ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qratilabs/qrati-connect",
3
- "version": "2.31.1",
3
+ "version": "2.31.2",
4
4
  "description": "Qrati Connect - Preact-based embeddable SDK with React wrapper",
5
5
  "author": "Qrati Labs",
6
6
  "license": "UNLICENSED",