@qratilabs/qrati-connect 2.31.2 → 2.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/element/704flhtG2.js +3 -0
- package/element/B4vKIcyS.js +2 -0
- package/element/{DMnbtDXS2.js → B5343djA.js} +1 -1
- package/element/BDe40W9d.js +16 -0
- package/element/{D1eaRhKY2.js → BE8OExtb.js} +3 -3
- package/element/BEljxaTQ2.js +1 -0
- package/element/BGkRue2Y2.js +14 -0
- package/element/BNljt5mO.js +4 -0
- package/element/BOJyFCIG.js +5 -0
- package/element/{BWjYmdOz2.js → BPGLsT1I.js} +7 -7
- package/element/{BNaRcekR2.js → BSdyruRZ.js} +1 -1
- package/element/BTWlllUg.js +2 -0
- package/element/BTduHo9u.js +199 -0
- package/element/{fQmLbYcp2.js → BfwZT31v.js} +1 -1
- package/element/BhoJSelw.js +2 -0
- package/element/{BaYMN8qa2.js → Bl8aWOla.js} +93 -93
- package/element/BtutZVbU.js +1 -0
- package/element/Bu-K2ipV.js +1 -0
- package/element/ByZt8Ha92.js +4 -0
- package/element/C41v7XyB.js +8 -0
- package/element/CKRLHPry.js +32 -0
- package/element/CMowDGuy2.js +8 -0
- package/element/{D2-DJv4T2.js → CV_RNBLv2.js} +1 -1
- package/element/CgFrSWMh.js +3 -0
- package/element/CkdxwEVw2.js +17 -0
- package/element/D-2JtKSL2.js +3 -0
- package/element/D0IYqyql.js +1 -0
- package/element/{7IEzYICH2.js → D7LeFN00.js} +24 -24
- package/element/DChfs6i_.js +2 -0
- package/element/DE9tQHM5.js +36 -0
- package/element/{V_pvG6Pc.js → DSORGFbF2.js} +85 -85
- package/element/D_F9CJK92.js +4 -0
- package/element/Da21-kaH2.js +5 -0
- package/element/{BXUp7Zp4.js → DdtKpY372.js} +7 -7
- package/element/DgX9Hgrs.js +1 -0
- package/element/Dip0ObTA2.js +8 -0
- package/element/{Ot24jlyb2.js → DqB6Xl6G.js} +1 -1
- package/element/RnyYX1t12.js +8 -0
- package/element/ZJzxZBJ5.js +2 -0
- package/element/lFDEfCSm.js +1 -0
- package/element/web.es.js +1 -48
- package/embed/embed.js +1 -1
- package/package.json +2 -2
- package/element/5r_0x4aK.js +0 -3
- package/element/ASQv5Ahv.js +0 -4
- package/element/BCmdnJKF.js +0 -1
- package/element/BOs_rBYA.js +0 -2
- package/element/BWKUiudT.js +0 -2
- package/element/BXMw4kNf.js +0 -1
- package/element/BYM2GyVF2.js +0 -1
- package/element/B_SYJsyF2.js +0 -3
- package/element/Bb9ydqSB.js +0 -1
- package/element/Bc-phiG6.js +0 -4
- package/element/BkIDQGIs.js +0 -1
- package/element/Bki5T_lb.js +0 -1
- package/element/BpAijsfn.js +0 -3
- package/element/Bq48A0Iv.js +0 -1
- package/element/BszsxRY6.js +0 -1
- package/element/Bvc6t1Gu.js +0 -1
- package/element/BxZobjC-.js +0 -2
- package/element/C0eP2utz.js +0 -2
- package/element/C2WFktw12.js +0 -3
- package/element/CDSgxlAB.js +0 -1
- package/element/CFRIlHtK2.js +0 -5
- package/element/CHYm7f-K2.js +0 -2
- package/element/CIcQE2CN2.js +0 -1
- package/element/CJ_l5BYI.js +0 -1
- package/element/CNyy8GGA.js +0 -7
- package/element/CQJ3AK1w.js +0 -1
- package/element/CTikdrXC.js +0 -80
- package/element/CV7KmbT-.js +0 -17
- package/element/CYGIt75r2.js +0 -39
- package/element/Cj_TL6Ks2.js +0 -36
- package/element/CkBayeWW.js +0 -11
- package/element/D54cshAo.js +0 -8
- package/element/D5Ja4Yts.js +0 -1
- package/element/DJMlQk40.js +0 -8
- package/element/DTPNRhMK.js +0 -8
- package/element/DWwbkxCM2.js +0 -16
- package/element/DXjc6xIy.js +0 -2
- package/element/DeK1vU3V2.js +0 -1
- package/element/Dl6jcv9I.js +0 -5
- package/element/DmpmrPE5.js +0 -1
- package/element/Do4y0nPe.js +0 -1
- package/element/Dpwx5KMy.js +0 -41
- package/element/Dstt_bTH.js +0 -2
- package/element/JY9kGm742.js +0 -2
- package/element/L4hWU3Nc.js +0 -1
- package/element/Te9ieH1R2.js +0 -1
- package/element/Z3MoLpu5.js +0 -5
- package/element/a_rT1I0D.js +0 -8
- package/element/erXAfWWY.js +0 -3
- package/element/rlutojb0.js +0 -1
- package/element/tbcqJrU_2.js +0 -9
- package/element/xPoQq2aN2.js +0 -14
- /package/element/{1dmOpMwn2.js → 1dmOpMwn.js} +0 -0
- /package/element/{BUDCYszs.js → BUDCYszs2.js} +0 -0
- /package/element/{Bo39kG4k2.js → Bo39kG4k.js} +0 -0
- /package/element/{CfMNBPpx.js → CfMNBPpx2.js} +0 -0
- /package/element/{CtxIOzTC2.js → CtxIOzTC.js} +0 -0
- /package/element/{DnIueBGr.js → DnIueBGr2.js} +0 -0
package/element/Dpwx5KMy.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import{E as e,_ as t,h as r,p as n,r as i,s,t as o,v as a,y as c}from"./BXMw4kNf.js";import{n as l,t as u}from"./DmpmrPE5.js";import{S as h,h as d,i as f}from"./Bb9ydqSB.js";var p=class{constructor(){this.listeners=/* @__PURE__ */new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},m=new class extends p{#e;#t;#r;constructor(){super(),this.#r=e=>{if("undefined"!=typeof window&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#e?this.#e:"hidden"!==globalThis.document?.visibilityState}},g={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},y=new class{#n=g;#i=!1;setTimeoutProvider(e){this.#n=e}setTimeout(e,t){return this.#n.setTimeout(e,t)}clearTimeout(e){this.#n.clearTimeout(e)}setInterval(e,t){return this.#n.setInterval(e,t)}clearInterval(e){this.#n.clearInterval(e)}},v="undefined"==typeof window||"Deno"in globalThis;function w(){}function b(e,t){return"function"==typeof e?e(t):e}function S(e){return"number"==typeof e&&e>=0&&e!==1/0}function R(e,t){return Math.max(e+(t||0)-Date.now(),0)}function I(e,t){return"function"==typeof e?e(t):e}function O(e,t){return"function"==typeof e?e(t):e}function T(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o)if(n){if(t.queryHash!==k(o,t.options))return!1}else if(!A(t.queryKey,o))return!1;if("all"!==r){const e=t.isActive();if("active"===r&&!e)return!1;if("inactive"===r&&e)return!1}return!("boolean"==typeof a&&t.isStale()!==a||i&&i!==t.state.fetchStatus||s&&!s(t))}function C(e,t){const{exact:r,status:n,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(r){if(E(t.options.mutationKey)!==E(s))return!1}else if(!A(t.options.mutationKey,s))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function k(e,t){return(t?.queryKeyHashFn||E)(e)}function E(e){return JSON.stringify(e,(e,t)=>M(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function A(e,t){return e===t||typeof e==typeof t&&!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(r=>A(e[r],t[r]))}var x=Object.prototype.hasOwnProperty;function F(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=D(e)&&D(t);if(!(n||M(e)&&M(t)))return t;const i=(n?e:Object.keys(e)).length,s=n?t:Object.keys(t),o=s.length,a=n?new Array(o):{};let c=0;for(let l=0;l<o;l++){const o=n?l:s[l],u=e[o],h=t[o];if(u===h){a[o]=u,(n?l<i:x.call(e,o))&&c++;continue}if(null===u||null===h||"object"!=typeof u||"object"!=typeof h){a[o]=h;continue}const d=F(u,h,r+1);a[o]=d,d===u&&c++}return i===o&&c===i?e:a}function P(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function D(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function M(e){if(!q(e))return!1;const t=e.constructor;if(void 0===t)return!0;const r=t.prototype;return!!q(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function q(e){return"[object Object]"===Object.prototype.toString.call(e)}function U(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?F(e,t):t}function Q(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function L(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var j=/* @__PURE__ */Symbol();function _(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==j?e.queryFn:()=>Promise.reject(/* @__PURE__ */new Error(`Missing queryFn: '${e.queryHash}'`))}function z(e,t){return"function"==typeof e?e(...t):!!e}var N=/* @__PURE__ */(()=>{let e=()=>v;return{isServer:()=>e(),setIsServer(t){e=t}}})();function $(){let e,t;const r=new Promise((r,n)=>{e=r,t=n});function n(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{n({status:"fulfilled",value:t}),e(t)},r.reject=e=>{n({status:"rejected",reason:e}),t(e)},r}var H=function(e){setTimeout(e,0)},V=function(){let e=[],t=0,r=e=>{e()},n=e=>{e()},i=H;const s=n=>{t?e.push(n):i(()=>{r(n)})};return{batch:s=>{let o;t++;try{o=s()}finally{t--,t||(()=>{const t=e;e=[],t.length&&i(()=>{n(()=>{t.forEach(e=>{r(e)})})})})()}return o},batchCalls:e=>(...t)=>{s(()=>{e(...t)})},schedule:s,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{n=e},setScheduler:e=>{i=e}}}(),W=new class extends p{#s=!0;#t;#r;constructor(){super(),this.#r=e=>{if("undefined"!=typeof window&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#s!==e&&(this.#s=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#s}};function G(e){return Math.min(1e3*2**e,3e4)}function Z(e){return"online"!==(e??"online")||W.isOnline()}var B=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function K(e){let t,r=!1,n=0;const i=$(),s=()=>"pending"!==i.status,o=()=>m.isFocused()&&("always"===e.networkMode||W.isOnline())&&e.canRun(),a=()=>Z(e.networkMode)&&e.canRun(),c=e=>{s()||(t?.(),i.resolve(e))},l=e=>{s()||(t?.(),i.reject(e))},u=()=>new Promise(r=>{t=e=>{(s()||o())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,s()||e.onContinue?.()}),h=()=>{if(s())return;let t;const i=0===n?e.initialPromise:void 0;try{t=i??e.fn()}catch(a){t=Promise.reject(a)}Promise.resolve(t).then(c).catch(t=>{if(s())return;const i=e.retry??(N.isServer()?0:3),a=e.retryDelay??G,c="function"==typeof a?a(n,t):a,d=!0===i||"number"==typeof i&&n<i||"function"==typeof i&&i(n,t);var f;!r&&d?(n++,e.onFail?.(n,t),(f=c,new Promise(e=>{y.setTimeout(e,f)})).then(()=>o()?void 0:u()).then(()=>{r?l(t):h()})):l(t)})};return{promise:i,status:()=>i.status,cancel:t=>{if(!s()){const r=new B(t);l(r),e.onCancel?.(r)}},continue:()=>(t?.(),i),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:a,start:()=>(a()?h():u().then(h),i)}}var J=class{#o;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),S(this.gcTime)&&(this.#o=y.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(N.isServer()?1/0:3e5))}clearGcTimeout(){void 0!==this.#o&&(y.clearTimeout(this.#o),this.#o=void 0)}};function Y(e){return{onFetch:(t,r)=>{const n=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const l=async()=>{let r=!1;const l=e=>{!function(e,r,n){let i,s=!1;Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t.signal,s||(s=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)})}(e,0,()=>r=!0)},u=_(t.options,t.fetchOptions),h=async(e,n,i)=>{if(r)return Promise.reject(t.signal.reason);if(null==n&&e.pages.length)return Promise.resolve(e);const s=(()=>{const e={client:t.client,queryKey:t.queryKey,pageParam:n,direction:i?"backward":"forward",meta:t.options.meta};return l(e),e})(),o=await u(s),{maxPages:a}=t.options,c=i?L:Q;return{pages:c(e.pages,o,a),pageParams:c(e.pageParams,n,a)}};if(i&&s.length){const e="backward"===i,t=e?ee:X,r={pages:s,pageParams:o};a=await h(r,t(n,r),e)}else{const t=e??s.length;do{const e=0===c?o[0]??n.initialPageParam:X(n,a);if(c>0&&null==e)break;a=await h(a,e),c++}while(c<t)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=l}}}function X(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function ee(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}function te(e,t){return!!t&&null!=X(e,t)}function re(e,t){return!(!t||!e.getPreviousPageParam)&&null!=ee(e,t)}var ne=class extends J{#a;#c;#l;#u;#h;#d;#f;#p;constructor(e){super(),this.#p=!1,this.#f=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#h=e.client,this.#u=this.#h.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#c=oe(this.options),this.state=e.state??this.#c,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#a}get promise(){return this.#d?.promise}setOptions(e){if(this.options={...this.#f,...e},e?._type&&(this.#a=e._type),this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const e=oe(this.options);void 0!==e.data&&(this.setState(se(e.data,e.dataUpdatedAt)),this.#c=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(e,t){const r=U(this.state.data,e,this.options);return this.#m({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e){this.#m({type:"setState",state:e})}cancel(e){const t=this.#d?.promise;return this.#d?.cancel(e),t?t.then(w).catch(w):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#c}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>!1!==O(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===j||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===I(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!R(this.state.dataUpdatedAt,e))}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#d?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#d?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#u.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#d&&(this.#p||this.#g()?this.#d.cancel({revert:!0}):this.#d.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#g(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}invalidate(){this.state.isInvalidated||this.#m({type:"invalidate"})}async fetch(e,t){if("idle"!==this.state.fetchStatus&&"rejected"!==this.#d?.status())if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#d)return this.#d.continueRetry(),this.#d.promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}const r=new AbortController,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#p=!0,r.signal)})},i=()=>{const e=_(this.options,t),r=(()=>{const e={client:this.#h,queryKey:this.queryKey,meta:this.meta};return n(e),e})();return this.#p=!1,this.options.persister?this.options.persister(e,r,this):e(r)},s=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#h,state:this.state,fetchFn:i};return n(e),e})();("infinite"===this.#a?Y(this.options.pages):this.options.behavior)?.onFetch(s,this),this.#l=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===s.fetchOptions?.meta||this.#m({type:"fetch",meta:s.fetchOptions?.meta}),this.#d=K({initialPromise:t?.initialPromise,fn:s.fetchFn,onCancel:e=>{e instanceof B&&e.revert&&this.setState({...this.#l,fetchStatus:"idle"}),r.abort()},onFail:(e,t)=>{this.#m({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#m({type:"pause"})},onContinue:()=>{this.#m({type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0});try{const e=await this.#d.start();if(void 0===e)throw new Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#u.config.onSuccess?.(e,this),this.#u.config.onSettled?.(e,this.state.error,this),e}catch(o){if(o instanceof B){if(o.silent)return this.#d.promise;if(o.revert){if(void 0===this.state.data)throw o;return this.state.data}}throw this.#m({type:"error",error:o}),this.#u.config.onError?.(o,this),this.#u.config.onSettled?.(this.state.data,o,this),o}finally{this.scheduleGc()}}#m(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...ie(t.data,this.options),fetchMeta:e.meta??null};case"success":const r={...t,...se(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=e.manual?r:void 0,r;case"error":const n=e.error;return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),V.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:e})})}};function ie(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Z(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function se(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function oe(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var ae=class extends p{constructor(e,t){super(),this.options=t,this.#h=e,this.#y=null,this.#v=$(),this.bindMethods(),this.setOptions(t)}#h;#w=void 0;#b=void 0;#S=void 0;#R;#I;#v;#y;#O;#T;#C;#k;#E;#A;#x=/* @__PURE__ */new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#w.addObserver(this),ce(this.#w,this.options)?this.#F():this.updateResult(),this.#P())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return le(this.#w,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return le(this.#w,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=/* @__PURE__ */new Set,this.#D(),this.#M(),this.#w.removeObserver(this)}setOptions(e){const t=this.options,r=this.#w;if(this.options=this.#h.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof O(this.options.enabled,this.#w))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#q(),this.#w.setOptions(this.options),t._defaulted&&!P(this.options,t)&&this.#h.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#w,observer:this});const n=this.hasListeners();n&&ue(this.#w,r,this.options,t)&&this.#F(),this.updateResult(),!n||this.#w===r&&O(this.options.enabled,this.#w)===O(t.enabled,this.#w)&&I(this.options.staleTime,this.#w)===I(t.staleTime,this.#w)||this.#U();const i=this.#Q();!n||this.#w===r&&O(this.options.enabled,this.#w)===O(t.enabled,this.#w)&&i===this.#A||this.#L(i)}getOptimisticResult(e){const t=this.#h.getQueryCache().build(this.#h,e),r=this.createResult(t,e);var n;return n=r,P(this.getCurrentResult(),n)||(this.#S=r,this.#I=this.options,this.#R=this.#w.state),r}getCurrentResult(){return this.#S}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#v.status||this.#v.reject(/* @__PURE__ */new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#x.add(e)}getCurrentQuery(){return this.#w}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#h.defaultQueryOptions(e),r=this.#h.getQueryCache().build(this.#h,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#F({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#S))}#F(e){this.#q();let t=this.#w.fetch(this.options,e);return e?.throwOnError||(t=t.catch(w)),t}#U(){this.#D();const e=I(this.options.staleTime,this.#w);if(N.isServer()||this.#S.isStale||!S(e))return;const t=R(this.#S.dataUpdatedAt,e)+1;this.#k=y.setTimeout(()=>{this.#S.isStale||this.updateResult()},t)}#Q(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#w):this.options.refetchInterval)??!1}#L(e){this.#M(),this.#A=e,!N.isServer()&&!1!==O(this.options.enabled,this.#w)&&S(this.#A)&&0!==this.#A&&(this.#E=y.setInterval(()=>{(this.options.refetchIntervalInBackground||m.isFocused())&&this.#F()},this.#A))}#P(){this.#U(),this.#L(this.#Q())}#D(){void 0!==this.#k&&(y.clearTimeout(this.#k),this.#k=void 0)}#M(){void 0!==this.#E&&(y.clearInterval(this.#E),this.#E=void 0)}createResult(e,t){const r=this.#w,n=this.options,i=this.#S,s=this.#R,o=this.#I,a=e!==r?e.state:this.#b,{state:c}=e;let l,u={...c},h=!1;if(t._optimisticResults){const i=this.hasListeners(),s=!i&&ce(e,t),o=i&&ue(e,r,t,n);(s||o)&&(u={...u,...ie(c.data,e.options)}),"isRestoring"===t._optimisticResults&&(u.fetchStatus="idle")}let{error:d,errorUpdatedAt:f,status:p}=u;l=u.data;let m=!1;if(void 0!==t.placeholderData&&void 0===l&&"pending"===p){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,m=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#C?.state.data,this.#C):t.placeholderData,void 0!==e&&(p="success",l=U(i?.data,e,t),h=!0)}if(t.select&&void 0!==l&&!m)if(i&&l===s?.data&&t.select===this.#O)l=this.#T;else try{this.#O=t.select,l=t.select(l),l=U(i?.data,l,t),this.#T=l,this.#y=null}catch(R){this.#y=R}this.#y&&(d=this.#y,l=this.#T,f=Date.now(),p="error");const g="fetching"===u.fetchStatus,y="pending"===p,v="error"===p,w=y&&g,b=void 0!==l,S={status:p,fetchStatus:u.fetchStatus,isPending:y,isSuccess:"success"===p,isError:v,isInitialLoading:w,isLoading:w,data:l,dataUpdatedAt:u.dataUpdatedAt,error:d,errorUpdatedAt:f,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:u.dataUpdateCount>a.dataUpdateCount||u.errorUpdateCount>a.errorUpdateCount,isFetching:g,isRefetching:g&&!y,isLoadingError:v&&!b,isPaused:"paused"===u.fetchStatus,isPlaceholderData:h,isRefetchError:v&&b,isStale:he(e,t),refetch:this.refetch,promise:this.#v,isEnabled:!1!==O(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=void 0!==S.data,n="error"===S.status&&!t,i=e=>{n?e.reject(S.error):t&&e.resolve(S.data)},s=()=>{const e=this.#v=S.promise=$();i(e)},o=this.#v;switch(o.status){case"pending":e.queryHash===r.queryHash&&i(o);break;case"fulfilled":(n||S.data!==o.value)&&s();break;case"rejected":n&&S.error===o.reason||s()}}return S}updateResult(){const e=this.#S,t=this.createResult(this.#w,this.options);this.#R=this.#w.state,this.#I=this.options,void 0!==this.#R.data&&(this.#C=this.#w),P(t,e)||(this.#S=t,this.#j({listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#x.size)return!0;const n=new Set(r??this.#x);return this.options.throwOnError&&n.add("error"),Object.keys(this.#S).some(t=>{const r=t;return this.#S[r]!==e[r]&&n.has(r)})})()}))}#q(){const e=this.#h.getQueryCache().build(this.#h,this.options);if(e===this.#w)return;const t=this.#w;this.#w=e,this.#b=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#P()}#j(e){V.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#S)}),this.#h.getQueryCache().notify({query:this.#w,type:"observerResultsUpdated"})})}};function ce(e,t){return function(e,t){return!1!==O(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===O(t.retryOnMount,e))}(e,t)||void 0!==e.state.data&&le(e,t,t.refetchOnMount)}function le(e,t,r){if(!1!==O(t.enabled,e)&&"static"!==I(t.staleTime,e)){const n="function"==typeof r?r(e):r;return"always"===n||!1!==n&&he(e,t)}return!1}function ue(e,t,r,n){return(e!==t||!1===O(n.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&he(e,r)}function he(e,t){return!1!==O(t.enabled,e)&&e.isStaleByTime(I(t.staleTime,e))}var de=e(void 0),fe=e=>{const t=c(de);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},pe=({client:e,children:r})=>(t(()=>(e.mount(),()=>{e.unmount()}),[e]),/* @__PURE__ */o(de.Provider,{value:e,children:r})),me=e(!1);me.Provider;var ge=e(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),ye=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function ve(e,n,s){const o=c(me),l=c(ge),u=fe(s),h=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(h);const d=u.getQueryCache().get(h.queryHash),f=!1!==e.subscribed;h._optimisticResults=o?"isRestoring":f?"optimistic":void 0,(e=>{if(e.suspense){const t=1e3,r=e=>"static"===e?e:Math.max(e??t,t),n=e.staleTime;e.staleTime="function"==typeof n?(...e)=>r(n(...e)):r(n),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,t))}})(h),((e,t,r)=>{const n=r?.state.error&&"function"==typeof e.throwOnError?z(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))})(h,l,d),(e=>{t(()=>{e.clearReset()},[e])})(l);const p=!u.getQueryCache().get(h.queryHash),[m]=r(()=>new n(u,h)),g=m.getOptimisticResult(h),y=!o&&f;if(i(a(e=>{const t=y?m.subscribe(V.batchCalls(e)):w;return m.updateResult(),t},[m,y]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),t(()=>{m.setOptions(h)},[h,m]),((e,t)=>e?.suspense&&t.isPending)(h,g))throw ye(h,m,l);if((({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(i&&void 0===e.data||z(r,[e.error,n])))({result:g,errorResetBoundary:l,throwOnError:h.throwOnError,query:d,suspense:h.suspense}))throw g.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(h,g),h.experimental_prefetchInRender&&!N.isServer()&&((e,t)=>e.isLoading&&e.isFetching&&!t)(g,o)&&(p?ye(h,m,l):d?.promise)?.catch(w).finally(()=>{m.updateResult()}),h.notifyOnChangeProps?g:m.trackResult(g)}function we(e,t){return ve(e,ae,t)}var be=null;function Se(e){be=e}function Re(e){try{const t=JSON.stringify(e);fetch(f.REPORT_ERROR,{method:"POST",headers:{"Content-Type":"application/json",...be?{"x-org-id":be}:{}},body:t,keepalive:!0}).catch(()=>{})}catch{}}function Ie(e,t){Re({message:e instanceof Error?e.message:String(e),stack:e instanceof Error?e.stack:void 0,level:t?.level??"error",component:t?.component,tags:t?.tags,context:t?.extra,url:"undefined"!=typeof window?window.location.href:void 0,userAgent:"undefined"!=typeof navigator?navigator.userAgent:void 0})}function Oe(e,t="info",r){Re({message:e,level:t,component:r?.component,tags:r?.tags,context:r?.extra,url:"undefined"!=typeof window?window.location.href:void 0,userAgent:"undefined"!=typeof navigator?navigator.userAgent:void 0})}function Te({title:e,children:t}){/* @__PURE__ */
|
|
2
|
-
return o("div",{className:"mx-auto mt-24 w-fit max-w-xl space-y-8",children:[/* @__PURE__ */o("svg",{xmlns:"http://www.w3.org/2000/svg",className:"mx-auto h-64 w-fit text-[#ff4800]",width:"800",height:"469.317",viewBox:"0 0 800 469.317",role:"img","aria-label":"Error illustration",children:/* @__PURE__ */o("g",{transform:"translate(-443.142 -257.876)",children:[
|
|
3
|
-
/* @__PURE__ */o("path",{d:"M898.247,664.1H371.155a30.276,30.276,0,0,1-30.241-30.241V352.525a30.276,30.276,0,0,1,30.241-30.241H898.247a30.276,30.276,0,0,1,30.241,30.241V633.862A30.276,30.276,0,0,1,898.247,664.1Z",transform:"translate(308.867 25.517)",fill:"#fff"}),
|
|
4
|
-
/* @__PURE__ */o("path",{d:"M557.334,341.82H30.241A30.276,30.276,0,0,1,0,311.578V30.241A30.276,30.276,0,0,1,30.241,0H557.334a30.276,30.276,0,0,1,30.241,30.241V311.578A30.276,30.276,0,0,1,557.334,341.82ZM30.241,1.833A28.441,28.441,0,0,0,1.833,30.241V311.578a28.441,28.441,0,0,0,28.409,28.409H557.334a28.441,28.441,0,0,0,28.409-28.409V30.241A28.441,28.441,0,0,0,557.334,1.833Z",transform:"matrix(0.999, -0.035, 0.035, 0.999, 643.995, 358.158)",fill:"#d6d6e3"}),
|
|
5
|
-
/* @__PURE__ */o("path",{d:"M754.171,630.2l-509.5-135.058a30.276,30.276,0,0,1-21.483-36.981L295.28,186.212a30.276,30.276,0,0,1,36.981-21.483l509.5,135.058a30.276,30.276,0,0,1,21.483,36.981L791.152,608.712A30.276,30.276,0,0,1,754.171,630.2Z",transform:"translate(220.958 94.156)",fill:"#f2f2f2"}),
|
|
6
|
-
/* @__PURE__ */o("path",{d:"M775.247,705.1H248.155a30.276,30.276,0,0,1-30.241-30.241V393.525a30.276,30.276,0,0,1,30.241-30.241H775.247a30.276,30.276,0,0,1,30.241,30.242V674.862A30.275,30.275,0,0,1,775.247,705.1Z",transform:"translate(319.149 22.09)",fill:"#fff"}),
|
|
7
|
-
/* @__PURE__ */o("path",{d:"M638.653,701.841H298.272c-.426,0-.852-.009-1.272-.033l160.985-90.663c3.065-1.762,9.943-2.382,15.361-1.385a13.912,13.912,0,0,1,4.26,1.385l108.041,60.842,5.176,2.911Z",transform:"translate(312.538 1.526)",fill:"#e6e6e6"}),
|
|
8
|
-
/* @__PURE__ */o("path",{d:"M760.145,704.279h-294.4l57.049-26.943L526.9,675.4l74.341-35.111c4.874-2.3,16.6-2.445,22.328-.434q.577.206,1.071.434Z",transform:"translate(298.432 -0.912)",fill:"#e6e6e6"}),
|
|
9
|
-
/* @__PURE__ */o("path",{d:"M248.322,365.284a28.441,28.441,0,0,0-28.409,28.409V675.03a28.441,28.441,0,0,0,28.409,28.409H775.415a28.441,28.441,0,0,0,28.409-28.409V393.693a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(318.982 21.923)",fill:"#3f3d56"}),
|
|
10
|
-
/* @__PURE__ */o("path",{d:"M777.254,685.116H250.161a8.257,8.257,0,0,1-8.248-8.248V395.532a8.257,8.257,0,0,1,8.248-8.248H777.254a8.257,8.257,0,0,1,8.248,8.248V676.869a8.257,8.257,0,0,1-8.248,8.248Zm-527.092-296a6.422,6.422,0,0,0-6.415,6.415V676.869a6.422,6.422,0,0,0,6.415,6.415H777.254a6.422,6.422,0,0,0,6.415-6.415V395.532a6.422,6.422,0,0,0-6.415-6.415Z",transform:"translate(317.143 20.083)",fill:"#ccc"}),
|
|
11
|
-
/* @__PURE__ */o("ellipse",{cx:"71.849",cy:"89.934",rx:"71.849",ry:"89.934",transform:"translate(928.82 428.806)",fill:"#f2f2f2"}),
|
|
12
|
-
/* @__PURE__ */o("path",{d:"M505.77,325.365h.2l3.553,203.7h-7.5Z",transform:"translate(495.097 175.29)",fill:"#ccc"}),
|
|
13
|
-
/* @__PURE__ */o("path",{d:"M736.239,636.154h0a1.776,1.776,0,0,1-.744,2.4l-10.3,5.425-1.655-3.144,10.3-5.425A1.776,1.776,0,0,1,736.239,636.154Z",transform:"translate(276.882 -0.641)",fill:"#ccc"}),
|
|
14
|
-
/* @__PURE__ */o("ellipse",{cx:"71.849",cy:"89.934",rx:"71.849",ry:"89.934",transform:"translate(722.256 428.806)",fill:"#f2f2f2"}),
|
|
15
|
-
/* @__PURE__ */o("path",{d:"M510.532,627.307h0a1.777,1.777,0,0,0-2.4-.744l-7.194,3.788-2.464-141.27h-.2l-3.75,203.7h7.5l-1.02-58.456,8.78-4.622A1.777,1.777,0,0,0,510.532,627.307Z",transform:"translate(296.026 11.574)",fill:"#ccc"}),
|
|
16
|
-
/* @__PURE__ */o("path",{d:"M626.318,603.854a2.25,2.25,0,0,0-3.04-.943l-9.116,4.8-3.122-179h-.25l-4.752,258.115h9.5l-1.292-74.07,11.125-5.857a2.251,2.251,0,0,0,.943-3.04Z",transform:"translate(286.704 16.621)",fill:"#3f3d56"}),
|
|
17
|
-
/* @__PURE__ */o("path",{d:"M777.247,703.1H250.155a30.276,30.276,0,0,1-30.241-30.241V391.525a30.276,30.276,0,0,1,30.241-30.241H777.247a30.276,30.276,0,0,1,30.241,30.241V672.862A30.276,30.276,0,0,1,777.247,703.1Z",transform:"translate(318.982 22.257)",fill:"#fff"}),
|
|
18
|
-
/* @__PURE__ */o("path",{d:"M671.188,708.113h-370.8c-.464,0-.928-.01-1.386-.036l175.372-98.766c3.339-1.919,10.831-2.595,16.734-1.509a15.16,15.16,0,0,1,4.641,1.509l117.7,66.28,5.639,3.172Z",transform:"translate(288.046 16.168)",fill:"#f2f2f2"}),
|
|
19
|
-
/* @__PURE__ */o("path",{d:"M788.457,708.163H467.743l62.148-29.351,4.472-2.114,80.984-38.25c5.309-2.507,18.082-2.663,24.324-.473q.629.224,1.166.473Z",transform:"translate(287.761 16.118)",fill:"#f2f2f2"}),
|
|
20
|
-
/* @__PURE__ */o("path",{d:"M777.247,703.1H250.155a30.276,30.276,0,0,1-30.241-30.241V391.525a30.276,30.276,0,0,1,30.241-30.241H777.247a30.276,30.276,0,0,1,30.241,30.241V672.862A30.276,30.276,0,0,1,777.247,703.1ZM250.155,363.117a28.441,28.441,0,0,0-28.409,28.409V672.862a28.441,28.441,0,0,0,28.409,28.409H777.247a28.441,28.441,0,0,0,28.409-28.409V391.525a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(318.982 22.257)",fill:"#3f3d56"}),
|
|
21
|
-
/* @__PURE__ */o("g",{transform:"translate(696.754 297.373)",children:[
|
|
22
|
-
/* @__PURE__ */o("ellipse",{cx:"61.798",cy:"61.798",rx:"61.798",ry:"61.798",transform:"translate(215.662 36.955)",fill:"#ff6584"}),
|
|
23
|
-
/* @__PURE__ */o("ellipse",{cx:"78.271",cy:"97.971",rx:"78.271",ry:"97.971",transform:"translate(225.025 127.808)",fill:"#e6e6e6"}),
|
|
24
|
-
/* @__PURE__ */o("path",{d:"M508.105,323.365h.215l3.87,221.909h-8.171Z",transform:"translate(-204.593 -117.286)",fill:"#ccc"}),
|
|
25
|
-
/* @__PURE__ */o("path",{d:"M739.374,634.239h0a1.935,1.935,0,0,1-.811,2.614l-11.226,5.91-1.8-3.425,11.226-5.91A1.935,1.935,0,0,1,739.374,634.239Z",transform:"translate(-422.513 -281.249)",fill:"#ccc"}),
|
|
26
|
-
/* @__PURE__ */o("ellipse",{cx:"78.271",cy:"97.971",rx:"78.271",ry:"97.971",transform:"translate(0 127.808)",fill:"#e6e6e6"}),
|
|
27
|
-
/* @__PURE__ */o("path",{d:"M513.962,637.661h0a1.936,1.936,0,0,0-2.614-.811l-7.837,4.126-2.684-153.9h-.215l-4.085,221.91H504.7l-1.111-63.68,9.565-5.036A1.936,1.936,0,0,0,513.962,637.661Z",transform:"translate(-422.126 -281.002)",fill:"#ccc"}),
|
|
28
|
-
/* @__PURE__ */o("path",{d:"M612.666,280.653c54.774,0,99.294,103.207,99.294,171.768s-44.4,124.14-99.177,124.14-99.177-55.579-99.177-124.14S557.892,280.653,612.666,280.653Z",transform:"translate(-422.155 -280.653)",fill:"currentColor"}),
|
|
29
|
-
/* @__PURE__ */o("path",{d:"M630.131,617.508a2.452,2.452,0,0,0-3.312-1.027l-9.931,5.228-3.4-195h-.272L608.039,707.89h10.353l-1.408-80.69,12.119-6.38A2.452,2.452,0,0,0,630.131,617.508Z",transform:"translate(-422.315 -280.9)",fill:"#3f3d56"})]})]})}),/* @__PURE__ */o("div",{className:"space-y-4",children:[/* @__PURE__ */o("h4",{className:"text-foreground text-center text-lg font-semibold",children:e}),/* @__PURE__ */o("p",{className:"text-muted-foreground text-center",children:t})]})]})}var Ce=({organizationId:e})=>/* @__PURE__ */o("a",{className:"font-medium text-blue-500",href:d.ORGANIZATION_SETTINGS_INTEGRATION(e),target:"_blank",rel:"noreferrer",children:"Guide"});function ke({organizationId:e,errorType:t,errorMessage:r}){/* @__PURE__ */
|
|
30
|
-
return o(Te,"custom-auth-invalid"===t?{title:"Setup needed",children:["Custom auth is enabled. Pass ",
|
|
31
|
-
/* @__PURE__ */o("code",{children:"uid"}),", ",
|
|
32
|
-
/* @__PURE__ */o("code",{children:"fname"}),", and ",
|
|
33
|
-
/* @__PURE__ */o("code",{children:"lname"})," as props to QratiConnect to complete setup. See our ",
|
|
34
|
-
/* @__PURE__ */o(Ce,{organizationId:e})," for details."]}:"service-unavailable"===t?{title:"We'll be right back!",children:["Our service is getting a quick tune-up. Hang tight — great things are coming your way soon! See our"," ",
|
|
35
|
-
/* @__PURE__ */o(Ce,{organizationId:e})," if you need help in the meantime."]}:"generic-error"===t&&r?{title:"Setup needed",children:[r," See our ",
|
|
36
|
-
/* @__PURE__ */o(Ce,{organizationId:e})," for details."]}:"page-not-registered"===t?{title:"Page not registered",children:["Add the current page URL in Allowed URLs under"," ",
|
|
37
|
-
/* @__PURE__ */o("a",{className:"font-medium text-blue-500",href:d.ORGANIZATION_SETTINGS(e),target:"_blank",rel:"noreferrer",children:"Organization Settings"})," ","⇨ Integration Settings. See our ",
|
|
38
|
-
/* @__PURE__ */o(Ce,{organizationId:e})," for details."]}:{title:"Heads up",children:["Something needs attention. See our ",
|
|
39
|
-
/* @__PURE__ */o(Ce,{organizationId:e})," for details or contact Qrati support."]})}var Ee='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',Ae=e=>e.trim().replace(/\s+/g," "),xe=e=>e?.replace(/\/+$/,"")||"",Fe=e=>{if(!e)return Ee;const t=Ae("string"==typeof e?e:e.fontFamily||""),r="string"==typeof e?void 0:e.customFontName;return t&&"system"!==t?"custom"===t?`"${r||"QratiCustomFont"}", ${Ee}`:`"${t}", ${Ee}`:"inherit"};function Pe(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=Pe(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function De(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=Pe(e))&&(n&&(n+=" "),n+=t);return n}var Me=(...e)=>De(e.filter(Boolean)),qe=e=>{const t=e.replace(/#/g,"");return(299*parseInt(t.slice(0,2),16)+587*parseInt(t.slice(2,4),16)+114*parseInt(t.slice(4,6),16))/1e3>=128?"#000000":"#FFFFFF"},Ue="px",Qe=(e,t="light")=>{const r=e?.themeSettings?.colors??{},n=e?.themeSettings?.border,i=e?.themeSettings?.shadow,s=e?.integrationSettings,o="dark"===t,a=(e,t,n,i)=>{const s=o?i:n;return r[o?t:e]||s},c=a("primaryLight","primaryDark","#ff4800","#ff4800");return{"--background":a("backgroundLight","backgroundDark","#fafafa","#0a0a0a"),"--foreground":a("foregroundLight","foregroundDark","#252629","#f5f5f5"),"--muted":a("mutedLight","mutedDark","#e5e5e5","#171717"),"--muted-foreground":a("mutedForegroundLight","mutedForegroundDark","#484848","#b5b8bb"),"--border":a("borderLight","borderDark","#dddddd","#353538"),"--input":a("inputLight","inputDark","#f5f5f5","#171717"),"--primary":c,"--primary-foreground":qe(c),"--popover":a("popoverLight","popoverDark","#f5f5f5","#171717"),"--popover-foreground":a("popoverForegroundLight","popoverForegroundDark","#252629","#fafafa"),"--info":a("infoLight","infoDark","#2563eb","#5b8def"),"--warning":a("warningLight","warningDark","#f59e0b","#fbbf24"),"--success":a("successLight","successDark","#10b981","#34d399"),"--destructive":a("destructiveLight","destructiveDark","#ef4444","#f87171"),"--border-width":`${n?.width??"1"}${n?.unit??"px"}`,"--radius":`${n?.radius??"10"}${n?.unit??"px"}`,"--shadow-outer-horizontal-offset":`${i?.outerHorizontalOffset??"0"}${i?.unit??Ue}`,"--shadow-outer-vertical-offset":`${i?.outerVerticalOffset??"0"}${i?.unit??Ue}`,"--shadow-outer-blur":`${i?.outerBlur??"0"}${i?.unit??Ue}`,"--shadow-outer-spread":`${i?.outerSpread??"0"}${i?.unit??Ue}`,...s?.fontFamily&&"system"!==s.fontFamily?{"--font-family":Fe(s)}:{}}},Le=async e=>{try{return await e()}catch{return null}},je=(e,t=1)=>{const r=(new TextEncoder).encode(e),n=3432918353,i=461845907;let s=t>>>0;const o=Math.floor(r.length/4),a=new DataView(r.buffer,r.byteOffset,r.byteLength);for(let h=0;h<o;h++){let e=a.getUint32(4*h,!0);e=Math.imul(e,n),e=e<<15|e>>>17,e=Math.imul(e,i),s^=e,s=s<<13|s>>>19,s=Math.imul(s,5)+3864292196>>>0}let c=0;const l=4*o,u=3&r.length;return 3===u&&(c^=r[l+2]<<16),u>=2&&(c^=r[l+1]<<8),u>=1&&(c^=r[l],c=Math.imul(c,n),c=c<<15|c>>>17,c=Math.imul(c,i),s^=c),s^=r.length,s^=s>>>16,s=Math.imul(s,2246822507)>>>0,s^=s>>>13,s=Math.imul(s,3266489909)>>>0,s^=s>>>16,s.toString(16).padStart(8,"0")},_e=e=>{if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(_e).join(",")}]`;const t=Object.keys(e).sort(),r=[];for(const n of t){const t=e[n];void 0!==t&&r.push(`${_e(n)}:${_e(t)}`)}return`{${r.join(",")}}`},ze=async({debug:e=!1}={})=>{const t=performance.now(),r=await Le(async()=>{if(!window.navigator.userAgentData||"function"!=typeof window.navigator.userAgentData.getHighEntropyValues)return null;const e=await window.navigator.userAgentData.getHighEntropyValues(["architecture","bitness","platformVersion","model","fullVersionList"]);return _e(e)}),n=await Le(()=>(()=>{const e=document.createElement("video"),t=["video/webm","video/mp4","video/ogg","audio/mp4","audio/webm","audio/ogg","audio/mpeg"],r={};for(const n of t){const t=e.canPlayType(n);r[n]=""===t?"no":t}return _e(r)})()),i=await Le(()=>(()=>{const e=["monospace","serif","sans-serif"],t=["Arial","Helvetica","Verdana","Trebuchet MS","Comic Sans MS","Georgia","Times New Roman","Courier New","Segoe UI","Roboto","Open Sans","Noto Sans","system-ui","-apple-system","BlinkMacSystemFont"],r=document.createElement("span");r.style.fontSize="72px",r.style.position="absolute",r.style.visibility="hidden",r.style.whiteSpace="nowrap",r.textContent="mmmmmmmmmwwwwwww",document.body.appendChild(r);const n={};for(const s of e)r.style.fontFamily=s,n[s]=r.offsetWidth;const i=[];for(const s of t){let t=!1;for(const o of e)if(r.style.fontFamily=`"${s}", ${o}`,r.offsetWidth!==n[o]){i.push(s),t=!0;break}t||(r.style.fontFamily=`"${s}"`,r.offsetWidth!==n.monospace&&r.offsetWidth!==n.serif&&i.push(s))}return document.body.removeChild(r),i.length?i.sort().join(","):null})()),s=await Le(()=>new Intl.NumberFormat(window.navigator.languages?.[0]||"en").resolvedOptions().numberingSystem),o=window.navigator.languages?Array.from(window.navigator.languages).join(","):window.navigator.language||null,a=Intl.DateTimeFormat().resolvedOptions(),c=a.timeZone,l=/* @__PURE__ */(new Date).getTimezoneOffset(),u=a.calendar||null,h=void 0!==a.hour12?a.hour12?"h12":"h23":a.hourCycle||null,d=window.matchMedia("(prefers-reduced-motion: reduce)").matches?"reduce":"no-preference",f=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",p=window.matchMedia("(prefers-contrast: more)").matches?"more":window.matchMedia("(prefers-contrast: less)").matches?"less":window.matchMedia("(prefers-contrast: custom)").matches?"custom":"no-preference",m=window.matchMedia("(prefers-reduced-transparency: reduce)").matches?"reduce":"no-preference",g=window.matchMedia("(forced-colors: active)").matches?"active":null,y="number"==typeof window.devicePixelRatio?Math.round(100*window.devicePixelRatio)/100:null,{pixelDepth:v,colorDepth:w}=window.screen,b="ontouchstart"in window||window.navigator.maxTouchPoints>0,S=await Le(()=>(async e=>{const t=document.createElement("canvas");t.width=280,t.height=100;const r=t.getContext("2d"),n=r.createLinearGradient(0,0,280,100);n.addColorStop(0,"#f60"),n.addColorStop(.4,"#09f"),n.addColorStop(.7,"#f09"),n.addColorStop(1,"#0f9"),r.fillStyle=n,r.fillRect(0,0,280,100),r.font='18px "Arial","Helvetica","DejaVu Sans",sans-serif',r.fillStyle="#000",r.textBaseline="alphabetic",r.fillText("Fingerprint ¼½¾™©®∆π∑€¶§",12,45),r.font='bold 22px "Georgia","Times New Roman",serif',r.fillStyle="#222",r.fillText("🦊🐱🚀 2026",12,78),r.globalAlpha=.7,r.fillStyle="rgba(255, 80, 0, 0.35)",r.fillRect(180,20,80,60),r.beginPath(),r.arc(220,50,32,0,2*Math.PI),r.strokeStyle="#fff",r.lineWidth=4,r.stroke(),r.beginPath(),r.moveTo(30,85),r.quadraticCurveTo(140,20,240,85),r.strokeStyle="#00f",r.lineWidth=3,r.stroke(),e&&(t.style.border="1px solid #444",document.body.appendChild(t));const i=t.toDataURL("image/png");return je(i)})(e)),R=await Le(()=>(async()=>{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl"),r=t.getExtension("WEBGL_debug_renderer_info"),n={vendor:r?t.getParameter(r.UNMASKED_VENDOR_WEBGL):t.getParameter(t.VENDOR),renderer:r?t.getParameter(r.UNMASKED_RENDERER_WEBGL):t.getParameter(t.RENDERER)};return je(_e(n))})()),I=await Le(()=>(async e=>{const t=await navigator.gpu.requestAdapter({powerPreference:"high-performance"}),r={vendor:t.info?.vendor??"",architecture:t.info?.architecture??"",description:t.info?.description??"",features:Array.from(t.features).sort(),limits:Array.from(t.limits).sort()};if(e){const e=document.createElement("pre");e.style.margin="10px 0",e.style.padding="10px",e.style.border="1px solid #444",e.style.background="#111",e.style.color="#0f8",e.style.fontFamily="monospace",e.textContent=`WebGPU:\n${JSON.stringify(r,null,2)}`,document.body.appendChild(e)}return je(_e(r))})(e)),O=await Le(()=>(async e=>{const t=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,6e3,44100),r=t.createOscillator();r.type="sawtooth",r.frequency.value=8800;const n=t.createDynamicsCompressor();n.threshold.value=-48,n.knee.value=30,n.ratio.value=14,n.attack.value=0,n.release.value=.3;const i=t.createGain();i.gain.value=.4,r.connect(n),n.connect(i),i.connect(t.destination),r.start(0);const s=(await t.startRendering()).getChannelData(0);let o=0,a=0;for(let l=3e3;l<5800;l+=2){const e=s[l];o=31*o+Math.floor(1e5*(e+1))|0,a=Math.imul(a^Math.floor(98765*e),2246822519)}const c=o>>>0^a>>>0;if(e){const e=document.createElement("canvas");e.width=500,e.height=120,e.style.border="1px solid #444",e.style.margin="10px 0",e.title="Audio buffer snippet (4500–5000 samples)";const t=e.getContext("2d");t.fillStyle="#111",t.fillRect(0,0,e.width,e.height),t.font="14px monospace",t.fillStyle="#0f8",t.textAlign="left",t.fillText("AudioID",10,20),t.strokeStyle="#0f8",t.lineWidth=1.5,t.beginPath();const r=Array.from(s.slice(4500,5e3)),n=e.width/r.length;for(let i=0;i<r.length;i++){const s=i*n,o=(r[i]+1)/2*e.height;0===i?t.moveTo(s,o):t.lineTo(s,o)}t.stroke(),document.body.appendChild(e)}return je(c.toString(16))})(e)),T=window.screen.width&&window.screen.height?(window.screen.width/window.screen.height).toFixed(4):null,C=await Le(()=>window.screen.orientation?.type||null),k=window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection,E=k&&k.type||null,A=k?.effectiveType||null,x=!0===k?.saveData,F="boolean"==typeof window.navigator.pdfViewerEnabled?window.navigator.pdfViewerEnabled:null,P="boolean"==typeof window.navigator.webdriver?window.navigator.webdriver:null,D=await Le(()=>"function"!=typeof Intl.supportedValuesOf?null:Intl.supportedValuesOf("calendar").join(",")),M=await Le(async()=>{if(!window.navigator.permissions||"function"!=typeof window.navigator.permissions.query)return null;const e=["geolocation","notifications"],t={};for(const r of e)try{t[r]=(await window.navigator.permissions.query({name:r})).state}catch{t[r]="unsupported"}return _e(t)}),q={vendor:window.navigator.vendor||null,platform:window.navigator.platform||null,userAgentHighEntropy:r||null,mediaCodecs:n||null,fonts:i,numberingSystem:s,languages:o,timezone:c,timezoneOffset:l,intlCalendar:u,hourCycle:h,reducedMotion:d,colorScheme:f,prefersContrast:p,prefersReducedTransparency:m,pdfViewerEnabled:F,webdriver:P,intlSupportedCalendars:D||null,permissionsState:M||null,hardwareConcurrency:window.navigator.hardwareConcurrency||null,deviceMemory:window.navigator.deviceMemory||null,forcedColors:g,devicePixelRatio:y,pixelDepth:v,colorDepth:w,touchSupport:b,screenOrientation:C||null,connectionType:E,effectiveType:A,saveData:x,canvasID:S,webglID:R,webgpuID:I,audioID:O},U={aspectRatio:T,width:window.screen.width,height:window.screen.height,maxTouchPoints:window.navigator.maxTouchPoints};(!0===navigator.userAgentData?.mobile||/Mobi|Android|iPhone|iPad|iPod|webOS|BlackBerry|Windows Phone/i.test(navigator.userAgent)||navigator.maxTouchPoints>0&&matchMedia("(pointer:coarse)").matches&&innerWidth<=1024)&&Object.assign(q,U);const Q=_e(q),L=je(Q),j=Math.round(performance.now()-t);return{fingerprint:L,...q,elapsedMs:j}};"undefined"!=typeof window&&(window.getBrowserFingerprint=ze);var Ne=e=>e?`qrati_token:${e}`:"qrati_token",$e=e=>e?.trim()||void 0,He=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),Ve=async(e,t)=>{if(e instanceof l){try{const t=e.data;if(t?.error)return t.error;if(t?.message)return t.message;if("INVALID_EMAIL_OR_PASSWORD"===t?.code)return"Invalid email or password"}catch{return t||e.message}return t||e.message}return e instanceof Error?t||e.message:t||String(e)},We=e(void 0),Ge=({props:e={},children:i})=>{const{organizationId:c,uid:d,fname:p,lname:m,theme:g="light"}=e,y=fe(),[v,w]=r(null),b=Boolean(d);t(()=>(Se(c??null),()=>Se(null)),[c]);const[S,R]=r(()=>{if("undefined"==typeof window)return null;if(b)return null;const e=localStorage.getItem(Ne(c));return e?{token:e}:null}),[I,O]=r(0),{isLoading:T,data:C,error:k}=we({queryKey:[h.QRATI_CONNECT_SESSION,c,d??null,p??null,m??null,I],queryFn:()=>(async({organizationId:e,uid:t,fname:r,lname:n,userToken:i})=>{const s=e.trim();if(!s)throw new Error("Organization ID is required for session initialization");const o=$e(t),a=$e(r),c=$e(n),h=(({userToken:e,uid:t,fname:r,lname:n})=>!e||t||r||n?null:e)({organizationId:s,uid:o,fname:a,lname:c,userToken:i}),d=await(async()=>{const e=await ze();return"string"==typeof e?e:e?.fingerprint})();try{const e=await u.post(f.INITIALIZE_SESSION,{json:{uid:o,fname:a,lname:c,browserFingerprint:d},headers:{"x-org-id":s,...h?{Authorization:`Bearer ${h}`}:{}}}).json();if(!He(e)||!He(e.data))throw new Error("Invalid session initialization response");const t=e.data;if("string"!=typeof t.sessionId||!He(t.organization)||!Array.isArray(t.folders)||void 0!==t.authSession&&null!==t.authSession&&!He(t.authSession)||void 0!==t.orgRole&&null!==t.orgRole&&"string"!=typeof t.orgRole)throw new Error("Invalid session initialization response");return{...t,requestToken:h}}catch(p){if(p instanceof l)try{const e=p.data;p.apiMessage=e?.message||e?.error}catch{}throw p}})({organizationId:c,uid:d,fname:p,lname:m,userToken:S?.token}),enabled:!!c,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1});t(()=>{C&&(({data:e,setUser:t,uid:r,fname:n,lname:i,organizationId:s,persistToken:o=!0})=>{const a=(({data:e,uid:t,fname:r,lname:n})=>{const i=e.authSession?.session?.token??e.authSession?.token,s=e.authSession?.user;return s&&i?{kind:"authenticated",sessionUser:s,sessionToken:i}:e.organization?.customAuth&&t&&r?{kind:"custom-auth",fallbackUser:{_id:t,uid:t,name:n?`${r} ${n}`:r,fname:r,lname:n}}:e.requestToken?{kind:"expired",requestToken:e.requestToken}:{kind:"none"}})({data:e,uid:r,fname:n,lname:i});"authenticated"===a.kind?(t(e=>({...e,...a.sessionUser,token:a.sessionToken,tcAccepted:void 0===a.sessionUser.tcAccepted?e?.tcAccepted:a.sessionUser.tcAccepted})),o&&localStorage.setItem(Ne(s),a.sessionToken)):"custom-auth"===a.kind?t(e=>e??a.fallbackUser):"expired"===a.kind&&t(e=>e?.token!==a.requestToken?e:(o&&localStorage.removeItem(Ne(s)),null))})({data:C,setUser:R,uid:d,fname:p,lname:m,organizationId:c,persistToken:!b})},[C,p,b,m,c,d]);const E=n(()=>{const e=C?.organization?.integrationSettings?.fontFamily,t=((e,t)=>{const r=xe("https://qrati.com"),n=t?Ae(t):"";return r&&n?`${r}/api/connect/organization/google-font?family=${encodeURIComponent(n)}`:null})(0,e),r=((e,t)=>{const r=xe("https://qrati.com");return r&&t?`${r}/api/connect/organization/custom-font?organizationId=${encodeURIComponent(t)}`:null})(0,c);return((e,t,r)=>{if(!e?.fontFamily||"system"===e.fontFamily)return"";const n=Ae(e.fontFamily);if("custom"===n&&t){const r=e.customFontName||"QratiCustomFont",n=/\.woff2(\?|$)/i.test(t)?"woff2":/\.ttf(\?|$)/i.test(t)?"truetype":"woff";return`@font-face{font-family:"${i=r,i.replace(/"/g,'\\"')}";src:url("${t}") format("${n}");font-weight:400 700;font-style:normal;font-display:swap;}`}var i;const s=r||(e=>{if(!e)return null;const t=Ae(e);return t&&"system"!==t.toLowerCase()&&"custom"!==t.toLowerCase()?`https://fonts.googleapis.com/css2?family=${t.replace(/\s+/g,"+")}:wght@400;500;600;700&display=swap`:null})(n);return s?`@import url("${s}");`:""})(C?.organization?.integrationSettings,C?.organization?.customFontUrl?r||C.organization.customFontUrl:void 0,t||void 0)},[C?.organization?.integrationSettings,C?.organization?.customFontUrl,c]);t(()=>{const e=`data-qrati-font-${c}`;if(document.head.querySelector(`[${e}]`)?.remove(),E){if(E.startsWith("@import")){const t=E.match(/@import url\("([^"]+)"\)/);if(!t?.[1])return;const r=document.createElement("link");r.rel="stylesheet",r.href=t[1],r.setAttribute(e,""),document.head.appendChild(r)}else{const t=document.createElement("style");t.textContent=E,t.setAttribute(e,""),document.head.appendChild(t)}return()=>{document.head.querySelector(`[${e}]`)?.remove()}}},[E,c]);const A=a(async e=>{R(t=>({...t,...e}))},[]),x=a(async(e,t,r,n)=>{try{const i=await u.post(f.REGISTER,{json:{email:e,password:t,fname:r,lname:n},headers:{"x-org-id":c}}).json();if(i.error)return{error:i.error};const s={...i.user,token:i.token};return R(s),O(e=>e+1),i.token&&!b&&localStorage.setItem(Ne(c),i.token),i}catch(k){return{error:await Ve(k,"Registration failed")}}},[c,b]),F=a(async(e,t)=>{try{const r=await u.post(f.LOGIN,{json:{email:e,password:t},headers:{"x-org-id":c}}).json();if(r.error)return{error:r.error};const n={...r.user,token:r.token};return R(n),O(e=>e+1),r.token&&!b&&localStorage.setItem(Ne(c),r.token),r}catch(k){return{error:await Ve(k,"Invalid email or password")}}},[c,b]),P=a(async e=>{const t=await((e,t,r)=>new Promise((n,i)=>{if(!e)return void i(/* @__PURE__ */new Error("Provider is required"));if(!t)return void i(/* @__PURE__ */new Error("Organization ID is required"));const s=new URL(`${r}/qc-social-auth`);s.searchParams.set("provider",e),s.searchParams.set("organizationId",t),s.searchParams.set("origin",window.location.origin);const o=(window.screen.width-500)/2,a=(window.screen.height-600)/2,c=window.open(s.toString(),"qrati_social_auth",`width=500,height=600,left=${o},top=${a},scrollbars=yes,resizable=yes,status=yes`);if(!c)return void i(/* @__PURE__ */new Error("Failed to open popup window. Please allow popups and try again."));const l=()=>{clearInterval(h),clearTimeout(d),window.removeEventListener("message",u)},u=e=>{try{const t=new URL(r).origin;if(e.origin!==t)return void console.warn("Origin mismatch:",e.origin,"expected:",t)}catch(h){return void console.warn("Could not parse origin for verification")}const{type:s,data:o,error:a,organizationId:u}=e.data||{};if(u===t)switch(s){case"QRATI_SOCIAL_AUTH_SUCCESS":l(),c.close(),n({user:o.user,session:o.session,token:o.token});break;case"QRATI_SOCIAL_AUTH_ERROR":console.error("Authentication error:",a),l(),c.close(),i(new Error(a||"Social authentication failed"));break;case"QRATI_SOCIAL_AUTH_CANCELLED":l(),c.close(),i(/* @__PURE__ */new Error("Authentication was cancelled"))}else console.warn("Organization ID mismatch:",u,"expected:",t)},h=setInterval(()=>{try{c.closed&&(l(),i(/* @__PURE__ */new Error("Authentication was cancelled")))}catch(e){}},1e3);window.addEventListener("message",u);const d=setTimeout(()=>{l(),c.closed||c.close(),i(/* @__PURE__ */new Error("Authentication timeout. Please try again."))},3e5)}))(e,c??"","https://qrati.com");return t?.user&&t?.token&&(R({...t.user,token:t.token}),O(e=>e+1),b||localStorage.setItem(Ne(c),t.token)),t},[c,b]),D=a(async()=>P("google"),[P]),M=a(async()=>P("apple"),[P]),q=a(async e=>{try{const t=await u.post(f.SEND_PASSWORD_RESET_CODE,{json:{email:e.toLowerCase()},headers:{"x-org-id":c}}).json();return t.error?{error:t.error}:t}catch(k){return{error:await Ve(k,"Failed to send password reset code")}}},[c]),U=a(async(e,t)=>{try{const r=await u.post(f.VERIFY_PASSWORD_RESET_CODE,{json:{email:e.toLowerCase(),code:t},headers:{"x-org-id":c}}).json();return r.error?{error:r.error}:r}catch(k){return{error:await Ve(k,"Invalid code, please check your email")}}},[c]),Q=a(async(e,t)=>{try{const r=await u.post(f.RESET_PASSWORD,{json:{passwordResetCodeId:e,newPassword:t},headers:{"x-org-id":c}}).json();return r.error?{error:r.error}:r}catch(k){return{error:k?.message}}},[c]),L=a(async()=>{try{const e=await u.post(f.LOGOUT,{headers:{"x-org-id":c,Authorization:`Bearer ${S?.token}`}}).json();return e.error?{error:e.error}:(R(null),b||localStorage.removeItem(Ne(c)),await y.invalidateQueries({queryKey:[h.QRATI_CONNECT_SESSION]}),e)}catch(k){return{error:k?.message}}},[b,c,S?.token]),j=n(()=>({props:e,initializing:T,sessionId:C?.sessionId,organization:C?.organization,folders:C?.folders,orgRole:C?.orgRole??null,loadingUser:T,user:S,updateUser:A,registerUsingEmail:x,loginWithGoogle:D,loginWithApple:M,loginUsingEmail:F,sendPasswordResetCode:q,verifyPasswordResetCode:U,resetPassword:Q,signout:L,error:k,portalContainer:v}),[e,T,C,S,A,x,D,M,F,q,U,Q,L,k,v]);if(k){const e=k,t=401===e?.response?.status?"page-not-registered":e?.response?"generic-error":"service-unavailable";/* @__PURE__ */
|
|
40
|
-
return o(s,{fallback:null,children:/* @__PURE__ */o(ke,{organizationId:c??"",errorType:t,errorMessage:"generic-error"===t?e.apiMessage:void 0})})}/* @__PURE__ */
|
|
41
|
-
return o(We.Provider,{value:j,children:/* @__PURE__ */o("div",{ref:w,id:"qrati-connect-container",style:{...Qe(C?.organization,g),fontFamily:C?.organization?.integrationSettings?.fontFamily&&"system"!==C.organization.integrationSettings.fontFamily?"var(--font-family)":"inherit"},className:Me("bg-background text-foreground relative min-h-[80vh]"),children:i})})},Ze=()=>{const e=c(We);if(void 0===e)throw new Error("useSession must be used within SessionProvider");return e};export{z as A,k as C,A as D,w as E,m as M,p as N,I as O,E as S,T,J as _,Qe as a,V as b,Oe as c,pe as d,fe as f,re as g,te as h,Me as i,j,P as k,we as l,ne as m,Ze as n,De as o,ae as p,ze as r,Ie as s,Ge as t,ve as u,K as v,C as w,b as x,W as y};
|
package/element/Dstt_bTH.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t}from"./BXMw4kNf.js";function e({className:e}){/* @__PURE__ */
|
|
2
|
-
return t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */t("path",{fill:"currentColor",d:"m7.825 13l4.9 4.9q.3.3.288.7t-.313.7q-.3.275-.7.288t-.7-.288l-6.6-6.6q-.15-.15-.213-.325T4.426 12t.063-.375t.212-.325l6.6-6.6q.275-.275.688-.275t.712.275q.3.3.3.713t-.3.712L7.825 11H19q.425 0 .713.288T20 12t-.288.713T19 13z"})})}export{e as t};
|
package/element/JY9kGm742.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{E as r,p as n,t as o,v as a,y as s}from"./BXMw4kNf.js";var t={loading:"Loading...",error:"Error",not_found:"Translation not found"},e=r({locale:"en",translations:t,isLoading:!1,error:null}),i=()=>{const r=s(e);if(!r)throw new Error("useI18n must be used within an I18nProvider");const{translations:n,isLoading:o,error:i}=r;return{t:a((r,a)=>o?t.loading:i?t.error:n[r]||a||r,[n,o,i])}},l=i,d=({children:r,locale:a="en",translations:s})=>{const i=n(()=>({locale:a,translations:{...t,...s||{}},isLoading:!1,error:null}),[a,s]);/* @__PURE__ */
|
|
2
|
-
return o(e.Provider,{value:i,children:r})};export{i as n,l as r,d as t};
|
package/element/L4hWU3Nc.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function t(t,e,i){const s=document.createElement(e);return t&&(s.className=t),i&&i.appendChild(s),s}function e(t,e){return t.x=e.x,t.y=e.y,void 0!==e.id&&(t.id=e.id),t}function i(t){t.x=Math.round(t.x),t.y=Math.round(t.y)}function s(t,e){const i=Math.abs(t.x-e.x),s=Math.abs(t.y-e.y);return Math.sqrt(i*i+s*s)}function n(t,e){return t.x===e.x&&t.y===e.y}function a(t,e,i){return Math.min(Math.max(t,e),i)}function h(t,e,i){let s=`translate3d(${t}px,${e||0}px,0)`;return void 0!==i&&(s+=` scale3d(${i},${i},1)`),s}function r(t,e,i,s){t.style.transform=h(e,i,s)}function o(t,e,i,s){t.style.transition=e?`${e} ${i}ms ${s||"cubic-bezier(.4,0,.22,1)"}`:"none"}function d(t,e,i){t.style.width="number"==typeof e?`${e}px`:e,t.style.height="number"==typeof i?`${i}px`:i}function l(t){o(t)}function c(t){return"decode"in t?t.decode().catch(()=>{}):t.complete?Promise.resolve(t):new Promise((e,i)=>{t.onload=()=>e(t),t.onerror=i})}var p="loading",m="loaded",u="error";function y(t){return"button"in t&&1===t.button||t.ctrlKey||t.metaKey||t.altKey||t.shiftKey}function f(t,e,i=document){let s=[];if(t instanceof Element)s=[t];else if(t instanceof NodeList||Array.isArray(t))s=Array.from(t);else{const n="string"==typeof t?t:e;n&&(s=Array.from(i.querySelectorAll(n)))}return s}function g(t){return"function"==typeof t&&t.prototype&&t.prototype.goTo}function v(){return!(!navigator.vendor||!navigator.vendor.match(/apple/i))}var I=class{constructor(e,i){if(this.element=t("pswp__img pswp__img--placeholder",e?"img":"div",i),e){const t=this.element;t.decoding="async",t.alt="",t.src=e,t.setAttribute("role","presentation")}this.element.setAttribute("aria-hidden","true")}setDisplayedSize(t,e){this.element&&("IMG"===this.element.tagName?(d(this.element,250,"auto"),this.element.style.transformOrigin="0 0",this.element.style.transform=h(0,0,t/250)):d(this.element,t,e))}destroy(){this.element?.parentNode&&this.element.remove(),this.element=null}},w=class{constructor(t,e,i){this.instance=e,this.data=t,this.index=i,this.element=void 0,this.placeholder=void 0,this.slide=void 0,this.displayedImageWidth=0,this.displayedImageHeight=0,this.width=Number(this.data.w)||Number(this.data.width)||0,this.height=Number(this.data.h)||Number(this.data.height)||0,this.isAttached=!1,this.hasSlide=!1,this.isDecoding=!1,this.state="idle",this.data.type?this.type=this.data.type:this.data.src?this.type="image":this.type="html",this.hash=this.data.hash,this.instance.dispatch("contentInit",{content:this})}removePlaceholder(){this.placeholder&&!this.keepPlaceholder()&&setTimeout(()=>{this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0)},1e3)}load(e,i){if(this.slide&&this.usePlaceholder())if(this.placeholder){const t=this.placeholder.element;t&&!t.parentElement&&this.slide.container.prepend(t)}else{const t=this.instance.applyFilters("placeholderSrc",!(!this.data.msrc||!this.slide.isFirstSlide)&&this.data.msrc,this);this.placeholder=new I(t,this.slide.container)}this.element&&!i||this.instance.dispatch("contentLoad",{content:this,isLazy:e}).defaultPrevented||(this.isImageContent()?(this.element=t("pswp__img","img"),this.displayedImageWidth&&this.loadImage(e)):(this.element=t("pswp__content","div"),this.element.innerHTML=this.data.html||""),i&&this.slide&&this.slide.updateContentSize(!0))}loadImage(t){if(!this.isImageContent()||!this.element||this.instance.dispatch("contentLoadImage",{content:this,isLazy:t}).defaultPrevented)return;const e=this.element;this.updateSrcsetSizes(),this.data.srcset&&(e.srcset=this.data.srcset),e.src=this.data.src??"",e.alt=this.data.alt??"",this.state=p,e.complete?this.onLoaded():(e.onload=()=>{this.onLoaded()},e.onerror=()=>{this.onError()})}setSlide(t){this.slide=t,this.hasSlide=!0,this.instance=t.pswp}onLoaded(){this.state=m,this.slide&&this.element&&(this.instance.dispatch("loadComplete",{slide:this.slide,content:this}),this.slide.isActive&&this.slide.heavyAppended&&!this.element.parentNode&&(this.append(),this.slide.updateContentSize(!0)),this.state!==m&&this.state!==u||this.removePlaceholder())}onError(){this.state=u,this.slide&&(this.displayError(),this.instance.dispatch("loadComplete",{slide:this.slide,isError:!0,content:this}),this.instance.dispatch("loadError",{slide:this.slide,content:this}))}isLoading(){return this.instance.applyFilters("isContentLoading",this.state===p,this)}isError(){return this.state===u}isImageContent(){return"image"===this.type||"ad"===this.type}setDisplayedSize(t,e){if(this.element&&(this.placeholder&&this.placeholder.setDisplayedSize(t,e),!this.instance.dispatch("contentResize",{content:this,width:t,height:e}).defaultPrevented&&(d(this.element,t,e),this.isImageContent()&&!this.isError()))){const i=!this.displayedImageWidth&&t;this.displayedImageWidth=t,this.displayedImageHeight=e,i?this.loadImage(!1):this.updateSrcsetSizes(),this.slide&&this.instance.dispatch("imageSizeChange",{slide:this.slide,width:t,height:e,content:this})}}isZoomable(){return this.instance.applyFilters("isContentZoomable",this.isImageContent()&&this.state!==u,this)}updateSrcsetSizes(){if(!this.isImageContent()||!this.element||!this.data.srcset)return;const t=this.element,e=this.instance.applyFilters("srcsetSizesWidth",this.displayedImageWidth,this);(!t.dataset.largestUsedSize||e>parseInt(t.dataset.largestUsedSize,10))&&(t.sizes=`${e}px`,t.dataset.largestUsedSize=String(e))}usePlaceholder(){return this.instance.applyFilters("useContentPlaceholder",this.isImageContent(),this)}lazyLoad(){this.instance.dispatch("contentLazyLoad",{content:this}).defaultPrevented||this.load(!0)}keepPlaceholder(){return this.instance.applyFilters("isKeepingPlaceholder",this.isLoading(),this)}destroy(){this.hasSlide=!1,this.slide=void 0,this.instance.dispatch("contentDestroy",{content:this}).defaultPrevented||(this.remove(),this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0),this.isImageContent()&&this.element&&(this.element.onload=null,this.element.onerror=null,this.element=void 0))}displayError(){if(this.slide){let e=t("pswp__error-msg","div");e.innerText=this.instance.options?.errorMsg??"",e=this.instance.applyFilters("contentErrorElement",e,this),this.element=t("pswp__content pswp__error-msg-container","div"),this.element.appendChild(e),this.slide.container.innerText="",this.slide.container.appendChild(this.element),this.slide.updateContentSize(!0),this.removePlaceholder()}}append(){if(this.isAttached||!this.element)return;if(this.isAttached=!0,this.state===u)return void this.displayError();if(this.instance.dispatch("contentAppend",{content:this}).defaultPrevented)return;const t="decode"in this.element;this.isImageContent()?t&&this.slide&&(!this.slide.isActive||v())?(this.isDecoding=!0,this.element.decode().catch(()=>{}).finally(()=>{this.isDecoding=!1,this.appendImage()})):this.appendImage():this.slide&&!this.element.parentNode&&this.slide.container.appendChild(this.element)}activate(){!this.instance.dispatch("contentActivate",{content:this}).defaultPrevented&&this.slide&&(this.isImageContent()&&this.isDecoding&&!v()?this.appendImage():this.isError()&&this.load(!1,!0),this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","false"))}deactivate(){this.instance.dispatch("contentDeactivate",{content:this}),this.slide&&this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","true")}remove(){this.isAttached=!1,this.instance.dispatch("contentRemove",{content:this}).defaultPrevented||(this.element&&this.element.parentNode&&this.element.remove(),this.placeholder&&this.placeholder.element&&this.placeholder.element.remove())}appendImage(){this.isAttached&&(this.instance.dispatch("contentAppendImage",{content:this}).defaultPrevented||(this.slide&&this.element&&!this.element.parentNode&&this.slide.container.appendChild(this.element),this.state!==m&&this.state!==u||this.removePlaceholder()))}};function _(t,e){if(t.getViewportSizeFn){const i=t.getViewportSizeFn(t,e);if(i)return i}return{x:document.documentElement.clientWidth,y:window.innerHeight}}function x(t,e,i,s,n){let a=0;if(e.paddingFn)a=e.paddingFn(i,s,n)[t];else if(e.padding)a=e.padding[t];else{const i=`padding${t[0].toUpperCase()}${t.slice(1)}`;e[i]&&(a=e[i])}return Number(a)||0}function S(t,e,i,s){return{x:e.x-x("left",t,e,i,s)-x("right",t,e,i,s),y:e.y-x("top",t,e,i,s)-x("bottom",t,e,i,s)}}var C=class{constructor(t,e,i,s){this.pswp=s,this.options=t,this.itemData=e,this.index=i,this.panAreaSize=null,this.elementSize=null,this.fit=1,this.fill=1,this.vFill=1,this.initial=1,this.secondary=1,this.max=1,this.min=1}update(t,e,i){const s={x:t,y:e};this.elementSize=s,this.panAreaSize=i;const n=i.x/s.x,a=i.y/s.y;this.fit=Math.min(1,n<a?n:a),this.fill=Math.min(1,n>a?n:a),this.vFill=Math.min(1,a),this.initial=this._getInitial(),this.secondary=this._getSecondary(),this.max=Math.max(this.initial,this.secondary,this._getMax()),this.min=Math.min(this.fit,this.initial,this.secondary),this.pswp&&this.pswp.dispatch("zoomLevelsUpdate",{zoomLevels:this,slideData:this.itemData})}_parseZoomLevelOption(t){const e=`${t}ZoomLevel`,i=this.options[e];if(i)return"function"==typeof i?i(this):"fill"===i?this.fill:"fit"===i?this.fit:Number(i)}_getSecondary(){let t=this._parseZoomLevelOption("secondary");return t||(t=Math.min(1,3*this.fit),this.elementSize&&t*this.elementSize.x>4e3&&(t=4e3/this.elementSize.x),t)}_getInitial(){return this._parseZoomLevelOption("initial")||this.fit}_getMax(){return this._parseZoomLevelOption("max")||Math.max(1,4*this.fit)}};function z(t,e,i){const s=e.createContentFromData(t,i);let n;const{options:a}=e;if(a){let h;n=new C(a,t,-1),h=e.pswp?e.pswp.viewportSize:_(a,e);const r=S(a,h,t,i);n.update(s.width,s.height,r)}return s.lazyLoad(),n&&s.setDisplayedSize(Math.ceil(s.width*n.initial),Math.ceil(s.height*n.initial)),s}function L(t,e){const i=e.getItemData(t);if(!e.dispatch("lazyLoadSlide",{index:t,itemData:i}).defaultPrevented)return z(i,e,t)}var D=class{constructor(t){this.pswp=t,this.limit=Math.max(t.options.preload[0]+t.options.preload[1]+1,5),this._cachedItems=[]}updateLazy(t){const{pswp:e}=this;if(e.dispatch("lazyLoad").defaultPrevented)return;const{preload:i}=e.options,s=void 0===t||t>=0;let n;for(n=0;n<=i[1];n++)this.loadSlideByIndex(e.currIndex+(s?n:-n));for(n=1;n<=i[0];n++)this.loadSlideByIndex(e.currIndex+(s?-n:n))}loadSlideByIndex(t){const e=this.pswp.getLoopedIndex(t);let i=this.getContentByIndex(e);i||(i=L(e,this.pswp),i&&this.addToCache(i))}getContentBySlide(t){let e=this.getContentByIndex(t.index);return e||(e=this.pswp.createContentFromData(t.data,t.index),this.addToCache(e)),e.setSlide(t),e}addToCache(t){if(this.removeByIndex(t.index),this._cachedItems.push(t),this._cachedItems.length>this.limit){const t=this._cachedItems.findIndex(t=>!t.isAttached&&!t.hasSlide);-1!==t&&this._cachedItems.splice(t,1)[0].destroy()}}removeByIndex(t){const e=this._cachedItems.findIndex(e=>e.index===t);-1!==e&&this._cachedItems.splice(e,1)}getContentByIndex(t){return this._cachedItems.find(e=>e.index===t)}destroy(){this._cachedItems.forEach(t=>t.destroy()),this._cachedItems=[]}},E=class{constructor(t,e){this.type=t,this.defaultPrevented=!1,e&&Object.assign(this,e)}preventDefault(){this.defaultPrevented=!0}},A=class{constructor(){this._listeners={},this._filters={},this.pswp=void 0,this.options=void 0}addFilter(t,e,i=100){this._filters[t]||(this._filters[t]=[]),this._filters[t]?.push({fn:e,priority:i}),this._filters[t]?.sort((t,e)=>t.priority-e.priority),this.pswp?.addFilter(t,e,i)}removeFilter(t,e){this._filters[t]&&(this._filters[t]=this._filters[t].filter(t=>t.fn!==e)),this.pswp&&this.pswp.removeFilter(t,e)}applyFilters(t,...e){return this._filters[t]?.forEach(t=>{e[0]=t.fn.apply(this,e)}),e[0]}on(t,e){this._listeners[t]||(this._listeners[t]=[]),this._listeners[t]?.push(e),this.pswp?.on(t,e)}off(t,e){this._listeners[t]&&(this._listeners[t]=this._listeners[t].filter(t=>e!==t)),this.pswp?.off(t,e)}dispatch(t,e){if(this.pswp)return this.pswp.dispatch(t,e);const i=new E(t,e);return this._listeners[t]?.forEach(t=>{t.call(this,i)}),i}},F=class extends A{getNumItems(){let t=0;const e=this.options?.dataSource;e&&"length"in e?t=e.length:e&&"gallery"in e&&(e.items||(e.items=this._getGalleryDOMElements(e.gallery)),e.items&&(t=e.items.length));const i=this.dispatch("numItems",{dataSource:e,numItems:t});return this.applyFilters("numItems",i.numItems,e)}createContentFromData(t,e){return new w(t,this,e)}getItemData(t){const e=this.options?.dataSource;let i={};Array.isArray(e)?i=e[t]:e&&"gallery"in e&&(e.items||(e.items=this._getGalleryDOMElements(e.gallery)),i=e.items[t]);let s=i;s instanceof Element&&(s=this._domElementToItemData(s));const n=this.dispatch("itemData",{itemData:s||{},index:t});return this.applyFilters("itemData",n.itemData,t)}_getGalleryDOMElements(t){return this.options?.children||this.options?.childSelector?f(this.options.children,this.options.childSelector,t)||[]:[t]}_toLowerCaseFirstLetter(t){return t?t.charAt(0).toLowerCase()+t.slice(1):t}_domElementToItemData(t){const e={element:t},i="A"===t.tagName?t:t.querySelector("a");if(i){e.src=i.dataset.pswpSrc||i.href,i.dataset.pswpSrcset&&(e.srcset=i.dataset.pswpSrcset),e.width=i.dataset.pswpWidth?parseInt(i.dataset.pswpWidth,10):0,e.height=i.dataset.pswpHeight?parseInt(i.dataset.pswpHeight,10):0,i.dataset.pswpType&&(e.type=i.dataset.pswpType.toLowerCase());const s=t.querySelector("img");s&&(e.msrc=s.currentSrc||s.src,e.alt=s.getAttribute("alt")??""),(i.dataset.pswpCropped||i.dataset.cropped)&&(e.thumbCropped=!0);const n=["element","src","srcset","width","height","type","msrc","alt","thumbCropped"];Object.keys(i.dataset).filter(t=>t.startsWith("pswp")&&!n.includes(this._toLowerCaseFirstLetter(t.slice(4)))).forEach(t=>{e[this._toLowerCaseFirstLetter(t.slice(4))]=i.dataset[t]})}return this.applyFilters("domItemData",e,t,i)}lazyLoadData(t,e){return z(t,this,e)}};export{i as _,S as a,y as b,a as c,e as d,s as f,l as g,n as h,C as i,t as l,g as m,D as n,_ as o,f as p,L as r,x as s,F as t,c as u,r as v,h as x,o as y};
|
package/element/Te9ieH1R2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as r,n as e}from"./Dpwx5KMy.js";import{t as a}from"./DmpmrPE5.js";import{i as t}from"./Bb9ydqSB.js";var o=({eventSlug:o})=>{const{props:s}=e(),n=s?.organizationId,{isLoading:i,data:d,isError:g,error:m}=r({queryKey:[`event-data-${n??""}-${o??""}`],queryFn:async()=>{try{const r=await a.get(t.EVENT_DATA,{searchParams:o?{eventSlug:o}:void 0,headers:{"x-org-id":n}}).json();if(r.error)throw new Error(r.error);return r.data}catch(r){throw new Error(r instanceof Error?r.message:String(r)||"Failed to fetch event data")}},enabled:!!n&&!!o,staleTime:3e5,gcTime:6e5,refetchOnWindowFocus:"always"});return{loading:i,event:d?.event,ads:d?.ads,gamConfig:d?.gamConfig,parameters:d?.parameters,isError:g,error:m}};export{o as t};
|
package/element/Z3MoLpu5.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{E as t,S as e,_ as n,f as s,h as r,p as i,t as a,v as o,w as c,y as u}from"./BXMw4kNf.js";import{i as l}from"./Dpwx5KMy.js";var h=t(null),p=t(null),d=class{entries;index=0;listeners=/* @__PURE__ */new Set;constructor(t="/"){this.entries=[{path:t}]}get location(){return this.entries[this.index]?.path??"/"}get state(){return this.entries[this.index]?.state}push(t,e){this.entries=this.entries.slice(0,this.index+1),this.index=this.entries.push({path:t,state:e})-1,this.notify()}replace(t,e){this.entries[this.index]={path:t,state:e},this.notify()}go(t){const e=this.index+t;e>=0&&e<this.entries.length&&(this.index=e,this.notify())}canGoBack(){return this.index>0}listen(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notify(){this.listeners.forEach(t=>t(this.location))}},f=class{listeners=/* @__PURE__ */new Set;appPushCount=0;get location(){return window.location.hash.replace(/^#/,"")||"/"}get state(){return window.history.state?.__qrati_state}makeUrl(t){return`${window.location.pathname+window.location.search}#${t}`}push(t,e){window.history.pushState({__qrati_state:e},"",this.makeUrl(t)),this.appPushCount+=1,this.notify()}replace(t,e){window.history.replaceState({__qrati_state:e},"",this.makeUrl(t)),this.notify()}go(t){this.appPushCount=Math.max(0,this.appPushCount+t),window.history.go(t)}canGoBack(){return this.appPushCount>0}listen(t){this.listeners.add(t);const e=()=>this.notify();return window.addEventListener("popstate",e),window.addEventListener("hashchange",e),queueMicrotask(()=>t(this.location)),()=>{this.listeners.delete(t),window.removeEventListener("popstate",e),window.removeEventListener("hashchange",e)}}notify(){this.listeners.forEach(t=>t(this.location))}};function m(t){const e=t.search(/[?#]/);return-1===e?t||"/":t.slice(0,e)||"/"}function w(t,e,n=!0){const s=t.split("/").filter(Boolean),r=function(t){const e=[],n=t.split("/").filter(Boolean);for(const s of n)if("*"===s)e.push({type:"wildcard"});else if(s.startsWith(":")){const t=s.endsWith("?"),n=t?s.slice(1,-1):s.slice(1);e.push({type:"param",name:n,optional:t})}else e.push({type:"static",value:s});return e}(e),i={};let a=0;for(const o of r)if("static"===o.type){if(s[a]!==o.value)return null;a++}else if("param"===o.type){if(a<s.length){try{i[o.name]=decodeURIComponent(s[a])}catch{i[o.name]=s[a]}a++}else if(!o.optional)return null}else if("wildcard"===o.type){i["*"]=s.slice(a).join("/"),a=s.length;break}return n&&a<s.length?null:{params:i}}function v(t,e){return e.startsWith("/")?e:t.endsWith("/")?t+e:`${t}/${e}`}function y(t,e,n=""){const s=m(t);for(const r of e){const t=r.path.startsWith("/")?r.path:v(n,r.path);if(r.children&&r.children.length>0){const e=w(s,t,!1);if(e){const n=[{route:r,params:e.params}],i=y(s,r.children,t);if(i)n.push(...i);else{const t=r.children.find(t=>""===t.path);t&&n.push({route:t,params:{}})}return n}}const e=w(s,t,!0);if(e)return[{route:r,params:e.params}]}return null}function g(){const t=u(p);if(!t)throw new Error("useParams must be used inside a Route");return t.params}function k(){const t=u(h);if(!t)throw new Error("useNavigate must be used inside a Router");const{navigate:e,go:n}=t;return o((t,s)=>{"number"!=typeof t?e(t,s):n(t)},[e,n])}function x(){const t=u(h);if(!t)throw new Error("useCanGoBack must be used inside a Router");return t.canGoBack}function C(){const t=u(h);if(!t)throw new Error("useRouterMode must be used inside a Router");return t.mode}function E(){const t=u(h);if(!t)throw new Error("useLocation must be used inside a Router");return function(t,e){const n=m(t),s=t.indexOf("?"),r=t.indexOf("#");return{pathname:n,state:e,search:-1===s?"":t.slice(s,-1===r?void 0:r),hash:-1===r?"":t.slice(r)}}(t.location,t.state)}function B({mode:t,initialPath:e,children:c}){const u=s("memory"===t?new d(e):new f),[l,p]=r(u.current.location),[m,w]=r(u.current.state),[v,y]=r(u.current.canGoBack());n(()=>(p(u.current.location),w(u.current.state),y(u.current.canGoBack()),u.current.listen(t=>{p(t),w(u.current.state),y(u.current.canGoBack())})),[]);const g=o((t,e)=>{const n=u.current;e&&e.replace?n.replace(t,e.state):n.push(t,e?.state)},[]),k=o(t=>{u.current.go(t)},[]),x=i(()=>({location:l,state:m,navigate:g,go:k,canGoBack:v,mode:t}),[l,m,g,k,v,t]);/* @__PURE__ */
|
|
2
|
-
return a(h.Provider,{value:x,children:c})}function _(t){return null}function P(t){return e(t).filter(t=>t?.type===_).map(t=>({path:t.props.path,element:t.props.element,children:t.props.children?P(t.props.children):void 0}))}function G({children:t}){const{location:n}=u(h),r=s([]),o=e(t).filter(t=>t?.type===_).map(t=>t.props.path).join("\0"),l=s("");o!==l.current&&(l.current=o,r.current=P(t));const d=r.current,f=i(()=>y(n,d),[n,d]),m=i(()=>(f??[]).reduce((t,e)=>({...t,...e.params}),{}),[f]),w=i(()=>{if(!f)return null;let t=null;for(let e=f.length-1;e>=0;e--){const n=f[e].route.element;t=/* @__PURE__ */a(p.Provider,{value:{params:m,outlet:t},children:/* @__PURE__ */a(n,{})})}return t},[f,m]);return f?/* @__PURE__ */a(c,{children:w}):null}function b(){/* @__PURE__ */
|
|
3
|
-
return a(c,{children:u(p)?.outlet})}function R({to:t,state:e,replace:n,children:s,className:r,onClick:i,...c}){const l=u(h);/* @__PURE__ */
|
|
4
|
-
return a("a",{href:t,onClick:o(s=>{s.preventDefault(),i?.(s),l?.navigate(t,{state:e,replace:n})},[l,t,e,n,i]),className:r,...c,children:s})}function N({to:t,state:e,replace:n,children:s,className:r,activeClassName:c,onClick:p,...d}){const f=u(h),w=i(()=>{if(!f)return!1;const e=m(f.location);return e===t||!("/"===t||!e.startsWith(`${t}/`))},[f?.location,t]);/* @__PURE__ */
|
|
5
|
-
return a("a",{href:t,onClick:o(s=>{s.preventDefault(),p?.(s),f?.navigate(t,{state:e,replace:n})},[f,t,e,n,p]),className:"function"==typeof r?r({isActive:w}):l(r,w&&c),...d,children:s})}function W({to:t,state:e,replace:s}){const r=k();return n(()=>{queueMicrotask(()=>{r(t,{state:e,replace:s})})},[r,t,e,s]),null}export{_ as a,x as c,g as d,C as f,b as i,E as l,N as n,B as o,W as r,G as s,R as t,k as u};
|
package/element/a_rT1I0D.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{_ as e,h as t,t as l,w as n}from"./BXMw4kNf.js";import{i as r}from"./Dpwx5KMy.js";import{t as s}from"./BWKUiudT.js";var a=()=>/* @__PURE__ */l("svg",{className:"size-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:/* @__PURE__ */l("path",{d:"m15 18-6-6 6-6"})}),o=()=>/* @__PURE__ */l("svg",{className:"size-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:/* @__PURE__ */l("path",{d:"m9 18 6-6-6-6"})});function i({items:s,autoplayInterval:i=3e3,showControls:d=!1,className:c}){const[u,h]=t(0);return e(()=>{if(s.length<=1)return;const e=setInterval(()=>h(e=>(e+1)%s.length),i);return()=>clearInterval(e)},[s.length,i]),0===s.length?null:/* @__PURE__ */l("div",{className:r("relative size-full overflow-hidden",c),children:[s.map((e,t)=>/* @__PURE__ */l("div",{className:r("absolute inset-0 transition-opacity duration-500",t===u?"opacity-100":"opacity-0"),children:e},t)),s.length>1&&/* @__PURE__ */l("div",{className:"absolute bottom-2 left-1/2 z-10 flex -translate-x-1/2 gap-1",children:s.map((e,t)=>/* @__PURE__ */l("button",{onClick:()=>h(t),className:r("h-1.5 rounded-full transition-all",t===u?"w-4 bg-white":"w-1.5 bg-white/50 hover:bg-white/75"),"aria-label":`Go to slide ${t+1}`},t))}),d&&s.length>1&&/* @__PURE__ */l(n,{children:[/* @__PURE__ */l("button",{onClick:()=>h(e=>0===e?s.length-1:e-1),className:"absolute top-1/2 left-2 z-10 flex size-8 -translate-y-1/2 items-center justify-center rounded-full bg-black/40 text-white hover:bg-black/60","aria-label":"Previous",children:/* @__PURE__ */l(a,{})}),/* @__PURE__ */l("button",{onClick:()=>h(e=>(e+1)%s.length),className:"absolute top-1/2 right-2 z-10 flex size-8 -translate-y-1/2 items-center justify-center rounded-full bg-black/40 text-white hover:bg-black/60","aria-label":"Next",children:/* @__PURE__ */l(o,{})})]})]})}var d=({event:e,onExplore:t})=>{const n=(e.contents||[]).map(t=>/* @__PURE__ */l(s,{alt:e.name,src:t.thumbnailUrl||t.url,containerClassName:"size-full",imgClassName:"rounded"},t._id)),r=e?.status?.toUpperCase();/* @__PURE__ */
|
|
2
|
-
return l("div",{className:"w-48 max-w-full overflow-hidden rounded-lg bg-white",children:[/* @__PURE__ */l("div",{className:"relative h-40 w-full overflow-hidden",children:[/* @__PURE__ */l(i,{items:n,autoplayInterval:3e3}),"OPEN"===r&&/* @__PURE__ */l("span",{className:"absolute top-2 left-2 inline-flex items-center gap-1 rounded-full bg-green-500 px-2 py-0.5 text-[10px] font-medium text-white",children:[/* @__PURE__ */l("span",{className:"size-1.5 animate-pulse rounded-full bg-white"}),"Open"]})]}),/* @__PURE__ */l("div",{className:"p-2",children:[
|
|
3
|
-
/* @__PURE__ */l("div",{className:"line-clamp-2 pb-0.5 text-sm font-medium text-black",children:e.name}),
|
|
4
|
-
/* @__PURE__ */l("div",{className:"pb-2 text-xs text-gray-600",children:e.location?.label}),
|
|
5
|
-
/* @__PURE__ */l("button",{type:"button",onClick:()=>t?.(e.slug||""),className:"bg-primary text-primary-foreground flex w-full items-center justify-center rounded py-1",children:"Explore"})]})]})},c=(e,t)=>e&&(/^#[0-9a-fA-F]{3,8}$/.test(e)||/^rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/.test(e))?e:t,u=e=>{if(e)try{const{protocol:t}=new URL(e);return"https:"===t||"http:"===t?e:void 0}catch{return}},h=({node:e,depth:n,activeFolderId:r,onSelect:s})=>{const[a,o]=t(!1),i=e.folder._id===r,d=e.children.length>0,c=e.eventCount>0;/* @__PURE__ */
|
|
6
|
-
return l("li",{children:[/* @__PURE__ */l("div",{class:"flex items-center gap-1 py-1.5 pr-2 rounded-lg "+(i?"bg-foreground/20":"hover:bg-foreground/20"),style:{paddingLeft:8+14*n+"px"},children:[/* @__PURE__ */l("button",{type:"button","aria-label":d?`${a?"Collapse":"Expand"} ${e.folder.name}`:`${e.folder.name} has no subfolders`,class:"flex w-4 shrink-0 items-center justify-center text-slate-400 text-xs",onClick:e=>{e.stopPropagation(),d&&o(e=>!e)},children:d?a?"▾":"▸":/* @__PURE__ */l("span",{class:"size-1.5 rounded-full bg-slate-300 inline-block"})}),/* @__PURE__ */l("button",{type:"button","aria-label":`Open ${e.folder.name}`,class:"flex flex-1 min-w-0 items-center gap-2 cursor-pointer",onClick:()=>{c?s(i?null:e.folder._id):o(e=>!e)},children:[
|
|
7
|
-
/* @__PURE__ */l("span",{class:"size-2 shrink-0 rounded-full",style:{background:e.color}}),
|
|
8
|
-
/* @__PURE__ */l("span",{class:"flex-1 truncate text-left text-sm",children:e.folder.name}),c&&/* @__PURE__ */l("span",{class:"text-xs tabular-nums text-slate-400",children:e.eventCount})]})]}),d&&a&&/* @__PURE__ */l("ul",{children:e.children.map(e=>/* @__PURE__ */l(h,{node:e,depth:n+1,activeFolderId:r,onSelect:s},e.folder._id))})]})},p=(e,t)=>{for(const l of e){if(l.folder._id===t)return l;const e=p(l.children,t);if(e)return e}return null},f=({folderTree:e,activeFolderId:t,setActiveFolderId:n,positionClass:r})=>0===e.length?null:/* @__PURE__ */l("div",{class:`${r??""} w-[min(92%,260px)] overflow-hidden rounded-xl bg-background shadow-lg backdrop-blur-sm`,children:[/* @__PURE__ */l("div",{class:"flex items-center justify-between border-b border-slate-100 px-3 py-2.5",children:[/* @__PURE__ */l("p",{class:"text-xs font-semibold uppercase tracking-wide",children:"Destinations"}),t&&/* @__PURE__ */l("button",{type:"button",onClick:()=>n(null),class:"text-xs text-foreground",children:"Show all"})]}),/* @__PURE__ */l("ul",{class:"max-h-[60vh] overflow-y-auto py-1",children:e.map(e=>/* @__PURE__ */l(h,{node:e,depth:0,activeFolderId:t,onSelect:n},e.folder._id))})]});export{d as a,u as i,p as n,c as r,f as t};
|
package/element/erXAfWWY.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{C as e,_ as r,f as t,h as n,p as s,t as a}from"./BXMw4kNf.js";import{a as o,d as i,n as c}from"./Dpwx5KMy.js";import{t as l}from"./rlutojb0.js";import{v as u}from"./Bb9ydqSB.js";import{t as m}from"./CQJ3AK1w.js";import{t as d}from"./BUDCYszs.js";import{a as f,i as p,n as h,r as g,t as b}from"./a_rT1I0D.js";var{getOwnPropertyNames:y,getOwnPropertySymbols:k}=Object,{hasOwnProperty:v}=Object.prototype;function x(e,r){return function(t,n,s){return e(t,n,s)&&r(t,n,s)}}function w(e){return function(r,t,n){if(!r||!t||"object"!=typeof r||"object"!=typeof t)return e(r,t,n);const{cache:s}=n,a=s.get(r),o=s.get(t);if(a&&o)return a===t&&o===r;s.set(r,t),s.set(t,r);const i=e(r,t,n);return s.delete(r),s.delete(t),i}}function E(e){return y(e).concat(k(e))}var C=Object.hasOwn||((e,r)=>v.call(e,r));function M(e,r){return e===r||!e&&!r&&e!=e&&r!=r}var{getOwnPropertyDescriptor:j,keys:A}=Object;function L(e,r){return e.byteLength===r.byteLength&&F(new Uint8Array(e),new Uint8Array(r))}function q(e,r,t){let n=e.length;if(r.length!==n)return!1;for(;n-- >0;)if(!t.equals(e[n],r[n],n,n,e,r,t))return!1;return!0}function O(e,r){return e.byteLength===r.byteLength&&F(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(r.buffer,r.byteOffset,r.byteLength))}function I(e,r){return M(e.getTime(),r.getTime())}function S(e,r){return e.name===r.name&&e.message===r.message&&e.cause===r.cause&&e.stack===r.stack}function _(e,r){return e===r}function z(e,r,t){const n=e.size;if(n!==r.size)return!1;if(!n)return!0;const s=new Array(n),a=e.entries();let o,i,c=0;for(;(o=a.next())&&!o.done;){const n=r.entries();let a=!1,l=0;for(;(i=n.next())&&!i.done;){if(s[l]){l++;continue}const n=o.value,u=i.value;if(t.equals(n[0],u[0],c,l,e,r,t)&&t.equals(n[1],u[1],n[0],u[0],e,r,t)){a=s[l]=!0;break}l++}if(!a)return!1;c++}return!0}var P=M;function T(e,r,t){const n=A(e);let s=n.length;if(A(r).length!==s)return!1;for(;s-- >0;)if(!D(e,r,t,n[s]))return!1;return!0}function U(e,r,t){const n=E(e);let s,a,o,i=n.length;if(E(r).length!==i)return!1;for(;i-- >0;){if(s=n[i],!D(e,r,t,s))return!1;if(a=j(e,s),o=j(r,s),(a||o)&&(!a||!o||a.configurable!==o.configurable||a.enumerable!==o.enumerable||a.writable!==o.writable))return!1}return!0}function N(e,r){return M(e.valueOf(),r.valueOf())}function $(e,r){return e.source===r.source&&e.flags===r.flags}function B(e,r,t){const n=e.size;if(n!==r.size)return!1;if(!n)return!0;const s=new Array(n),a=e.values();let o,i;for(;(o=a.next())&&!o.done;){const n=r.values();let a=!1,c=0;for(;(i=n.next())&&!i.done;){if(!s[c]&&t.equals(o.value,i.value,o.value,i.value,e,r,t)){a=s[c]=!0;break}c++}if(!a)return!1}return!0}function F(e,r){let t=e.byteLength;if(r.byteLength!==t||e.byteOffset!==r.byteOffset)return!1;for(;t-- >0;)if(e[t]!==r[t])return!1;return!0}function Z(e,r){return e.hostname===r.hostname&&e.pathname===r.pathname&&e.protocol===r.protocol&&e.port===r.port&&e.hash===r.hash&&e.username===r.username&&e.password===r.password}function D(e,r,t,n){return!("_owner"!==n&&"__o"!==n&&"__v"!==n||!e.$$typeof&&!r.$$typeof)||C(r,n)&&t.equals(e[n],r[n],n,n,e,r,t)}var R={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},G=Object.prototype.toString;var V=K();function K(e={}){const{circular:r=!1,createInternalComparator:t,createState:n,strict:s=!1}=e,a=function({areArrayBuffersEqual:e,areArraysEqual:r,areDataViewsEqual:t,areDatesEqual:n,areErrorsEqual:s,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:i,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:m,areTypedArraysEqual:d,areUrlsEqual:f,unknownTagComparators:p}){return function(h,g,b){if(h===g)return!0;if(null==h||null==g)return!1;const y=typeof h;if(y!==typeof g)return!1;if("object"!==y)return"number"===y?i(h,g,b):"function"===y&&a(h,g,b);const k=h.constructor;if(k!==g.constructor)return!1;if(k===Object)return c(h,g,b);if(Array.isArray(h))return r(h,g,b);if(k===Date)return n(h,g,b);if(k===RegExp)return u(h,g,b);if(k===Map)return o(h,g,b);if(k===Set)return m(h,g,b);const v=G.call(h);if("[object Date]"===v)return n(h,g,b);if("[object RegExp]"===v)return u(h,g,b);if("[object Map]"===v)return o(h,g,b);if("[object Set]"===v)return m(h,g,b);if("[object Object]"===v)return"function"!=typeof h.then&&"function"!=typeof g.then&&c(h,g,b);if("[object URL]"===v)return f(h,g,b);if("[object Error]"===v)return s(h,g,b);if("[object Arguments]"===v)return c(h,g,b);if(R[v])return d(h,g,b);if("[object ArrayBuffer]"===v)return e(h,g,b);if("[object DataView]"===v)return t(h,g,b);if("[object Boolean]"===v||"[object Number]"===v||"[object String]"===v)return l(h,g,b);if(p){let e=p[v];if(!e){const r=null!=(x=h)?x[Symbol.toStringTag]:void 0;r&&(e=p[r])}if(e)return e(h,g,b)}var x;return!1}}(function({circular:e,createCustomConfig:r,strict:t}){let n={areArrayBuffersEqual:L,areArraysEqual:t?U:q,areDataViewsEqual:O,areDatesEqual:I,areErrorsEqual:S,areFunctionsEqual:_,areMapsEqual:t?x(z,U):z,areNumbersEqual:P,areObjectsEqual:t?U:T,arePrimitiveWrappersEqual:N,areRegExpsEqual:$,areSetsEqual:t?x(B,U):B,areTypedArraysEqual:t?x(F,U):F,areUrlsEqual:Z,unknownTagComparators:void 0};if(r&&(n=Object.assign({},n,r(n))),e){const e=w(n.areArraysEqual),r=w(n.areMapsEqual),t=w(n.areObjectsEqual),s=w(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:e,areMapsEqual:r,areObjectsEqual:t,areSetsEqual:s})}return n}(e));return function({circular:e,comparator:r,createState:t,equals:n,strict:s}){if(t)return function(a,o){const{cache:i=(e?/* @__PURE__ */new WeakMap:void 0),meta:c}=t();return r(a,o,{cache:i,equals:n,meta:c,strict:s})};if(e)return function(e,t){return r(e,t,{cache:/* @__PURE__ */new WeakMap,equals:n,meta:void 0,strict:s})};const a={cache:void 0,equals:n,meta:void 0,strict:s};return function(e,t){return r(e,t,a)}}({circular:r,comparator:a,createState:n,equals:t?t(a):(o=a,function(e,r,t,n,s,a,i){return o(e,r,i)}),strict:s});var o}K({strict:!0}),K({circular:!0}),K({circular:!0,strict:!0}),K({createInternalComparator:()=>M}),K({strict:!0,createInternalComparator:()=>M}),K({circular:!0,createInternalComparator:()=>M}),K({circular:!0,createInternalComparator:()=>M,strict:!0});var W=class{static isAdvancedMarkerAvailable(e){return google.maps.marker&&!0===e.getMapCapabilities().isAdvancedMarkersAvailable}static isAdvancedMarker(e){return google.maps.marker&&e instanceof google.maps.marker.AdvancedMarkerElement}static setMap(e,r){this.isAdvancedMarker(e)?e.map=r:e.setMap(r)}static getPosition(e){if(this.isAdvancedMarker(e)){if(e.position){if(e.position instanceof google.maps.LatLng)return e.position;if(Number.isFinite(e.position.lat)&&Number.isFinite(e.position.lng))return new google.maps.LatLng(e.position.lat,e.position.lng)}return new google.maps.LatLng(null)}return e.getPosition()}static getVisible(e){return!!this.isAdvancedMarker(e)||e.getVisible()}},J=class{constructor({markers:e,position:r}){this.markers=[],e&&(this.markers=e),r&&(r instanceof google.maps.LatLng?this._position=r:this._position=new google.maps.LatLng(r))}get bounds(){if(0===this.markers.length&&!this._position)return;const e=new google.maps.LatLngBounds(this._position,this._position);for(const r of this.markers)e.extend(W.getPosition(r));return e}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(e=>W.getVisible(e)).length}push(e){this.markers.push(e)}delete(){this.marker&&(W.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}};function X(e,r="assertion failed"){if(null==e)throw Error(r)}var H,Q=class{constructor({maxZoom:e=16}){this.maxZoom=e}noop({markers:e}){return Y(e)}},Y=e=>e.map(e=>new J({position:W.getPosition(e),markers:[e]})),ee=class extends Q{constructor(e){var{maxZoom:r,radius:t=60}=e,n=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)r.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(t[n[s]]=e[n[s]])}return t}(e,["maxZoom","radius"]);super({maxZoom:r}),this.markers=[],this.clusters=[],this.state={zoom:-1},this.superCluster=new d(Object.assign({maxZoom:this.maxZoom,radius:t},n))}calculate(e){let r=!1,t=e.map.getZoom();X(t),t=Math.round(t);const n={zoom:t};if(!V(e.markers,this.markers)){r=!0,this.markers=[...e.markers];const t=this.markers.map(e=>{const r=W.getPosition(e);return{type:"Feature",geometry:{type:"Point",coordinates:[r.lng(),r.lat()]},properties:{marker:e}}});this.superCluster.load(t)}return r||(this.state.zoom<=this.maxZoom||n.zoom<=this.maxZoom)&&(r=!V(this.state,n)),this.state=n,0===e.markers.length?(this.clusters=[],{clusters:this.clusters,changed:r}):(r&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:r})}cluster({map:e}){const r=e.getZoom();return X(r),this.superCluster.getClusters([-180,-90,180,90],Math.round(r)).map(e=>this.transformCluster(e))}transformCluster({geometry:{coordinates:[e,r]},properties:t}){if(t.cluster)return new J({markers:this.superCluster.getLeaves(t.cluster_id,1/0).map(e=>e.properties.marker),position:{lat:r,lng:e}});const n=t.marker;return new J({markers:[n],position:W.getPosition(n)})}},re=class{constructor(e,r){this.markers={sum:e.length};const t=r.map(e=>e.count),n=t.reduce((e,r)=>e+r,0);this.clusters={count:r.length,markers:{mean:n/r.length,sum:n,min:Math.min(...t),max:Math.max(...t)}}}},te=class{render({count:e,position:r},t,n){const s=`<svg fill="${e>Math.max(10,t.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">\n<circle cx="120" cy="120" opacity=".6" r="70" />\n<circle cx="120" cy="120" opacity=".3" r="90" />\n<circle cx="120" cy="120" opacity=".2" r="110" />\n<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${e}</text>\n</svg>`,a=`Cluster of ${e} markers`,o=Number(google.maps.Marker.MAX_ZINDEX)+e;if(W.isAdvancedMarkerAvailable(n)){const e=(new DOMParser).parseFromString(s,"image/svg+xml").documentElement;e.setAttribute("transform","translate(0 25)");const t={map:n,position:r,zIndex:o,title:a,content:e};return new google.maps.marker.AdvancedMarkerElement(t)}const i={position:r,zIndex:o,title:a,icon:{url:`data:image/svg+xml;base64,${btoa(s)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(i)}},ne=class e{constructor(){!function(e,r){for(let t in r.prototype)e.prototype[t]=r.prototype[t]}(e,google.maps.OverlayView)}};!function(e){e.CLUSTERING_BEGIN="clusteringbegin",e.CLUSTERING_END="clusteringend",e.CLUSTER_CLICK="click",e.GMP_CLICK="gmp-click"}(H||(H={}));var se=(e,r,t)=>{r.bounds&&t.fitBounds(r.bounds)},ae=class extends ne{constructor({map:e,markers:r=[],algorithmOptions:t={},algorithm:n=new ee(t),renderer:s=new te,onClusterClick:a=se}){super(),this.map=null,this.idleListener=null,this.markers=[...r],this.clusters=[],this.algorithm=n,this.renderer=s,this.onClusterClick=a,e&&this.setMap(e)}addMarker(e,r){this.markers.includes(e)||(this.markers.push(e),r||this.render())}addMarkers(e,r){e.forEach(e=>{this.addMarker(e,!0)}),r||this.render()}removeMarker(e,r){const t=this.markers.indexOf(e);return-1!==t&&(W.setMap(e,null),this.markers.splice(t,1),r||this.render(),!0)}removeMarkers(e,r){let t=!1;return e.forEach(e=>{t=this.removeMarker(e,!0)||t}),t&&!r&&this.render(),t}clearMarkers(e){this.markers.length=0,e||this.render()}render(){const e=this.getMap();if(e instanceof google.maps.Map&&e.getProjection()){google.maps.event.trigger(this,H.CLUSTERING_BEGIN,this);const{clusters:r,changed:t}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(t||null==t){const e=/* @__PURE__ */new Set;for(const n of r)1==n.markers.length&&e.add(n.markers[0]);const t=[];for(const r of this.clusters)null!=r.marker&&(1==r.markers.length?e.has(r.marker)||W.setMap(r.marker,null):t.push(r.marker));this.clusters=r,this.renderClusters(),requestAnimationFrame(()=>t.forEach(e=>W.setMap(e,null)))}google.maps.event.trigger(this,H.CLUSTERING_END,this)}}onAdd(){const e=this.getMap();X(e),this.idleListener=e.addListener("idle",this.render.bind(this)),this.render()}onRemove(){this.idleListener&&google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(e=>W.setMap(e,null)),this.clusters.forEach(e=>e.delete()),this.clusters=[]}renderClusters(){const e=new re(this.markers,this.clusters),r=this.getMap();this.clusters.forEach(t=>{if(1===t.markers.length)t.marker=t.markers[0];else if(t.marker=this.renderer.render(t,e,r),t.markers.forEach(e=>W.setMap(e,null)),this.onClusterClick){const e=W.isAdvancedMarker(t.marker)?H.GMP_CLICK:H.CLUSTER_CLICK;t.marker.addListener(e,e=>{google.maps.event.trigger(this,H.CLUSTER_CLICK,t),this.onClusterClick(e,t,r)})}W.setMap(t.marker,r)})}},oe={top:60,bottom:60,left:276,right:60},ie=new l,ce=e=>{const r=document.createElement("div");r.style.cssText=`\n background:${g(e.color,"#fb8500")};color:#fff;border-radius:20px;padding:5px 10px;\n font-size:12px;font-weight:600;white-space:nowrap;cursor:pointer;\n box-shadow:0 2px 8px rgba(0,0,0,0.25);border:2px solid rgba(255,255,255,0.4);\n display:inline-flex;align-items:center;gap:6px;\n `;const t=document.createElement("span");t.textContent=e.folder.name;const n=document.createElement("span");return n.style.cssText="background:rgba(0,0,0,0.18);border-radius:10px;padding:1px 5px;font-size:10px;",n.textContent=String(e.eventCount),r.appendChild(t),r.appendChild(n),r},le=(e,r)=>{const t=document.createElement("div");if(t.style.cssText=`\n width:36px;height:36px;cursor:pointer;\n background:${e};border-radius:50% 50% 50% 0;transform:rotate(-45deg);\n border:2px solid white;box-shadow:0 2px 8px rgba(0,0,0,0.3);\n display:flex;align-items:center;justify-content:center;overflow:hidden;\n `,r){const e=document.createElement("img");e.src=p(r)??"",e.style.cssText="width:24px;height:24px;border-radius:50%;object-fit:cover;transform:rotate(45deg);",t.appendChild(e)}return t},ue=({apiKey:l,mapId:d="DEMO_MAP_ID",onExplore:p,logoUrl:g})=>{const y=t(null),k=t(null),v=t(null),x=t(null),w=t(null),E=t([]),C=t([]),M=t(null),j=t(!1),A=t(!1),[L,q]=n(!1),[O,I]=n(!0),[S,_]=n(!1),{folderTree:z,activeFolderId:P,activeFolder:T,visibleEvents:U,setActiveFolderId:N,isLoadingEvents:$}=m(),{organization:B}=c(),F=o(B)["--primary"],Z=`${u}-${B?._id??"unknown"}`,D=t(Z);D.current=Z;const R=s(()=>(e=>{try{const r=sessionStorage.getItem(e);if(!r)return null;const t=JSON.parse(r);if(Array.isArray(t?.center)&&"number"==typeof t.zoom)return t}catch{}return null})(Z),[Z]),G=t(/* @__PURE__ */new Map),V=t(/* @__PURE__ */new Map),K=t(null),W=t(null),J=t(p);J.current=p;const X=(e,r,t,n,s)=>{s.event.addListenerOnce(e,"bounds_changed",()=>{const r=e.getZoom();void 0!==r&&r>n&&e.setZoom(n)}),e.fitBounds(r,t)},H=()=>{E.current.forEach(e=>{e.map=null}),E.current=[]},Q=()=>{M.current&&(M.current.clearMarkers(),M.current=null),C.current.forEach(e=>{e.map=null}),C.current=[]};return r(()=>{if(!y.current||k.current)return;let r=!1;return(async()=>{try{const{setOptions:t,importLibrary:n}=await import("./ob_CTelx.js");if(r)return;if(t({key:l,v:"weekly"}),await Promise.all([n("maps"),n("marker")]),r||!y.current)return;const s=window.google.maps;v.current=s;const a=R?.center?{lng:R.center[0],lat:R.center[1]}:{lat:20,lng:0},o=R?.zoom??3,i=new s.Map(y.current,{mapId:d,renderingType:"VECTOR",mapTypeId:"roadmap",center:a,zoom:o,mapTypeControl:!1,streetViewControl:!1});k.current=i,x.current=new s.InfoWindow({maxWidth:280}),x.current.addListener("closeclick",()=>{w.current&&(e(null,w.current),w.current=null)});const c=()=>{try{const e=i.getCenter();if(!e)return;sessionStorage.setItem(D.current,JSON.stringify({center:[e.lng(),e.lat()],zoom:i.getZoom()}))}catch{}};i.addListener("idle",c),I(!1),q(!0)}catch{r||_(!0)}finally{r||I(!1)}})(),()=>{r=!0,H(),Q(),x.current?.close(),w.current&&(e(null,w.current),w.current=null),k.current=null,v.current=null}},[l]),r(()=>{if(!L)return;const r=k.current,t=v.current;if(!r||!t)return;const n=null===P&&z.length>0,s=!n&&0===z.length&&null===P,o=n?"folders":s?"all-events":"folder-events";if(K.current!==o&&(H(),Q(),V.current.clear(),G.current.clear(),W.current=null,x.current?.close(),K.current=o),n){const e=[],n=r=>{for(const t of r)t.centroid?e.push(t):t.children.length>0&&n(t.children)};n(z);const s=new Set(e.map(e=>e.folder._id));for(const[r,t]of V.current)s.has(r)||(t.map=null,V.current.delete(r));E.current=Array.from(V.current.values());for(const a of e){const e=V.current.get(a.folder._id);if(e){e.position={lng:a.centroid[0],lat:a.centroid[1]};continue}const n=ce(a),s=new t.marker.AdvancedMarkerElement({map:r,position:{lng:a.centroid[0],lat:a.centroid[1]},content:n,gmpClickable:!0});s.addListener("click",()=>N(a.folder._id)),V.current.set(a.folder._id,s),E.current.push(s)}}else{if(0===U.length){for(const e of G.current.values())"all-events"===o?M.current?.removeMarker(e,!0):e.map=null;return G.current.clear(),void(C.current=[])}const n=s?F:T?.color||F,c=`${n}|${g??""}`,l=W.current!==c;W.current=c;const u=new Set(U.map(e=>String(e._id))),m=[];for(const[e,r]of G.current)u.has(e)||(m.push(r),G.current.delete(e));m.length>0&&M.current?.removeMarkers(m,!0);const d=[],p=new t.LatLngBounds;U.forEach(s=>{const o=String(s._id),c=s.location.y,u=s.location.x;p.extend({lat:c,lng:u});const m=G.current.get(o);if(m)return m.position={lat:c,lng:u},void(l&&(m.content=le(n,g)));const h=le(n,g),b=new t.marker.AdvancedMarkerElement({map:r,position:{lat:c,lng:u},content:h,gmpClickable:!0});b.addListener("click",()=>{w.current&&e(null,w.current);const t=document.createElement("div");((r,t)=>{e(/* @__PURE__ */a(i,{client:ie,children:/* @__PURE__ */a(f,{event:r,onExplore:e=>J.current?.(e)})}),t)})(s,t),x.current?.close(),x.current?.setContent(t),x.current?.open({anchor:b,map:r}),w.current=t}),G.current.set(o,b),d.push(b)}),C.current=Array.from(G.current.values()),l&&M.current&&(M.current.clearMarkers(),M.current=null),(d.length>0||m.length>0||l)&&(M.current?(d.length>0&&M.current.addMarkers(d,!0),M.current.render()):M.current=new ae({markers:C.current,map:r,renderer:{render:e=>{const{count:r,position:s}=e,a=document.createElement("div"),o=r<10?28:r<30?34:40;return a.style.cssText=`\n width:${o}px;height:${o}px;border-radius:50%;cursor:pointer;\n background:${n};color:#fff;\n display:flex;align-items:center;justify-content:center;\n font-size:13px;font-weight:700;\n box-shadow:0 2px 8px rgba(0,0,0,0.3);\n border:2px solid rgba(255,255,255,0.6);\n `,a.textContent=String(r),new t.marker.AdvancedMarkerElement({position:s,content:a,gmpClickable:!0,zIndex:1e6+r})}}})),s&&(A.current||(A.current=!0,R||p.isEmpty()||X(r,p,oe,8,t)))}},[P,z,U,L,g,N,T,R]),r(()=>{if(!L)return;const e=k.current,r=v.current;if(e&&r)if(j.current||!R){if(j.current=!0,P){const t=h(z,P);if(!t?.folder.boundary?.length)return;const n=new r.LatLngBounds;for(const e of t.folder.boundary)n.extend({lat:e.y,lng:e.x});n.isEmpty()||X(e,n,oe,14,r)}else if(z.length>0){const t=new r.LatLngBounds,n=e=>{for(const r of e)r.centroid?t.extend({lng:r.centroid[0],lat:r.centroid[1]}):n(r.children)};n(z),t.isEmpty()||X(e,t,oe,8,r)}}else j.current=!0},[P,z,L,R]),/* @__PURE__ */a("div",{class:"relative h-screen w-full sm:h-[calc(100vh-4rem)]",style:o(B),children:[
|
|
2
|
-
/* @__PURE__ */a(b,{positionClass:"absolute top-3 left-16 z-[1000]",folderTree:z,activeFolderId:P,setActiveFolderId:N}),$&&/* @__PURE__ */a("div",{class:"absolute inset-0 z-10 flex items-center justify-center bg-white/60",children:/* @__PURE__ */a("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"})}),O&&/* @__PURE__ */a("div",{class:"absolute inset-0 z-20 flex items-center justify-center bg-white/85",children:/* @__PURE__ */a("div",{class:"flex flex-col items-center gap-3",children:[/* @__PURE__ */a("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"}),/* @__PURE__ */a("p",{class:"text-sm font-medium text-slate-700",children:"Loading map…"})]})}),S&&!O&&/* @__PURE__ */a("div",{class:"absolute inset-0 z-20 flex items-center justify-center bg-white/90",children:/* @__PURE__ */a("div",{class:"max-w-sm px-6 text-center",children:[/* @__PURE__ */a("p",{class:"font-medium text-slate-800",children:"Google Maps could not be loaded."}),/* @__PURE__ */a("p",{class:"mt-1 text-sm text-slate-600",children:"Check the organization API key and allowed referrer domains."})]})}),
|
|
3
|
-
/* @__PURE__ */a("div",{ref:y,class:"size-full"})]})};export{ue as default};
|
package/element/rlutojb0.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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};
|
package/element/tbcqJrU_2.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
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
|
-
/* @__PURE__ */t(n,{className:"mx-auto mt-4 h-8 w-64"}),
|
|
3
|
-
/* @__PURE__ */t(n,{className:"mx-auto mt-6 h-6 w-72"}),
|
|
4
|
-
/* @__PURE__ */t(n,{className:"mx-auto mt-6 h-8 w-72"}),
|
|
5
|
-
/* @__PURE__ */t("div",{className:"mt-8 grid grid-cols-1 gap-4 sm:grid-cols-3",children:Array.from({length:8}).map((s,o)=>/* @__PURE__ */t(n,{className:"h-72"},o))})]});const j=N?.organizationId?.toString?.()||N?.organizationId,w=h?.toString?.()||h,x=N?.folderId?.toString?.()||N?.folderId,S=v?.some(t=>t._id===x)?x:void 0;/* @__PURE__ */
|
|
6
|
-
return t("div",N&&j===w?{className:"bg-background relative min-h-screen",children:/* @__PURE__ */t(d,{locale:N?.language??"en",translations:N?.translations,children:[
|
|
7
|
-
/* @__PURE__ */t(m,{to:S?o.FOLDER_EVENTS(S):o.PUBLIC_EVENTS}),
|
|
8
|
-
/* @__PURE__ */t(r,{}),
|
|
9
|
-
/* @__PURE__ */t(l,{})]})}:{className:"flex w-full flex-col items-center gap-8",children:[/* @__PURE__ */t(i,{className:"mt-16",title:"Event not found",description:"Please check the provided link",iconSvg:/* @__PURE__ */t("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-full",viewBox:"0 0 997.86122 450.8081",role:"img"})}),/* @__PURE__ */t(e,{to:o.PUBLIC_EVENTS,state:{internalNavigation:!0},children:/* @__PURE__ */t(g,{children:"All events"})})]})};export{f as default};
|
package/element/xPoQq2aN2.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
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
|
-
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
|
-
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__ */
|
|
5
|
-
return e("div",{className:a("flex w-full flex-col items-center justify-center rounded-xl p-4 text-center sm:min-w-36","bg-linear-to-b",n.gradient),children:[o?/* @__PURE__ */e(s,{className:a(n.size,{1:"text-amber-400",2:"text-slate-400",3:"text-amber-600"}[l])}):/* @__PURE__ */e("div",{className:"relative",children:[/* @__PURE__ */e("img",{className:a(n.imageSize,"shadow-card scale-100 rounded-full border-4 object-cover",n.borderColor),src:t.image,alt:t.name??"",loading:"lazy",onError:c}),/* @__PURE__ */e("span",{className:a("shadow-card absolute -bottom-2 left-1/2 z-10 flex size-7 -translate-x-1/2 items-center justify-center rounded-full border-2 text-sm font-bold",d[l].bg,d[l].border,d[l].text),children:l})]}),/* @__PURE__ */e("div",{className:"mt-3 space-y-3 text-center",children:[/* @__PURE__ */e(m,{variant:"h6",lines:2,className:"max-w-24",align:"center",children:w(t.name)}),/* @__PURE__ */e("div",{className:"text-primary text-lg font-bold",children:j(t,i)})]})]})},P=({title:t,entries:l=[],showFloatingPoint:i=!1,hidePictures:o=!0})=>{const{t:n}=f(),s=t.replace(/\s+/g,"-").toLowerCase(),d=r(e=>{e.currentTarget.style.display="none"},[]);/* @__PURE__ */
|
|
6
|
-
return e("div",{className:"border-border mx-auto flex max-w-2xl flex-col rounded border p-4 sm:p-5 lg:p-6",children:[/* @__PURE__ */e("div",{className:"mb-4 flex items-center justify-center gap-2",children:[/* @__PURE__ */e(p,{className:"text-primary size-6"}),/* @__PURE__ */e(m,{variant:"h4",align:"center",color:"primary",children:t})]}),0===l.length?/* @__PURE__ */e("div",{className:"py-16 text-center",children:[/* @__PURE__ */e(m,{variant:"h5",align:"center",color:"error",children:n("leaderboard.not_available","No data available")}),/* @__PURE__ */e(m,{variant:"body2",align:"center",color:"muted",className:"mt-2",children:n("leaderboard.come_back_later","Check back later for updates.")})]}):/* @__PURE__ */e("div",{children:[/* @__PURE__ */e("div",{className:"flex items-end justify-center gap-2 lg:gap-8",children:[l.length>1&&/* @__PURE__ */e(z,{entry:l[1],position:2,showFloatingPoint:i,hidePictures:o}),l.length>0&&/* @__PURE__ */e(z,{entry:l[0],position:1,showFloatingPoint:i,hidePictures:o}),l.length>2&&/* @__PURE__ */e(z,{entry:l[2],position:3,showFloatingPoint:i,hidePictures:o})]}),/* @__PURE__ */e("div",{className:"mt-6 overflow-hidden rounded ring-1 ring-black/5",children:/* @__PURE__ */e("div",{className:"divide-border divide-y",children:l.slice(3).map((r,t)=>/* @__PURE__ */e("div",{className:a("hover:bg-primary/5 flex items-center gap-4 px-4 py-3",t%2==0?"bg-primary/5":"bg-background"),children:[
|
|
7
|
-
/* @__PURE__ */e("span",{className:"text-muted-foreground w-8 text-center text-sm font-medium",children:t+4}),!o&&/* @__PURE__ */e("img",{className:"ring-border size-10 rounded-full object-cover ring-2",src:r.image,alt:r.name??"",loading:"lazy",onError:d}),
|
|
8
|
-
/* @__PURE__ */e("div",{className:"min-w-0 flex-1",children:/* @__PURE__ */e("div",{className:"truncate font-medium",children:w(r.name)})}),
|
|
9
|
-
/* @__PURE__ */e("div",{className:"text-primary text-right font-semibold",children:j(r,i)})]},`${s}-${r.name??""}-${r.totalPoint??r.maxScore??""}-${r.image??t}`))})})]})]})},S=()=>{const{eventSlug:r}=d(),{props:p}=l(),{t:u}=f(),v=p?.organizationId,{event:N,loading:w}=b({eventSlug:r}),{isLoading:y,isError:j,error:z,data:S}=t({queryKey:[`leaderboard-${v}-${N?._id}`],queryFn:async()=>(await i.get(n.GET_LEADERBOARD,{headers:{"x-org-id":v??""},searchParams:{eventId:N?._id??"",projection:"connect"}}).json()).data,enabled:Boolean(N),staleTime:3e4,gcTime:3e5});return w||y?/* @__PURE__ */e("div",{className:"bg-background mt-4 flex min-h-[80vh] w-full flex-col gap-6 px-2 py-4 sm:px-0 lg:py-8",children:[/* @__PURE__ */e("div",{className:"flex flex-col items-center gap-2 text-center",children:[/* @__PURE__ */e(h,{className:"h-5 w-28 rounded-full"}),/* @__PURE__ */e(h,{className:"h-10 w-64 rounded"})]}),/* @__PURE__ */e("div",{className:a("flex w-full gap-8 lg:gap-0",N?.engagementStyle===o.REACTION?"flex-col-reverse md:flex-row-reverse md:justify-between":"flex-col md:flex-row"),children:[/* @__PURE__ */e("div",{className:"flex-1",children:[/* @__PURE__ */e(h,{className:"h-72 w-full rounded"}),/* @__PURE__ */e(h,{className:"mt-4 h-72 w-full rounded"})]}),/* @__PURE__ */e("div",{className:"flex-1",children:/* @__PURE__ */e(h,{className:"h-72 w-full rounded"})})]})]}):j?/* @__PURE__ */e("div",{className:"bg-background mt-4 flex min-h-[80vh] w-full flex-col items-center justify-center gap-4 px-2 py-4 text-center sm:px-0 lg:py-8",children:[
|
|
10
|
-
/* @__PURE__ */e(x,{className:"size-9 text-destructive"}),
|
|
11
|
-
/* @__PURE__ */e(m,{variant:"h4",color:"error",align:"center",children:u("common.error","Something went wrong")}),
|
|
12
|
-
/* @__PURE__ */e(m,{variant:"body2",color:"muted",align:"center",children:z instanceof Error?z.message:u("common.try_again","Please try again later.")})]}):!1===N?.showLeaderboard?/* @__PURE__ */e(g,{title:u("leaderboard.not_available","Leaderboard not available"),description:u("leaderboard.disabled","Leaderboard is not available for this event.")}):/* @__PURE__ */e("div",{className:"bg-background mt-4 flex min-h-[80vh] w-full flex-col gap-6 px-2 py-4 sm:px-0 lg:py-8",children:[/* @__PURE__ */e("div",{className:"flex flex-col items-center gap-2 text-center",children:[
|
|
13
|
-
/* @__PURE__ */e("div",{className:"text-primary flex items-center gap-2",children:/* @__PURE__ */e(m,{variant:"h5",color:"primary",children:u("leaderboard.leaderboard","Leaderboard")})}),
|
|
14
|
-
/* @__PURE__ */e(m,{variant:"h4",align:"center",color:"foreground",children:N?.name}),N?.slug&&/* @__PURE__ */e(c,{to:s.GALLERY(N.slug),state:{internalNavigation:!0},className:"text-primary text-sm font-medium underline-offset-4 hover:underline",children:u("leaderboard.back_to_gallery","Back to Gallery")})]}),/* @__PURE__ */e("div",{className:a("flex w-full gap-8 lg:gap-0",N?.engagementStyle===o.REACTION?"flex-col-reverse md:flex-row-reverse md:justify-between":"flex-col md:flex-row"),children:[/* @__PURE__ */e("div",{className:"flex-1",children:/* @__PURE__ */e(P,{title:u("leaderboard.point_leaders","Top Points Leaders"),entries:S?.leaderboardByPoint?.topRankers||[],pointName:N?.pointName})}),/* @__PURE__ */e("div",{className:"flex-1",children:/* @__PURE__ */e(P,{title:N?.engagementStyle===o.REACTION?u("leaderboard.reaction_counts","Top Reactions"):u("leaderboard.top_rated_photos","Top Rated Photos"),showFloatingPoint:N?.engagementStyle===o.CONTEST,entries:S?.leaderboardByScore?.topRankers||[],pointName:N?.pointName})})]})]})};export{S as default};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|