PageSourceSearch

https://www.reversenetworkmeets.com/assets/index-9wd7-dWc.js

js reversenetworkmeets.com collected 2026-10-05 08:53:32 UTC 1,116,906 bytes, 433 lines download raw bytes

vendor: 4,140 bytes, lines 1-9
1var Zb=e=>{throw TypeError(e)};var Jm=(e,t,n)=>t.has(e)||Zb("Cannot "+n);var O=(e,t,n)=>(Jm(e,t,"read from private field"),n?n.call(e):t.get(e)),Ce=(e,t,n)=>t.has(e)?Zb("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),he=(e,t,n,r)=>(Jm(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),De=(e,t,n)=>(Jm(e,t,"access private method"),n);var pf=(e,t,n,r)=>({set _(s){he(e,t,s,n)},get _(){return O(e,t,r)}});function LI(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(r,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function FS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zS={exports:{}},Pp={},BS={exports:{}},Be={};/**
2 * @license React
3 * react.production.min.js
4 *
5 * Copyright (c) Facebook, Inc. and its affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var Ld=Symbol.for("react.element"),DI=Symbol.for("react.portal"),$I=Symbol.for("react.fragment"),UI=Symbol.for("react.strict_mode"),FI=Symbol.for("react.profiler"),zI=Symbol.for("react.provider"),BI=Symbol.for("react.context"),WI=Symbol.for("react.forward_ref"),HI=Symbol.for("react.suspense"),KI=Symbol.for("react.memo"),qI=Symbol.for("react.lazy"),e0=Symbol.iterator;function VI(e){return e===null||typeof e!="object"?null:(e=e0&&e[e0]||e["@@iterator"],typeof e=="function"?e:null)}var WS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},HS=Object.assign,KS={};function Ic(e,t,n){this.props=e,this.context=t,this.refs=KS,this.updater=n||WS}Ic.prototype.isReactComponent={};Ic.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ic.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function qS(){}qS.prototype=Ic.prototype;function jw(e,t,n){this.props=e,this.context=t,this.refs=KS,this.updater=n||WS}var Nw=jw.prototype=new qS;Nw.constructor=jw;HS(Nw,Ic.prototype);Nw.isPureReactComponent=!0;var t0=Array.isArray,VS=Object.prototype.hasOwnProperty,Tw={current:null},YS={key:!0,ref:!0,__self:!0,__source:!0};function GS(e,t,n){var r,s={},o=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)VS.call(t,r)&&!YS.hasOwnProperty(r)&&(s[r]=t[r]);var l=arguments.length-2;if(l===1)s.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];s.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)s[r]===void 0&&(s[r]=l[r]);return{$$typeof:Ld,type:e,key:o,ref:a,props:s,_owner:Tw.current}}function YI(e,t){return{$$typeof:Ld,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Pw(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ld}function GI(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var n0=/\/+/g;function Qm(e,t){return typeof e=="object"&&e!==null&&e.key!=null?GI(""+e.key):t.toString(36)}
vendor: 4,788 bytes, lines 9-17
9function nh(e,t,n,r,s){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(o){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case Ld:case DI:a=!0}}if(a)return a=e,s=s(a),e=r===""?"."+Qm(a,0):r,t0(s)?(n="",e!=null&&(n=e.replace(n0,"$&/")+"/"),nh(s,t,n,"",function(u){return u})):s!=null&&(Pw(s)&&(s=YI(s,n+(!s.key||a&&a.key===s.key?"":(""+s.key).replace(n0,"$&/")+"/")+e)),t.push(s)),1;if(a=0,r=r===""?".":r+":",t0(e))for(var l=0;l<e.length;l++){o=e[l];var c=r+Qm(o,l);a+=nh(o,t,n,c,s)}else if(c=VI(e),typeof c=="function")for(e=c.call(e),l=0;!(o=e.next()).done;)o=o.value,c=r+Qm(o,l++),a+=nh(o,t,n,c,s);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function mf(e,t,n){if(e==null)return e;var r=[],s=0;return nh(e,r,"","",function(o){return t.call(n,o,s++)}),r}function JI(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var gr={current:null},rh={transition:null},QI={ReactCurrentDispatcher:gr,ReactCurrentBatchConfig:rh,ReactCurrentOwner:Tw};function JS(){throw Error("act(...) is not supported in production builds of React.")}Be.Children={map:mf,forEach:function(e,t,n){mf(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return mf(e,function(){t++}),t},toArray:function(e){return mf(e,function(t){return t})||[]},only:function(e){if(!Pw(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Be.Component=Ic;Be.Fragment=$I;Be.Profiler=FI;Be.PureComponent=jw;Be.StrictMode=UI;Be.Suspense=HI;Be.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=QI;Be.act=JS;Be.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=HS({},e.props),s=e.key,o=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,a=Tw.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)VS.call(t,c)&&!YS.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:Ld,type:e.type,key:s,ref:o,props:r,_owner:a}};Be.createContext=function(e){return e={$$typeof:BI,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:zI,_context:e},e.Consumer=e};Be.createElement=GS;Be.createFactory=function(e){var t=GS.bind(null,e);return t.type=e,t};Be.createRef=function(){return{current:null}};Be.forwardRef=function(e){return{$$typeof:WI,render:e}};Be.isValidElement=Pw;Be.lazy=function(e){return{$$typeof:qI,_payload:{_status:-1,_result:e},_init:JI}};Be.memo=function(e,t){return{$$typeof:KI,type:e,compare:t===void 0?null:t}};Be.startTransition=function(e){var t=rh.transition;rh.transition={};try{e()}finally{rh.transition=t}};Be.unstable_act=JS;Be.useCallback=function(e,t){return gr.current.useCallback(e,t)};Be.useContext=function(e){return gr.current.useContext(e)};Be.useDebugValue=function(){};Be.useDeferredValue=function(e){return gr.current.useDeferredValue(e)};Be.useEffect=function(e,t){return gr.current.useEffect(e,t)};Be.useId=function(){return gr.current.useId()};Be.useImperativeHandle=function(e,t,n){return gr.current.useImperativeHandle(e,t,n)};Be.useInsertionEffect=function(e,t){return gr.current.useInsertionEffect(e,t)};Be.useLayoutEffect=function(e,t){return gr.current.useLayoutEffect(e,t)};Be.useMemo=function(e,t){return gr.current.useMemo(e,t)};Be.useReducer=function(e,t,n){return gr.current.useReducer(e,t,n)};Be.useRef=function(e){return gr.current.useRef(e)};Be.useState=function(e){return gr.current.useState(e)};Be.useSyncExternalStore=function(e,t,n){return gr.current.useSyncExternalStore(e,t,n)};Be.useTransition=function(){return gr.current.useTransition()};Be.version="18.3.1";BS.exports=Be;var d=BS.exports;const le=FS(d),QS=LI({__proto__:null,default:le},[d]);/**
10 * @license React
11 * react-jsx-runtime.production.min.js
12 *
13 * Copyright (c) Facebook, Inc. and its affiliates.
14 *
15 * This source code is licensed under the MIT license found in the
16 * LICENSE file in the root directory of this source tree.
17 */var XI=d,ZI=Symbol.for("react.element"),eO=Symbol.for("react.fragment"),tO=Object.prototype.hasOwnProperty,nO=XI.__SECRET_INT
vendor: 11,397 bytes, lines 17-34
17ERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,rO={key:!0,ref:!0,__self:!0,__source:!0};function XS(e,t,n){var r,s={},o=null,a=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)tO.call(t,r)&&!rO.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:ZI,type:e,key:o,ref:a,props:s,_owner:nO.current}}Pp.Fragment=eO;Pp.jsx=XS;Pp.jsxs=XS;zS.exports=Pp;var i=zS.exports,ZS={exports:{}},ts={},eC={exports:{}},tC={};/**
18 * @license React
19 * scheduler.production.min.js
20 *
21 * Copyright (c) Facebook, Inc. and its affiliates.
22 *
23 * This source code is licensed under the MIT license found in the
24 * LICENSE file in the root directory of this source tree.
25 */(function(e){function t(j,N){var W=j.length;j.push(N);e:for(;0<W;){var G=W-1>>>1,L=j[G];if(0<s(L,N))j[G]=N,j[W]=L,W=G;else break e}}function n(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var N=j[0],W=j.pop();if(W!==N){j[0]=W;e:for(var G=0,L=j.length,K=L>>>1;G<K;){var J=2*(G+1)-1,Z=j[J],ce=J+1,q=j[ce];if(0>s(Z,W))ce<L&&0>s(q,Z)?(j[G]=q,j[ce]=W,G=ce):(j[G]=Z,j[J]=W,G=J);else if(ce<L&&0>s(q,W))j[G]=q,j[ce]=W,G=ce;else break e}}return N}function s(j,N){var W=j.sortIndex-N.sortIndex;return W!==0?W:j.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],u=[],f=1,p=null,h=3,m=!1,v=!1,g=!1,x=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(j){for(var N=n(u);N!==null;){if(N.callback===null)r(u);else if(N.startTime<=j)r(u),N.sortIndex=N.expirationTime,t(c,N);else break;N=n(u)}}function _(j){if(g=!1,b(j),!v)if(n(c)!==null)v=!0,U(k);else{var N=n(u);N!==null&&D(_,N.startTime-j)}}function k(j,N){v=!1,g&&(g=!1,w(A),A=-1),m=!0;var W=h;try{for(b(N),p=n(c);p!==null&&(!(p.expirationTime>N)||j&&!P());){var G=p.callback;if(typeof G=="function"){p.callback=null,h=p.priorityLevel;var L=G(p.expirationTime<=N);N=e.unstable_now(),typeof L=="function"?p.callback=L:p===n(c)&&r(c),b(N)}else r(c);p=n(c)}if(p!==null)var K=!0;else{var J=n(u);J!==null&&D(_,J.startTime-N),K=!1}return K}finally{p=null,h=W,m=!1}}var C=!1,E=null,A=-1,T=5,M=-1;function P(){return!(e.unstable_now()-M<T)}function $(){if(E!==null){var j=e.unstable_now();M=j;var N=!0;try{N=E(!0,j)}finally{N?H():(C=!1,E=null)}}else C=!1}var H;if(typeof y=="function")H=function(){y($)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,B=z.port2;z.port1.onmessage=$,H=function(){B.postMessage(null)}}else H=function(){x($,0)};function U(j){E=j,C||(C=!0,H())}function D(j,N){A=x(function(){j(e.unstable_now())},N)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(j){j.callback=null},e.unstable_continueExecution=function(){v||m||(v=!0,U(k))},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(j){switch(h){case 1:case 2:case 3:var N=3;break;default:N=h}var W=h;h=N;try{return j()}finally{h=W}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(j,N){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var W=h;h=j;try{return N()}finally{h=W}},e.unstable_scheduleCallback=function(j,N,W){var G=e.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?G+W:G):W=G,j){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=W+L,j={id:f++,callback:N,priorityLevel:j,startTime:W,expirationTime:L,sortIndex:-1},W>G?(j.sortIndex=W,t(u,j),n(c)===null&&j===n(u)&&(g?(w(A),A=-1):g=!0,D(_,W-G))):(j.sortIndex=L,t(c,j),v||m||(v=!0,U(k))),j},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(j){var N=h;return function(){var W=h;h=N;try{return j.apply(this,arguments)}finally{h=W}}}})(tC);eC.exports=tC;var sO=eC.exports;/**
26 * @license React
27 * react-dom.production.min.js
28 *
29 * Copyright (c) Facebook, Inc. and its affiliates.
30 *
31 * This source code is licensed under the MIT license found in the
32 * LICENSE file in the root directory of this source tree.
33 */var oO=d,Zr=sO;function se(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var nC=new Set,Ju={};function qa(e,t){wc(e,t),wc(e+"Capture",t)}function wc(e,t){for(Ju[e]=t,e=0;e<t.length;e++)nC.add(t[e])}var Po=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ey=Object.prototype.hasOwnProperty,iO=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,r0={},s0={};function aO(e){return Ey.call(s0,e)?!0:Ey.call(r0,e)?!1:iO.test(e)?s0[e]=!0:(r0[e]=!0,!1)}function lO(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function cO(e,t,n,r){if(t===null||typeof t>"u"||lO(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function yr(e,t,n,r,s,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var Jn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Jn[e]=new yr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Jn[t]=new yr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Jn[e]=new yr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Jn[e]=new yr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Jn[e]=new yr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Jn[e]=new yr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Jn[e]=new yr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Jn[e]=new yr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Jn[e]=new yr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Rw=/[\-:]([a-z])/g;function Aw(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Rw,Aw);Jn[t]=new yr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Rw,Aw);Jn[t]=new yr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Rw,Aw);Jn[t]=new yr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Jn[e]=new yr(e,1,!1,e.toLowerCase(),null,!1,!1)});Jn.xlinkHref=new yr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Jn[e]=new yr(e,1,!1,e.toLowerCase(),null,!0,!0)});function Iw(e,t,n,r){var s=Jn.hasOwnProperty(t)?Jn[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(cO(t,n,s,r)&&(n=null),r||s===null?aO(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var $o=oO.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,gf=Symbol.for("react.element"),Rl=Symbol.for("react.portal"),Al=Symbol.for("react.fragment"),Ow=Symbol.for("react.strict_mode"),jy=Symbol.for("react.profiler"),rC=Symbol.for("react.provider"),sC=Symbol.for("react.context"),Mw=Symbol.for("react.forward_ref"),Ny=Symbol.for("react.suspense"),Ty=Symbol.for("react.suspense_list"),Lw=Symbol.for("react.memo"),ri=Symbol.for("react.lazy"),oC=Symbol.for("react.offscreen"),o0=Symbol.iterator;function su(e){return e===null||typeof e!="object"?null:(e=o0&&e[o0]||e["@@iterator"],typeof e=="function"?e:null)}var hn=Object.assign,Xm;function bu(e){if(Xm===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Xm=t&&t[1]||""}return`
34`+Xm+e}var Zm=!1;function eg(e,t){if(!e||Zm)return"";Zm=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}
vendor: 5,499 bytes, lines 34-37
34catch(u){if(u&&r&&typeof u.stack=="string"){for(var s=u.stack.split(`
35`),o=r.stack.split(`
36`),a=s.length-1,l=o.length-1;1<=a&&0<=l&&s[a]!==o[l];)l--;for(;1<=a&&0<=l;a--,l--)if(s[a]!==o[l]){if(a!==1||l!==1)do if(a--,l--,0>l||s[a]!==o[l]){var c=`
37`+s[a].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=a&&0<=l);break}}}finally{Zm=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?bu(e):""}function uO(e){switch(e.tag){case 5:return bu(e.type);case 16:return bu("Lazy");case 13:return bu("Suspense");case 19:return bu("SuspenseList");case 0:case 2:case 15:return e=eg(e.type,!1),e;case 11:return e=eg(e.type.render,!1),e;case 1:return e=eg(e.type,!0),e;default:return""}}function Py(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Al:return"Fragment";case Rl:return"Portal";case jy:return"Profiler";case Ow:return"StrictMode";case Ny:return"Suspense";case Ty:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case sC:return(e.displayName||"Context")+".Consumer";case rC:return(e._context.displayName||"Context")+".Provider";case Mw:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Lw:return t=e.displayName||null,t!==null?t:Py(e.type)||"Memo";case ri:t=e._payload,e=e._init;try{return Py(e(t))}catch{}}return null}function dO(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Py(t);case 8:return t===Ow?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ii(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function iC(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function fO(e){var t=iC(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yf(e){e._valueTracker||(e._valueTracker=fO(e))}function aC(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=iC(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Th(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ry(e,t){var n=t.checked;return hn({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function i0(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ii(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function lC(e,t){t=t.checked,t!=null&&Iw(e,"checked",t,!1)}function Ay(e,t){lC(e,t);var n=Ii(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Iy(e,t.type,n):t.hasOwnProperty("defaultValue")&&Iy(e,t.type,Ii(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function a0(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Iy(e,t,n){(t!=="number"||Th(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var _u=Array.isArray;function Yl(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Ii(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Oy(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(se(91));return hn({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function l0(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(se(92));
vendor: 8,607 bytes, line 37
37if(_u(n)){if(1<n.length)throw Error(se(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Ii(n)}}function cC(e,t){var n=Ii(t.value),r=Ii(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function c0(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function uC(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function My(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?uC(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var vf,dC=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(vf=vf||document.createElement("div"),vf.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=vf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Qu(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Pu={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},hO=["Webkit","ms","Moz","O"];Object.keys(Pu).forEach(function(e){hO.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Pu[t]=Pu[e]})});function fC(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Pu.hasOwnProperty(e)&&Pu[e]?(""+t).trim():t+"px"}function hC(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=fC(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var pO=hn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ly(e,t){if(t){if(pO[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(se(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(se(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(se(61))}if(t.style!=null&&typeof t.style!="object")throw Error(se(62))}}function Dy(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var $y=null;function Dw(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Uy=null,Gl=null,Jl=null;function u0(e){if(e=Ud(e)){if(typeof Uy!="function")throw Error(se(280));var t=e.stateNode;t&&(t=Mp(t),Uy(e.stateNode,e.type,t))}}function pC(e){Gl?Jl?Jl.push(e):Jl=[e]:Gl=e}function mC(){if(Gl){var e=Gl,t=Jl;if(Jl=Gl=null,u0(e),t)for(e=0;e<t.length;e++)u0(t[e])}}function gC(e,t){return e(t)}function yC(){}var tg=!1;function vC(e,t,n){if(tg)return e(t,n);tg=!0;try{return gC(e,t,n)}finally{tg=!1,(Gl!==null||Jl!==null)&&(yC(),mC())}}function Xu(e,t){var n=e.stateNode;if(n===null)return null;var r=Mp(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(se(231,t,typeof n));return n}var Fy=!1;if(Po)try{var ou={};Object.defineProperty(ou,"passive",{get:function(){Fy=!0}}),window.addEventListener("test",ou,ou),window.removeEventListener("test",ou,ou)}catch{Fy=!1}function mO(e,t,n,r,s,o,a,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(f){this.onError(f)}}var Ru=!1,Ph=null,Rh=!1,zy=null,gO={onError:function(e){Ru=!0,Ph=e}};function yO(e,t,n,r,s,o,a,l,c){Ru=!1,Ph=null,mO.apply(gO,arguments)}function vO(e,t,n,r,s,o,a,l,c){if(yO.apply(this,arguments),Ru){if(Ru){var u=Ph;Ru=!1,Ph=null}else throw Error(se(198));Rh||(Rh=!0,zy=u)}}function Va(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function wC(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d0(e){if(Va(e)!==e)throw Error(se(188))}function wO(e){var t=e.alternate;if(!t){if(t=Va(e),t===null)throw Error(se(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var o=s.alternate;if(o===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===o.child){for(o=s.child;o;){if(o===n)return d0(s),e;if(o===r)return d0(s),t;o=o.sibling}throw Error(se(188))}if(n.return!==r.return)n=s,r=o;else{for(var a=!1,l=s.child;l;){if(l===n){a=!0,n=s,r=o;break}if(l===r){a=!0,r=s,n=o;break}l=l.sibling}if(!a){for(l=o.child;l;){if(l===n){a=!0,n=o,r=s;break}if(l===r){a=!0,r=o,n=s;break}l=l.sibling}if(!a)throw Error(se(189))}}if(n.alternate!==r)throw Error(se(190))}if(n.tag!==3)throw Error(se(188));return n.stateNode.current===n?e:t}function xC(e){return e=wO(e),e!==null?bC(e):null}function bC(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=bC(e);if(t!==null)return t;e=e.sibling}return null}var _C=Zr.unstable_scheduleCallback,f0=Zr.unstable_cancelCallback,xO=Zr.unstable_shouldYield,bO=Zr.unstable_requestPaint,En=Zr.unstable_now,_O=Zr.unstable_getCurrentPriorityLevel,$w=Zr.unstable_ImmediatePriority,kC=Zr.unstable_UserBlockingPriority,Ah=Zr.unstable_NormalPriority,kO=Zr.unstable_LowPriority,SC=Zr.unstable_IdlePriority,Rp=null,Qs=null;function SO(e){if(Qs&&typeof Qs.onCommitFiberRoot=="function")try{Qs.onCommitFiberRoot(Rp,e,void 0,(e.current.flags&128)===128)}catch{}}var Rs=Math.clz32?Math.clz32:jO,CO=Math.log,EO=Math.LN2;function jO(e){return e>>>=0,e===0?32:31-(CO(e)/EO|0)|0}var wf=64,xf=4194304;function ku(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ih(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var l=a&~s;l!==0?r=ku(l):(o&=a,o!==0&&(r=ku(o)))}else a=n&~s,a!==0?r=ku(a):o!==0&&(r=ku(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,o=t&-t,s>=o||s===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Rs(t),s=1<<n,r|=e[n],t&=~s;return r}function NO(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function TO(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes;0<o;){var a=31-Rs(o),l=1<<a,c=s[a];c===-1?(!(l&n)||l&r)&&(s[a]=NO(l,t)):c<=t&&(e.expiredLanes|=l),o&=~l}}function By(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function CC(){var e=wf;return wf<<=1,!(wf&4194240)&&(wf=64),e}function ng(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}
vendor: 1,579 bytes, line 37
37function Dd(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Rs(t),e[t]=n}function PO(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-Rs(n),o=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~o}}function Uw(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Rs(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var Pt=0;function EC(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var jC,Fw,NC,TC,PC,Wy=!1,bf=[],bi=null,_i=null,ki=null,Zu=new Map,ed=new Map,ii=[],RO="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function h0(e,t){switch(e){case"focusin":case"focusout":bi=null;break;case"dragenter":case"dragleave":_i=null;break;case"mouseover":case"mouseout":ki=null;break;case"pointerover":case"pointerout":Zu.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ed.delete(t.pointerId)}}function iu(e,t,n,r,s,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[s]},t!==null&&(t=Ud(t),t!==null&&Fw(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function AO(e,t,n,r,s){switch(t){case"focusin":return bi=iu(bi,e,t,n,r,s
vendor: 12,909 bytes, line 37
37),!0;case"dragenter":return _i=iu(_i,e,t,n,r,s),!0;case"mouseover":return ki=iu(ki,e,t,n,r,s),!0;case"pointerover":var o=s.pointerId;return Zu.set(o,iu(Zu.get(o)||null,e,t,n,r,s)),!0;case"gotpointercapture":return o=s.pointerId,ed.set(o,iu(ed.get(o)||null,e,t,n,r,s)),!0}return!1}function RC(e){var t=ga(e.target);if(t!==null){var n=Va(t);if(n!==null){if(t=n.tag,t===13){if(t=wC(n),t!==null){e.blockedOn=t,PC(e.priority,function(){NC(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function sh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Hy(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);$y=r,n.target.dispatchEvent(r),$y=null}else return t=Ud(n),t!==null&&Fw(t),e.blockedOn=n,!1;t.shift()}return!0}function p0(e,t,n){sh(e)&&n.delete(t)}function IO(){Wy=!1,bi!==null&&sh(bi)&&(bi=null),_i!==null&&sh(_i)&&(_i=null),ki!==null&&sh(ki)&&(ki=null),Zu.forEach(p0),ed.forEach(p0)}function au(e,t){e.blockedOn===t&&(e.blockedOn=null,Wy||(Wy=!0,Zr.unstable_scheduleCallback(Zr.unstable_NormalPriority,IO)))}function td(e){function t(s){return au(s,e)}if(0<bf.length){au(bf[0],e);for(var n=1;n<bf.length;n++){var r=bf[n];r.blockedOn===e&&(r.blockedOn=null)}}for(bi!==null&&au(bi,e),_i!==null&&au(_i,e),ki!==null&&au(ki,e),Zu.forEach(t),ed.forEach(t),n=0;n<ii.length;n++)r=ii[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<ii.length&&(n=ii[0],n.blockedOn===null);)RC(n),n.blockedOn===null&&ii.shift()}var Ql=$o.ReactCurrentBatchConfig,Oh=!0;function OO(e,t,n,r){var s=Pt,o=Ql.transition;Ql.transition=null;try{Pt=1,zw(e,t,n,r)}finally{Pt=s,Ql.transition=o}}function MO(e,t,n,r){var s=Pt,o=Ql.transition;Ql.transition=null;try{Pt=4,zw(e,t,n,r)}finally{Pt=s,Ql.transition=o}}function zw(e,t,n,r){if(Oh){var s=Hy(e,t,n,r);if(s===null)fg(e,t,r,Mh,n),h0(e,r);else if(AO(s,e,t,n,r))r.stopPropagation();else if(h0(e,r),t&4&&-1<RO.indexOf(e)){for(;s!==null;){var o=Ud(s);if(o!==null&&jC(o),o=Hy(e,t,n,r),o===null&&fg(e,t,r,Mh,n),o===s)break;s=o}s!==null&&r.stopPropagation()}else fg(e,t,r,null,n)}}var Mh=null;function Hy(e,t,n,r){if(Mh=null,e=Dw(r),e=ga(e),e!==null)if(t=Va(e),t===null)e=null;else if(n=t.tag,n===13){if(e=wC(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Mh=e,null}function AC(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(_O()){case $w:return 1;case kC:return 4;case Ah:case kO:return 16;case SC:return 536870912;default:return 16}default:return 16}}var wi=null,Bw=null,oh=null;function IC(){if(oh)return oh;var e,t=Bw,n=t.length,r,s="value"in wi?wi.value:wi.textContent,o=s.length;for(e=0;e<n&&t[e]===s[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===s[o-r];r++);return oh=s.slice(e,1<r?1-r:void 0)}function ih(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function _f(){return!0}function m0(){return!1}function ns(e){function t(n,r,s,o,a){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=o,this.target=a,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(o):o[l]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?_f:m0,this.isPropagationStopped=m0,this}return hn(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=_f)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=_f)},persist:function(){},isPersistent:_f}),t}var Oc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ww=ns(Oc),$d=hn({},Oc,{view:0,detail:0}),LO=ns($d),rg,sg,lu,Ap=hn({},$d,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hw,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==lu&&(lu&&e.type==="mousemove"?(rg=e.screenX-lu.screenX,sg=e.screenY-lu.screenY):sg=rg=0,lu=e),rg)},movementY:function(e){return"movementY"in e?e.movementY:sg}}),g0=ns(Ap),DO=hn({},Ap,{dataTransfer:0}),$O=ns(DO),UO=hn({},$d,{relatedTarget:0}),og=ns(UO),FO=hn({},Oc,{animationName:0,elapsedTime:0,pseudoElement:0}),zO=ns(FO),BO=hn({},Oc,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),WO=ns(BO),HO=hn({},Oc,{data:0}),y0=ns(HO),KO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qO={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},VO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function YO(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=VO[e])?!!t[e]:!1}function Hw(){return YO}var GO=hn({},$d,{key:function(e){if(e.key){var t=KO[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ih(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?qO[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hw,charCode:function(e){return e.type==="keypress"?ih(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ih(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),JO=ns(GO),QO=hn({},Ap,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),v0=ns(QO),XO=hn({},$d,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hw}),ZO=ns(XO),e2=hn({},Oc,{propertyName:0,elapsedTime:0,pseudoElement:0}),t2=ns(e2),n2=hn({},Ap,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),r2=ns(n2),s2=[9,13,27,32],Kw=Po&&"CompositionEvent"in window,Au=null;Po&&"documentMode"in document&&(Au=document.documentMode);var o2=Po&&"TextEvent"in window&&!Au,OC=Po&&(!Kw||Au&&8<Au&&11>=Au),w0=" ",x0=!1;function MC(e,t){switch(e){case"keyup":return s2.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function LC(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Il=!1;function i2(e,t){switch(e){case"compositionend":return LC(t);case"keypress":return t.which!==32?null:(x0=!0,w0);case"textInput":return e=t.data,e===w0&&x0?null:e;default:return null}}function a2(e,t){if(Il)return e==="compositionend"||!Kw&&MC(e,t)?(e=IC(),oh=Bw=wi=null,Il=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return OC&&t.locale!=="ko"?null:t.data;default:return null}}var l2={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function b0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!l2[e.type]:t==="textarea"}function DC(e,t,n,r){pC(r),t=Lh(t,"onChange"),0<t.length&&(n=new Ww("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Iu=null,nd=null;function c2(e){YC(e,0)}function Ip(e){var t=Ll(e);if(aC(t))return e}function u2(e,t){if(e==="change")return t}var $C=!1;if(Po){var ig;if(Po){var ag="oninput"in document;if(!ag){var _0=document.createElement("div");_0.setAttribute("oninput","return;"),ag=typeof _0.oninput=="function"}ig=ag}else ig=!1;$C=ig&&(!document.documentMode||9<document.documentMode)}function k0(){Iu&&(Iu.detachEvent("onpropertychange",UC),nd=Iu=null)}function UC(e){if(e.propertyName==="value"&&Ip(nd)){var t=[];DC(t,nd,e,Dw(e)),vC(c2,t)}}function d2(e,t,n){e==="focusin"?(k0(),Iu=t,nd=n,Iu.attachEvent("onpropertychange",UC)):e==="focusout"&&k0()}function f2(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ip(nd)}function h2(e,t){if(e==="click")return Ip(t)}function p2(e,t){if(e==="input"||e==="change")return Ip(t)}function m2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Is=typeof Object.is=="function"?Object.is:m2;function rd(e,t){if(Is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!Ey.call(t,s)||!Is(e[s],t[s]))return!1}return!0}function S0(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function C0(e,t){var n=S0(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=S0(n)}}function FC(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?FC(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function zC(){for(var e=window,t=Th();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Th(e.document)}return t}function qw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function g2(e){var t=zC(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&FC(n.ownerDocument.documentElement,n)){if(r!==null&&qw(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,o=Math.min(r.start,s);r=r.end===void 0?o:Math.min(r.end,s),!e.extend&&o>r&&(s=r,r=o,o=s),s=C0(n,o);var a=C0(n,r);s&&a&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var y2=Po&&"documentMode"in document&&11>=document.documentMode,Ol=null,Ky=null,Ou=null,qy=!1;function E0(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;qy||Ol==null||Ol!==Th(r)||(r=Ol,"selectionStart"in r&&qw(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focu
vendor: 4,352 bytes, line 37
37sNode:r.focusNode,focusOffset:r.focusOffset}),Ou&&rd(Ou,r)||(Ou=r,r=Lh(Ky,"onSelect"),0<r.length&&(t=new Ww("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Ol)))}function kf(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ml={animationend:kf("Animation","AnimationEnd"),animationiteration:kf("Animation","AnimationIteration"),animationstart:kf("Animation","AnimationStart"),transitionend:kf("Transition","TransitionEnd")},lg={},BC={};Po&&(BC=document.createElement("div").style,"AnimationEvent"in window||(delete Ml.animationend.animation,delete Ml.animationiteration.animation,delete Ml.animationstart.animation),"TransitionEvent"in window||delete Ml.transitionend.transition);function Op(e){if(lg[e])return lg[e];if(!Ml[e])return e;var t=Ml[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in BC)return lg[e]=t[n];return e}var WC=Op("animationend"),HC=Op("animationiteration"),KC=Op("animationstart"),qC=Op("transitionend"),VC=new Map,j0="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ui(e,t){VC.set(e,t),qa(t,[e])}for(var cg=0;cg<j0.length;cg++){var ug=j0[cg],v2=ug.toLowerCase(),w2=ug[0].toUpperCase()+ug.slice(1);Ui(v2,"on"+w2)}Ui(WC,"onAnimationEnd");Ui(HC,"onAnimationIteration");Ui(KC,"onAnimationStart");Ui("dblclick","onDoubleClick");Ui("focusin","onFocus");Ui("focusout","onBlur");Ui(qC,"onTransitionEnd");wc("onMouseEnter",["mouseout","mouseover"]);wc("onMouseLeave",["mouseout","mouseover"]);wc("onPointerEnter",["pointerout","pointerover"]);wc("onPointerLeave",["pointerout","pointerover"]);qa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));qa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));qa("onBeforeInput",["compositionend","keypress","textInput","paste"]);qa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));qa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));qa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Su="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),x2=new Set("cancel close invalid load scroll toggle".split(" ").concat(Su));function N0(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,vO(r,t,void 0,e),e.currentTarget=null}function YC(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var a=r.length-1;0<=a;a--){var l=r[a],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==o&&s.isPropagationStopped())break e;N0(s,l,u),o=c}else for(a=0;a<r.length;a++){if(l=r[a],c=l.instance,u=l.currentTarget,l=l.listener,c!==o&&s.isPropagationStopped())break e;N0(s,l,u),o=c}}}if(Rh)throw e=zy,Rh=!1,zy=null,e}function Jt(e,t){var n=t[Qy];n===void 0&&(n=t[Qy]=new Set);var r=e+"__bubble";n.has(r)||(GC(t,e,2,!1),n.add(r))}function dg(e,t,n){var r=0;t&&(r|=4),GC(n,e,r,t)}var Sf="_reactListening"+Math.random().toString(36).slice(2);function sd(e){if(!e[Sf]){e[Sf]=!0,nC.forEach(function(n){n!=="selectionchange"&&(x2.has(n)||dg(n,!1,e),dg(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Sf]||(t[Sf]=!0,dg("selectionchange",!1,t))}}function GC(e,t,n,r){switch(AC(t)){case 1:var s=OO;break;case 4:s=MO;break;default:s=zw}n=s.bind(null,t,n,e),s=void 0,!Fy||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}
vendor: 2,676 bytes, line 37
37function fg(e,t,n,r,s){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var l=r.stateNode.containerInfo;if(l===s||l.nodeType===8&&l.parentNode===s)break;if(a===4)for(a=r.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;a=a.return}for(;l!==null;){if(a=ga(l),a===null)return;if(c=a.tag,c===5||c===6){r=o=a;continue e}l=l.parentNode}}r=r.return}vC(function(){var u=o,f=Dw(n),p=[];e:{var h=VC.get(e);if(h!==void 0){var m=Ww,v=e;switch(e){case"keypress":if(ih(n)===0)break e;case"keydown":case"keyup":m=JO;break;case"focusin":v="focus",m=og;break;case"focusout":v="blur",m=og;break;case"beforeblur":case"afterblur":m=og;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=g0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=$O;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=ZO;break;case WC:case HC:case KC:m=zO;break;case qC:m=t2;break;case"scroll":m=LO;break;case"wheel":m=r2;break;case"copy":case"cut":case"paste":m=WO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=v0}var g=(t&4)!==0,x=!g&&e==="scroll",w=g?h!==null?h+"Capture":null:h;g=[];for(var y=u,b;y!==null;){b=y;var _=b.stateNode;if(b.tag===5&&_!==null&&(b=_,w!==null&&(_=Xu(y,w),_!=null&&g.push(od(y,_,b)))),x)break;y=y.return}0<g.length&&(h=new m(h,v,null,n,f),p.push({event:h,listeners:g}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&n!==$y&&(v=n.relatedTarget||n.fromElement)&&(ga(v)||v[Ro]))break e;if((m||h)&&(h=f.window===f?f:(h=f.ownerDocument)?h.defaultView||h.parentWindow:window,m?(v=n.relatedTarget||n.toElement,m=u,v=v?ga(v):null,v!==null&&(x=Va(v),v!==x||v.tag!==5&&v.tag!==6)&&(v=null)):(m=null,v=u),m!==v)){if(g=g0,_="onMouseLeave",w="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(g=v0,_="onPointerLeave",w="onPointerEnter",y="pointer"),x=m==null?h:Ll(m),b=v==null?h:Ll(v),h=new g(_,y+"leave",m,n,f),h.target=x,h.relatedTarget=b,_=null,ga(f)===u&&(g=new g(w,y+"enter",v,n,f),g.target=b,g.relatedTarget=x,_=g),x=_,m&&v)t:{for(g=m,w=v,y=0,b=g;b;b=dl(b))y++;for(b=0,_=w;_;_=dl(_))b++;for(;0<y-b;)g=dl(g),y--;for(;0<b-y;)w=dl(w),b--;for(;y--;){if(g===w||w!==null&&g===w.alternate)break t;g=dl(g),w=dl(w)}g=null}else g=null;m!==null&&T0(p,h,m,g,!1),v!==null&&x!==null&&T0(p,x,v,g,!0)}}
vendor: 4,437 bytes, lines 37-38
37e:{if(h=u?Ll(u):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var k=u2;else if(b0(h))if($C)k=p2;else{k=f2;var C=d2}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(k=h2);if(k&&(k=k(e,u))){DC(p,k,n,f);break e}C&&C(e,h,u),e==="focusout"&&(C=h._wrapperState)&&C.controlled&&h.type==="number"&&Iy(h,"number",h.value)}switch(C=u?Ll(u):window,e){case"focusin":(b0(C)||C.contentEditable==="true")&&(Ol=C,Ky=u,Ou=null);break;case"focusout":Ou=Ky=Ol=null;break;case"mousedown":qy=!0;break;case"contextmenu":case"mouseup":case"dragend":qy=!1,E0(p,n,f);break;case"selectionchange":if(y2)break;case"keydown":case"keyup":E0(p,n,f)}var E;if(Kw)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else Il?MC(e,n)&&(A="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(A="onCompositionStart");A&&(OC&&n.locale!=="ko"&&(Il||A!=="onCompositionStart"?A==="onCompositionEnd"&&Il&&(E=IC()):(wi=f,Bw="value"in wi?wi.value:wi.textContent,Il=!0)),C=Lh(u,A),0<C.length&&(A=new y0(A,e,null,n,f),p.push({event:A,listeners:C}),E?A.data=E:(E=LC(n),E!==null&&(A.data=E)))),(E=o2?i2(e,n):a2(e,n))&&(u=Lh(u,"onBeforeInput"),0<u.length&&(f=new y0("onBeforeInput","beforeinput",null,n,f),p.push({event:f,listeners:u}),f.data=E))}YC(p,t)})}function od(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Lh(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=Xu(e,n),o!=null&&r.unshift(od(e,o,s)),o=Xu(e,t),o!=null&&r.push(od(e,o,s))),e=e.return}return r}function dl(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function T0(e,t,n,r,s){for(var o=t._reactName,a=[];n!==null&&n!==r;){var l=n,c=l.alternate,u=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&u!==null&&(l=u,s?(c=Xu(n,o),c!=null&&a.unshift(od(n,c,l))):s||(c=Xu(n,o),c!=null&&a.push(od(n,c,l)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var b2=/\r\n?/g,_2=/\u0000|\uFFFD/g;function P0(e){return(typeof e=="string"?e:""+e).replace(b2,`
38`).replace(_2,"")}function Cf(e,t,n){if(t=P0(t),P0(e)!==t&&n)throw Error(se(425))}function Dh(){}var Vy=null,Yy=null;function Gy(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Jy=typeof setTimeout=="function"?setTimeout:void 0,k2=typeof clearTimeout=="function"?clearTimeout:void 0,R0=typeof Promise=="function"?Promise:void 0,S2=typeof queueMicrotask=="function"?queueMicrotask:typeof R0<"u"?function(e){return R0.resolve(null).then(e).catch(C2)}:Jy;function C2(e){setTimeout(function(){throw e})}function hg(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),td(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);td(t)}function Si(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function A0(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Mc=Math.random().toString(36).slice(2),Vs="__reactFiber$"+Mc,id="__reactProps$"+Mc,Ro="__reactContainer$"+Mc,Qy="__reactEvents$"+Mc,E2="__reactListeners$"+Mc,j2="__reactHandles$"+Mc;function ga(e){var t=e[Vs];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ro]||n[Vs]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=A0(e);e!==null;){if(n=e[Vs])return n;e=A0(e)}return t}e=n,n=e.parentNode}return null}function Ud(e){return e=e[Vs]||e[Ro],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ll(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(se(33))}function Mp(e){return e[id]||null}var Xy=[],Dl=-1;function Fi(e){return{current:e}}function Qt(e){0>Dl||(e.current=Xy[Dl],Xy[Dl]=null,Dl--)}function Bt(e,t){Dl++,Xy[Dl]=e.current,e.current=t}var Oi={},ir=Fi(Oi),Ir=Fi(!1),Ia=Oi;function xc(e,t){var n=e.type.contextTypes;if(!n)return Oi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},o;
vendor: 14,769 bytes, line 38
38for(o in n)s[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Or(e){return e=e.childContextTypes,e!=null}function $h(){Qt(Ir),Qt(ir)}function I0(e,t,n){if(ir.current!==Oi)throw Error(se(168));Bt(ir,t),Bt(Ir,n)}function JC(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(se(108,dO(e)||"Unknown",s));return hn({},n,r)}function Uh(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Oi,Ia=ir.current,Bt(ir,e),Bt(Ir,Ir.current),!0}function O0(e,t,n){var r=e.stateNode;if(!r)throw Error(se(169));n?(e=JC(e,t,Ia),r.__reactInternalMemoizedMergedChildContext=e,Qt(Ir),Qt(ir),Bt(ir,e)):Qt(Ir),Bt(Ir,n)}var _o=null,Lp=!1,pg=!1;function QC(e){_o===null?_o=[e]:_o.push(e)}function N2(e){Lp=!0,QC(e)}function zi(){if(!pg&&_o!==null){pg=!0;var e=0,t=Pt;try{var n=_o;for(Pt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}_o=null,Lp=!1}catch(s){throw _o!==null&&(_o=_o.slice(e+1)),_C($w,zi),s}finally{Pt=t,pg=!1}}return null}var $l=[],Ul=0,Fh=null,zh=0,as=[],ls=0,Oa=null,Co=1,Eo="";function aa(e,t){$l[Ul++]=zh,$l[Ul++]=Fh,Fh=e,zh=t}function XC(e,t,n){as[ls++]=Co,as[ls++]=Eo,as[ls++]=Oa,Oa=e;var r=Co;e=Eo;var s=32-Rs(r)-1;r&=~(1<<s),n+=1;var o=32-Rs(t)+s;if(30<o){var a=s-s%5;o=(r&(1<<a)-1).toString(32),r>>=a,s-=a,Co=1<<32-Rs(t)+s|n<<s|r,Eo=o+e}else Co=1<<o|n<<s|r,Eo=e}function Vw(e){e.return!==null&&(aa(e,1),XC(e,1,0))}function Yw(e){for(;e===Fh;)Fh=$l[--Ul],$l[Ul]=null,zh=$l[--Ul],$l[Ul]=null;for(;e===Oa;)Oa=as[--ls],as[ls]=null,Eo=as[--ls],as[ls]=null,Co=as[--ls],as[ls]=null}var Qr=null,Jr=null,nn=!1,Ts=null;function ZC(e,t){var n=cs(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function M0(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Qr=e,Jr=Si(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Qr=e,Jr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Oa!==null?{id:Co,overflow:Eo}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=cs(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Qr=e,Jr=null,!0):!1;default:return!1}}function Zy(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ev(e){if(nn){var t=Jr;if(t){var n=t;if(!M0(e,t)){if(Zy(e))throw Error(se(418));t=Si(n.nextSibling);var r=Qr;t&&M0(e,t)?ZC(r,n):(e.flags=e.flags&-4097|2,nn=!1,Qr=e)}}else{if(Zy(e))throw Error(se(418));e.flags=e.flags&-4097|2,nn=!1,Qr=e}}}function L0(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Qr=e}function Ef(e){if(e!==Qr)return!1;if(!nn)return L0(e),nn=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Gy(e.type,e.memoizedProps)),t&&(t=Jr)){if(Zy(e))throw e1(),Error(se(418));for(;t;)ZC(e,t),t=Si(t.nextSibling)}if(L0(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(se(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Jr=Si(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Jr=null}}else Jr=Qr?Si(e.stateNode.nextSibling):null;return!0}function e1(){for(var e=Jr;e;)e=Si(e.nextSibling)}function bc(){Jr=Qr=null,nn=!1}function Gw(e){Ts===null?Ts=[e]:Ts.push(e)}var T2=$o.ReactCurrentBatchConfig;function cu(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(se(309));var r=n.stateNode}if(!r)throw Error(se(147,e));var s=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(a){var l=s.refs;a===null?delete l[o]:l[o]=a},t._stringRef=o,t)}if(typeof e!="string")throw Error(se(284));if(!n._owner)throw Error(se(290,e))}return e}function jf(e,t){throw e=Object.prototype.toString.call(t),Error(se(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function D0(e){var t=e._init;return t(e._payload)}function t1(e){function t(w,y){if(e){var b=w.deletions;b===null?(w.deletions=[y],w.flags|=16):b.push(y)}}function n(w,y){if(!e)return null;for(;y!==null;)t(w,y),y=y.sibling;return null}function r(w,y){for(w=new Map;y!==null;)y.key!==null?w.set(y.key,y):w.set(y.index,y),y=y.sibling;return w}function s(w,y){return w=Ni(w,y),w.index=0,w.sibling=null,w}function o(w,y,b){return w.index=b,e?(b=w.alternate,b!==null?(b=b.index,b<y?(w.flags|=2,y):b):(w.flags|=2,y)):(w.flags|=1048576,y)}function a(w){return e&&w.alternate===null&&(w.flags|=2),w}function l(w,y,b,_){return y===null||y.tag!==6?(y=bg(b,w.mode,_),y.return=w,y):(y=s(y,b),y.return=w,y)}function c(w,y,b,_){var k=b.type;return k===Al?f(w,y,b.props.children,_,b.key):y!==null&&(y.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===ri&&D0(k)===y.type)?(_=s(y,b.props),_.ref=cu(w,y,b),_.return=w,_):(_=hh(b.type,b.key,b.props,null,w.mode,_),_.ref=cu(w,y,b),_.return=w,_)}function u(w,y,b,_){return y===null||y.tag!==4||y.stateNode.containerInfo!==b.containerInfo||y.stateNode.implementation!==b.implementation?(y=_g(b,w.mode,_),y.return=w,y):(y=s(y,b.children||[]),y.return=w,y)}function f(w,y,b,_,k){return y===null||y.tag!==7?(y=Pa(b,w.mode,_,k),y.return=w,y):(y=s(y,b),y.return=w,y)}function p(w,y,b){if(typeof y=="string"&&y!==""||typeof y=="number")return y=bg(""+y,w.mode,b),y.return=w,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case gf:return b=hh(y.type,y.key,y.props,null,w.mode,b),b.ref=cu(w,null,y),b.return=w,b;case Rl:return y=_g(y,w.mode,b),y.return=w,y;case ri:var _=y._init;return p(w,_(y._payload),b)}if(_u(y)||su(y))return y=Pa(y,w.mode,b,null),y.return=w,y;jf(w,y)}return null}function h(w,y,b,_){var k=y!==null?y.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return k!==null?null:l(w,y,""+b,_);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case gf:return b.key===k?c(w,y,b,_):null;case Rl:return b.key===k?u(w,y,b,_):null;case ri:return k=b._init,h(w,y,k(b._payload),_)}if(_u(b)||su(b))return k!==null?null:f(w,y,b,_,null);jf(w,b)}return null}function m(w,y,b,_,k){if(typeof _=="string"&&_!==""||typeof _=="number")return w=w.get(b)||null,l(y,w,""+_,k);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case gf:return w=w.get(_.key===null?b:_.key)||null,c(y,w,_,k);case Rl:return w=w.get(_.key===null?b:_.key)||null,u(y,w,_,k);case ri:var C=_._init;return m(w,y,b,C(_._payload),k)}if(_u(_)||su(_))return w=w.get(b)||null,f(y,w,_,k,null);jf(y,_)}return null}function v(w,y,b,_){for(var k=null,C=null,E=y,A=y=0,T=null;E!==null&&A<b.length;A++){E.index>A?(T=E,E=null):T=E.sibling;var M=h(w,E,b[A],_);if(M===null){E===null&&(E=T);break}e&&E&&M.alternate===null&&t(w,E),y=o(M,y,A),C===null?k=M:C.sibling=M,C=M,E=T}if(A===b.length)return n(w,E),nn&&aa(w,A),k;if(E===null){for(;A<b.length;A++)E=p(w,b[A],_),E!==null&&(y=o(E,y,A),C===null?k=E:C.sibling=E,C=E);return nn&&aa(w,A),k}for(E=r(w,E);A<b.length;A++)T=m(E,w,A,b[A],_),T!==null&&(e&&T.alternate!==null&&E.delete(T.key===null?A:T.key),y=o(T,y,A),C===null?k=T:C.sibling=T,C=T);return e&&E.forEach(function(P){return t(w,P)}),nn&&aa(w,A),k}function g(w,y,b,_){var k=su(b);if(typeof k!="function")throw Error(se(150));if(b=k.call(b),b==null)throw Error(se(151));for(var C=k=null,E=y,A=y=0,T=null,M=b.next();E!==null&&!M.done;A++,M=b.next()){E.index>A?(T=E,E=null):T=E.sibling;var P=h(w,E,M.value,_);if(P===null){E===null&&(E=T);break}e&&E&&P.alternate===null&&t(w,E),y=o(P,y,A),C===null?k=P:C.sibling=P,C=P,E=T}if(M.done)return n(w,E),nn&&aa(w,A),k;if(E===null){for(;!M.done;A++,M=b.next())M=p(w,M.value,_),M!==null&&(y=o(M,y,A),C===null?k=M:C.sibling=M,C=M);return nn&&aa(w,A),k}for(E=r(w,E);!M.done;A++,M=b.next())M=m(E,w,A,M.value,_),M!==null&&(e&&M.alternate!==null&&E.delete(M.key===null?A:M.key),y=o(M,y,A),C===null?k=M:C.sibling=M,C=M);return e&&E.forEach(function($){return t(w,$)}),nn&&aa(w,A),k}function x(w,y,b,_){if(typeof b=="object"&&b!==null&&b.type===Al&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case gf:e:{for(var k=b.key,C=y;C!==null;){if(C.key===k){if(k=b.type,k===Al){if(C.tag===7){n(w,C.sibling),y=s(C,b.props.children),y.return=w,w=y;break e}}else if(C.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===ri&&D0(k)===C.type){n(w,C.sibling),y=s(C,b.props),y.ref=cu(w,C,b),y.return=w,w=y;break e}n(w,C);break}else t(w,C);C=C.sibling}b.type===Al?(y=Pa(b.props.children,w.mode,_,b.key),y.return=w,w=y):(_=hh(b.type,b.key,b.props,null,w.mode,_),_.ref=cu(w,y,b),_.return=w,w=_)}return a(w);case Rl:e:{for(C=b.key;y!==null;){if(y.key===C)if(y.tag===4&&y.stateNode.containerInfo===b.containerInfo&&y.stateNode.implementation===b.implementation){n(w,y.sibling),y=s(y,b.children||[]),y.return=w,w=y;break e}else{n(w,y);break}else t(w,y);y=y.sibling}y=_g(b,w.mode,_),y.return=w,w=y}return a(w);case ri:return C=b._init,x(w,y,C(b._payload),_)}if(_u(b))return v(w,y,b,_);if(su(b))return g(w,y,b,_);jf(w,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,y!==null&&y.tag===6?(n(w,y.sibling),y=s(y,b),y.return=w,w=y):(n(w,y),y=bg(b,w.mode,_),y.return=w,w=y),a(w)):n(w,y)}return x}var _c=t1(!0),n1=t1(!1),Bh=Fi(null),Wh=null,Fl=null,Jw=null;function Qw(){Jw=Fl=Wh=null}function Xw(e){var t=Bh.current;Qt(Bh),e._currentValue=t}function tv(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Xl(e,t){Wh=e,Jw=Fl=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Rr=!0),e.firstContext=null)}function fs(e){var t=e._currentValue;if(Jw!==e)if(e={context:e,memoizedValue:t,next:null},Fl===null){if(Wh===null)throw Error(se(308));Fl=e,Wh.dependencies={lanes:0,firstContext:e}}else Fl=Fl.next=e;return t}var ya=null;function Zw(e){ya===null?ya=[e]:ya.push(e)}function r1(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Zw(t)):(n.next=s.next,s.next=n),t.interleaved=n,Ao(e,r)}function Ao(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var si=!1;function ex(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function s1(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function jo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ci(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,st&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Ao(e,n)}return s=r.interleaved,s===null?(t.next=t,Zw(r)):(t.next=s.next,s.next=t),r.interleaved=t,Ao(e,n)}function ah(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Uw(e,n)}}function $0(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?s=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?s=o=t:o=o.next=t}else s=o=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Hh(e,t,n,r){var s=e.updateQueue;si=!1;var o=s.firstBaseUpdate,a=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?o=u:a.next=u,a=c;var f=e.alternate;f!==null&&(f=f.updateQueue,l=f.lastBaseUpdate,l!==a&&(l===null?f.firstBaseUpdate=u:l.next=u,f.lastBaseUpdate=c))}if(o!==null){var p=s.baseState;a=0,f=u=c=null,l=o;do{var h=l.lane,m=l.eventTime;if((r&h)===h){f!==null&&(f=f.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var v=e,g=l;switch(h=t,m=n,g.tag){case 1:if(v=g.payload,typeof v=="function"){p=v.call(m,p,h);break e}p=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=g.payload,h=typeof v=="function"?v.call(m,p,h):v,h==null)break e;p=hn({},p,h);break e;case 2:si=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[l]:h.push(l))}else m={eventTime:m,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},f===null?(u=f=m,c=p):f=f.next=m,a|=h;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;h=l,l=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(f===null&&(c=p),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=f,t=s.shared.interleaved,t!==null){s=t;do a|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);La|=a,e.lanes=a,e.memoizedState=p}}function U0(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(se(191,s));s.call(r)}}}var Fd={},Xs=Fi(Fd),ad=Fi(Fd),ld=Fi(Fd);function va(e){if(e===Fd)throw Error(se(174));return e}function tx(e,t){switch(Bt(ld,t),Bt(ad,e),Bt(Xs,Fd),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:My(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=My(t,e)}Qt(Xs),Bt(Xs,t)}function kc(){Qt(Xs),Qt(ad),Qt(ld)}function o1(e){va(ld.current);var t=va(Xs.current),n=My(t,e.type);t!==n&&(Bt(ad,e),Bt(Xs,n))}function nx(e){ad.current===e&&(Qt(Xs),Qt(ad))}var un=Fi(0);function Kh(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var mg=[];function rx(){for(var e=0;e<mg.length;e++)mg[e]._workInProgressVersionPrimary=null;mg.length=0}var lh=$o.ReactCurrentDispatcher,gg=$o.ReactCurrentBatchConfig,Ma=0,dn=null,$n=null,Bn=null,qh=!1,Mu=!1,cd=0,P2=0;function tr(){throw Error(se(321))}function sx(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Is(e[n],t[n]))return!1;return!0}function ox(e,t,n,r,s,o){if(Ma=o,dn=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,lh.current=e===null||e.memoizedState===null?O2:M2,e=n(r,s),Mu){o=0;
vendor: 6,598 bytes, line 38
38do{if(Mu=!1,cd=0,25<=o)throw Error(se(301));o+=1,Bn=$n=null,t.updateQueue=null,lh.current=L2,e=n(r,s)}while(Mu)}if(lh.current=Vh,t=$n!==null&&$n.next!==null,Ma=0,Bn=$n=dn=null,qh=!1,t)throw Error(se(300));return e}function ix(){var e=cd!==0;return cd=0,e}function Ws(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bn===null?dn.memoizedState=Bn=e:Bn=Bn.next=e,Bn}function hs(){if($n===null){var e=dn.alternate;e=e!==null?e.memoizedState:null}else e=$n.next;var t=Bn===null?dn.memoizedState:Bn.next;if(t!==null)Bn=t,$n=e;else{if(e===null)throw Error(se(310));$n=e,e={memoizedState:$n.memoizedState,baseState:$n.baseState,baseQueue:$n.baseQueue,queue:$n.queue,next:null},Bn===null?dn.memoizedState=Bn=e:Bn=Bn.next=e}return Bn}function ud(e,t){return typeof t=="function"?t(e):t}function yg(e){var t=hs(),n=t.queue;if(n===null)throw Error(se(311));n.lastRenderedReducer=e;var r=$n,s=r.baseQueue,o=n.pending;if(o!==null){if(s!==null){var a=s.next;s.next=o.next,o.next=a}r.baseQueue=s=o,n.pending=null}if(s!==null){o=s.next,r=r.baseState;var l=a=null,c=null,u=o;do{var f=u.lane;if((Ma&f)===f)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var p={lane:f,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=p,a=r):c=c.next=p,dn.lanes|=f,La|=f}u=u.next}while(u!==null&&u!==o);c===null?a=r:c.next=l,Is(r,t.memoizedState)||(Rr=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do o=s.lane,dn.lanes|=o,La|=o,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function vg(e){var t=hs(),n=t.queue;if(n===null)throw Error(se(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,o=t.memoizedState;if(s!==null){n.pending=null;var a=s=s.next;do o=e(o,a.action),a=a.next;while(a!==s);Is(o,t.memoizedState)||(Rr=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function i1(){}function a1(e,t){var n=dn,r=hs(),s=t(),o=!Is(r.memoizedState,s);if(o&&(r.memoizedState=s,Rr=!0),r=r.queue,ax(u1.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||Bn!==null&&Bn.memoizedState.tag&1){if(n.flags|=2048,dd(9,c1.bind(null,n,r,s,t),void 0,null),Wn===null)throw Error(se(349));Ma&30||l1(n,t,s)}return s}function l1(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=dn.updateQueue,t===null?(t={lastEffect:null,stores:null},dn.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function c1(e,t,n,r){t.value=n,t.getSnapshot=r,d1(t)&&f1(e)}function u1(e,t,n){return n(function(){d1(t)&&f1(e)})}function d1(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Is(e,n)}catch{return!0}}function f1(e){var t=Ao(e,1);t!==null&&As(t,e,1,-1)}function F0(e){var t=Ws();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ud,lastRenderedState:e},t.queue=e,e=e.dispatch=I2.bind(null,dn,e),[t.memoizedState,e]}function dd(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=dn.updateQueue,t===null?(t={lastEffect:null,stores:null},dn.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function h1(){return hs().memoizedState}function ch(e,t,n,r){var s=Ws();dn.flags|=e,s.memoizedState=dd(1|t,n,void 0,r===void 0?null:r)}function Dp(e,t,n,r){var s=hs();r=r===void 0?null:r;var o=void 0;if($n!==null){var a=$n.memoizedState;if(o=a.destroy,r!==null&&sx(r,a.deps)){s.memoizedState=dd(t,n,o,r);return}}dn.flags|=e,s.memoizedState=dd(1|t,n,o,r)}function z0(e,t){return ch(8390656,8,e,t)}function ax(e,t){return Dp(2048,8,e,t)}function p1(e,t){return Dp(4,2,e,t)}function m1(e,t){return Dp(4,4,e,t)}function g1(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function y1(e,t,n){return n=n!=null?n.concat([e]):null,Dp(4,4,g1.bind(null,t,e),n)}function lx(){}function v1(e,t){var n=hs();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&sx(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function w1(e,t){var n=hs();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&sx(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function x1(e,t,n){return Ma&21?(Is(n,t)||(n=CC(),dn.lanes|=n,La|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Rr=!0),e.memoizedState=n)}function R2(e,t){var n=Pt;Pt=n!==0&&4>n?n:4,e(!0);var r=gg.transition;gg.transition={};try{e(!1),t()}finally{Pt=n,gg.transition=r}}function b1(){return hs().memoizedState}function A2(e,t,n){var r=ji(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},_1(e))k1(t,n);else if(n=r1(e,t,n,r),n!==null){var s=pr();As(n,e,r,s),S1(n,t,r)}}function I2(e,t,n){var r=ji(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(_1(e))k1(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,l=o(a,n);if(s.hasEagerState=!0,s.eagerState=l,Is(l,a)){var c=t.interleaved;c===null?(s.next=s,Zw(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=r1(e,t,s,r),n!==null&&(s=pr(),As(n,e,r,s),S1(n,t,r))}}function _1(e){var t=e.alternate;return e===dn||t!==null&&t===dn}function k1(e,t){Mu=qh=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function S1(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Uw(e,n)}}var Vh={readContext:fs,useCallback:tr,useContext:tr,useEffect:tr,useImperativeHandle:tr,useInsertionEffect:tr,useLayoutEffect:tr,useMemo:tr,useReducer:tr,useRef:tr,useState:tr,useDebugValue:tr,useDeferredValue:tr,useTransition:tr,useMutableSource:tr,useSyncExternalStore:tr,useId:tr,unstable_isNewReconciler:!1},O2={readContext:fs,useCallback:function(e,t){return Ws().memoizedState=[e,t===void 0?null:t],e},useContext:fs,useEffect:z0,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ch(4194308,4,g1.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ch(4194308,4,e,t)},useInsertionEffect:function(e,t){return ch(4,2,e,t)},useMemo:function(e,t){var n=Ws();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ws();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=A2.bind(null,dn,e),[r.memoizedState,e]}
vendor: 5,550 bytes, lines 38-40
38,useRef:function(e){var t=Ws();return e={current:e},t.memoizedState=e},useState:F0,useDebugValue:lx,useDeferredValue:function(e){return Ws().memoizedState=e},useTransition:function(){var e=F0(!1),t=e[0];return e=R2.bind(null,e[1]),Ws().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=dn,s=Ws();if(nn){if(n===void 0)throw Error(se(407));n=n()}else{if(n=t(),Wn===null)throw Error(se(349));Ma&30||l1(r,t,n)}s.memoizedState=n;var o={value:n,getSnapshot:t};return s.queue=o,z0(u1.bind(null,r,o,e),[e]),r.flags|=2048,dd(9,c1.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Ws(),t=Wn.identifierPrefix;if(nn){var n=Eo,r=Co;n=(r&~(1<<32-Rs(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=cd++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=P2++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},M2={readContext:fs,useCallback:v1,useContext:fs,useEffect:ax,useImperativeHandle:y1,useInsertionEffect:p1,useLayoutEffect:m1,useMemo:w1,useReducer:yg,useRef:h1,useState:function(){return yg(ud)},useDebugValue:lx,useDeferredValue:function(e){var t=hs();return x1(t,$n.memoizedState,e)},useTransition:function(){var e=yg(ud)[0],t=hs().memoizedState;return[e,t]},useMutableSource:i1,useSyncExternalStore:a1,useId:b1,unstable_isNewReconciler:!1},L2={readContext:fs,useCallback:v1,useContext:fs,useEffect:ax,useImperativeHandle:y1,useInsertionEffect:p1,useLayoutEffect:m1,useMemo:w1,useReducer:vg,useRef:h1,useState:function(){return vg(ud)},useDebugValue:lx,useDeferredValue:function(e){var t=hs();return $n===null?t.memoizedState=e:x1(t,$n.memoizedState,e)},useTransition:function(){var e=vg(ud)[0],t=hs().memoizedState;return[e,t]},useMutableSource:i1,useSyncExternalStore:a1,useId:b1,unstable_isNewReconciler:!1};function ks(e,t){if(e&&e.defaultProps){t=hn({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function nv(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:hn({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var $p={isMounted:function(e){return(e=e._reactInternals)?Va(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=pr(),s=ji(e),o=jo(r,s);o.payload=t,n!=null&&(o.callback=n),t=Ci(e,o,s),t!==null&&(As(t,e,s,r),ah(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=pr(),s=ji(e),o=jo(r,s);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=Ci(e,o,s),t!==null&&(As(t,e,s,r),ah(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pr(),r=ji(e),s=jo(n,r);s.tag=2,t!=null&&(s.callback=t),t=Ci(e,s,r),t!==null&&(As(t,e,r,n),ah(t,e,r))}};function B0(e,t,n,r,s,o,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,a):t.prototype&&t.prototype.isPureReactComponent?!rd(n,r)||!rd(s,o):!0}function C1(e,t,n){var r=!1,s=Oi,o=t.contextType;return typeof o=="object"&&o!==null?o=fs(o):(s=Or(t)?Ia:ir.current,r=t.contextTypes,o=(r=r!=null)?xc(e,s):Oi),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=$p,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=o),t}function W0(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&$p.enqueueReplaceState(t,t.state,null)}function rv(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},ex(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=fs(o):(o=Or(t)?Ia:ir.current,s.context=xc(e,o)),s.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(nv(e,t,o,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&$p.enqueueReplaceState(s,s.state,null),Hh(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Sc(e,t){try{var n="",r=t;do n+=uO(r),r=r.return;while(r);var s=n}catch(o){s=`
39Error generating stack: `+o.message+`
40`+o.stack}return{value:e,source:t,stack:s,digest:null}}function wg(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function sv(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var D2=typeof WeakMap=="function"?WeakMap:Map;function E1(e,t,n){n=jo(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Gh||(Gh=!0,pv=r),sv(e,t)},n}function j1(e,t,n){n=jo(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){sv(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){sv(e,t),typeof r!="function"&&(Ei===null?Ei=new Set([this]):Ei.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function H0(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new D2;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=Q2.bind(null,e,t,n),t.then(e,e))}function K0(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}
vendor: 9,907 bytes, line 40
40function q0(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=jo(-1,1),t.tag=2,Ci(n,t,1))),n.lanes|=1),e)}var $2=$o.ReactCurrentOwner,Rr=!1;function dr(e,t,n,r){t.child=e===null?n1(t,null,n,r):_c(t,e.child,n,r)}function V0(e,t,n,r,s){n=n.render;var o=t.ref;return Xl(t,s),r=ox(e,t,n,r,o,s),n=ix(),e!==null&&!Rr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Io(e,t,s)):(nn&&n&&Vw(t),t.flags|=1,dr(e,t,r,s),t.child)}function Y0(e,t,n,r,s){if(e===null){var o=n.type;return typeof o=="function"&&!gx(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,N1(e,t,o,r,s)):(e=hh(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&s)){var a=o.memoizedProps;if(n=n.compare,n=n!==null?n:rd,n(a,r)&&e.ref===t.ref)return Io(e,t,s)}return t.flags|=1,e=Ni(o,r),e.ref=t.ref,e.return=t,t.child=e}function N1(e,t,n,r,s){if(e!==null){var o=e.memoizedProps;if(rd(o,r)&&e.ref===t.ref)if(Rr=!1,t.pendingProps=r=o,(e.lanes&s)!==0)e.flags&131072&&(Rr=!0);else return t.lanes=e.lanes,Io(e,t,s)}return ov(e,t,n,r,s)}function T1(e,t,n){var r=t.pendingProps,s=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Bt(Bl,Vr),Vr|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Bt(Bl,Vr),Vr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,Bt(Bl,Vr),Vr|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,Bt(Bl,Vr),Vr|=r;return dr(e,t,s,n),t.child}function P1(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ov(e,t,n,r,s){var o=Or(n)?Ia:ir.current;return o=xc(t,o),Xl(t,s),n=ox(e,t,n,r,o,s),r=ix(),e!==null&&!Rr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Io(e,t,s)):(nn&&r&&Vw(t),t.flags|=1,dr(e,t,n,s),t.child)}function G0(e,t,n,r,s){if(Or(n)){var o=!0;Uh(t)}else o=!1;if(Xl(t,s),t.stateNode===null)uh(e,t),C1(t,n,r),rv(t,n,r,s),r=!0;else if(e===null){var a=t.stateNode,l=t.memoizedProps;a.props=l;var c=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=fs(u):(u=Or(n)?Ia:ir.current,u=xc(t,u));var f=n.getDerivedStateFromProps,p=typeof f=="function"||typeof a.getSnapshotBeforeUpdate=="function";p||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==r||c!==u)&&W0(t,a,r,u),si=!1;var h=t.memoizedState;a.state=h,Hh(t,r,a,s),c=t.memoizedState,l!==r||h!==c||Ir.current||si?(typeof f=="function"&&(nv(t,n,f,r),c=t.memoizedState),(l=si||B0(t,n,l,r,h,c,u))?(p||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),a.props=r,a.state=c,a.context=u,r=l):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,s1(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:ks(t.type,l),a.props=u,p=t.pendingProps,h=a.context,c=n.contextType,typeof c=="object"&&c!==null?c=fs(c):(c=Or(n)?Ia:ir.current,c=xc(t,c));var m=n.getDerivedStateFromProps;(f=typeof m=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==p||h!==c)&&W0(t,a,r,c),si=!1,h=t.memoizedState,a.state=h,Hh(t,r,a,s);var v=t.memoizedState;l!==p||h!==v||Ir.current||si?(typeof m=="function"&&(nv(t,n,m,r),v=t.memoizedState),(u=si||B0(t,n,u,r,h,v,c)||!1)?(f||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,v,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,v,c)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),a.props=r,a.state=v,a.context=c,r=u):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return iv(e,t,n,r,o,s)}function iv(e,t,n,r,s,o){P1(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return s&&O0(t,n,!1),Io(e,t,o);r=t.stateNode,$2.current=t;var l=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=_c(t,e.child,null,o),t.child=_c(t,null,l,o)):dr(e,t,l,o),t.memoizedState=r.state,s&&O0(t,n,!0),t.child}function R1(e){var t=e.stateNode;t.pendingContext?I0(e,t.pendingContext,t.pendingContext!==t.context):t.context&&I0(e,t.context,!1),tx(e,t.containerInfo)}function J0(e,t,n,r,s){return bc(),Gw(s),t.flags|=256,dr(e,t,n,r),t.child}var av={dehydrated:null,treeContext:null,retryLane:0};function lv(e){return{baseLanes:e,cachePool:null,transitions:null}}function A1(e,t,n){var r=t.pendingProps,s=un.current,o=!1,a=(t.flags&128)!==0,l;if((l=a)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),Bt(un,s&1),e===null)return ev(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,o?(r=t.mode,o=t.child,a={mode:"hidden",children:a},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=a):o=zp(a,r,0,null),e=Pa(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=lv(n),t.memoizedState=av,e):cx(t,a));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return U2(e,t,a,r,l,s,n);if(o){o=r.fallback,a=t.mode,s=e.child,l=s.sibling;var c={mode:"hidden",children:r.children};return!(a&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Ni(s,c),r.subtreeFlags=s.subtreeFlags&14680064),l!==null?o=Ni(l,o):(o=Pa(o,a,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,a=e.child.memoizedState,a=a===null?lv(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},o.memoizedState=a,o.childLanes=e.childLanes&~n,t.memoizedState=av,r}return o=e.child,e=o.sibling,r=Ni(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function cx(e,t){return t=zp({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Nf(e,t,n,r){return r!==null&&Gw(r),_c(t,e.child,null,n),e=cx(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function U2(e,t,n,r,s,o,a){if(n)return t.flags&256?(t.flags&=-257,r=wg(Error(se(422))),Nf(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,s=t.mode,r=zp({mode:"visible",children:r.children},s,0,null),o=Pa(o,s,a,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&_c(t,e.child,null,a),t.child.memoizedState=lv(a),t.memoizedState=av,o);if(!(t.mode&1))return Nf(e,t,a,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var l=r.dgst;return r=l,o=Error(se(419)),r=wg(o,r,void 0),Nf(e,t,a,r)}if(l=(a&e.childLanes)!==0,Rr||l){if(r=Wn,r!==null){switch(a&-a){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|a)?0:s,s!==0&&s!==o.retryLane&&(o.retryLane=s,Ao(e,s),As(r,e,s,-1))}return mx(),r=wg(Error(se(421))),Nf(e,t,a,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=X2.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,Jr=Si(s.nextSibling),Qr=t,nn=!0,Ts=null,e!==null&&(as[ls++]=Co,as[ls++]=Eo,as[ls++]=Oa,Co=e.id,Eo=e.overflow,Oa=t),t=cx(t,r.children),t.flags|=4096,t)}function Q0(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),tv(e.return,t,n)}function xg(e,t,n,r,s){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=s)}function I1(e,t,n){var r=t.pendingProps,s=r.revealOrder,o=r.tail;if(dr(e,t,r.children,n),r=un.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Q0(e,n,t);else if(e.tag===19)Q0(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Bt(un,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Kh(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),xg(t,!1,s,n,o);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Kh(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}xg(t,!0,n,null,o);break;case"together":xg(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function uh(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}
vendor: 4,087 bytes, line 40
40function Io(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),La|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(se(153));if(t.child!==null){for(e=t.child,n=Ni(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ni(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function F2(e,t,n){switch(t.tag){case 3:R1(t),bc();break;case 5:o1(t);break;case 1:Or(t.type)&&Uh(t);break;case 4:tx(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;Bt(Bh,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Bt(un,un.current&1),t.flags|=128,null):n&t.child.childLanes?A1(e,t,n):(Bt(un,un.current&1),e=Io(e,t,n),e!==null?e.sibling:null);Bt(un,un.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return I1(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Bt(un,un.current),r)break;return null;case 22:case 23:return t.lanes=0,T1(e,t,n)}return Io(e,t,n)}var O1,cv,M1,L1;O1=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};cv=function(){};M1=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,va(Xs.current);var o=null;switch(n){case"input":s=Ry(e,s),r=Ry(e,r),o=[];break;case"select":s=hn({},s,{value:void 0}),r=hn({},r,{value:void 0}),o=[];break;case"textarea":s=Oy(e,s),r=Oy(e,r),o=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Dh)}Ly(n,r);var a;n=null;for(u in s)if(!r.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var l=s[u];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Ju.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var c=r[u];if(l=s!=null?s[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(a in l)!l.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&l[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(o||(o=[]),o.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(o=o||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(o=o||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Ju.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&Jt("scroll",e),o||l===c||(o=[])):(o=o||[]).push(u,c))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};L1=function(e,t,n,r){n!==r&&(t.flags|=4)};function uu(e,t){if(!nn)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function nr(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function z2(e,t,n){var r=t.pendingProps;switch(Yw(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nr(t),null;case 1:return Or(t.type)&&$h(),nr(t),null;case 3:return r=t.stateNode,kc(),Qt(Ir),Qt(ir),rx(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ef(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ts!==null&&(yv(Ts),Ts=null))),cv(e,t),nr(t),null;case 5:nx(t);var s=va(ld.current);
vendor: 29,806 bytes, line 40
40if(n=t.type,e!==null&&t.stateNode!=null)M1(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(se(166));return nr(t),null}if(e=va(Xs.current),Ef(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Vs]=t,r[id]=o,e=(t.mode&1)!==0,n){case"dialog":Jt("cancel",r),Jt("close",r);break;case"iframe":case"object":case"embed":Jt("load",r);break;case"video":case"audio":for(s=0;s<Su.length;s++)Jt(Su[s],r);break;case"source":Jt("error",r);break;case"img":case"image":case"link":Jt("error",r),Jt("load",r);break;case"details":Jt("toggle",r);break;case"input":i0(r,o),Jt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},Jt("invalid",r);break;case"textarea":l0(r,o),Jt("invalid",r)}Ly(n,o),s=null;for(var a in o)if(o.hasOwnProperty(a)){var l=o[a];a==="children"?typeof l=="string"?r.textContent!==l&&(o.suppressHydrationWarning!==!0&&Cf(r.textContent,l,e),s=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(o.suppressHydrationWarning!==!0&&Cf(r.textContent,l,e),s=["children",""+l]):Ju.hasOwnProperty(a)&&l!=null&&a==="onScroll"&&Jt("scroll",r)}switch(n){case"input":yf(r),a0(r,o,!0);break;case"textarea":yf(r),c0(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=Dh)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=uC(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Vs]=t,e[id]=r,O1(e,t,!1,!1),t.stateNode=e;e:{switch(a=Dy(n,r),n){case"dialog":Jt("cancel",e),Jt("close",e),s=r;break;case"iframe":case"object":case"embed":Jt("load",e),s=r;break;case"video":case"audio":for(s=0;s<Su.length;s++)Jt(Su[s],e);s=r;break;case"source":Jt("error",e),s=r;break;case"img":case"image":case"link":Jt("error",e),Jt("load",e),s=r;break;case"details":Jt("toggle",e),s=r;break;case"input":i0(e,r),s=Ry(e,r),Jt("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=hn({},r,{value:void 0}),Jt("invalid",e);break;case"textarea":l0(e,r),s=Oy(e,r),Jt("invalid",e);break;default:s=r}Ly(n,s),l=s;for(o in l)if(l.hasOwnProperty(o)){var c=l[o];o==="style"?hC(e,c):o==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&dC(e,c)):o==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Qu(e,c):typeof c=="number"&&Qu(e,""+c):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Ju.hasOwnProperty(o)?c!=null&&o==="onScroll"&&Jt("scroll",e):c!=null&&Iw(e,o,c,a))}switch(n){case"input":yf(e),a0(e,r,!1);break;case"textarea":yf(e),c0(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Ii(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Yl(e,!!r.multiple,o,!1):r.defaultValue!=null&&Yl(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=Dh)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return nr(t),null;case 6:if(e&&t.stateNode!=null)L1(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(se(166));if(n=va(ld.current),va(Xs.current),Ef(t)){if(r=t.stateNode,n=t.memoizedProps,r[Vs]=t,(o=r.nodeValue!==n)&&(e=Qr,e!==null))switch(e.tag){case 3:Cf(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Cf(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Vs]=t,t.stateNode=r}return nr(t),null;case 13:if(Qt(un),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(nn&&Jr!==null&&t.mode&1&&!(t.flags&128))e1(),bc(),t.flags|=98560,o=!1;else if(o=Ef(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(se(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(se(317));o[Vs]=t}else bc(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;nr(t),o=!1}else Ts!==null&&(yv(Ts),Ts=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||un.current&1?Fn===0&&(Fn=3):mx())),t.updateQueue!==null&&(t.flags|=4),nr(t),null);case 4:return kc(),cv(e,t),e===null&&sd(t.stateNode.containerInfo),nr(t),null;case 10:return Xw(t.type._context),nr(t),null;case 17:return Or(t.type)&&$h(),nr(t),null;case 19:if(Qt(un),o=t.memoizedState,o===null)return nr(t),null;if(r=(t.flags&128)!==0,a=o.rendering,a===null)if(r)uu(o,!1);else{if(Fn!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Kh(e),a!==null){for(t.flags|=128,uu(o,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,a=o.alternate,a===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=a.childLanes,o.lanes=a.lanes,o.child=a.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=a.memoizedProps,o.memoizedState=a.memoizedState,o.updateQueue=a.updateQueue,o.type=a.type,e=a.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Bt(un,un.current&1|2),t.child}e=e.sibling}o.tail!==null&&En()>Cc&&(t.flags|=128,r=!0,uu(o,!1),t.lanes=4194304)}else{if(!r)if(e=Kh(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),uu(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!nn)return nr(t),null}else 2*En()-o.renderingStartTime>Cc&&n!==1073741824&&(t.flags|=128,r=!0,uu(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=En(),t.sibling=null,n=un.current,Bt(un,r?n&1|2:n&1),t):(nr(t),null);case 22:case 23:return px(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Vr&1073741824&&(nr(t),t.subtreeFlags&6&&(t.flags|=8192)):nr(t),null;case 24:return null;case 25:return null}throw Error(se(156,t.tag))}function B2(e,t){switch(Yw(t),t.tag){case 1:return Or(t.type)&&$h(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return kc(),Qt(Ir),Qt(ir),rx(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return nx(t),null;case 13:if(Qt(un),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(se(340));bc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Qt(un),null;case 4:return kc(),null;case 10:return Xw(t.type._context),null;case 22:case 23:return px(),null;case 24:return null;default:return null}}var Tf=!1,sr=!1,W2=typeof WeakSet=="function"?WeakSet:Set,ye=null;function zl(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){yn(e,t,r)}else n.current=null}function uv(e,t,n){try{n()}catch(r){yn(e,t,r)}}var X0=!1;function H2(e,t){if(Vy=Oh,e=zC(),qw(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,l=-1,c=-1,u=0,f=0,p=e,h=null;t:for(;;){for(var m;p!==n||s!==0&&p.nodeType!==3||(l=a+s),p!==o||r!==0&&p.nodeType!==3||(c=a+r),p.nodeType===3&&(a+=p.nodeValue.length),(m=p.firstChild)!==null;)h=p,p=m;for(;;){if(p===e)break t;if(h===n&&++u===s&&(l=a),h===o&&++f===r&&(c=a),(m=p.nextSibling)!==null)break;p=h,h=p.parentNode}p=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Yy={focusedElem:e,selectionRange:n},Oh=!1,ye=t;ye!==null;)if(t=ye,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ye=e;else for(;ye!==null;){t=ye;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var g=v.memoizedProps,x=v.memoizedState,w=t.stateNode,y=w.getSnapshotBeforeUpdate(t.elementType===t.type?g:ks(t.type,g),x);w.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(se(163))}}catch(_){yn(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,ye=e;break}ye=t.return}return v=X0,X0=!1,v}function Lu(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&uv(t,n,o)}s=s.next}while(s!==r)}}function Up(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function dv(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function D1(e){var t=e.alternate;t!==null&&(e.alternate=null,D1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Vs],delete t[id],delete t[Qy],delete t[E2],delete t[j2])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function $1(e){return e.tag===5||e.tag===3||e.tag===4}function Z0(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||$1(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function fv(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Dh));else if(r!==4&&(e=e.child,e!==null))for(fv(e,t,n),e=e.sibling;e!==null;)fv(e,t,n),e=e.sibling}function hv(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(hv(e,t,n),e=e.sibling;e!==null;)hv(e,t,n),e=e.sibling}var Vn=null,js=!1;function Yo(e,t,n){for(n=n.child;n!==null;)U1(e,t,n),n=n.sibling}function U1(e,t,n){if(Qs&&typeof Qs.onCommitFiberUnmount=="function")try{Qs.onCommitFiberUnmount(Rp,n)}catch{}switch(n.tag){case 5:sr||zl(n,t);case 6:var r=Vn,s=js;Vn=null,Yo(e,t,n),Vn=r,js=s,Vn!==null&&(js?(e=Vn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Vn.removeChild(n.stateNode));break;case 18:Vn!==null&&(js?(e=Vn,n=n.stateNode,e.nodeType===8?hg(e.parentNode,n):e.nodeType===1&&hg(e,n),td(e)):hg(Vn,n.stateNode));break;case 4:r=Vn,s=js,Vn=n.stateNode.containerInfo,js=!0,Yo(e,t,n),Vn=r,js=s;break;case 0:case 11:case 14:case 15:if(!sr&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var o=s,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&uv(n,t,a),s=s.next}while(s!==r)}Yo(e,t,n);break;case 1:if(!sr&&(zl(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){yn(n,t,l)}Yo(e,t,n);break;case 21:Yo(e,t,n);break;case 22:n.mode&1?(sr=(r=sr)||n.memoizedState!==null,Yo(e,t,n),sr=r):Yo(e,t,n);break;default:Yo(e,t,n)}}function e_(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new W2),t.forEach(function(r){var s=Z2.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function ws(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var o=e,a=t,l=a;e:for(;l!==null;){switch(l.tag){case 5:Vn=l.stateNode,js=!1;break e;case 3:Vn=l.stateNode.containerInfo,js=!0;break e;case 4:Vn=l.stateNode.containerInfo,js=!0;break e}l=l.return}if(Vn===null)throw Error(se(160));U1(o,a,s),Vn=null,js=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(u){yn(s,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)F1(t,e),t=t.sibling}function F1(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ws(t,e),Bs(e),r&4){try{Lu(3,e,e.return),Up(3,e)}catch(g){yn(e,e.return,g)}try{Lu(5,e,e.return)}catch(g){yn(e,e.return,g)}}break;case 1:ws(t,e),Bs(e),r&512&&n!==null&&zl(n,n.return);break;case 5:if(ws(t,e),Bs(e),r&512&&n!==null&&zl(n,n.return),e.flags&32){var s=e.stateNode;try{Qu(s,"")}catch(g){yn(e,e.return,g)}}if(r&4&&(s=e.stateNode,s!=null)){var o=e.memoizedProps,a=n!==null?n.memoizedProps:o,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&o.type==="radio"&&o.name!=null&&lC(s,o),Dy(l,a);var u=Dy(l,o);for(a=0;a<c.length;a+=2){var f=c[a],p=c[a+1];f==="style"?hC(s,p):f==="dangerouslySetInnerHTML"?dC(s,p):f==="children"?Qu(s,p):Iw(s,f,p,u)}switch(l){case"input":Ay(s,o);break;case"textarea":cC(s,o);break;case"select":var h=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var m=o.value;m!=null?Yl(s,!!o.multiple,m,!1):h!==!!o.multiple&&(o.defaultValue!=null?Yl(s,!!o.multiple,o.defaultValue,!0):Yl(s,!!o.multiple,o.multiple?[]:"",!1))}s[id]=o}catch(g){yn(e,e.return,g)}}break;case 6:if(ws(t,e),Bs(e),r&4){if(e.stateNode===null)throw Error(se(162));s=e.stateNode,o=e.memoizedProps;try{s.nodeValue=o}catch(g){yn(e,e.return,g)}}break;case 3:if(ws(t,e),Bs(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{td(t.containerInfo)}catch(g){yn(e,e.return,g)}break;case 4:ws(t,e),Bs(e);break;case 13:ws(t,e),Bs(e),s=e.child,s.flags&8192&&(o=s.memoizedState!==null,s.stateNode.isHidden=o,!o||s.alternate!==null&&s.alternate.memoizedState!==null||(fx=En())),r&4&&e_(e);break;case 22:if(f=n!==null&&n.memoizedState!==null,e.mode&1?(sr=(u=sr)||f,ws(t,e),sr=u):ws(t,e),Bs(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!f&&e.mode&1)for(ye=e,f=e.child;f!==null;){for(p=ye=f;ye!==null;){switch(h=ye,m=h.child,h.tag){case 0:case 11:case 14:case 15:Lu(4,h,h.return);break;case 1:zl(h,h.return);var v=h.stateNode;if(typeof v.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(g){yn(r,n,g)}}break;case 5:zl(h,h.return);break;case 22:if(h.memoizedState!==null){n_(p);continue}}m!==null?(m.return=h,ye=m):n_(p)}f=f.sibling}e:for(f=null,p=e;;){if(p.tag===5){if(f===null){f=p;try{s=p.stateNode,u?(o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(l=p.stateNode,c=p.memoizedProps.style,a=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=fC("display",a))}catch(g){yn(e,e.return,g)}}}else if(p.tag===6){if(f===null)try{p.stateNode.nodeValue=u?"":p.memoizedProps}catch(g){yn(e,e.return,g)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===e)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;p.sibling===null;){if(p.return===null||p.return===e)break e;f===p&&(f=null),p=p.return}f===p&&(f=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:ws(t,e),Bs(e),r&4&&e_(e);break;case 21:break;default:ws(t,e),Bs(e)}}function Bs(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if($1(n)){var r=n;break e}n=n.return}throw Error(se(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(Qu(s,""),r.flags&=-33);var o=Z0(e);hv(e,o,s);break;case 3:case 4:var a=r.stateNode.containerInfo,l=Z0(e);fv(e,l,a);break;default:throw Error(se(161))}}catch(c){yn(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function K2(e,t,n){ye=e,z1(e)}function z1(e,t,n){for(var r=(e.mode&1)!==0;ye!==null;){var s=ye,o=s.child;if(s.tag===22&&r){var a=s.memoizedState!==null||Tf;if(!a){var l=s.alternate,c=l!==null&&l.memoizedState!==null||sr;l=Tf;var u=sr;if(Tf=a,(sr=c)&&!u)for(ye=s;ye!==null;)a=ye,c=a.child,a.tag===22&&a.memoizedState!==null?r_(s):c!==null?(c.return=a,ye=c):r_(s);for(;o!==null;)ye=o,z1(o),o=o.sibling;ye=s,Tf=l,sr=u}t_(e)}else s.subtreeFlags&8772&&o!==null?(o.return=s,ye=o):t_(e)}}function t_(e){for(;ye!==null;){var t=ye;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:sr||Up(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!sr)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:ks(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&U0(t,o,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}U0(t,a,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var f=u.memoizedState;if(f!==null){var p=f.dehydrated;p!==null&&td(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(se(163))}sr||t.flags&512&&dv(t)}catch(h){yn(t,t.return,h)}}if(t===e){ye=null;break}if(n=t.sibling,n!==null){n.return=t.return,ye=n;break}ye=t.return}}function n_(e){for(;ye!==null;){var t=ye;if(t===e){ye=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ye=n;break}ye=t.return}}function r_(e){for(;ye!==null;){var t=ye;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Up(4,t)}catch(c){yn(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(c){yn(t,s,c)}}var o=t.return;try{dv(t)}catch(c){yn(t,o,c)}break;case 5:var a=t.return;try{dv(t)}catch(c){yn(t,a,c)}}}catch(c){yn(t,t.return,c)}if(t===e){ye=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ye=l;break}ye=t.return}}var q2=Math.ceil,Yh=$o.ReactCurrentDispatcher,ux=$o.ReactCurrentOwner,us=$o.ReactCurrentBatchConfig,st=0,Wn=null,An=null,Yn=0,Vr=0,Bl=Fi(0),Fn=0,fd=null,La=0,Fp=0,dx=0,Du=null,Pr=null,fx=0,Cc=1/0,wo=null,Gh=!1,pv=null,Ei=null,Pf=!1,xi=null,Jh=0,$u=0,mv=null,dh=-1,fh=0;function pr(){return st&6?En():dh!==-1?dh:dh=En()}function ji(e){return e.mode&1?st&2&&Yn!==0?Yn&-Yn:T2.transition!==null?(fh===0&&(fh=CC()),fh):(e=Pt,e!==0||(e=window.event,e=e===void 0?16:AC(e.type)),e):1}function As(e,t,n,r){if(50<$u)throw $u=0,mv=null,Error(se(185));Dd(e,n,r),(!(st&2)||e!==Wn)&&(e===Wn&&(!(st&2)&&(Fp|=n),Fn===4&&ai(e,Yn)),Mr(e,r),n===1&&st===0&&!(t.mode&1)&&(Cc=En()+500,Lp&&zi()))}function Mr(e,t){var n=e.callbackNode;TO(e,t);var r=Ih(e,e===Wn?Yn:0);if(r===0)n!==null&&f0(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&f0(n),t===1)e.tag===0?N2(s_.bind(null,e)):QC(s_.bind(null,e)),S2(function(){!(st&6)&&zi()}),n=null;else{switch(EC(r)){case 1:n=$w;break;case 4:n=kC;break;case 16:n=Ah;break;case 536870912:n=SC;break;default:n=Ah}n=G1(n,B1.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function B1(e,t){if(dh=-1,fh=0,st&6)throw Error(se(327));var n=e.callbackNode;if(Zl()&&e.callbackNode!==n)return null;var r=Ih(e,e===Wn?Yn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Qh(e,r);else{t=r;var s=st;st|=2;var o=H1();(Wn!==e||Yn!==t)&&(wo=null,Cc=En()+500,Ta(e,t));do try{G2();break}catch(l){W1(e,l)}while(!0);Qw(),Yh.current=o,st=s,An!==null?t=0:(Wn=null,Yn=0,t=Fn)}if(t!==0){if(t===2&&(s=By(e),s!==0&&(r=s,t=gv(e,s))),t===1)throw n=fd,Ta(e,0),ai(e,r),Mr(e,En()),n;if(t===6)ai(e,r);else{if(s=e.current.alternate,!(r&30)&&!V2(s)&&(t=Qh(e,r),t===2&&(o=By(e),o!==0&&(r=o,t=gv(e,o))),t===1))throw n=fd,Ta(e,0),ai(e,r),Mr(e,En()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(se(345));case 2:la(e,Pr,wo);break;case 3:if(ai(e,r),(r&130023424)===r&&(t=fx+500-En(),10<t)){if(Ih(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){pr(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Jy(la.bind(null,e,Pr,wo),t);break}la(e,Pr,wo);break;case 4:if(ai(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var a=31-Rs(r);o=1<<a,a=t[a],a>s&&(s=a),r&=~o}if(r=s,r=En()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*q2(r/1960))-r,10<r){e.timeoutHandle=Jy(la.bind(null,e,Pr,wo),r);break}la(e,Pr,wo);break;case 5:la(e,Pr,wo);break;default:throw Error(se(329))}}}return Mr(e,En()),e.callbackNode===n?B1.bind(null,e):null}function gv(e,t){var n=Du;return e.current.memoizedState.isDehydrated&&(Ta(e,t).flags|=256),e=Qh(e,t),e!==2&&(t=Pr,Pr=n,t!==null&&yv(t)),e}function yv(e){Pr===null?Pr=e:Pr.push.apply(Pr,e)}function V2(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],o=s.getSnapshot;s=s.value;try{if(!Is(o(),s))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ai(e,t){for(t&=~dx,t&=~Fp,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Rs(t),r=1<<n;e[n]=-1,t&=~r}}function s_(e){if(st&6)throw Error(se(327));Zl();var t=Ih(e,0);if(!(t&1))return Mr(e,En()),null;var n=Qh(e,t);if(e.tag!==0&&n===2){var r=By(e);r!==0&&(t=r,n=gv(e,r))}if(n===1)throw n=fd,Ta(e,0),ai(e,t),Mr(e,En()),n;if(n===6)throw Error(se(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,la(e,Pr,wo),Mr(e,En()),null}function hx(e,t){var n=st;st|=1;try{return e(t)}finally{st=n,st===0&&(Cc=En()+500,Lp&&zi())}}function Da(e){xi!==null&&xi.tag===0&&!(st&6)&&Zl();var t=st;st|=1;var n=us.transition,r=Pt;try{if(us.transition=null,Pt=1,e)return e()}finally{Pt=r,us.transition=n,st=t,!(st&6)&&zi()}}function px(){Vr=Bl.current,Qt(Bl)}function Ta(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,k2(n)),An!==null)for(n=An.return;n!==null;){var r=n;switch(Yw(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&$h();break;case 3:kc(),Qt(Ir),Qt(ir),rx();break;case 5:nx(r);break;case 4:kc();break;case 13:Qt(un);break;case 19:Qt(un);break;case 10:Xw(r.type._context);break;case 22:case 23:px()}n=n.return}if(Wn=e,An=e=Ni(e.current,null),Yn=Vr=t,Fn=0,fd=null,dx=Fp=La=0,Pr=Du=null,ya!==null){for(t=0;t<ya.length;t++)if(n=ya[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,o=n.pending;if(o!==null){var a=o.next;o.next=s,r.next=a}n.pending=r}ya=null}return e}function W1(e,t){do{var n=An;try{if(Qw(),lh.current=Vh,qh){for(var r=dn.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}qh=!1}if(Ma=0,Bn=$n=dn=null,Mu=!1,cd=0,ux.current=null,n===null||n.return===null){Fn=1,fd=t,An=null;break}e:{var o=e,a=n.return,l=n,c=t;if(t=Yn,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,f=l,p=f.tag;if(!(f.mode&1)&&(p===0||p===11||p===15)){var h=f.alternate;h?(f.updateQueue=h.updateQueue,f.memoizedState=h.memoizedState,f.lanes=h.lanes):(f.updateQueue=null,f.memoizedState=null)}var m=K0(a);if(m!==null){m.flags&=-257,q0(m,a,l,o,t),m.mode&1&&H0(o,u,t),t=m,c=u;var v=t.updateQueue;if(v===null){var g=new Set;g.add(c),t.updateQueue=g}else v.add(c);break e}else{if(!(t&1)){H0(o,u,t),mx();break e}c=Error(se(426))}}else if(nn&&l.mode&1){var x=K0(a);if(x!==null){!(x.flags&65536)&&(x.flags|=256),q0(x,a,l,o,t),Gw(Sc(c,l));break e}}o=c=Sc(c,l),Fn!==4&&(Fn=2),Du===null?Du=[o]:Du.push(o),o=a;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var w=E1(o,c,t);$0(o,w);break e;case 1:l=c;var y=o.type,b=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Ei===null||!Ei.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var _=j1(o,l,t);$0(o,_);break e}}o=o.return}while(o!==null)}q1(n)}catch(k){t=k,An===n&&n!==null&&(An=n=n.return);continue}break}while(!0)}function H1(){var e=Yh.current;return Yh.current=Vh,e===null?Vh:e}function mx(){(Fn===0||Fn===3||Fn===2)&&(Fn=4),Wn===null||!(La&268435455)&&!(Fp&268435455)||ai(Wn,Yn)}function Qh(e,t){var n=st;st|=2;var r=H1();(Wn!==e||Yn!==t)&&(wo=null,Ta(e,t));do try{Y2();break}catch(s){W1(e,s)}while(!0);if(Qw(),st=n,Yh.current=r,An!==null)throw Error(se(261));return Wn=null,Yn=0,Fn}function Y2(){for(;An!==null;)K1(An)}function G2(){for(;An!==null&&!xO();)K1(An)}function K1(e){var t=Y1(e.alternate,e,Vr);e.memoizedProps=e.pendingProps,t===null?q1(e):An=t,ux.current=null}function q1(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=B2(n,t),n!==null){n.flags&=32767,An=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Fn=6,An=null;return}}else if(n=z2(n,t,Vr),n!==null){An=n;return}if(t=t.sibling,t!==null){An=t;return}An=t=e}while(t!==null);Fn===0&&(Fn=5)}function la(e,t,n){var r=Pt,s=us.transition;try{us.transition=null,Pt=1,J2(e,t,n,r)}finally{us.transition=s,Pt=r}return null}function J2(e,t,n,r){do Zl();while(xi!==null);if(st&6)throw Error(se(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(se(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(PO(e,o),e===Wn&&(An=Wn=null,Yn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Pf||(Pf=!0,G1(Ah,function(){return Zl(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=us.transition,us.transition=null;var a=Pt;Pt=1;var l=st;st|=4,ux.current=null,H2(e,n),F1(n,e),g2(Yy),Oh=!!Vy,Yy=Vy=null,e.current=n,K2(n),bO(),st=l,Pt=a,us.transition=o}else e.current=n;if(Pf&&(Pf=!1,xi=e,Jh=s),o=e.pendingLanes,o===0&&(Ei=null),SO(n.stateNode),Mr(e,En()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(Gh)throw Gh=!1,e=pv,pv=null,e;return Jh&1&&e.tag!==0&&Zl(),o=e.pendingLanes,o&1?e===mv?$u++:($u=0,mv=e):$u=0,zi(),null}function Zl(){if(xi!==null){var e=EC(Jh),t=us.transition,n=Pt;try{if(us.transition=null,Pt=16>e?16:e,xi===null)var r=!1;else{if(e=xi,xi=null,Jh=0,st&6)throw Error(se(331));var s=st;for(st|=4,ye=e.current;ye!==null;){var o=ye,a=o.child;if(ye.flags&16){var l=o.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(ye=u;ye!==null;){var f=ye;switch(f.tag){case 0:case 11:case 15:Lu(8,f,o)}var p=f.child;if(p!==null)p.return=f,ye=p;else for(;ye!==null;){f=ye;var h=f.sibling,m=f.return;if(D1(f),f===u){ye=null;break}if(h!==null){h.return=m,ye=h;break}ye=m}}}var v=o.alternate;if(v!==null){var g=v.child;if(g!==null){v.child=null;do{var x=g.sibling;g.sibling=null,g=x}while(g!==null)}}ye=o}}if(o.subtreeFlags&2064&&a!==null)a.return=o,ye=a;else e:for(;ye!==null;){if(o=ye,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Lu(9,o,o.return)}var w=o.sibling;if(w!==null){w.return=o.return,ye=w;break e}ye=o.return}}var y=e.current;for(ye=y;ye!==null;){a=ye;var b=a.child;if(a.subtreeFlags&2064&&b!==null)b.return=a,ye=b;else e:for(a=y;ye!==null;){if(l=ye,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Up(9,l)}}catch(k){yn(l,l.return,k)}if(l===a){ye=null;break e}var _=l.sibling;if(_!==null){_.return=l.return,ye=_;break e}ye=l.return}}if(st=s,zi(),Qs&&typeof Qs.onPostCommitFiberRoot=="function")try{Qs.onPostCommitFiberRoot(Rp,e)}catch{}r=!0}return r}finally{Pt=n,us.transition=t}}return!1}function o_(e,t,n){t=Sc(n,t),t=E1(e,t,1),e=Ci(e,t,1),t=pr(),e!==null&&(Dd(e,1,t),Mr(e,t))}function yn(e,t,n){if(e.tag===3)o_(e,e,n);else for(;t!==null;){if(t.tag===3){o_(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ei===null||!Ei.has(r))){e=Sc(n,e),e=j1(t,e,1),t=Ci(t,e,1),e=pr(),t!==null&&(Dd(t,1,e),Mr(t,e));break}}t=t.return}}function Q2(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=pr(),e.pingedLanes|=e.suspendedLanes&n,Wn===e&&(Yn&n)===n&&(Fn===4||Fn===3&&(Yn&130023424)===Yn&&500>En()-fx?Ta(e,0):dx|=n),Mr(e,t)}function V1(e,t){t===0&&(e.mode&1?(t=xf,xf<<=1,!(xf&130023424)&&(xf=4194304)):t=1);var n=pr();e=Ao(e,t),e!==null&&(Dd(e,t,n),Mr(e,n))}function X2(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),V1(e,n)}function Z2(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(se(314))}r!==null&&r.delete(t),V1(e,n)}var Y1;Y1=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ir.current)Rr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Rr=!1,F2(e,t,n);Rr=!!(e.flags&131072)}else Rr=!1,nn&&t.flags&1048576&&XC(t,zh,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;uh(e,t),e=t.pendingProps;var s=xc(t,ir.current);Xl(t,n),s=ox(null,t,r,e,s,n);var o=ix();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Or(r)?(o=!0,Uh(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,ex(t),s.updater=$p,t.stateNode=s,s._reactInternals=t,rv(t,r,e,n),t=iv(null,t,r,!0,o,n)):(t.tag=0,nn&&o&&Vw(t),dr(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(uh(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=tM(r),e=ks(r,e),s){case 0:t=ov(null,t,r,e,n);break e;case 1:t=G0(null,t,r,e,n);break e;case 11:t=V0(null,t,r,e,n);break e;case 14:t=Y0(null,t,r,ks(r.type,e),n);break e}throw Error(se(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ks(r,s),ov(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ks(r,s),G0(e,t,r,s,n);case 3:e:{if(R1(t),e===null)throw Error(se(387));
vendor: 4,581 bytes, line 40
40r=t.pendingProps,o=t.memoizedState,s=o.element,s1(e,t),Hh(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=Sc(Error(se(423)),t),t=J0(e,t,r,n,s);break e}else if(r!==s){s=Sc(Error(se(424)),t),t=J0(e,t,r,n,s);break e}else for(Jr=Si(t.stateNode.containerInfo.firstChild),Qr=t,nn=!0,Ts=null,n=n1(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(bc(),r===s){t=Io(e,t,n);break e}dr(e,t,r,n)}t=t.child}return t;case 5:return o1(t),e===null&&ev(t),r=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,a=s.children,Gy(r,s)?a=null:o!==null&&Gy(r,o)&&(t.flags|=32),P1(e,t),dr(e,t,a,n),t.child;case 6:return e===null&&ev(t),null;case 13:return A1(e,t,n);case 4:return tx(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=_c(t,null,r,n):dr(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ks(r,s),V0(e,t,r,s,n);case 7:return dr(e,t,t.pendingProps,n),t.child;case 8:return dr(e,t,t.pendingProps.children,n),t.child;case 12:return dr(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,o=t.memoizedProps,a=s.value,Bt(Bh,r._currentValue),r._currentValue=a,o!==null)if(Is(o.value,a)){if(o.children===s.children&&!Ir.current){t=Io(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){a=o.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(o.tag===1){c=jo(-1,n&-n),c.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?c.next=c:(c.next=f.next,f.next=c),u.pending=c}}o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),tv(o.return,n,t),l.lanes|=n;break}c=c.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(se(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),tv(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}dr(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Xl(t,n),s=fs(s),r=r(s),t.flags|=1,dr(e,t,r,n),t.child;case 14:return r=t.type,s=ks(r,t.pendingProps),s=ks(r.type,s),Y0(e,t,r,s,n);case 15:return N1(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ks(r,s),uh(e,t),t.tag=1,Or(r)?(e=!0,Uh(t)):e=!1,Xl(t,n),C1(t,r,s),rv(t,r,s,n),iv(null,t,r,!0,e,n);case 19:return I1(e,t,n);case 22:return T1(e,t,n)}throw Error(se(156,t.tag))};function G1(e,t){return _C(e,t)}function eM(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function cs(e,t,n,r){return new eM(e,t,n,r)}function gx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function tM(e){if(typeof e=="function")return gx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Mw)return 11;if(e===Lw)return 14}return 2}function Ni(e,t){var n=e.alternate;return n===null?(n=cs(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function hh(e,t,n,r,s,o){var a=2;if(r=e,typeof e=="function")gx(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Al:return Pa(n.children,s,o,t);case Ow:a=8,s|=8;break;case jy:return e=cs(12,n,t,s|2),e.elementType=jy,e.lanes=o,e;case Ny:return e=cs(13,n,t,s),e.elementType=Ny,e.lanes=o,e;case Ty:return e=cs(19,n,t,s),e.elementType=Ty,e.lanes=o,e;case oC:return zp(n,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case rC:a=10;break e;case sC:a=9;break e;case Mw:a=11;break e;case Lw:a=14;break e;case ri:a=16,r=null;break e}throw Error(se(130,e==null?e:typeof e,""))}return t=cs(a,n,t,s),t.elementType=e,t.type=r,t.lanes=o,t}function Pa(e,t,n,r){return e=cs(7,e,r,t),e.lanes=n,e}
vendor: 4,511 bytes, line 40
40function zp(e,t,n,r){return e=cs(22,e,r,t),e.elementType=oC,e.lanes=n,e.stateNode={isHidden:!1},e}function bg(e,t,n){return e=cs(6,e,null,t),e.lanes=n,e}function _g(e,t,n){return t=cs(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function nM(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ng(0),this.expirationTimes=ng(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ng(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function yx(e,t,n,r,s,o,a,l,c){return e=new nM(e,t,n,l,c),t===1?(t=1,o===!0&&(t|=8)):t=0,o=cs(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ex(o),e}function rM(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Rl,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function J1(e){if(!e)return Oi;e=e._reactInternals;e:{if(Va(e)!==e||e.tag!==1)throw Error(se(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Or(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(se(171))}if(e.tag===1){var n=e.type;if(Or(n))return JC(e,n,t)}return t}function Q1(e,t,n,r,s,o,a,l,c){return e=yx(n,r,!0,e,s,o,a,l,c),e.context=J1(null),n=e.current,r=pr(),s=ji(n),o=jo(r,s),o.callback=t??null,Ci(n,o,s),e.current.lanes=s,Dd(e,s,r),Mr(e,r),e}function Bp(e,t,n,r){var s=t.current,o=pr(),a=ji(s);return n=J1(n),t.context===null?t.context=n:t.pendingContext=n,t=jo(o,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Ci(s,t,a),e!==null&&(As(e,s,a,o),ah(e,s,a)),a}function Xh(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function i_(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function vx(e,t){i_(e,t),(e=e.alternate)&&i_(e,t)}function sM(){return null}var X1=typeof reportError=="function"?reportError:function(e){console.error(e)};function wx(e){this._internalRoot=e}Wp.prototype.render=wx.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(se(409));Bp(e,t,null,null)};Wp.prototype.unmount=wx.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Da(function(){Bp(null,e,null,null)}),t[Ro]=null}};function Wp(e){this._internalRoot=e}Wp.prototype.unstable_scheduleHydration=function(e){if(e){var t=TC();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ii.length&&t!==0&&t<ii[n].priority;n++);ii.splice(n,0,e),n===0&&RC(e)}};function xx(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Hp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function a_(){}function oM(e,t,n,r,s){if(s){if(typeof r=="function"){var o=r;r=function(){var u=Xh(a);o.call(u)}}var a=Q1(t,r,e,0,null,!1,!1,"",a_);return e._reactRootContainer=a,e[Ro]=a.current,sd(e.nodeType===8?e.parentNode:e),Da(),a}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var l=r;r=function(){var u=Xh(c);l.call(u)}}var c=yx(e,0,!1,null,null,!1,!1,"",a_);return e._reactRootContainer=c,e[Ro]=c.current,sd(e.nodeType===8?e.parentNode:e),Da(function(){Bp(t,c,n,r)}),c}function Kp(e,t,n,r,s){var o=n._reactRootContainer;if(o){var a=o;if(typeof s=="function"){var l=s;s=function(){var c=Xh(a);l.call(c)}}Bp(t,a,e,s)}else a=oM(n,t,e,s,r);return Xh(a)}jC=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ku(t.pendingLanes);n!==0&&(Uw(t,n|1),Mr(t,En()),!(st&6)&&(Cc=En()+500,zi()))}break;case 13:Da(function(){var r=Ao(e,1);if(r!==null){var s=pr();As(r,e,1,s)}}),vx(e,1)}};Fw=function(e){if(e.tag===13){var t=Ao(e,134217728);if(t!==null){var n=pr();As(t,e,134217728,n)}vx(e,134217728)}};NC=function(e){if(e.tag===13){var t=ji(e),n=Ao(e,t);if(n!==null){var r=pr();As(n,e,t,r)}vx(e,t)}};TC=function(){return Pt};PC=function(e,t){var n=Pt;try{return Pt=e,t()}finally{Pt=n}
40};Uy=function(e,t,n){switch(t){case"input":if(Ay(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=Mp(r);if(!s)throw Error(se(90));aC(r),Ay(r,s)}}}break;case"textarea":cC(e,n);break;case"select":t=n.value,t!=null&&Yl(e,!!n.multiple,t,!1)}};gC=hx;yC=Da;var iM={usingClientEntryPoint:!1,Events:[Ud,Ll,Mp,pC,mC,hx]},du={findFiberByHostInstance:ga,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},aM={bundleType:du.bundleType,version:du.version,rendererPackageName:du.rendererPackageName,rendererConfig:du.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:$o.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=xC(e),e===null?null:e.stateNode},findFiberByHostInstance:du.findFiberByHostInstance||sM,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Rf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Rf.isDisabled&&Rf.supportsFiber)try{Rp=Rf.inject(aM),Qs=Rf}catch{}}ts.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=iM;ts.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!xx(t))throw Error(se(200));return rM(e,t,null,n)};ts.createRoot=function(e,t){if(!xx(e))throw Error(se(299));var n=!1,r="",s=X1;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=yx(e,1,!1,null,null,n,!1,r,s),e[Ro]=t.current,sd(e.nodeType===8?e.parentNode:e),new wx(t)};ts.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(se(188)):(e=Object.keys(e).join(","),Error(se(268,e)));return e=xC(t),e=e===null?null:e.stateNode,e};ts.flushSync=function(e){return Da(e)};ts.hydrate=function(e,t,n){if(!Hp(t))throw Error(se(200));return Kp(null,e,t,!0,n)};ts.hydrateRoot=function(e,t,n){if(!xx(e))throw Error(se(405));var r=n!=null&&n.hydratedSources||null,s=!1,o="",a=X1;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=Q1(t,null,e,1,n??null,s,!1,o,a),e[Ro]=t.current,sd(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new Wp(t)};ts.render=function(e,t,n){if(!Hp(t))throw Error(se(200));return Kp(null,e,t,!1,n)};ts.unmountComponentAtNode=function(e){if(!Hp(e))throw Error(se(40));return e._reactRootContainer?(Da(function(){Kp(null,null,e,!1,function(){e._reactRootContainer=null,e[Ro]=null})}),!0):!1};ts.unstable_batchedUpdates=hx;ts.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Hp(n))throw Error(se(200));if(e==null||e._reactInternals===void 0)throw Error(se(38));return Kp(e,t,n,!1,r)};ts.version="18.3.1-next-f1338f8080-20240426";function Z1(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Z1)}catch(e){console.error(e)}}Z1(),ZS.exports=ts;var Bi=ZS.exports;const eE=FS(Bi);var tE,l_=Bi;tE=l_.createRoot,l_.hydrateRoot;/**
41 * react-router v7.13.0
42 *
43 * Copyright (c) Remix Software Inc.
44 *
45 * This source code is licensed under the MIT license found in the
46 * LICENSE.md file in the root directory of this source tree.
47 *
48 * @license MIT
49 */var c_="popstate";function lM(e={}){function t(r,s){let{pathname:o,search:a,hash:l}=r.location;return vv("",{pathname:o,search:a,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:hd(s)}return uM(t,n,null,e)}function fn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function eo(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function cM(){return Math.random().toString(36).substring(2,10)}function u_(e,t){return{usr:e.state,key:e.key,idx:t}}function vv(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Lc(t):t,state:n,key:t&&t.key||r||cM()}}function hd({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Lc(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function uM(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:o=!1}=r,a=s.history,l="POP",c=null,u=f();u==null&&(u=0,a.replaceState({...a.state,idx:u},""));function f(){return(a.state||{idx:null}).idx}function p(){l="POP";let x=f(),w=x==null?null:x-u;u=x,c&&c({action:l,location:g.location,delta:w})}function h(x,w){l="PUSH";let y=vv(g.location,x,w);u=f()+1;let b=u_(y,u),_=g.createHref(y);try{a.pushState(b,"",_)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;s.location.assign(_)}o&&c&&c({action:l,location:g.location,delta:1})}function m(x,w){l="REPLACE";let y=vv(g.location,x,w);u=f();let b=u_(y,u),_=g.createHref(y);a.replaceState(b,"",_),o&&c&&c({action:l,location:g.location,delta:0})}function v(x){return dM(x)}let g={get action(){return l},get location(){return e(s,a)}
49,listen(x){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(c_,p),c=x,()=>{s.removeEventListener(c_,p),c=null}},createHref(x){return t(s,x)},createURL:v,encodeLocation(x){let w=v(x);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:h,replace:m,go(x){return a.go(x)}};return g}function dM(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),fn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:hd(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function nE(e,t,n="/"){return fM(e,t,n,!1)}function fM(e,t,n,r){let s=typeof t=="string"?Lc(t):t,o=Oo(s.pathname||"/",n);if(o==null)return null;let a=rE(e);hM(a);let l=null;for(let c=0;l==null&&c<a.length;++c){let u=SM(o);l=_M(a[c],u,r)}return l}function rE(e,t=[],n=[],r="",s=!1){let o=(a,l,c=s,u)=>{let f={relativePath:u===void 0?a.path||"":u,caseSensitive:a.caseSensitive===!0,childrenIndex:l,route:a};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(r)&&c)return;fn(f.relativePath.startsWith(r),`Absolute route path "${f.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(r.length)}let p=No([r,f.relativePath]),h=n.concat(f);a.children&&a.children.length>0&&(fn(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),rE(a.children,t,h,p,c)),!(a.path==null&&!a.index)&&t.push({path:p,score:xM(p,a.index),routesMeta:h})};return e.forEach((a,l)=>{var c;if(a.path===""||!((c=a.path)!=null&&c.includes("?")))o(a,l);else for(let u of sE(a.path))o(a,l,!0,u)}),t}function sE(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return s?[o,""]:[o];let a=sE(r.join("/")),l=[];return l.push(...a.map(c=>c===""?o:[o,c].join("/"))),s&&l.push(...a),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function hM(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:bM(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var pM=/^:[\w-]+$/,mM=3,gM=2,yM=1,vM=10,wM=-2,d_=e=>e==="*";function xM(e,t){let n=e.split("/"),r=n.length;return n.some(d_)&&(r+=wM),t&&(r+=gM),n.filter(s=>!d_(s)).reduce((s,o)=>s+(pM.test(o)?mM:o===""?yM:vM),r)}function bM(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function _M(e,t,n=!1){let{routesMeta:r}=e,s={},o="/",a=[];for(let l=0;l<r.length;++l){let c=r[l],u=l===r.length-1,f=o==="/"?t:t.slice(o.length)||"/",p=Zh({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},f),h=c.route;if(!p&&u&&n&&!r[r.length-1].route.index&&(p=Zh({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},f)),!p)return null;
49Object.assign(s,p.params),a.push({params:s,pathname:No([o,p.pathname]),pathnameBase:NM(No([o,p.pathnameBase])),route:h}),p.pathnameBase!=="/"&&(o=No([o,p.pathnameBase]))}return a}function Zh(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=kM(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let o=s[0],a=o.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:r.reduce((u,{paramName:f,isOptional:p},h)=>{if(f==="*"){let v=l[h]||"";a=o.slice(0,o.length-v.length).replace(/(.)\/+$/,"$1")}const m=l[h];return p&&!m?u[f]=void 0:u[f]=(m||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:a,pattern:e}}function kM(e,t=!1,n=!0){eo(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function SM(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return eo(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Oo(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var CM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function EM(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Lc(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=f_(n.substring(1),"/"):o=f_(n,t)):o=t,{pathname:o,search:TM(r),hash:PM(s)}}function f_(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function kg(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}].  Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function jM(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function oE(e){let t=jM(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function iE(e,t,n,r=!1){let s;typeof e=="string"?s=Lc(e):(s={...e},fn(!s.pathname||!s.pathname.includes("?"),kg("?","pathname","search",s)),fn(!s.pathname||!s.pathname.includes("#"),kg("#","pathname","hash",s)),fn(!s.search||!s.search.includes("#"),kg("#","search","hash",s)));let o=e===""||s.pathname==="",a=o?"/":s.pathname,l;if(a==null)l=n;else{let p=t.length-1;if(!r&&a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),p-=1;s.pathname=h.join("/")}l=p>=0?t[p]:"/"}let c=EM(s,l),u=a&&a!=="/"&&a.endsWith("/"),f=(o||a===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||f)&&(c.pathname+="/"),c}var No=e=>e.join("/").replace(/\/\/+/g,"/"),NM=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),TM=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,PM=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,RM=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function AM(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function IM(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var aE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function lE(e,t){let n=e;if(typeof n!="string"||!CM.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,s=!1;if(aE)try{let o=new URL(window.location.href),a=n.startsWith("//")?new URL(o.protocol+n):new URL(n),l=Oo(a.pathname,t);a.origin===o.origin&&l!=null?n=l+a.search+a.hash:s=!0}catch{eo(!1,`<Link to="${n}">
49 contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:s,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var cE=["POST","PUT","PATCH","DELETE"];new Set(cE);var OM=["GET",...cE];new Set(OM);var Dc=d.createContext(null);Dc.displayName="DataRouter";var qp=d.createContext(null);qp.displayName="DataRouterState";var MM=d.createContext(!1),uE=d.createContext({isTransitioning:!1});uE.displayName="ViewTransition";var LM=d.createContext(new Map);LM.displayName="Fetchers";var DM=d.createContext(null);DM.displayName="Await";var ps=d.createContext(null);ps.displayName="Navigation";var zd=d.createContext(null);zd.displayName="Location";var io=d.createContext({outlet:null,matches:[],isDataRoute:!1});io.displayName="Route";var bx=d.createContext(null);bx.displayName="RouteError";var dE="REACT_ROUTER_ERROR",$M="REDIRECT",UM="ROUTE_ERROR_RESPONSE";function FM(e){if(e.startsWith(`${dE}:${$M}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function zM(e){if(e.startsWith(`${dE}:${UM}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new RM(t.status,t.statusText,t.data)}catch{}}function BM(e,{relative:t}={}){fn(Bd(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=d.useContext(ps),{hash:s,pathname:o,search:a}=Hd(e,{relative:t}),l=o;return n!=="/"&&(l=o==="/"?n:No([n,o])),r.createHref({pathname:l,search:a,hash:s})}function Bd(){return d.useContext(zd)!=null}function $s(){return fn(Bd(),"useLocation() may be used only in the context of a <Router> component."),d.useContext(zd).location}var fE="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function hE(e){d.useContext(ps).static||d.useLayoutEffect(e)}function Wi(){let{isDataRoute:e}=d.useContext(io);return e?tL():WM()}function WM(){fn(Bd(),"useNavigate() may be used only in the context of a <Router> component.");let e=d.useContext(Dc),{basename:t,navigator:n}=d.useContext(ps),{matches:r}=d.useContext(io),{pathname:s}=$s(),o=JSON.stringify(oE(r)),a=d.useRef(!1);return hE(()=>{a.current=!0}),d.useCallback((c,u={})=>{if(eo(a.current,fE),!a.current)return;if(typeof c=="number"){n.go(c);return}let f=iE(c,JSON.parse(o),s,u.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:No([t,f.pathname])),(u.replace?n.replace:n.push)(f,u.state,u)},[t,n,o,s,e])}d.createContext(null);function Wd(){let{matches:e}=d.useContext(io),t=e[e.length-1];return t?t.params:{}}function Hd(e,{relative:t}={}){let{matches:n}=d.useContext(io),{pathname:r}=$s(),s=JSON.stringify(oE(n));return d.useMemo(()=>iE(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function HM(e,t){return pE(e,t)}function pE(e,t,n,r,s){var y;fn(Bd(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=d.useContext(ps),{matches:a}=d.useContext(io),l=a[a.length-1],c=l?l.params:{},u=l?l.pathname:"/",f=l?l.pathnameBase:"/",p=l&&l.route;{let b=p&&p.path||"";gE(u,!p||b.endsWith("*")||b.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${b}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
50
51Please change the parent <Route path="${b}"> to <Route path="${b==="/"?"*":`${b}/*`}">.`)}let h=$s(),m;if(t){let b=typeof t=="string"?Lc(t):t;fn(f==="/"||((y=b.pathname)==null?void 0:y.startsWith(f)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${f}" but pathname "${b.pathname}" was given in the \`location\` prop.`),m=b}else m=h;let v=m.pathname||"/",g=v;if(f!=="/"){let b=f.replace(/^\//,"").split("/");g="/"+v.replace(/^\//,"").split("/").slice(b.length).join("/")}let x=nE(e,{pathname:g});eo(p||x!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),eo(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let w=GM(x&&x.map(b=>Object.assign({},b,{params:Object.assign({},c,b.params),pathname:No([f,o.encodeLocation?o.encodeLocation(b.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?f:No([f,o.encodeLocation?o.encodeLocation(b.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathnameBase])})),a,n,r,s);return t&&w?d.createElement(zd.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...m},navigationType:"POP"}},w):w}function KM(){let e=eL(),t=AM(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},a=null;return console.error("Error handled by React Router default ErrorBoundary:",e),a=d.createElement(d.Fragment,null,d.createElement("p",null,"💿 Hey developer 👋"),d.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",d.createElement("code",{style:o},"ErrorBoundary")," or"," ",d.createElement("code",{style:o},"errorElement")," prop on your route.")),d.createElement(d.Fragment,null,d.createElement("h2",null,"Unexpected Application 
51Error!"),d.createElement("h3",{style:{fontStyle:"italic"}},t),n?d.createElement("pre",{style:s},n):null,a)}var qM=d.createElement(KM,null),mE=class extends d.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=zM(e.digest);n&&(e=n)}let t=e!==void 0?d.createElement(io.Provider,{value:this.props.routeContext},d.createElement(bx.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?d.createElement(VM,{error:e},t):t}};mE.contextType=MM;var Sg=new WeakMap;function VM({children:e,error:t}){let{basename:n}=d.useContext(ps);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=FM(t.digest);if(r){let s=Sg.get(t);if(s)throw s;let o=lE(r.location,n);if(aE&&!Sg.get(t))if(o.isExternal||r.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const a=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:r.replace}));throw Sg.set(t,a),a}return d.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function YM({routeContext:e,match:t,children:n}){let r=d.useContext(Dc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),d.createElement(io.Provider,{value:e},n)}function GM(e,t=[],n=null,r=null,s=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,a=n==null?void 0:n.errors;if(a!=null){let f=o.findIndex(p=>p.route.id&&(a==null?void 0:a[p.route.id])!==void 0);fn(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),o=o.slice(0,Math.min(o.length,f+1))}let l=!1,c=-1;if(n)for(let f=0;f<o.length;f++){let p=o[f];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(c=f),p.route.id){let{loaderData:h,errors:m}=n,v=p.route.loader&&!h.hasOwnProperty(p.route.id)&&(!m||m[p.route.id]===void 0);if(p.route.lazy||v){l=!0,c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}let u=n&&r?(f,p)=>{var h,m;r(f,{location:n.location,params:((m=(h=n.matches)==null?void 0:h[0])==null?void 0:m.params)??{},unstable_pattern:IM(n.matches),errorInfo:p})}:void 0;return o.reduceRight((f,p,h)=>{let m,v=!1,g=null,x=null;n&&(m=a&&p.route.id?a[p.route.id]:void 0,g=p.route.errorElement||qM,l&&(c<0&&h===0?(gE("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,x=null):c===h&&(v=!0,x=p.route.hydrateFallbackElement||null)));let w=t.concat(o.slice(0,h+1)),y=()=>{let b;return m?b=g:v?b=x:p.route.Component?b=d.createElement(p.route.Component,null):p.route.element?b=p.route.element:b=f,d.createElement(YM,{match:p,routeContext:{outlet:f,matches:w,isDataRoute:n!=null},children:b})};return n&&(p.route.ErrorBoundary||p.route.errorElement||h===0)?d.createElement(mE,{location:n.location,revalidation:n.revalidation,component:g,error:m,children:y(),routeC
51ontext:{outlet:null,matches:w,isDataRoute:!0},onError:u}):y()},null)}function _x(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function JM(e){let t=d.useContext(Dc);return fn(t,_x(e)),t}function QM(e){let t=d.useContext(qp);return fn(t,_x(e)),t}function XM(e){let t=d.useContext(io);return fn(t,_x(e)),t}function kx(e){let t=XM(e),n=t.matches[t.matches.length-1];return fn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function ZM(){return kx("useRouteId")}function eL(){var r;let e=d.useContext(bx),t=QM("useRouteError"),n=kx("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function tL(){let{router:e}=JM("useNavigate"),t=kx("useNavigate"),n=d.useRef(!1);return hE(()=>{n.current=!0}),d.useCallback(async(s,o={})=>{eo(n.current,fE),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...o}))},[e,t])}var h_={};function gE(e,t,n){!t&&!h_[e]&&(h_[e]=!0,eo(!1,n))}d.memo(nL);function nL({routes:e,future:t,state:n,onError:r}){return pE(e,void 0,n,r,t)}function Ra(e){fn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function rL({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:o=!1,unstable_useTransitions:a}){fn(!Bd(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),c=d.useMemo(()=>({basename:l,navigator:s,static:o,unstable_useTransitions:a,future:{}}),[l,s,o,a]);typeof n=="string"&&(n=Lc(n));let{pathname:u="/",search:f="",hash:p="",state:h=null,key:m="default"}=n,v=d.useMemo(()=>{let g=Oo(u,l);return g==null?null:{location:{pathname:g,search:f,hash:p,state:h,key:m},navigationType:r}},[l,u,f,p,h,m,r]);return eo(v!=null,`<Router basename="${l}"> is not able to match the URL "${u}${f}${p}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:d.createElement(ps.Provider,{value:c},d.createElement(zd.Provider,{children:t,value:v}))}function yE({children:e,location:t}){return HM(wv(e),t)}function wv(e,t=[]){let n=[];return d.Children.forEach(e,(r,s)=>{if(!d.isValidElement(r))return;let o=[...t,s];if(r.type===d.Fragment){n.push.apply(n,wv(r.props.children,o));return}fn(r.type===Ra,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),fn(!r.props.index||!r.props.children,"An index route cannot have child routes.");let a={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=wv(r.props.children,o)),n.push(a)}),n}var ph="get",mh="application/x-www-form-urlencoded";function Vp(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function sL(e){return Vp(e)&&e.tagName.toLowerCase()==="button"}function oL(e){return Vp(e)&&e.tagName.toLowerCase()==="form"}function iL(e){return Vp(e)&&e.tagName.toLowerCase()==="input"}function aL(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function lL(e,t){return e.button===0&&(!t||t==="_self")&&!aL(e)}var Af=null;function cL(){if(Af===null)try{new FormData(document.createElement("form"),0),Af=!1}catch{Af=!0}return Af}var uL=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Cg(e){return e!=null&&!uL.has(e)?(eo(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${mh}"`),null):e}function dL(e,t){let n,r,s,o,a;if(oL(e)){let l=e.getAttribute("action");r=l?Oo(l,t):null,n=e.getAttribute("method")||ph,s=Cg(e.getAttribute("enctype"))||mh,o=new FormData(e)}else if(sL(e)||iL(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||l.getAttribute("action");if(r=c?Oo(c,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||ph,s=Cg(e.getAttribute("formenctype"))||Cg(l.getAttribute("enctype"))||mh,o=new FormData(l,e),!cL()){let{name:u,type:f,value:p}=e;if(f==="image"){let h=u?`${u}.`:"";o.append(`${h}x`,"0"),o.append(`${h}y`,"0")}else u&&o.append(u,p)}}else{if(Vp(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=ph,r=null,s=mh,a=e}return o&&s==="text/plain"&&(a=o,o=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:o,body:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Sx(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function fL(e,t,n,r){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${r}`:s.pathname=`${s.pathname}.${r}`:s.pathname==="/"?s.pathname=`_root.${r}`:t&&Oo(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${r}`,s}async function hL(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.
51isSpaMode,window.location.reload(),new Promise(()=>{})}}function pL(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function mL(e,t,n){let r=await Promise.all(e.map(async s=>{let o=t.routes[s.route.id];if(o){let a=await hL(o,n);return a.links?a.links():[]}return[]}));return wL(r.flat(1).filter(pL).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function p_(e,t,n,r,s,o){let a=(c,u)=>n[u]?c.route.id!==n[u].route.id:!0,l=(c,u)=>{var f;return n[u].pathname!==c.pathname||((f=n[u].route.path)==null?void 0:f.endsWith("*"))&&n[u].params["*"]!==c.params["*"]};return o==="assets"?t.filter((c,u)=>a(c,u)||l(c,u)):o==="data"?t.filter((c,u)=>{var p;let f=r.routes[c.route.id];if(!f||!f.hasLoader)return!1;if(a(c,u)||l(c,u))return!0;if(c.route.shouldRevalidate){let h=c.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((p=n[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof h=="boolean")return h}return!0}):[]}function gL(e,t,{includeHydrateFallback:n}={}){return yL(e.map(r=>{let s=t.routes[r.route.id];if(!s)return[];let o=[s.module];return s.clientActionModule&&(o=o.concat(s.clientActionModule)),s.clientLoaderModule&&(o=o.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(o=o.concat(s.hydrateFallbackModule)),s.imports&&(o=o.concat(s.imports)),o}).flat(1))}function yL(e){return[...new Set(e)]}function vL(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function wL(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let o=JSON.stringify(vL(s));return n.has(o)||(n.add(o),r.push({key:o,link:s})),r},[])}function vE(){let e=d.useContext(Dc);return Sx(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function xL(){let e=d.useContext(qp);return Sx(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Cx=d.createContext(void 0);Cx.displayName="FrameworkContext";function wE(){let e=d.useContext(Cx);return Sx(e,"You must render this element inside a <HydratedRouter> element"),e}function bL(e,t){let n=d.useContext(Cx),[r,s]=d.useState(!1),[o,a]=d.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:u,onMouseLeave:f,onTouchStart:p}=t,h=d.useRef(null);d.useEffect(()=>{if(e==="render"&&a(!0),e==="viewport"){let g=w=>{w.forEach(y=>{a(y.isIntersecting)})},x=new IntersectionObserver(g,{threshold:.5});return h.current&&x.observe(h.current),()=>{x.disconnect()}}},[e]),d.useEffect(()=>{if(r){let g=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(g)}}},[r]);let m=()=>{s(!0)},v=()=>{s(!1),a(!1)};return n?e!=="intent"?[o,h,{}]:[o,h,{onFocus:fu(l,m),onBlur:fu(c,v),onMouseEnter:fu(u,m),onMouseLeave:fu(f,v),onTouchStart:fu(p,m)}]:[!1,h,{}]}function fu(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function _L({page:e,...t}){let{router:n}=vE(),r=d.useMemo(()=>nE(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?d.createElement(SL,{page:e,matches:r,...t}):null}function kL(e){let{manifest:t,routeModules:n}=wE(),[r,s]=d.useState([]);return d.useEffect(()=>{let o=!1;return mL(e,t,n).then(a=>{o||s(a)}),()=>{o=!0}},[e,t,n]),r}function SL({page:e,matches:t,...n}){let r=$s(),{future:s,manifest:o,routeModules:a}=wE(),{basename:l}=vE(),{loaderData:c,matches:u}=xL(),f=d.useMemo(()=>p_(e,t,u,o,r,"data"),[e,t,u,o,r]),p=d.useMemo(()=>p_(e,t,u,o,r,"assets"),[e,t,u,o,r]),h=d.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let g=new Set,x=!1;if(t.forEach(y=>{var _;let b=o.routes[y.route.id];!b||!b.hasLoader||(!f.some(k=>k.route.id===y.route.id)&&y.route.id in c&&((_=a[y.route.id])!=null&&_.shouldRevalidate)||b.hasClientLoader?x=!0:g.add(y.route.id))}),g.size===0)return[];let w=fL(e,l,s.unstable_trailingSlashAwareDataRequests,"data");return x&&g.size>0&&w.searchParams.set("_routes",t.filter(y=>g.has(y.route.id)).map(y=>y.route.id).join(",")),[w.pathname+w.search]},[l,s.unstable_trailingSlashAwareDataRequests,c,r,o,f,t,e,a]),m=d.useMemo(()=>gL(p,o),[p,o]),v=kL(p);return d.createElement(d.Fragment,null,h.map(g=>d.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...n})),m.map(g=>d.createElement("link",{key:g,rel:"modulepreload",href:g,...n})),v.map(({key:g,link:x})=>d.createElement("link",{key:g,nonce:n.nonce,...x,crossOrigin:x.crossOrigin??n.crossOrigin})))}function CL(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var EL=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{EL&&(window.__reactRouterVersion="7.13.0")}catch{}function xE({basename:e,children:t,unstable_useTransitions:n,window:r}){let s=d.useRef();s.current==null&&(s.current=lM({window:r,v5Compat:!0}));let o=s.current,[a,l]=d.useState({action:o.action,location:o.location}),c=d.useCallback(u=>{n===!1?l(u):d.startTransition(()=>l(u))},[n]);return d.useLayoutEffect(()=>o.listen(c),[o,c]),d.createElement(rL,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:o,unstable_useTransitions:n})}var bE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ex=d.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:o,replace:a,state:l,target:c,to:u,preventScrollReset:f,viewTransition:p,unstable_defaultShouldRevalidate:h,...m},v){let{basename:g,unstable_useTransitions:x}=d.useContext(ps),w=typeof u=="string"&&bE.test(u),y=lE(u,g);u=y.to;let b=BM(u,{relative:s}),[_,k,C]=bL(r,m),E=PL(u,{replace:a,state:l,target:c,preventScrollReset:f,relative:s,viewTransition:p,unstable_defaultShouldRevalidate:h,unstable_useTransitions:x});function A(M){t&&t(M),M.defaultPrevented||E(M)}let T=d.createElement("a",{...m,...C,href:y.absoluteURL||b,onClick:y.isExternal||o?t:A,ref:CL(v,k),target:c,"data-discover":!w&&n==="render"?"true":void 0});return _&&!w?d.createElement(d.Fragment,null,T,d.createElement(_L,{page:b})):T});Ex.displayName="Link";var jL=d.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:o,to:a,viewTransition:l,children:c,...u},f){let p=Hd(a,{relative:u.relative}),h=$s(),m=d.useContext(qp),{navigator:v,basename:g}=d.useContext(ps),x=m!=null&&ML(p)&&l===!0,w=v.encodeLocation?v.encodeLocation(p).pathname:p.pathname,y=h.pathname,b=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;n||(y=y.toLowerCase(),b=b?b.toLowerCase():null,w=w.toLowerCase()),b&&g&&(b=Oo(b,g)||b);const _=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let k=y===w||!s&&y.startsWith(w)&&y.charAt(_)==="/",C=b!=null&&(b===w||!s&&b.startsWith(w)&&b.charAt(w.length)==="/"),E={isActive:k,isPending:C,isTransitioning:x},A=k?t:void 0,T;typeof r=="function"?T=r(E):T=[r,k?"active":null,C?"pending":null,x?"transitioning":null].filter(
51Boolean).join(" ");let M=typeof o=="function"?o(E):o;return d.createElement(Ex,{...u,"aria-current":A,className:T,ref:f,style:M,to:a,viewTransition:l},typeof c=="function"?c(E):c)});jL.displayName="NavLink";var NL=d.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:o,method:a=ph,action:l,onSubmit:c,relative:u,preventScrollReset:f,viewTransition:p,unstable_defaultShouldRevalidate:h,...m},v)=>{let{unstable_useTransitions:g}=d.useContext(ps),x=IL(),w=OL(l,{relative:u}),y=a.toLowerCase()==="get"?"get":"post",b=typeof l=="string"&&bE.test(l),_=k=>{if(c&&c(k),k.defaultPrevented)return;k.preventDefault();let C=k.nativeEvent.submitter,E=(C==null?void 0:C.getAttribute("formmethod"))||a,A=()=>x(C||k.currentTarget,{fetcherKey:t,method:E,navigate:n,replace:s,state:o,relative:u,preventScrollReset:f,viewTransition:p,unstable_defaultShouldRevalidate:h});g&&n!==!1?d.startTransition(()=>A()):A()};return d.createElement("form",{ref:v,method:y,action:w,onSubmit:r?c:_,...m,"data-discover":!b&&e==="render"?"true":void 0})});NL.displayName="Form";function TL(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function _E(e){let t=d.useContext(Dc);return fn(t,TL(e)),t}function PL(e,{target:t,replace:n,state:r,preventScrollReset:s,relative:o,viewTransition:a,unstable_defaultShouldRevalidate:l,unstable_useTransitions:c}={}){let u=Wi(),f=$s(),p=Hd(e,{relative:o});return d.useCallback(h=>{if(lL(h,t)){h.preventDefault();let m=n!==void 0?n:hd(f)===hd(p),v=()=>u(e,{replace:m,state:r,preventScrollReset:s,relative:o,viewTransition:a,unstable_defaultShouldRevalidate:l});c?d.startTransition(()=>v()):v()}},[f,u,p,n,r,t,e,s,o,a,l,c])}var RL=0,AL=()=>`__${String(++RL)}__`;function IL(){let{router:e}=_E("useSubmit"),{basename:t}=d.useContext(ps),n=ZM(),r=e.fetch,s=e.navigate;return d.useCallback(async(o,a={})=>{let{action:l,method:c,encType:u,formData:f,body:p}=dL(o,t);if(a.navigate===!1){let h=a.fetcherKey||AL();await r(h,n,a.action||l,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:f,body:p,formMethod:a.method||c,formEncType:a.encType||u,flushSync:a.flushSync})}else await s(a.action||l,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:f,body:p,formMethod:a.method||c,formEncType:a.encType||u,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,s,t,n])}function OL(e,{relative:t}={}){let{basename:n}=d.useContext(ps),r=d.useContext(io);fn(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),o={...Hd(e||".",{relative:t})},a=$s();if(e==null){o.search=a.search;let l=new URLSearchParams(o.search),c=l.getAll("index");if(c.some(f=>f==="")){l.delete("index"),c.filter(p=>p).forEach(p=>l.append("index",p));let f=l.toString();o.search=f?`?${f}`:""}}return(!e||e===".")&&s.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:No([n,o.pathname])),hd(o)}function ML(e,{relative:t}={}){let n=d.useContext(uE);fn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=_E("useViewTransitionState"),s=Hd(e,{relative:t});if(!n.isTransitioning)return!1;let o=Oo(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=Oo(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Zh(s.pathname,a)!=null||Zh(s.pathname,o)!=null}/**
52 * @license lucide-react v0.462.0 - ISC
53 *
54 * This source code is licensed under the ISC license.
55 * See the LICENSE file in the root directory of this source tree.
56 */const LL=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),kE=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
57 * @license lucide-react v0.462.0 - ISC
58 *
59 * This source code is licensed under the ISC license.
60 * See the LICENSE file in the root directory of this source tree.
61 */var DL={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
62 * @license lucide-react v0.462.0 - ISC
63 *
64 * This source code is licensed under the ISC license.
65 * See the LICENSE file in the root directory of this source tree.
66 */const $L=d.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:a,...l},c)=>d.createElement("svg",{ref:c,...DL,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:kE("lucide",s),...l},[...a.map(([u,f])=>d.createElement(u,f)),...Array.isArray(o)?o:[o]]));/**
67 * @license lucide-react v0.462.0 - ISC
68 *
69 * This source code is licensed under the ISC license.
70 * See the LICENSE file in the root directory of this source tree.
71 */const Ue=(e,t)=>{const n=d.forwardRef(({className:r,...s},o)=>d.createElement($L,{ref:o,iconNode:t,className:kE(`lucide-${LL(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
72 * @license lucide-react v0.462.0 - ISC
73 *
74 * This source code is licensed under the ISC license.
75 * See the LICENSE file in the root directory of this source tree.
76 */const Cu=Ue("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
77 * @license lucide-react v0.462.0 - ISC
78 *
79 * This source code is licensed under the ISC license.
80 * See the LICENSE file in the root directory of this source tree.
81 */const gh=Ue("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
82 * @license lucide-react v0.462.0 - ISC
83 *
84 * This source code is licensed under the ISC license.
85 * See the LICENSE file in the root directory of this source tree.
86 */const es=Ue("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
87 * @license lucide-react v0.462.0 - ISC
88 *
89 * This source code is licensed under the ISC license.
90 * See the LICENSE file in the root directory of this source tree.
91 */const Yp=Ue("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
92 * @license lucide-react v0.462.0 - ISC
93 *
94 * This source code is licensed under the ISC license.
95 * See the LICENSE file in the root directory of this source tree.
96 */const SE=Ue("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
97 * @license lucide-react v0.462.0 - ISC
98 *
99 * This source code is licensed under the ISC license.
100 * See the LICENSE file in the root directory of this source tree.
101 */const xo=Ue("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
102 * @license lucide-react v0.462.0 - ISC
103 *
104 * This source code is licensed under the ISC license.
105 * See the LICENSE file in the root directory of this source tree.
106 */const CE=Ue("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
107 * @license lucide-react v0.462.0 - ISC
108 *
109 * This source code is licensed under the ISC license.
110 * See the LICENSE file in the root directory of this source tree.
111 */const UL=Ue("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
112 * @license lucide-react v0.462.0 - ISC
113 *
114 * This source code is licensed under the ISC license.
115 * See the LICENSE file in the root directory of this source tree.
116 */const FL=Ue("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
117 * @license lucide-react v0.462.0 - ISC
118 *
119 * This source code is licensed under the ISC license.
120 * See the LICENSE file in the root directory of this source tree.
121 */const Eg=Ue("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
122 * @license lucide-react v0.462.0 - ISC
123 *
124 * This source code is licensed under the ISC license.
125 * See the LICENSE file in the root directory of this source tree.
126 */const EE=Ue("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
127 * @license lucide-react v0.462.0 - ISC
128 *
129 * This source code is licensed under the ISC license.
130 * See the LICENSE file in the root directory of this source tree.
131 */const ep=Ue("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
132 * @license lucide-react v0.462.0 - ISC
133 *
134 * This source code is licensed under the ISC license.
135 * See the LICENSE file in the root directory of this source tree.
136 */const zL=Ue("CornerRightUp",[["polyline",{points:"10 9 15 4 20 9",key:"1lr6px"}],["path",{d:"M4 20h7a4 4 0 0 0 4-4V4",key:"1plgdj"}]]);/**
137 * @license lucide-react v0.462.0 - ISC
138 *
139 * This source code is licensed under the ISC license.
140 * See the LICENSE file in the root directory of this source tree.
141 */const m_=Ue("FileSpreadsheet",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]]);/**
142 * @license lucide-react v0.462.0 - ISC
143 *
144 * This source code is licensed under the ISC license.
145 * See the LICENSE file in the root directory of this source tree.
146 */const BL=Ue("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
147 * @license lucide-react v0.462.0 - ISC
148 *
149 * This source code is licensed under the ISC license.
150 * See the LICENSE file in the root directory of this source tree.
151 */const WL=Ue("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/**
152 * @license lucide-react v0.462.0 - ISC
153 *
154 * This source code is licensed under the ISC license.
155 * See the LICENSE file in the root directory of this source tree.
156 */const g_=Ue("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
157 * @license lucide-react v0.462.0 - ISC
158 *
159 * This source code is licensed under the ISC license.
160 * See the LICENSE file in the root directory of this source tree.
161 */const jE=Ue("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
162 * @license lucide-react v0.462.0 - ISC
163 *
164 * This source code is licensed under the ISC license.
165 * See the LICENSE file in the root directory of this source tree.
166 */const HL=Ue("Instagram",[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]]);/**
167 * @license lucide-react v0.462.0 - ISC
168 *
169 * This source code is licensed under the ISC license.
170 * See the LICENSE file in the root directory of this source tree.
171 */const KL=Ue("Linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]]);/**
172 * @license lucide-react v0.462.0 - ISC
173 *
174 * This source code is licensed under the ISC license.
175 * See the LICENSE file in the root directory of this source tree.
176 */const to=Ue("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
177 * @license lucide-react v0.462.0 - ISC
178 *
179 * This source code is licensed under the ISC license.
180 * See the LICENSE file in the root directory of this source tree.
181 */const qL=Ue("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
182 * @license lucide-react v0.462.0 - ISC
183 *
184 * This source code is licensed under the ISC license.
185 * See the LICENSE file in the root directory of this source tree.
186 */const NE=Ue("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/**
187 * @license lucide-react v0.462.0 - ISC
188 *
189 * This source code is licensed under the ISC license.
190 * See the LICENSE file in the root directory of this source tree.
191 */const TE=Ue("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
192 * @license lucide-react v0.462.0 - ISC
193 *
194 * This source code is licensed under the ISC license.
195 * See the LICENSE file in the root directory of this source tree.
196 */const VL=Ue("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
197 * @license lucide-react v0.462.0 - ISC
198 *
199 * This source code is licensed under the ISC license.
200 * See the LICENSE file in the root directory of this source tree.
201 */const Uu=Ue("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
202 * @license lucide-react v0.462.0 - ISC
203 *
204 * This source code is licensed under the ISC license.
205 * See the LICENSE file in the root directory of this source tree.
206 */const YL=Ue("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
207 * @license lucide-react v0.462.0 - ISC
208 *
209 * This source code is licensed under the ISC license.
210 * See the LICENSE file in the root directory of this source tree.
211 */const PE=Ue("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
212 * @license lucide-react v0.462.0 - ISC
213 *
214 * This source code is licensed under the ISC license.
215 * See the LICENSE file in the root directory of this source tree.
216 */const RE=Ue("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
217 * @license lucide-react v0.462.0 - ISC
218 *
219 * This source code is licensed under the ISC license.
220 * See the LICENSE file in the root directory of this source tree.
221 */const GL=Ue("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
222 * @license lucide-react v0.462.0 - ISC
223 *
224 * This source code is licensed under the ISC license.
225 * See the LICENSE file in the root directory of this source tree.
226 */const jx=Ue("Share",[["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["polyline",{points:"16 6 12 2 8 6",key:"m901s6"}],["line",{x1:"12",x2:"12",y1:"2",y2:"15",key:"1p0rca"}]]);/**
227 * @license lucide-react v0.462.0 - ISC
228 *
229 * This source code is licensed under the ISC license.
230 * See the LICENSE file in the root directory of this source tree.
231 */const JL=Ue("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
232 * @license lucide-react v0.462.0 - ISC
233 *
234 * This source code is licensed under the ISC license.
235 * See the LICENSE file in the root directory of this source tree.
236 */const yh=Ue("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}
vendor: 6,037 bytes, lines 236-266
236],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
237 * @license lucide-react v0.462.0 - ISC
238 *
239 * This source code is licensed under the ISC license.
240 * See the LICENSE file in the root directory of this source tree.
241 */const AE=Ue("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
242 * @license lucide-react v0.462.0 - ISC
243 *
244 * This source code is licensed under the ISC license.
245 * See the LICENSE file in the root directory of this source tree.
246 */const QL=Ue("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
247 * @license lucide-react v0.462.0 - ISC
248 *
249 * This source code is licensed under the ISC license.
250 * See the LICENSE file in the root directory of this source tree.
251 */const IE=Ue("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
252 * @license lucide-react v0.462.0 - ISC
253 *
254 * This source code is licensed under the ISC license.
255 * See the LICENSE file in the root directory of this source tree.
256 */const xv=Ue("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
257 * @license lucide-react v0.462.0 - ISC
258 *
259 * This source code is licensed under the ISC license.
260 * See the LICENSE file in the root directory of this source tree.
261 */const OE=Ue("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
262 * @license lucide-react v0.462.0 - ISC
263 *
264 * This source code is licensed under the ISC license.
265 * See the LICENSE file in the root directory of this source tree.
266 */const $c=Ue("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function y_(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Mo(...e){return t=>{let n=!1;const r=e.map(s=>{const o=y_(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():y_(e[s],null)}}}}function Pe(...e){return d.useCallback(Mo(...e),e)}function Mi(e){const t=ZL(e),n=d.forwardRef((r,s)=>{const{children:o,...a}=r,l=d.Children.toArray(o),c=l.find(eD);if(c){const u=c.props.children,f=l.map(p=>p===c?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:p);return i.jsx(t,{...a,ref:s,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return i.jsx(t,{...a,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}var XL=Mi("Slot");function ZL(e){const t=d.forwardRef((n,r)=>{const{children:s,...o}=n;if(d.isValidElement(s)){const a=nD(s),l=tD(o,s.props);return s.type!==d.Fragment&&(l.ref=r?Mo(r,a):a),d.cloneElement(s,l)}return d.Children.count(s)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ME=Symbol("radix.slottable");function LE(e){const t=({children:n})=>i.jsx(i.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=ME,t}function eD(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ME}function tD(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...l)=>{const c=o(...l);return s(...l),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function nD(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function DE(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=DE(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function $E(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=DE(e))&&(r&&(r+=" "),r+=t);return r}const v_=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,w_=$E,Nx=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return w_(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:o}=t,a=Object.keys(s).map(u=>{const f=n==null?void 0:n[u],p=o==null?void 0:o[u];if(f===null)return null;const h=v_(f)||v_(p);return s[u][h]}),l=n&&Object.entries(n).reduce((u,f)=>{let[p,h]=f;return h===void 0||(u[p]=h),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,f)=>{let{class:p,className:h,...m}=f;return Object.entries(m).every(v=>{let[g,x]=v;return Array.isArray(x)?x.includes({...o,...l}[g]):{...o,...l}[g]===x})?[...u,p,h]:u},[]);return w_(e,a,c,n==null?void 0:n.class,n==null?void 0:n.className)},Tx="-",rD=e=>{const t=oD(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const l=a.split(Tx);return l[0]===""&&l.length!==1&&l.shift(),UE(l,t)||sD(a)},getConflictingClassGroupIds:(a,l)=>{const c=n[a]||[];return l&&r[a]?[...c,...r[a]]:c}}},UE=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?UE(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(Tx);return(a=t.validators.find(({validator:l})=>l(o)))==null?void 0:a.classGroupId},x_=/^\[(.+)\]$/,sD=e=>{if(x_.test(e)){const t=x_.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},oD=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};
vendor: 5,120 bytes, line 266
266return aD(Object.entries(e.classGroups),n).forEach(([o,a])=>{bv(a,r,o,t)}),r},bv=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:b_(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(iD(s)){bv(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,a])=>{bv(a,b_(t,o),n,r)})})},b_=(e,t)=>{let n=e;return t.split(Tx).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},iD=e=>e.isThemeGetter,aD=(e,t)=>t?e.map(([n,r])=>{const s=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,l])=>[t+a,l])):o);return[n,s]}):e,lD=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return s(o,a),a},set(o,a){n.has(o)?n.set(o,a):s(o,a)}}},FE="!",cD=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],o=t.length,a=l=>{const c=[];let u=0,f=0,p;for(let x=0;x<l.length;x++){let w=l[x];if(u===0){if(w===s&&(r||l.slice(x,x+o)===t)){c.push(l.slice(f,x)),f=x+o;continue}if(w==="/"){p=x;continue}}w==="["?u++:w==="]"&&u--}const h=c.length===0?l:l.substring(f),m=h.startsWith(FE),v=m?h.substring(1):h,g=p&&p>f?p-f:void 0;return{modifiers:c,hasImportantModifier:m,baseClassName:v,maybePostfixModifierPosition:g}};return n?l=>n({className:l,parseClassName:a}):a},uD=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},dD=e=>({cache:lD(e.cacheSize),parseClassName:cD(e),...rD(e)}),fD=/\s+/,hD=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,o=[],a=e.trim().split(fD);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{modifiers:f,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:m}=n(u);let v=!!m,g=r(v?h.substring(0,m):h);if(!g){if(!v){l=u+(l.length>0?" "+l:l);continue}if(g=r(h),!g){l=u+(l.length>0?" "+l:l);continue}v=!1}const x=uD(f).join(":"),w=p?x+FE:x,y=w+g;if(o.includes(y))continue;o.push(y);const b=s(g,v);for(let _=0;_<b.length;++_){const k=b[_];o.push(w+k)}l=u+(l.length>0?" "+l:l)}return l};function pD(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=zE(t))&&(r&&(r+=" "),r+=n);return r}const zE=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=zE(e[r]))&&(n&&(n+=" "),n+=t);return n};function mD(e,...t){let n,r,s,o=a;function a(c){const u=t.reduce((f,p)=>p(f),e());return n=dD(u),r=n.cache.get,s=n.cache.set,o=l,l(c)}function l(c){const u=r(c);if(u)return u;const f=hD(c,n);return s(c,f),f}return function(){return o(pD.apply(null,arguments))}}const Gt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},BE=/^\[(?:([a-z-]+):)?(.+)\]$/i,gD=/^\d+\/\d+$/,yD=new Set(["px","full","screen"]),vD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wD=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,xD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,bD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_D=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,po=e=>ec(e)||yD.has(e)||gD.test(e),Go=e=>Uc(e,"length",PD),ec=e=>!!e&&!Number.isNaN(Number(e)),jg=e=>Uc(e,"number",ec),hu=e=>!!e&&Number.isInteger(Number(e)),kD=e=>e.endsWith("%")&&ec(e.slice(0,-1)),Oe=e=>BE.test(e),Jo=e=>vD.test(e),SD=new Set(["length","size","percentage"]),CD=e=>Uc(e,SD,WE),ED=e=>Uc(e,"position",WE),jD=new Set(["image","url"]),ND=e=>Uc(e,jD,AD),TD=e=>Uc(e,"",RD),pu=()=>!0,Uc=(e,t,n)=>{const r=BE.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},PD=e=>wD.test(e)&&!xD.test(e),WE=()=>!1,RD=e=>bD.test(e),AD=e=>_D.test(e),ID=()=>{const e=Gt("colors"),t=Gt("spacing"),n=Gt("blur"),r=Gt("brightness"),s=Gt("borderColor"),o=Gt("borderRadius"),a=Gt("borderSpacing"),l=Gt("borderWidth"),c=Gt("contrast"),u=Gt("grayscale"),f=Gt("hueRotate"),p=Gt("invert"),h=Gt("gap"),m=Gt("gradientColorStops"),v=Gt("gradientColorStopPositions"),g=Gt("inset"),x=Gt("margin"),w=Gt("opacity"),y=Gt("padding"),b=Gt("saturate"),_=Gt("scale"),k=Gt("sepia"),C=Gt("skew"),E=Gt("space"),A=Gt("translate"),T=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",Oe,t],$=()=>[Oe,t],H=()=>["",po,Go],z=()=>["auto",ec,Oe],B=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],D=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],j=()=>["start","end","center","between","around","evenly","stretch"],N=()=>["","0",Oe],W=()=>["auto","avoid","all","avoid-page","page","left","right","column"],G=()=>[ec,Oe];return{cacheSize:500,separator:":",theme:{colors:[pu],spacing:[po,Go],blur:["none","",Jo,Oe],brightness:G(),borderColor:[e],borderRadius:["n
266one","","full",Jo,Oe],borderSpacing:$(),borderWidth:H(),contrast:G(),grayscale:N(),hueRotate:G(),invert:N(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[kD,Go],inset:P(),margin:P(),opacity:G(),padding:$(),saturate:G(),scale:G(),sepia:N(),skew:G(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",Oe]}],container:["container"],columns:[{columns:[Jo]}],"break-after":[{"break-after":W()}],"break-before":[{"break-before":W()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...B(),Oe]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",hu,Oe]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Oe]}],grow:[{grow:N()}],shrink:[{shrink:N()}],order:[{order:["first","last","none",hu,Oe]}],"grid-cols":[{"grid-cols":[pu]}],"col-start-end":[{col:["auto",{span:["full",hu,Oe]},Oe]}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":[pu]}],"row-start-end":[{row:["auto",{span:[hu,Oe]},Oe]}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Oe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Oe]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...j()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...j(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...j(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Oe,t]}],"min-w":[{"min-w":[Oe,t,"min","max","fit"]}],"max-w":[{"max-w":[Oe,t,"none","full","min","max","fit","prose",{screen:[Jo]},Jo]}],h:[{h:[Oe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Oe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Oe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Oe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Jo,Go]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",jg]}],"font-family":[{font:[pu]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Oe]}],"line-clamp":[{"line-clamp":["none",ec,jg]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",po,Oe]}],"list-image":[{"list-image":["none",Oe]}],"list-style-type":[{list:["none","disc","decimal",Oe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",po,Go]}],"underline-offset":[{"underline-offset":["auto",po,Oe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Oe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Oe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...B(),ED]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",CD]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ND]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}
vendor: 5,180 bytes, line 266
266],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...U(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:U()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...U()]}],"outline-offset":[{"outline-offset":[po,Oe]}],"outline-w":[{outline:[po,Go]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[po,Go]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Jo,TD]}],"shadow-color":[{shadow:[pu]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...D(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":D()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Jo,Oe]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[p]}],saturate:[{saturate:[b]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Oe]}],duration:[{duration:G()}],ease:[{ease:["linear","in","out","in-out",Oe]}],delay:[{delay:G()}],animate:[{animate:["none","spin","ping","pulse","bounce",Oe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[hu,Oe]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Oe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Oe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}
266],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Oe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[po,Go,jg]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},OD=mD(ID);function X(...e){return OD($E(e))}const pd=Nx("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ee=d.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},o)=>{const a=r?XL:"button";return i.jsx(a,{className:X(pd({variant:t,size:n,className:e})),ref:o,...s})});ee.displayName="Button";function qe(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function mr(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function fr(e,t){const n=qe(e);return isNaN(t)?mr(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Os(e,t){const n=qe(e);
266if(isNaN(t))return mr(e,NaN);if(!t)return n;const r=n.getDate(),s=mr(e,n.getTime());s.setMonth(n.getMonth()+t+1,0);const o=s.getDate();return r>=o?s:(n.setFullYear(s.getFullYear(),s.getMonth(),r),n)}function HE(e,t){const n=+qe(e);return mr(e,n+t)}const Px=6048e5,MD=864e5,KE=6e4,qE=36e5;function __(e,t){return HE(e,t*qE)}let LD={};function Kd(){return LD}function no(e,t){var l,c,u,f;const n=Kd(),r=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((f=(u=n.locale)==null?void 0:u.options)==null?void 0:f.weekStartsOn)??0,s=qe(e),o=s.getDay(),a=(o<r?7:0)+o-r;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function $a(e){return no(e,{weekStartsOn:1})}function VE(e){const t=qe(e),n=t.getFullYear(),r=mr(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const s=$a(r),o=mr(e,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const a=$a(o);return t.getTime()>=s.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function Ec(e){const t=qe(e);return t.setHours(0,0,0,0),t}function tp(e){const t=qe(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Gs(e,t){const n=Ec(e),r=Ec(t),s=+n-tp(n),o=+r-tp(r);return Math.round((s-o)/MD)}function DD(e){const t=VE(e),n=mr(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),$a(n)}function Ng(e,t){return HE(e,t*KE)}function tc(e,t){const n=t*7;return fr(e,n)}function $D(e,t){return Os(e,t*12)}function UD(e){let t;return e.forEach(function(n){const r=qe(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function FD(e){let t;return e.forEach(n=>{const r=qe(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function YE(e){return mr(e,Date.now())}function or(e,t){const n=Ec(e),r=Ec(t);return+n==+r}function Rx(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function zD(e){if(!Rx(e)&&typeof e!="number")return!1;const t=qe(e);return!isNaN(Number(t))}function md(e,t){const n=qe(e),r=qe(t),s=n.getFullYear()-r.getFullYear(),o=n.getMonth()-r.getMonth();return s*12+o}function BD(e,t,n){const r=no(e,n),s=no(t,n),o=+r-tp(r),a=+s-tp(s);return Math.round((o-a)/Px)}function GE(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function JE(e,t){return+qe(e)-+qe(t)}function WD(e,t,n){const r=JE(e,t)/qE;return GE(n==null?void 0:n.roundingMethod)(r)}function HD(e,t,n){const r=JE(e,t)/KE;return GE(n==null?void 0:n.roundingMethod)(r)}function Ax(e){const t=qe(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function Lr(e){const t=qe(e);return t.setDate(1),t.setHours(0,0,0,0),t}function QE(e){const t=qe(e),n=mr(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Ix(e,t){var l,c,u,f;const n=Kd(),r=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((f=(u=n.locale)==null?void 0:u.options)==null?void 0:f.weekStartsOn)??0,s=qe(e),o=s.getDay(),a=(o<r?-7:0)+6-(o-r);return s.setDate(s.getDate()+a),s.setHours(23,59,59,999),s}function XE(e){return Ix(e,{weekStartsOn:1})}const KD={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},qD=(e,t,n)=>{let r;const s=KD[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Tg(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const VD={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},YD={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},GD={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},JD={date:Tg({formats:VD,defaultWidth:"full"}),time:Tg({formats:YD,defaultWidth:"full"}),dateTime:Tg({formats:GD,defaultWidth:"full"})},QD={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},XD=(e,t,n,r)=>QD[e];function mu(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):a;s=e.formattingValues[l]||e.formattingValues[a]}else{const a=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;s=e.values[l]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}const ZD={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},e$={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},t$={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},n$={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
266ay","Saturday"]},r$={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},s$={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},o$=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},i$={ordinalNumber:o$,era:mu({values:ZD,defaultWidth:"wide"}),quarter:mu({values:e$,defaultWidth:"wide",argumentCallback:e=>e-1}),month:mu({values:t$,defaultWidth:"wide"}),day:mu({values:n$,defaultWidth:"wide"}),dayPeriod:mu({values:r$,defaultWidth:"wide",formattingValues:s$,defaultFormattingWidth:"wide"})};function gu(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const a=o[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?l$(l,p=>p.test(a)):a$(l,p=>p.test(a));let u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const f=t.slice(a.length);return{value:u,rest:f}}}function a$(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function l$(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function c$(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const s=r[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const l=t.slice(s.length);return{value:a,rest:l}}}const u$=/^(\d+)(th|st|nd|rd)?/i,d$=/\d+/i,f$={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},h$={any:[/^b/i,/^(a|c)/i]},p$={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},m$={any:[/1/i,/2/i,/3/i,/4/i]},g$={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},y$={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},v$={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},w$={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},x$={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},b$={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},_$={ordinalNumber:c$({matchPattern:u$,parsePattern:d$,valueCallback:e=>parseInt(e,10)}),era:gu({matchPatterns:f$,defaultMatchWidth:"wide",parsePatterns:h$,defaultParseWidth:"any"}),quarter:gu({matchPatterns:p$,defaultMatchWidth:"wide",parsePatterns:m$,defaultParseWidth:"any",valueCallback:e=>e+1}),month:gu({matchPatterns:g$,defaultMatchWidth:"wide",parsePatterns:y$,defaultParseWidth:"any"}),day:gu({matchPatterns:v$,defaultMatchWidth:"wide",parsePatterns:w$,defaultParseWidth:"any"}),dayPeriod:gu({matchPatterns:x$,defaultMatchWidth:"any",parsePatterns:b$,defaultParseWidth:"any"})},ZE={code:"en-US",formatDistance:qD,formatLong:JD,formatRelative:XD,localize:i$,match:_$,options:{weekStartsOn:0,firstWeekContainsDate:1}};function k$(e){const t=qe(e);return Gs(t,QE(t))+1}function ej(e){const t=qe(e),n=+$a(t)-+DD(t);return Math.round(n/Px)+1}function tj(e,t){var f,p,h,m;const n=qe(e),r=n.getFullYear(),s=Kd(),o=(t==null?void 0:t.firstWeekContainsDate)??((p=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??s.firstWeekContainsDate??((m=(h=s.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,a=mr(e,0);a.setFullYear(r+1,0,o),a.setHours(0,0,0,0);const l=no(a,t),c=mr(e,0);c.setFullYear(r,0,o),c.setHours(0,0,0,0);const u=no(c,t);return n.getTime()>=l.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function S$(e,t){var l,c,u,f;const n=Kd(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(u=n.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,s=tj(e,t),o=mr(e,0);return o.setFullYear(s,0,r),o.setHours(0,0,0,0),no(o,t)}function nj(e,t){const n=qe(e),r=+no(n,t)-+S$(n,t);return Math.round(r/Px)+1}function kt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Qo={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return kt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):kt(n+1,2)},d(e,t){return kt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return kt(e.getHours()%12||12,t.length)},H(e,t){return kt(e.getHours(),t.length)},m(e,t){return kt(e.getMinutes(),t.length)},s(e,t){return kt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return kt(s,t.length)}},fl={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},k_={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return Qo.y(e,t)},Y:function(e,t,n,r){const s=tj(e,r),o=s>0?s:1-s;if(t==="YY"){const a=o%100;return kt(a,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):kt(o,t.length)},R:function(e,t){const n=VE(e);return kt(n,t.length)},u:function(e,t){const n=e.getFullYear();return kt(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return kt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return kt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Qo.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return kt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const s=nj(e,r);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):kt(s,t.length)},I:function(e,t,n){const r=ej(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):kt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Qo.d(e,t)},D:function(e,t,n){const r=k$(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):kt(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const s=e.getDay(),o=(s-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return kt(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const s=e.getDay(),o=(s-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return kt(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),s=r===0?7:r;switch(t){case"i":return String(s);case"ii":return kt(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let s;switch(r===12?s=fl.noon:r===0?s=fl.midnight:s=r/12>
vendor: 4,371 bytes, line 266
266=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let s;switch(r>=17?s=fl.evening:r>=12?s=fl.afternoon:r>=4?s=fl.morning:s=fl.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Qo.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Qo.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):kt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):kt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Qo.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Qo.s(e,t)},S:function(e,t){return Qo.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return C_(r);case"XXXX":case"XX":return ca(r);case"XXXXX":case"XXX":default:return ca(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return C_(r);case"xxxx":case"xx":return ca(r);case"xxxxx":case"xxx":default:return ca(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+S_(r,":");case"OOOO":default:return"GMT"+ca(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+S_(r,":");case"zzzz":default:return"GMT"+ca(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return kt(r,t.length)},T:function(e,t,n){const r=e.getTime();return kt(r,t.length)}};function S_(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=Math.trunc(r/60),o=r%60;return o===0?n+String(s):n+String(s)+t+kt(o,2)}function C_(e,t){return e%60===0?(e>0?"-":"+")+kt(Math.abs(e)/60,2):ca(e,t)}function ca(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=kt(Math.trunc(r/60),2),o=kt(r%60,2);return n+s+t+o}const E_=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},rj=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},C$=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return E_(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",E_(r,t)).replace("{{time}}",rj(s,t))},E$={p:rj,P:C$},j$=/^D+$/,N$=/^Y+$/,T$=["D","DD","YY","YYYY"];function P$(e){return j$.test(e)}function R$(e){return N$.test(e)}function A$(e,t,n){const r=I$(e,t,n);if(console.warn(r),T$.includes(e))throw new RangeError(r)}function I$(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const O$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,M$=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,L$=/^'([^]*?)'?$/,D$=/''/g,$$=/[a-zA-Z]/;function tn(e,t,n){var f,p,h,m,v,g,x,w;const r=Kd(),s=(n==null?void 0:n.locale)??r.locale??ZE,o=(n==null?void 0:n.firstWeekContainsDate)??((p=(f=n==null?void 0:n.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??r.firstWeekContainsDate??((m=(h=r.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,a=(n==null?void 0:n.weekStartsOn)??((g=(v=n==null?void 0:n.locale)==null?void 0:v.options)==null?void 0:g.weekStartsOn)??r.weekStartsOn??((w=(x=r.locale)==null?void 0:x.options)==null?void 0:w.weekStartsOn)??0,l=qe(e);
266if(!zD(l))throw new RangeError("Invalid time value");let c=t.match(M$).map(y=>{const b=y[0];if(b==="p"||b==="P"){const _=E$[b];return _(y,s.formatLong)}return y}).join("").match(O$).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const b=y[0];if(b==="'")return{isToken:!1,value:U$(y)};if(k_[b])return{isToken:!0,value:y};if(b.match($$))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:y}});s.localize.preprocessor&&(c=s.localize.preprocessor(l,c));const u={firstWeekContainsDate:o,weekStartsOn:a,locale:s};return c.map(y=>{if(!y.isToken)return y.value;const b=y.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&R$(b)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&P$(b))&&A$(b,t,String(e));const _=k_[b[0]];return _(l,b,s.localize,u)}).join("")}function U$(e){const t=e.match(L$);return t?t[1].replace(D$,"'"):e}function F$(e){const t=qe(e),n=t.getFullYear(),r=t.getMonth(),s=mr(e,0);return s.setFullYear(n,r+1,0),s.setHours(0,0,0,0),s.getDate()}function z$(e){return Math.trunc(+qe(e)/1e3)}function B$(e){const t=qe(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function W$(e,t){return BD(B$(e),Lr(e),t)+1}function _v(e,t){const n=qe(e),r=qe(t);return n.getTime()>r.getTime()}function sj(e,t){const n=qe(e),r=qe(t);return+n<+r}function Ox(e,t){const n=qe(e),r=qe(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function H$(e,t){const n=qe(e),r=qe(t);return n.getFullYear()===r.getFullYear()}function K$(e){return or(e,YE(e))}function vh(e,t){return fr(e,-t)}function q$(e){return or(e,vh(YE(e),1))}function Pg(e,t){const n=qe(e),r=n.getFullYear(),s=n.getDate(),o=mr(e,0);o.setFullYear(r,t,15),o.setHours(0,0,0,0);const a=F$(o);return n.setMonth(t,Math.min(s,a)),n}function j_(e,t){const n=qe(e);return isNaN(+n)?mr(e,NaN):(n.setFullYear(t),n)}var Ys=function(){return Ys=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Ys.apply(this,arguments)};function Fc(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function V$(e,t,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(f){try{u(r.next(f))}catch(p){a(p)}}function c(f){try{u(r.throw(f))}catch(p){a(p)}}function u(f){f.done?o(f.value):s(f.value).then(l,c)}u((r=r.apply(e,t||[])).next())})}function Y$(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,o;r<s;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}const G$=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class Mx extends Error{constructor(t,n="FunctionsError",r){super(t),this.name=n,this.context=r}}class J$ extends Mx{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class N_ extends Mx{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class kv extends Mx{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var Sv;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(Sv||(Sv={}));class Q${constructor(t,{headers:n={},customFetch:r,region:s=Sv.Any}={}){this.url=t,this.headers=n,this.region=s,this.fetch=G$(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return V$(this,arguments,void 0,function*(n,r={}){var s;let o,a;
266try{const{headers:l,method:c,body:u,signal:f,timeout:p}=r;let h={},{region:m}=r;m||(m=this.region);const v=new URL(`${this.url}/${n}`);m&&m!=="any"&&(h["x-region"]=m,v.searchParams.set("forceFunctionRegion",m));let g;u&&(l&&!Object.prototype.hasOwnProperty.call(l,"Content-Type")||!l)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(h["Content-Type"]="application/octet-stream",g=u):typeof u=="string"?(h["Content-Type"]="text/plain",g=u):typeof FormData<"u"&&u instanceof FormData?g=u:(h["Content-Type"]="application/json",g=JSON.stringify(u)):u&&typeof u!="string"&&!(typeof Blob<"u"&&u instanceof Blob)&&!(u instanceof ArrayBuffer)&&!(typeof FormData<"u"&&u instanceof FormData)?g=JSON.stringify(u):g=u;let x=f;p&&(a=new AbortController,o=setTimeout(()=>a.abort(),p),f?(x=a.signal,f.addEventListener("abort",()=>a.abort())):x=a.signal);const w=yield this.fetch(v.toString(),{method:c||"POST",headers:Object.assign(Object.assign(Object.assign({},h),this.headers),l),body:g,signal:x}).catch(k=>{throw new J$(k)}),y=w.headers.get("x-relay-error");if(y&&y==="true")throw new N_(w);if(!w.ok)throw new kv(w);let b=((s=w.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),_;return b==="application/json"?_=yield w.json():b==="application/octet-stream"||b==="application/pdf"?_=yield w.blob():b==="text/event-stream"?_=w:b==="multipart/form-data"?_=yield w.formData():_=yield w.text(),{data:_,error:null,response:w}}catch(l){return{data:null,error:l,response:l instanceof kv||l instanceof N_?l.context:void 0}}finally{o&&clearTimeout(o)}})}}var X$=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.co
266de=e.code}},Z$=class{constructor(e){var t,n,r;this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(n=e.isMaybeSingle)!==null&&n!==void 0?n:!1,this.urlLengthLimit=(r=e.urlLengthLimit)!==null&&r!==void 0?r:8e3,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}then(e,t){var n=this;this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const r=this.fetch;let s=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async o=>{let a=null,l=null,c=null,u=o.status,f=o.statusText;if(o.ok){var p,h;if(n.method!=="HEAD"){var m;const w=await o.text();w===""||(n.headers.get("Accept")==="text/csv"||n.headers.get("Accept")&&(!((m=n.headers.get("Accept"))===null||m===void 0)&&m.includes("application/vnd.pgrst.plan+text"))?l=w:l=JSON.parse(w))}const g=(p=n.headers.get("Prefer"))===null||p===void 0?void 0:p.match(/count=(exact|planned|estimated)/),x=(h=o.headers.get("content-range"))===null||h===void 0?void 0:h.split("/");g&&x&&x.length>1&&(c=parseInt(x[1])),n.isMaybeSingle&&n.method==="GET"&&Array.isArray(l)&&(l.length>1?(a={code:"PGRST116",details:`Results contain ${l.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},l=null,c=null,u=406,f="Not Acceptable"):l.length===1?l=l[0]:l=null)}else{var v;const g=await o.text();try{a=JSON.parse(g),Array.isArray(a)&&o.status===404&&(l=[],a=null,u=200,f="OK")}catch{o.status===404&&g===""?(u=204,f="No Content"):a={message:g}}if(a&&n.isMaybeSingle&&(!(a==null||(v=a.details)===null||v===void 0)&&v.includes("0 rows"))&&(a=null,u=200,f="OK"),a&&n.shouldThrowOnError)throw new X$(a)}return{error:a,data:l,count:c,status:u,statusText:f}});return this.shouldThrowOnError||(s=s.catch(o=>{var a;let l="",c="",u="";const f=o==null?void 0:o.cause;if(f){var p,h,m,v;const w=(p=f==null?void 0:f.message)!==null&&p!==void 0?p:"",y=(h=f==null?void 0:f.code)!==null&&h!==void 0?h:"";l=`${(m=o==null?void 0:o.name)!==null&&m!==void 0?m:"FetchError"}: ${o==null?void 0:o.message}`,l+=`
267
268Caused by: ${(v=f==null?void 0:f.name)!==null&&v!==void 0?v:"Error"}: ${w}`,y&&(l+=` (${y})`),f!=null&&f.stack&&(l+=`
269${f.stack}`)}else{var g;l=(g=o==null?void 0:o.stack)!==null&&g!==void 0?g:""}const x=this.url.toString().length;return(o==null?void 0:o.name)==="AbortError"||(o==null?void 0:o.code)==="ABORT_ERR"?(u="",c="Request was aborted (timeout or manual cancellation)",x>this.urlLengthLimit&&(c+=`. Note: Your request URL is ${x} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((f==null?void 0:f.name)==="HeadersOverflowError"||(f==null?void 0:f.code)==="UND_ERR_HEADERS_OVERFLOW")&&(u="",c="HTTP headers exceeded server limits (typically 16KB)",x>this.urlLengthLimit&&(c+=`. Your request URL is ${x} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{error:{message:`${(a=o==null?void 0:o.name)!==null&&a!==void 0?a:"FetchError"}: ${o==null?void 0:o.message}`,details:l,hint:c,code:u},data:null,count:null,status:0,statusText:""}})),s.then(e,t)}returns(){return this}overrideTypes(){return this}},e4=class extends Z${select(e){let t=!1;const n=(e??"*").split("").map(r=>/\s/.test(r)&&!t?"":(r==='"'&&(t=!t),r)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:n,foreignTable:r,referencedTable:s=r}={}){const o=s?`${s}.order`:"order",a=this.url.searchParams.get(o);return this.url.searchParams.set(o,`${a?`${a},`:""}${e}.${t?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:n=t}={}){const r=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:n,referencedTable:r=n}={}){const s=typeof r>"u"?"offset":`${r}.offset`,o=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(s,`${e}`),this.url.searchParams.set(o,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}
269explain({analyze:e=!1,verbose:t=!1,settings:n=!1,buffers:r=!1,wal:s=!1,format:o="text"}={}){var a;const l=[e?"analyze":null,t?"verbose":null,n?"settings":null,r?"buffers":null,s?"wal":null].filter(Boolean).join("|"),c=(a=this.headers.get("Accept"))!==null&&a!==void 0?a:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${o}; for="${c}"; options=${l};`),o==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const T_=new RegExp("[,()]");var Cl=class extends e4{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const n=Array.from(new Set(t)).map(r=>typeof r=="string"&&T_.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}notIn(e,t){const n=Array.from(new Set(t)).map(r=>typeof r=="string"&&T_.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`not.in.(${n})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:n,type:r}={}){let s="";r==="plain"?s="pl":r==="phrase"?s="ph":r==="websearch"&&(s="w");const o=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${s}fts${o}.${t}`),this}match(e){return Object.entries(e).forEach(([t,n])=>{this.url.searchParams.append(t,`eq.${n}`)}),this}not(e,t,n){return this.url.searchParams.append(e,`not.${t}.${n}`),this}or(e,{foreignTable:t,referencedTable:n=t}={}){const r=n?`${n}.or`:"or";return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,n){return this.url.searchParams.append(e,`${t}.${n}`),this}},t4=class{constructor(e,{headers:t={},schema:n,fetch:r,urlLengthLimit:s=8e3}){this.url=e,this.headers=new Headers(t),this.schema=n,this.fetch=r,this.urlLengthLimit=s}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:n=!1,count:r}=t??{},s=n?"HEAD":"GET";let o=!1;const a=(e??"*").split("").map(u=>/\s/.test(u)&&!o?"":(u==='"'&&(o=!o),u)).join(""),{url:l,headers:c}=this.cloneRequestState();return l.searchParams.set("select",a),r&&c.append("Prefer",`count=${r}`),new Cl({method:s,url:l,headers:c,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}insert(e,{count:t,defaultToNull:n=!0}={}){var r;const s="POST",{url:o,headers:a}=this.cloneRequestState();if(t&&a.append("Prefer",`count=${t}`),n||a.append("Prefer","missing=default"),Array.isArray(e)){const l=e.reduce((c,u)=>c.concat(Object.keys(u)),[]);if(l.length>0){const c=[...new Set(l)].map(u=>`"${u}"`);o.searchParams.set("columns",c.join(","))}}return new Cl({method:s,url:o,headers:a,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:r,defaultToNull:s=!0}={}){var o;const a="POST",{url:l,headers:c}=this.cloneRequestState();if(c.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),t!==void 0&&l.searchParams.set("on_conflict",t),r&&c.append("Prefer",`count=${r}`),s||c.append("Prefer","missing=default"),Array.isArray(e)){const u=e.reduce((f,p)=>f.concat(Object.keys(p)),[]);if(u.length>0){const f=[...new Set(u)].map(p=>`"${p}"`);l.searchParams.set("columns",f.join(","))}}return new Cl({method:a,url:l,headers:c,schema:this.schema,body:e,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit})}update(e,{count:t}={}){var n;const r="PATCH",{url:s,headers:o}=this.cloneRequestState();return t&&o.append("Prefer",`count=${t}`),new Cl({method:r,url:s,headers:o,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit})}delete({count:e}={}){var t;const n="DELETE",{url:r,headers:s}=this.cloneRequestState();return e&&s.append("Prefer",`count=${e}`),new Cl({method:n,url:r,headers:s,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit})}};function gd(e){"@babel/helpers - typeof";return gd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gd(e)}function n4(e,t){if(gd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(gd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function r4(e){var t=n4(e,"string");return gd(t)=="symbol"?t:t+""}function s4(e,t,n){return(t=r4(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function If(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};
269t%2?P_(Object(n),!0).forEach(function(r){s4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var o4=class oj{constructor(t,{headers:n={},schema:r,fetch:s,timeout:o,urlLengthLimit:a=8e3}={}){this.url=t,this.headers=new Headers(n),this.schemaName=r,this.urlLengthLimit=a;const l=s??globalThis.fetch;o!==void 0&&o>0?this.fetch=(c,u)=>{const f=new AbortController,p=setTimeout(()=>f.abort(),o),h=u==null?void 0:u.signal;if(h){if(h.aborted)return clearTimeout(p),l(c,u);const m=()=>{clearTimeout(p),f.abort()};return h.addEventListener("abort",m,{once:!0}),l(c,If(If({},u),{},{signal:f.signal})).finally(()=>{clearTimeout(p),h.removeEventListener("abort",m)})}return l(c,If(If({},u),{},{signal:f.signal})).finally(()=>clearTimeout(p))}:this.fetch=l}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new t4(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}schema(t){return new oj(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}rpc(t,n={},{head:r=!1,get:s=!1,count:o}={}){var a;let l;const c=new URL(`${this.url}/rpc/${t}`);let u;const f=m=>m!==null&&typeof m=="object"&&(!Array.isArray(m)||m.some(f)),p=r&&Object.values(n).some(f);p?(l="POST",u=n):r||s?(l=r?"HEAD":"GET",Object.entries(n).filter(([m,v])=>v!==void 0).map(([m,v])=>[m,Array.isArray(v)?`{${v.join(",")}}`:`${v}`]).forEach(([m,v])=>{c.searchParams.append(m,v)})):(l="POST",u=n);const h=new Headers(this.headers);return p?h.set("Prefer",o?`count=${o},return=minimal`:"return=minimal"):o&&h.set("Prefer",`count=${o}`),new Cl({method:l,url:c,headers:h,schema:this.schemaName,body:u,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch,urlLengthLimit:this.urlLengthLimit})}};class i4{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const n=globalThis.process;if(n){const r=n.versions;if(r&&r.node){const s=r.node,o=parseInt(s.replace(/^v/,"").split(".")[0]);return o>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${o} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${o} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
270import ws from "ws"
271new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.constructor)return t.constructor;let n=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(n+=`
272
273Suggested solution: ${t.workaround}`),new Error(n)}static createWebSocket(t,n){const r=this.getWebSocketConstructor();return new r(t,n)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const a4="2.98.0",l4=`realtime-js/${a4}`,c4="1.0.0",ij="2.0.0",R_=ij,Cv=1e4,u4=1e3,d4=100;var oi;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(oi||(oi={}));var Dn;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(Dn||(Dn={}));var Ns;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(Ns||(Ns={}));var Ev;(function(e){e.websocket="websocket"})(Ev||(Ev={}));var ha;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(ha||(ha={}));class f4{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,n){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return n(this._binaryEncodeUserBroadcastPush(t));let r=[t.join_ref,t.ref,t.topic,t.event,t.payload];return n(JSON.stringify(r))}_binaryEncodeUserBroadcastPush(t){var n;return this._isArrayBuffer((n=t.payload)===null||n===void 0?void 0:n.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var n,r;const s=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,s)}_encodeJsonUserBroadcastPush(t){var n,r;const s=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:{},a=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,a)}_encodeUserBroadcastPush(t,n,r){var s,o;const a=t.topic,l=(s=t.ref)!==null&&s!==void 0?s:"",c=(o=t.join_ref)!==null&&o!==void 0?o:"",u=t.payload.event,f=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},p=Object.keys(f).length===0?"":JSON.stringify(f);
273if(c.length>255)throw new Error(`joinRef length ${c.length} exceeds maximum of 255`);if(l.length>255)throw new Error(`ref length ${l.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`topic length ${a.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(p.length>255)throw new Error(`metadata length ${p.length} exceeds maximum of 255`);const h=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+l.length+a.length+u.length+p.length,m=new ArrayBuffer(this.HEADER_LENGTH+h);let v=new DataView(m),g=0;v.setUint8(g++,this.KINDS.userBroadcastPush),v.setUint8(g++,c.length),v.setUint8(g++,l.length),v.setUint8(g++,a.length),v.setUint8(g++,u.length),v.setUint8(g++,p.length),v.setUint8(g++,n),Array.from(c,w=>v.setUint8(g++,w.charCodeAt(0))),Array.from(l,w=>v.setUint8(g++,w.charCodeAt(0))),Array.from(a,w=>v.setUint8(g++,w.charCodeAt(0))),Array.from(u,w=>v.setUint8(g++,w.charCodeAt(0))),Array.from(p,w=>v.setUint8(g++,w.charCodeAt(0)));var x=new Uint8Array(m.byteLength+r.byteLength);return x.set(new Uint8Array(m),0),x.set(new Uint8Array(r),m.byteLength),x.buffer}decode(t,n){if(this._isArrayBuffer(t)){let r=this._binaryDecode(t);return n(r)}if(typeof t=="string"){const r=JSON.parse(t),[s,o,a,l,c]=r;return n({join_ref:s,ref:o,topic:a,event:l,payload:c})}return n({})}_binaryDecode(t){const n=new DataView(t),r=n.getUint8(0),s=new TextDecoder;switch(r){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,n,s)}}_decodeUserBroadcast(t,n,r){const s=n.getUint8(1),o=n.getUint8(2),a=n.getUint8(3),l=n.getUint8(4);let c=this.HEADER_LENGTH+4;const u=r.decode(t.slice(c,c+s));c=c+s;const f=r.decode(t.slice(c,c+o));c=c+o;const p=r.decode(t.slice(c,c+a));c=c+a;const h=t.slice(c,t.byteLength),m=l===this.JSON_ENCODING?JSON.parse(r.decode(h)):h,v={type:this.BROADCAST_EVENT,event:f,payload:m};return a>0&&(v.meta=JSON.parse(p)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:v}}_isArrayBuffer(t){var n;return t instanceof ArrayBuffer||((n=t==null?void 0:t.constructor)===null||n===void 0?void 0:n.name)==="ArrayBuffer"}_pick(t,n){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([r])=>n.includes(r)))}}class aj{constructor(t,n){this.callback=t,this.timerCalc=n,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=n}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var zt;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(zt||(zt={}));const A_=(e,t,n={})=>{var r;const s=(r=n.skipTypes)!==null&&r!==void 0?r:[];return t?Object.keys(t).reduce((o,a)=>(o[a]=h4(a,e,t,s),o),{}):{}},h4=(e,t,n,r)=>{const s=t.find(l=>
273l.name===e),o=s==null?void 0:s.type,a=n[e];return o&&!r.includes(o)?lj(o,a):jv(a)},lj=(e,t)=>{if(e.charAt(0)==="_"){const n=e.slice(1,e.length);return y4(t,n)}switch(e){case zt.bool:return p4(t);case zt.float4:case zt.float8:case zt.int2:case zt.int4:case zt.int8:case zt.numeric:case zt.oid:return m4(t);case zt.json:case zt.jsonb:return g4(t);case zt.timestamp:return v4(t);case zt.abstime:case zt.date:case zt.daterange:case zt.int4range:case zt.int8range:case zt.money:case zt.reltime:case zt.text:case zt.time:case zt.timestamptz:case zt.timetz:case zt.tsrange:case zt.tstzrange:return jv(t);default:return jv(t)}},jv=e=>e,p4=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},m4=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},g4=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},y4=(e,t)=>{if(typeof e!="string")return e;const n=e.length-1,r=e[n];if(e[0]==="{"&&r==="}"){let o;const a=e.slice(1,n);try{o=JSON.parse("["+a+"]")}catch{o=a?a.split(","):[]}return o.map(l=>lj(t,l))}return e},v4=e=>typeof e=="string"?e.replace(" ","T"):e,cj=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};class Rg{constructor(t,n,r={},s=Cv){this.channel=t,this.event=n,this.payload=r,this.timeout=s,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,n){var r;return this._hasReceived(t)&&n((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHooks.push({status:t,callback:n}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const t=n=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=n,this._matchReceive(n)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,n){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:n})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:t,response:n}){this.recHooks.filter(r=>r.status===t).forEach(r=>r.callback(n))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}}var I_;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(I_||(I_={}));class Fu{constructor(t,n){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const r=(n==null?void 0:n.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},s=>{const{onJoin:o,onLeave:a,onSync:l}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Fu.syncState(this.state,s,o,a),this.pendingDiffs.forEach(c=>{this.state=Fu.syncDiff(this.state,c,o,a)}),this.pendingDiffs=[],l()}),this.channel._on(r.diff,{},s=>{const{onJoin:o,onLeave:a,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=Fu.syncDiff(this.state,s,o,a),l())}),this.onJoin((s,o,a)=>{this.channel._trigger("presence",{event:"join",key:s,currentPresences:o,newPresences:a})}),this.onLeave((s,o,a)=>{this.channel._trigger("presence",{event:"leave",key:s,currentPresences:o,leftPresences:a})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,n,r,s){const o=this.cloneDeep(t),a=this.transformState(n),l={},c={};return this.map(o,(u,f)=>{a[u]||(c[u]=f)}),this.map(a,(u,f)=>{const p=o[u];if(p){const h=f.map(x=>x.presence_ref),m=p.map(x=>x.presence_ref),v=f.filter(x=>m.indexOf(x.presence_ref)<0),g=p.filter(x=>h.indexOf(x.presence_ref)<0);v.length>0&&(l[u]=v),g.length>0&&(c[u]=g)}else l[u]=f}),this.syncDiff(o,{joins:l,leaves:c},r,s)}static syncDiff(t,n,r,s){const{joins:o,leaves:a}={joins:this.transformState(n.joins),leaves:this.transformState(n.leaves)};return r||(r=()=>{}),s||(s=()=>{}),this.map(o,(l,c)=>{var u;const f=(u=t[l])!==null&&u!==void 0?u:[];if(t[l]=this.cloneDeep(c),f.length>0){const p=t[l].map(m=>m.presence_ref),h=f.filter(m=>p.indexOf(m.presence_ref)<0);t[l].unshift(...h)}r(l,f,c)}),this.map(a,(l,c)=>{let u=t[l];if(!u)return;const f=c.map(p=>p.presence_ref);u=u.filter(p=>f.indexOf(p.presence_ref)<0),t[l]=u,s(l,u,c),u.length===0&&delete t[l]}),t}static map(t,n){return Object.getOwnPropertyNames(t).map(r=>n(r,t[r]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((n,r)=>{const s=t[r];return"metas"in s?n[r]=s.metas.map(o=>(o.presence_ref=o.phx_ref,delete o.phx_ref,delete o.phx_ref_prev,o)):n[r]=s,n},{})}static cloneDeep(t){return JSON.parse(JSON.stringify(t))}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var O_;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(O_||(O_={}));var zu;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(zu||(zu={}));var bo;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(bo||(bo={}));class Wl{constructor(t,n={config:{}},r){var s,o;if(this.topic=t,this.params=n,this.socket=r,this.bindings={},this.state=Dn.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config),this.timeout=this.socket.timeout,this.joinPush=new Rg(this,Ns.join,this.params,this.timeout),this.rejoinTimer=new aj(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Dn.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(a=>a.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Dn.closed,this.socket._remove(this)}),this._onError(a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=Dn.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Dn.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=Dn.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Ns.reply,{},(a,l)=>{this._trigger(this._replyEventName(l),a)}),this.presence=new Fu(this),this.broadcastEndpointURL=cj(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((o=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||o===void 0)&&o.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(t,n=this.timeout){var r,s,o;if(this.socket.isConnected()||this.socket.connect(),this.state==Dn.closed){const{config:{broadcast:a,presence:l,private:c}}=this.params,u=(s=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(m=>m.filter))!==null&&s!==void 0?s:[],f=!!this.bindings[zu.PRESENCE]&&this.bindings[zu.PRESENCE].length>0||((o=this.params.config.presence)===null||o===void 0?void 0:o.enabled)===!0,p={},h={broadcast:a,presence:Object.assign(Object.assign({},l),{enabled:f}),postgres_changes:u,private:c};this.socket.accessTokenValue&&(p.access_token=this.socket.accessTokenValue),this._onError(m=>t==null?void 0:t(bo.CHANNEL_ERROR,m)),this._onClose(()=>t==null?void 0:t(bo.CLOSED)),this.updateJoinPayload(Object.assign({config:h},p)),this.joinedOnce=!0,this._rejoin(n),this.joinPush.receive("ok",async({postgres_changes:m})=>{var v;if(this.socket._isManualToken()||this.socket.setAuth(),m===void 0){t==null||t(bo.SUBSCRIBED);return}else{const g=this.bindings.postgres_changes,x=(v=g==null?void 0:g.length)!==null&&v!==void 0?v:0,w=[];for(let y=0;y<x;y++){const b=g[y],{filter:{event:_,schema:k,table:C,filter:E}}=b,A=m&&m[y];if(A&&A.event===_&&Wl.isFilterValueEqual(A.schema,k)&&Wl.isFilterValueEqual(A.table,C)&&Wl.isFilterValueEqual(A.filter,E))w.push(Object.assign(Object.assign({},b),{id:A.id}));else{this.unsubscribe(),this.state=Dn.errored,t==null||t(bo.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=w,t&&t(bo.SUBSCRIBED);return}}).receive("error",m=>{this.state=Dn.errored,t==null||t(bo.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(m).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(bo.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,n={}){return await this.send({type:"presence",event:"track",payload:t},n.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,n,r){return this.state===Dn.joined&&t===zu.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(async()=>await this.subscribe())),this._on(t,n,r)}async httpSend(t,n,r={}){var s;if(n==null)return Promise.reject("Payload is required for httpSend()");const o={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(o.Authorization=`Bearer ${this.socket.accessTokenValue}`);const a={method:"POST",headers:o,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:n,private:this.private}]})},l=await this._fetchWithTimeout(this.broadcastEndpointURL,a,(s=r.timeout)!==null&&s!==void 0?s:this.timeout);if(l.status===202)return{success:!0};let c=l.statusText;
273try{const u=await l.json();c=u.error||u.message||c}catch{}return Promise.reject(new Error(c))}async send(t,n={}){var r,s;if(!this._canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:o,payload:a}=t,l={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(l.Authorization=`Bearer ${this.socket.accessTokenValue}`);const c={method:"POST",headers:l,body:JSON.stringify({messages:[{topic:this.subTopic,event:o,payload:a,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((s=u.body)===null||s===void 0?void 0:s.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(o=>{var a,l,c;const u=this._push(t.type,t,n.timeout||this.timeout);t.type==="broadcast"&&!(!((c=(l=(a=this.params)===null||a===void 0?void 0:a.config)===null||l===void 0?void 0:l.broadcast)===null||c===void 0)&&c.ack)&&o("ok"),u.receive("ok",()=>o("ok")),u.receive("error",()=>o("error")),u.receive("timeout",()=>o("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=Dn.leaving;const n=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Ns.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(s=>{r=new Rg(this,Ns.leave,{},t),r.receive("ok",()=>{n(),s("ok")}).receive("timeout",()=>{n(),s("timed out")}).receive("error",()=>{s("error")}),r.send(),this._canPush()||r.trigger("ok",{})}).finally(()=>{r==null||r.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Dn.closed,this.bindings={}}async _fetchWithTimeout(t,n,r){const s=new AbortController,o=setTimeout(()=>s.abort(),r),a=await this.socket.fetch(t,Object.assign(Object.assign({},n),{signal:s.signal}));return clearTimeout(o),a}_push(t,n,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let s=new Rg(this,t,n,r);return this._canPush()?s.send():this._addToPushBuffer(s),s}_addToPushBuffer(t){if(t.startTimeout(),this.pushBuffer.push(t),this.pushBuffer.length>d4){const n=this.pushBuffer.shift();n&&(n.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${n.event}`,n.payload))}}_onMessage(t,n,r){return n}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,n,r){var s,o;const a=t.toLocaleLowerCase(),{close:l,error:c,leave:u,join:f}=Ns;if(r&&[l,c,u,f].indexOf(a)>=0&&r!==this._joinRef())return;let h=this._onMessage(a,n,r);if(n&&!h)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(a)?(s=this.bindings.postgres_changes)===null||s===void 0||s.filter(m=>{var v,g,x;return((v=m.filter)===null||v===void 0?void 0:v.event)==="*"||((x=(g=m.filter)===null||g===void 0?void 0:g.event)===null||x===void 0?void 0:x.toLocaleLowerCase())===a}).map(m=>m.callback(h,r)):(o=this.bindings[a])===null||o===void 0||o.filter(m=>{var v,g,x,w,y,b;if(["broadcast","presence","postgres_changes"].includes(a))if("id"in m){const _=m.id,k=(v=m.filter)===null||v===void 0?void 0:v.event;return _&&((g=n.ids)===null||g===void 0?void 0:g.includes(_))&&(k==="*"||(k==null?void 0:k.toLocaleLowerCase())===((x=n.data)===null||x===void 0?void 0:x.type.toLocaleLowerCase()))}else{const _=(y=(w=m==null?void 0:m.filter)===null||w===void 0?void 0:w.event)===null||y===void 0?void 0:y.toLocaleLowerCase();return _==="*"||_===((b=n==null?void 0:n.event)===null||b===void 0?void 0:b.toLocaleLowerCase())}else return m.type.toLocaleLowerCase()===a}).map(m=>{if(typeof h=="object"&&"ids"in h){const v=h.data,{schema:g,table:x,commit_timestamp:w,type:y,errors:b}=v;h=Object.assign(Object.assign({},{schema:g,table:x,commit_timestamp:w,eventType:y,new:{},old:{},errors:b}),this._getPayloadRecords(v))}m.callback(h,r)})}_isClosed(){return this.state===Dn.closed}_isJoined(){return this.state===Dn.joined}_isJoining(){return this.state===Dn.joining}_isLeaving(){return this.state===Dn.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,n,r){const s=t.toLocaleLowerCase(),o={type:s,filter:n,callback:r};return this.bindings[s]?this.bindings[s].push(o):this.bindings[s]=[o],this}_off(t,n){const r=t.toLocaleLowerCase();return this.bindings[r]&&(this.bindings[r]=this.bindings[r].filter(s=>{var o;return!(((o=s.type)===null||o===void 0?void 0:o.toLocaleLowerCase())===r&&Wl.isEqual(s.filter,n))})),this}static isEqual(t,n){if(Object.keys(t).length!==Object.keys(n).length)return!1;for(const r in t)if(t[r]!==n[r])return!1;return!0}static isFilterValueEqual(t,n){return(t??void 0)===(n??void 0)}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(Ns.close,{},t)}_onError(t){this._on(Ns.error,{},n=>t(n))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Dn.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const n={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(n.new=A_(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(n.old=A_(t.columns,t.old_record)),n}}const Ag=()=>{},Of={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},w4=[1e3,2e3,5e3,1e4],x4=1e4,b4=`
274  addEventListener("message", (e) => {
275    if (e.data.event === "start") {
276      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
277    }
278  });`;class _4{constructor(t,n){var r;if(this.accessTokenValue=null,this.apiKey=null,this._manuallySetToken=!1,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=Cv,this.transport=null,this.heartbeatIntervalMs=Of.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=Ag,this.ref=0,this.reconnectTimer=null,this.vsn=R_,this.logger=Ag,this.conn=null,this.sendBuffer=[],this.serializer
278=new f4,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._heartbeatSentAt=null,this._resolveFetch=s=>s?(...o)=>s(...o):(...o)=>fetch(...o),!(!((r=n==null?void 0:n.params)===null||r===void 0)&&r.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=n.params.apikey,this.endPoint=`${t}/${Ev.websocket}`,this.httpEndpoint=cj(t),this._initializeOptions(n),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(n==null?void 0:n.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=i4.createWebSocket(this.endpointURL())}catch(t){this._setConnectionState("disconnected");const n=t.message;throw n.includes("Node.js")?new Error(`${n}
279
280To use Realtime in Node.js, you need to provide a WebSocket implementation:
281
282Option 1: Use Node.js 22+ which has native WebSocket support
283Option 2: Install and provide the "ws" package:
284
285  npm install ws
286
287  import ws from "ws"
288  const client = new RealtimeClient(url, {
289    ...options,
290    transport: ws
291  })`):new Error(`WebSocket not available: ${n}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(t,n){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const r=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(r),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(t?this.conn.close(t,n??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(t){const n=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const t=await Promise.all(this.channels.map(n=>n.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,n,r){this.logger(t,n,r)}connectionState(){switch(this.conn&&this.conn.readyState){case oi.connecting:return ha.Connecting;case oi.open:return ha.Open;case oi.closing:return ha.Closing;default:return ha.Closed}}isConnected(){return this.connectionState()===ha.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(t,n={config:{}}){const r=`realtime:${t}`,s=this.getChannels().find(o=>o.topic===r);if(s)return s;{const o=new Wl(`realtime:${t}`,n,this);return this.channels.push(o),o}}push(t){const{topic:n,event:r,payload:s,ref:o}=t,a=()=>{this.encode(t,l=>{var c;(c=this.conn)===null||c===void 0||c.send(l)})};this.log("push",`${n} ${r} (${o})`,s),this.isConnected()?a():this.sendBuffer.push(a)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){var t;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(n){this.log("error","error in heartbeat callback",n)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this._heartbeatSentAt=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(n){this.log("error","error in heartbeat callback",n)}this._wasManualDisconnect=!1,(t=this.conn)===null||t===void 0||t.close(u4,"heartbeat timeout"),setTimeout(()=>{var n;this.isConnected()||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout()},Of.HEARTBEAT_TIMEOUT_FALLBACK);return}this._heartbeatSentAt=Date.now(),this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(n){this.log("error","error in heartbeat callback",n)}this._setAuthSafely("heartbeat")}onHeartbeat(t){this.heartbeatCallback=t}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let n=this.channels.find(r=>r.topic===t&&(r._isJoined()||r._isJoining()));n&&(this.log("transport",`leaving duplicate topic "${t}"`),n.unsubscribe())}_remove(t){this.channels=this.channels.filter(n=>n.topic!==t.topic)}_onConnMessage(t){this.decode(t.data,n=>
291{if(n.topic==="phoenix"&&n.event==="phx_reply"&&n.ref&&n.ref===this.pendingHeartbeatRef){const u=this._heartbeatSentAt?Date.now()-this._heartbeatSentAt:void 0;try{this.heartbeatCallback(n.payload.status==="ok"?"ok":"error",u)}catch(f){this.log("error","error in heartbeat callback",f)}this._heartbeatSentAt=null,this.pendingHeartbeatRef=null}const{topic:r,event:s,payload:o,ref:a}=n,l=a?`(${a})`:"",c=o.status||"";this.log("receive",`${c} ${r} ${s} ${l}`.trim(),o),this.channels.filter(u=>u._isMember(r)).forEach(u=>u._trigger(s,o,a)),this._triggerStateCallbacks("message",n)})}_clearTimer(t){var n;t==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):t==="reconnect"&&((n=this.reconnectTimer)===null||n===void 0||n.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=t=>this._onConnError(t),this.conn.onmessage=t=>this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t),this.conn.readyState===oi.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===oi.open||this.conn.readyState===oi.connecting)try{this.conn.close()}catch(t){this.log("error","Error closing connection",t)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this._terminateWorker(),this.channels.forEach(t=>t.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.accessTokenValue&&(this.channels.forEach(n=>{n.updateJoinPayload({access_token:this.accessTokenValue})}),this.sendBuffer=[],this.channels.forEach(n=>{n._isJoining()&&(n.joinPush.sent=!1,n.joinPush.send())})),this.flushSendBuffer()}).catch(n=>{this.log("error","error waiting for auth on connect",n),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this._terminateWorker()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_onConnClose(t){var n;this._setConnectionState("disconnected"),this.log("transport","close",t),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout(),this._triggerStateCallbacks("close",t)}_onConnError(t){this._setConnectionState("disconnected"),this.log("transport",`${t}`),this._triggerChanError(),this._triggerStateCallbacks("error",t);try{this.heartbeatCallback("error")}catch(n){this.log("error","error in heartbeat callback",n)}}_triggerChanError(){this.channels.forEach(t=>t._trigger(Ns.error))}_appendParams(t,n){if(Object.keys(n).length===0)return t;const r=t.match(/\?/)?"&":"?",s=new URLSearchParams(n);return`${t}${r}${s}`}_workerObjectUrl(t){let n;if(t)n=t;else{const r=new Blob([b4],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_setConnectionState(t,n=!1){this._connectionState=t,t==="connecting"?this._wasManualDisconnect=!1:t==="disconnecting"&&(this._wasManualDisconnect=n)}async _performAuth(t=null){let n,r=!1;if(t)n=t,r=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(s){this.log("error","Error fetching access token from callback",s),n=this.accessTokenValue}else n=this.accessTokenValue;r?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEac
291h(s=>{const o={access_token:n,version:l4};n&&s.updateJoinPayload(o),s.joinedOnce&&s._isJoined()&&s._push(Ns.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(n=>{this.log("error",`Error setting auth in ${t}`,n)})}_triggerStateCallbacks(t,n){try{this.stateChangeCallbacks[t].forEach(r=>{try{r(n)}catch(s){this.log("error",`error in ${t} callback`,s)}})}catch(r){this.log("error",`error triggering ${t} callbacks`,r)}}_setupReconnectionTimer(){this.reconnectTimer=new aj(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},Of.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var n,r,s,o,a,l,c,u,f,p,h,m;switch(this.transport=(n=t==null?void 0:t.transport)!==null&&n!==void 0?n:null,this.timeout=(r=t==null?void 0:t.timeout)!==null&&r!==void 0?r:Cv,this.heartbeatIntervalMs=(s=t==null?void 0:t.heartbeatIntervalMs)!==null&&s!==void 0?s:Of.HEARTBEAT_INTERVAL,this.worker=(o=t==null?void 0:t.worker)!==null&&o!==void 0?o:!1,this.accessToken=(a=t==null?void 0:t.accessToken)!==null&&a!==void 0?a:null,this.heartbeatCallback=(l=t==null?void 0:t.heartbeatCallback)!==null&&l!==void 0?l:Ag,this.vsn=(c=t==null?void 0:t.vsn)!==null&&c!==void 0?c:R_,t!=null&&t.params&&(this.params=t.params),t!=null&&t.logger&&(this.logger=t.logger),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(u=t==null?void 0:t.reconnectAfterMs)!==null&&u!==void 0?u:v=>w4[v-1]||x4,this.vsn){case c4:this.encode=(f=t==null?void 0:t.encode)!==null&&f!==void 0?f:(v,g)=>g(JSON.stringify(v)),this.decode=(p=t==null?void 0:t.decode)!==null&&p!==void 0?p:(v,g)=>g(JSON.parse(v));break;case ij:this.encode=(h=t==null?void 0:t.encode)!==null&&h!==void 0?h:this.serializer.encode.bind(this.serializer),this.decode=(m=t==null?void 0:t.decode)!==null&&m!==void 0?m:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl}}}var yd=class extends Error{constructor(e,t){var n;super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&((n=t.icebergType)==null?void 0:n.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function k4(e,t,n){const r=new URL(t,e);if(n)for(const[s,o]of Object.entries(n))o!==void 0&&r.searchParams.set(s,o);return r.toString()}async function S4(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function C4(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:s,body:o,headers:a}){const l=k4(e.baseUrl,r,s),c=await S4(e.auth),u=await t(l,{method:n,headers:{...o?{"Content-Type":"application/json"}:{},...c,...a},body:o?JSON.stringify(o):void 0}),f=await u.text(),p=(u.headers.get("content-type")||"").includes("application/json"),h=p&&f?JSON.parse(f):f;if(!u.ok){const m=p?h:void 0,v=m==null?void 0:m.error;throw new yd((v==null?void 0:v.message)??`Request failed with status ${u.status}`,{status:u.status,icebergType:v==null?void 0:v.type,icebergCode:v==null?void 0:v.code,details:m})}return{status:u.status,headers:u.headers,data:h}}}}function Mf(e){return e.join("�")}var E4=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:Mf(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(r=>({namespace:r}))}async createNamespace(e,t){const n={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Mf(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Mf(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Mf(e.namespace)}`}),!0}catch(t){if(t instanceof yd&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(n){if(n instanceof yd&&n.status===409)return;throw n}}};function hl(e){return e.join("�")}var j4=class{constructor(e,t="",n){this.client=e,this.prefix=t,this.accessDelegation=n}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${hl(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${hl(e.namespace)}/tables`,body:t,headers:n})).data.metadata}async updateTable(e,t){const n=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${hl(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":n.data["metadata-location"],metadata:n.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${hl(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((t==null?void 0:t.purge)??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${hl(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${hl(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(n){if(n instanceof yd&&n.status===404)return!1;throw n}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof yd&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},N4=class{constructor(e){var r;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const n=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=C4({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(r=e.accessDelegation)==null?void 0:r.join(","),this.namespaceOps=new E4(this.client,t),this.tableOps=new j4(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}
291async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}},Gp=class extends Error{constructor(e,t="storage",n,r){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=n,this.statusCode=r}};function Jp(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var Lf=class extends Gp{constructor(e,t,n,r="storage"){super(e,r,t,n),this.name=r==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},uj=class extends Gp{constructor(e,t,n="storage"){super(e,n),this.name=n==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};const T4=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),P4=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Nv=e=>{if(Array.isArray(e))return e.map(n=>Nv(n));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([n,r])=>{const s=n.replace(/([-_][a-z])/gi,o=>o.toUpperCase().replace(/[-_]/g,""));t[s]=Nv(r)}),t},R4=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e);function vd(e){"@babel/helpers - typeof";return vd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vd(e)}function A4(e,t){if(vd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(vd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function I4(e){var t=A4(e,"string");return vd(t)=="symbol"?t:t+""}function O4(e,t,n){return(t=I4(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ee(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?M_(Object(n),!0).forEach(function(r){O4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const L_=e=>{var t;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(t=e.error)===null||t===void 0?void 0:t.message)||JSON.stringify(e)},M4=async(e,t,n,r)=>{if(e&&typeof e=="object"&&"status"in e&&"ok"in e&&typeof e.status=="number"&&!(n!=null&&n.noResolveJson)){const s=e,o=s.status||500;if(typeof s.json=="function")s.json().then(a=>{const l=(a==null?void 0:a.statusCode)||(a==null?void 0:a.code)||o+"";t(new Lf(L_(a),o,l,r))}).catch(()=>{if(r==="vectors"){const a=o+"";t(new Lf(s.statusText||`HTTP ${o} error`,o,a,r))}else{const a=o+"";t(new Lf(s.statusText||`HTTP ${o} error`,o,a,r))}});else{const a=o+"";t(new Lf(s.statusText||`HTTP ${o} error`,o,a,r))}}else t(new uj(L_(e),e,r))},L4=(e,t,n,r)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"||e==="HEAD"||!r?Ee(Ee({},s),n):(P4(r)?(s.headers=Ee({"Content-Type":"application/json"},t==null?void 0:t.headers),s.body=JSON.stringify(r)):s.body=r,t!=null&&t.duplex&&(s.duplex=t.duplex),Ee(Ee({},s),n))};async function yu(e,t,n,r,s,o,a){return new Promise((l,c)=>{e(n,L4(t,r,s,o)).then(u=>{if(!u.ok)throw u;if(r!=null&&r.noResolveJson)return u;if(a==="vectors"){const f=u.headers.get("content-type");if(u.headers.get("content-length")==="0"||u.status===204)return{};if(!f||!f.includes("application/json"))return{}}return u.json()}).then(u=>l(u)).catch(u=>M4(u,c,r,a))})}function dj(e="storage"){return{get:async(t,n,r,s)=>yu(t,"GET",n,r,s,void 0,e),post:async(t,n,r,s,o)=>yu(t,"POST",n,s,o,r,e),put:async(t,n,r,s,o)=>yu(t,"PUT",n,s,o,r,e),head:async(t,n,r,s)=>yu(t,"HEAD",n,Ee(Ee({},r),{},{noResolveJson:!0}),s,void 0,e),remove:async(t,n,r,s,o)=>yu(t,"DELETE",n,s,o,r,e)}}const D4=dj("storage"),{get:wd,post:Ss,put:Tv,head:$4,remove:Lx}=D4,Gr=dj("vectors");var zc=class{constructor(e,t={},n,r="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=t,this.fetch=T4(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=Ee(Ee({},this.headers),{},{[e]:t}),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(Jp(n))return{data:null,error:n};throw n}}},U4=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Jp(t))return{data:null,error:t};throw t}}};let fj;fj=Symbol.toStringTag;var F4=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[fj]="BlobDownloadBuilder",this.promise=null}asStream(){return new U4(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Jp(t))return{data:null,error:t};throw t}}};const z4={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},D_={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var B4=class extends zc{constructor(e,t={},n,r){super(e,t,r,"storage"),this.bucketId=n}async uploadOrUpdate(e,t,n,r){var s=this;return s.handleOperation(async()=>{let o;const a=Ee(Ee({},D_),r);let l=Ee(Ee({},s.headers),e==="POST"&&{"x-upsert":String(a.upsert)});const c=a.metadata;typeof Blob<"u"&&n instanceof Blob?(o=new FormData,o.append("cacheControl",a.cacheControl),c&&o.append("metadata",s.encodeMetadata(c)),o.append("",n)):typeof FormData<"u"&&n instanceof FormData?(o=n,o.has("cacheControl")||o.append("cacheControl",a.cacheControl),c&&!o.has("metadata")&&o.append("metadata",s.encodeMetadata(c))):(o=n,l["cache-control"]=`max-age=${a.cacheControl}`,l["content-type"]=a.contentType,c&&(l["x-metadata"]=s.toBase64(s.encodeMetadata(c))),(typeof ReadableStream<"u"&&o instanceof ReadableStream||o&&typeof o=="object"&&"pipe"in o&&typeof o.pipe=="function")&&!a.duplex&&(a.duplex="half")),r!=null&&r.headers&&(l=Ee(Ee({},l),r.headers));const u=s._removeEmptyFolders(t),f=s._getFinalPath(u),p=await(e=="PUT"?Tv:Ss)(s.fetch,`${s.url}/object/${f}`,o,Ee({headers:l},a!=null&&a.duplex?{duplex:a.duplex}:{}));return{path:u,id:p.Id,fullPath:p.Key}})}async upload(e,t,n){return this.uploadOrUpdate("POST",e,t,n)}async uploadToSignedUrl(e,t,n,r){var s=this;const o=s._removeEmptyFolders(e),a=s._getFinalPath(o),l=new URL(s.url+`/object/upload/sign/${a}`);return l.searchParams.set("token",t),s.handleOperation(async()=>{let c;const u=Ee({upsert:D_.upsert},r),f=Ee(Ee({},s.headers),{"x-upsert":String(u.upsert)});return typeof Blob<"u"&&n instanceof Blob?(c=new FormData,c.append("cacheControl",u.cacheControl),c.append("",n)):typeof FormData<"u"&&n instanceof FormData?(c=n,c.append("cacheControl",u.cacheControl)):(c=n,f["cache-control"]=`max-age=${u.cacheControl}`,f["content-type"]=u.contentType),{path:o,fullPath:(await Tv(s.fetch,l.toString(),c,{headers:f})).Key}})}async createSignedUploadUrl(e,t){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(e);const s=Ee({},n.headers);t!=null&&t.upsert&&(s["x-upsert"]="true");const o=await Ss(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:s}),a=new URL(n.url+o.url),l=a.searchParams.get("token");if(!l)throw new Gp("No token returned by API");return{signedUrl:a.toString(),path:e,token:l}})}async update(e,t,n){return this.uploadOrUpdate("PUT",e,t,n)}async move(e,t,n){var r=this;return r.handleOperation(async()=>await Ss(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,de
291stinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers}))}async copy(e,t,n){var r=this;return r.handleOperation(async()=>({path:(await Ss(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(e,t,n){var r=this;return r.handleOperation(async()=>{let s=r._getFinalPath(e),o=await Ss(r.fetch,`${r.url}/object/sign/${s}`,Ee({expiresIn:t},n!=null&&n.transform?{transform:n.transform}:{}),{headers:r.headers});const a=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return{signedUrl:encodeURI(`${r.url}${o.signedURL}${a}`)}})}async createSignedUrls(e,t,n){var r=this;return r.handleOperation(async()=>{const s=await Ss(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:t,paths:e},{headers:r.headers}),o=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return s.map(a=>Ee(Ee({},a),{},{signedUrl:a.signedURL?encodeURI(`${r.url}${a.signedURL}${o}`):null}))})}download(e,t,n){const r=typeof(t==null?void 0:t.transform)<"u"?"render/image/authenticated":"object",s=this.transformOptsToQueryString((t==null?void 0:t.transform)||{}),o=s?`?${s}`:"",a=this._getFinalPath(e),l=()=>wd(this.fetch,`${this.url}/${r}/${a}${o}`,{headers:this.headers,noResolveJson:!0},n);return new F4(l,this.shouldThrowOnError)}async info(e){var t=this;const n=t._getFinalPath(e);return t.handleOperation(async()=>Nv(await wd(t.fetch,`${t.url}/object/info/${n}`,{headers:t.headers})))}async exists(e){var t=this;const n=t._getFinalPath(e);try{return await $4(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Jp(r)&&r instanceof uj){const s=r.originalError;if([400,404].includes(s==null?void 0:s.status))return{data:!1,error:r}}throw r}}getPublicUrl(e,t){const n=this._getFinalPath(e),r=[],s=t!=null&&t.download?`download=${t.download===!0?"":t.download}`:"";s!==""&&r.push(s);const o=typeof(t==null?void 0:t.transform)<"u"?"render/image":"object",a=this.transformOptsToQueryString((t==null?void 0:t.transform)||{});a!==""&&r.push(a);let l=r.join("&");return l!==""&&(l=`?${l}`),{data:{publicUrl:encodeURI(`${this.url}/${o}/public/${n}${l}`)}}}async remove(e){var t=this;return t.handleOperation(async()=>await Lx(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,n){var r=this;return r.handleOperation(async()=>{const s=Ee(Ee(Ee({},z4),t),{},{prefix:e||""});return await Ss(r.fetch,`${r.url}/object/list/${r.bucketId}`,s,{headers:r.headers},n)})}async listV2(e,t){var n=this;return n.handleOperation(async()=>{const r=Ee({},e);return await Ss(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}};const W4="2.98.0",qd={"X-Client-Info":`storage-js/${W4}`};var H4=class extends zc{constructor(e,t={},n,r){const s=new URL(e);r!=null&&r.useNewHostname&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase."));const o=s.href.replace(/\/$/,""),a=Ee(Ee({},qd),t);super(o,a,n,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=t.listBucketOptionsToQueryString(e);return await wd(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await wd(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var n=this;return n.handleOperation(async()=>await Ss(n.fetch,`${n.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async updateBucket(e,t){var n=this;return n.handleOperation(async()=>await Tv(n.fetch,`${n.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await Ss(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Lx(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},K4=class extends zc{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=Ee(Ee({},qd),t);super(r,s,n,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Ss(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&n.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&n.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&n.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&n.set("sortOrder",e.sortOrder),e!=null&&e.search&&n.set("search",e.search);const r=n.toString(),s=r?`${t.url}/bucket?${r}`:`${t.url}/bucket`;return await wd(t.fetch,s,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Lx(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!R4(e))throw new Gp("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const n=new N4({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}
291),r=this.shouldThrowOnError;return new Proxy(n,{get(s,o){const a=s[o];return typeof a!="function"?a:async(...l)=>{try{return{data:await a.apply(s,l),error:null}}catch(c){if(r)throw c;return{data:null,error:c}}}}})}},q4=class extends zc{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=Ee(Ee({},qd),{},{"Content-Type":"application/json"},t);super(r,s,n,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await Gr.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var n=this;return n.handleOperation(async()=>await Gr.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await Gr.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var n=this;return n.handleOperation(async()=>await Gr.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers})||{})}},V4=class extends zc{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=Ee(Ee({},qd),{},{"Content-Type":"application/json"},t);super(r,s,n,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await Gr.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await Gr.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await Gr.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await Gr.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await Gr.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},Y4=class extends zc{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=Ee(Ee({},qd),{},{"Content-Type":"application/json"},t);super(r,s,n,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Gr.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Gr.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await Gr.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Gr.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},G4=class extends Y4{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new J4(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,n=this;return t().call(n,e)}async getBucket(e){var t=()=>super.getBucket,n=this;return t().call(n,e)}async listBuckets(e={}){var t=()=>super.listBuckets,n=this;return t().call(n,e)}async deleteBucket(e){var t=()=>super.deleteBucket,n=this;return t().call(n,e)}},J4=class extends q4{constructor(e,t,n,r){super(e,t,r),this.vectorBucketName=n}async createIndex(e){var t=()=>super.createIndex,n=this;return t().call(n,Ee(Ee({},e),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,n=this;return t().call(n,Ee(Ee({},e),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,n=this;return t().call(n,n.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,n=this;return t().call(n,n.vectorBucketName,e)}index(e){return new Q4(this.url,this.headers,this.vectorBucketName,e,this.fetch)}}
291,Q4=class extends V4{constructor(e,t,n,r,s){super(e,t,s),this.vectorBucketName=n,this.indexName=r}async putVectors(e){var t=()=>super.putVectors,n=this;return t().call(n,Ee(Ee({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(e){var t=()=>super.getVectors,n=this;return t().call(n,Ee(Ee({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,n=this;return t().call(n,Ee(Ee({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,n=this;return t().call(n,Ee(Ee({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,n=this;return t().call(n,Ee(Ee({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},X4=class extends H4{constructor(e,t={},n,r){super(e,t,n,r)}from(e){return new B4(this.url,this.headers,e,this.fetch)}get vectors(){return new G4(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new K4(this.url+"/iceberg",this.headers,this.fetch)}};const hj="2.98.0",El=30*1e3,Pv=3,Ig=Pv*El,Z4="http://localhost:9999",eU="supabase.auth.token",tU={"X-Client-Info":`gotrue-js/${hj}`},Rv="X-Supabase-Api-Version",pj={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},nU=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,rU=10*60*1e3;class xd extends Error{constructor(t,n,r){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}}function xe(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class sU extends xd{constructor(t,n,r){super(t,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function oU(e){return xe(e)&&e.name==="AuthApiError"}class pa extends xd{constructor(t,n){super(t),this.name="AuthUnknownError",this.originalError=n}}class Uo extends xd{constructor(t,n,r,s){super(t,r,s),this.name=n,this.status=r}}class Hr extends Uo{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Og(e){return xe(e)&&e.name==="AuthSessionMissingError"}class pl extends Uo{constructor(){super("Auth session or user missing","AuthInvalidToken
291ResponseError",500,void 0)}}class Df extends Uo{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class $f extends Uo{constructor(t,n=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function iU(e){return xe(e)&&e.name==="AuthImplicitGrantRedirectError"}class $_ extends Uo{constructor(t,n=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class aU extends Uo{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class Av extends Uo{constructor(t,n){super(t,"AuthRetryableFetchError",n,void 0)}}function Mg(e){return xe(e)&&e.name==="AuthRetryableFetchError"}class U_ extends Uo{constructor(t,n,r){super(t,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}}class Iv extends Uo{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const np="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),F_=` 	
292\r=`.split(""),lU=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<F_.length;t+=1)e[F_[t].charCodeAt(0)]=-2;for(let t=0;t<np.length;t+=1)e[np[t].charCodeAt(0)]=t;return e})();function z_(e,t,n){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(np[r]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(np[r]),t.queuedBits-=6}}function mj(e,t,n){const r=lU[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function B_(e){const t=[],n=a=>{t.push(String.fromCodePoint(a))},r={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},o=a=>{dU(a,r,n)};for(let a=0;a<e.length;a+=1)mj(e.charCodeAt(a),s,o);return t.join("")}function cU(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function uU(e,t){for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r>55295&&r<=56319){const s=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|s)+65536,n+=1}cU(r,t)}}function dU(e,t,n){if(t.utf8seq===0){if(e<=127){n(e);return}for(let r=1;r<6;r+=1)if(!(e>>7-r&1)){t.utf8seq=r;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&n(t.codepoint)}}function nc(e){const t=[],n={queue:0,queuedBits:0},r=s=>{t.push(s)};for(let s=0;s<e.length;s+=1)mj(e.charCodeAt(s),n,r);return new Uint8Array(t)}function fU(e){const t=[];return uU(e,n=>t.push(n)),new Uint8Array(t)}function wa(e){const t=[],n={queue:0,queuedBits:0},r=s=>{t.push(s)};return e.forEach(s=>z_(s,n,r)),z_(null,n,r),t.join("")}function hU(e){return Math.round(Date.now()/1e3)+e}function pU(){return Symbol("auth-callback")}const qn=()=>typeof window<"u"&&typeof document<"u",ra={tested:!1,writable:!1},gj=()=>{if(!qn())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(ra.tested)return ra.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),ra.tested=!0,ra.writable=!0}catch{ra.tested=!0,ra.writable=!1}return ra.writable};function mU(e){const t={},n=new URL(e);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEac
292h((s,o)=>{t[o]=s})}catch{}return n.searchParams.forEach((r,s)=>{t[s]=r}),t}const yj=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),gU=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",jl=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},sa=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return n}},Kn=async(e,t)=>{await e.removeItem(t)};class Qp{constructor(){this.promise=new Qp.promiseConstructor((t,n)=>{this.resolve=t,this.reject=n})}}Qp.promiseConstructor=Promise;function Uf(e){const t=e.split(".");if(t.length!==3)throw new Iv("Invalid JWT structure");for(let r=0;r<t.length;r++)if(!nU.test(t[r]))throw new Iv("JWT not in base64url format");return{header:JSON.parse(B_(t[0])),payload:JSON.parse(B_(t[1])),signature:nc(t[2]),raw:{header:t[0],payload:t[1]}}}async function yU(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function vU(e,t){return new Promise((r,s)=>{(async()=>{for(let o=0;o<1/0;o++)try{const a=await e(o);if(!t(o,null,a)){r(a);return}}catch(a){if(!t(o,a)){s(a);return}}})()})}function wU(e){return("0"+e.toString(16)).substr(-2)}function xU(){const t=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let s="";for(let o=0;o<56;o++)s+=n.charAt(Math.floor(Math.random()*r));return s}return crypto.getRandomValues(t),Array.from(t,wU).join("")}async function bU(e){const n=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",n),s=new Uint8Array(r);return Array.from(s).map(o=>String.fromCharCode(o)).join("")}async function _U(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const n=await bU(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function ml(e,t,n=!1){const r=xU();let s=r;n&&(s+="/PASSWORD_RECOVERY"),await jl(e,`${t}-code-verifier`,s);const o=await _U(r);return[o,r===o?"plain":"s256"]}const kU=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function SU(e){const t=e.headers.get(Rv);if(!t||!t.match(kU))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function CU(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function EU(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const jU=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function gl(e){if(!jU.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Lg(){const e={};return new Proxy(e,{get:(t,n)=>{if(n==="__isUserNotAvailableProxy")return!0;if(typeof n=="symbol"){const r=n.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${n}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function NU(e,t){return new Proxy(e,{get:(n,r,s)=>{if(r==="__isInsecureUserWarningProxy")return!0;if(typeof r=="symbol"){const o=r.toString();if(o==="Symbol(Symbol.toPrimitive)"||o==="Symbol(Symbol.toStringTag)"||o==="Symbol(util.inspect.custom)"||o==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(n,r,s)}return!t.value&&typeof r=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(n,r,s)}})}function W_(e){return JSON.parse(JSON.stringify(e))}const ua=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),TU=[502,503,504];async function H_(e){var t;if(!gU(e))throw new Av(ua(e),0);if(TU.includes(e.status))throw new Av(ua(e),e.status);let n;try{n=await e.json()}catch(o){throw new pa(ua(o),o)}let r;const s=SU(e);if(s&&s.getTime()>=pj["2024-01-01"].timestamp&&typeof n=="object"&&n&&typeof n.code=="string"?r=n.code:typeof n=="object"&&n&&typeof n.error_code=="string"&&(r=n.error_code),r){if(r==="weak_password")throw new U_(ua(n),e.status,((t=n.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new Hr}else if(typeof n=="object"&&n&&typeof n.weak_password=="object"&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((o,a)=>
292o&&typeof a=="string",!0))throw new U_(ua(n),e.status,n.weak_password.reasons);throw new sU(ua(n),e.status||500,r)}const PU=(e,t,n,r)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),s.body=JSON.stringify(r),Object.assign(Object.assign({},s),n))};async function Ne(e,t,n,r){var s;const o=Object.assign({},r==null?void 0:r.headers);o[Rv]||(o[Rv]=pj["2024-01-01"].name),r!=null&&r.jwt&&(o.Authorization=`Bearer ${r.jwt}`);const a=(s=r==null?void 0:r.query)!==null&&s!==void 0?s:{};r!=null&&r.redirectTo&&(a.redirect_to=r.redirectTo);const l=Object.keys(a).length?"?"+new URLSearchParams(a).toString():"",c=await RU(e,t,n+l,{headers:o,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(c):{data:Object.assign({},c),error:null}}async function RU(e,t,n,r,s,o){const a=PU(t,r,s,o);let l;try{l=await e(n,Object.assign({},a))}catch(c){throw console.error(c),new Av(ua(c),0)}if(l.ok||await H_(l),r!=null&&r.noResolveJson)return l;try{return await l.json()}catch(c){await H_(c)}}function bs(e){var t;let n=null;OU(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=hU(e.expires_in)));const r=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:n,user:r},error:null}}function K_(e){const t=bs(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((n,r)=>n&&typeof r=="string",!0)&&(t.data.weak_password=e.weak_password),t}function li(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function AU(e){return{data:e,error:null}}function IU(e){const{action_link:t,email_otp:n,hashed_token:r,redirect_to:s,verification_type:o}=e,a=Fc(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:t,email_otp:n,hashed_token:r,redirect_to:s,verification_type:o},c=Object.assign({},a);return{data:{properties:l,user:c},error:null}}function q_(e){return e}function OU(e){return e.access_token&&e.refresh_token&&e.expires_in}const Dg=["global","local","others"];class MU{constructor({url:t="",headers:n={},fetch:r}){this.url=t,this.headers=n,this.fetch=yj(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(t,n=Dg[0]){if(Dg.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Dg.join(", ")}`);try{return await Ne(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(r){if(xe(r))return{data:null,error:r};throw r}}async inviteUserByEmail(t,n={}){try{return await Ne(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:li})}catch(r){if(xe(r))return{data:{user:null},error:r};throw r}}async generateLink(t){try{const{options:n}=t,r=Fc(t,["options"]),s=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(s.new_email=r==null?void 0:r.newEmail,delete s.newEmail),await Ne(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:IU,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(xe(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(t){try{return await Ne(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:li})}catch(n){if(xe(n))return{data:{user:null},error:n};throw n}}async listUsers(t){var n,r,s,o,a,l,c;try{const u={nextPage:null,lastPage:0,total:0},f=await Ne(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(o=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&o!==void 0?o:""},xform:q_});if(f.error)throw f.error;const p=await f.json(),h=(a=f.headers.get("x-total-count"))!==null&&a!==void 0?a:0,m=(c=(l=f.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return m.length>0&&(m.forEach(v=>{const g=parseInt(v.split(";")[0].split("=")[1].substring(0,1)),x=JSON.parse(v.split(";")[1].split("=")[1]);u[`${x}Page`]=g}),u.total=parseInt(h)),{data:Object.assign(Object.assign({},p),u),error:null}}catch(u){if(xe(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){gl(t);try{return await Ne(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:li})}catch(n){if(xe(n))return{data:{user:null},error:n};throw n}}async updateUserById(t,n){gl(t);try{return await Ne(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:n,headers:this.headers,xform:li})}catch(r){if(xe(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,n=!1){gl(t);
292try{return await Ne(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:n},xform:li})}catch(r){if(xe(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){gl(t.userId);try{const{data:n,error:r}=await Ne(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:n,error:r}}catch(n){if(xe(n))return{data:null,error:n};throw n}}async _deleteFactor(t){gl(t.userId),gl(t.id);try{return{data:await Ne(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(n){if(xe(n))return{data:null,error:n};throw n}}async _listOAuthClients(t){var n,r,s,o,a,l,c;try{const u={nextPage:null,lastPage:0,total:0},f=await Ne(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(o=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&o!==void 0?o:""},xform:q_});if(f.error)throw f.error;const p=await f.json(),h=(a=f.headers.get("x-total-count"))!==null&&a!==void 0?a:0,m=(c=(l=f.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return m.length>0&&(m.forEach(v=>{const g=parseInt(v.split(";")[0].split("=")[1].substring(0,1)),x=JSON.parse(v.split(";")[1].split("=")[1]);u[`${x}Page`]=g}),u.total=parseInt(h)),{data:Object.assign(Object.assign({},p),u),error:null}}catch(u){if(xe(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(t){try{return await Ne(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(xe(n))return{data:null,error:n};throw n}}async _getOAuthClient(t){try{return await Ne(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(xe(n))return{data:null,error:n};throw n}}async _updateOAuthClient(t,n){try{return await Ne(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(xe(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(t){try{return await Ne(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(xe(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(t){try{return await Ne(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(xe(n))return{data:null,error:n};throw n}}}function V_(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}const mo={debug:!!(globalThis&&gj()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class vj extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class LU extends vj{}async function DU(e,t,n){mo.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const r=new globalThis.AbortController;t>0&&setTimeout(()=>{r.abort(),mo.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve();try{return await globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async s=>{if(s){mo.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,s.name);try{return await n()}finally{mo.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,s.name)}}else{if(t===0)throw mo.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new LU(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(mo.debug)try{const o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null,"  "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await n()}})}catch(s){if((s==null?void 0:s.name)==="AbortError"&&t>0)return mo.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",e),console.warn(`@
292supabase/gotrue-js: Lock "${e}" was not released within ${t}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,{mode:"exclusive",steal:!0},async o=>{if(o){mo.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",e,o.name);try{return await n()}finally{mo.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",e,o.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await n()}));throw s}}function $U(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function wj(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function UU(e){return parseInt(e,16)}function FU(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,r=>r.toString(16).padStart(2,"0")).join("")}function zU(e){var t;const{chainId:n,domain:r,expirationTime:s,issuedAt:o=new Date,nonce:a,notBefore:l,requestId:c,resources:u,scheme:f,uri:p,version:h}=e;{if(!Number.isInteger(n))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${n}`);if(!r)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(a&&a.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${a}`);if(!p)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(h!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${h}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(`
293`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const m=wj(e.address),v=f?`${f}://${r}
293`:r,g=e.statement?`${e.statement}
294`:"",x=`${v} wants you to sign in with your Ethereum account:
295${m}
296
297${g}`;let w=`URI: ${p}
298Version: ${h}
299Chain ID: ${n}${a?`
300Nonce: ${a}`:""}
301Issued At: ${o.toISOString()}`;if(s&&(w+=`
302Expiration Time: ${s.toISOString()}`),l&&(w+=`
303Not Before: ${l.toISOString()}`),c&&(w+=`
304Request ID: ${c}`),u){let y=`
305Resources:`;for(const b of u){if(!b||typeof b!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${b}`);y+=`
306- ${b}`}w+=y}return`${x}
307${w}`}class Rn extends Error{constructor({message:t,code:n,cause:r,name:s}){var o;super(t,{cause:r}),this.__isWebAuthnError=!0,this.name=(o=s??(r instanceof Error?r.name:void 0))!==null&&o!==void 0?o:"Unknown Error",this.code=n}}class rp extends Rn{constructor(t,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:t}),this.name="WebAuthnUnknownError",this.originalError=n}}function BU({error:e,options:t}){var n,r,s;const{publicKey:o}=t;if(!o)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Rn({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((n=o.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new Rn({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((r=o.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new Rn({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((s=o.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new Rn({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new Rn({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new Rn({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return o.pubKeyCredParams.filter(l=>l.type==="public-key").length===0?new Rn({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new Rn({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const a=window.location.hostname;if(xj(a)){if(o.rp.id!==a)return new Rn({message:`The RP ID "${o.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Rn({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(o.user.id.byteLength<1||o.user.id.byteLength>64)return new Rn({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new Rn({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Rn({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function WU({error:e,options:t}){const{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Rn({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new Rn({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const r=window.location.hostname;if(xj(r)){if(n.rpId!==r)return new Rn({message:`The RP ID "${n.rpId}
307" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Rn({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new Rn({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Rn({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class HU{createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const KU=new HU;function qU(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:n,excludeCredentials:r}=e,s=Fc(e,["challenge","user","excludeCredentials"]),o=nc(t).buffer,a=Object.assign(Object.assign({},n),{id:nc(n.id).buffer}),l=Object.assign(Object.assign({},s),{challenge:o,user:a});if(r&&r.length>0){l.excludeCredentials=new Array(r.length);for(let c=0;c<r.length;c++){const u=r[c];l.excludeCredentials[c]=Object.assign(Object.assign({},u),{id:nc(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return l}function VU(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:n}=e,r=Fc(e,["challenge","allowCredentials"]),s=nc(t).buffer,o=Object.assign(Object.assign({},r),{challenge:s});if(n&&n.length>0){o.allowCredentials=new Array(n.length);for(let a=0;a<n.length;a++){const l=n[a];o.allowCredentials[a]=Object.assign(Object.assign({},l),{id:nc(l.id).buffer,type:l.type||"public-key",transports:l.transports})}}return o}function YU(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e;return{id:e.id,rawId:e.id,response:{attestationObject:wa(new Uint8Array(e.response.attestationObject)),clientDataJSON:wa(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function GU(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e,r=e.getClientExtensionResults(),s=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:wa(new Uint8Array(s.authenticatorData)),clientDataJSON:wa(new Uint8Array(s.clientDataJSON)),signature:wa(new Uint8Array(s.signature)),userHandle:s.userHandle?wa(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function xj(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function Y_(){var e,t;return!!(qn()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.get)=="function")}async function JU(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new rp("Browser returned unexpected credential type",t)}:{data:null,error:new rp("Empty credential response",t)}}catch(t){return{data:null,error:BU({error:t,options:e})}}}async function QU(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new rp("Browser returned unexpected credential type",t)}:{data:null,error:new rp("Empty credential response",t)}}
307catch(t){return{data:null,error:WU({error:t,options:e})}}}const XU={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},ZU={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function sp(...e){const t=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),n=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),r={};for(const s of e)if(s)for(const o in s){const a=s[o];if(a!==void 0)if(Array.isArray(a))r[o]=a;else if(n(a))r[o]=a;else if(t(a)){const l=r[o];t(l)?r[o]=sp(l,a):r[o]=sp(a)}else r[o]=a}return r}function eF(e,t){return sp(XU,e,t||{})}function tF(e,t){return sp(ZU,e,t||{})}class nF{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:n,friendlyName:r,signal:s},o){var a;try{const{data:l,error:c}=await this.client.mfa.challenge({factorId:t,webauthn:n});if(!l)return{data:null,error:c};const u=s??KU.createNewAbortSignal();if(l.webauthn.type==="create"){const{user:f}=l.webauthn.credential_options.publicKey;if(!f.name){const p=r;if(p)f.name=`${f.id}:${p}`;else{const m=(await this.client.getUser()).data.user,v=((a=m==null?void 0:m.user_metadata)===null||a===void 0?void 0:a.name)||(m==null?void 0:m.email)||(m==null?void 0:m.id)||"User";f.name=`${f.id}:${v}`}}f.displayName||(f.displayName=f.name)}switch(l.webauthn.type){case"create":{const f=eF(l.webauthn.credential_options.publicKey,o==null?void 0:o.create),{data:p,error:h}=await JU({publicKey:f,signal:u});return p?{data:{factorId:t,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:p}},error:null}:{data:null,error:h}}case"request":{const f=tF(l.webauthn.credential_options.publicKey,o==null?void 0:o.request),{data:p,error:h}=await QU(Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:f,signal:u}));return p?{data:{factorId:t,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:p}},error:null}:{data:null,error:h}}}}catch(l){return xe(l)?{data:null,error:l}:{data:null,error:new pa("Unexpected error in challenge",l)}}}async _verify({challengeId:t,factorId:n,webauthn:r}){return this.client.mfa.verify({factorId:n,challengeId:t,webauthn:r})}async _authenticate({factorId:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},o){if(!n)return{data:null,error:new xd("rpId is required for WebAuthn authentication")};try{if(!Y_())return{data:null,error:new pa("Browser does not support WebAuthn",null)};const{data:a,error:l}=await this.challenge({factorId:t,webauthn:{rpId:n,rpOrigins:r},signal:s},{request:o});if(!a)return{data:null,error:l};const{webauthn:c}=a;return this._verify({factorId:t,challengeId:a.challengeId,webauthn:{type:c.type,rpId:n,rpOrigins:r,credential_response:c.credential_response}})}catch(a){return xe(a)?{data:null,error:a}:{data:null,error:new pa("Unexpected error in authenticate",a)}}}async _register({friendlyName:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},o){if(!n)return{data:null,error:new xd("rpId is required for WebAuthn registration")};try{if(!Y_())return{data:null,error:new pa("Browser does not support WebAuthn",null)};const{data:a,error:l}=await this._enroll({friendlyName:t});if(!a)return await this.client.mfa.listFactors().then(f=>{var p;return(p=f.data)===null||p===void 0?void 0:p.all.find(h=>h.factor_type==="webauthn"&&h.friendly_name===t&&h.status!=="unverified")}).then(f=>f?this.client.mfa.unenroll({factorId:f==null?void 0:f.id}):void 0),{data:null,error:l};const{data:c,error:u}=await this._challenge({factorId:a.id,friendlyName:a.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:s},{create:o});return c?this._verify({factorId:a.id,challengeId:c.challengeId,webauthn:{rpId:n,rpOrigins:r,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:u}}catch(a){return xe(a)?{data:null,error:a}:{data:null,error:new pa("Unexpected error in register",a)}}}}$U();const rF={url:Z4,storageKey:eU,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:tU,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1};async function G_(e,t,n){return await n()}const yl={};class bd{get jwks(){var t,n;return(n=(t=yl[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(t){yl[this.storageKey]=Object.assign(Object.assign({},yl[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,n;return(n=(t=yl[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){yl[this.storageKey]=Object.assign(Object.assign({},yl[this.storageKey]),{cachedAt:t})}constructor(t){var n,r,s;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const o=Object.assign(Object.assign({},rF),t);
307if(this.storageKey=o.storageKey,this.instanceID=(n=bd.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,bd.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!o.debug,typeof o.debug=="function"&&(this.logger=o.debug),this.instanceID>0&&qn()){const a=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(a),this.logDebugMessages&&console.trace(a)}if(this.persistSession=o.persistSession,this.autoRefreshToken=o.autoRefreshToken,this.admin=new MU({url:o.url,headers:o.headers,fetch:o.fetch}),this.url=o.url,this.headers=o.headers,this.fetch=yj(o.fetch),this.lock=o.lock||G_,this.detectSessionInUrl=o.detectSessionInUrl,this.flowType=o.flowType,this.hasCustomAuthorizationHeader=o.hasCustomAuthorizationHeader,this.throwOnError=o.throwOnError,this.lockAcquireTimeout=o.lockAcquireTimeout,o.lock?this.lock=o.lock:this.persistSession&&qn()&&(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=DU:this.lock=G_,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new nF(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(o.storage?this.storage=o.storage:gj()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=V_(this.memoryStorage)),o.userStorage&&(this.userStorage=o.userStorage)):(this.memoryStorage={},this.storage=V_(this.memoryStorage)),qn()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(a){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",a)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async a=>{this._debug("received broadcast notification from other tab or client",a);try{await this._notifyAllSubscribers(a.data.event,a.data.session,!1)}catch(l){this._debug("#broadcastChannel","error",l)}})}o.skipAutoInitialize||this.initialize().catch(a=>{this._debug("#initialize()","error",a)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${hj}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let n={},r="none";if(qn()&&(n=mU(window.location.href),this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce")),qn()&&this.detectSessionInUrl&&r!=="none"){const{data:s,error:o}=await this._getSessionFromURL(n,r);if(o){if(this._debug("#_initialize()","error detecting session from URL",o),iU(o)){const c=(t=o.details)===null||t===void 0?void 0:t.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:o}}return{error:o}}const{session:a,redirectType:l}=s;return this._debug("#_initialize()","detected session in URL",a,"redirect type",l),await this._saveSession(a),setTimeout(async()=>{l==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",a):await this._notifyAllSubscribers("SIGNED_IN",a)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return xe(n)?this._returnResult({error:n}):this._returnResult({error:new pa("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var n,r,s;try{const o=await Ne(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(s=t==null?void 0:t.options)===null||s===void 0?void 0:s.captchaToken}},xform:bs}),{data:a,error:l}=o;if(l||!a)return this._returnResult({data:{user:null,session:null},error:l});const c=a.session,u=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(o){if(xe(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signUp(t){var n,r,s;try{let o;if("email"in t){const{email:f,password:p,options:h}=t;let m=null,v=null;this.flowType==="pkce"&&([m,v]=await ml(this.storage,this.storageKey)),o=await Ne(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:h==null?void 0:h.emailRedirectTo,body:{email:f,password:p,data:(n=h==null?void 0:h.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken},code_challenge:m,code_challenge_method:v},xform:bs})}else if("phone"in t){const{phone:f,password:p,options:h}=t;o=await Ne(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:f,password:p,data:(r=h==null?void 0:h.data)!==null&&r!==void 0?r:{},channel:(s=h==null?void 0:h.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken}},xform:bs})}else throw new Df("You must provide either an email or phone number and a password");const{data:a,error:l}=o;if(l||!a)return await Kn(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:l});const c=a.session,u=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(o){if(await Kn(this.storage,`${this.storageKey}-code-verifier`),xe(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signInWithPassword(t){try{let n;if("email"in t){const{email:o,password:a,options:l}=t;n=await Ne(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:o,password:a,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:K_})}else if("phone"in t){const{phone:o,password:a,options:l}=t;n=await Ne(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:o,password:a,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:K_})}else throw new Df("You must provide either an email or phone number and a password");const{data:r,error:s}=n;if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!r||!r.session||!r.user){const o=new pl;return this._returnResult({data:{user:null,session:null},error:o})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:s})}catch(n){if(xe(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(t){var n,r,s,o;return await this._handleProviderSignIn(t.provider,{redirectTo:(n=t.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=t.options)===null||r===void 0?void 0:r.scopes,queryParams:(s=t.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(o=t.o
307ptions)===null||o===void 0?void 0:o.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:n}=t;switch(n){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}}async signInWithEthereum(t){var n,r,s,o,a,l,c,u,f,p,h;let m,v;if("message"in t)m=t.message,v=t.signature;else{const{chain:g,wallet:x,statement:w,options:y}=t;let b;if(qn())if(typeof x=="object")b=x;else{const T=window;if("ethereum"in T&&typeof T.ethereum=="object"&&"request"in T.ethereum&&typeof T.ethereum.request=="function")b=T.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof x!="object"||!(y!=null&&y.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");b=x}const _=new URL((n=y==null?void 0:y.url)!==null&&n!==void 0?n:window.location.href),k=await b.request({method:"eth_requestAccounts"}).then(T=>T).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!k||k.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const C=wj(k[0]);let E=(r=y==null?void 0:y.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!E){const T=await b.request({method:"eth_chainId"});E=UU(T)}const A={domain:_.host,address:C,statement:w,uri:_.href,version:"1",chainId:E,nonce:(s=y==null?void 0:y.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(a=(o=y==null?void 0:y.signInWithEthereum)===null||o===void 0?void 0:o.issuedAt)!==null&&a!==void 0?a:new Date,expirationTime:(l=y==null?void 0:y.signInWithEthereum)===null||l===void 0?void 0:l.expirationTime,notBefore:(c=y==null?void 0:y.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(u=y==null?void 0:y.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(f=y==null?void 0:y.signInWithEthereum)===null||f===void 0?void 0:f.resources};m=zU(A),v=await b.request({method:"personal_sign",params:[FU(m),C]})}try{const{data:g,error:x}=await Ne(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:m,signature:v},!((p=t.options)===null||p===void 0)&&p.captchaToken?{gotrue_meta_security:{captcha_token:(h=t.options)===null||h===void 0?void 0:h.captchaToken}}:null),xform:bs});if(x)throw x;if(!g||!g.session||!g.user){const w=new pl;return this._returnResult({data:{user:null,session:null},error:w})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:x})}catch(g){if(xe(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async signInWithSolana(t){var n,r,s,o,a,l,c,u,f,p,h,m;let v,g;if("message"in t)v=t.message,g=t.signature;else{const{chain:x,wallet:w,statement:y,options:b}=t;let _;if(qn())if(typeof w=="object")_=w;else{const C=window;if("solana"in C&&typeof C.solana=="object"&&("signIn"in C.solana&&typeof C.solana.signIn=="function"||"signMessage"in C.solana&&typeof C.solana.signMessage=="function"))_=C.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof w!="object"||!(b!=null&&b.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");_=w}const k=new URL((n=b==null?void 0:b.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in _&&_.signIn){const C=await _.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},b==null?void 0:b.signInWithSolana),{version:"1",domain:k.host,uri:k.href}),y?{statement:y}:null));let E;if(Array.isArray(C)&&C[0]&&typeof C[0]=="object")E=C[0];else if(C&&typeof C=="object"&&"signedMessage"in C&&"signature"in C)E=C;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in E&&"signature"in E&&(typeof E.signedMessage=="string"||E.signedMessage instanceof Uint8Array)&&E.signature instanceof Uint8Array)v=typeof E.signedMessage=="string"?E.signedMessage:new TextDecoder().decode(E.signedMessage),g=E.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in _)||typeof _.signMessage!="function"||!("publicKey"in _)||typeof _!="object"||!_.publicKey||!("toBase58"in _.publicKey)||typeof _.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");v=[`${k.host} wants you to sign in with your Solana account:`,_.publicKey.toBase58(),...y?["",y,""]:[""],"Version: 1",`URI: ${k.href}`,`Issued At: ${(s=(r=b==null?void 0:b.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((o=b==null?void 0:b.signInWithSolana)===null||o===void 0)&&o.notBefore?[`Not Before: ${b.signInWithSolana.notBefore}`]:[],...!((a=b==null?void 0:b.signInWithSolana)===null||a===void 0)&&a.expirationTime?[`Expiration Time: ${b.signInWithSolana.expirationTime}`]:[],...!((l=b==null?void 0:b.signInWithSolana)===null||l===void 0)&&l.chainId?[`Chain ID: ${b.signInWithSolana.chainId}`]:[],...!((c=b==null?void 0:b.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${b.signInWithSolana.nonce}`]:[],...!((u=b==null?void 0:b.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${b.signInWithSolana.requestId}`]:[],...!((p=(f=b==null?void 0:b.signInWithSolana)===null||f===void 0?void 0:f.resources)===null||p===void 0)&&p.length?["Resources",...b.signInWithSolana.resources.map(E=>`- ${E}`)]:[]].join(`
308`);const C=await _.signMessage(new TextEncoder().encode(v),"utf8");if(!C||!(C instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=C}}try{const{data:x,error:w}=await Ne(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:v,signature:wa(g)}
308,!((h=t.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(m=t.options)===null||m===void 0?void 0:m.captchaToken}}:null),xform:bs});if(w)throw w;if(!x||!x.session||!x.user){const y=new pl;return this._returnResult({data:{user:null,session:null},error:y})}return x.session&&(await this._saveSession(x.session),await this._notifyAllSubscribers("SIGNED_IN",x.session)),this._returnResult({data:Object.assign({},x),error:w})}catch(x){if(xe(x))return this._returnResult({data:{user:null,session:null},error:x});throw x}}async _exchangeCodeForSession(t){const n=await sa(this.storage,`${this.storageKey}-code-verifier`),[r,s]=(n??"").split("/");try{if(!r&&this.flowType==="pkce")throw new aU;const{data:o,error:a}=await Ne(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:bs});if(await Kn(this.storage,`${this.storageKey}-code-verifier`),a)throw a;if(!o||!o.session||!o.user){const l=new pl;return this._returnResult({data:{user:null,session:null,redirectType:null},error:l})}return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",o.session)),this._returnResult({data:Object.assign(Object.assign({},o),{redirectType:s??null}),error:a})}catch(o){if(await Kn(this.storage,`${this.storageKey}-code-verifier`),xe(o))return this._returnResult({data:{user:null,session:null,redirectType:null},error:o});throw o}}async signInWithIdToken(t){try{const{options:n,provider:r,token:s,access_token:o,nonce:a}=t,l=await Ne(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:s,access_token:o,nonce:a,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:bs}),{data:c,error:u}=l;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!c||!c.session||!c.user){const f=new pl;return this._returnResult({data:{user:null,session:null},error:f})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:c,error:u})}catch(n){if(xe(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(t){var n,r,s,o,a;try{if("email"in t){const{email:l,options:c}=t;let u=null,f=null;this.flowType==="pkce"&&([u,f]=await ml(this.storage,this.storageKey));const{error:p}=await Ne(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:l,data:(n=c==null?void 0:c.data)!==null&&n!==void 0?n:{},create_user:(r=c==null?void 0:c.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:u,code_challenge_method:f},redirectTo:c==null?void 0:c.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:p})}if("phone"in t){const{phone:l,options:c}=t,{data:u,error:f}=await Ne(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(s=c==null?void 0:c.data)!==null&&s!==void 0?s:{},create_user:(o=c==null?void 0:c.shouldCreateUser)!==null&&o!==void 0?o:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(a=c==null?void 0:c.channel)!==null&&a!==void 0?a:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:f})}throw new Df("You must provide either an email or phone number.")}catch(l){if(await Kn(this.storage,`${this.storageKey}-code-verifier`),xe(l))return this._returnResult({data:{user:null,session:null},error:l});throw l}}async verifyOtp(t){var n,r;try{let s,o;"options"in t&&(s=(n=t.options)===null||n===void 0?void 0:n.redirectTo,o=(r=t.options)===null||r===void 0?void 0:r.captchaToken);const{data:a,error:l}=await Ne(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:o}}),redirectTo:s,xform:bs});if(l)throw l;if(!a)throw new Error("An error occurred on token verification.");const c=a.session,u=a.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(s){if(xe(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(t){var n,r,s,o,a;try{let l=null,c=null;this.flowType==="pkce"&&([l,c]=await ml(this.storage,this.storageKey));const u=await Ne(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(r=(n=t.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((s=t==null?void 0:t.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:l,code_challenge_method:c}),headers:this.headers,xform:AU});return!((o=u.data)===null||o===void 0)&&o.url&&qn()&&!(!((a=t.options)===null||a===void 0)&&a.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(l){if(await Kn(this.storage,`${this.storageKey}-code-verifier`),xe(l))return this._returnResult({data:null,error:l});throw l}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;if(r)throw r;if(!n)throw new Hr;const{error:s}=await Ne(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:s})})}catch(t){if(xe(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const n=`${this.url}/resend`;if("email"in t){const{email:r,type:s,options:o}=t,{error:a}=await Ne(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:s,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},redirectTo:o==null?void 0:o.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}else if("phone"in t){const{phone:r,type:s,options:o}=t,{data:a,error:l}=await Ne(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:s,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:a==null?void 0:a.message_id},error:l})}throw new Df("You must provide either an email or phone number and a type")}catch(n){if(xe(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async n=>n))}async _acquireLock(t,n){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=n();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await t(n)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const n=await sa(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?t=n:(this._debug("#getSession()","session from storage is not val
308id"),await this._removeSession())),!t)return{data:{session:null},error:null};const r=t.expires_at?t.expires_at*1e3-Date.now()<Ig:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.userStorage){const a=await sa(this.userStorage,this.storageKey+"-user");a!=null&&a.user?t.user=a.user:t.user=Lg()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const a={value:this.suppressGetSessionWarning};t.user=NU(t.user,a),a.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:s,error:o}=await this._callRefreshToken(t.refresh_token);return o?this._returnResult({data:{session:null},error:o}):this._returnResult({data:{session:s},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;const n=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return n.data.user&&(this.suppressGetSessionWarning=!0),n}async _getUser(t){try{return t?await Ne(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:li}):await this._useSession(async n=>{var r,s,o;const{data:a,error:l}=n;if(l)throw l;return!(!((r=a.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Hr}:await Ne(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(o=(s=a.session)===null||s===void 0?void 0:s.access_token)!==null&&o!==void 0?o:void 0,xform:li})})}catch(n){if(xe(n))return Og(n)&&(await this._removeSession(),await Kn(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:n});throw n}}async updateUser(t,n={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,n))}async _updateUser(t,n={}){try{return await this._useSession(async r=>{const{data:s,error:o}=r;if(o)throw o;if(!s.session)throw new Hr;const a=s.session;let l=null,c=null;this.flowType==="pkce"&&t.email!=null&&([l,c]=await ml(this.storage,this.storageKey));const{data:u,error:f}=await Ne(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:l,code_challenge_method:c}),jwt:a.access_token,xform:li});if(f)throw f;return a.user=u.user,await this._saveSession(a),await this._notifyAllSubscribers("USER_UPDATED",a),this._returnResult({data:{user:a.user},error:null})})}catch(r){if(await Kn(this.storage,`${this.storageKey}-code-verifier`),xe(r))return this._returnResult({data:{user:null},error:r});throw r}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new Hr;const n=Date.now()/1e3;let r=n,s=!0,o=null;const{payload:a}=Uf(t.access_token);if(a.exp&&(r=a.exp,s=r<=n),s){const{data:l,error:c}=await this._callRefreshToken(t.refresh_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!l)return{data:{user:null,session:null},error:null};o=l}else{const{data:l,error:c}=await this._getUser(t.access_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});o={access_token:t.access_token,refresh_token:t.refresh_token,user:l.user,token_type:"bearer",expires_in:r-n,expires_at:r},await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)}return this._returnResult({data:{user:o.user,session:o},error:null})}catch(n){if(xe(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async n=>{var r;if(!t){const{data:a,error:l}=n;if(l)throw l;t=(r=a.session)!==null&&r!==void 0?r:void 0}if(!(t!=null&&t.refresh_token))throw new Hr;const{data:s,error:o}=await this._callRefreshToken(t.refresh_token);return o?this._returnResult({data:{user:null,session:null},error:o}):s?this._returnResult({data:{user:s.user,session:s},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(xe(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(t,n){try{if(!qn())throw new $f("No browser detected.");
308if(t.error||t.error_description||t.error_code)throw new $f(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new $_("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new $f("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new $_("No code detected.");const{data:y,error:b}=await this._exchangeCodeForSession(t.code);if(b)throw b;const _=new URL(window.location.href);return _.searchParams.delete("code"),window.history.replaceState(window.history.state,"",_.toString()),{data:{session:y.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:s,access_token:o,refresh_token:a,expires_in:l,expires_at:c,token_type:u}=t;if(!o||!l||!a||!u)throw new $f("No session defined in URL");const f=Math.round(Date.now()/1e3),p=parseInt(l);let h=f+p;c&&(h=parseInt(c));const m=h-f;m*1e3<=El&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${m}s, should have been closer to ${p}s`);const v=h-p;f-v>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",v,h,f):f-v<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",v,h,f);const{data:g,error:x}=await this._getUser(o);if(x)throw x;const w={provider_token:r,provider_refresh_token:s,access_token:o,expires_in:p,expires_at:h,refresh_token:a,token_type:u,user:g.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:w,redirectType:t.type},error:null})}catch(r){if(xe(r))return this._returnResult({data:{session:null,redirectType:null},error:r});throw r}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){const n=await sa(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&n)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async n=>{var r;const{data:s,error:o}=n;if(o&&!Og(o))return this._returnResult({error:o});const a=(r=s.session)===null||r===void 0?void 0:r.access_token;if(a){const{error:l}=await this.admin.signOut(a,t);if(l&&!(oU(l)&&(l.status===404||l.status===401||l.status===403)||Og(l)))return this._returnResult({error:l})}return t!=="others"&&(await this._removeSession(),await Kn(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const n=pU(),r={id:n,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",n),this.stateChangeEmitters.delete(n)}};return this._debug("#onAuthStateChange()","registered callback with id",n),this.stateChangeEmitters.set(n,r),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:r}}}async _emitInitialSession(t){return await this._useSession(async n=>{var r,s;try{const{data:{session:o},error:a}=n;if(a)throw a;await((r=this.stateChangeEmitters.get(t))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",o)),this._debug("INITIAL_SESSION","callback id",t,"session",o)}catch(o){await((s=this.stateChangeEmitters.get(t))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",o),console.error(o)}})}async resetPasswordForEmail(t,n={}){let r=null,s=null;this.flowType==="pkce"&&([r,s]=await ml(this.storage,this.storageKey,!0));try{return await Ne(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:r,code_challenge_method:s,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(o){if(await Kn(this.storage,`${this.storageKey}-code-verifier`),xe(o))return this._returnResult({data:null,error:o});throw o}}async getUserIdentities(){var t;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:(t=n.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(n){if(xe(n))return this._returnResult({data:null,error:n});throw n}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var n;try{const{data:r,error:s}=await this._useSession(async o=>{var a,l,c,u,f;const{data:p,error:h}=o;if(h)throw h;const m=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(a=t.options)===null||a===void 0?void 0:a.redirectTo,scopes:(l=t.options)===null||l===void 0?void 0:l.scopes,queryParams:(c=t.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await Ne(this.fetch,"GET",m,{headers:this.headers,jwt:(f=(u=p.session)===null||u===void 0?void 0:u.access_token)!==null&&f!==void 0?f:void 0})});if(s)throw s;return qn()&&!(!((n=t.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),this._returnResult({data:{provider:t.provider,url:r==null?void 0:r.url},error:null})}catch(r){if(xe(r))return this._returnResult({data:{provider:t.provider,url:null},error:r});throw r}}async linkIdentityIdToken(t){return await this._useSession(async n=>{var r;try{const{error:s,data:{session:o}}=n;if(s)throw s;const{options:a,provider:l,token:c,access_token:u,nonce:f}=t,p=await Ne(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=o==null?void 0:o.access_token)!==null&&r!==void 0?r:void 0,body:{provider:l,id_token:c,access_token:u,nonce:f,link_identity:!0,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:bs}),{data:h,error:m}=p;return m?this._returnResult({data:{user:null,session:null},error:m}):!h||!h.session||!h.user?this._returnResult({data:{user:null,session:null},error:new pl}):(h.session&&(await this._saveSession(h.session),await this._notifyAllSubscribers("USER_UPDATED",h.session)),this._returnResult({data:h,error:m}))}catch(s){if(await Kn(this.storage,`${this.storageKey}-code-verifier`),xe(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}})}async unlinkIdentity(t){try{return await this._useSession(async n=>{var r,s;const{data:o,error:a}=n;
308if(a)throw a;return await Ne(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(s=(r=o.session)===null||r===void 0?void 0:r.access_token)!==null&&s!==void 0?s:void 0})})}catch(n){if(xe(n))return this._returnResult({data:null,error:n});throw n}}async _refreshAccessToken(t){const n=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(n,"begin");try{const r=Date.now();return await vU(async s=>(s>0&&await yU(200*Math.pow(2,s-1)),this._debug(n,"refreshing attempt",s),await Ne(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:bs})),(s,o)=>{const a=200*Math.pow(2,s);return o&&Mg(o)&&Date.now()+a-r<El})}catch(r){if(this._debug(n,"error",r),xe(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}finally{this._debug(n,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,n){const r=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",n,"url",r),qn()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:t,url:r},error:null}}async _recoverAndRefresh(){var t,n;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const s=await sa(this.storage,this.storageKey);if(s&&this.userStorage){let a=await sa(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!a&&(a={user:s.user},await jl(this.userStorage,this.storageKey+"-user",a)),s.user=(t=a==null?void 0:a.user)!==null&&t!==void 0?t:Lg()}else if(s&&!s.user&&!s.user){const a=await sa(this.storage,this.storageKey+"-user");a&&(a!=null&&a.user)?(s.user=a.user,await Kn(this.storage,this.storageKey+"-user"),await jl(this.storage,this.storageKey,s)):s.user=Lg()}if(this._debug(r,"session from storage",s),!this._isValidSession(s)){this._debug(r,"session is not valid"),s!==null&&await this._removeSession();return}const o=((n=s.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<Ig;if(this._debug(r,`session has${o?"":" not"} expired with margin of ${Ig}s`),o){if(this.autoRefreshToken&&s.refresh_token){const{error:a}=await this._callRefreshToken(s.refresh_token);a&&(console.error(a),Mg(a)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",a),await this._removeSession()))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:a,error:l}=await this._getUser(s.access_token);!l&&(a!=null&&a.user)?(s.user=a.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(a){console.error("Error getting user data:",a),this._debug(r,"error getting user data, skipping SIGNED_IN notification",a)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(r,"error",s),console.error(s);return}finally{this._debug(r,"end")}}async _callRefreshToken(t){var n,r;if(!t)throw new Hr;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new Qp;const{data:o,error:a}=await this._refreshAccessToken(t);if(a)throw a;if(!o.session)throw new Hr;await this._saveSession(o.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",o.session);const l={data:o.session,error:null};return this.refreshingDeferred.resolve(l),l}catch(o){if(this._debug(s,"error",o),xe(o)){const a={data:null,error:o};return Mg(o)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(a),a}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(o),o}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(t,n,r=!0){const s=`#_notifyAllSubscribers(${t})`;this._debug(s,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:t,session:n});const o=[],a=Array.from(this.stateChangeEmitters.values()).map(async l=>{try{await l.callback(t,n)}catch(c){o.push(c)}});if(await Promise.all(a),o.length>0){for(let l=0;l<o.length;l+=1)console.error(o[l]);throw o[0]}}finally{this._debug(s,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await Kn(this.storage,`${this.storageKey}-code-verifier`);const n=Object.assign({},t),r=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&n.user&&await jl(this.userStorage,this.storageKey+"-user",{user:n.user});const s=Object.assign({},n);delete s.user;const o=W_(s);await jl(this.storage,this.storageKey,o)}else{const s=W_(n);await jl(this.storage,this.storageKey,s)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await Kn(this.storage,this.storageKey),await Kn(this.storage,this.storageKey+"-code-verifier"),await Kn(this.storage,this.storageKey+"-user"),this.userStorage&&await Kn(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&qn()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}
308catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),El);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);const n=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=n,n&&typeof n=="object"&&typeof n.unref=="function"?n.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(n)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);const n=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,n&&clearTimeout(n)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async n=>{const{data:{session:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((r.expires_at*1e3-t)/El);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${El}ms, refresh threshold is ${Pv} ticks`),s<=Pv&&await this._callRefreshToken(r.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof vj)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!qn()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(t){this._debug("#visibilityChangedCallback","error",t)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const n=`#_onVisibilityChanged(${t})`;this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(n,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,n,r){const s=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&s.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&s.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[o,a]=await ml(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(o)}`,code_challenge_method:`${encodeURIComponent(a)}`});s.push(l.toString())}if(r!=null&&r.queryParams){const o=new URLSearchParams(r.queryParams);s.push(o.toString())}return r!=null&&r.skipBrowserRedirect&&s.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${t}?${s.join("&")}`}async _unenroll(t){try{return await this._useSession(async n=>{var r;const{data:s,error:o}=n;return o?this._returnResult({data:null,error:o}):await Ne(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(xe(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(t){try{return await this._useSession(async n=>{var r,s;const{data:o,error:a}=n;
308if(a)return this._returnResult({data:null,error:a});const l=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:c,error:u}=await Ne(this.fetch,"POST",`${this.url}/factors`,{body:l,headers:this.headers,jwt:(r=o==null?void 0:o.session)===null||r===void 0?void 0:r.access_token});return u?this._returnResult({data:null,error:u}):(t.factorType==="totp"&&c.type==="totp"&&(!((s=c==null?void 0:c.totp)===null||s===void 0)&&s.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),this._returnResult({data:c,error:null}))})}catch(n){if(xe(n))return this._returnResult({data:null,error:n});throw n}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:s,error:o}=n;if(o)return this._returnResult({data:null,error:o});const a=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?YU(t.webauthn.credential_response):GU(t.webauthn.credential_response)})}:{code:t.code}),{data:l,error:c}=await Ne(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:a,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});return c?this._returnResult({data:null,error:c}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+l.expires_in},l)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",l),this._returnResult({data:l,error:c}))})}catch(n){if(xe(n))return this._returnResult({data:null,error:n});throw n}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:s,error:o}=n;if(o)return this._returnResult({data:null,error:o});const a=await Ne(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});if(a.error)return a;const{data:l}=a;if(l.type!=="webauthn")return{data:l,error:null};switch(l.webauthn.type){case"create":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:qU(l.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:VU(l.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(xe(n))return this._returnResult({data:null,error:n});throw n}})}async _challengeAndVerify(t){const{data:n,error:r}=await this._challenge({factorId:t.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:t.factorId,challengeId:n.id,code:t.code})}async _listFactors(){var t;const{data:{user:n},error:r}=await this.getUser();if(r)return{data:null,error:r};const s={all:[],phone:[],totp:[],webauthn:[]};for(const o of(t=n==null?void 0:n.factors)!==null&&t!==void 0?t:[])s.all.push(o),o.status==="verified"&&s[o.factor_type].push(o);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(t){var n,r,s,o;if(t)try{const{payload:m}=Uf(t);let v=null;m.aal&&(v=m.aal);let g=v;const{data:{user:x},error:w}=await this.getUser(t);if(w)return this._returnResult({data:null,error:w});((r=(n=x==null?void 0:x.factors)===null||n===void 0?void 0:n.filter(_=>_.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(g="aal2");const b=m.amr||[];return{data:{currentLevel:v,nextLevel:g,currentAuthenticationMethods:b},error:null}}catch(m){if(xe(m))return this._returnResult({data:null,error:m});throw m}const{data:{session:a},error:l}
308=await this.getSession();if(l)return this._returnResult({data:null,error:l});if(!a)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:c}=Uf(a.access_token);let u=null;c.aal&&(u=c.aal);let f=u;((o=(s=a.user.factors)===null||s===void 0?void 0:s.filter(m=>m.status==="verified"))!==null&&o!==void 0?o:[]).length>0&&(f="aal2");const h=c.amr||[];return{data:{currentLevel:u,nextLevel:f,currentAuthenticationMethods:h},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;return s?this._returnResult({data:null,error:s}):r?await Ne(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:r.access_token,xform:o=>({data:o,error:null})}):this._returnResult({data:null,error:new Hr})})}catch(n){if(xe(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:s},error:o}=r;if(o)return this._returnResult({data:null,error:o});if(!s)return this._returnResult({data:null,error:new Hr});const a=await Ne(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"approve"},xform:l=>({data:l,error:null})});return a.data&&a.data.redirect_url&&qn()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(r){if(xe(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:s},error:o}=r;if(o)return this._returnResult({data:null,error:o});if(!s)return this._returnResult({data:null,error:new Hr});const a=await Ne(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"deny"},xform:l=>({data:l,error:null})});return a.data&&a.data.redirect_url&&qn()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(r){if(xe(r))return this._returnResult({data:null,error:r});throw r}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?await Ne(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new Hr})})}catch(t){if(xe(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;return s?this._returnResult({data:null,error:s}):r?(await Ne(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Hr})})}catch(n){if(xe(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(t,n={keys:[]}){let r=n.keys.find(l=>l.kid===t);if(r)return r;const s=Date.now();if(r=this.jwks.keys.find(l=>l.kid===t),r&&this.jwks_cached_at+rU>s)return r;const{data:o,error:a}=await Ne(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(a)throw a;return!o.keys||o.keys.length===0||(this.jwks=o,this.jwks_cached_at=s,r=o.keys.find(l=>l.kid===t),!r)?null:r}async getClaims(t,n={}){try{let r=t;if(!r){const{data:m,error:v}
308=await this.getSession();if(v||!m.session)return this._returnResult({data:null,error:v});r=m.session.access_token}const{header:s,payload:o,signature:a,raw:{header:l,payload:c}}=Uf(r);n!=null&&n.allowExpired||CU(o.exp);const u=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!u){const{error:m}=await this.getUser(r);if(m)throw m;return{data:{claims:o,header:s,signature:a},error:null}}const f=EU(s.alg),p=await crypto.subtle.importKey("jwk",u,f,!0,["verify"]);if(!await crypto.subtle.verify(f,p,a,fU(`${l}.${c}`)))throw new Iv("Invalid JWT signature");return{data:{claims:o,header:s,signature:a},error:null}}catch(r){if(xe(r))return this._returnResult({data:null,error:r});throw r}}}bd.nextInstanceID={};const sF=bd,oF="2.98.0";let Eu="";typeof Deno<"u"?Eu="deno":typeof document<"u"?Eu="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Eu="react-native":Eu="node";const iF={"X-Client-Info":`supabase-js-${Eu}/${oF}`},aF={headers:iF},lF={schema:"public"},cF={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},uF={};function _d(e){"@babel/helpers - typeof";return _d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_d(e)}function dF(e,t){if(_d(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(_d(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fF(e){var t=dF(e,"string");return _d(t)=="symbol"?t:t+""}function hF(e,t,n){return(t=fF(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function J_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function gn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?J_(Object(n),!0).forEach(function(r){hF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const pF=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),mF=()=>Headers,gF=(e,t,n)=>{const r=pF(n),s=mF();return async(o,a)=>{var l;const c=(l=await t())!==null&&l!==void 0?l:e;let u=new s(a==null?void 0:a.headers);return u.has("apikey")||u.set("apikey",e),u.has("Authorization")||u.set("Authorization",`Bearer ${c}`),r(o,gn(gn({},a),{},{headers:u}))}};function yF(e){return e.endsWith("/")?e:e+"/"}function vF(e,t){var n,r;const{db:s,auth:o,realtime:a,global:l}=e,{db:c,auth:u,realtime:f,global:p}=t,h={db:gn(gn({},c),s),auth:gn(gn({},u),o),realtime:gn(gn({},f),a),storage:{},global:gn(gn(gn({},p),l),{},{headers:gn(gn({},(n=p==null?void 0:p.headers)!==null&&n!==void 0?n:{}),(r=l==null?void 0:l.headers)!==null&&r!==void 0?r:{})}),accessToken:async()=>""};return e.accessToken?h.accessToken=e.accessToken:delete h.accessToken,h}function wF(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(yF(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var xF=class extends sF{constructor(e){super(e)}},bF=class{constructor(e,t,n){var r,s;this.supabaseUrl=e,this.supabaseKey=t;const o=wF(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",o),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",o),this.storageUrl=new URL("storage/v1",o),this.functionsUrl=new URL("functions/v1",o);const a=`sb-${o.hostname.split(".")[0]}-auth-token`,l={db:lF,realtime:uF,auth:gn(gn({},cF),{},{storageKey:a}),global:aF},c=vF(n??{},l);if(this.storageKey=(r=c.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(s=c.global.headers)!==null&&s!==void 0?s:{},c.accessToken)this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(f,p)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(p)} is not possible`)}});else{var u;this.auth=this._initSupabaseAuthClient((u=c.auth)!==null&&u!==void 0?u:{},this.headers,c.global.fetch)}this.fetch=gF(t,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(gn({headers:this.headers,accessToken:this._getAccessToken.bind(this)},c.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(f=>this.realtime.setAuth(f)).catch(f=>console.warn("Failed to set initial Realtime auth token:",f)),this.rest=new o4(new URL("rest/v1",o).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch,timeout:c.db.timeout,urlLengthLimit:c.db.urlLengthLimit}),this.storage=new X4(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new Q$(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,n)}
308channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,t,n;if(e.accessToken)return await e.accessToken();const{data:r}=await e.auth.getSession();return(t=(n=r.session)===null||n===void 0?void 0:n.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:s,storageKey:o,flowType:a,lock:l,debug:c,throwOnError:u},f,p){const h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new xF({url:this.authUrl.href,headers:gn(gn({},h),f),storageKey:o,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:s,flowType:a,lock:l,debug:c,throwOnError:u,fetch:p,hasCustomAuthorizationHeader:Object.keys(this.headers).some(m=>m.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new _4(this.realtimeUrl.href,gn(gn({},e),{},{params:gn(gn({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t==null?void 0:t.access_token)})}_handleTokenChanged(e,t,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const bj=(e,t,n)=>new bF(e,t,n);function _F(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const n=t.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=18:!1}_F()&&console.warn("⚠️  Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const kF="https://uijpvjufahnqxxxickza.supabase.co",SF="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InVpanB2anVmYWhucXh4eGlja3phIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjQ3Mjc2MTIsImV4cCI6MjA4MDMwMzYxMn0.cmf5m_XGhwIl1GHcaLkgSWzCHmphMd8Vw2-5qdQBGbQ",pe=bj(kF,SF,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0,storageKey:"staaake-auth-token",detectSessionInUrl:!0,flowType:"implicit"}});var CF=e=>{switch(e){case"success":return NF;case"info":return PF;case"warning":return TF;case"error":return RF;default:return null}},EF=Array(12).fill(0),jF=({visible:e,className:t})=>le.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},le.createElement("div",{className:"sonner-spinner"},EF.map((n,r)=>le.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),NF=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),TF=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),PF=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),RF=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),AF=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},le.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),le.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),IF=()=>{let[e,t]=le.useState(document.hidden);return le.useEffect(()=>{let n=()=>{t(document.hidden)};
308return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Ov=1,OF=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Ov++,o=this.toasts.find(l=>l.id===s),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),o?this.toasts=this.toasts.map(l=>l.id===s?(this.publish({...l,...e,id:s,title:n}),{...l,...e,id:s,dismissible:a,title:n}):l):this.addToast({title:n,...r,dismissible:a,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>
308this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),s=n!==void 0,o,a=r.then(async c=>{if(o=["resolve",c],le.isValidElement(c))s=!1,this.create({id:n,type:"default",message:c});else if(LF(c)&&!c.ok){s=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,f=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:u,description:f})}else if(t.success!==void 0){s=!1;let u=typeof t.success=="function"?await t.success(c):t.success,f=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:u,description:f})}}).catch(async c=>{if(o=["reject",c],t.error!==void 0){s=!1;let u=typeof t.error=="function"?await t.error(c):t.error,f=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:u,description:f})}}).finally(()=>{var c;s&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,u)=>a.then(()=>o[0]==="reject"?u(o[1]):c(o[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||Ov++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},jr=new OF,MF=(e,t)=>{let n=(t==null?void 0:t.id)||Ov++;return jr.addToast({title:e,...t,id:n}),n},LF=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",DF=MF,$F=()=>jr.toasts,UF=()=>jr.getActiveToasts(),re=Object.assign(DF,{success:jr.success,info:jr.info,warning:jr.warning,error:jr.error,custom:jr.custom,message:jr.message,promise:jr.promise,dismiss:jr.dismiss,loading:jr.loading},{getHistory:$F,getToasts:UF});function FF(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}FF(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
308left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
308:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);
308--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
309`);function Ff(e){return e.label!==void 0}var zF=3,BF="32px",WF="16px",Q_=4e3,HF=356,KF=14,qF=20,VF=200;function xs(...e){return e.filter(Boolean).join(" ")}function YF(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var GF=e=>{var t,n,r,s,o,a,l,c,u,f,p;let{invert:h,toast:m,unstyled:v,interacting:g,setHeights:x,visibleToasts:w,heights:y,index:b,toasts:_,expanded:k,removeToast:C,defaultRichColors:E,closeButton:A,style:T,cancelButtonStyle:M,actionButtonStyle:P,className:$="",descriptionClassName:H="",duration:z,position:B,gap:U,loadingIcon:D,expandByDefault:j,classNames:N,icons:W,closeButtonAriaLabel:G="Close toast",pauseWhenPageIsHidden:L}=e,[K,J]=le.useState(null),[Z,ce]=le.useState(null),[q,me]=le.useState(!1),[oe,ae]=le.useState(!1),[fe,ge]=le.useState(!1),[$e,tt]=le.useState(!1),[Lt,ut]=le.useState(!1),[Nn,Ae]=le.useState(0),[Xn,rn]=le.useState(0),ar=le.useRef(m.duration||z||Q_),In=le.useRef(null),On=le.useRef(null),xr=b===0,Ur=b+1<=w,Q=m.type,V=m.dismissible!==!1,je=m.className||"",Me=m.descriptionClassName||"",xt=le.useMemo(()=>y.findIndex(be=>be.toastId===m.id)||0,[y,m.id]),lr=le.useMemo(()=>{var be;return(be=m.closeButton)!=null?be:A},[m.closeButton,A]),br=le.useMemo(()=>m.duration||z||Q_,[m.duration,z]),Zn=le.useRef(0),Xt=le.useRef(0),rs=le.useRef(0),Kt=le.useRef(null),[bn,qt]=B.split("-"),Fr=le.useMemo(()=>y.reduce((be,We,ft)=>ft>=xt?be:be+We.height,0),[y,xt]),sn=IF(),Fe=m.invert||h,_n=Q==="loading";Xt.current=le.useMemo(()=>xt*U+Fr,[xt,Fr]),le.useEffect(()=>{ar.current=br},[br]),le.useEffect(()=>{me(!0)},[]),le.useEffect(()=>{let be=On.current;if(be){let We=be.getBoundingClientRect().height;return rn(We),x(ft=>[{toastId:m.id,height:We,position:m.position},...ft]),()=>x(ft=>ft.filter(kn=>kn.toastId!==m.id))}},[x,m.id]),le.useLayoutEffect(()=>{if(!q)return;let be=On.current,We=be.style.height;be.style.height="auto";let ft=be.getBoundingClientRect().height;be.style.height=We,rn(ft),x(kn=>kn.find(Hn=>Hn.toastId===m.id)?kn.map(Hn=>Hn.toastId===m.id?{...Hn,height:ft}:Hn):[{toastId:m.id,height:ft,position:m.position},...kn])},[q,m.title,m.description,x,m.id]);let dt=le.useCallback(()=>{ae(!0),Ae(Xt.current),x(be=>be.filter(We=>We.toastId!==m.id)),setTimeout(()=>{C(m)},VF)},[m,C,x,Xt]);le.useEffect(()=>{if(m.promise&&Q==="loading"||m.duration===1/0||m.type==="loading")return;let be;return k||g||L&&sn?(()=>{if(rs.current<Zn.current){let We=new Date().getTime()-Zn.current;ar.current=ar.current-We}
309rs.current=new Date().getTime()})():ar.current!==1/0&&(Zn.current=new Date().getTime(),be=setTimeout(()=>{var We;(We=m.onAutoClose)==null||We.call(m,m),dt()},ar.current)),()=>clearTimeout(be)},[k,g,m,Q,L,sn,dt]),le.useEffect(()=>{m.delete&&dt()},[dt,m.delete]);function _r(){var be,We,ft;return W!=null&&W.loading?le.createElement("div",{className:xs(N==null?void 0:N.loader,(be=m==null?void 0:m.classNames)==null?void 0:be.loader,"sonner-loader"),"data-visible":Q==="loading"},W.loading):D?le.createElement("div",{className:xs(N==null?void 0:N.loader,(We=m==null?void 0:m.classNames)==null?void 0:We.loader,"sonner-loader"),"data-visible":Q==="loading"},D):le.createElement(jF,{className:xs(N==null?void 0:N.loader,(ft=m==null?void 0:m.classNames)==null?void 0:ft.loader),visible:Q==="loading"})}return le.createElement("li",{tabIndex:0,ref:On,className:xs($,je,N==null?void 0:N.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,N==null?void 0:N.default,N==null?void 0:N[Q],(n=m==null?void 0:m.classNames)==null?void 0:n[Q]),"data-sonner-toast":"","data-rich-colors":(r=m.richColors)!=null?r:E,"data-styled":!(m.jsx||m.unstyled||v),"data-mounted":q,"data-promise":!!m.promise,"data-swiped":Lt,"data-removed":oe,"data-visible":Ur,"data-y-position":bn,"data-x-position":qt,"data-index":b,"data-front":xr,"data-swiping":fe,"data-dismissible":V,"data-type":Q,"data-invert":Fe,"data-swipe-out":$e,"data-swipe-direction":Z,"data-expanded":!!(k||j&&q),style:{"--index":b,"--toasts-before":b,"--z-index":_.length-b,"--offset":`${oe?Nn:Xt.current}px`,"--initial-height":j?"auto":`${Xn}px`,...T,...m.style},onDragEnd:()=>{ge(!1),J(null),Kt.current=null},onPointerDown:be=>{_n||!V||(In.current=new Date,Ae(Xt.current),be.target.setPointerCapture(be.pointerId),be.target.tagName!=="BUTTON"&&(ge(!0),Kt.current={x:be.clientX,y:be.clientY}))},onPointerUp:()=>{var be,We,ft,kn;if($e||!V)return;Kt.current=null;let Hn=Number(((be=On.current)==null?void 0:be.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Tn=Number(((We=On.current)==null?void 0:We.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),S=new Date().getTime()-((ft=In.current)==null?void 0:ft.getTime()),on=K==="x"?Hn:Tn,it=Math.abs(on)/S;if(Math.abs(on)>=qF||it>.11){Ae(Xt.current),(kn=m.onDismiss)==null||kn.call(m,m),ce(K==="x"?Hn>0?"right":"left":Tn>0?"down":"up"),dt(),tt(!0),ut(!1);return}ge(!1),J(null)},onPointerMove:be=>{var We,ft,kn,Hn;if(!Kt.current||!V||((We=window.getSelection())==null?void 0:We.toString().length)>0)return;let Tn=be.clientY-Kt.current.y,S=be.clientX-Kt.current.x,on=(ft=e.swipeDirections)!=null?ft:YF(B);!K&&(Math.abs(S)>1||Math.abs(Tn)>1)&&J(Math.abs(S)>Math.abs(Tn)?"x":"y");let it={x:0,y:0};K==="y"?(on.includes("top")||on.includes("bottom"))&&(on.includes("top")&&Tn<0||on.includes("bottom")&&Tn>0)&&(it.y=Tn):K==="x"&&(on.includes("left")||on.includes("right"))&&(on.includes("left")&&S<0||on.includes("right")&&S>0)&&(it.x=S),(Math.abs(it.x)>0||Math.abs(it.y)>0)&&ut(!0),(kn=On.current)==null||kn.style.setProperty("--swipe-amount-x",`${it.x}px`),(Hn=On.current)==null||Hn.style.setProperty("--swipe-amount-y",`${it.y}px`)}},lr&&!m.jsx?le.createElement("button",{"aria-label":G,"data-disabled":_n,"data-close-button":!0,onClick:_n||!V?()=>{}:()=>{var be;dt(),(be=m.onDismiss)==null||be.call(m,m)},className:xs(N==null?void 0:N.closeButton,(s=m==null?void 0:m.classNames)==null?void 0:s.closeButton)},(o=W==null?void 0:W.close)!=null?o:AF):null,m.jsx||d.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:le.createElement(le.Fragment,null,Q||m.icon||m.promise?le.createElement("div",{"data-icon":"",className:xs(N==null?void 0:N.icon,(a=m==null?void 0:m.classNames)==null?void 0:a.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||_r():null,m.type!=="loading"?m.
vendor: 14,154 bytes, line 309
309icon||(W==null?void 0:W[Q])||CF(Q):null):null,le.createElement("div",{"data-content":"",className:xs(N==null?void 0:N.content,(l=m==null?void 0:m.classNames)==null?void 0:l.content)},le.createElement("div",{"data-title":"",className:xs(N==null?void 0:N.title,(c=m==null?void 0:m.classNames)==null?void 0:c.title)},typeof m.title=="function"?m.title():m.title),m.description?le.createElement("div",{"data-description":"",className:xs(H,Me,N==null?void 0:N.description,(u=m==null?void 0:m.classNames)==null?void 0:u.description)},typeof m.description=="function"?m.description():m.description):null),d.isValidElement(m.cancel)?m.cancel:m.cancel&&Ff(m.cancel)?le.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||M,onClick:be=>{var We,ft;Ff(m.cancel)&&V&&((ft=(We=m.cancel).onClick)==null||ft.call(We,be),dt())},className:xs(N==null?void 0:N.cancelButton,(f=m==null?void 0:m.classNames)==null?void 0:f.cancelButton)},m.cancel.label):null,d.isValidElement(m.action)?m.action:m.action&&Ff(m.action)?le.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||P,onClick:be=>{var We,ft;Ff(m.action)&&((ft=(We=m.action).onClick)==null||ft.call(We,be),!be.defaultPrevented&&dt())},className:xs(N==null?void 0:N.actionButton,(p=m==null?void 0:m.classNames)==null?void 0:p.actionButton)},m.action.label):null))};function X_(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function JF(e,t){let n={};return[e,t].forEach((r,s)=>{let o=s===1,a=o?"--mobile-offset":"--offset",l=o?WF:BF;function c(u){["top","right","bottom","left"].forEach(f=>{n[`${a}-${f}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${a}-${u}`]=l:n[`${a}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):c(l)}),n}var QF=d.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:o,closeButton:a,className:l,offset:c,mobileOffset:u,theme:f="light",richColors:p,duration:h,style:m,visibleToasts:v=zF,toastOptions:g,dir:x=X_(),gap:w=KF,loadingIcon:y,icons:b,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:k}=e,[C,E]=le.useState([]),A=le.useMemo(()=>Array.from(new Set([r].concat(C.filter(L=>L.position).map(L=>L.position)))),[C,r]),[T,M]=le.useState([]),[P,$]=le.useState(!1),[H,z]=le.useState(!1),[B,U]=le.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),D=le.useRef(null),j=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),N=le.useRef(null),W=le.useRef(!1),G=le.useCallback(L=>{E(K=>{var J;return(J=K.find(Z=>Z.id===L.id))!=null&&J.delete||jr.dismiss(L.id),K.filter(({id:Z})=>Z!==L.id)})},[]);return le.useEffect(()=>jr.subscribe(L=>{if(L.dismiss){E(K=>K.map(J=>J.id===L.id?{...J,delete:!0}:J));return}setTimeout(()=>{eE.flushSync(()=>{E(K=>{let J=K.findIndex(Z=>Z.id===L.id);return J!==-1?[...K.slice(0,J),{...K[J],...L},...K.slice(J+1)]:[L,...K]})})})}),[]),le.useEffect(()=>{if(f!=="system"){U(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;let L=window.matchMedia("(prefers-color-scheme: dark)");try{L.addEventListener("change",({matches:K})=>{U(K?"dark":"light")})}catch{L.addListener(({matches:J})=>{try{U(J?"dark":"light")}catch(Z){console.error(Z)}})}},[f]),le.useEffect(()=>{C.length<=1&&$(!1)},[C]),le.useEffect(()=>{let L=K=>{var J,Z;s.every(ce=>K[ce]||K.code===ce)&&($(!0),(J=D.current)==null||J.focus()),K.code==="Escape"&&(document.activeElement===D.current||(Z=D.current)!=null&&Z.contains(document.activeElement))&&$(!1)};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[s]),le.useEffect(()=>{if(D.current)return()=>{N.current&&(N.current.focus({preventScroll:!0}),N.current=null,W.current=!1)}},[D.current]),le.createElement("section",{ref:t,"aria-label":`${_} ${j}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},A.map((L,K)=>{var J;let[Z,ce]=L.split("-");return C.length?le.createElement("ol",{key:L,dir:x==="auto"?X_():x,tabIndex:-1,ref:D,className:l,"data-sonner-toaster":!0,"data-theme":B,"data-y-position":Z,"data-lifted":P&&C.length>1&&!o,"data-x-position":ce,style:{"--front-toast-height":`${((J=T[0])==null?void 0:J.height)||0}px`,"--width":`${HF}px`,"--gap":`${w}px`,...m,...JF(c,u)},onBlur:q=>{W.current&&!q.currentTarget.contains(q.relatedTarget)&&(W.current=!1,N.current&&(N.current.focus({preventScroll:!0}),N.current=null))},onFocus:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||W.current||(W.current=!0,N.current=q.relatedTarget)},onMouseEnter:()=>$(!0),onMouseMove:()=>$(!0),onMouseLeave:()=>{H||$(!1)},onDragEnd:()=>$(!1),onPointerDown:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||z(!0)},onPointerUp:()=>z(!1)},C.filter(q=>!q.position&&K===0||q.position===L).map((q,me)=>{var oe,ae;return le.createElement(GF,{key:q.id,icons:b,index:me,toast:q,defaultRichColors:p,duration:(oe=g==null?void 0:g.duration)!=null?oe:h,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:n,visibleToasts:v,closeButton:(ae=g==null?void 0:g.closeButton)!=null?ae:a,interacting:H,position:L,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:G,toasts:C.filter(fe=>fe.position==q.position),heights:T.filter(fe=>fe.position==q.position),setHeights:M,expandByDefault:o,gap:w,loadingIcon:y,expanded:P,pauseWhenPageIsHidden:k,swipeDirections:e.swipeDirections})})):null}))}),Bc=class{constructor(){this.listeners=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(){}},Ua=typeof window>"u"||"Deno"in globalThis;function hr(){}function XF(e,t){return typeof e=="function"?e(t):e}function Mv(e){return typeof e=="number"&&e>=0&&e!==1/0}function _j(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ti(e,t){return typeof e=="function"?e(t):e}function is(e,t){return typeof e=="function"?e(t):e}function Z_(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:o,queryKey:a,stale:l}=e;if(a){if(r){if(t.queryHash!==Dx(a,t.options))return!1}else if(!kd(t.queryKey,a))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||o&&!o(t))}function ek(e,t){const{exact:n,status:r,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Fa(t.options.mutationKey)!==Fa(o))return!1}else if(!kd(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function Dx(e,t){return((t==null?void 0:t.queryKeyHashFn)||Fa)(e)}function Fa(e){return JSON.stringify(e,(t,n)=>Lv(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function kd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>kd(e[n],t[n])):!1}function kj(e,t){if(e===t)return e;const n=tk(e)&&tk(t);if(n||Lv(e)&&Lv(t)){const r=n?e:Object.keys(e),s=r.length,o=n?t:Object.keys(t),a=o.length,l=n?[]:{},c=new Set(r);let u=0;for(let f=0;f<a;f++){const p=n?f:o[f];(!n&&c.has(p)||n)&&e[p]===void 0&&t[p]===void 0?(l[p]=void 0,u++):(l[p]=kj(e[p],t[p]),l[p]===e[p]&&e[p]!==void 0&&u++)}return s===a&&u===s?e:l}return t}function op(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function tk(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Lv(e){if(!nk(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!nk(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function nk(e){return Object.prototype.toString.call(e)==="[object Object]"}function ZF(e){return new Promise(t=>{setTimeout(t,e)})}function Dv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?kj(e,t):t}function e3(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function t3(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var $x=Symbol();function Sj(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===$x?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Cj(e,t){return typeof e=="function"?e(...t):!!e}var xa,ci,ac,PS,n3=(PS=class extends Bc{constructor(){super();Ce(this,xa);Ce(this,ci);Ce(this,ac);he(this,ac,t=>{if(!Ua&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){O(this,ci)||this.setEventListener(O(this,ac))}onUnsubscribe(){var t;this.hasListeners()||((t=O(this,ci))==null||t.call(this),he(this,ci,void 0))}setEventListener(t){var n;he(this,ac,t),(n=O(this,ci))==null||n.call(this),he(this,ci,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){O(this,xa)!==t&&(he(this,xa,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof O(this,xa)=="boolean"?O(this,xa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},xa=new WeakMap,ci=new WeakMap,ac=new WeakMap,PS),Ux=new n3,lc,ui,cc,RS,r3=(RS=class extends Bc{constructor(){super();Ce(this,lc,!0);Ce(this,ui);Ce(this,cc);he(this,cc,t=>{if(!Ua&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){O(this,ui)||this.setEventListener(O(this,cc))}onUnsubscribe(){var t;this.hasListeners()||((t=O(this,ui))==null||t.call(this),he(this,ui,void 0))}setEventListener(t){var n;he(this,cc,t),(n=O(this,ui))==null||n.call(this),he(this,ui,t(this.setOnline.bind(this)))}setOnline(t){O(this,lc)!==t&&(he(this,lc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return O(this,lc)}},lc=new WeakMap,ui=new WeakMap,cc=new WeakMap,RS),ip=new r3;function $v(){let e,t;const n=new Promise((s,o)=>{e=s,t=o});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}function s3(e){return Math.min(1e3*2**e,3e4)}function Ej(e){return(e??"online")==="online"?ip.isOnline():!0}var jj=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function $g(e){return e instanceof jj}function Nj(e){let t=!1,n=0,r=!1,s;const o=$v(),a=g=>{var x;r||(h(new jj(g)),(x=e.abort)==null||x.call(e))},l=()=>{t=!0},c=()=>{t=!1},u=()=>Ux.isFocused()&&(e.networkMode==="always"||ip.isOnline())&&e.canRun(),f=()=>Ej(e.networkMode)&&e.canRun(),p=g=>{var x;r||(r=!0,(x=e.onSuccess)==null||x.call(e,g),s==null||s(),o.resolve(g))},h=g=>{var x;r||(r=!0,(x=e.onError)==null||x.call(e,g),s==null||s(),o.reject(g))},m=()=>new Promise(g=>{var x;s=w=>{(r||u())&&g(w)},(x=e.onPause)==null||x.call(e)}).then(()=>{var g;s=void 0,r||(g=e.onContinue)==null||g.call(e)}),v=()=>{if(r)return;let g;const x=n===0?e.initialPromise:void 0;try{g=x??e.fn()}catch(w){g=Promise.reject(w)}Promise.resolve(g).then(p).catch(w=>{var C;if(r)return;const y=e.retry??(Ua?0:3),b=e.retryDelay??s3,_=typeof b=="function"?b(n,w):b,k=y===!0||typeof y=="number"&&n<y||typeof y=="function"&&y(n,w);if(t||!k){h(w);return}n++,(C=e.onFail)==null||C.call(e,n,w),ZF(_).then(()=>u()?void 0:m()).then(()=>{t?h(w):v()})})};return{promise:o,cancel:a,continue:()=>(s==null||s(),o),cancelRetry:l,continueRetry:c,canStart:f,start:()=>(f()?v():m().then(v),o)}}var o3=e=>setTimeout(e,0);function i3(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=o3;const o=l=>{t?e.push(l):s(()=>{n(l)})},a=()=>{const l=e;e=[],l.length&&s(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||a()}return c},batchCalls:l=>(...c)=>{o(()=>{l(...c)})},schedule:o,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}var Un=i3(),ba,AS,Tj=(AS=class{constructor(){Ce(this,ba)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Mv(this.gcTime)&&he(this,ba,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ua?1/0:5*60*1e3))}clearGcTimeout(){O(this,ba)&&(clearTimeout(O(this,ba)),he(this,ba,void 0))}},ba=new WeakMap,AS),uc,_a,os,ka,rr,Ad,Sa,Cs,vo,IS,a3=(IS=class extends Tj{constructor(t){super();Ce(this,Cs);Ce(this,uc);Ce(this,_a);Ce(this,os);Ce(this,ka);Ce(this,rr);Ce(this,Ad);Ce(this,Sa);he(this,Sa,!1),he(this,Ad,t.defaultOptions),this.setOptions(t.options),this.observers=[],he(this,ka,t.client),he(this,os,O(this,ka).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,he(this,uc,l3(this.options)),this.state=t.state??O(this,uc),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=O(this,rr))==null?void 0:t.promise}setOptions(t){this.options={...O(this,Ad),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&O(this,os).remove(this)}setData(t,n){const r=Dv(this.state.data,t,this.options);return De(this,Cs,vo).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){De(this,Cs,vo).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=O(this,rr))==null?void 0:r.promise;
vendor: 1,669 bytes, line 309
309return(s=O(this,rr))==null||s.cancel(t),n?n.then(hr).catch(hr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(O(this,uc))}isActive(){return this.observers.some(t=>is(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===$x||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ti(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!_j(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=O(this,rr))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=O(this,rr))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),O(this,os).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(O(this,rr)&&(O(this,Sa)?O(this,rr).cancel({revert:!0}):O(this,rr).cancelRetry()),this.scheduleGc()),O(this,os).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||De(this,Cs,vo).call(this,{type:"invalidate"})}
vendor: 26,148 bytes, line 309
309fetch(t,n){var u,f,p;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(O(this,rr))return O(this,rr).continueRetry(),O(this,rr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const h=this.observers.find(m=>m.options.queryFn);h&&this.setOptions(h.options)}const r=new AbortController,s=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(he(this,Sa,!0),r.signal)})},o=()=>{const h=Sj(this.options,n),v=(()=>{const g={client:O(this,ka),queryKey:this.queryKey,meta:this.meta};return s(g),g})();return he(this,Sa,!1),this.options.persister?this.options.persister(h,v,this):h(v)},l=(()=>{const h={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:O(this,ka),state:this.state,fetchFn:o};return s(h),h})();(u=this.options.behavior)==null||u.onFetch(l,this),he(this,_a,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=l.fetchOptions)==null?void 0:f.meta))&&De(this,Cs,vo).call(this,{type:"fetch",meta:(p=l.fetchOptions)==null?void 0:p.meta});const c=h=>{var m,v,g,x;$g(h)&&h.silent||De(this,Cs,vo).call(this,{type:"error",error:h}),$g(h)||((v=(m=O(this,os).config).onError)==null||v.call(m,h,this),(x=(g=O(this,os).config).onSettled)==null||x.call(g,this.state.data,h,this)),this.scheduleGc()};return he(this,rr,Nj({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,abort:r.abort.bind(r),onSuccess:h=>{var m,v,g,x;if(h===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(h)}catch(w){c(w);return}(v=(m=O(this,os).config).onSuccess)==null||v.call(m,h,this),(x=(g=O(this,os).config).onSettled)==null||x.call(g,h,this.state.error,this),this.scheduleGc()},onError:c,onFail:(h,m)=>{De(this,Cs,vo).call(this,{type:"failed",failureCount:h,error:m})},onPause:()=>{De(this,Cs,vo).call(this,{type:"pause"})},onContinue:()=>{De(this,Cs,vo).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),O(this,rr).start()}},uc=new WeakMap,_a=new WeakMap,os=new WeakMap,ka=new WeakMap,rr=new WeakMap,Ad=new WeakMap,Sa=new WeakMap,Cs=new WeakSet,vo=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Pj(r.data,this.options),fetchMeta:t.meta??null};case"success":return he(this,_a,void 0),{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return $g(s)&&s.revert&&O(this,_a)?{...O(this,_a),fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Un.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),O(this,os).notify({query:this,type:"updated",action:t})})},IS);function Pj(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ej(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function l3(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Hs,OS,c3=(OS=class extends Bc{constructor(t={}){super();Ce(this,Hs);this.config=t,he(this,Hs,new Map)}build(t,n,r){const s=n.queryKey,o=n.queryHash??Dx(s,n);let a=this.get(o);return a||(a=new a3({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(a)),a}add(t){O(this,Hs).has(t.queryHash)||(O(this,Hs).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=O(this,Hs).get(t.queryHash);n&&(t.destroy(),n===t&&O(this,Hs).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Un.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return O(this,Hs).get(t)}getAll(){return[...O(this,Hs).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Z_(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Z_(t,r)):n}notify(t){Un.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Un.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Un.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Hs=new WeakMap,OS),Ks,cr,Ca,qs,ti,MS,u3=(MS=class extends Tj{constructor(t){super();Ce(this,qs);Ce(this,Ks);Ce(this,cr);Ce(this,Ca);this.mutationId=t.mutationId,he(this,cr,t.mutationCache),he(this,Ks,[]),this.state=t.state||Rj(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){O(this,Ks).includes(t)||(O(this,Ks).push(t),this.clearGcTimeout(),O(this,cr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){he(this,Ks,O(this,Ks).filter(n=>n!==t)),this.scheduleGc(),O(this,cr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){O(this,Ks).length||(this.state.status==="pending"?this.scheduleGc():O(this,cr).remove(this))}continue(){var t;return((t=O(this,Ca))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,a,l,c,u,f,p,h,m,v,g,x,w,y,b,_,k,C,E,A;const n=()=>{De(this,qs,ti).call(this,{type:"continue"})};he(this,Ca,Nj({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(T,M)=>{De(this,qs,ti).call(this,{type:"failed",failureCount:T,error:M})},onPause:()=>{De(this,qs,ti).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>O(this,cr).canRun(this)}));const r=this.state.status==="pending",s=!O(this,Ca).canStart();try{if(r)n();else{De(this,qs,ti).call(this,{type:"pending",variables:t,isPaused:s}),await((a=(o=O(this,cr).config).onMutate)==null?void 0:a.call(o,t,this));const M=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));M!==this.state.context&&De(this,qs,ti).call(this,{type:"pending",context:M,variables:t,isPaused:s})}const T=await O(this,Ca).start();return await((f=(u=O(this,cr).config).onSuccess)==null?void 0:f.call(u,T,t,this.state.context,this)),await((h=(p=this.options).onSuccess)==null?void 0:h.call(p,T,t,this.state.context)),await((v=(m=O(this,cr).config).onSettled)==null?void 0:v.call(m,T,null,this.state.variables,this.state.context,this)),await((x=(g=this.options).onSettled)==null?void 0:x.call(g,T,null,t,this.state.context)),De(this,qs,ti).call(this,{type:"success",data:T}),T}catch(T){try{throw await((y=(w=O(this,cr).config).onError)==null?void 0:y.call(w,T,t,this.state.context,this)),await((_=(b=this.options).onError)==null?void 0:_.call(b,T,t,this.state.context)),await((C=(k=O(this,cr).config).onSettled)==null?void 0:C.call(k,void 0,T,this.state.variables,this.state.context,this)),await((A=(E=this.options).onSettled)==null?void 0:A.call(E,void 0,T,t,this.state.context)),T}finally{De(this,qs,ti).call(this,{type:"error",error:T})}}finally{O(this,cr).runNext(this)}}},Ks=new WeakMap,cr=new WeakMap,Ca=new WeakMap,qs=new WeakSet,ti=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Un.batch(()=>{O(this,Ks).forEach(r=>{r.onMutationUpdate(t)}),O(this,cr).notify({mutation:this,type:"updated",action:t})})},MS);function Rj(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ko,Es,Id,LS,d3=(LS=class extends Bc{constructor(t={}){super();Ce(this,ko);Ce(this,Es);Ce(this,Id);this.config=t,he(this,ko,new Set),he(this,Es,new Map),he(this,Id,0)}build(t,n,r){const s=new u3({mutationCache:this,mutationId:++pf(this,Id)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){O(this,ko).add(t);const n=zf(t);if(typeof n=="string"){const r=O(this,Es).get(n);r?r.push(t):O(this,Es).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(O(this,ko).delete(t)){const n=zf(t);if(typeof n=="string"){const r=O(this,Es).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&O(this,Es).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=zf(t);if(typeof n=="string"){const r=O(this,Es).get(n),s=r==null?void 0:r.find(o=>o.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=zf(t);if(typeof n=="string"){const s=(r=O(this,Es).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Un.batch(()=>{O(this,ko).forEach(t=>{this.notify({type:"removed",mutation:t})}),O(this,ko).clear(),O(this,Es).clear()})}getAll(){return Array.from(O(this,ko))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>ek(n,r))}findAll(t={}){return this.getAll().filter(n=>ek(t,n))}notify(t){Un.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Un.batch(()=>Promise.all(t.map(n=>n.continue().catch(hr))))}},ko=new WeakMap,Es=new WeakMap,Id=new WeakMap,LS);function zf(e){var t;return(t=e.options.scope)==null?void 0:t.id}function rk(e){return{onFetch:(t,n)=>{var f,p,h,m,v;const r=t.options,s=(h=(p=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:p.fetchMore)==null?void 0:h.direction,o=((m=t.state.data)==null?void 0:m.pages)||[],a=((v=t.state.data)==null?void 0:v.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let g=!1;const x=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},w=Sj(t.options,t.fetchOptions),y=async(b,_,k)=>{if(g)return Promise.reject();if(_==null&&b.pages.length)return Promise.resolve(b);const E=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:_,direction:k?"backward":"forward",meta:t.options.meta};return x(P),P})(),A=await w(E),{maxPages:T}=t.options,M=k?t3:e3;return{pages:M(b.pages,A,T),pageParams:M(b.pageParams,_,T)}};if(s&&o.length){const b=s==="backward",_=b?f3:sk,k={pages:o,pageParams:a},C=_(r,k);l=await y(k,C,b)}else{const b=e??o.length;do{const _=c===0?a[0]??r.initialPageParam:sk(r,l);if(c>0&&_==null)break;l=await y(l,_),c++}while(c<b)}return l};t.options.persister?t.fetchFn=()=>{var g,x;return(x=(g=t.options).persister)==null?void 0:x.call(g,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function sk(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function f3(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var mn,di,fi,dc,fc,hi,hc,pc,DS,h3=(DS=class{constructor(e={}){Ce(this,mn);Ce(this,di);Ce(this,fi);Ce(this,dc);Ce(this,fc);Ce(this,hi);Ce(this,hc);Ce(this,pc);he(this,mn,e.queryCache||new c3),he(this,di,e.mutationCache||new d3),he(this,fi,e.defaultOptions||{}),he(this,dc,new Map),he(this,fc,new Map),he(this,hi,0)}mount(){pf(this,hi)._++,O(this,hi)===1&&(he(this,hc,Ux.subscribe(async e=>{e&&(await this.resumePausedMutations(),O(this,mn).onFocus())})),he(this,pc,ip.subscribe(async e=>{e&&(await this.resumePausedMutations(),O(this,mn).onOnline())})))}unmount(){var e,t;pf(this,hi)._--,O(this,hi)===0&&((e=O(this,hc))==null||e.call(this),he(this,hc,void 0),(t=O(this,pc))==null||t.call(this),he(this,pc,void 0))}isFetching(e){return O(this,mn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return O(this,di).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=O(this,mn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=O(this,mn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ti(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return O(this,mn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=O(this,mn).get(r.queryHash),o=s==null?void 0:s.state.data,a=XF(t,o);if(a!==void 0)return O(this,mn).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Un.batch(()=>O(this,mn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=O(this,mn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=O(this,mn);Un.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=O(this,mn);return Un.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Un.batch(()=>O(this,mn).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(hr).catch(hr)}invalidateQueries(e,t={}){return Un.batch(()=>(O(this,mn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Un.batch(()=>O(this,mn).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(hr)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(hr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=O(this,mn).build(this,t);return n.isStaleByTime(Ti(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(hr).catch(hr)}fetchInfiniteQuery(e){return e.behavior=rk(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(hr).catch(hr)}ensureInfiniteQueryData(e){return e.behavior=rk(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ip.isOnline()?O(this,di).resumePausedMutations():Promise.resolve()}getQueryCache(){return O(this,mn)}getMutationCache(){return O(this,di)}getDefaultOptions(){return O(this,fi)}setDefaultOptions(e){he(this,fi,e)}setQueryDefaults(e,t){O(this,dc).set(Fa(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...O(this,dc).values()],n={};return t.forEach(r=>{kd(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){O(this,fc).set(Fa(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...O(this,fc).values()],n={};return t.forEach(r=>{kd(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...O(this,fi).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Dx(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===$x&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...O(this,fi).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){O(this,mn).clear(),O(this,di).clear()}},mn=new WeakMap,di=new WeakMap,fi=new WeakMap,dc=new WeakMap,fc=new WeakMap,hi=new WeakMap,hc=new WeakMap,pc=new WeakMap,DS),Cr,Ye,Od,ur,Ea,mc,pi,mi,Md,gc,yc,ja,Na,gi,vc,wt,ju,Uv,Fv,zv,Bv,Wv,Hv,Kv,Aj,$S,p3=($S=class extends Bc{constructor(t,n){super();Ce(this,wt);Ce(this,Cr);Ce(this,Ye);Ce(this,Od);Ce(this,ur);Ce(this,Ea);Ce(this,mc);Ce(this,pi);Ce(this,mi);Ce(this,Md);Ce(this,gc);Ce(this,yc);Ce(this,ja);Ce(this,Na);Ce(this,gi);Ce(this,vc,new Set);this.options=n,he(this,Cr,t),he(this,mi,null),he(this,pi,$v()),this.options.experimental_prefetchInRender||O(this,pi).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(O(this,Ye).addObserver(this),ok(O(this,Ye),this.options)?De(this,wt,ju).call(this):this.updateResult(),De(this,wt,Bv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return qv(O(this,Ye),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return qv(O(this,Ye),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,De(this,wt,Wv).call(this),De(this,wt,Hv).call(this),O(this,Ye).removeObserver(this)}setOptions(t){const n=this.options,r=O(this,Ye);if(this.options=O(this,Cr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof is(this.options.enabled,O(this,Ye))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");De(this,wt,Kv).call(this),O(this,Ye).setOptions(this.options),n._defaulted&&!op(this.options,n)&&O(this,Cr).getQueryCache().notify({type:"observerOptionsUpdated",query:O(this,Ye),observer:this});const s=this.hasListeners();s&&ik(O(this,Ye),r,this.options,n)&&De(this,wt,ju).call(this),this.updateResult(),s&&(O(this,Ye)!==r||is(this.options.enabled,O(this,Ye))!==is(n.enabled,O(this,Ye))||Ti(this.options.staleTime,O(this,Ye))!==Ti(n.staleTime,O(this,Ye)))&&De(this,wt,Uv).call(this);const o=De(this,wt,Fv).call(this);s&&(O(this,Ye)!==r||is(this.options.enabled,O(this,Ye))!==is(n.enabled,O(this,Ye))||o!==O(this,gi))&&De(this,wt,zv).call(this,o)}getOptimisticResult(t){const n=O(this,Cr).getQueryCache().build(O(this,Cr),t),r=this.createResult(n,t);return g3(this,r)&&(he(this,ur,r),he(this,mc,this.options),he(this,Ea,O(this,Ye).state)),r}getCurrentResult(){return O(this,ur)}trackResult(t,n){return new Proxy(t,{get:(r,s)=>(this.trackProp(s),n==null||n(s),Reflect.get(r,s))})}trackProp(t){O(this,vc).add(t)}getCurrentQuery(){return O(this,Ye)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=O(this,Cr).defaultQueryOptions(t),r=O(this,Cr).getQueryCache().build(O(this,Cr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return De(this,wt,ju).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),O(this,ur)))}createResult(t,n){var T;const r=O(this,Ye),s=this.options,o=O(this,ur),a=O(this,Ea),l=O(this,mc),u=t!==r?t.state:O(this,Od),{state:f}=t;let p={...f},h=!1,m;if(n._optimisticResults){const M=this.hasListeners(),P=!M&&ok(t,n),$=M&&ik(t,r,n,s);(P||$)&&(p={...p,...Pj(f.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:v,errorUpdatedAt:g,status:x}=p;m=p.data;let w=!1;if(n.placeholderData!==void 0&&m===void 0&&x==="pending"){let M;o!=null&&o.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(M=o.data,w=!0):M=typeof n.placeholderData=="function"?n.placeholderData((T=O(this,yc))==null?void 0:T.state.data,O(this,yc)):n.placeholderData,M!==void 0&&(x="success",m=Dv(o==null?void 0:o.data,M,n),h=!0)}if(n.select&&m!==void 0&&!w)if(o&&m===(a==null?void 0:a.data)&&n.select===O(this,Md))m=O(this,gc);else try{he(this,Md,n.select),m=n.select(m),m=Dv(o==null?void 0:o.data,m,n),he(this,gc,m),he(this,mi,null)}catch(M){he(this,mi,M)}O(this,mi)&&(v=O(this,mi),m=O(this,gc),g=Date.now(),x="error");const y=p.fetchStatus==="fetching",b=x==="pending",_=x==="error",k=b&&y,C=m!==void 0,A={status:x,fetchStatus:p.fetchStatus,isPending:b,isSuccess:x==="success",isError:_,isInitialLoading:k,isLoading:k,data:m,dataUpdatedAt:p.dataUpdatedAt,error:v,errorUpdatedAt:g,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>u.dataUpdateCount||p.errorUpdateCount>u.errorUpdateCount,isFetching:y,isRefetching:y&&!b,isLoadingError:_&&!C,isPaused:p.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:_&&C,isStale:Fx(t,n),refetch:this.refetch,promise:O(this,pi),isEnabled:is(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const M=H=>{A.status==="error"?H.reject(A.error):A.data!==void 0&&H.resolve(A.data)},P=()=>{const H=he(this,pi,A.promise=$v());M(H)},$=O(this,pi);switch($.status){case"pending":t.queryHash===r.queryHash&&M($);break;case"fulfilled":(A.status==="error"||A.data!==$.value)&&P();break;case"rejected":(A.status!=="error"||A.error!==$.reason)&&P();break}}return A}updateResult(){const t=O(this,ur),n=this.createResult(O(this,Ye),this.options);if(he(this,Ea,O(this,Ye).state),he(this,mc,this.options),O(this,Ea).data!==void 0&&he(this,yc,O(this,Ye)),op(n,t))return;he(this,ur,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!O(this,vc).size)return!0;const a=new Set(o??O(this,vc));return this.options.throwOnError&&a.add("error"),Object.keys(O(this,ur)).some(l=>{const c=l;return O(this,ur)[c]!==t[c]&&a.has(c)})};De(this,wt,Aj).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&De(this,wt,Bv).call(this)}},Cr=new WeakMap,Ye=new WeakMap,Od=new WeakMap,ur=new WeakMap,Ea=new WeakMap,mc=new WeakMap,pi=new WeakMap,mi=new WeakMap,Md=new WeakMap,gc=new WeakMap,yc=new WeakMap,ja=new WeakMap,Na=new WeakMap,gi=new WeakMap,vc=new WeakMap,wt=new WeakSet,ju=function(t){De(this,wt,Kv).call(this);let n=O(this,Ye).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(hr)),n},Uv=function(){De(this,wt,Wv).call(this);const t=Ti(this.options.staleTime,O(this,Ye));if(Ua||O(this,ur).isStale||!Mv(t))return;const r=_j(O(this,ur).dataUpdatedAt,t)+1;he(this,ja,setTimeout(()=>{O(this,ur).isStale||this.updateResult()},r))},Fv=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(O(this,Ye)):this.options.refetchInterval)??!1},zv=function(t){De(this,wt,Hv).call(this),he(this,gi,t),!(Ua||is(this.options.enabled,O(this,Ye))===!1||!Mv(O(this,gi))||O(this,gi)===0)&&he(this,Na,setInterval(()=>{(this.options.refetchIntervalInBackground||Ux.isFocused())&&De(this,wt,ju).call(this)},O(this,gi)))},Bv=function(){De(this,wt,Uv).call(this),De(this,wt,zv).call(this,De(this,wt,Fv).call(this))},Wv=function(){O(this,ja)&&(clearTimeout(O(this,ja)),he(this,ja,void 0))},Hv=function(){O(this,Na)&&(clearInterval(O(this,Na)),he(this,Na,void 0))},Kv=function(){const t=O(this,Cr).getQueryCache().build(O(this,Cr),this.options);if(t===O(this,Ye))return;const n=O(this,Ye);he(this,Ye,t),he(this,Od,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Aj=function(t){Un.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(O(this,ur))}),O(this,Cr).getQueryCache().notify({query:O(this,Ye),type:"observerResultsUpdated"})})},$S);function m3(e,t){return is(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function ok(e,t){return m3(e,t)||e.state.data!==void 0&&qv(e,t,t.refetchOnMount)}function qv(e,t,n){if(is(t.enabled,e)!==!1&&Ti(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Fx(e,t)}return!1}function ik(e,t,n,r){return(e!==t||is(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Fx(e,n)}function Fx(e,t){return is(t.enabled,e)!==!1&&e.isStaleByTime(Ti(t.staleTime,e))}function g3(e,t){return!op(e.getCurrentResult(),t)}var yi,vi,Er,So,To,wh,Vv,US,y3=(US=class extends Bc{constructor(n,r){super();Ce(this,To);Ce(this,yi);Ce(this,vi);Ce(this,Er);Ce(this,So);he(this,yi,n),this.setOptions(r),this.bindMethods(),De(this,To,wh).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=O(this,yi).defaultMutationOptions(n),op(this.options,r)||O(this,yi).getMutationCache().notify({type:"observerOptionsUpdated",mutation:O(this,Er),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Fa(r.mutationKey)!==Fa(this.options.mutationKey)?this.reset():((s=O(this,Er))==null?void 0:s.state.status)==="pending"&&O(this,Er).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=O(this,Er))==null||n.removeObserver(this)}onMutationUpdate(n){De(this,To,wh).call(this),De(this,To,Vv).call(this,n)}getCurrentResult(){return O(this,vi)}reset(){var n;(n=O(this,Er))==null||n.removeObserver(this),he(this,Er,void 0),De(this,To,wh).call(this),De(this,To,Vv).call(this)}mutate(n,r){var s;return he(this,So,r),(s=O(this,Er))==null||s.removeObserver(this),he(this,Er,O(this,yi).getMutationCache().build(O(this,yi),this.options)),O(this,Er).addObserver(this),O(this,Er).execute(n)}},yi=new WeakMap,vi=new WeakMap,Er=new WeakMap,So=new WeakMap,To=new WeakSet,wh=function(){var r;const n=((r=O(this,Er))==null?void 0:r.state)??Rj();he(this,vi,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Vv=function(n){Un.batch(()=>{var r,s,o,a,l,c,u,f;
309if(O(this,So)&&this.hasListeners()){const p=O(this,vi).variables,h=O(this,vi).context;(n==null?void 0:n.type)==="success"?((s=(r=O(this,So)).onSuccess)==null||s.call(r,n.data,p,h),(a=(o=O(this,So)).onSettled)==null||a.call(o,n.data,null,p,h)):(n==null?void 0:n.type)==="error"&&((c=(l=O(this,So)).onError)==null||c.call(l,n.error,p,h),(f=(u=O(this,So)).onSettled)==null||f.call(u,void 0,n.error,p,h))}this.listeners.forEach(p=>{p(O(this,vi))})})},US),Ij=d.createContext(void 0),Dr=e=>{const t=d.useContext(Ij);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},ak=({client:e,children:t})=>(d.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx(Ij.Provider,{value:e,children:t})),Oj=d.createContext(!1),v3=()=>d.useContext(Oj);Oj.Provider;function w3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var x3=d.createContext(w3()),b3=()=>d.useContext(x3),_3=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},k3=e=>{d.useEffect(()=>{e.clearReset()},[e])},S3=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||Cj(n,[e.error,r])),C3=e=>{if(e.suspense){const t=r=>r==="static"?r:Math.max(r??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...r)=>t(n(...r)):t(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},E3=(e,t)=>e.isLoading&&e.isFetching&&!t,j3=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,lk=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function N3(e,t,n){var p,h,m,v,g;const r=v3(),s=b3(),o=Dr(),a=o.defaultQueryOptions(e);(h=(p=o.getDefaultOptions().queries)==null?void 0:p._experimental_beforeQuery)==null||h.call(p,a),a._optimisticResults=r?"isRestoring":"optimistic",C3(a),_3(a,s),k3(s);const l=!o.getQueryCache().get(a.queryHash),[c]=d.useState(()=>new t(o,a)),u=c.getOptimisticResult(a),f=!r&&e.subscribed!==!1;if(d.useSyncExternalStore(d.useCallback(x=>{const w=f?c.subscribe(Un.batchCalls(x)):hr;return c.updateResult(),w},[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),d.useEffect(()=>{c.setOptions(a)},[a,c]),j3(a,u))throw lk(a,c,s);if(S3({result:u,errorResetBoundary:s,throwOnError:a.throwOnError,query:o.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw u.error;if((v=(m=o.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||v.call(m,a,u),a.experimental_prefetchInRender&&!Ua&&E3(u,r)){const x=l?lk(a,c,s):(g=o.getQueryCache().get(a.queryHash))==null?void 0:g.promise;x==null||x.catch(hr).finally(()=>{c.updateResult()})}return a.notifyOnChangeProps?u:c.trackResult(u)}function Wt(e,t){return N3(e,p3)}function Mj(e,t){const n=Dr(),[r]=d.useState(()=>new y3(n,e));d.useEffect(()=>{r.setOptions(e)},[r,e]);const s=d.useSyncExternalStore(d.useCallback(a=>r.subscribe(Un.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=d.useCallback((a,l)=>{r.mutate(a,l).catch(hr)},[r]);if(s.error&&Cj(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}function Xp(e){return e.includes("lovableproject.com")||e.includes("lovable.app")||e==="localhost"||e==="127.0.0.1"}function xn(){const e=typeof window<"u"?new URLSearchParams(window.location.search):null,t=typeof window<"u"?window.location.hostname:"",n=Xp(t);let r=(e==null?void 0:e.get("site"))||null;if(n&&typeof window<"u")try{r?window.sessionStorage.setItem("lovable_preview_site",r):r=window.sessionStorage.getItem("lovable_preview_site")}catch{}return Lj(r,t)}function pt(){const e=xn();return e.kind==="event"?e:Lj(null,"powerwalkmeets.com")}function Lj(e,t){const n={kind:"event",event_type:"reversenetwork",siteKey:"reversenetwork",title:"Reverse Network Meets",singleEventType:!0,description:"Connect online first, meet in person later",descriptionText:`Reverse Networking events can happen anywhere, from parks and co-working spaces to bars, clubs and more.
310Invite the people you've connected with online and meet them all in one place in real life.
311Skip endless coffee meetings and connect with multiple people at once.`,eventbriteSummary:"Connect online first, meet later in person",ogImage:"/reverse.png",favicon:"/reverse-net
311work-favicon.ico",canonicalUrl:"https://reversenetworkmeets.com",color:"#394b89",logo:"/reverse.png"},r={kind:"event",event_type:"powerwalk",siteKey:"powerwalk",title:"Power Walk Meets",singleEventType:!0,description:"Join or create a themed power walk",descriptionText:`A Power Walk is the easiest way to meet people in your space and get 6,000 steps in at the same time. Build real in-person connections without wasting time.
312
313Important: This is a walking and talking event where the group keeps moving. The host will not be on the phone to coordinate with latecomers. The event starts sharp. No waiting. Arrive 10 minutes early.`,eventbriteSummary:"Join or create a themed power walk",ogImage:"/powerwalk.png",favicon:"/powerwalk-favicon.png",canonicalUrl:"https://powerwalkmeets.com",color:"#16a34a",logo:"/powerwalk.png"},s={kind:"event",event_type:"hoopersmeets",siteKey:"hoopersmeets",title:"Hoopers Meets",singleEventType:!0,description:"Meet hoopers & get your reps in",descriptionText:"Stop pulling up solo. Meet hoopers who want to run, shoot, and get better, or just get reps with another hooper.",eventbriteSummary:"Meet hoopers & get your reps in",ogImage:"/hoopers.png",favicon:"/hoopers_favicon.png",canonicalUrl:"https://hoopersmeets.com",color:"#cfab56",logo:"/hoopers.png"},o={kind:"event",event_type:"foodclubmeets",siteKey:"foodclubmeets",title:"Food Club Meets",singleEventType:!0,description:"Join or create a curated food club",descriptionText:"Food Club is curated for people in your space. It's designed as a more intentional setting where you build real relationships, earn trust, and get to know people beyond surface-level conversations, while building long-term relationships.",eventbriteSummary:"Join a curated food club",ogImage:"/foodclub.png",favicon:"/foodclub_favicon.png",canonicalUrl:"https://foodclubmeets.com",color:"#080808",logo:"/foodclub.png"},a={kind:"event",event_type:"connectonlinemeets",siteKey:"connectonlinemeets",title:"Connect Online Meets",singleEventType:!0,description:"Build your circle through regular online meets",descriptionText:`Regular online meets with your customers, your community, or your circle, all in one place. Instead of wasting time on endless 15-minute calls, bring people together in a single group session and have real conversations. The goal is to make it feel as close to in-person as possible.
314
315One simple rule: camera must be on, to make it as personal as possible.`,eventbriteSummary:"Build your circle through regular online meets",ogImage:"/connectonline.png",favicon:"/connectonline_favicon.png",canonicalUrl:"https://connectonlinemeets.com",color:"#7c007c",logo:"/connectonline.png"},l={kind:"event",event_type:"inpersondates",siteKey:"inpersondates",title:"In Person Dates",singleEventType:!0,description:"no swiping. no texting. meet on a date.",descriptionText:"Go or offer real dates from the start. No long texting, no guessing, no build-up, just a real interaction right away. The date creator can select up to 5 people to join, saving time and helping them quickly see who they connect with in person. Meet face to face, see how it feels, then decide if you want to continue. It saves time and leads to more real connections, and even if it's not a match, you didn't waste your time, you went out, had a real experience, and learned what you want.",eventbriteSummary:"no swiping. no texting. meet on a date.",ogImage:"/inpersondates.png",favicon:"/inpersondates_favicon.ico",canonicalUrl:"https://www.inpersondates.com",color:"#8F3736",logo:"/inpersondates.png"},c={kind:"landing",siteKey:"staaakemeets",title:"staaake meets",description:"Create once. Publish everywhere. Just a title, date, time, location, and polls. Publish to Luma, Eventbrite, and Meetup.",descriptionText:"Create an event in under a minute. Just a title, date, time, location, and polls. Publish to Luma, Eventbrite, and Meetup.",ogImage:"https://www.staaakemeets.com/staaakemeets-og.jpg",favicon:"/staaakemeets-favicon.png",canonicalUrl:"https://www.staaakemeets.com",color:"#0a0a0a",logo:"/staaakemeets-og.png"};return e==="reversenetwork"?n:e==="powerwalk"?r:e==="hoopersmeets"?s:e==="foodclubmeets"?o:e==="connectonlinemeets"?a:e==="inpers
315ondates"?l:e==="staaakemeets"?c:t.includes("reversenetwork")?n:t.includes("powerwalkmeets")?r:t.includes("hoopersmeets")?s:t.includes("foodclubmeets")?o:t.includes("connectonlinemeets")?a:t.includes("inpersondates")?l:t.includes("staaakemeets")?c:r}const ap="staaake-local-auth-cleanup";let zx=!1;function T3(){return zx}function Dj(){zx=!0,window.dispatchEvent(new CustomEvent(ap,{detail:!0}))}function Bx(){zx=!1,window.dispatchEvent(new CustomEvent(ap,{detail:!1}))}function P3(e){const t=n=>{e(n.detail===!0)};return window.addEventListener(ap,t),()=>window.removeEventListener(ap,t)}const Sd="staaake-profile-identity",$j=e=>`staaake-profile-flags-${e??"default"}`;function R3(){try{const e=localStorage.getItem(Sd);return e?JSON.parse(e):null}catch{return null}}function A3(e){try{localStorage.setItem(Sd,JSON.stringify(e))}catch{}}function I3(e){try{const t=localStorage.getItem($j(e));return t?JSON.parse(t):null}catch{return null}}function O3(e,t){try{localStorage.setItem($j(e),JSON.stringify(t))}catch{}}function Ug(){try{localStorage.removeItem(Sd);const e=[];for(let t=0;t<localStorage.length;t++){const n=localStorage.key(t);n&&n.startsWith("staaake-profile-flags-")&&e.push(n)}e.forEach(t=>localStorage.removeItem(t))}catch{}}function Fg(){try{const e=[];for(let t=0;t<localStorage.length;t++){const n=localStorage.key(t);(n==="selected_sheet_username"||n!=null&&n.startsWith("selected_sheet_username:"))&&e.push(n)}e.forEach(t=>localStorage.removeItem(t))}catch{}}async function Uj(e){const t="errlhmcitfpyyhnwtqrs";try{const n=`https://${t}.supabase.co/functions/v1/sync-user`;console.log("[syncLocalUser] Calling:",n);const r=await fetch(n,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({event_type:pt().event_type})});if(!r.ok)return console.error("[syncLocalUser] FAILED:",r.status,await r.text().catch(()=>"")),{user_id:null,has_rsvps:!1,has_created:!1};const s=await r.json();return console.log("[syncLocalUser] SUCCESS:",JSON.stringify(s)),{user_id:s.user_id||null,has_rsvps:s.has_rsvps===!0,has_created:s.has_created===!0}}catch(n){return console.error("[syncLocalUser] ERROR:",n),{user_id:null,has_rsvps:!1,has_created:!1}}}async function M3(){var n,r;const{data:{session:e}}=await pe.auth.getSession();if(console.log("[fetchProfileData] session:",e?`yes (${(n=e.user)==null?void 0:n.email})`:"none"),!(e!=null&&e.access_token))return null;const t="https://uijpvjufahnqxxxickza.supabase.co";try{const s=`${t}/functions/v1/verify-identity`;console.log("[fetchProfileData] Calling verify-identity:",s);const[o,a]=await Promise.all([fetch(s,{method:"GET",headers:{Authorization:`Bearer ${e.access_token}`}}),Uj(e.access_token)]);if(!o.ok){if(console.error("[fetchProfileData] verify-identity FAILED:",o.status,await o.text().catch(()=>"")),o.status===401)try{const{data:f,error:p}=await pe.auth.getUser();if(f!=null&&f.user)console.warn("[fetchProfileData] session still valid — keeping it despite verify-identity 401");else{console.warn("[fetchProfileData] auth server confirms session invalid, signing out locally:",p==null?void 0:p.message);try{await pe.auth.signOut({scope:"local"})}catch{}}}catch(f){console.warn("[fetchProfileData] getUser check failed, keeping session:",f)}return null}const l=await o.json();console.log("[fetchProfileData] verify-identity OK:",JSON.stringify(l));const c={firstName:l.first_name||"",lastName:l.last_name||"",email:l.email||"",activeUsername:l.active_username||"",localUserId:a.user_id||"",profileComplete:l.profile_complete===!0,authUserId:(r=e.user)==null?void 0:r.id},u={hasRsvps:a.has_rsvps,hasCreated:a.has_created};return A3(c),O3(pt().event_type,u),{...c,...u}}catch(s){return console.error("[fetchProfileData] ERROR:",s),null}}function Fj(){const e=Dr(),[t,n]=d.useState(null),[r,s]=d.useState(!1),[o,a]=d.useState(T3),l=d.useRef(null),c=pt().event_type;d.useEffect(()=>P3(D=>{a(D),D&&(n(null),l.current=null,Ug(),Fg(),e.cancelQueries({queryKey:["staaake-profile"]}),e.cancelQueries({queryKey:["staaake-sheets"]}),e.cancelQueries({queryKey:["creator_follows"]}),e.removeQueries({queryKey:["staaake-profile"]}),e.removeQueries({queryKey:["staaake-sheets"]}),e.removeQueries({queryKey:["creator_follows"]}))}),[e]);const u=R3(),f=I3(c),p=u?{...u,hasRsvps:(f==null?void 0:f.hasRsvps)??!1,hasCreated:(f==null?void 0:f.hasCreated)??!1}:void 0;d.useEffect(()=>{let D=!1;const j=window.location.hash,W=new URLSearchParams(window.location.search).get("code"),G=j&&j.includes("access_token"),K=!(window.location.pathname.replace(/\/+$/,"")==="/auth/handoff")&&!!W||!!G;if(console.log("[AuthReady] Page load URL:",window.location.href),console.log("[AuthReady] hasAuthCallback:",K,"code:",!!W,"hashTokens:",!!G),!K)return pe.auth.getSession().then(({data:{session:oe}})=>{var ae,fe;D||(console.log("[AuthReady] No callback, immediate session:",oe?`yes (${(ae=oe.user)==null?void 0:ae.email})`:"none"),n((oe==null?void 0:oe.user)??null),l.current=((fe=oe==null?void 0:oe.user)==null?void 0:fe.id)??null,s(!0))}),()=>{D=!0};console.log("[AuthReady] Auth callback detected, waiting for session restore...");const J=()=>
315{const oe=window.location.pathname,ae=new URLSearchParams(window.location.search);ae.delete("code");const fe=ae.toString();window.history.replaceState(null,"",oe+(fe?`?${fe}`:"")),console.log("[AuthReady] URL cleaned")};let Z=!1;const ce=(oe,ae)=>{var fe,ge;Z||D||(Z=!0,console.log(`[AuthReady] Session resolved via ${oe}:`,ae?`yes (${(fe=ae.user)==null?void 0:fe.email})`:"NO SESSION"),n((ae==null?void 0:ae.user)??null),l.current=((ge=ae==null?void 0:ae.user)==null?void 0:ge.id)??null,J(),s(!0),q.unsubscribe(),clearTimeout(me))};W&&(console.log("[AuthReady] Exchanging code:",W.substring(0,10)+"..."),pe.auth.exchangeCodeForSession(W).then(({data:oe,error:ae})=>{var fe,ge;ae?console.error("[AuthReady] exchangeCodeForSession FAILED:",ae.message):console.log("[AuthReady] exchangeCodeForSession SUCCESS:",(ge=(fe=oe.session)==null?void 0:fe.user)==null?void 0:ge.email),ce("codeExchange",oe.session)}));const{data:{subscription:q}}=pe.auth.onAuthStateChange((oe,ae)=>{console.log("[AuthReady] onAuthStateChange:",oe),(oe==="SIGNED_IN"||oe==="TOKEN_REFRESHED")&&ce("onAuthStateChange",ae)});if(!W){const oe=async ae=>{var ge;const{data:{session:fe}}=await pe.auth.getSession();console.log(`[AuthReady] immediateGetSession attempt ${ae}:`,fe?`yes (${(ge=fe.user)==null?void 0:ge.email})`:"none"),fe?ce("immediateGetSession",fe):ae<3&&setTimeout(()=>oe(ae+1),500)};oe(1)}const me=setTimeout(()=>{console.log("[AuthReady] Fallback timeout — marking ready"),ce("fallback",null)},5e3);return()=>{D=!0,clearTimeout(me),q.unsubscribe()}},[]);const{data:h,isLoading:m,isFetching:v,isFetched:g,isPlaceholderData:x}=Wt({queryKey:["staaake-profile",c],queryFn:M3,staleTime:5*6e4,refetchOnWindowFocus:!1,gcTime:10*6e4,retry:2,retryDelay:D=>Math.min(1e3*2**D,4e3),placeholderData:p,enabled:r&&!!t&&!o});d.useEffect(()=>{const{data:{subscription:D}}=pe.auth.onAuthStateChange((j,N)=>{var W;if(n((N==null?void 0:N.user)??null),j==="SIGNED_IN"){const G=((W=N==null?void 0:N.user)==null?void 0:W.id)??null;G&&G!==l.current&&(l.current=G,Ug(),Fg(),e.invalidateQueries({queryKey:["staaake-profile"]}),e.invalidateQueries({queryKey:["staaake-sheets"]}))}else j==="SIGNED_OUT"&&(l.current=null,Ug(),Fg(),e.removeQueries({queryKey:["staaake-profile"]}),e.removeQueries({queryKey:["staaake-sheets"]}),e.removeQueries({queryKey:["creator_follows"]}),Bx());if(j==="TOKEN_REFRESHED"||j==="SIGNED_IN"){const G=e.getQueryData(["staaake-profile",pt().event_type]);(!G||G.profileComplete!==!0)&&e.invalidateQueries({queryKey:["staaake-profile"]})}});return()=>D.unsubscribe()},[e]);const w=d.useCallback(async()=>{try{localStorage.removeItem(Sd)}catch{}await e.refetchQueries({queryKey:["staaake-profile"]})},[e]),y=d.useCallback(async(D,j)=>{const{data:{session:N}}=await pe.auth.getSession();if(!(N!=null&&N.access_token))return!1;const W="https://uijpvjufahnqxxxickza.supabase.co";try{if((await(await fetch(`${W}/functions/v1/update-profile`,{method:"POST",headers:{Authorization:`Bearer ${N.access_token}`,"Content-Type":"application/json"},body:JSON.stringify({first_name:D,last_name:j})})).json()).ok){await Uj(N.access_token);try{localStorage.removeItem(Sd)}catch{}return await e.invalidateQueries({queryKey:["staaake-profile"]}),!0}return!1}catch{return!1}},[e]),b=!!t,_=!b||!!h&&g&&!v&&!x,k=b&&!h&&g&&!v,C=d.useRef(null),E=d.useRef(null),A=(t==null?void 0:t.id)??null;o?(C.current=null,E.current=null):(C.current!==A&&C.current!==null&&(C.current=null),E.current!==A&&E.current!==null&&(E.current=null),_&&(C.current=A),k&&(E.current=A));const T=!o&&C.current===A,M=!o&&E.current===A,P=_||T&&!!h,$=!o&&r&&(k||M&&!h),H=!o&&r&&b&&!!(u!=null&&u.authUserId)&&u.authUserId===(t==null?void 0:t.id),z=!o&&r&&(!b||P||$||H),B=b&&(h==null?void 0:h.activeUsername)||"",U=!!B&&B.trim().toLowerCase()==="staaake";return{user:t,firstName:b&&(h==null?void 0:h.firstName)||"",lastName:b&&(h==null?void 0:h.lastName)||"",email:b&&(h==null?void 0:h.email)||"",activeUsername:B,isAdmin:U,localUserId:b&&(h==null?void 0:h.localUserId)||"",profileComplete:b?(h==null?void 0:h.profileComplete)??!1:!1,hasRsvps:b?(h==null?void 0:h.hasRsvps)??!1:!1,hasCreated:b?(h==null?void 0:h.hasCreated)??!1:!1,authCleanupInProgress:o,authResolved:z,identityFastPath:H,profileFailed:$,loading:o||!r||!P||!T&&(m||v),profileFetched:!!h&&g&&!x&&r&&P,refreshProfile:w,updateProfile:y}}function L3(e){return Wt({queryKey:["staaake-sheets",e==null?void 0:e.id],queryFn:async()=>{const{data:t,error:n}=await pe.from("sheets").select("id, sheet_username").eq("owner_uid",e.id).eq("status","active");return n?(console.error("[useSheets] error:",n),[]):t??[]},enabled:!!e,staleTime:6e4})}const zj=d.createContext(null),Yv="selected_sheet_username",vu=e=>`${Yv}:${e}`,oa=e=>(e||"").trim().toLowerCase();function ck({children:e}){var y;const t=Fj(),n=Dr(),{data:r=[],isFetched:s,isFetching:o}
315=L3(t.user),a=s&&!o,[l,c]=d.useState({userId:null,username:""}),u=((y=t.user)==null?void 0:y.id)??null,f=l.userId===u?l.username:"";d.useEffect(()=>{if(!u){t.authResolved&&l.userId!==null&&c({userId:null,username:""});return}if(l.userId===u)return;let b="";try{b=localStorage.getItem(vu(u))||localStorage.getItem(Yv)||"",b&&localStorage.setItem(vu(u),b),localStorage.removeItem(Yv)}catch{}c({userId:u,username:b})},[u,t.authResolved,l.userId]),d.useEffect(()=>{var E;if(!u||l.userId!==u||!a)return;const b=r.find(A=>oa(A.sheet_username)===oa(f));if(b){if(b.sheet_username!==f){c({userId:u,username:b.sheet_username});try{localStorage.setItem(vu(u),b.sheet_username)}catch{}}return}const _=r.find(A=>oa(A.sheet_username)==="staaake"),k=r.find(A=>oa(A.sheet_username)===oa(t.activeUsername)),C=(_==null?void 0:_.sheet_username)||(k==null?void 0:k.sheet_username)||((E=r[0])==null?void 0:E.sheet_username)||t.activeUsername||"";if(C!==f){c({userId:u,username:C});try{localStorage.setItem(vu(u),C)}catch{}}},[u,t.activeUsername,l.userId,f,r,a]);const p=d.useCallback(b=>{var k;if(!u)return;const _=(k=r.find(C=>oa(C.sheet_username)===oa(b)))==null?void 0:k.sheet_username;if(_){c({userId:u,username:_});try{localStorage.setItem(vu(u),_)}catch{}}},[u,r]),h="https://errlhmcitfpyyhnwtqrs.supabase.co",m="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImVycmxobWNpdGZweXlobnd0cXJzIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzIyOTY1NDcsImV4cCI6MjA4Nzg3MjU0N30.Vg5RxV3TAd2PGJ6pwFjMYEds0EtO_yQ07EbX5B_p7WU";d.useEffect(()=>{!t.localUserId||window.location.hostname.includes("lovableproject.com")||window.location.hostname.includes("lovable.app")||n.prefetchQuery({queryKey:["creator_follows",t.localUserId],queryFn:async()=>{const{data:{session:_}}=await pe.auth.getSession();if(!(_!=null&&_.access_token))return[];const k=await fetch(`${h}/functions/v1/get-follows`,{headers:{Authorization:`Bearer ${_.access_token}`,apikey:m}});return k.ok?k.json():[]},staleTime:3e4})},[t.localUserId,n,h,m]);const v=t.user?f||t.activeUsername:"",g=b=>(b||"").trim().toLowerCase(),x=!!t.user&&(g(t.activeUsername)==="staaake"||r.some(b=>g(b.sheet_username)==="staaake")),w={...t,activeUsername:v,selectedUsername:v,isAdmin:x,setSelectedUsername:p,sheets:r,sheetsFetched:a||!t.user,authResolved:t.authResolved&&(a||!t.user||t.profileFailed||t.identityFastPath)};return i.jsx(zj.Provider,{value:w,children:e})}function Fo(){const e=d.useContext(zj);if(!e)throw new Error("useProfileContext must be used within AuthProvider");return e}function ao(){const[e,t]=d.useState(!1),[n,r]=d.useState(!1),s=d.useRef(null),o=d.useRef(!1),{user:a,firstName:l,lastName:c,email:u,activeUsername:f,localUserId:p,profileComplete:h,profileFetched:m,authCleanupInProgress:v,hasRsvps:g,hasCreated:x,loading:w,refreshProfile:y,updateProfile:b,sheetsFetched:_,isAdmin:k}=Fo(),C=h,E=m&&_&&!w;d.useEffect(()=>{if(a&&C&&s.current){const P=s.current;s.current=null,r(!1),P()}},[a,C]),d.useEffect(()=>{a&&!v&&!w&&m&&_&&!C&&!o.current&&r(!0),(!a||v)&&(r(!1),o.current=!1)},[a,v,w,m,_,C]),d.useEffect(()=>{a&&E&&C&&r(!1)},[a,E,C]);const A=d.useCallback((P,$)=>{const H=()=>{$!=null&&$.preserveQueued&&s.current||(s.current=P)};if(!a){H(),t(!0);return}if(!v){if(w){H();return}if(!C){H(),r(!0);return}P()}},[a,C,w,v]),T=d.useCallback(()=>{},[]),M=d.useCallback(async()=>{o.current=!0,r(!1),await y()},[y]);return{user:a,authOpen:e,setAuthOpen:t,showOnboarding:n,setShowOnboarding:r,guardAction:A,onAuthSuccess:T,onOnboardingSuccess:M,localUserId:p,firstName:l,lastName:c,email:u,activeUsername:f,isAdmin:k,profileComplete:h,profileFetched:m,authCleanupInProgress:v,hasRsvps:g,hasCreated:x,loading:w,refreshProfile:y,updateProfile:b}}const da=e=>e.replace(/^\d{4,6}\s+/,"").replace(/^\d{4,6}-\d{3,4}\s+/,"").replace(/\s\d{4,6}-\d{3,4}$/,"").replace(/\s\d{4,6}$/,"").replace(/\s[A-Za-z]{1,2}\d[A-Za-z\d]?\s*\d[A-Za-z]{2}$/i,"").replace(/\s[A-Za-z]\d[A-Za-z]\s*\d[A-Za-z]\d$/i,"").replace(/\s\d{4}\s?[A-Za-z]{2}$/,"").trim(),uk=new Set(["japan","jp","china","cn","south korea","korea","kr","taiwan","tw","hong kong","hk","usa","us","united states","united kingdom","uk","france","germany","spain","italy","portugal","netherlands","belgium","canada","australia","india","brazil","mexico","singapore","thailand","vietnam","indonesia","philippines","malaysia","uae","united arab emirates","switzerland","austria","sweden","norway","denmark","finland","poland","ireland","greece","turkey","israel","south africa","argentina","chile","colombia","new zealand"]),D3=e=>{const t=da(e);return/^[A-Za-z]{2}$/.test(t)};function Wx(e){if(!e)return{country:"",city:""};const t=e.split(",").map(a=>a.trim());if(t.length<2)return{country:da(t[0]||"").toLowerCase(),city:""};const n=da(t[0]).toLowerCase(),r=da(t[t.length-1]).toLowerCase();if(uk.has(n)&&!uk.has(r))return{country:n,city:da(t[1]||"").toLowerCase()};const s=da(t[t.length-1]).toLowerCase();let o=t.length-2;return o-1>=0&&D3(t[o])&&(o-=1),{country:s,city:da(t[o]).toLowerCase()}}function dk(e){return e&&e.split(/\s+/).map(t=>t&&t[0].toUpperCase()+t.slice(1)).join(" ")}function Zp(e){const t=Wx(e),n=t.city?t.city.length===2?t.city.toUpperCase():dk(t.city):"";return n||(t.country?t.country.length<=3?t.country.toUpperCase():dk(t.country):"")}function Hx(){return!(typeof window>"u")}const $3=["event_name","description","venue_name","location_name","location_lat","location_lng","place_id","location_note","capacity","custom_image_url","custom_description","custom_duration_minutes"],U3=new Set($3);function em(e,t){const n=t==null?void 0:t.overrides;if(!n||typeof n!="object")return e;const r={...e};for(const s of Object.keys(n))U3.has(s)&&(r[s]=n[s]);return r}const Bj=["Dinner Club","Lunch Club","Breakfast Club","Brunch Club"],Wj=["Online Meet","Weekly Online Meet","Bi-Weekly Online Meet","Monthly Online Meet"];function Nl(e){return e.replace(/\s*[—–-]?\s*Reverse\s*Network\s*Meet\s*$/i,"").replace(/\s*[—–-]?\s*power\s*walk\s*$/i,"").replace(/\s*[—–-]?\s*Hoopers\s*Meet\s*$/i,"").trim()}function F3(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function z3(e){if(!e)return e;const t=e.trim(),n=t.match(/^In\s+person\s*[—–-]\s*(.+?)\s*[—–-]\s*date$/i);if(n&&n[1].trim())return n[1].trim();for(const s of[...Bj,...Wj]){const o=new RegExp(`^(.+?)\\s*[—–-]\\s*${F3(s)}\\s*$`,"i"),a=t.match(o);if(a&&a[1].trim())return a[1].trim()}const r=Nl(t);return r!==t&&r?r:t}function ie(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function B3(e,t){const n=d.createContext(t),r=o=>{const{children:a,...l}=o,c=d.useMemo(()=>l,Object.values(l));return i.jsx(n.Provider,{value:c,children:a})};r.displayName=e+"Provider";function s(o){const a=d.useContext(n);if(a)return a;
vendor: 14,517 bytes, line 315
315if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,s]}function vr(e,t=[]){let n=[];function r(o,a){const l=d.createContext(a),c=n.length;n=[...n,a];const u=p=>{var w;const{scope:h,children:m,...v}=p,g=((w=h==null?void 0:h[e])==null?void 0:w[c])||l,x=d.useMemo(()=>v,Object.values(v));return i.jsx(g.Provider,{value:x,children:m})};u.displayName=o+"Provider";function f(p,h){var g;const m=((g=h==null?void 0:h[e])==null?void 0:g[c])||l,v=d.useContext(m);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[u,f]}const s=()=>{const o=n.map(a=>d.createContext(a));return function(l){const c=(l==null?void 0:l[e])||o;return d.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[r,W3(s,...t)]}function W3(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const a=r.reduce((l,{useScope:c,scopeName:u})=>{const p=c(o)[`__scope${u}`];return{...l,...p}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var jn=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{},H3=QS[" useId ".trim().toString()]||(()=>{}),K3=0;function Gn(e){const[t,n]=d.useState(H3());return jn(()=>{n(r=>r??String(K3++))},[e]),t?`radix-${t}`:""}var q3=QS[" useInsertionEffect ".trim().toString()]||jn;function ro({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,o,a]=V3({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:s;{const f=d.useRef(e!==void 0);d.useEffect(()=>{const p=f.current;p!==l&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=l},[l,r])}const u=d.useCallback(f=>{var p;if(l){const h=Y3(f)?f(e):f;h!==e&&((p=a.current)==null||p.call(a,h))}else o(f)},[l,e,o,a]);return[c,u]}function V3({defaultProp:e,onChange:t}){const[n,r]=d.useState(e),s=d.useRef(n),o=d.useRef(t);return q3(()=>{o.current=t},[t]),d.useEffect(()=>{var a;s.current!==n&&((a=o.current)==null||a.call(o,n),s.current=n)},[n,s]),[n,r,o]}function Y3(e){return typeof e=="function"}var G3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ve=G3.reduce((e,t)=>{const n=Mi(`Primitive.${t}`),r=d.forwardRef((s,o)=>{const{asChild:a,...l}=s,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...l,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Kx(e,t){e&&Bi.flushSync(()=>e.dispatchEvent(t))}function vn(e){const t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function J3(e,t=globalThis==null?void 0:globalThis.document){const n=vn(e);d.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Q3="DismissableLayer",Gv="dismissableLayer.update",X3="dismissableLayer.pointerDownOutside",Z3="dismissableLayer.focusOutside",fk,Hj=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ya=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:l,...c}=e,u=d.useContext(Hj),[f,p]=d.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=d.useState({}),v=Pe(t,E=>p(E)),g=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),w=g.indexOf(x),y=f?g.indexOf(f):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,_=y>=w,k=t5(E=>{const A=E.target,T=[...u.branches].some(M=>M.contains(A));!_||T||(s==null||s(E),a==null||a(E),E.defaultPrevented||l==null||l())},h),C=n5(E=>{const A=E.target;[...u.branches].some(M=>M.contains(A))||(o==null||o(E),a==null||a(E),E.defaultPrevented||l==null||l())},h);return J3(E=>{y===u.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&l&&(E.preventDefault(),l()))},h),d.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(fk=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),hk(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=fk)}},[f,h,n,u]),d.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),hk())},[f,u]),d.useEffect(()=>{const E=()=>m({});return document.addEventListener(Gv,E),()=>document.removeEventListener(Gv,E)},[]),i.jsx(ve.div,{...c,ref:v,style:{pointerEvents:b?_?"auto":"none":void 0,...e.style},onFocusCapture:ie(e.onFocusCapture,C.onFocusCapture),onBlurCapture:ie(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:ie(e.onPointerDownCapture,k.onPointerDownCapture)})});Ya.displayName=Q3;var e5="DismissableLayerBranch",Kj=d.forwardRef((e,t)=>{const n=d.useContext(Hj),r=d.useRef(null),s=Pe(t,r);return d.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),i.jsx(ve.div,{...e,ref:s})});Kj.displayName=e5;function t5(e,t=globalThis==null?void 0:globalThis.document){const n=vn(e),r=d.useRef(!1),s=d.useRef(()=>{});return d.useEffect(()=>{const o=l=>{if(l.target&&!r.current){let c=function(){qj(X3,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function n5(e,t=globalThis==null?void 0:globalThis.document){const n=vn(e),r=d.useRef(!1);return d.useEffect(()=>{const s=o=>{o.target&&!r.current&&qj(Z3,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function hk(){const e=new CustomEvent(Gv);document.dispatchEvent(e)}function qj(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?Kx(s,o):s.dispatchEvent(o)}var r5=Ya,s5=Kj,zg="focusScope.autoFocusOnMount",Bg="focusScope.autoFocusOnUnmount",pk={bubbles:!1,cancelable:!0},o5="FocusScope",Vd=d.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...a}=e,[l,c]=d.useState(null),u=vn(s),f=vn(o),p=d.useRef(null),h=Pe(t,g=>c(g)),m=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let g=function(b){if(m.paused||!l)return;const _=b.target;l.contains(_)?p.current=_:ni(p.current,{select:!0})},x=function(b){if(m.paused||!l)return;const _=b.relatedTarget;_!==null&&(l.contains(_)||ni(p.current,{select:!0}))},w=function(b){if(document.activeElement===document.body)for(const k of b)k.removedNodes.length>0&&ni(l)};document.addEventListener("focusin",g),document.addEventListener("focusout",x);const y=new MutationObserver(w);return l&&y.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",x),y.disconnect()}}},[r,l,m.paused]),d.useEffect(()=>{if(l){gk.add(m);const g=document.activeElement;if(!l.contains(g)){const w=new CustomEvent(zg,pk);l.addEventListener(zg,u),l.dispatchEvent(w),w.defaultPrevented||(i5(d5(Vj(l)),{select:!0}),document.activeElement===g&&ni(l))}return()=>{l.removeEventListener(zg,u),setTimeout(()=>{const w=new CustomEvent(Bg,pk);l.addEventListener(Bg,f),l.dispatchEvent(w),w.defaultPrevented||ni(g??document.body,{select:!0}),l.removeEventListener(Bg,f),gk.remove(m)},0)}}},[l,u,f,m]);const v=d.useCallback(g=>{if(!n&&!r||m.paused)return;const x=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,w=document.activeElement;if(x&&w){const y=g.currentTarget,[b,_]=a5(y);b&&_?!g.shiftKey&&w===_?(g.preventDefault(),n&&ni(b,{select:!0})):g.shiftKey&&w===b&&(g.preventDefault(),n&&ni(_,{select:!0})):w===y&&g.preventDefault()}},[n,r,m.paused]);return i.jsx(ve.div,{tabIndex:-1,...a,ref:h,onKeyDown:v})});Vd.displayName=o5;function i5(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ni(r,{select:t}),document.activeElement!==n)return}function a5(e){const t=Vj(e),n=mk(t,e),r=mk(t.reverse(),e);return[n,r]}function Vj(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function mk(e,t){for(const n of e)if(!l5(n,{upTo:t}))return n}function l5(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function c5(e){return e instanceof HTMLInputElement&&"select"in e}function ni(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&c5(e)&&t&&e.select()}}var gk=u5();function u5(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=yk(e,t),e.unshift(t)},remove(t){var n;e=yk(e,t),(n=e[0])==null||n.resume()}}}function yk(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function d5(e){return e.filter(t=>t.tagName!=="A")}var f5="Portal",Wc=d.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[s,o]=d.useState(!1);jn(()=>o(!0),[]);const a=n||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return a?eE.createPortal(i.jsx(ve.div,{...r,ref:t}),a):null});Wc.displayName=f5;function h5(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var Qn=e=>{const{present:t,children:n}=e,r=p5(t),s=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),o=Pe(r.ref,m5(s));return typeof n=="function"||r.isPresent?d.cloneElement(s,{ref:o}):null};Qn.displayName="Presence";function p5(e){const[t,n]=d.useState(),r=d.useRef(null),s=d.useRef(e),o=d.useRef("none"),a=e?"mounted":"unmounted",[l,c]=h5(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const u=Bf(r.current);o.current=l==="mounted"?u:"none"},[l]),jn(()=>{const u=r.current,f=s.current;if(f!==e){const h=o.current,m=Bf(u);e?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(f&&h!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),jn(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,p=m=>{const g=Bf(r.current).includes(m.animationName);if(m.target===t&&g&&(c("ANIMATION_END"),!s.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},h=m=>{m.target===t&&(o.current=Bf(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:d.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Bf(e){return(e==null?void 0:e.animationName)||"none"}function m5(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Wg=0;function tm(){d.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??vk()),document.body.insertAdjacentElement("beforeend",e[1]??vk()),Wg++,()=>{Wg===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Wg--}},[])}function vk(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var xh="right-scroll-bar-position",bh="width-before-scroll-bar",g5="with-scroll-bars-hidden",y5="--removed-body-scroll-bar-size";function Hg(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function v5(e,t){var n=d.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var w5=typeof window<"u"?d.useLayoutEffect:d.useEffect,wk=new WeakMap;function x5(e,t){var n=v5(null,function(r){return e.forEach(function(s){return Hg(s,r)})});return w5(function(){var r=wk.get(n);if(r){var s=new Set(r),o=new Set(e),a=n.current;s.forEach(function(l){o.has(l)||Hg(l,null)}),o.forEach(function(l){s.has(l)||Hg(l,a)})}wk.set(n,e)},[e]),n}function b5(e){return e}function _5(e,t){t===void 0&&(t=b5);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(l){return l!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(l){return o(l)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var l=n;n=[],l.forEach(o),a=n}var c=function(){var f=a;a=[],f.forEach(o)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(f){a.push(f),u()},filter:function(f){return a=a.filter(f),n}}}};return s}function k5(e){e===void 0&&(e={});var t=_5(null);return t.options=Ys({async:!0,ssr:!1},e),t}var Yj=function(e){var t=e.sideCar,n=Fc(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return d.createElement(r,Ys({},n))};
vendor: 4,936 bytes, lines 315-352
315Yj.isSideCarExport=!0;function S5(e,t){return e.useMedium(t),Yj}var Gj=k5(),Kg=function(){},nm=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:Kg,onWheelCapture:Kg,onTouchMoveCapture:Kg}),s=r[0],o=r[1],a=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,f=e.enabled,p=e.shards,h=e.sideCar,m=e.noRelative,v=e.noIsolation,g=e.inert,x=e.allowPinchZoom,w=e.as,y=w===void 0?"div":w,b=e.gapMode,_=Fc(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=h,C=x5([n,t]),E=Ys(Ys({},_),s);return d.createElement(d.Fragment,null,f&&d.createElement(k,{sideCar:Gj,removeScrollBar:u,shards:p,noRelative:m,noIsolation:v,inert:g,setCallbacks:o,allowPinchZoom:!!x,lockRef:n,gapMode:b}),a?d.cloneElement(d.Children.only(l),Ys(Ys({},E),{ref:C})):d.createElement(y,Ys({},E,{className:c,ref:C}),l))});nm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};nm.classNames={fullWidth:bh,zeroRight:xh};var C5=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function E5(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=C5();return t&&e.setAttribute("nonce",t),e}function j5(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function N5(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var T5=function(){var e=0,t=null;return{add:function(n){e==0&&(t=E5())&&(j5(t,n),N5(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},P5=function(){var e=T5();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Jj=function(){var e=P5(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},R5={left:0,top:0,right:0,gap:0},qg=function(e){return parseInt(e||"",10)||0},A5=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[qg(n),qg(r),qg(s)]},I5=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return R5;var t=A5(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},O5=Jj(),rc="data-scroll-locked",M5=function(e,t,n,r){var s=e.left,o=e.top,a=e.right,l=e.gap;return n===void 0&&(n="margin"),`
316  .`.concat(g5,` {
317   overflow: hidden `).concat(r,`;
318   padding-right: `).concat(l,"px ").concat(r,`;
319  }
320  body[`).concat(rc,`] {
321    overflow: hidden `).concat(r,`;
322    overscroll-behavior: contain;
323    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
324    padding-left: `.concat(s,`px;
325    padding-top: `).concat(o,`px;
326    padding-right: `).concat(a,`px;
327    margin-left:0;
328    margin-top:0;
329    margin-right: `).concat(l,"px ").concat(r,`;
330    `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
331  }
332  
333  .`).concat(xh,` {
334    right: `).concat(l,"px ").concat(r,`;
335  }
336  
337  .`).concat(bh,` {
338    margin-right: `).concat(l,"px ").concat(r,`;
339  }
340  
341  .`).concat(xh," .").concat(xh,` {
342    right: 0 `).concat(r,`;
343  }
344  
345  .`).concat(bh," .").concat(bh,` {
346    margin-right: 0 `).concat(r,`;
347  }
348  
349  body[`).concat(rc,`] {
350    `).concat(y5,": ").concat(l,`px;
351  }
352`)},xk=function(){var e=parseInt(document.body.getAttribute(rc)||"0",10);return isFinite(e)?e:0},L5=function(){d.useEffect(function(){return document.body.setAttribute(rc,(xk()+1).toString()),function(){var e=xk()-1;e<=0?document.body.removeAttribute(rc):document.body.setAttribute(rc,e.toString())}},[])},D5=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;L5();var o=d.useMemo(function(){return I5(s)},[s]);return d.createElement(O5,{styles:M5(o,!t,s,n?"":"!important")})},Jv=!1;if(typeof window<"u")try{var Wf=Object.defineProperty({},"passive",{get:function(){return Jv=!0,!0}});window.addEventListener("test",Wf,Wf),window.removeEventListener("test",Wf,Wf)}catch{Jv=!1}var vl=Jv?{passive:!1}:!1,$5=function(e){return e.tagName==="TEXTAREA"},Qj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!$5(e)&&n[t]==="visible")},U5=function(e){return Qj(e,"overflowY")},F5=function(e){return Qj(e,"overflowX")},bk=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=Xj(e,r);if(s){var o=Zj(e,r),a=o[1],l=o[2];if(a>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},z5=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},B5=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Xj=function(e,t){return e==="v"?U5(t):F5(t)},Zj=function(e,t){return e==="v"?z5(t):B5(t)},W5=function(e,t){return e==="h"&&t==="rtl"?-1:1}
vendor: 4,364 bytes, lines 352-355
352,H5=function(e,t,n,r,s){var o=W5(e,window.getComputedStyle(t).direction),a=o*r,l=n.target,c=t.contains(l),u=!1,f=a>0,p=0,h=0;do{if(!l)break;var m=Zj(e,l),v=m[0],g=m[1],x=m[2],w=g-x-o*v;(v||w)&&Xj(e,l)&&(p+=w,h+=v);var y=l.parentNode;l=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(f&&(Math.abs(p)<1||!s)||!f&&(Math.abs(h)<1||!s))&&(u=!0),u},Hf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},_k=function(e){return[e.deltaX,e.deltaY]},kk=function(e){return e&&"current"in e?e.current:e},K5=function(e,t){return e[0]===t[0]&&e[1]===t[1]},q5=function(e){return`
353  .block-interactivity-`.concat(e,` {pointer-events: none;}
354  .allow-interactivity-`).concat(e,` {pointer-events: all;}
355`)},V5=0,wl=[];function Y5(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),s=d.useState(V5++)[0],o=d.useState(Jj)[0],a=d.useRef(e);d.useEffect(function(){a.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var g=Y$([e.lockRef.current],(e.shards||[]).map(kk),!0).filter(Boolean);return g.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),g.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=d.useCallback(function(g,x){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!a.current.allowPinchZoom;var w=Hf(g),y=n.current,b="deltaX"in g?g.deltaX:y[0]-w[0],_="deltaY"in g?g.deltaY:y[1]-w[1],k,C=g.target,E=Math.abs(b)>Math.abs(_)?"h":"v";if("touches"in g&&E==="h"&&C.type==="range")return!1;var A=bk(E,C);if(!A)return!0;if(A?k=E:(k=E==="v"?"h":"v",A=bk(E,C)),!A)return!1;if(!r.current&&"changedTouches"in g&&(b||_)&&(r.current=k),!k)return!0;var T=r.current||k;return H5(T,x,g,T==="h"?b:_,!0)},[]),c=d.useCallback(function(g){var x=g;if(!(!wl.length||wl[wl.length-1]!==o)){var w="deltaY"in x?_k(x):Hf(x),y=t.current.filter(function(k){return k.name===x.type&&(k.target===x.target||x.target===k.shadowParent)&&K5(k.delta,w)})[0];if(y&&y.should){x.cancelable&&x.preventDefault();return}if(!y){var b=(a.current.shards||[]).map(kk).filter(Boolean).filter(function(k){return k.contains(x.target)}),_=b.length>0?l(x,b[0]):!a.current.noIsolation;_&&x.cancelable&&x.preventDefault()}}},[]),u=d.useCallback(function(g,x,w,y){var b={name:g,delta:x,target:w,should:y,shadowParent:G5(w)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(_){return _!==b})},1)},[]),f=d.useCallback(function(g){n.current=Hf(g),r.current=void 0},[]),p=d.useCallback(function(g){u(g.type,_k(g),g.target,l(g,e.lockRef.current))},[]),h=d.useCallback(function(g){u(g.type,Hf(g),g.target,l(g,e.lockRef.current))},[]);d.useEffect(function(){return wl.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",c,vl),document.addEventListener("touchmove",c,vl),document.addEventListener("touchstart",f,vl),function(){wl=wl.filter(function(g){return g!==o}),document.removeEventListener("wheel",c,vl),document.removeEventListener("touchmove",c,vl),document.removeEventListener("touchstart",f,vl)}},[]);var m=e.removeScrollBar,v=e.inert;return d.createElement(d.Fragment,null,v?d.createElement(o,{styles:q5(s)}):null,m?d.createElement(D5,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function G5(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const J5=S5(Gj,Y5);var Yd=d.forwardRef(function(e,t){return d.createElement(nm,Ys({},e,{ref:t,sideCar:J5}))});Yd.classNames=nm.classNames;var Q5=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},xl=new WeakMap,Kf=new WeakMap,qf={},Vg=0,eN=function(e){return e&&(e.host||eN(e.parentNode))},X5=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=eN(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Z5=function(e,t,n,r){var s=X5(t,Array.isArray(e)?e:[e]);qf[n]||(qf[n]=new WeakMap);var o=qf[n],a=[],l=new Set,c=new Set(s),u=function(p){!p||l.has(p)||(l.add(p),u(p.parentNode))};
vendor: 6,974 bytes, lines 355-359
355s.forEach(u);var f=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(h){if(l.has(h))f(h);else try{var m=h.getAttribute(r),v=m!==null&&m!=="false",g=(xl.get(h)||0)+1,x=(o.get(h)||0)+1;xl.set(h,g),o.set(h,x),a.push(h),g===1&&v&&Kf.set(h,!0),x===1&&h.setAttribute(n,"true"),v||h.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",h,w)}})};return f(t),l.clear(),Vg++,function(){a.forEach(function(p){var h=xl.get(p)-1,m=o.get(p)-1;xl.set(p,h),o.set(p,m),h||(Kf.has(p)||p.removeAttribute(r),Kf.delete(p)),m||p.removeAttribute(n)}),Vg--,Vg||(xl=new WeakMap,xl=new WeakMap,Kf=new WeakMap,qf={})}},rm=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=Q5(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),Z5(r,s,n,"aria-hidden")):function(){return null}},sm="Dialog",[tN,nN]=vr(sm),[ez,Us]=tN(sm),rN=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,l=d.useRef(null),c=d.useRef(null),[u,f]=ro({prop:r,defaultProp:s??!1,onChange:o,caller:sm});return i.jsx(ez,{scope:t,triggerRef:l,contentRef:c,contentId:Gn(),titleId:Gn(),descriptionId:Gn(),open:u,onOpenChange:f,onOpenToggle:d.useCallback(()=>f(p=>!p),[f]),modal:a,children:n})};rN.displayName=sm;var sN="DialogTrigger",oN=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Us(sN,n),o=Pe(t,s.triggerRef);return i.jsx(ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Yx(s.open),...r,ref:o,onClick:ie(e.onClick,s.onOpenToggle)})});oN.displayName=sN;var qx="DialogPortal",[tz,iN]=tN(qx,{forceMount:void 0}),aN=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=Us(qx,t);return i.jsx(tz,{scope:t,forceMount:n,children:d.Children.map(r,a=>i.jsx(Qn,{present:n||o.open,children:i.jsx(Wc,{asChild:!0,container:s,children:a})}))})};aN.displayName=qx;var lp="DialogOverlay",lN=d.forwardRef((e,t)=>{const n=iN(lp,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Us(lp,e.__scopeDialog);return o.modal?i.jsx(Qn,{present:r||o.open,children:i.jsx(rz,{...s,ref:t})}):null});lN.displayName=lp;var nz=Mi("DialogOverlay.RemoveScroll"),rz=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Us(lp,n);return i.jsx(Yd,{as:nz,allowPinchZoom:!0,shards:[s.contentRef],children:i.jsx(ve.div,{"data-state":Yx(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),za="DialogContent",cN=d.forwardRef((e,t)=>{const n=iN(za,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Us(za,e.__scopeDialog);return i.jsx(Qn,{present:r||o.open,children:o.modal?i.jsx(sz,{...s,ref:t}):i.jsx(oz,{...s,ref:t})})});cN.displayName=za;var sz=d.forwardRef((e,t)=>{const n=Us(za,e.__scopeDialog),r=d.useRef(null),s=Pe(t,n.contentRef,r);return d.useEffect(()=>{const o=r.current;if(o)return rm(o)},[]),i.jsx(uN,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ie(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:ie(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0;(a.button===2||l)&&o.preventDefault()}),onFocusOutside:ie(e.onFocusOutside,o=>o.preventDefault())})}),oz=d.forwardRef((e,t)=>{const n=Us(za,e.__scopeDialog),r=d.useRef(!1),s=d.useRef(!1);return i.jsx(uN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,l;(a=e.onCloseAutoFocus)==null||a.call(e,o),o.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),uN=d.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...a}=e,l=Us(za,n),c=d.useRef(null),u=Pe(t,c);return tm(),i.jsxs(i.Fragment,{children:[i.jsx(Vd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:i.jsx(Ya,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Yx(l.open),...a,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(az,{titleId:l.titleId}),i.jsx(cz,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Vx="DialogTitle",dN=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Us(Vx,n);return i.jsx(ve.h2,{id:s.titleId,...r,ref:t})});dN.displayName=Vx;var fN="DialogDescription",hN=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Us(fN,n);return i.jsx(ve.p,{id:s.descriptionId,...r,ref:t})});hN.displayName=fN;var pN="DialogClose",mN=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Us(pN,n);return i.jsx(ve.button,{type:"button",...r,ref:t,onClick:ie(e.onClick,()=>s.onOpenChange(!1))})});mN.displayName=pN;function Yx(e){return e?"open":"closed"}var gN="DialogTitleWarning",[iz,yN]=B3(gN,{contentName:za,titleName:Vx,docsSlug:"dialog"}),az=({titleId:e})=>{const t=yN(gN),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
356
357If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
358
359For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return d.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},lz="DialogDescriptionWarning",cz=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${yN(lz).contentName}}.`;return d.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Gx=rN,uz=oN,Jx=aN,om=lN,im=cN,Qx=dN,Xx=hN,am=mN;const ot=Gx,dz=Jx,Sk=am,vN=d.forwardRef(({className:e,...t},n)=>i.jsx(om,{ref:n,className:X("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));vN.displayName=om.displayName;const et=d.forwardRef(({className:e,children:t,overlayClassName:n,...r},s)=>i.jsxs(dz,{children:[i.jsx(vN,{className:n}),i.jsxs(im,{ref:s,className:X("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,i.jsxs(am,{className:"absolute right-4 top-4 roun
359ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[i.jsx($c,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));et.displayName=im.displayName;const Tt=({className:e,...t})=>i.jsx("div",{className:X("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Tt.displayName="DialogHeader";const so=({className:e,...t})=>i.jsx("div",{className:X("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});so.displayName="DialogFooter";const vt=d.forwardRef(({className:e,...t},n)=>i.jsx(Qx,{ref:n,className:X("text-lg font-semibold leading-none tracking-tight",e),...t}));vt.displayName=Qx.displayName;const Ps=d.forwardRef(({className:e,...t},n)=>i.jsx(Xx,{ref:n,className:X("text-sm text-muted-foreground",e),...t}));Ps.displayName=Xx.displayName;const Zx=d.forwardRef(({className:e,...t},n)=>i.jsx("textarea",{className:X("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
359ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Zx.displayName="Textarea";function Qv(e,[t,n]){return Math.min(n,Math.max(t,e))}function lm(e){const t=e+"CollectionProvider",[n,r]=vr(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=g=>{const{scope:x,children:w}=g,y=le.useRef(null),b=le.useRef(new Map).current;return i.jsx(s,{scope:x,itemMap:b,collectionRef:y,children:w})};a.displayName=t;const l=e+"CollectionSlot",c=Mi(l),u=le.forwardRef((g,x)=>{const{scope:w,children:y}=g,b=o(l,w),_=Pe(x,b.collectionRef);return i.jsx(c,{ref:_,children:y})});u.displayName=l;const f=e+"CollectionItemSlot",p="data-radix-collection-item",h=Mi(f),m=le.forwardRef((g,x)=>{const{scope:w,children:y,...b}=g,_=le.useRef(null),k=Pe(x,_),C=o(f,w);return le.useEffect(()=>(C.itemMap.set(_,{ref:_,...b}),()=>void C.itemMap.delete(_))),i.jsx(h,{[p]:"",ref:k,children:y})});m.displayName=f;function v(g){const x=o(e+"CollectionConsumer",g);return le.useCallback(()=>{const y=x.collectionRef.current;if(!y)return[];const b=Array.from(y.querySelectorAll(`[${p}]`));return Array.from(x.itemMap.values()).sort((C,E)=>b.indexOf(C.ref.current)-b.indexOf(E.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:a,Slot:u,ItemSlot:m},v,r]}var fz=d.createContext(void 0);function cm(e){const t=d.useContext(fz);return e||t||"ltr"}const hz=["top","right","bottom","left"],Li=Math.min,Yr=Math.max,cp=Math.round,Vf=Math.floor,Zs=e=>({x:e,y:e}),pz={left:"right",right:"left",bottom:"top",top:"bottom"},mz={start:"end",end:"start"};function Xv(e,t,n){return Yr(e,Li(t,n))}function Lo(e,t){return typeof e=="function"?e(t):e}function Do(e){return e.split("-")[0]}function Hc(e){return e.split("-")[1]}function eb(e){return e==="x"?"y":"x"}function tb(e){return e==="y"?"height":"width"}const gz=new Set(["top","bottom"]);function Js(e){return gz.has(Do(e))?"y":"x"}function nb(e){return eb(Js(e))}function yz(e,t,n){n===void 0&&(n=!1);const r=Hc(e),s=nb(e),o=tb(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=up(a)),[a,up(a)]}function vz(e){const t=up(e);return[Zv(e),t,Zv(t)]}function Zv(e){return e.replace(/start|end/g,t=>mz[t])}const Ck=["left","right"],Ek=["right","left"],wz=["top","bottom"],xz=["bottom","top"];function bz(e,t,n){switch(e){case"top":case"bottom":return n?t?Ek:Ck:t?Ck:Ek;case"left":case"right":return t?wz:xz;default:return[]}}function _z(e,t,n,r){const s=Hc(e);let o=bz(Do(e),n==="start",r);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(Zv)))),o}function up(e){return e.replace(/left|right|bottom|top/g,t=>pz[t])}function kz(e){return{top:0,right:0,bottom:0,left:0,...e}}function wN(e){return typeof e!="number"?kz(e):{top:e,right:e,bottom:e,left:e}}function dp(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function jk(e,t,n){let{reference:r,floating:s}=e;const o=Js(t),a=nb(t),l=tb(a),c=Do(t),u=o==="y",f=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,h=r[l]/2-s[l]/2;let m;switch(c){case"top":m={x:f,y:r.y-s.height};break;case"bottom":m={x:f,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:p};break;case"left":m={x:r.x-s.width,y:p};break;default:m={x:r.x,y:r.y}}switch(Hc(t)){case"start":m[a]-=h*(n&&u?-1:1);break;case"end":m[a]+=h*(n&&u?-1:1);break}return m}const Sz=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:a}=n,l=o.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:f,y:p}=jk(u,r,c),h=r,m={},v=0;for(let g=0;g<l.length;g++){const{name:x,fn:w}=l[g],{x:y,y:b,data:_,reset:k}=await w({x:f,y:p,initialPlacement:r,placement:h,strategy:s,middlewareData:m,rects:u,platform:a,elements:{reference:e,floating:t}});f=y??f,p=b??p,m={...m,[x]:{...m[x],..._}},k&&v<=50&&(v++,typeof k=="object"&&(k.placement&&(h=k.placement),k.rects&&(u=k.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):k.rects),{x:f,y:p}=jk(u,h,c)),g=-1)}return{x:f,y:p,placement:h,strategy:s,middlewareData:m}};async function Cd(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:o,rects:a,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:h=!1,padding:m=0}=Lo(t,e),v=wN(m),x=l[h?p==="floating"?"reference":"floating":p],w=dp(await o.getClippingRect
vendor: 9,439 bytes, line 359
359({element:(n=await(o.isElement==null?void 0:o.isElement(x)))==null||n?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:u,rootBoundary:f,strategy:c})),y=p==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,b=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),_=await(o.isElement==null?void 0:o.isElement(b))?await(o.getScale==null?void 0:o.getScale(b))||{x:1,y:1}:{x:1,y:1},k=dp(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:b,strategy:c}):y);return{top:(w.top-k.top+v.top)/_.y,bottom:(k.bottom-w.bottom+v.bottom)/_.y,left:(w.left-k.left+v.left)/_.x,right:(k.right-w.right+v.right)/_.x}}const Cz=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:o,platform:a,elements:l,middlewareData:c}=t,{element:u,padding:f=0}=Lo(e,t)||{};if(u==null)return{};const p=wN(f),h={x:n,y:r},m=nb(s),v=tb(m),g=await a.getDimensions(u),x=m==="y",w=x?"top":"left",y=x?"bottom":"right",b=x?"clientHeight":"clientWidth",_=o.reference[v]+o.reference[m]-h[m]-o.floating[v],k=h[m]-o.reference[m],C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let E=C?C[b]:0;(!E||!await(a.isElement==null?void 0:a.isElement(C)))&&(E=l.floating[b]||o.floating[v]);const A=_/2-k/2,T=E/2-g[v]/2-1,M=Li(p[w],T),P=Li(p[y],T),$=M,H=E-g[v]-P,z=E/2-g[v]/2+A,B=Xv($,z,H),U=!c.arrow&&Hc(s)!=null&&z!==B&&o.reference[v]/2-(z<$?M:P)-g[v]/2<0,D=U?z<$?z-$:z-H:0;return{[m]:h[m]+D,data:{[m]:B,centerOffset:z-B-D,...U&&{alignmentOffset:D}},reset:U}}}),Ez=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:o,rects:a,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:g=!0,...x}=Lo(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const w=Do(s),y=Js(l),b=Do(l)===l,_=await(c.isRTL==null?void 0:c.isRTL(u.floating)),k=h||(b||!g?[up(l)]:vz(l)),C=v!=="none";!h&&C&&k.push(..._z(l,g,v,_));const E=[l,...k],A=await Cd(t,x),T=[];let M=((r=o.flip)==null?void 0:r.overflows)||[];if(f&&T.push(A[w]),p){const z=yz(s,a,_);T.push(A[z[0]],A[z[1]])}if(M=[...M,{placement:s,overflows:T}],!T.every(z=>z<=0)){var P,$;const z=(((P=o.flip)==null?void 0:P.index)||0)+1,B=E[z];if(B&&(!(p==="alignment"?y!==Js(B):!1)||M.every(j=>j.overflows[0]>0&&Js(j.placement)===y)))return{data:{index:z,overflows:M},reset:{placement:B}};let U=($=M.filter(D=>D.overflows[0]<=0).sort((D,j)=>D.overflows[1]-j.overflows[1])[0])==null?void 0:$.placement;if(!U)switch(m){case"bestFit":{var H;const D=(H=M.filter(j=>{if(C){const N=Js(j.placement);return N===y||N==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(N=>N>0).reduce((N,W)=>N+W,0)]).sort((j,N)=>j[1]-N[1])[0])==null?void 0:H[0];D&&(U=D);break}case"initialPlacement":U=l;break}if(s!==U)return{reset:{placement:U}}}return{}}}};function Nk(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Tk(e){return hz.some(t=>e[t]>=0)}const jz=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=Lo(e,t);switch(r){case"referenceHidden":{const o=await Cd(t,{...s,elementContext:"reference"}),a=Nk(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Tk(a)}}}case"escaped":{const o=await Cd(t,{...s,altBoundary:!0}),a=Nk(o,n.floating);return{data:{escapedOffsets:a,escaped:Tk(a)}}}default:return{}}}}},xN=new Set(["left","top"]);async function Nz(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=Do(n),l=Hc(n),c=Js(n)==="y",u=xN.has(a)?-1:1,f=o&&c?-1:1,p=Lo(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:v}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof v=="number"&&(m=l==="end"?v*-1:v),c?{x:m*f,y:h*u}:{x:h*u,y:m*f}}const Tz=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:a,middlewareData:l}=t,c=await Nz(t,e);return a===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:o+c.y,data:{...c,placement:a}}}}},Pz=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:x=>{let{x:w,y}=x;return{x:w,y}}},...c}=Lo(e,t),u={x:n,y:r},f=await Cd(t,c),p=Js(Do(s)),h=eb(p);let m=u[h],v=u[p];if(o){const x=h==="y"?"top":"left",w=h==="y"?"bottom":"right",y=m+f[x],b=m-f[w];m=Xv(y,m,b)}if(a){const x=p==="y"?"top":"left",w=p==="y"?"bottom":"right",y=v+f[x],b=v-f[w];v=Xv(y,v,b)}const g=l.fn({...t,[h]:m,[p]:v});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[h]:o,[p]:a}}}}}},Rz=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:o,middlewareData:a}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=Lo(e,t),f={x:n,y:r},p=Js(s),h=eb(p);let m=f[h],v=f[p];const g=Lo(l,t),x=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const b=h==="y"?"height":"width",_=o.reference[h]-o.floating[b]+x.mainAxis,k=o.reference[h]+o.reference[b]-x.mainAxis;m<_?m=_:m>k&&(m=k)}if(u){var w,y;const b=h==="y"?"width":"height",_=xN.has(Do(s)),k=o.reference[p]-o.floating[b]+(_&&((w=a.offset)==null?void 0:w[p])||0)+(_?0:x.crossAxis),C=o.reference[p]+o.reference[b]+(_?0:((y=a.offset)==null?void 0:y[p])||0)-(_?x.crossAxis:0);v<k?v=k:v>C&&(v=C)}return{[h]:m,[p]:v}}}},Az=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:o,platform:a,elements:l}=t,{apply:c=()=>{},...u}=Lo(e,t),f=await Cd(t,u),p=Do(s),h=Hc(s),m=Js(s)==="y",{width:v,height:g}=o.floating;let x,w;p==="top"||p==="bottom"?(x=p,w=h===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(w=p,x=h==="end"?"top":"bottom");const y=g-f.top-f.bottom,b=v-f.left-f.right,_=Li(g-f[x],y),k=Li(v-f[w],b),C=!t.middlewareData.shift;let E=_,A=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=y),C&&!h){const M=Yr(f.left,0),P=Yr(f.right,0),$=Yr(f.top,0),H=Yr(f.bottom,0);m?A=v-2*(M!==0||P!==0?M+P:Yr(f.left,f.right)):E=g-2*($!==0||H!==0?$+H:Yr(f.top,f.bottom))}await c({...t,availableWidth:A,availableHeight:E});const T=await a.getDimensions(l.floating);return v!==T.width||g!==T.height?{reset:{rects:!0}}:{}}}};function um(){return typeof window<"u"}function Kc(e){return bN(e)?(e.nodeName||"").toLowerCase():"#document"}function Xr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function lo(e){var t;return(t=(bN(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function bN(e){return um()?e instanceof Node||e instanceof Xr(e).Node:!1}function Ms(e){return um()?e instanceof Element||e instanceof Xr(e).Element:!1}function oo(e){return um()?e instanceof HTMLElement||e instanceof Xr(e).HTMLElement:!1}function Pk(e){return!um()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Xr(e).ShadowRoot}const Iz=new Set(["inline","contents"]);function Gd(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Ls(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Iz.has(s)}const Oz=new Set(["table","td","th"]);function Mz(e){return Oz.has(Kc(e))}const Lz=[":popover-open",":modal"];function dm(e){return Lz.some(t=>{try{return e.matches(t)}catch{return!1}})}const Dz=["transform","translate","scale","rotate","perspective"],$z=["transform","translate","scale","rotate","perspective","filter"],Uz=["paint","layout","strict","content"];function rb(e){const t=sb(),n=Ms(e)?Ls(e):e;return Dz.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||$z.some(r=>(n.willChange||"").includes(r))||Uz.some(r=>(n.contain||"").includes(r))}function Fz(e){let t=Di(e);for(;oo(t)&&!jc(t);){if(rb(t))return t;if(dm(t))return null;t=Di(t)}return null}function sb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const zz=new Set(["html","body","#document"]);function jc(e){return zz.has(Kc(e))}function Ls(e){return Xr(e).getComputedStyle(e)}function fm(e){return Ms(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Di(e){if(Kc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Pk(e)&&e.host||lo(e);return Pk(t)?t.host:t}function _N(e){const t=Di(e);return jc(t)?e.ownerDocument?e.ownerDocument.body:e.body:oo(t)&&Gd(t)?t:_N(t)}function Ed(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=_N(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),a=Xr(s);if(o){const l=ew(a);return t.concat(a,a.visualViewport||[],Gd(s)?s:[],l&&n?Ed(l):[])}return t.concat(s,Ed(s,[],n))}function ew(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function kN(e){const t=Ls(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=oo(e),o=s?e.offsetWidth:n,a=s?e.offsetHeight:r,l=cp(n)!==o||cp(r)!==a;return l&&(n=o,r=a),{width:n,height:r,$:l}}function ob(e){return Ms(e)?e:e.contextElement}function sc(e){const t=ob(e);if(!oo(t))return Zs(1);
vendor: 3,360 bytes, line 359
359const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=kN(t);let a=(o?cp(n.width):n.width)/r,l=(o?cp(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const Bz=Zs(0);function SN(e){const t=Xr(e);return!sb()||!t.visualViewport?Bz:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Wz(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Xr(e)?!1:t}function Ba(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=ob(e);let a=Zs(1);t&&(r?Ms(r)&&(a=sc(r)):a=sc(e));const l=Wz(o,n,r)?SN(o):Zs(0);let c=(s.left+l.x)/a.x,u=(s.top+l.y)/a.y,f=s.width/a.x,p=s.height/a.y;if(o){const h=Xr(o),m=r&&Ms(r)?Xr(r):r;let v=h,g=ew(v);for(;g&&r&&m!==v;){const x=sc(g),w=g.getBoundingClientRect(),y=Ls(g),b=w.left+(g.clientLeft+parseFloat(y.paddingLeft))*x.x,_=w.top+(g.clientTop+parseFloat(y.paddingTop))*x.y;c*=x.x,u*=x.y,f*=x.x,p*=x.y,c+=b,u+=_,v=Xr(g),g=ew(v)}}return dp({width:f,height:p,x:c,y:u})}function ib(e,t){const n=fm(e).scrollLeft;return t?t.left+n:Ba(lo(e)).left+n}function CN(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=r.left+t.scrollLeft-(n?0:ib(e,r)),o=r.top+t.scrollTop;return{x:s,y:o}}function Hz(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",a=lo(r),l=t?dm(t.floating):!1;if(r===a||l&&o)return n;let c={scrollLeft:0,scrollTop:0},u=Zs(1);const f=Zs(0),p=oo(r);if((p||!p&&!o)&&((Kc(r)!=="body"||Gd(a))&&(c=fm(r)),oo(r))){const m=Ba(r);u=sc(r),f.x=m.x+r.clientLeft,f.y=m.y+r.clientTop}const h=a&&!p&&!o?CN(a,c,!0):Zs(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+f.x+h.x,y:n.y*u.y-c.scrollTop*u.y+f.y+h.y}}function Kz(e){return Array.from(e.getClientRects())}function qz(e){const t=lo(e),n=fm(e),r=e.ownerDocument.body,s=Yr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Yr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+ib(e);const l=-n.scrollTop;return Ls(r).direction==="rtl"&&(a+=Yr(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:a,y:l}}function Vz(e,t){const n=Xr(e),r=lo(e),s=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,l=0,c=0;if(s){o=s.width,a=s.height;const u=sb();(!u||u&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:o,height:a,x:l,y:c}}const Yz=new Set(["absolute","fixed"]);function Gz(e,t){const n=Ba(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=oo(e)?sc(e):Zs(1),a=e.clientWidth*o.x,l=e.clientHeight*o.y,c=s*o.x,u=r*o.y;return{width:a,height:l,x:c,y:u}}function Rk(e,t,n){let r;if(t==="viewport")r=Vz(e,n);else if(t==="document")r=qz(lo(e));else if(Ms(t))r=Gz(t,n);else{const s=SN(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return dp(r)}function EN(e,t){const n=Di(e);return n===t||!Ms(n)||jc(n)?!1:Ls(n).position==="fixed"||EN(n,t)}function Jz(e,t){const n=t.get(e);if(n)return n;let r=Ed(e,[],!1).filter(l=>Ms(l)&&Kc(l)!=="body"),s=null;const o=Ls(e).position==="fixed";let a=o?Di(e):e;for(;Ms(a)&&!jc(a);){const l=Ls(a),c=rb(a);!c&&l.position==="fixed"&&(s=null),(o?!c&&!s:!c&&l.position==="static"&&!!s&&Yz.has(s.position)||Gd(a)&&!c&&EN(e,a))?r=r.filter(f=>f!==a):s=l,a=Di(a)}return t.set(e,r),r}function Qz(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const a=[...n==="clippingAncestors"?dm(t)?[]:Jz(t,this._c):[].concat(n),r],l=a[0],c=a.reduce((u,f)=>
vendor: 10,065 bytes, line 359
359{const p=Rk(t,f,s);return u.top=Yr(p.top,u.top),u.right=Li(p.right,u.right),u.bottom=Li(p.bottom,u.bottom),u.left=Yr(p.left,u.left),u},Rk(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Xz(e){const{width:t,height:n}=kN(e);return{width:t,height:n}}function Zz(e,t,n){const r=oo(t),s=lo(t),o=n==="fixed",a=Ba(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const c=Zs(0);function u(){c.x=ib(s)}if(r||!r&&!o)if((Kc(t)!=="body"||Gd(s))&&(l=fm(t)),r){const m=Ba(t,!0,o,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else s&&u();o&&!r&&s&&u();const f=s&&!r&&!o?CN(s,l):Zs(0),p=a.left+l.scrollLeft-c.x-f.x,h=a.top+l.scrollTop-c.y-f.y;return{x:p,y:h,width:a.width,height:a.height}}function Yg(e){return Ls(e).position==="static"}function Ak(e,t){if(!oo(e)||Ls(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return lo(e)===n&&(n=n.ownerDocument.body),n}function jN(e,t){const n=Xr(e);if(dm(e))return n;if(!oo(e)){let s=Di(e);for(;s&&!jc(s);){if(Ms(s)&&!Yg(s))return s;s=Di(s)}return n}let r=Ak(e,t);for(;r&&Mz(r)&&Yg(r);)r=Ak(r,t);return r&&jc(r)&&Yg(r)&&!rb(r)?n:r||Fz(e)||n}const eB=async function(e){const t=this.getOffsetParent||jN,n=this.getDimensions,r=await n(e.floating);return{reference:Zz(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function tB(e){return Ls(e).direction==="rtl"}const nB={convertOffsetParentRelativeRectToViewportRelativeRect:Hz,getDocumentElement:lo,getClippingRect:Qz,getOffsetParent:jN,getElementRects:eB,getClientRects:Kz,getDimensions:Xz,getScale:sc,isElement:Ms,isRTL:tB};function NN(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function rB(e,t){let n=null,r;const s=lo(e);function o(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function a(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),o();const u=e.getBoundingClientRect(),{left:f,top:p,width:h,height:m}=u;if(l||t(),!h||!m)return;const v=Vf(p),g=Vf(s.clientWidth-(f+h)),x=Vf(s.clientHeight-(p+m)),w=Vf(f),b={rootMargin:-v+"px "+-g+"px "+-x+"px "+-w+"px",threshold:Yr(0,Li(1,c))||1};let _=!0;function k(C){const E=C[0].intersectionRatio;if(E!==c){if(!_)return a();E?a(!1,E):r=setTimeout(()=>{a(!1,1e-7)},1e3)}E===1&&!NN(u,e.getBoundingClientRect())&&a(),_=!1}try{n=new IntersectionObserver(k,{...b,root:s.ownerDocument})}catch{n=new IntersectionObserver(k,b)}n.observe(e)}return a(!0),o}function sB(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=ob(e),f=s||o?[...u?Ed(u):[],...Ed(t)]:[];f.forEach(w=>{s&&w.addEventListener("scroll",n,{passive:!0}),o&&w.addEventListener("resize",n)});const p=u&&l?rB(u,n):null;let h=-1,m=null;a&&(m=new ResizeObserver(w=>{let[y]=w;y&&y.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var b;(b=m)==null||b.observe(t)})),n()}),u&&!c&&m.observe(u),m.observe(t));let v,g=c?Ba(e):null;c&&x();function x(){const w=Ba(e);g&&!NN(g,w)&&n(),g=w,v=requestAnimationFrame(x)}return n(),()=>{var w;f.forEach(y=>{s&&y.removeEventListener("scroll",n),o&&y.removeEventListener("resize",n)}),p==null||p(),(w=m)==null||w.disconnect(),m=null,c&&cancelAnimationFrame(v)}}const oB=Tz,iB=Pz,aB=Ez,lB=Az,cB=jz,Ik=Cz,uB=Rz,dB=(e,t,n)=>{const r=new Map,s={platform:nB,...n},o={...s.platform,_c:r};return Sz(e,t,{...s,platform:o})};var fB=typeof document<"u",hB=function(){},_h=fB?d.useLayoutEffect:hB;function fp(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!fp(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!fp(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function TN(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ok(e,t){const n=TN(e);return Math.round(t*n)/n}function Gg(e){const t=d.useRef(e);return _h(()=>{t.current=e}),t}function pB(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:a}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[f,p]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=d.useState(r);fp(h,r)||m(r);const[v,g]=d.useState(null),[x,w]=d.useState(null),y=d.useCallback(j=>{j!==C.current&&(C.current=j,g(j))},[]),b=d.useCallback(j=>{j!==E.current&&(E.current=j,w(j))},[]),_=o||v,k=a||x,C=d.useRef(null),E=d.useRef(null),A=d.useRef(f),T=c!=null,M=Gg(c),P=Gg(s),$=Gg(u),H=d.useCallback(()=>{if(!C.current||!E.current)return;const j={placement:t,strategy:n,middleware:h};P.current&&(j.platform=P.current),dB(C.current,E.current,j).then(N=>{const W={...N,isPositioned:$.current!==!1};z.current&&!fp(A.current,W)&&(A.current=W,Bi.flushSync(()=>{p(W)}))})},[h,t,n,P,$]);_h(()=>{u===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,p(j=>({...j,isPositioned:!1})))},[u]);const z=d.useRef(!1);_h(()=>(z.current=!0,()=>{z.current=!1}),[]),_h(()=>{if(_&&(C.current=_),k&&(E.current=k),_&&k){if(M.current)return M.current(_,k,H);H()}},[_,k,H,M,T]);const B=d.useMemo(()=>({reference:C,floating:E,setReference:y,setFloating:b}),[y,b]),U=d.useMemo(()=>({reference:_,floating:k}),[_,k]),D=d.useMemo(()=>{const j={position:n,left:0,top:0};if(!U.floating)return j;const N=Ok(U.floating,f.x),W=Ok(U.floating,f.y);return l?{...j,transform:"translate("+N+"px, "+W+"px)",...TN(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:N,top:W}},[n,l,U.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:H,refs:B,elements:U,floatingStyles:D}),[f,H,B,U,D])}const mB=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Ik({element:r.current,padding:s}).fn(n):{}:r?Ik({element:r,padding:s}).fn(n):{}}}},gB=(e,t)=>({...oB(e),options:[e,t]}),yB=(e,t)=>({...iB(e),options:[e,t]}),vB=(e,t)=>({...uB(e),options:[e,t]}),wB=(e,t)=>({...aB(e),options:[e,t]}),xB=(e,t)=>({...lB(e),options:[e,t]}),bB=(e,t)=>({...cB(e),options:[e,t]}),_B=(e,t)=>({...mB(e),options:[e,t]});var kB="Arrow",PN=d.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...o}=e;return i.jsx(ve.svg,{...o,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});PN.displayName=kB;var SB=PN;function ab(e){const[t,n]=d.useState(void 0);return jn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let a,l;if("borderBoxSize"in o){const c=o.borderBoxSize,u=Array.isArray(c)?c[0]:c;a=u.inlineSize,l=u.blockSize}else a=e.offsetWidth,l=e.offsetHeight;n({width:a,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var lb="Popper",[RN,Hi]=vr(lb),[CB,AN]=RN(lb),IN=e=>{const{__scopePopper:t,children:n}=e,[r,s]=d.useState(null);return i.jsx(CB,{scope:t,anchor:r,onAnchorChange:s,children:n})};IN.displayName=lb;var ON="PopperAnchor",MN=d.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,o=AN(ON,n),a=d.useRef(null),l=Pe(t,a);return d.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:i.jsx(ve.div,{...s,ref:l})});MN.displayName=ON;var cb="PopperContent",[EB,jB]=RN(cb),LN=d.forwardRef((e,t)=>{var q,me,oe,ae,fe,ge;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:a=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:v,...g}=e,x=AN(cb,n),[w,y]=d.useState(null),b=Pe(t,$e=>y($e)),[_,k]=d.useState(null),C=ab(_),E=(C==null?void 0:C.width)??0,A=(C==null?void 0:C.height)??0,T=r+(o!=="center"?"-"+o:""),M=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},P=Array.isArray(u)?u:[u],$=P.length>0,H={padding:M,boundary:P.filter(TB),altBoundary:$},{refs:z,floatingStyles:B,placement:U,isPositioned:D,middlewareData:j}=pB({strategy:"fixed",placement:T,whileElementsMounted:(...$e)=>sB(...$e,{animationFrame:m==="always"}),elements:{reference:x.anchor},middleware:[gB({mainAxis:s+A,alignmentAxis:a}),c&&yB({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?vB():void 0,...H}),c&&wB({...H}),xB({...H,apply:({elements:$e,rects:tt,availableWidth:Lt,availableHeight:ut})=>{const{width:Nn,height:Ae}=tt.reference,Xn=$e.floating.style;Xn.setProperty("--radix-popper-available-width",`${Lt}px`),Xn.setProperty("--radix-popper-available-height",`${ut}px`),Xn.setProperty("--radix-popper-anchor-width",`${Nn}px`),Xn.setProperty("--radix-popper-anchor-height",`${Ae}px`)}}),_&&_B({element:_,padding:l}),PB({arrowWidth:E,arrowHeight:A}),h&&bB({strategy:"referenceHidden",...H})]}),[N,W]=UN(U),G=vn(v);jn(()=>{D&&(G==null||G())},[D,G]);const L=(q=j.arrow)==null?void 0:q.x,K=(me=j.arrow)==null?void 0:me.y,J=((oe=j.arrow)==null?void 0:oe.centerOffset)!==0,[Z,ce]=d.useState();return jn(()=>{w&&ce(window.getComputedStyle(w).zIndex)},[w]),i.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:D?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[(ae=j.transformOrigin)==null?void 0:ae.x,(fe=j.transformOrigin)==null?void 0:fe.y].join(" "),...((ge=j.hide)==null?void 0:ge.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(EB,{scope:n,placedSide:N,onArrowChange:k,arrowX:L,arrowY:K,shouldHideArrow:J,children:i.jsx(ve.div,{"data-side":N,"data-align":W,...g,ref:b,style:{...g.style,animation:D?void 0:"none"}})})})});LN.displayName=cb;var DN="PopperArrow",NB={top:"bottom",right:"left",bottom:"top",left:"r
359ight"},$N=d.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,o=jB(DN,r),a=NB[o.placedSide];return i.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:i.jsx(SB,{...s,ref:n,style:{...s.style,display:"block"}})})});$N.displayName=DN;function TB(e){return e!==null}var PB=e=>({name:"transformOrigin",options:e,fn(t){var x,w,y;const{placement:n,rects:r,middlewareData:s}=t,a=((x=s.arrow)==null?void 0:x.centerOffset)!==0,l=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[u,f]=UN(n),p={start:"0%",center:"50%",end:"100%"}[f],h=(((w=s.arrow)==null?void 0:w.x)??0)+l/2,m=(((y=s.arrow)==null?void 0:y.y)??0)+c/2;let v="",g="";return u==="bottom"?(v=a?p:`${h}px`,g=`${-c}px`):u==="top"?(v=a?p:`${h}px`,g=`${r.floating.height+c}px`):u==="right"?(v=`${-c}px`,g=a?p:`${m}px`):u==="left"&&(v=`${r.floating.width+c}px`,g=a?p:`${m}px`),{data:{x:v,y:g}}}});function UN(e){const[t,n="center"]=e.split("-");return[t,n]}var hm=IN,Jd=MN,pm=LN,mm=$N;function ub(e){const t=d.useRef({value:e,previous:e});return d.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var FN=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),RB="VisuallyHidden",gm=d.forwardRef((e,t)=>i.jsx(ve.span,{...e,ref:t,style:{...FN,...e.style}}));gm.displayName=RB;var AB=gm,IB=[" ","Enter","ArrowUp","ArrowDown"],OB=[" ","Enter"],Wa="Select",[ym,vm,MB]=lm(Wa),[qc,Y7]=vr(Wa,[MB,Hi]),wm=Hi(),[LB,Ki]=qc(Wa),[DB,$B]=qc(Wa),zN=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:o,value:a,defaultValue:l,onValueChange:c,dir:u,name:f,autoComplete:p,disabled:h,required:m,form:v}=e,g=wm(t),[x,w]=d.useState(null),[y,b]=d.useState(null),[_,k]=d.useState(!1),C=cm(u),[E,A]=ro({prop:r,defaultProp:s??!1,onChange:o,caller:Wa}),[T,M]=ro({prop:a,defaultProp:l,onChange:c,caller:Wa}),P=d.useRef(null),$=x?v||!!x.closest("form"):!0,[H,z]=d.useState(new Set),B=Array.from(H).map(U=>U.props.value).join(";");return i.jsx(hm,{...g,children:i.jsxs(LB,{required:m,scope:t,trigger:x,onTriggerChange:w,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:_,onValueNodeHasChildrenChange:k,contentId:Gn(),value:T,onValueChange:M,open:E,onOpenChange:A,dir:C,triggerPointerDownPosRef:P,disabled:h,children:[i.jsx(ym.Provider,{scope:t,children:i.jsx(DB,{scope:e.__scopeSelect,onNativeOptionAdd:d.useCallback(U=>{z(D=>new Set(D).add(U))},[]),onNativeOptionRemove:d.useCallback(U=>{z(D=>{const j=new Set(D);return j.delete(U),j})},[]),children:n})}),$?i.jsxs(dT,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:p,value:T,onChange:U=>M(U.target.value),disabled:h,form:v,children:[T===void 0?i.jsx("option",{value:""}):null,Array.from(H)]},B):null]})})};zN.displayName=Wa;var BN="SelectTrigger",WN=d.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,o=wm(n),a=Ki(BN,n),l=a.disabled||r,c=Pe(t,a.onTriggerChange),u=vm(n),f=d.useRef("touch"),[p,h,m]=hT(g=>{const x=u().filter(b=>!b.disabled),w=x.find(b=>b.value===a.value),y=pT(x,g,w);y!==void 0&&a.onValueChange(y.value)}),v=g=>{l||(a.onOpenChange(!0),m()),g&&(a.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return i.jsx(Jd,{asChild:!0,...o,children:i.jsx(ve.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":fT(a.value)?"":void 0,...s,ref:c,onClick:ie(s.onClick,g=>{g.currentTarget.focus(),f.current!=="mouse"&&v(g)}),onPointerDown:ie(s.onPointerDown,g=>{f.current=g.pointerType;const x=g.target;x.hasPointerCapture(g.pointerId)&&x.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(v(g),g.preventDefault())}),onKeyDown:ie(s.onKeyDown,g=>{const x=p.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&h(g.key),!(x&&g.key===" ")&&IB.includes(g.key)&&(v(),g.preventDefault())})})})});WN.displayName=BN;var HN="SelectValue",KN=d.forwardRef((e,t)=>
vendor: 1,302 bytes, line 359
359{const{__scopeSelect:n,className:r,style:s,children:o,placeholder:a="",...l}=e,c=Ki(HN,n),{onValueNodeHasChildrenChange:u}=c,f=o!==void 0,p=Pe(t,c.onValueNodeChange);return jn(()=>{u(f)},[u,f]),i.jsx(ve.span,{...l,ref:p,style:{pointerEvents:"none"},children:fT(c.value)?i.jsx(i.Fragment,{children:a}):o})});KN.displayName=HN;var UB="SelectIcon",qN=d.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return i.jsx(ve.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});qN.displayName=UB;var FB="SelectPortal",VN=e=>i.jsx(Wc,{asChild:!0,...e});VN.displayName=FB;var Ha="SelectContent",YN=d.forwardRef((e,t)=>{const n=Ki(Ha,e.__scopeSelect),[r,s]=d.useState();if(jn(()=>{s(new DocumentFragment)},[]),!n.open){const o=r;return o?Bi.createPortal(i.jsx(GN,{scope:e.__scopeSelect,children:i.jsx(ym.Slot,{scope:e.__scopeSelect,children:i.jsx("div",{children:e.children})})}),o):null}return i.jsx(JN,{...e,ref:t})});YN.displayName=Ha;var _s=10,[GN,qi]=qc(Ha),zB="SelectContentImpl",BB=Mi("SelectContent.RemoveScroll"),JN=d.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:a,side:l,sideOffset:c,align:u,alignOffset:f,arrowPadding:p,collisionBoundary:h,collisionPadding:m,sticky:v,hideWhenDetached:g,avoidCollisions:x,...w}
vendor: 14,229 bytes, line 359
359=e,y=Ki(Ha,n),[b,_]=d.useState(null),[k,C]=d.useState(null),E=Pe(t,q=>_(q)),[A,T]=d.useState(null),[M,P]=d.useState(null),$=vm(n),[H,z]=d.useState(!1),B=d.useRef(!1);d.useEffect(()=>{if(b)return rm(b)},[b]),tm();const U=d.useCallback(q=>{const[me,...oe]=$().map(ge=>ge.ref.current),[ae]=oe.slice(-1),fe=document.activeElement;for(const ge of q)if(ge===fe||(ge==null||ge.scrollIntoView({block:"nearest"}),ge===me&&k&&(k.scrollTop=0),ge===ae&&k&&(k.scrollTop=k.scrollHeight),ge==null||ge.focus(),document.activeElement!==fe))return},[$,k]),D=d.useCallback(()=>U([A,b]),[U,A,b]);d.useEffect(()=>{H&&D()},[H,D]);const{onOpenChange:j,triggerPointerDownPosRef:N}=y;d.useEffect(()=>{if(b){let q={x:0,y:0};const me=ae=>{var fe,ge;q={x:Math.abs(Math.round(ae.pageX)-(((fe=N.current)==null?void 0:fe.x)??0)),y:Math.abs(Math.round(ae.pageY)-(((ge=N.current)==null?void 0:ge.y)??0))}},oe=ae=>{q.x<=10&&q.y<=10?ae.preventDefault():b.contains(ae.target)||j(!1),document.removeEventListener("pointermove",me),N.current=null};return N.current!==null&&(document.addEventListener("pointermove",me),document.addEventListener("pointerup",oe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",me),document.removeEventListener("pointerup",oe,{capture:!0})}}},[b,j,N]),d.useEffect(()=>{const q=()=>j(!1);return window.addEventListener("blur",q),window.addEventListener("resize",q),()=>{window.removeEventListener("blur",q),window.removeEventListener("resize",q)}},[j]);const[W,G]=hT(q=>{const me=$().filter(fe=>!fe.disabled),oe=me.find(fe=>fe.ref.current===document.activeElement),ae=pT(me,q,oe);ae&&setTimeout(()=>ae.ref.current.focus())}),L=d.useCallback((q,me,oe)=>{const ae=!B.current&&!oe;(y.value!==void 0&&y.value===me||ae)&&(T(q),ae&&(B.current=!0))},[y.value]),K=d.useCallback(()=>b==null?void 0:b.focus(),[b]),J=d.useCallback((q,me,oe)=>{const ae=!B.current&&!oe;(y.value!==void 0&&y.value===me||ae)&&P(q)},[y.value]),Z=r==="popper"?tw:QN,ce=Z===tw?{side:l,sideOffset:c,align:u,alignOffset:f,arrowPadding:p,collisionBoundary:h,collisionPadding:m,sticky:v,hideWhenDetached:g,avoidCollisions:x}:{};return i.jsx(GN,{scope:n,content:b,viewport:k,onViewportChange:C,itemRefCallback:L,selectedItem:A,onItemLeave:K,itemTextRefCallback:J,focusSelectedItem:D,selectedItemText:M,position:r,isPositioned:H,searchRef:W,children:i.jsx(Yd,{as:BB,allowPinchZoom:!0,children:i.jsx(Vd,{asChild:!0,trapped:y.open,onMountAutoFocus:q=>{q.preventDefault()},onUnmountAutoFocus:ie(s,q=>{var me;(me=y.trigger)==null||me.focus({preventScroll:!0}),q.preventDefault()}),children:i.jsx(Ya,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:q=>q.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:i.jsx(Z,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:q=>q.preventDefault(),...w,...ce,onPlaced:()=>z(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:ie(w.onKeyDown,q=>{const me=q.ctrlKey||q.altKey||q.metaKey;if(q.key==="Tab"&&q.preventDefault(),!me&&q.key.length===1&&G(q.key),["ArrowUp","ArrowDown","Home","End"].includes(q.key)){let ae=$().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);if(["ArrowUp","End"].includes(q.key)&&(ae=ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(q.key)){const fe=q.target,ge=ae.indexOf(fe);ae=ae.slice(ge+1)}setTimeout(()=>U(ae)),q.preventDefault()}})})})})})})});JN.displayName=zB;var WB="SelectItemAlignedPosition",QN=d.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,o=Ki(Ha,n),a=qi(Ha,n),[l,c]=d.useState(null),[u,f]=d.useState(null),p=Pe(t,E=>f(E)),h=vm(n),m=d.useRef(!1),v=d.useRef(!0),{viewport:g,selectedItem:x,selectedItemText:w,focusSelectedItem:y}=a,b=d.useCallback(()=>{if(o.trigger&&o.valueNode&&l&&u&&g&&x&&w){const E=o.trigger.getBoundingClientRect(),A=u.getBoundingClientRect(),T=o.valueNode.getBoundingClientRect(),M=w.getBoundingClientRect();if(o.dir!=="rtl"){const fe=M.left-A.left,ge=T.left-fe,$e=E.left-ge,tt=E.width+$e,Lt=Math.max(tt,A.width),ut=window.innerWidth-_s,Nn=Qv(ge,[_s,Math.max(_s,ut-Lt)]);l.style.minWidth=tt+"px",l.style.left=Nn+"px"}else{const fe=A.right-M.right,ge=window.innerWidth-T.right-fe,$e=window.innerWidth-E.right-ge,tt=E.width+$e,Lt=Math.max(tt,A.width),ut=window.innerWidth-_s,Nn=Qv(ge,[_s,Math.max(_s,ut-Lt)]);l.style.minWidth=tt+"px",l.style.right=Nn+"px"}const P=h(),$=window.innerHeight-_s*2,H=g.scrollHeight,z=window.getComputedStyle(u),B=parseInt(z.borderTopWidth,10),U=parseInt(z.paddingTop,10),D=parseInt(z.borderBottomWidth,10),j=parseInt(z.paddingBottom,10),N=B+U+H+j+D,W=Math.min(x.offsetHeight*5,N),G=window.getComputedStyle(g),L=parseInt(G.paddingTop,10),K=parseInt(G.paddingBottom,10),J=E.top+E.height/2-_s,Z=$-J,ce=x.offsetHeight/2,q=x.offsetTop+ce,me=B+U+q,oe=N-me;if(me<=J){const fe=P.length>0&&x===P[P.length-1].ref.current;l.style.bottom="0px";const ge=u.clientHeight-g.offsetTop-g.offsetHeight,$e=Math.max(Z,ce+(fe?K:0)+ge+D),tt=me+$e;l.style.height=tt+"px"}else{const fe=P.length>0&&x===P[0].ref.current;l.style.top="0px";const $e=Math.max(J,B+g.offsetTop+(fe?L:0)+ce)+oe;l.style.height=$e+"px",g.scrollTop=me-J+g.offsetTop}l.style.margin=`${_s}px 0`,l.style.minHeight=W+"px",l.style.maxHeight=$+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[h,o.trigger,o.valueNode,l,u,g,x,w,o.dir,r]);jn(()=>b(),[b]);const[_,k]=d.useState();jn(()=>{u&&k(window.getComputedStyle(u).zIndex)},[u]);const C=d.useCallback(E=>{E&&v.current===!0&&(b(),y==null||y(),v.current=!1)},[b,y]);return i.jsx(KB,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:m,onScrollButtonChange:C,children:i.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:i.jsx(ve.div,{...s,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});QN.displayName=WB;var HB="SelectPopperPosition",tw=d.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=_s,...o}=e,a=wm(n);return i.jsx(pm,{...a,...o,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});tw.displayName=HB;var[KB,db]=qc(Ha,{}),nw="SelectViewport",XN=d.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,o=qi(nw,n),a=db(nw,n),l=Pe(t,o.onViewportChange),c=d.useRef(0);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),i.jsx(ym.Slot,{scope:n,children:i.jsx(ve.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:ie(s.onScroll,u=>{const f=u.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:h}=a;if(h!=null&&h.current&&p){const m=Math.abs(c.current-f.scrollTop);if(m>0){const v=window.innerHeight-_s*2,g=parseFloat(p.style.minHeight),x=parseFloat(p.style.height),w=Math.max(g,x);if(w<v){const y=w+m,b=Math.min(v,y),_=y-b;p.style.height=b+"px",p.style.bottom==="0px"&&(f.scrollTop=_>0?_:0,p.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});XN.displayName=nw;var ZN="SelectGroup",[qB,VB]=qc(ZN),YB=d.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Gn();return i.jsx(qB,{scope:n,id:s,children:i.jsx(ve.div,{role:"group","aria-labelledby":s,...r,ref:t})})});YB.displayName=ZN;var eT="SelectLabel",tT=d.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=VB(eT,n);return i.jsx(ve.div,{id:s.id,...r,ref:t})});tT.displayName=eT;var hp="SelectItem",[GB,nT]=qc(hp),rT=d.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:o,...a}=e,l=Ki(hp,n),c=qi(hp,n),u=l.value===r,[f,p]=d.useState(o??""),[h,m]=d.useState(!1),v=Pe(t,y=>{var b;return(b=c.itemRefCallback)==null?void 0:b.call(c,y,r,s)}),g=Gn(),x=d.useRef("touch"),w=()=>{s||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return i.jsx(GB,{scope:n,value:r,disabled:s,textId:g,isSelected:u,onItemTextChange:d.useCallback(y=>{p(b=>b||((y==null?void 0:y.textContent)??"").trim())},[]),children:i.jsx(ym.ItemSlot,{scope:n,value:r,disabled:s,textValue:f,children:i.jsx(ve.div,{role:"option","aria-labelledby":g,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:v,onFocus:ie(a.onFocus,()=>m(!0)),onBlur:ie(a.onBlur,()=>m(!1)),onClick:ie(a.onClick,()=>{x.current!=="mouse"&&w()}),onPointerUp:ie(a.onPointerUp,()=>{x.current==="mouse"&&w()}),onPointerDown:ie(a.onPointerDown,y=>{x.current=y.pointerType}),onPointerMove:ie(a.onPointerMove,y=>{var b;x.current=y.pointerType,s?(b=c.onItemLeave)==null||b.call(c):x.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ie(a.onPointerLeave,y=>{var b;y.currentTarget===document.activeElement&&((b=c.onItemLeave)==null||b.call(c))}),onKeyDown:ie(a.onKeyDown,y=>{var _;((_=c.searchRef)==null?void 0:_.current)!==""&&y.key===" "||(OB.includes(y.key)&&w(),y.key===" "&&y.preventDefault())})})})})});rT.displayName=hp;var Nu="SelectItemText",sT=d.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...o}=e,a=Ki(Nu,n),l=qi(Nu,n),c=nT(Nu,n),u=$B(Nu,n),[f,p]=d.useState(null),h=Pe(t,w=>p(w),c.onItemTextChange,w=>{var y;return(y=l.itemTextRefCallback)==null?void 0:y.call(l,w,c.value,c.disabled)}),m=f==null?void 0:f.textContent,v=d.useMemo(()=>i.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:x}=u;return jn(()=>(g(v),()=>x(v)),[g,x,v]),i.jsxs(i.Fragment,{children:[i.jsx(ve.span,{id:c.textId,...o,ref:h}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Bi.createPortal(o.children,a.valueNode):null]})});sT.displayName=Nu;var oT="SelectItemIndicator",iT=d.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return nT(oT,n).isSelected?i.jsx(ve.span,{"aria-hidden":!0,...r,ref:t}):null});iT.displayName=oT;var rw="SelectScrollUpButton",aT=d.forwardRef((e,t)=>{const n=qi(rw,e.__scopeSelect),r=db(rw,e.__scopeSelect),[s,o]=d.useState(!1),a=Pe(t,r.onScrollButtonChange);return jn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollTop>0;o(u)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),s?i.jsx(cT,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});aT.displayName=rw;var sw="SelectScrollDownButton",lT=d.forwardRef((e,t)=>{const n=qi(sw,e.__scopeSelect),r=db(sw,e.__scopeSelect),[s,o]=d.useState(!1),a=Pe(t,r.onScrollButtonChange);return jn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)<u;o(f)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),s?i.jsx(cT,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});lT.displayName=sw;var cT=d.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,o=qi("SelectScrollButton",n),a=d.useRef(null),l=vm(n),c=d.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return d.useEffect(()=>()=>c(),[c]),jn(()=>{var f;const u=l().find(p=>p.ref.current===document.activeElement);(f=u==null?void 0:u.ref.current)==null||f.scrollIntoView({block:"nearest"})},[l]),i.jsx(ve.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:ie(s.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:ie(s.onPointerMove,()=>{var u;(u=o.onItemLeave)==null||u.call(o),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:ie(s.onPointerLeave,()=>{c()})})}),JB="SelectSeparator",uT=d.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return i.jsx(ve.div,{"aria-hidden":!0,...r,ref:t})});uT.displayName=JB;var ow="SelectArrow",QB=d.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=wm(n),o=Ki(ow,n),a=qi(ow,n);return o.open&&a.position==="popper"?i.jsx(mm,{...s,...r,ref:t}):null});QB.displayName=ow;var XB="SelectBubbleInput",dT=d.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=d.useRef(null),o=Pe(r,s),a=ub(t);return d.useEffect(()=>{const l=s.current;if(!l)return;const c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&f){const p=new Event("change",{bubbles:!0});f.call(l,t),l.dispatchEvent(p)}},[a,t]),i.jsx(ve.select,{...n,style:{...FN,...n.style},ref:o,defaultValue:t})});dT.displayName=XB;function fT(e){return e===""||e===void 0}function hT(e){const t=vn(e),n=d.useRef(""),r=d.useRef(0),s=d.useCallback(a=>{const l=n.current+a;t(l),function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),o=d.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,o]}function pT(e,t,n){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=ZB(e,Math.max(o,0));s.length===1&&(a=a.filter(u=>u!==n));const c=a.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function ZB(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var e6=zN,mT=WN,t6=KN,n6=qN,r6=VN,gT=YN,s6=XN,yT=tT,vT=rT,o6=sT,i6=iT,wT=aT,xT=lT,bT=uT;const Kr=e6,qr=t6,Nr=d.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(mT,{ref:r,className:X("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
359ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,i.jsx(n6,{asChild:!0,children:i.jsx(Yp,{className:"h-4 w-4 opacity-50"})})]}));Nr.displayName=mT.displayName;const _T=d.forwardRef(({className:e,...t},n)=>i.jsx(wT,{ref:n,className:X("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(CE,{className:"h-4 w-4"})}));_T.displayName=wT.displayName;const kT=d.forwardRef(({className:e,...t},n)=>i.jsx(xT,{ref:n,className:X("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(Yp,{className:"h-4 w-4"})}));kT.displayName=xT.displayName;const Tr=d.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>i.jsx(r6,{children:i.jsxs(gT,{ref:s,className:X("relative z-50 max-h-[min(24rem,var(--radix-select-content-available-height))] min-w-[8rem] overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[i.jsx(_T,{}),i.jsx(s6,{className:X("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),i.jsx(kT,{})]})}));Tr.displayName=gT.displayName;const a6=d.forwardRef(({className:e,...t},n)=>i.jsx(yT,{ref:n,className:X("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));a6.displayName=yT.displayName;const bt=d.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(vT,{ref:r,className:X("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(i6,{children:i.jsx(es,{className:"h-4 w-4"})})}),i.jsx(o6,{children:t})]}));bt.displayName=vT.displayName;const l6=d.forwardRef(({className:e,...t},n)=>i.jsx(bT,{ref:n,className:X("-mx-1 my-1 h-px bg-muted",e),...t}));l6.displayName=bT.displayName;function ST(e,t){const n=d.useRef(t);n.current=t,d.useEffect(()=>{if(!e)return;let r=!1;const s=Date.now(),o=async()=>{if(!(r||document.hidden)){r=!0;try{await n.current()}catch{}finally{r=!1}}},a=()=>{document.hidden||o()};document.addEventListener("visibilitychange",a),window.addEventListener("focus",a);const l=setInterval(()=>{if(Date.now()-s>10*6e4){clearInterval(l);return}o()},5e3);return()=>{document.removeEventListener("visibilitychange",a),window.removeEventListener("focus",a),clearInterval(l)}},[e])}const c6="https://errlhmcitfpyyhnwtqrs.supabase.co";function u6(e={}){const{user:n,localUserId:r,activeUsername:s,isAdmin:o}=Fo(),a=!!n&&(o||(s||"").trim().toLowerCase()==="staaake"),l=e.enabled!==!1&&!0&&!!n&&!a,{data:c,isLoading:u,isFetched:f,refetch:p}=Wt({queryKey:["premium-customization-stake",r,s],queryFn:async()=>{try{const{data:{session:w}}=await pe.auth.getSession();if(!(w!=null&&w.access_token))return{allowed:!1};const y=await fetch(`${c6}/functions/v1/check-staaake-stake`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${w.access_token}`},body:JSON.stringify({sheet:"staaakemeets",...s?{viewer_username:s}:{}})});if(!y.ok)return{allowed:!1};const b=await y.json().catch(()=>null);return{allowed:(b==null?void 0:b.allowed)===!0}}catch{return{allowed:!1}}},enabled:l,staleTime:5*6e4,retry:0}),[h,m]=d.useState(!1),v=d.useCallback(()=>m(!0),[]),g=d.useCallback(()=>m(!1),[]),x=a||(c==null?void 0:c.allowed)===!0;return ST(l&&f&&!x,()=>p()),d.useEffect(()=>{x&&m(!1)},[x]),{visible:!0,unlocked:x,isLoading:!a&&l&&u,isReady:a||!l||f,paywallOpen:h,openPaywall:v,closePaywall:g}}
359const Jg=({icon:e,label:t,locked:n,expanded:r,onClick:s,summary:o,children:a})=>i.jsxs("div",{className:"space-y-2",children:[i.jsxs("button",{type:"button",onClick:s,className:X("flex min-h-10 w-full items-center gap-3 rounded-md border border-input bg-background px-3 py-1.5 text-left text-sm transition-colors","hover:border-primary/40"),children:[i.jsx("span",{className:"text-muted-foreground",children:e}),i.jsx("span",{className:"flex-1 font-medium text-foreground",children:t}),o&&!n&&i.jsx("span",{className:"truncate text-xs text-muted-foreground max-w-[160px]",children:o}),n?i.jsx(qL,{className:"h-4 w-4 text-muted-foreground"}):r?i.jsx(CE,{className:"h-4 w-4 text-muted-foreground"}):i.jsx(Yp,{className:"h-4 w-4 text-muted-foreground"})]}),r&&!n&&a]}),d6="https://staaake.in/staaakemeets",f6=({open:e,onOpenChange:t})=>i.jsx(ot,{open:e,onOpenChange:t,children:i.jsxs(et,{className:"max-w-sm",children:[i.jsxs(Tt,{children:[i.jsx(vt,{children:"Premium customization"}),i.jsx(Ps,{children:"To unlock custom event customization, you need an 'I' stake or higher in staaake meets."})]}),i.jsxs(ee,{className:"w-full font-semibold",onClick:()=>{window.open(d6,"_blank","noopener,noreferrer")},children:["Get a stake on staaake meets",i.jsx(Cu,{className:"ml-1.5 h-4 w-4"})]})]})}),Mk=440,Xo=240,h6=1600,p6=.85;function m6({file:e,open:t,onCancel:n,onSave:r,saving:s}){const[o,a]=d.useState(null),[l,c]=d.useState(null),[u,f]=d.useState({x:0,y:0}),p=d.useRef(null);d.useEffect(()=>{if(!e){a(null),c(null),f({x:0,y:0});return}const C=URL.createObjectURL(e);a(C);const E=new Image;return E.onload=()=>{c(E),f({x:0,y:0})},E.src=C,()=>URL.revokeObjectURL(C)},[e]);const{displayW:h,displayH:m,stageW:v,stageH:g,scale:x}=d.useMemo(()=>{if(!l)return{displayW:0,displayH:0,stageW:0,stageH:0,scale:1};const C=l.naturalWidth,E=l.naturalHeight,A=Math.min(C,E),T=Xo/A,M=C*T,P=E*T,$=Math.min(M,Mk),H=Math.min(P,Mk);return{displayW:M,displayH:P,stageW:$,stageH:H,scale:T}},[l]),w=(C,E)=>{const A=Math.max(0,(h-Xo)/2),T=Math.max(0,(m-Xo)/2);return{x:Math.max(-A,Math.min(A,C)),y:Math.max(-T,Math.min(T,E))}},y=C=>{var E,A;(A=(E=C.target).setPointerCapture)==null||A.call(E,C.pointerId),p.current={x:C.clientX,y:C.clientY,ox:u.x,oy:u.y}},b=C=>{if(!p.current)return;const E=C.clientX-p.current.x,A=C.clientY-p.current.y;f(w(p.current.ox+E,p.current.oy+A))},_=()=>{p.current=null},k=async()=>{if(!l)return;const C=Xo/x,E=l.naturalWidth/2-u.x/x,A=l.naturalHeight/2-u.y/x,T=E-C/2,M=A-C/2,P=h6,$=document.createElement("canvas");$.width=P,$.height=P;const H=$.getContext("2d");if(!H)return;H.imageSmoothingEnabled=!0,H.imageSmoothingQuality="high",H.drawImage(l,T,M,C,C,0,0,P,P);const z=await new Promise(B=>$.toBlob(B,"image/jpeg",p6));z&&await r(z)};return i.jsx(ot,{open:t,onOpenChange:C=>{!C&&!s&&n()},children:i.jsxs(et,{className:"max-w-md",children:[i.jsx(Tt,{children:i.jsx(vt,{children:"Adjust image"})}),i.jsxs("div",{className:"flex flex-col items-center gap-4",children:[i.jsxs("div",{onPointerDown:y,onPointerMove:b,onPointerUp:_,onPointerCancel:_,className:"relative overflow-hidden rounded-lg bg-black/90 select-none",style:{width:v||Xo,height:g||Xo,touchAction:"none",cursor:l?"grab":"default"},children:[o&&l&&i.jsx("img",{src:o,alt:"",draggable:!1,style:{position:"absolute",width:h,height:m,maxWidth:"none",maxHeight:"none",left:"50%",top:"50%",transform:`translate(calc(-50% + ${u.x}px), calc(-50% + ${u.y}px))`,pointerEvents:"none",userSelect:"none"}}),i.jsx("div",{className:"pointer-events-none absolute left-1/2 top-1/2",style:{width:Xo,height:Xo,transform:"translate(-50%, -50%)",boxShadow:"0 0 0 9999px rgba(0,0,0,0.5)",outline:"1px solid rgba(255,255,255,0.4)",outlineOffset:"-1px",borderRadius:4}})]}),i.jsxs("div",{className:"flex w-full justify-end gap-2",children:[i.jsx(ee,{type:"button",variant:"ghost",onClick:n,disabled:s,children:"Cancel"}),i.jsx(ee,{type:"button",onClick:k,disabled:!l||s,children:s?i.jsxs(i.Fragment,{children:[i.jsx(to,{className:"mr-1 h-4 w-4 animate-spin"})," Saving..."]}):"Save Crop"})]})]})]})})}const g6="https://errlhmcitfpyyhnwtqrs.supabase.co",CT=[];for(let e=30;e<=360;e+=15)CT.push(e);function Lk(e){const t=Math.floor(e/60),n=e%60;return t===0?`${n} min`:n===0?`${t} h`:`${t} h ${n} min`}
359const y6=({value:e,onChange:t,eventCodeHint:n})=>{const{visible:r,unlocked:s,paywallOpen:o,openPaywall:a,closePaywall:l}=u6(),[c,u]=d.useState(null),[f,p]=d.useState(!1),h=d.useRef(null),[m,v]=d.useState(null);if(d.useEffect(()=>{s||u(null)},[s]),!r)return null;const g=k=>{if(!s){a();return}u(C=>C===k?null:k)},x=()=>{h.current&&(h.current.value="")},w=k=>{if(k){if(!k.type.startsWith("image/")){re.error("Please choose an image file."),x();return}v(k)}},y=async k=>{p(!0);try{const{data:{session:C}}=await pe.auth.getSession();if(!(C!=null&&C.access_token)){re.error("You must be logged in.");return}const E=new FormData;E.append("file",k,"premium.jpg"),n&&E.append("event_code",n);const A=await fetch(`${g6}/functions/v1/upload-premium-image`,{method:"POST",headers:{Authorization:`Bearer ${C.access_token}`},body:E}),T=await A.json().catch(()=>({}));if(!A.ok||!(T!=null&&T.url))throw new Error((T==null?void 0:T.error)||"Upload failed");t({...e,customImageUrl:T.url}),re.success("Image uploaded"),v(null)}catch(C){console.error("[premium-image] upload error",C),re.error((C==null?void 0:C.message)||"Image upload failed")}finally{p(!1),x()}},b=()=>{v(null),x()},_=(e.customDescription??"").length;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-3 rounded-lg border border-border/60 bg-muted/10 p-3",children:[i.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Premium customization"}),i.jsx(Jg,{icon:i.jsx(g_,{className:"h-4 w-4"}),label:i.jsxs("span",{className:"inline",children:["Upload custom image"," ",i.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"(1:1 crop)"})]}),locked:!s,expanded:c==="image",onClick:()=>g("image"),summary:e.customImageUrl?"Custom image set":null,children:i.jsxs("div",{className:"space-y-3 pt-1",children:[i.jsx("input",{ref:h,type:"file",accept:"image/*",className:"hidden",onChange:k=>{var E;const C=(E=k.target.files)==null?void 0:E[0];C&&w(C)}}),i.jsx("button",{type:"button",onClick:()=>{var k;return(k=h.current)==null?void 0:k.click()},disabled:f,className:"flex h-32 w-full flex-col items-center justify-center gap-1.5 rounded-lg border-2 border-dashed border-border/60 bg-muted/20 px-4 text-center transition-colors hover:border-primary/40 hover:bg-muted/30 disabled:opacity-60",children:f?i.jsxs(i.Fragment,{children:[i.jsx(to,{className:"h-5 w-5 animate-spin text-muted-foreground"}),i.jsx("span",{className:"text-sm font-medium text-foreground",children:"Uploading..."})]}):i.jsxs(i.Fragment,{children:[i.jsx(g_,{className:"h-5 w-5 text-muted-foreground"}),i.jsx("span",{className:"text-sm font-medium text-foreground",children:"Upload image"}),i.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Ideal image ratio is 1:1"})]})}),e.customImageUrl&&i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"mx-auto w-full max-w-[220px] sm:max-w-[260px]",children:i.jsx("div",{className:"aspect-square w-full overflow-hidden rounded-lg border border-border",children:i.jsx("img",{src:e.customImageUrl,alt:"Custom event cover preview",className:"h-full w-full object-cover"})})}),i.jsxs("div",{className:"flex justify-center gap-2",children:[i.jsx(ee,{type:"button",variant:"outline",size:"sm",onClick:()=>{var k;return(k=h.current)==null?void 0:k.click()},disabled:f,children:"Replace"}),i.jsxs(ee,{type:"button",variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-destructive",onClick:()=>t({...e,customImageUrl:null}),children:[i.jsx($c,{className:"mr-1 h-3.5 w-3.5"})," Remove"]})]})]})]})}),i.jsx(Jg,{icon:i.jsx(QL,{className:"h-4 w-4"}),label:i.jsxs("span",{className:"inline",children:["Add custom description"," ",i.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"(1000 chars)"})]}),locked:!s,expanded:c==="text",onClick:()=>g("text"),summary:e.customDescription?`${_} chars`:null,children:i.jsxs("div",{className:"space-y-1 pt-1",children:[i.jsx(Zx,{value:e.customDescription??"",maxLength:1e3,onChange:k=>t({...e,customDescription:k.target.value.length>0?k.target.value:null}),placeholder:`Philo loma serava.
360
361• lumari vento nasha
362• talo miro vessa
363• soma liri nova`,className:"min-h-[100px]"}),i.jsxs("div",{className:"flex justify-between gap-3 text-[11px] text-muted-foreground",children:[i.jsxs("div",{className:"leading-snug",children:[i.jsx("p",{children:"Shown above the default About section."}),i.jsx("p",{children:"Leave empty to skip."})]}),i.jsxs("span",{className:"shrink-0 text-right "+(_>=1e3?"text-destructive":_>=900?"text-primary":"text-muted-foreground"),children:[_," / 1000"]})]})]})}),i.jsx(Jg,{icon:i.jsx(ep,{className:"h-4 w-4"}),label:i.jsxs("span",{className:"inline",children:["Change event duration"," ",i.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"(up to 6 hours)"})]}),locked:!s,expanded:c==="duration",onClick:()=>g("duration"),summary:e.customDurationMinutes?Lk(e.customDurationMinutes):null,children:i.jsxs("div",{className:"space-y-1 pt-1",children:[i.jsxs(Kr,{value:e.customDurationMinutes?String(e.customDurationMinutes):"",onValueChange:k=>t({...e,customDurationMinutes:k?Number(k):null}),children:[i.jsx(Nr,{className:"h-10",children:i.jsx(qr,{placeholder:"Use default (1 h)"})}),i.jsx(Tr,{children:CT.map(k=>i.jsx(bt,{value:String(k),children:Lk(k)},k))})]}),e.customDurationMinutes&&i.jsx("button",{type:"button",className:"text-[11px] text-muted-foreground hover:text-foreground underline",onClick:()=>t({...e,customDurationMinutes:null}),children:"Reset to default"})]})})]}),i.jsx(f6,{open:o,onOpenChange:k=>k?a():l()}),i.jsx(m6,{file:m,open:!!m,onCancel:b,onSave:y,saving:f})]})},v6={luma:"Luma",eventbrite:"Eventbrite",meetup:"Meetup"};function Dk({state:e,label:t,savedLabel:n}){return e==="final"||e==="done"?i.jsxs("div",{className:"flex items-center gap-3 text-sm text-foreground",children:[i.jsx(es,{className:"h-4 w-4 text-primary shrink-0"}),i.jsx("span",{children:n?`Saved to ${t}`:`Synced to ${t}`})]}):e==="error"?i.jsxs("div",{className:"flex items-center gap-3 text-sm text-destructive",children:[i.jsx(AE,{className:"h-4 w-4 shrink-0"}),i.jsxs("span",{children:[t," sync failed"]})]}):i.jsxs("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[i.jsx(to,{className:"h-4 w-4 animate-spin shrink-0"}),i.jsxs("span",{children:["Syncing to ",t,"..."]}
363)]})}function w6({open:e,platforms:t,allDone:n,onClose:r}){const s=Object.values(t).some(c=>c==="error"),o=n&&!s,a=n,l=["luma","eventbrite","meetup"];return i.jsx(ot,{open:e,onOpenChange:c=>{},children:i.jsxs(et,{className:"sm:max-w-[420px] bg-card border-2 border-primary/40 p-6 gap-4",onEscapeKeyDown:c=>c.preventDefault(),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[i.jsx("div",{className:"text-base font-semibold text-foreground",children:"Saving Event..."}),i.jsxs("div",{className:"flex flex-col gap-3",children:[i.jsx(Dk,{state:"final",label:"staaake meets",savedLabel:!0}),l.map(c=>t[c]?i.jsx(Dk,{state:t[c],label:v6[c]},c):null)]}),o&&i.jsxs("div",{className:"flex items-center gap-3 text-sm text-foreground pt-1",children:[i.jsx(es,{className:"h-4 w-4 text-primary shrink-0"}),i.jsx("span",{children:"Event updated successfully."})]}),a&&i.jsx("div",{className:"flex justify-end pt-2",children:i.jsx(ee,{variant:"outline",size:"sm",onClick:r,children:"Close"})})]})})}function x6(e){const t={luma:0,eventbrite:0,meetup:0};for(const n of e)n&&(n.luma_event_id&&t.luma++,n.eventbrite_event_id&&t.eventbrite++,n.meetup_event_id&&t.meetup++);return t}function b6(e){return e.luma+e.eventbrite+e.meetup>0}var ET="AlertDialog",[_6,G7]=vr(ET,[nN]),zo=nN(),jT=e=>{const{__scopeAlertDialog:t,...n}=e,r=zo(t);return i.jsx(Gx,{...r,...n,modal:!0})};jT.displayName=ET;var k6="AlertDialogTrigger",S6=d.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=zo(n);return i.jsx(uz,{...s,...r,ref:t})});S6.displayName=k6;var C6="AlertDialogPortal",NT=e=>{const{__scopeAlertDialog:t,...n}=e,r=zo(t);return i.jsx(Jx,{...r,...n})};NT.displayName=C6;var E6="AlertDialogOverlay",TT=d.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=zo(n);return i.jsx(om,{...s,...r,ref:t})});TT.displayName=E6;var oc="AlertDialogContent",[j6,N6]=_6(oc),T6=LE("AlertDialogContent"),PT=d.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,o=zo(n),a=d.useRef(null),l=Pe(t,a),c=d.useRef(null);return i.jsx(iz,{contentName:oc,titleName:RT,docsSlug:"alert-dialog",children:i.jsx(j6,{scope:n,cancelRef:c,children:i.jsxs(im,{role:"alertdialog",...o,...s,ref:l,onOpenAutoFocus:ie(s.onOpenAutoFocus,u=>{var f;u.preventDefault(),(f=c.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[i.jsx(T6,{children:r}),i.jsx(R6,{contentRef:a})]})})})});PT.displayName=oc;var RT="AlertDialogTitle",AT=d.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=zo(n);return i.jsx(Qx,{...s,...r,ref:t})});AT.displayName=RT;var IT="AlertDialogDescription",OT=d.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=zo(n);return i.jsx(Xx,{...s,...r,ref:t})});OT.displayName=IT;var P6="AlertDialogAction",MT=d.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=zo(n);return i.jsx(am,{...s,...r,ref:t})});MT.displayName=P6;var LT="AlertDialogCancel",DT=d.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=N6(LT,n),o=zo(n),a=Pe(t,s);return i.jsx(am,{...o,...r,ref:a})});DT.displayName=LT;var R6=({contentRef:e})=>{const t=`\`${oc}\` requires a description for the component to be accessible for screen reader users.
364
365You can add a description to the \`${oc}\` by passing a \`${IT}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
366
367Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${oc}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
368
369For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return d.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},A6=jT,I6=NT,$T=TT,UT=PT,FT=MT,zT=DT,BT=AT,WT=OT;const Rt=A6,O6=I6,HT=d.forwardRef(({className:e,...t},n)=>i.jsx($T,{className:X("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));HT.displayName=$T.displayName;const St=d.forwardRef(({className:e,...t},n)=>i.jsxs(O6,{children:[i.jsx(HT,{}),i.jsx(UT,{ref:n,className:X("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rou
369nded-lg",e),...t})]}));St.displayName=UT.displayName;const Ct=({className:e,...t})=>i.jsx("div",{className:X("flex flex-col space-y-2 text-center sm:text-left",e),...t});Ct.displayName="AlertDialogHeader";const Et=({className:e,...t})=>i.jsx("div",{className:X("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Et.displayName="AlertDialogFooter";const jt=d.forwardRef(({className:e,...t},n)=>i.jsx(BT,{ref:n,className:X("text-lg font-semibold",e),...t}));jt.displayName=BT.displayName;const Nt=d.forwardRef(({className:e,...t},n)=>i.jsx(WT,{ref:n,className:X("text-sm text-muted-foreground",e),...t}));Nt.displayName=WT.displayName;const ln=d.forwardRef(({className:e,...t},n)=>i.jsx(FT,{ref:n,className:X(pd(),e),...t}));ln.displayName=FT.displayName;const cn=d.forwardRef(({className:e,...t},n)=>i.jsx(zT,{ref:n,className:X(pd({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));cn.displayName=zT.displayName;var M6="Label",KT=d.forwardRef((e,t)=>i.jsx(ve.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));KT.displayName=M6;var qT=KT;const L6=Nx("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),_t=d.forwardRef(({className:e,...t},n)=>i.jsx(qT,{ref:n,className:X(L6(),e),...t}));_t.displayName=qT.displayName;var xm="Switch",[D6,J7]=vr(xm),[$6,U6]=D6(xm),VT=d.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:o,required:a,disabled:l,value:c="on",onCheckedChange:u,form:f,...p}=e,[h,m]=d.useState(null),v=Pe(t,b=>m(b)),g=d.useRef(!1),x=h?f||!!h.closest("form"):!0,[w,y]=ro({prop:s,defaultProp:o??!1,onChange:u,caller:xm});return i.jsxs($6,{scope:n,checked:w,disabled:l,children:[i.jsx(ve.button,{type:"button",role:"switch","aria-checked":w,"aria-required":a,"data-state":QT(w),"data-disabled":l?"":void 0,disabled:l,value:c,...p,ref:v,onClick:ie(e.onClick,b=>{y(_=>!_),x&&(g.current=b.isPropagationStopped(),g.current||b.stopPropagation())})}),x&&i.jsx(JT,{control:h,bubbles:!g.current,name:r,value:c,checked:w,required:a,disabled:l,form:f,style:{transform:"translateX(-100%)"}})]})});VT.displayName=xm;var YT="SwitchThumb",GT=d.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=U6(YT,n);return i.jsx(ve.span,{"data-state":QT(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});GT.displayName=YT;var F6="SwitchBubbleInput",JT=d.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},o)=>{const a=d.useRef(null),l=Pe(a,o),c=ub(n),u=ab(t);return d.useEffect(()=>{const f=a.current;if(!f)return;const p=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(p,"checked").set;if(c!==n&&m){const v=new Event("click",{bubbles:r});m.call(f,n),f.dispatchEvent(v)}},[c,n,r]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:l,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});JT.displayName=F6;function QT(e){return e?"checked":"unchecked"}var XT=VT,z6=GT;const ZT=d.forwardRef(({className:e,...t},n)=>i.jsx(XT,{className:X("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",e),...t,ref:n,children:i.jsx(z6,{className:X("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));ZT.displayName=XT.displayName;var Te=function(){return Te=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Te.apply(this,arguments)};function B6(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function eP(e,t,n){for(var r=0,s=t.length,o;r<s;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function Qd(e){return e.mode==="multiple"}function Xd(e){return e.mode==="range"}function bm(e){return e.mode==="single"}var W6={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rd
369p-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function H6(e,t){return tn(e,"LLLL y",t)}function K6(e,t){return tn(e,"d",t)}function q6(e,t){return tn(e,"LLLL",t)}function V6(e){return"".concat(e)}function Y6(e,t){return tn(e,"cccccc",t)}function G6(e,t){return tn(e,"yyyy",t)}var J6=Object.freeze({__proto__:null,formatCaption:H6,formatDay:K6,formatMonthCaption:q6,formatWeekNumber:V6,formatWeekdayName:Y6,formatYearCaption:G6}),Q6=function(e,t,n){return tn(e,"do MMMM (EEEE)",n)},X6=function(){return"Month: "},Z6=function(){return"Go to next month"},eW=function(){return"Go to previous month"},tW=function(e,t){return tn(e,"cccc",t)},nW=function(e){return"Week n. ".concat(e)},rW=function(){return"Year: "},sW=Object.freeze({__proto__:null,labelDay:Q6,labelMonthDropdown:X6,labelNext:Z6,labelPrevious:eW,labelWeekNumber:nW,labelWeekday:tW,labelYearDropdown:rW});function oW(){var e="buttons",t=W6,n=ZE,r={},s={},o=1,a={},l=new Date;return{captionLayout:e,classNames:t,formatters:J6,labels:sW,locale:n,modifiersClassNames:r,modifiers:s,numberOfMonths:o,styles:a,today:l,mode:"default"}}function iW(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,s=e.toMonth,o=e.fromDate,a=e.toDate;return r?o=Lr(r):t&&(o=new Date(t,0,1)),s?a=Ax(s):n&&(a=new Date(n,11,31)),{fromDate:o?Ec(o):void 0,toDate:a?Ec(a):void 0}}var tP=d.createContext(void 0);function aW(e){var t,n=e.initialProps,r=oW(),s=iW(n),o=s.fromDate,a=s.toDate,l=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;l!=="buttons"&&(!o||!a)&&(l="buttons");var c;(bm(n)||Qd(n)||Xd(n))&&(c=n.onSelect);var u=Te(Te(Te({},r),n),{captionLayout:l,classNames:Te(Te({},r.classNames),n.classNames),components:Te({},n.components),formatters:Te(Te({},r.formatters),n.formatters),fromDate:o,labels:Te(Te({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:Te(Te({},r.modifiers),n.modifiers),modifiersClassNames:Te(Te({},r.modifiersClassNames),n.modifiersClassNames),onSelect:c,styles:Te(Te({},r.styles),n.styles),toDate:a});return i.jsx(tP.Provider,{value:u,children:e.children})}function Ht(){var e=d.useContext(tP);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function nP(e){var t=Ht(),n=t.locale,r=t.classNames,s=t.styles,o=t.formatters.formatCaption;return i.jsx("div",{className:r.caption_label,style:s.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:o(e.displayMonth,{locale:n})})}function lW(e){return i.jsx("svg",Te({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:i.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function rP(e){var t,n,r=e.onChange,s=e.value,o=e.children,a=e.caption,l=e.className,c=e.style,u=Ht(),f=(n=(t=u.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:lW;return i.jsxs("div",{className:l,style:c,children:[i.jsx("span",{className:u.classNames.vhidden,children:e["aria-label"]}),i.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:u.classNames.dropdown,style:u.styles.dropdown,value:s,onChange:r,children:o}),i.jsxs("div",{className:u.classNames.caption_label,style:u.styles.caption_label,"aria-hidden":"true",children:[a,i.jsx(f,{className:u.classNames.dropdown_icon,style:u.styles.dropdown_icon})]})]})}function cW(e){var t,n=Ht(),r=n.fromDate,s=n.toDate,o=n.styles,a=n.locale,l=n.formatters.formatMonthCaption,c=n.classNames,u=n.components,f=n.labels.labelMonthDropdown;if(!r)return i.jsx(i.Fragment,{});if(!s)return i.jsx(i.Fragment,{});var p=[];if(H$(r,s))for(var h=Lr(r),m=r.getMonth();m<=s.getMonth();m++)p.push(Pg(h,m));else for(var h=Lr(new Date),m=0;m<=11;m++)p.push(Pg(h,m));var v=function(x){var w=Number(x.target.value),y=Pg(Lr(e.displayMonth),w);e.onChange(y)},g=(t=u==null?void 0:u.Dropdown)!==null&&t!==void 0?t:rP;return i.jsx(g,{name:"months","aria-label":f(),className:c.dropdown_month,style:o.dropdown_month,onChange:v,value:e.displayMonth.getMonth(),c
369aption:l(e.displayMonth,{locale:a}),children:p.map(function(x){return i.jsx("option",{value:x.getMonth(),children:l(x,{locale:a})},x.getMonth())})})}function uW(e){var t,n=e.displayMonth,r=Ht(),s=r.fromDate,o=r.toDate,a=r.locale,l=r.styles,c=r.classNames,u=r.components,f=r.formatters.formatYearCaption,p=r.labels.labelYearDropdown,h=[];if(!s)return i.jsx(i.Fragment,{});if(!o)return i.jsx(i.Fragment,{});for(var m=s.getFullYear(),v=o.getFullYear(),g=m;g<=v;g++)h.push(j_(QE(new Date),g));var x=function(y){var b=j_(Lr(n),Number(y.target.value));e.onChange(b)},w=(t=u==null?void 0:u.Dropdown)!==null&&t!==void 0?t:rP;return i.jsx(w,{name:"years","aria-label":p(),className:c.dropdown_year,style:l.dropdown_year,onChange:x,value:n.getFullYear(),caption:f(n,{locale:a}),children:h.map(function(y){return i.jsx("option",{value:y.getFullYear(),children:f(y,{locale:a})},y.getFullYear())})})}function dW(e,t){var n=d.useState(e),r=n[0],s=n[1],o=t===void 0?r:t;return[o,s]}function fW(e){var t=e.month,n=e.defaultMonth,r=e.today,s=t||n||r||new Date,o=e.toDate,a=e.fromDate,l=e.numberOfMonths,c=l===void 0?1:l;if(o&&md(o,s)<0){var u=-1*(c-1);s=Os(o,u)}return a&&md(s,a)<0&&(s=a),Lr(s)}function hW(){var e=Ht(),t=fW(e),n=dW(t,e.month),r=n[0],s=n[1],o=function(a){var l;if(!e.disableNavigation){var c=Lr(a);s(c),(l=e.onMonthChange)===null||l===void 0||l.call(e,c)}};return[r,o]}function pW(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,s=Lr(e),o=Lr(Os(s,r)),a=md(o,s),l=[],c=0;c<a;c++){var u=Os(s,c);l.push(u)}return n&&(l=l.reverse()),l}function mW(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,s=t.numberOfMonths,o=s===void 0?1:s,a=r?o:1,l=Lr(e);if(!n)return Os(l,a);var c=md(n,e);if(!(c<o))return Os(l,a)}}function gW(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,s=t.numberOfMonths,o=s===void 0?1:s,a=r?o:1,l=Lr(e);if(!n)return Os(l,-a);var c=md(l,n);if(!(c<=0))return Os(l,-a)}}var sP=d.createContext(void 0);function yW(e){var t=Ht(),n=hW(),r=n[0],s=n[1],o=pW(r,t),a=mW(r,t),l=gW(r,t),c=function(p){return o.some(function(h){return Ox(p,h)})},u=function(p,h){c(p)||(h&&sj(p,h)?s(Os(p,1+t.numberOfMonths*-1)):s(p))},f={currentMonth:r,displayMonths:o,goToMonth:s,goToDate:u,previousMonth:l,nextMonth:a,isDateDisplayed:c};return i.jsx(sP.Provider,{value:f,children:e.children})}function Zd(){var e=d.useContext(sP);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function $k(e){var t,n=Ht(),r=n.classNames,s=n.styles,o=n.components,a=Zd().goToMonth,l=function(f){a(Os(f,e.displayIndex?-e.dis
369playIndex:0))},c=(t=o==null?void 0:o.CaptionLabel)!==null&&t!==void 0?t:nP,u=i.jsx(c,{id:e.id,displayMonth:e.displayMonth});return i.jsxs("div",{className:r.caption_dropdowns,style:s.caption_dropdowns,children:[i.jsx("div",{className:r.vhidden,children:u}),i.jsx(cW,{onChange:l,displayMonth:e.displayMonth}),i.jsx(uW,{onChange:l,displayMonth:e.displayMonth})]})}function vW(e){return i.jsx("svg",Te({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:i.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function wW(e){return i.jsx("svg",Te({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:i.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var pp=d.forwardRef(function(e,t){var n=Ht(),r=n.classNames,s=n.styles,o=[r.button_reset,r.button];e.className&&o.push(e.className);var a=o.join(" "),l=Te(Te({},s.button_reset),s.button);return e.style&&Object.assign(l,e.style),i.jsx("button",Te({},e,{ref:t,type:"button",className:a,style:l}))});function xW(e){var t,n,r=Ht(),s=r.dir,o=r.locale,a=r.classNames,l=r.styles,c=r.labels,u=c.labelPrevious,f=c.labelNext,p=r.components;if(!e.nextMonth&&!e.previousMonth)return i.jsx(i.Fragment,{});var h=u(e.previousMonth,{locale:o}),m=[a.nav_button,a.nav_button_previous].join(" "),v=f(e.nextMonth,{locale:o}),g=[a.nav_button,a.nav_button_next].join(" "),x=(t=p==null?void 0:p.IconRight)!==null&&t!==void 0?t:wW,w=(n=p==null?void 0:p.IconLeft)!==null&&n!==void 0?n:vW;return i.jsxs("div",{className:a.nav,style:l.nav,children:[!e.hidePrevious&&i.jsx(pp,{name:"previous-month","aria-label":h,className:m,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:s==="rtl"?i.jsx(x,{className:a.nav_icon,style:l.nav_icon}):i.jsx(w,{className:a.nav_icon,style:l.nav_icon})}),!e.hideNext&&i.jsx(pp,{name:"next-month","aria-label":v,className:g,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:s==="rtl"?i.jsx(w,{className:a.nav_icon,style:l.nav_icon}):i.jsx(x,{className:a.nav_icon,style:l.nav_icon})})]})}function Uk(e){var t=Ht().numberOfMonths,n=Zd(),r=n.previousMonth,s=n.nextMonth,o=n.goToMonth,a=n.displayMonths,l=a.findIndex(function(v){return Ox(e.displayMonth,v)}),c=l===0,u=l===a.length-1,f=t>1&&(c||!u),p=t>1&&(u||!c),h=function(){r&&o(r)},m=function(){s&&o(s)};return i.jsx(xW,{displayMonth:e.displayMonth,hideNext:f,hidePrevious:p,nextMonth:s,previousMonth:r,onPreviousClick:h,onNextClick:m})}function bW(e){var t,n=Ht(),r=n.classNames,s=n.disableNavigation,o=n.styles,a=n.captionLayout,l=n.components,c=(t=l==null?void 0:l.CaptionLabel)!==null&&t!==void 0?t:nP,u;return s?u=i.jsx(c,{id:e.id,displayMonth:e.displayMonth}):a==="dropdown"?u=i.jsx($k,{displayMonth:e.displayMonth,id:e.id}):a==="dropdown-buttons"?u=i.jsxs(i.Fragment,{children:[i.jsx($k,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),i.jsx(Uk,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):u=i.jsxs(i.Fragment,{children:[i.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),i.jsx(Uk,{displayMonth:e.displayMonth,id:e.id})]}),i.jsx("div",{className:r.caption,style:o.caption,children:u})}function _W(e){var t=Ht(),n=t.footer,r=t.styles,s=t.classNames.tfoot;return n?i.jsx("tfoot",{className:s,style:r.tfoot,children:i.jsx("tr",{children:i.jsx("td",{colSpan:8,children:n})})}):i.jsx(i.Fragment,{})}function kW(e,t,n){for(var r=n?$a(new Date):no(new Date,{locale:e,weekStartsOn:t}),s=[],o=0;o<7;o++){var a=fr(r,o);s.push(a)}return s}function SW(){var e=Ht(),t=e.classNames,n=e.styles,r=e.showWeekNumber,s=e.locale,o=e.weekStartsOn,a=e.ISOWeek,l=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,u=kW(s,o,a);return i.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&i.jsx("td",{style:n.head_cell,className:t.head_cell}),u.map(function(f,p){return i.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":c(f,{locale:s}),children:l(f,{locale:s})},p)})]})}function CW(){var e,t=Ht(),n=t.classNames,r=t.styles,s=t.components,o=(e=s==null?void 0:s.HeadRow)!==null&&e!==void 0?e:SW;return i.jsx("thead",{style:r.head,className:n.head,children:i.jsx(o,{})})}function EW(e){var t=Ht(),n=t.locale,r=t.formatters.formatDay;return i.jsx(i.Fragment,{children:r(e.date,{locale:n})})}var fb=d.createContext(void 0);function jW(e){if(!Qd(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return i.jsx(fb.Provider,{value:t,children:e.children})}return i.jsx(NW,{initialProps:e.initialProps,children:e.children})}function NW(e){var t=e.initialProps,n=e.children,r=t.selected,s=t.min,o=t.max,a=function(u,f,p){var h,m;(h=t.onDayClick)===null||h===void 0||h.call(t,u,f,p);var v=!!(f.selected&&s&&(r==null?void 0:r.length)===s);if(!v){var g=!!(!f.selected&&o&&(r==null?void 0:r.length)===o);if(!g){var x=r?eP([],r):[];if(f.selected){var w=x.findIndex(function(y){return or(u,y)});x.splice(w,1)}else x.push(u);(m=t.onSelect)===null||m===void 0||m.call(t,x,u,f,p)}}},l={disabled:[]};r&&l.disabled.push(function(u){var f=o&&r.length>
369o-1,p=r.some(function(h){return or(h,u)});return!!(f&&!p)});var c={selected:r,onDayClick:a,modifiers:l};return i.jsx(fb.Provider,{value:c,children:n})}function hb(){var e=d.useContext(fb);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function TW(e,t){var n=t||{},r=n.from,s=n.to;return r&&s?or(s,e)&&or(r,e)?void 0:or(s,e)?{from:s,to:void 0}:or(r,e)?void 0:_v(r,e)?{from:e,to:s}:{from:r,to:e}:s?_v(e,s)?{from:s,to:e}:{from:e,to:s}:r?sj(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var pb=d.createContext(void 0);function PW(e){if(!Xd(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return i.jsx(pb.Provider,{value:t,children:e.children})}return i.jsx(RW,{initialProps:e.initialProps,children:e.children})}function RW(e){var t=e.initialProps,n=e.children,r=t.selected,s=r||{},o=s.from,a=s.to,l=t.min,c=t.max,u=function(m,v,g){var x,w;(x=t.onDayClick)===null||x===void 0||x.call(t,m,v,g);var y=TW(m,r);(w=t.onSelect)===null||w===void 0||w.call(t,y,m,v,g)},f={range_start:[],range_end:[],range_middle:[],disabled:[]};if(o?(f.range_start=[o],a?(f.range_end=[a],or(o,a)||(f.range_middle=[{after:o,before:a}])):f.range_end=[o]):a&&(f.range_start=[a],f.range_end=[a]),l&&(o&&!a&&f.disabled.push({after:vh(o,l-1),before:fr(o,l-1)}),o&&a&&f.disabled.push({after:o,before:fr(o,l-1)}),!o&&a&&f.disabled.push({after:vh(a,l-1),before:fr(a,l-1)})),c){if(o&&!a&&(f.disabled.push({before:fr(o,-c+1)}),f.disabled.push({after:fr(o,c-1)})),o&&a){var p=Gs(a,o)+1,h=c-p;f.disabled.push({before:vh(o,h)}),f.disabled.push({after:fr(a,h)})}!o&&a&&(f.disabled.push({before:fr(a,-c+1)}),f.disabled.push({after:fr(a,c-1)}))}return i.jsx(pb.Provider,{value:{selected:r,onDayClick:u,modifiers:f},children:n})}function mb(){var e=d.useContext(pb);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function kh(e){return Array.isArray(e)?eP([],e):e!==void 0?[e]:[]}function AW(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],s=n[1];t[r]=kh(s)}),t}var Ds;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(Ds||(Ds={}));var IW=Ds.Selected,go=Ds.Disabled,OW=Ds.Hidden,MW=Ds.Today,Qg=Ds.RangeEnd,Xg=Ds.RangeMiddle,Zg=Ds.RangeStart,LW=Ds.Outside;function DW(e,t,n){var r,s=(r={},r[IW]=kh(e.selected),r[go]=kh(e.disabled),r[OW]=kh(e.hidden),r[MW]=[e.today],r[Qg]=[],r[Xg]=[],r[Zg]=[],r[LW]=[],r);return e.fromDate&&s[go].push({before:e.fromDate}),e.toDate&&s[go].push({after:e.toDate}),Qd(e)?s[go]=s[go].concat(t.modifiers[go]):Xd(e)&&(s[go]=s[go].concat(n.modifiers[go]),s[Zg]=n.modifiers[Zg],s[Xg]=n.modifiers[Xg],s[Qg]=n.modifiers[Qg]),s}var oP=d.createContext(void 0);function $W(e){var t=Ht(),n=hb(),r=mb(),s=DW(t,n,r),o=AW(t.modifiers),a=Te(Te({},s),o);return i.jsx(oP.Provider,{value:a,children:e.children})}function iP(){var e=d.useContext(oP);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function UW(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function FW(e){return!!(e&&typeof e=="object"&&"from"in e)}function zW(e){return!!(e&&typeof e=="object"&&"after"in e)}function BW(e){return!!(e&&typeof e=="object"&&"before"in e)}function WW(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function HW(e,t){var n,r=t.from,s=t.to;if(r&&s){var o=Gs(s,r)<0;o&&(n=[s,r],r=n[0],s=n[1]);var a=Gs(e,r)>=0&&Gs(s,e)>=0;return a}return s?or(s,e):r?or(r,e):!1}function KW(e){return Rx(e)}function qW(e){return Array.isArray(e)&&e.every(Rx)}function VW(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(KW(n))return or(e,n);if(qW(n))return n.includes(e);if(FW(n))return HW(e,n);if(WW(n))return n.dayOfWeek.includes(e.getDay());if(UW(n)){var r=Gs(n.before,e),s=Gs(n.after,e),o=r>0,a=s<0,l=_v(n.before,n.after);return l?a&&o:o||a}return zW(n)?Gs(e,n.after)>0:BW(n)?Gs(n.before,e)>0:typeof n=="function"?n(e):!1})}function gb(e,t,n){var r=Object.keys(t).reduce(function(o,a){var l=t[a];return VW(e,l)&&o.push(a),o},[]),s={};return r.forEach(function(o){return s[o]=!0}),n&&!Ox(e,n)&&(s.outside=!0),s}function YW(e,t){for(var n=Lr(e[0]),r=Ax(e[e.length-1]),s,o,a=n;a<=r;){var l=gb(a,t),c=!l.disabled&&!l.hidden;if(!c){a=fr(a,1);continue}if(l.selected)return a;l.today&&!o&&(o=a),s||(s=a),a=fr(a,1)}return o||s}var GW=365;function aP(e,t){var n=t.moveBy,r=t.direction,s=t.context,o=t.modifiers,a=t.retry,l=a===void 0?{count:0,lastFocused:e}:a,c=s.weekStartsOn,u=s.fromDate,f=s.toDate,p=s.locale,h={day:fr,week:tc,month:Os,year:$D,startOfWeek:function(x){return s.ISOWeek?$a(x):no(x,{locale:p,weekStartsOn:c})},endOfWeek:function(x){return s.ISOWeek?XE(x):Ix(x,{locale:p,weekStartsOn:c})}},m=h[n](e,r==="after"?1:-1);r==="before"&&u?m=UD([u,m]):r==="after"&&f&&(m=FD([f,m]));var v=!0;if(o){var g=gb(m,o);v=!g.disabled&&!g.hidden}return v?m:l.count>GW?l.lastFocused:aP(m,{moveBy:n,direction:r,context:s,modifiers:o,retry:Te(Te({},l),{count:l.count+1})})}var lP=d.createContext(void 0);function JW(e){var t=Zd(),n=iP(),r=d.useState(),s=r[0],o=r[1],a=d.useState(),l=a[0],c=a[1],u=YW(t.displayMonths,n),f=s??(l&&t.isDateDisplayed(l))?l:u,p=function(){c(s),o(void 0)},h=function(x){o(x)},m=Ht(),v=function(x,w){if(s){var y=aP(s,{moveBy:x,direction:w,context:m,modifiers:n});or(s,y)||(t.goToDate(y,s),h(y))}},g={focusedDay:s,focusTarget:f,blur:p,focus:h,focusDayAfter:function(){return v("day","after")},focusDayBefore:function(){return v("day","before")},focusWeekAfter:function(){return v("week","after")},focusWeekBefore:function(){return v("week","before")},focusMonthBefore:function(){return v("month","before")},focusMonthAfter:function(){return v("month","after")},focusYearBefore:function(){return v("year","before")},focusYearAfter:function(){return v("year","after")},focusStartOfWeek:function(){return v("startOfWeek","before")},focusEndOfWeek:function(){return v("endOfWeek","after")}};return i.jsx(lP.Provider,{value:g,children:e.children})}function yb(){var e=d.useContext(lP);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function QW(e,t){var n=iP(),r=gb(e,n,t);return r}var vb=d.createContext(void 0);function XW(e){if(!bm(e.initialProps)){var t={selected:void 0};return i.jsx(vb.Provider,{value:t,children:e.children})}return i.jsx(ZW,{initialProps:e.initialProps,children:e.children})}function ZW(e){var t=e.initialProps,n=e.children,r=function(o,a,l){var c,u,f;
369if((c=t.onDayClick)===null||c===void 0||c.call(t,o,a,l),a.selected&&!t.required){(u=t.onSelect)===null||u===void 0||u.call(t,void 0,o,a,l);return}(f=t.onSelect)===null||f===void 0||f.call(t,o,o,a,l)},s={selected:t.selected,onDayClick:r};return i.jsx(vb.Provider,{value:s,children:n})}function cP(){var e=d.useContext(vb);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function e8(e,t){var n=Ht(),r=cP(),s=hb(),o=mb(),a=yb(),l=a.focusDayAfter,c=a.focusDayBefore,u=a.focusWeekAfter,f=a.focusWeekBefore,p=a.blur,h=a.focus,m=a.focusMonthBefore,v=a.focusMonthAfter,g=a.focusYearBefore,x=a.focusYearAfter,w=a.focusStartOfWeek,y=a.focusEndOfWeek,b=function(D){var j,N,W,G;bm(n)?(j=r.onDayClick)===null||j===void 0||j.call(r,e,t,D):Qd(n)?(N=s.onDayClick)===null||N===void 0||N.call(s,e,t,D):Xd(n)?(W=o.onDayClick)===null||W===void 0||W.call(o,e,t,D):(G=n.onDayClick)===null||G===void 0||G.call(n,e,t,D)},_=function(D){var j;h(e),(j=n.onDayFocus)===null||j===void 0||j.call(n,e,t,D)},k=function(D){var j;p(),(j=n.onDayBlur)===null||j===void 0||j.call(n,e,t,D)},C=function(D){var j;(j=n.onDayMouseEnter)===null||j===void 0||j.call(n,e,t,D)},E=function(D){var j;(j=n.onDayMouseLeave)===null||j===void 0||j.call(n,e,t,D)},A=function(D){var j;(j=n.onDayPointerEnter)===null||j===void 0||j.call(n,e,t,D)},T=function(D){var j;(j=n.onDayPointerLeave)===null||j===void 0||j.call(n,e,t,D)},M=function(D){var j;(j=n.onDayTouchCancel)===null||j===void 0||j.call(n,e,t,D)},P=function(D){var j;(j=n.onDayTouchEnd)===null||j===void 0||j.call(n,e,t,D)},$=function(D){var j;(j=n.onDayTouchMove)===null||j===void 0||j.call(n,e,t,D)},H=function(D){var j;(j=n.onDayTouchStart)===null||j===void 0||j.call(n,e,t,D)},z=function(D){var j;(j=n.onDayKeyUp)===null||j===void 0||j.call(n,e,t,D)},B=function(D){var j;switch(D.key){case"ArrowLeft":D.preventDefault(),D.stopPropagation(),n.dir==="rtl"?l():c();break;case"ArrowRight":D.preventDefault(),D.stopPropagation(),n.dir==="rtl"?c():l();break;case"ArrowDown":D.preventDefault(),D.stopPropagation(),u();break;case"ArrowUp":D.preventDefault(),D.stopPropagation(),f();break;case"PageUp":D.preventDefault(),D.stopPropagation(),D.shiftKey?g():m();break;case"PageDown":D.preventDefault(),D.stopPropagation(),D.shiftKey?x():v();break;case"Home":D.preventDefault(),D.stopPropagation(),w();break;case"End":D.preventDefault(),D.stopPropagation(),y();break}(j=n.onDayKeyDown)===null||j===void 0||j.call(n,e,t,D)},U={onClick:b,onFocus:_,onBlur:k,onKeyDown:B,onKeyUp:z,onMouseEnter:C,onMouseLeave:E,onPointerEnter:A,onPointerLeave:T,onTouchCancel:M,onTouchEnd:P,onTouchMove:$,onTouchStart:H};return U}function t8(){var e=Ht(),t=cP(),n=hb(),r=mb(),s=bm(e)?t.selected:Qd(e)?n.selected:Xd(e)?r.selected:void 0;return s}function n8(e){return Object.values(Ds).includes(e)}function r8(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var s=e.modifiersClassNames[r];if(s)n.push(s);else if(n8(r)){var o=e.classNames["day_".concat(r)];o&&n.push(o)}}),n}function s8(e,t){var n=Te({},e.styles.day);return Object.keys(t).forEach(function(r){var s;n=Te(Te({},n),(s=e.modifiersStyles)===null||s===void 0?void 0:s[r])}),n}function o8(e,t,n){var r,s,o,a=Ht(),l=yb(),c=QW(e,t),u=e8(e,c),f=t8(),p=!!(a.onDayCl
369ick||a.mode!=="default");d.useEffect(function(){var C;c.outside||l.focusedDay&&p&&or(l.focusedDay,e)&&((C=n.current)===null||C===void 0||C.focus())},[l.focusedDay,e,n,p,c.outside]);var h=r8(a,c).join(" "),m=s8(a,c),v=!!(c.outside&&!a.showOutsideDays||c.hidden),g=(o=(s=a.components)===null||s===void 0?void 0:s.DayContent)!==null&&o!==void 0?o:EW,x=i.jsx(g,{date:e,displayMonth:t,activeModifiers:c}),w={style:m,className:h,children:x,role:"gridcell"},y=l.focusTarget&&or(l.focusTarget,e)&&!c.outside,b=l.focusedDay&&or(l.focusedDay,e),_=Te(Te(Te({},w),(r={disabled:c.disabled,role:"gridcell"},r["aria-selected"]=c.selected,r.tabIndex=b||y?0:-1,r)),u),k={isButton:p,isHidden:v,activeModifiers:c,selectedDays:f,buttonProps:_,divProps:w};return k}function i8(e){var t=d.useRef(null),n=o8(e.date,e.displayMonth,t);return n.isHidden?i.jsx("div",{role:"gridcell"}):n.isButton?i.jsx(pp,Te({name:"day",ref:t},n.buttonProps)):i.jsx("div",Te({},n.divProps))}function a8(e){var t=e.number,n=e.dates,r=Ht(),s=r.onWeekNumberClick,o=r.styles,a=r.classNames,l=r.locale,c=r.labels.labelWeekNumber,u=r.formatters.formatWeekNumber,f=u(Number(t),{locale:l});if(!s)return i.jsx("span",{className:a.weeknumber,style:o.weeknumber,children:f});var p=c(Number(t),{locale:l}),h=function(m){s(t,n,m)};return i.jsx(pp,{name:"week-number","aria-label":p,className:a.weeknumber,style:o.weeknumber,onClick:h,children:f})}function l8(e){var t,n,r=Ht(),s=r.styles,o=r.classNames,a=r.showWeekNumber,l=r.components,c=(t=l==null?void 0:l.Day)!==null&&t!==void 0?t:i8,u=(n=l==null?void 0:l.WeekNumber)!==null&&n!==void 0?n:a8,f;return a&&(f=i.jsx("td",{className:o.cell,style:s.cell,children:i.jsx(u,{number:e.weekNumber,dates:e.dates})})),i.jsxs("tr",{className:o.row,style:s.row,children:[f,e.dates.map(function(p){return i.jsx("td",{className:o.cell,style:s.cell,role:"presentation",children:i.jsx(c,{displayMonth:e.displayMonth,date:p})},z$(p))})]})}function Fk(e,t,n){for(var r=n!=null&&n.ISOWeek?XE(t):Ix(t,n),s=n!=null&&n.ISOWeek?$a(e):no(e,n),o=Gs(r,s),a=[],l=0;l<=o;l++)a.push(fr(s,l));var c=a.reduce(function(u,f){var p=n!=null&&n.ISOWeek?ej(f):nj(f,n),h=u.find(function(m){return m.weekNumber===p});return h?(h.dates.push(f),u):(u.push({weekNumber:p,dates:[f]}),u)},[]);return c}function c8(e,t){var n=Fk(Lr(e),Ax(e),t);if(t!=null&&t.useFixedWeeks){var r=W$(e,t);if(r<6){var s=n[n.length-1],o=s.dates[s.dates.length-1],a=tc(o,6-r),l=Fk(tc(o,1),a,t);n.push.apply(n,l)}}return n}function u8(e){var t,n,r,s=Ht(),o=s.locale,a=s.classNames,l=s.styles,c=s.hideHead,u=s.fixedWeeks,f=s.components,p=s.weekStartsOn,h=s.firstWeekContainsDate,m=s.ISOWeek,v=c8(e.displayMonth,{useFixedWeeks:!!u,ISOWeek:m,locale:o,weekStartsOn:p,firstWeekContainsDate:h}),g=(t=f==null?void 0:f.Head)!==null&&t!==void 0?t:CW,x=(n=f==null?void 0:f.Row)!==null&&n!==void 0?n:l8,w=(r=f==null?void 0:f.Footer)!==null&&r!==void 0?r:_W;return i.jsxs("table",{id:e.id,className:a.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&i.jsx(g,{}),i.jsx("tbody",{className:a.tbody,style:l.tbody,children:v.map(function(y){return i.jsx(x,{displayMonth:e.displayMonth,dates:y.dates,weekNumber:y.weekNumber},y.weekNumber)})}),i.jsx(w,{displayMonth:e.displayMonth})]})}function d8(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var f8=d8()?d.useLayoutEffect:d.useEffect,ey=!1,h8=0;function zk(){return"react-day-picker-".concat(++h8)}function p8(e){var t,n=e??(ey?zk():null),r=d.useState(n),s=r[0],o=r[1];return f8(function(){s===null&&o(zk())},[]),d.useEffect(function(){ey===!1&&(ey=!0)},[]),(t=e??s)!==null&&t!==void 0?t:void 0}function m8(e){var t,n,r=Ht(),s=r.dir,o=r.classNames,a=r.styles,l=r.components,c=Zd().displayMonths,u=p8(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),f=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,p=[o.month],h=a.month,m=e.displayIndex===0,v=e.displayIndex===c.length-1,g=!m&&!v;s==="rtl"&&(t=[m,v],v=t[0],m=t[1]),m&&(p.push(o.caption_start),h=Te(Te({},h),a.caption_start)),v&&(p.push(o.caption_end),h=Te(Te({},h),a.caption_end)),g&&(p.push(o.caption_between),h=Te(Te({},h),a.caption_between));var x=(n=l==null?void 0:l.Caption)!==null&&n!==void 0?n:bW;return i.jsxs("div",{className:p.join(" "),style:h,children:[i.jsx(x,{id:u,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),i.jsx(u8,{id:f,"aria-labelledby":u,displayMonth:e.displayMonth})]},e.displayIndex)}function g8(e){var t=Ht(),n=t.classNames,r=t.styles;return i.jsx("div",{className:n.months,style:r.months,children:e.children})}function y8(e){var t,n,r=e.initialProps,s=Ht(),o=yb(),a=Zd(),l=d.useState(!1),c=l[0],u=l[1];d.useEffect(function(){s.initialFocus&&o.focusTarget&&(c||(o.focus(o.focusTarget),u(!0)))},[s.initialFocus,c,o.focus,o.focusTarget,o]);var f=[s.classNames.root,s.className];s.numberOfMonths>1&&f.push(s.classNames.multiple_months),s.showWeekNumber&&f.push(s.classNames.with_weeknumber);var p=Te(Te({},s.styles.root),s.style),h=Object.keys(r).filter(function(v){return v.startsWith("data-")}).reduce(function(v,g){var x;return Te(Te({},v),(x={},x[g]=r[g],x))},{}),m=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:g8;return i.jsx("div",Te({className:f.join(" "),style:p,dir:s.dir,id:s.id,nonce:r.nonce,title:r.title,lang:r.lang},h,{children:i.jsx(m,{children:a.displayMonths.map(function(v,g){return i.jsx(m8,{displayIndex:g,displayMonth:v},g)})})}))}function v8(e){var t=e.children,n=B6(e,["children"]);return i.jsx(aW,{initialProps:n,children:i.jsx(yW,{children:i.jsx(XW,{initialProps:n,children:i.jsx(jW,{initialProps:n,children:i.jsx(PW,{initialProps:n,children:i.jsx($W,{children:i.jsx(JW,{children:t})})})})})})})}function w8(e){return i.jsx(v8,Te({},e,{children:i.jsx(y8,{initialProps:e})}))}function mp({className:e,classNames:t,showOutsideDays:n=!0,...r}){return i.jsx(w8,{showOutsideDays:n,className:X("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:sp
369ace-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:X(pd({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:X(pd({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...s})=>i.jsx(SE,{className:"h-4 w-4"}),IconRight:({...s})=>i.jsx(xo,{className:"h-4 w-4"})},...r})}mp.displayName="Calendar";var _m="Popover",[uP,Q7]=vr(_m,[Hi]),ef=Hi(),[x8,Vi]=uP(_m),dP=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:a=!1}=e,l=ef(t),c=d.useRef(null),[u,f]=d.useState(!1),[p,h]=ro({prop:r,defaultProp:s??!1,onChange:o,caller:_m});return i.jsx(hm,{...l,children:i.jsx(x8,{scope:t,contentId:Gn(),triggerRef:c,open:p,onOpenChange:h,onOpenToggle:d.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:u,onCustomAnchorAdd:d.useCallback(()=>f(!0),[]),onCustomAnchorRemove:d.useCallback(()=>f(!1),[]),modal:a,children:n})})};dP.displayName=_m;var fP="PopoverAnchor",b8=d.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Vi(fP,n),o=ef(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:l}=s;return d.useEffect(()=>(a(),()=>l()),[a,l]),i.jsx(Jd,{...o,...r,ref:t})});b8.displayName=fP;var hP="PopoverTrigger",pP=d.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Vi(hP,n),o=ef(n),a=Pe(t,s.triggerRef),l=i.jsx(ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":wP(s.open),...r,ref:a,onClick:ie(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?l:i.jsx(Jd,{asChild:!0,...o,children:l})});pP.displayName=hP;var wb="PopoverPortal",[_8,k8]=uP(wb,{forceMount:void 0}),mP=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,o=Vi(wb,t);return i.jsx(_8,{scope:t,forceMount:n,children:i.jsx(Qn,{present:n||o.open,children:i.jsx(Wc,{asChild:!0,container:s,children:r})})})};mP.displayName=wb;var Nc="PopoverContent",gP=d.forwardRef((e,t)=>{const n=k8(Nc,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,o=Vi(Nc,e.__scopePopover);return i.jsx(Qn,{present:r||o.open,children:o.modal?i.jsx(C8,{...s,ref:t}):i.jsx(E8,{...s,ref:t})})});gP.displayName=Nc;var S8=Mi("PopoverContent.RemoveScroll"),C8=d.forwardRef((e,t)=>{const n=Vi(Nc,e.__scopePopover),r=d.useRef(null),s=Pe(t,r),o=d.useRef(!1);return d.useEffect(()=>{const a=r.current;if(a)return rm(a)},[]),i.jsx(Yd,{as:S8,allowPinchZoom:!0,children:i.jsx(yP,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ie(e.onCloseAutoFocus,a=>{var l;a.preventDefault(),o.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ie(e.onPointerDownOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;o.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:ie(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),E8=d.forwardRef((e,t)=>{const n=Vi(Nc,e.__scopePopover),r=d.useRef(!1),s=d.useRef(!1);return i.jsx(yP,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,l;(a=e.onCloseAutoFocus)==null||a.call(e,o),o.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),yP=d.forwardRef((e,t)=>
369{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:f,...p}=e,h=Vi(Nc,n),m=ef(n);return tm(),i.jsx(Vd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:i.jsx(Ya,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),children:i.jsx(pm,{"data-state":wP(h.open),role:"dialog",id:h.contentId,...m,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),vP="PopoverClose",j8=d.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Vi(vP,n);return i.jsx(ve.button,{type:"button",...r,ref:t,onClick:ie(e.onClick,()=>s.onOpenChange(!1))})});j8.displayName=vP;var N8="PopoverArrow",T8=d.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=ef(n);return i.jsx(mm,{...s,...r,ref:t})});T8.displayName=N8;function wP(e){return e?"open":"closed"}var P8=dP,R8=pP,A8=mP,xP=gP;const gp=P8,yp=R8,jd=d.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>i.jsx(A8,{children:i.jsx(xP,{ref:s,align:t,sideOffset:n,className:X("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));jd.displayName=xP.displayName;function Yf(e,t,n,r,s,o){const a=new Date(Date.UTC(e,t,n,r,s,0,0)),l=new Intl.DateTimeFormat("en-US",{timeZone:o,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}),c=h=>{const m=l.formatToParts(h),v=x=>{var w;return parseInt(((w=m.find(y=>y.type===x))==null?void 0:w.value)||"0")},g=v("hour")===24?0:v("hour");return new Date(Date.UTC(v("year"),v("month")-1,v("day"),g,v("minute"),v("second")))},u=a.getTime()-c(a).getTime(),f=new Date(a.getTime()+u),p=f.getTime()-c(f).getTime();return p!==u?new Date(a.getTime()+p):f}const I8=["AI — Power Walk","Marketing — Power Walk","Developer — Power Walk","Vibe Coding — Power Walk"],O8=["Park — Reverse Network Meet","Bar — Reverse Network Meet","Rooftop — Reverse Network Meet","Drinks — Reverse Network Meet","Co-working — Reverse Network Meet"],M8=["5 on 5 — Hoopers Meet","3 on 3 — Hoopers Meet","1 - 1 — Hoopers Meet","Free throw shooting — Hoopers Meet","3 point shooting — Hoopers Meet","H-O-R-S-E — Hoopers Meet","Left Hand, Right Hand Shooting — Hoopers Meet"],L8=["In person – coffee – date","In person – walking – date","In person – dinner – date","In person – movie – date","In person – sunset – date","In person – neighborhood explore – date","In person – museum – date","In person – free event – date","In person – library – date","In person – people watching – date","In person – photography – date","In person – workout – date","In person – volunteer – date"],D8=["Founders","Creators","Investors","FinTech","AI","Custom"],$8=" — ",U8=["Founders Tech/AI","Creators","FAQ","Brainstorm","Custom"],F8=" — ",ty={"Online Meet":{recurring:!1},"Weekly Online Meet":{recurring:!0,frequency:"weekly"},"Bi-Weekly Online Meet":{recurring:!0,frequency:"biweekly"},"Monthly Online Meet":{recurring:!0,frequency:"monthly"}},z8={none:"Online Meet",weekly:"Weekly Online Meet",biweekly:"Bi-Weekly Online Meet",monthly:"Monthly Online Meet"},Bk=Array.from({length:48},(e,t)=>{const n=String(Math.floor(t/2)).padStart(2,"0"),r=t%2===0?"00":"30";return`${n}:${r}`}),B8=[{elementType:"geometry",stylers:[{color:"#1a1a2e"}]},{elementType:"labels.text.stroke",stylers:[{color:"#1a1a2e"}]},{elementType:"labels.text.fill",stylers:[{color:"#6b7280"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#2a2a3e"}]},{featureType:"road",elementType:"labels.text.fill",stylers:[{color:"#6b7280"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#0f0f1a"}]},{featureType:"poi",stylers:[{visibility:"off"}]},{featureType:"transit",stylers:[{visibility:"off"}]}];function W8(e){var t;try{const n=new Date,o=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"shortOffset"}).formatToParts(n).find(a=>a.type==="timeZoneName");return((t=o==null?void 0:o.value)==null?void 0:t.replace("GMT","GMT"))??"GMT"}catch{return"GMT"}}function H8(){try{return Intl.supportedValuesOf("timeZone").map(t=>({value:t,label:`${W8(t)} — ${t.replace(/_/g," ")}`}))}catch{return[{value:"UTC",label:"GMT — UTC"}]}}function bl(e){const t=e.trim();return t?/^https?:\/\//i.test(t)?t:`https://${t}`:""}function ny(e){return/^https?:\/\/[^\s]+$/i.test(e)}function ry(e){const[t,n]=e.split(":");let r=parseInt(t,10);const s=r>=12?"PM":"AM";return r===0?r=12:r>12&&(r-=12),`${r}:${n} ${s}`}const K8=({locationData:e})=>{const t=d.useRef(null),n=d.useRef(null),r=d.useRef(null);return d.useEffect(()=>{var o;if(!t.current||!window.google||e.lat==null||e.lng==null)return;const s={lat:e.lat,lng:e.lng};n.current?(n.current.setCenter(s),(o=r.current)==null||o.setPosition(s)):(n.current=ne
369w window.google.maps.Map(t.current,{center:s,zoom:14,styles:B8,disableDefaultUI:!0,zoomControl:!0}),r.current=new window.google.maps.Marker({position:s,map:n.current}))},[e.lat,e.lng]),i.jsx("div",{ref:t,className:"rounded-lg overflow-hidden border border-border h-[250px] w-full"})},iw=({open:e,onOpenChange:t,localUserId:n,mode:r="create",event:s,eventDateObj:o,singleInstance:a,resetOverrides:l,onRequestDelete:c,onRequestDuplicate:u,importPrefill:f})=>{const p=Wi(),h=Dr(),{activeUsername:m}=ao(),{isAdmin:v}=Fo(),g=pt(),x=g.siteKey,w=r==="edit"&&!!(o!=null&&o.start_time)&&new Date(o.start_time).getTime()<=Date.now(),y=x==="foodclubmeets"?2:1,b=x==="inpersondates",k=!!n&&!!(s!=null&&s.creator_id)&&n===s.creator_id||v,C=Array.isArray(s==null?void 0:s.polls)&&s.polls.some(I=>I.poll_type==="location"),E=b&&r!=="create"&&C&&!k,A=x==="hoopersmeets"?M8:x==="reversenetwork"?O8:b?L8:I8,T=x==="hoopersmeets"?"Hoopers Meet":x==="reversenetwork"?"Reverse Network Meet":"Power Walk",M=x==="foodclubmeets",P=x==="connectonlinemeets",$=M||P,H=P?U8:D8,z=P?Wj:Bj,B=P?F8:$8,[U,D]=d.useState(""),[j,N]=d.useState(""),[W,G]=d.useState(""),[L,K]=d.useState(""),[J,Z]=d.useState(""),[ce,q]=d.useState(""),[me,oe]=d.useState(""),[ae,fe]=d.useState(""),ge=P?ce:W,$e=P?q:G,tt=P?me:L,Lt=P?oe:K,ut=P?ae:J,Nn=P?fe:Z,[Ae,Xn]=d.useState(),[rn,ar]=d.useState("16:00"),[In,On]=d.useState(()=>Intl.DateTimeFormat().resolvedOptions().timeZone),[xr,Ur]=d.useState(""),[Q,V]=d.use
369State(null),[je,Me]=d.useState("public"),[xt,lr]=d.useState("no"),[br,Zn]=d.useState(""),[Xt,rs]=d.useState("unlimited"),[Kt,bn]=d.useState("10"),[qt,Fr]=d.useState(!1),[sn,Fe]=d.useState("weekly"),[_n,dt]=d.useState("4"),[_r,be]=d.useState([]),We=Hx(),ft=!qt||!!a,[kn,Hn]=d.useState(!1),[Tn,S]=d.useState(!1),[on,it]=d.useState(!1),[mt,Zt]=d.useState(!1),[Sn,Yi]=d.useState({time:"12:00"}),[Yc,Gc]=d.useState({title:0,date:0,time:0,location:0}),[Gi,Ji]=d.useState(null),[Km,Qa]=d.useState(!1),[Dt,F]=d.useState({}),[Xa,Bo]=d.useState([]),[Za,Fs]=d.useState(!1),[te,Wo]=d.useState(""),[el,uo]=d.useState(!1),[Mn,Ho]=d.useState(""),[zr,Ko]=d.useState(!1),[tl,Jc]=d.useState(!1),qo=d.useRef(!1);d.useEffect(()=>{qo.current=tl},[tl]);const[Qi,gt]=d.useState({}),[lf,fo]=d.useState(!1),[cf,Xi]=d.useState(!1),[uf,nl]=d.useState(!1),[df,Qc]=d.useState(!1),[Xc,rl]=d.useState(!1),[Zi,Zc]=d.useState(!1),[$t,pn]=d.useState({customImageUrl:null,customDescription:null,customDurationMinutes:null}),ea=d.useRef(null),eu=d.useRef(null),Br=d.useRef(null),ta=d.useRef(null),sl=d.useRef(!1),gs=d.useRef(!1),tu=d.useRef(null),Vo=d.useRef(0),[Qb,ff]=d.useState(null),[qm,na]=d.use
369State(!1),kr=d.useRef(null),an=d.useRef(!1),ys=d.useRef(null),ho=d.useRef(null),[nu,ol]=d.useState(!1),ru=d.useMemo(H8,[]);d.useEffect(()=>{ho.current=Q},[Q]),d.useEffect(()=>{e&&(Br.current=null,na(!1))},[e]),d.useEffect(()=>{if(!Za)return;const I=ne=>{ta.current&&!ta.current.contains(ne.target)&&ea.current&&!ea.current.contains(ne.target)&&Fs(!1)};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[Za]);const Xb=d.useCallback(async I=>{var ne,de;if(!I.trim()||!((de=(ne=window.google)==null?void 0:ne.maps)!=null&&de.places)){Bo([]),Fs(!1);return}try{Br.current||(Br.current=new google.maps.places.AutocompleteSessionToken);const{suggestions:_e}=await google.maps.places.AutocompleteSuggestion.fetchAutocompleteSuggestions({input:I,sessionToken:Br.current}),Ge=_e.filter(Re=>Re.placePrediction).map(Re=>({placeId:Re.placePrediction.placeId,text:Re.placePrediction.text.text}));Bo(Ge),Fs(Ge.length>0)}catch(_e){console.error("[CreateEventModal] fetchAutocompleteSuggestions error:",_e),Bo([]),Fs(!1)}},[]),il=d.useCallback(async I=>{var Ge,Re,en;Fs(!1),Bo([]),Ur(I.text),na(!1);const ne=++Vo.current,de=I.text||"",_e=Je=>{ho.current=Je,V(Je),Ur(Je.address),F(at=>({...at,location:!1}))};_e({address:de,venueName:((Ge=de.split(",")[0])==null?void 0:Ge.trim())||"",lat:null,lng:null,place_id:I.placeId});try{let Je=null,at=null,Pn="",He="";try{const nt=new google.maps.places.Place({id:I.placeId});await nt.fetchFields({fields:["formattedAddress","location","id","displayName"]});const It=nt.location;It&&(Je=It.lat(),at=It.lng());const Ot=nt.displayName;Pn=(typeof Ot=="string"?Ot:Ot==null?void 0:Ot.text)||"",He=nt.formattedAddress||""}catch(nt){console.error("[CreateEventModal] Place.fetchFields error:",nt)}if(Je==null||at==null)try{const nt=new google.maps.Geocoder,{results:It}=await nt.geocode({placeId:I.placeId}),Ot=It==null?void 0:It[0];(Re=Ot==null?void 0:Ot.geometry)!=null&&Re.location&&(Je=Ot.geometry.location.lat(),at=Ot.geometry.location.lng(),He||(He=Ot.formatted_address||""))}catch(nt){console.error("[CreateEventModal] Geocoder placeId fallback error:",nt)}let At=de;(He&&He.length>de.length&&He.toLowerCase().includes(de.toLowerCase())||!de&&He)&&(At=He),Pn&&!At.toLowerCase().includes(Pn.toLowerCase())&&(At=`${Pn}, ${At}`);const er=Pn||((en=de.split(",")[0])==null?void 0:en.trim())||"",Ut={address:At,venueName:er,lat:Je,lng:at,place_id:I.placeId};if(_e(Ut),na(Je==null||at==null),Je!=null&&at!=null)try{const nt="https://errlhmcitfpyyhnwtqrs.supabase.co",{data:{session:It}}=await pe.auth.getSession(),Sr=await(await fetch(`${nt}/functions/v1/resolve-timezone`,{method:"POST",headers:{"Content-Type":"application/json",...It!=null&&It.access_token?{Authorization:`Bearer ${It.access_token}`}:{}},body:JSON.stringify({lat:Je,lng:at})})).json();Sr.timezone&&ne===Vo.current&&(On(Sr.timezone),tu.current=Sr.timezone,ff(Sr.timezone))}catch(nt){console.warn("[CreateEventModal] Failed to resolve timezone from location:",nt)}}catch(Je){console.error("[CreateEventModal] Location selection error:",Je)}finally{Br.current=null}},[]),zn=d.useMemo(()=>{if($){const ne=ge==="Custom"?ut.trim():ge;return ne?`${ne}${B}${tt}`:""}if(!U)return"";if(U!=="Custom")return U;const I=Nl(j);return b?I?`In person – ${I} – date`:"":I?`${I} — ${T}`:""},[U,j,T,$,B,ge,tt,ut,b]),zs=d.useMemo(()=>{if(!Ae||!rn)return null;const[I,ne]=rn.split(":").map(Number),de=new Date(Ae.getFullYear(),Ae.getMonth(),Ae.getDate(),I,ne),_e=$t.customDurationMinutes??y*60;return Ng(de,_e)},[Ae,rn,$t.customDurationMinutes,y]);d.useEffect(()=>{if(!qt||!Ae){be([]);return}if(r==="edit")return;const I=Math.min(Math.max(parseInt(_n,10)||1,1),12),ne=[];for(let de=0;de<I;de++)sn==="weekly"?ne.push(tc(Ae,de)):sn==="biweekly"?ne.push(tc(Ae,de*2)):ne.push(tc(Ae,de*4));be(ne)},[qt,Ae,sn,_n,r]),d.useEffect(()=>{qt&&!a&&Tn&&S(!1)},[qt,a,Tn]),d.useEffect(()=>{P&&mt&&Zt(!1)},[P,mt]),d.useEffect(()=>{if(!P)return;const ne=z8[qt?sn:"none"];ne&&ne!==me&&oe(ne)},[qt,sn,P,me]);const ss=I=>{be(ne=>ne.filter((de,_e)=>_e!==I))},Vm=I=>tn(I,"EEE"),Ym=d.useCallback(()=>{D(""),N(""),G(""),K(""),Z(""),q(""),oe(""),fe(""),Xn(void 0),ar("16:00"),On(Intl.DateTimeFormat().resolvedOptions().timeZone),Ur(""),V(null),Ho(""),Me("public"),lr("no"),Zn(""),rs("unlimited"),bn("10"),Fr(!1),Fe("weekly"),dt("4"),be([]),F({}),Bo([]),Fs(!1),Wo(""),uo(!1),Br.current=null,pn({customImageUrl:null,customDescription:null,customDurationMinutes:null})},[]),al=I=>{I||Ym(),sl.current=!1,gs.current=!1,ol(!1),t(I)},ll=d.useRef(!1);d.useEffect(()=>{var ne,de;if(!e){ll.current=!1;return}if(r!=="create"||!f||ll.current)return;ll.current=!0;const I=(ne=f.title)==null?void 0:ne.trim();if(I&&($?($e("Custom"),Nn(I)):(D("Custom"),N(I))),f.date){const[_e,Ge,Re]=f.date.split("-").map(Number);_e&&Ge&&Re&&Xn(new Date(_e,Ge-1,Re))}if(f.startTime&&/^\d{2}:\d{2}$/.test(f.startTime)){const[_e,Ge]=f.startTime.split(":").map(Number),Re=Ge>=45?{h:(_e+1)%24,m:0}:Ge>=15?{h:_e,m:30}:{h:_e,m:0},en=`${String(Re.h).padStart(2,"0")}
369:${String(Re.m).padStart(2,"0")}`;ar(en)}if(f.timezone&&On(f.timezone),f.location){const _e=f.location;if(_e.name&&Ur(_e.name),typeof _e.lat=="number"&&typeof _e.lng=="number"&&_e.placeId){const Ge={address:_e.name||"",venueName:((de=(_e.name||"").split(",")[0])==null?void 0:de.trim())||"",lat:_e.lat,lng:_e.lng,place_id:_e.placeId};ho.current=Ge,V(Ge)}else if(_e.name){const Ge=(async()=>{var Re,en,Je,at,Pn;try{const He=Date.now();for(;(typeof window.google>"u"||!((Je=(en=(Re=window.google)==null?void 0:Re.maps)==null?void 0:en.places)!=null&&Je.AutocompleteSuggestion))&&Date.now()-He<5e3;)await new Promise(It=>setTimeout(It,100));const At=(Pn=(at=window.google)==null?void 0:at.maps)==null?void 0:Pn.places;if(!(At!=null&&At.AutocompleteSuggestion))return;Br.current||(Br.current=new window.google.maps.places.AutocompleteSessionToken);const{suggestions:er}=await At.AutocompleteSuggestion.fetchAutocompleteSuggestions({input:_e.name,sessionToken:Br.current}),Ut=er==null?void 0:er.find(It=>It.placePrediction);if(!Ut)return;const nt={placeId:Ut.placePrediction.placeId,text:Ut.placePrediction.text.text};await il(nt)}catch(He){console.warn("[CreateEventModal] Failed to resolve imported location via Places:",He)}})();kr.current=Ge}}},[e,r,f,$]),d.useEffect(()=>{var Ge,Re,en,Je,at,Pn,He,At,er,Ut,nt,It,Ot,Sr;if(!e||r!=="edit"&&r!=="duplicate"||!s)return;const I=r==="duplicate",ne=yt=>I?`(Copy) ${yt}`:yt,de=em(s,o??null);if($){const yt=B,ke=P?"Online Meet":"Dinner Club";let Ie="",Ft=ke;const Mt=!!((Ge=de.event_name)!=null&&Ge.includes(yt));if(Mt){const Ve=de.event_name.split(yt);Ie=((Re=Ve[0])==null?void 0:Re.trim())||"Founders";const Ln=((en=Ve[1])==null?void 0:en.trim())||ke;Ft=z.includes(Ln)?Ln:ke}else Ie=de.event_name||"";if(I)$e("Custom"),Nn(ne(Ie)),Lt(Ft);else{const Ve=H.filter(Ln=>Ln!=="Custom");Mt&&Ve.includes(Ie)?$e(Ie):($e("Custom"),Nn(Ie)),Lt(Ft)}if(P){const Ve=ty[Ft];Ve&&(Fr(Ve.recurring),Ve.recurring&&Ve.frequency&&Fe(Ve.frequency))}}else{const yt=A.find(ke=>ke===de.event_name);if(yt&&!I)D(yt),N("");else{D("Custom");const ke=de.event_name||"";let Ie;if(yt)Ie=ke;else if(b){const Ft=ke.match(/^In person\s*–\s*(.*?)\s*–\s*date$/i);Ie=Ft?Ft[1]:ke}else Ie=Nl(ke);N(ne(Ie))}}const _e=(o==null?void 0:o.start_time)??((at=(Je=s.event_dates)==null?void 0:Je[0])==null?void 0:at.start_time);if(_e){const yt=new Date(_e);Xn(I?void 0:yt);const ke=s.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone,Ft=new Intl.DateTimeFormat("en-US",{timeZone:ke,hour:"numeric",minute:"numeric",hour12:!1}).formatToParts(yt),Mt=parseInt(((Pn=Ft.find(Le=>Le.type==="hour"))==null?void 0:Pn.value)||"0"),Ve=parseInt(((He=Ft.find(Le=>Le.type==="minute"))==null?void 0:He.value)||"0"),Ln=String(Mt===24?0:Mt).padStart(2,"0"),lt=Ve<30?"00":"30";ar(`${Ln}:${lt}`)}else I&&Xn(void 0);if(s.timezone&&On(s.timezone),P){const yt=(o==null?void 0:o.join_url)||"",ke=bl(yt);ny(ke)?Ho(yt):Ho("")}else(de.location_name||de.venue_name)&&(E?(Ur(Zp(de.location_name)||""),V(null)):(Ur(de.location_name||de.venue_name||""),de.location_lat&&de.location_lng&&(V({address:de.location_name||"",venueName:de.venue_name||"",lat:de.location_lat,lng:de.location_lng,place_id:de.place_id||""}),(async()=>{try{const yt=++Vo.current,ke="https://errlhmcitfpyyhnwtqrs.supabase.co",{data:{session:Ie}}=await pe.auth.getSession(),Mt=await(await fetch(`${ke}/functions/v1/resolve-timezone`,{method:"POST",headers:{"Content-Type":"application/json",...Ie!=null&&Ie.access_token?{Authorization:`Bearer ${Ie.access_token}`}:{}},body:JSON.stringify({lat:de.location_lat,lng:de.location_lng})})).json();Mt!=null&&Mt.timezone&&yt===Vo.current&&(tu.current=Mt.timezone,ff(Mt.timezone),s.timezone||On(Mt.timezone))}catch(yt){console.warn("[CreateEventModal] edit-mode tz resolve failed:",yt)}})())));if(Me(s.visibility==="private"?"private":"public"),lr(s.stake_required?"yes":"no"),Zn(s.min_stake_tier||""),Fr(!!s.is_recurring),Wo(de.location_note||""),uo(!!de.location_note),de.capacity!==null&&de.capacity!==void 0?(rs("limited"),bn(String(de.capacity))):(rs("unlimited"),bn("10")),!I&&s.is_recurring&&((At=s.event_dates)==null?void 0:At.length)>1&&be(s.event_dates.map(yt=>new Date(yt.start_time))),pn({customImageUrl:de.custom_image_url??null,customDescription:de.custom_description??null,customDurationMinutes:de.custom_duration_minutes??null}),We&&!I&&Array.isArray(s.polls)&&s.polls.length>0){const yt=s.polls,ke=s.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone,Ie=new Set(yt.map(Ve=>Ve.poll_type));Hn(Ie.has("title")),S(Ie.has("date")),it(Ie.has("time")),Zt(Ie.has("location"));const Ft={title:0,date:0,time:0,location:0};for(const Ve of yt){const Ln=(Ve.options??[]).reduce((lt,Le)=>lt+(Le.vote_count??0),0);(Ve.poll_type==="title"||Ve.poll_type==="date"||Ve.poll_type==="time"||Ve.poll_type==="location")&&(Ft[Ve.poll_type]=Ln)}Gc(Ft);const Mt=(er=yt.find(Ve=>Ve.deadline))==null?void 0:er.deadline;if(Mt){const Ve=new Date(Mt),Ln=new Intl.DateTimeFormat("en-CA",{timeZone:ke,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(Ve),lt=parseInt(((Ut=Ln.find(Se=>Se.type==="year"))==null?void 0:Ut.value)||"0"),Le=parseInt(((nt=Ln.find(Se=>Se.type==="month"))==null?void 0:nt.value)||"1"),vs=parseInt(((It=Ln.find(Se=>Se.type==="day"))==null?void 0:It.value)||"1"),Vt=new Intl.DateTimeFormat("en-US",{timeZone:ke,hour:"numeric",minute:"numeric",hour12:!1}).formatToParts(Ve),R=parseInt(((Ot=Vt.find(Se=>Se.type==="hour"))==null?void 0:Ot.value)||"0"),Y=parseInt(((Sr=Vt.find(Se=>Se.type==="minute"))==null?void 0:Sr.value)||"0"),ue=String(R===24?0:R).padStart(2,"0"),we=Y<30?"00":"30";Yi({date:new Date(lt,Le-1,vs),time:`${ue}:${we}`})}}else We&&(Hn(!1),S(!1),it(!1),Zt(!1),Gc({title:0,date:0,time:0,location:0}))},[e,r,s]);const cl=async()=>
369{if(an.current)return;if(an.current=!0,ys.current||(ys.current=crypto.randomUUID()),kr.current)try{await kr.current}catch{}const I=ho.current,ne={};if($?(!(ge==="Custom"?ut.trim():ge)||!tt)&&(ne.eventType=!0):(!U||U==="Custom"&&!Nl(j))&&(ne.eventType=!0),Ae||(ne.startDate=!0),rn||(ne.startTime=!0),!P&&!I&&(ne.location=!0),xt==="yes"&&!br&&(ne.stakeTier=!0),(kn||Tn||on||mt)&&!Sn.date&&(ne.pollDeadline=!0),$?ge==="Custom"&&ut.length>50&&(ne.title=!0):U==="Custom"&&j.length>50&&(ne.title=!0),F(ne),Object.keys(ne).length>0){ne.stakeTier&&Object.keys(ne).length===1?re.error("Please select a minimum stake tier."):re.error("Please fill in all required fields."),an.current=!1;return}Ko(!0);try{const{data:{session:de}}=await pe.auth.getSession();if(!(de!=null&&de.access_token)){re.error("You must be logged in to create an event"),Ko(!1);return}const _e=In,Ge=Ut=>{const[nt,It]=rn.split(":").map(Number),Ot=Yf(Ut.getFullYear(),Ut.getMonth(),Ut.getDate(),nt,It,_e),Sr=$t.customDurationMinutes?Ng(Ot,$t.customDurationMinutes):__(Ot,y);return{start_time:Ot.toISOString(),end_time:Sr.toISOString()}},Re=qt&&_r.length>0?_r.map(Ge):Ae?[Ge(Ae)]:[],en=P&&ny(bl(Mn))?bl(Mn):null,Je=Sn.date?(()=>{const[Ut,nt]=(Sn.time||"12:00").split(":").map(Number);return Yf(Sn.date.getFullYear(),Sn.date.getMonth(),Sn.date.getDate(),Ut,nt,_e).toISOString()})():null,at=[];We&&(kn&&Je&&zn&&at.push({poll_type:"title",deadline:Je,first_option:{value:zn,label:zn}}),Tn&&!qt&&Ae&&Je&&at.push({poll_type:"date",deadline:Je,first_option:{value:tn(Ae,"yyyy-MM-dd"),label:tn(Ae,"EEE, MMM d, yyyy")}}),on&&Je&&at.push({poll_type:"time",deadline:Je,first_option:{value:rn,label:rn}}),mt&&(I!=null&&I.address)&&Je&&at.push({poll_type:"location",deadline:Je,first_option:{value:I.address,label:I.venueName||I.address,lat:I.lat,lng:I.lng,place_id:I.place_id}}));const Pn={event_type:g.event_type,event_name:zn,description:g.descriptionText,timezone:_e,venue_name:P?null:(I==null?void 0:I.venueName)||null,location_name:P?en:(I==null?void 0:I.address)||null,location_lat:P?null:(I==null?void 0:I.lat)??null,location_lng:P?null:(I==null?void 0:I.lng)??null,place_id:P?null:(I==null?void 0:I.place_id)||null,location_note:P?null:te.trim()||null,visibility:je,stake_required:xt==="yes",min_stake_tier:xt==="yes"&&br||null,is_recurring:qt,capacity:Xt==="limited"?parseInt(Kt)||10:null,dates:Re,creator_username:m||void 0,custom_image_url:$t.customImageUrl,custom_description:$t.customDescription,custom_duration_minutes:$t.customDurationMinutes,polls:at,client_request_id:ys.current},At=await fetch("https://errlhmcitfpyyhnwtqrs.supabase.co/functions/v1/create-event",{method:"POST",headers:{Authorization:`Bearer ${de.access_token}`,"Content-Type":"application/json"},body:JSON.stringify(Pn)}),er=await At.json();if(!At.ok)throw new Error(er.error||"Failed to create event");ys.current=null,re.success("Event created!"),al(!1),h.setQueryData(["staaake-profile",pt().event_type],Ut=>{if(!Ut)return Ut;const nt={...Ut,hasCreated:!0};try{const It=pt().event_type;localStorage.setItem(`staaake-profile-flags-${It??"default"}`,JSON.stringify({hasRsvps:nt.hasRsvps,hasCreated:nt.hasCreated}))}catch{}return nt}),h.invalidateQueries({queryKey:["events"]}
369),p(`/${er.event_code}${window.location.search}`,{state:{justCreated:!0}})}catch(de){console.error("[CreateEventModal] Create event error:",de),re.error(de.message||"Failed to create event")}finally{an.current=!1,Ko(!1)}},ul=async()=>{var Ge;if(kr.current)try{await kr.current}catch{}const I=ho.current,ne={};if($?(!(ge==="Custom"?ut.trim():ge)||!tt)&&(ne.eventType=!0):(!U||U==="Custom"&&!Nl(j))&&(ne.eventType=!0),Ae||(ne.startDate=!0),rn||(ne.startTime=!0),!P&&!I&&(ne.location=!0),xt==="yes"&&!br&&(ne.stakeTier=!0),(kn||Tn||on||mt)&&!Sn.date&&(ne.pollDeadline=!0),$?ge==="Custom"&&ut.length>50&&(ne.title=!0):U==="Custom"&&j.length>50&&(ne.title=!0),F(ne),Object.keys(ne).length>0){ne.stakeTier&&Object.keys(ne).length===1?re.error("Please select a minimum stake tier."):re.error("Please fill in all required fields.");return}const de=xt==="yes"||je==="private",_e=!!(o!=null&&o.luma_event_id||o!=null&&o.eventbrite_event_id||o!=null&&o.meetup_event_id);if(de&&_e&&!gs.current){ol(!0);return}Ko(!0);try{const{data:{session:Re}}=await pe.auth.getSession();if(!(Re!=null&&Re.access_token)){re.error("You must be logged in to edit an event"),Ko(!1);return}const en=In,Je=ke=>{const[Ie,Ft]=rn.split(":").map(Number),Mt=Yf(ke.getFullYear(),ke.getMonth(),ke.getDate(),Ie,Ft,en),Ve=$t.customDurationMinutes?Ng(Mt,$t.customDurationMinutes):__(Mt,y);return{start_time:Mt.toISOString(),end_time:Ve.toISOString()}},at=a?Ae?[Je(Ae)]:[]:qt&&_r.length>0?_r.map(Je):Ae?[Je(Ae)]:[],Pn=P&&ny(bl(Mn))?bl(Mn):null,He={event_code:s.event_code,event_type:(s==null?void 0:s.event_type)||"powerwalk",event_name:zn,description:g.descriptionText,venue_name:P?null:(I==null?void 0:I.venueName)||null,location_name:P?null:(I==null?void 0:I.address)||null,location_lat:P?null:(I==null?void 0:I.lat)??null,location_lng:P?null:(I==null?void 0:I.lng)??null,place_id:P?null:(I==null?void 0:I.place_id)||null,location_note:P?null:te.trim()||null,capacity:Xt==="limited"?parseInt(Kt)||10:null,dates:at,custom_image_url:$t.customImageUrl,custom_description:$t.customDescription,custom_duration_minutes:$t.customDurationMinutes};if(a||(He.timezone=en,He.visibility=je,He.stake_required=xt==="yes",He.min_stake_tier=xt==="yes"&&br||null,He.is_recurring=qt),P&&(He.join_url=Pn),We){const ke=Sn.date?(()=>{const[Ft,Mt]=(Sn.time||"12:00").split(":").map(Number);return Yf(Sn.date.getFullYear(),Sn.date.getMonth(),Sn.date.getDate(),Ft,Mt,en).toISOString()})():null,Ie=[];kn&&ke&&zn&&Ie.push({poll_type:"title",deadline:ke,first_option:{value:zn,label:zn}}),Tn&&ft&&Ae&&ke&&Ie.push({poll_type:"date",deadline:ke,first_option:{value:tn(Ae,"yyyy-MM-dd"),label:tn(Ae,"EEE, MMM d, yyyy")}}),on&&ke&&Ie.push({poll_type:"time",deadline:ke,first_option:{value:rn,label:rn}}),mt&&(I!=null&&I.address)&&ke&&Ie.push({poll_type:"location",deadline:ke,first_option:{value:I.address,label:I.venueName||I.address,lat:I.lat,lng:I.lng,place_id:I.place_id}}),He.polls=Ie}a&&(o!=null&&o.id)&&(He.single_date_id=o.id),l&&(He.reset_overrides=!0);const At="https://errlhmcitfpyyhnwtqrs.supabase.co",er=await fetch(`${At}/functions/v1/update-event`,{method:"POST",headers:{Authorization:`Bearer ${Re.access_token}`,"Content-Type":"application/json"},body:JSON.stringify(He)}),Ut=await er.json();if(!er.ok)throw new Error(Ut.error||"Failed to update event");const nt=Array.isArray(Ut==null?void 0:Ut.changed_fields)?Ut.changed_fields:[],It=new Set(["location_name","venue_name","place_id","location_lat","location_lng"]),Ot=nt.some(ke=>It.has(ke)),Sr=nt.some(ke=>ke==="start_time"||ke==="end_time"),yt=nt.includes("custom_image_url");
369if(de&&_e&&!sl.current&&(o!=null&&o.luma_event_id))try{const ke=await fetch(`${At}/functions/v1/delete-luma-event`,{method:"POST",headers:{Authorization:`Bearer ${Re.access_token}`,"Content-Type":"application/json"},body:JSON.stringify({event_id:s.id,event_date_id:o==null?void 0:o.id,luma_event_id:o.luma_event_id})});ke.ok?sl.current=!0:console.error("[luma-delete] failed",await ke.text())}catch(ke){console.error("[luma-delete] error",ke)}if(de&&(o!=null&&o.eventbrite_event_id))try{await fetch(`${At}/functions/v1/delete-eventbrite-event`,{method:"POST",headers:{Authorization:`Bearer ${Re.access_token}`,"Content-Type":"application/json"},body:JSON.stringify({event_id:s.id,event_date_id:o==null?void 0:o.id,eventbrite_event_id:o.eventbrite_event_id})})}catch(ke){console.error("[eventbrite-delete] error",ke)}if(de&&(o!=null&&o.meetup_event_id))try{await fetch(`${At}/functions/v1/delete-meetup-event`,{method:"POST",headers:{Authorization:`Bearer ${Re.access_token}`,"Content-Type":"application/json"},body:JSON.stringify({event_id:s.id,event_date_id:o==null?void 0:o.id,meetup_event_id:o.meetup_event_id})})}catch(ke){console.error("[meetup-delete] error",ke)}if(!de&&!sl.current){const ke=a||!(s!=null&&s.is_recurring)||!((Ge=s==null?void 0:s.event_dates)!=null&&Ge.length)?[{dateObj:o,datePayload:at[0]}]:s.event_dates.map((lt,Le)=>({dateObj:lt,datePayload:at[Le]||at[0]})),Ie=x6(ke.map(lt=>lt.dateObj)),Ft={};Ie.luma>0&&(Ft.luma="pending"),Ie.eventbrite>0&&(Ft.eventbrite="pending"),Ie.meetup>0&&(Ft.meetup="pending");const Mt=b6(Ie);console.debug("[EditSyncModal] connected-platform detection",{siteKey:x,event_id:s==null?void 0:s.id,event_code:s==null?void 0:s.event_code,event_type:s==null?void 0:s.event_type,mode:r,singleInstance:a,dates:ke.map(lt=>{var Le,vs,Vt,R;return{id:(Le=lt.dateObj)==null?void 0:Le.id,luma_event_id:((vs=lt.dateObj)==null?void 0:vs.luma_event_id)??null,eventbrite_event_id:((Vt=lt.dateObj)==null?void 0:Vt.eventbrite_event_id)??null,meetup_event_id:((R=lt.dateObj)==null?void 0:R.meetup_event_id)??null}}),remaining:Ie,hasAnyConnected:Mt}),r==="edit"&&Mt&&(gt(Ft),Jc(!0));const Ve=lt=>{Ie[lt]--,Ie[lt]<=0&&gt(Le=>Le[lt]==="error"?Le:{...Le,[lt]:"done"})},Ln=lt=>{gt(Le=>({...Le,[lt]:"error"}))};for(const{dateObj:lt,datePayload:Le}of ke){if(!lt)continue;const vs=P?Pn:null;if(lt.luma_event_id)try{await fetch(`${At}/functions/v1/update-luma-event`,{method:"POST",headers:{Authorization:`Bearer ${Re.access_token}`,"Content-Type":"application/json"},body:JSON.stringify({event_api_id:lt.luma_event_id,name:zn,start_at:Le==null?void 0:Le.start_time,end_at:Le==null?void 0:Le.end_time,timezone:In,capacity:Xt==="limited"?parseInt(Kt)||10:null,suppress_notifications:!0,description:(()=>{const Vt=($t.customDescription||"").trim(),R=g.descriptionText;return Vt?`${Vt}
370
371About ${g.title}
372${R}`:R})(),event_type:(s==null?void 0:s.event_type)||"powerwalk",username:m||void 0,location:P?vs:(I==null?void 0:I.address)||null,venue_name:P?null:(I==null?void 0:I.venueName)||null,place_id:P?null:(I==null?void 0:I.place_id)||null,custom_image_url:$t.customImageUrl||void 0,custom_description:$t.customDescription||void 0,location_changed:Ot})}),Ve("luma")}catch(Vt){Ln("luma"),console.error("[luma-update] failed",Vt)}if(lt.eventbrite_event_id)try{await fetch(`${At}/functions/v1/update-eventbrite-event`,{method:"POST",headers:{Authorization:`Bearer ${Re.access_token}`,"Content-Type":"application/json"},body:JSON.stringify({eventbrite_event_id:lt.eventbrite_event_id,name:zn,description:(()=>{const Vt=($t.customDescription||"").trim(),R=g.descriptionText;return Vt?`${Vt}
373
374About ${g.title}
375${R}`:R})(),start_time:Le==null?void 0:Le.start_time,end_time:Le==null?void 0:Le.end_time,timezone:In,location:P?null:(I==null?void 0:I.address)||null,venue_name:P?null:(I==null?void 0:I.venueName)||null,capacity:Xt==="limited"?parseInt(Kt)||10:null,event_type:(s==null?void 0:s.event_type)||"powerwalk",username:m||void 0,...P?{online_event:!0,join_url:vs}:{},custom_image_url:$t.customImageUrl||void 0,custom_description:$t.customDescription||void 0,location_changed:Ot})}),Ve("eventbrite")}catch(Vt){Ln("eventbrite"),console.error("[eventbrite-update] failed",Vt)}if(lt.meetup_event_id)try{const Vt=await fetch(`${At}/functions/v1/update-meetup-event`,{method:"POST",headers:{Authorization:`Bearer ${Re.access_token}`,"Content-Type":"application/json"},body:JSON.stringify({meetup_event_id:lt.meetup_event_id,name:zn,start_at:Le==null?void 0:Le.start_time,end_at:Le==null?void 0:Le.end_time,timezone:In,description:(()=>{const R=($t.customDescription||"").trim(),Y=g.descriptionText;return R?`${R}
376
377About ${g.title}
378${Y}`:Y})(),event_type:(s==null?void 0:s.event_type)||"powerwalk",username:m||void 0,location:P?vs:(I==null?void 0:I.address)||null,venue_name:P?null:(I==null?void 0:I.venueName)||null,custom_image_url:$t.customImageUrl||void 0,custom_description:$t.customDescription||void 0,location_changed:Ot,time_changed:Sr,
378image_changed:yt})});if(!Vt.ok){const R=await Vt.text().catch(()=>"");throw new Error(`Meetup update failed: ${R||Vt.status}`)}Ve("meetup")}catch(Vt){throw Ln("meetup"),console.error("[meetup-update] failed",Vt),Vt}}}qo.current&&await new Promise(ke=>setTimeout(ke,600)),re.success("Event updated!"),al(!1),h.invalidateQueries({queryKey:["event",s.event_code]}),h.invalidateQueries({queryKey:["events"]}),Jc(!1)}catch(Re){console.error("[CreateEventModal] Update event error:",Re),re.error(Re.message||"Failed to update event")}finally{Ko(!1)}},Gm=I=>{const ne=I.target.value;if(Ur(ne),!ne.trim())V(null),ho.current=null,Bo([]),Fs(!1),na(!1);else{const de=Ge=>Ge.trim().replace(/\s+/g," ").toLowerCase(),_e=ho.current;_e&&de(ne)!==de(_e.address||"")&&(ho.current=null,V(null),na(!1)),eu.current&&clearTimeout(eu.current),eu.current=setTimeout(()=>Xb(ne),300)}F(de=>({...de,location:!1}))};return i.jsxs(i.Fragment,{children:[i.jsx(ot,{open:e,onOpenChange:al,children:i.jsxs(et,{className:"sm:max-w-[520px] bg-card border-2 border-primary/40 p-0 gap-0 max-h-[90vh] overflow-y-auto",children:[i.jsxs(Tt,{className:"px-6 pt-6 pb-4",children:[i.jsx(vt,{className:"text-lg font-semibold text-foreground",children:r==="edit"?b?"Edit Date":"Edit Event":b?"Create Date":"Create Event"}),zn&&i.jsx("p",{className:"text-foreground font-semibold text-base mt-1",children:zn})]}),i.jsxs("div",{className:"px-6 pb-6 space-y-5",children:[i.jsxs("fieldset",{disabled:w,className:X("space-y-5 border-0 m-0 p-0 min-w-0",w&&"pointer-events-none"),children:[$?i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"grid grid-cols-[1fr_auto_1fr] gap-2 items-center",children:[i.jsxs(Kr,{value:ge||void 0,onValueChange:I=>{$e(I),F(ne=>({...ne,eventType:!1}))},children:[i.jsx(Nr,{className:X(Dt.eventType&&(!ge||ge==="Custom"&&!ut.trim())&&"border-destructive"),children:i.jsx(qr,{placeholder:"Select event name"})}),i.jsxs(Tr,{children:[i.jsx(bt,{value:"__placeholder",disabled:!0,children:"Select event name"}),H.map(I=>i.jsx(bt,{value:I,children:I==="Custom"?"Custom Event Name":I},I))]})]}),i.jsx("span",{className:"text-muted-foreground text-sm",children:"—"}),i.jsxs(Kr,{value:tt||void 0,onValueChange:I=>{if(Lt(I),P&&ty[I]){const ne=ty[I];Fr(ne.recurring),ne.recurring&&ne.frequency&&Fe(ne.frequency)}},children:[i.jsx(Nr,{disabled:P&&!!s,className:X(Dt.eventType&&!tt&&"border-destructive"),children:i.jsx(qr,{placeholder:P?"Select online meet":"Select club"})}),i.jsxs(Tr,{children:[i.jsx(bt,{value:"__placeholder",disabled:!0,children:P?"Select online meet":"Select club"}),z.map(I=>i.jsx(bt,{value:I,children:I},I))]})]})]}),ge==="Custom"&&i.jsxs(i.Fragment,{children:[i.jsx("input",{placeholder:"e.g. Deep Tech",value:ut,onChange:I=>Nn(I.target.value),maxLength:50,className:X("w-full h-10 rounded-md border border-input bg-background px-3 py-2 text-sm",Dt.eventType&&!ut.trim()&&"border-destructive",ut.length>50&&"border-destructive")}
378),i.jsxs("p",{className:X("text-xs text-right",ut.length>50?"text-destructive":"text-muted-foreground"),children:[ut.length,"/50"]})]}),Dt.eventType&&i.jsx("p",{className:"text-destructive text-xs",children:P?"Please select event name and type":"Please select event name and club"})]}):i.jsxs("div",{className:"space-y-2",children:[i.jsx(_t,{className:"text-muted-foreground text-xs uppercase tracking-wide",children:b?"Choose Date Title":"Choose Event Name"}),i.jsxs(Kr,{value:U,onValueChange:I=>{D(I),F(ne=>({...ne,eventType:!1}))},children:[i.jsx(Nr,{className:X(Dt.eventType&&"border-destructive"),children:i.jsx(qr,{placeholder:"Select event name"})}),i.jsxs(Tr,{children:[A.map(I=>i.jsx(bt,{value:I,children:I},I)),i.jsx(bt,{value:"Custom",children:b?"Custom Date Title":"Custom Event Name"})]})]}),U==="Custom"&&i.jsxs("div",{className:"mt-2 space-y-1",children:[i.jsxs("div",{className:X("flex items-center h-10 w-full rounded-md border border-input bg-background ring-offset-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",Dt.eventType&&!Nl(j)&&"border-destructive",j.length>50&&"border-destructive"),children:[b&&i.jsx("span",{className:"text-muted-foreground text-sm pl-3 whitespace-nowrap",children:"In person –"}),i.jsx("input",{placeholder:b?"Enter custom date (e.g. paint together)":"Enter custom theme (e.g. Fintech)",value:j,onChange:I=>N(I.target.value),maxLength:50,className:"flex-1 bg-transparent px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none"}),i.jsx("span",{className:"text-muted-foreground text-sm pr-3 whitespace-nowrap",children:b?"– date":`— ${T}`})]}),i.jsxs("p",{className:X("text-xs text-right",j.length>50?"text-destructive":"text-muted-foreground"),children:[j.length,"/50"]})]}),Dt.eventType&&i.jsx("p",{className:"text-destructive text-xs",children:"Event type is required"})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(_t,{className:"text-muted-foreground text-xs uppercase tracking-wide",children:"Start time"}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsxs(gp,{children:[i.jsx(yp,{asChild:!0,children:i.jsxs(ee,{variant:"outline",className:X("justify-start text-left font-normal",!Ae&&"text-muted-foreground",Dt.startDate&&"border-destructive"),children:[i.jsx(gh,{className:"mr-2 h-4 w-4"}),Ae?tn(Ae,"MMM d, yyyy"):"Pick date"]})}),i.jsx(jd,{className:"w-auto p-0",align:"start",children:i.jsx(mp,{mode:"single",selected:Ae,onSelect:I=>{Xn(I),F(ne=>({...ne,startDate:!1}))},initialFocus:!0,className:"p-3 pointer-events-auto"})})]}),i.jsxs(Kr,{value:rn,onValueChange:I=>{ar(I),F(ne=>({...ne,startTime:!1}))},children:[i.jsxs(Nr,{className:X(Dt.startTime&&"border-destructive"),children:[i.jsx(ep,{className:"mr-2 h-4 w-4 text-muted-foreground"}),i.jsx(qr,{placeholder:"Pick time"})]}),i.jsx(Tr,{className:"max-h-60",children:Bk.map(I=>i.jsx(bt,{value:I,children:ry(I)},I))})]})]}),(Dt.startDate||Dt.startTime)&&i.jsx("p",{className:"text-destructive text-xs",children:"Date and time are required"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(_t,{className:"text-muted-foreground text-xs uppercase tracking-wide",children:"End time"}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsxs("div",{className:"flex items-center h-10 rounded-md border border-input bg-muted/30 px-3 text-sm text-muted-foreground",children:[i.jsx(gh,{className:"mr-2 h-4 w-4"}),zs?tn(zs,"MMM d, yyyy"):"Pick date"]}),i.jsxs("div",{className:"flex items-center h-10 rounded-md border border-input bg-muted/30 px-3 text-sm text-muted-foreground",children:[i.jsx(ep,{className:"mr-2 h-4 w-4"}),zs?ry(tn(zs,"HH:mm")):"Auto"]})]})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(_t,{className:"text-muted-foreground text-xs uppercase tracking-wide",children:"Timezone"}),i.jsxs(Kr,{value:In,onValueChange:On,children:[i.jsxs(Nr,{children:[i.jsx(BL,{className:"mr-2 h-4 w-4 text-muted-foreground"}),i.jsx(qr,{})]}),i.jsx(Tr,{className:"max-h-60",children:ru.map(I=>i.jsx(bt,{value:I.value,children:I.label},I.value))})]})]}),r!=="edit"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(_t,{className:"text-muted-foreground text-xs uppercase tracking-wide",children:"Recurring"}),i.jsxs("div",{className:"flex h-10 rounded-md border border-input bg-muted/30 p-1",children:[i.jsx("button",{type:"button",onClick:()=>Fr(!1),className:X("flex-1 rounded-sm text-sm font-medium transition-colors",qt?"text-muted-foreground hover:text-foreground":"bg-primary text-primary-foreground shadow-sm"),children:"No"}),i.jsx("button",{type:"button",onClick:()=>Qa(!0),className:X("flex-1 rounded-sm text-sm font-medium transition-colors",qt?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Yes"})]})]}),qt&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(_t,{className:"text-muted-foreground text-xs uppercase tracking-wide",children:"Frequency"}),i.jsxs(Kr,{value:sn,onValueChange:I=>Fe(I),children:[i.jsx(Nr,{children:i.jsx(qr,{})}),i.jsxs(Tr,{children:[i.jsx(bt,{value:"weekly",children:"Weekly"}),i.jsx(bt,{value:"biweekly",children:"Bi-Weekly"}),i.jsx(bt,{value:"monthly",children:"Monthly"})]})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs(_t,{className:"text-muted-foreground text-xs uppercase tracking-wide",children:["How Many ",sn==="weekly"?"Weeks":sn==="biweekly"?"Bi-Weeks":"Months"," (max 12)"]}),i.jsxs(Kr,{value:_n,onValueChange:dt,children:[i.jsx(Nr,{children:i.jsx(qr,{})}),i.jsx(Tr,{className:"max-h-60",children:Array.from({length:12},(I,ne)=>i.jsx(bt,{value:String(ne+1),children:ne+1},ne+1))})]})]}),_r.length>0&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(_t,{className:"text-muted-foreground text-xs uppercase tracking-wide",children:"Event Dates"}),i.jsx("div",{className:"space-y-1 max-h-[240px] overflow-y-auto rounded-md border border-input bg-muted/30 p-2",children:_r.map((I,ne)=>i.jsxs("div",{className:"flex items-center justify-between h-9 px-3 rounded-sm text-sm",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("span",{className:"text-muted-foreground font-medium w-10",children:Vm(I)}),i.jsx("span",{className:"text-foreground",children:tn(I,"MMM d, yyyy")})]}),i.jsx("button",{type:"button",onClick:()=>ss(ne),className:"text-muted-foreground hover:text-destructive transition-colors p-1",children:i.jsx($c,{
378className:"h-3.5 w-3.5"})})]},ne))})]})]})]}),P?i.jsxs("div",{className:"space-y-2",children:[i.jsx(_t,{className:"text-muted-foreground text-xs uppercase tracking-wide",children:"Join URL"}),i.jsxs("div",{className:"relative",children:[i.jsx(OE,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground z-10"}),i.jsx("input",{placeholder:"https://meet.google.com/abc-defg-hij",value:Mn,onChange:I=>Ho(I.target.value),onBlur:()=>{const I=bl(Mn);I&&Ho(I)},className:"flex h-10 w-full rounded-md border border-input bg-background pl-9 pr-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 md:text-sm"})]})]}):i.jsxs("div",{className:"space-y-2",children:[i.jsx(_t,{className:"text-muted-foreground text-xs uppercase tracking-wide",children:"Location"}),i.jsxs("div",{className:"relative",children:[i.jsx(Uu,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground z-10"}),i.jsx("input",{ref:ea,placeholder:"Add event location",value:xr,onChange:Gm,onFocus:()=>{Xa.length>0&&Fs(!0)},className:X("flex h-10 w-full rounded-md border border-input bg-background pl-9 pr-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 md:text-sm",Dt.location&&"border-destructive"),autoComplete:"off"}),Za&&Xa.length>0&&i.jsx("div",{ref:ta,className:"absolute z-50 top-full left-0 right-0 mt-1 rounded-md border border-border bg-popover shadow-md max-h-60 overflow-y-auto",children:Xa.map(I=>i.jsx("button",{type:"button",className:"w-full text-left px-3 py-2 text-sm text-popover-foreground hover:bg-accent hover:text-accent-foreground transition-colors",onClick:()=>{kr.current=il(I)},children:I.text},I.placeId))})]}),Dt.location&&i.jsx("p",{className:"text-destructive text-xs",children:"Location is required"}),qm&&i.jsx("p",{className:"text-muted-foreground text-xs",children:"Couldn't load the map for this location, the address was still saved"}),Q&&Q.lat!=null&&Q.lng!=null&&i.jsx(K8,{locationData:Q}),el?i.jsxs("div",{className:"mt-2 space-y-1",children:[i.jsx(_t,{className:"text-muted-foreground text-xs uppercase tracking-wide",children:"Instructions"}),i.jsx("input",{placeholder:"Meet in front of the red door, Wearing blue hat, etc...",value:te,onChange:I=>Wo(I.target.value.slice(0,50)),maxLength:50,className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 md:text-sm"}),i.jsxs("p",{className:"text-xs text-muted-foreground text-right",children:[te.length,"/50"]})]}):i.jsx("button",{type:"button",onClick:()=>uo(!0),className:"mt-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:"+ Add Further Instructions"})]}),We&&ft&&i.jsxs("div",{className:"space-y-3 rounded-md border border-input bg-muted/20 p-3",children:[i.jsx(_t,{className:"text-muted-foreground text-xs uppercase tracking-wide",children:"Community Polls (optional)"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Let people suggest options and vote before the event. Your chosen ",P?"title, date and time":"title, date, time and location"," become the first option."]}),[{type:"title",label:"Title Poll",on:kn,set:Hn,disabled:!1},{type:"date",label:"Date Poll",on:Tn,set:S,disabled:!ft},{type:"time",label:"Time Poll",on,set:it,disabled:!1},{type:"location",label:"Location Poll",on:mt,set:Zt,disabled:!1}].filter(I=>!(P&&I.type==="location")).map(I=>i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsxs("span",{className:X("text-sm",I.disabled&&"text-muted-foreground/50"),children:[I.label,I.type==="date"&&!ft&&i.jsx("span",{className:"ml-2 text-[11px] text-muted-foreground",children:"(single-date events only)"})]}),i.jsx(ZT,{checked:I.on,onCheckedChange:ne=>{if(!ne&&r==="edit"&&Yc[I.type]>0){Ji(I.type);return}I.set(ne),[["title",kn],["date",Tn],["time",on],["location",mt]].some(([_e,Ge])=>_e===I.type?ne:Ge)||F(_e=>({..._e,pollDeadline:!1}))},disabled:I.disabled,className:"shrink-0"})]},I.type)),(kn||Tn||on||mt)&&i.jsxs("div",{className:"space-y-2 pt-1",children:[i.jsx(_t,{className:"text-muted-foreground text-xs uppercase tracking-wide",children:"Poll Deadline"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(gp,{children:[i.jsx(yp,{asChild:!0,children:i.jsxs(ee,{variant:"outline",size:"sm",className:X("flex-1 justify-start text-left font-normal",!Sn.date&&"text-muted-foreground",Dt.pollDeadline&&"border-destructive"),children:[i.jsx(gh,{className:"mr-2 h-4 w-4"}),Sn.date?tn(Sn.date,"MMM d, yyyy"):"Deadline date"]})}),i.jsx(jd,{className:"w-auto p-0",align:"start",children:i.jsx(mp,{mode:"single",selected:Sn.date,onSelect:I=>{Yi(ne=>({...ne,date:I??void 0})),F(ne=>({...ne,pollDeadline:!1}))},disabled:I=>I<new Date(new Date().setHours(0,0,0,0)),initialFocus:!0,className:"p-3 pointer-events-auto"})})]}),i.jsxs(Kr,{value:Sn.time,onValueChange:I=>Yi(ne=>({...ne,time:I}
378)),children:[i.jsx(Nr,{className:"w-28",children:i.jsx(qr,{})}),i.jsx(Tr,{className:"max-h-60",children:Bk.map(I=>i.jsx(bt,{value:I,children:ry(I)},I))})]})]}),Dt.pollDeadline&&i.jsx("p",{className:"text-destructive text-xs",children:"Poll deadline is required"})]})]}),i.jsx(Rt,{open:Gi!==null,onOpenChange:I=>{I||Ji(null)},children:i.jsxs(St,{children:[i.jsxs(Ct,{children:[i.jsx(jt,{children:"Delete Poll?"}),i.jsx(Nt,{className:"whitespace-pre-line",children:`This poll already has votes.
379
380Turning off this poll will permanently delete:
381
382• All poll options
383• All votes
384• All poll results
385
386This action cannot be undone.`})]}),i.jsxs(Et,{children:[i.jsx(cn,{onClick:()=>Ji(null),children:"Cancel"}),i.jsx(ln,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{Gi==="date"?S(!1):Gi==="time"?it(!1):Gi==="location"&&Zt(!1),Ji(null)},children:"Delete Poll"})]})]})}),i.jsx(Rt,{open:Km,onOpenChange:I=>{I||Qa(!1)},children:i.jsxs(St,{children:[i.jsxs(Ct,{children:[i.jsx(jt,{children:"Recurring Events"}),i.jsx(Nt,{className:"whitespace-pre-line",children:`Polls are not available for recurring events.
387
388You can create polls for each event later.`})]}),i.jsxs(Et,{children:[i.jsx(cn,{onClick:()=>Qa(!1),children:"Cancel"}),i.jsx(ln,{onClick:()=>{Fr(!0),S(!1),it(!1),Zt(!1),Qa(!1)},children:"Continue"})]})]})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(_t,{className:"text-muted-foreground text-xs uppercase tracking-wide",children:"Visibility"}),i.jsxs("div",{className:"flex h-10 rounded-md border border-input bg-muted/30 p-1",children:[i.jsx("button",{type:"button",onClick:()=>{je==="private"?Xi(!0):Me("public")},className:X("flex-1 rounded-sm text-sm font-medium transition-colors",je==="public"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Public"}),i.jsx("button",{type:"button",onClick:()=>{je==="public"&&fo(!0)},className:X("flex-1 rounded-sm text-sm font-medium transition-colors",je==="private"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Private"})]}),i.jsx(Rt,{open:lf,onOpenChange:I=>{I||fo(!1)},children:i.jsxs(St,{children:[i.jsxs(Ct,{children:[i.jsx(jt,{children:"Private Event"}),i.jsxs(Nt,{children:["If you change this event to Private, it will not appear in the public event calendar. Only people who have the event link will be able to see and access the event.",`
389
390`,"This event cannot be shared on Luma, Eventbrite or Meetup.",r==="edit"&&!!(o!=null&&o.luma_event_id||o!=null&&o.eventbrite_event_id)&&`
391
392Your event on Luma, Eventbrite, and Meetup, along with all sign-ups, will be deleted.`]})]}),i.jsxs(Et,{children:[i.jsx(ee,{variant:"outline",onClick:()=>fo(!1),children:"Cancel"}),i.jsx(ee,{onClick:()=>{Me("private"),fo(!1)},children:"Understand"})]})]})}),i.jsx(Rt,{open:cf,onOpenChange:I=>{I||Xi(!1)},children:i.jsxs(St,{children:[i.jsxs(Ct,{children:[i.jsx(jt,{children:"Make Event Public?"}),i.jsx(Nt,{children:"This event will appear in the public calendar."})]}),i.jsxs(Et,{children:[i.jsx(ee,{variant:"outline",onClick:()=>Xi(!1),children:"Cancel"}),i.jsx(ee,{onClick:()=>{Me("public"),Xi(!1)},children:"Make Public"})]})]})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(_t,{className:"text-muted-foreground text-xs uppercase tracking-wide",children:"Must Have a Stake in the Host to Join Event"}),i.jsxs("div",{className:"flex h-10 rounded-md border border-input bg-muted/30 p-1",children:[i.jsx("button",{type:"button",onClick:()=>{lr("no"),Zn("")},className:X("flex-1 rounded-sm text-sm font-medium transition-colors",xt==="no"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"No"}),i.jsx("button",{type:"button",onClick:()=>{xt==="no"&&nl(!0)},className:X("flex-1 rounded-sm text-sm font-medium transition-colors",xt==="yes"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Yes"})]}),i.jsx(Rt,{open:uf,onOpenChange:I=>{I||nl(!1)},children:i.jsxs(St,{children:[i.jsxs(Ct,{children:[i.jsx(jt,{children:"Stake Requirement"}),i.jsxs(Nt,{children:["People must be on the host's visibility sheet (staaake sheet) in order to attend this event. This event cannot be shared on Luma, Eventbrite or Meetup.",r==="edit"&&!!(o!=null&&o.luma_event_id||o!=null&&o.eventbrite_event_id)&&`
393
394Your event on Luma, Eventbrite, and Meetup, along with all sign-ups, will be deleted.`]})]}),i.jsxs(Et,{children:[i.jsx(ee,{variant:"outline",onClick:()=>nl(!1),children:"Cancel"}),i.jsx(ee,{onClick:()=>{lr("yes"),nl(!1)},children:"Understand"})]})]})}),i.jsx(Rt,{open:nu,onOpenChange:I=>{I||ol(!1)},children:i.jsxs(St,{children:[i.jsxs(Ct,{children:[i.jsx(jt,{children:"Are you sure?"}),i.jsx(Nt,{children:"Your event on Luma and Eventbrite, along with all sign-ups, will be deleted."})]}),i.jsxs(Et,{children:[i.jsx(ee,{variant:"outline",onClick:()=>ol(!1),children:"Cancel"}),i.jsx(ee,{onClick:()=>{gs.current=!0,ol(!1),ul()},children:"Continue"})]})]})})]}),xt==="yes"&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(_t,{className:"text-muted-foreground text-xs uppercase tracking-wide",children:"Minimum Stake Tier"}),i.jsxs(Kr,{value:br,onValueChange:I=>{Zn(I),Dt.stakeTier&&F(ne=>({...ne,stakeTier:!1}))},children:[i.jsx(Nr,{className:X(Dt.stakeTier&&"border-destructive ring-destructive"),children:i.jsx(qr,{placeholder:"Select minimum tier"})}),i.jsxs(Tr,{children:[i.jsx(bt,{value:"J",children:"J → A — Must be on host visibility sheet"}),i.jsx(bt,{value:"I",children:"I → A — $10 – $5,000"}),i.jsx(bt,{value:"H",children:"H → A — $25 – $5,000"}),i.jsx(bt,{value:"G",children:"G → A — $50 – $5,000"}),i.jsx(bt,{value:"F",children:"F → A — $100 – $5,000"}
394),i.jsx(bt,{value:"E",children:"E → A — $200 – $5,000"}),i.jsx(bt,{value:"D",children:"D → A — $300 – $5,000"}),i.jsx(bt,{value:"C",children:"C → A — $500 – $5,000"}),i.jsx(bt,{value:"B",children:"B → A — $1,000 – $5,000"}),i.jsx(bt,{value:"A",children:"A — $5,000"})]})]})]}),!b&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(_t,{className:"text-muted-foreground text-xs uppercase tracking-wide",children:"Capacity"}),i.jsxs("div",{className:"flex h-10 rounded-md border border-input bg-muted/30 p-1",children:[i.jsx("button",{type:"button",onClick:()=>rs("unlimited"),className:X("flex-1 rounded-sm text-sm font-medium transition-colors",Xt==="unlimited"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Unlimited"}),i.jsx("button",{type:"button",onClick:()=>{Xt==="unlimited"&&rl(!0)},className:X("flex-1 rounded-sm text-sm font-medium transition-colors",Xt==="limited"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Limited"})]}),i.jsx("div",{className:X("overflow-hidden transition-all duration-200 ease-in-out",Xt==="limited"?"max-h-24 opacity-100":"max-h-0 opacity-0"),children:i.jsxs("div",{className:"space-y-1 pt-2",children:[i.jsx(_t,{className:"text-muted-foreground text-xs uppercase tracking-wide",children:"Max Capacity"}),i.jsx("input",{type:"number",min:"1",value:Kt,onChange:I=>bn(I.target.value),className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 md:text-sm"})]})}),i.jsx(Rt,{open:Xc,onOpenChange:I=>{I||rl(!1)},children:i.jsxs(St,{children:[i.jsxs(Ct,{children:[i.jsx(jt,{children:"Capacity Limit"}),i.jsxs(Nt,{children:["If you enable a capacity limit, this event cannot be shared on Luma, Eventbrite or Meetup.",r==="edit"&&!!(o!=null&&o.luma_event_id||o!=null&&o.eventbrite_event_id)&&`
395
396Your event on Luma, Eventbrite, and Meetup, along with all sign-ups, will be deleted.`]})]}),i.jsxs(Et,{children:[i.jsx(ee,{variant:"outline",onClick:()=>rl(!1),children:"Cancel"}),i.jsx(ee,{onClick:()=>{rs("limited"),rl(!1)},children:"Understand"})]})]})})]}),i.jsx(y6,{value:$t,onChange:pn,eventCodeHint:s==null?void 0:s.event_code}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(_t,{className:"text-muted-foreground text-xs uppercase tracking-wide",children:"Description"}),$t.customDescription&&i.jsx("p",{className:"text-sm text-foreground leading-relaxed whitespace-pre-wrap",children:$t.customDescription}),i.jsxs("p",{className:"text-sm font-semibold text-foreground",children:["About ",g.title]}),i.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed whitespace-pre-wrap",children:g.descriptionText})]})]}),!w&&i.jsx(ee,{onClick:r==="edit"?ul:cl,className:"w-full font-semibold",disabled:zr,children:zr?i.jsxs(i.Fragment,{children:[i.jsx(to,{className:"mr-2 h-4 w-4 animate-spin"}),r==="edit"?"Saving...":"Creating..."]}):r==="edit"?"Save Changes":b?"Create Date":"Create Event"}),r==="edit"&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"border-t border-border my-2"}),i.jsx(ee,{variant:"outline",className:"w-full font-semibold",onClick:()=>u==null?void 0:u(),disabled:zr||Zi,children:"Duplicate Event"}),i.jsx(ee,{variant:"destructive",className:"w-full font-semibold",onClick:()=>{var I;c&&(s!=null&&s.is_recurring)&&((I=s==null?void 0:s.event_dates)==null?void 0:I.length)>1?c():Qc(!0)},disabled:zr||Zi,children:"Cancel Event"})]})]})]})}),i.jsx(w6,{open:tl,platforms:Qi,allDone:(()=>{const I=Object.values(Qi);return I.length>0&&I.every(ne=>ne==="done"||ne==="error")})(),onClose:()=>Jc(!1)}),i.jsx(Rt,{open:df,onOpenChange:Qc,children:i.jsxs(St,{children:[i.jsxs(Ct,{children:[i.jsx(jt,{children:"Cancel Event?"}),i.jsxs(Nt,{children:["Are you sure you want to cancel this event? People who joined will no longer see it as an upcoming event.",((s==null?void 0:s.luma_event_id)||(s==null?void 0:s.eventbrite_event_id))&&i.jsxs(i.Fragment,{children:[" ","If this event is shared on Luma or Eventbrite, it will also be removed from those platforms."]})," ","This action cannot be undone."]})]}),i.jsxs(Et,{children:[i.jsx(cn,{children:"No"}),i.jsx(ln,{onClick:async()=>{Zc(!0);try{const{data:{session:I}}=await pe.auth.getSession();if(!(I!=null&&I.access_token)){re.error("You must be logged in");return}const de=await fetch("https://errlhmcitfpyyhnwtqrs.supabase.co/functions/v1/cancel-event",{method:"POST",headers:{Authorization:`Bearer ${I.access_token}`,"Content-Type":"application/json"}
396,body:JSON.stringify({event_code:s.event_code})});if(!de.ok){const Re=await de.json();throw new Error(Re.error||"Failed to cancel event")}const _e=await de.json().catch(()=>({})),Ge=Array.isArray(_e==null?void 0:_e.warnings)?_e.warnings:[];if(Ge.length>0){const Re=Array.from(new Set(Ge.map(en=>en.platform))).map(en=>en==="luma"?"Luma":en==="eventbrite"?"Eventbrite":en).join(" and ");re.warning(`Event cancelled, but ${Re} did not respond. Please remove it manually on ${Re}.`)}else re.success("Event cancelled");Qc(!1),al(!1),h.invalidateQueries({queryKey:["events"]}),h.invalidateQueries({queryKey:["going-events"]}),p("/")}catch(I){console.error("[CreateEventModal] Cancel event error:",I),re.error(I.message||"Failed to cancel event")}finally{Zc(!1)}},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Zi?i.jsxs(i.Fragment,{children:[i.jsx(to,{className:"mr-2 h-4 w-4 animate-spin"}),"Cancelling..."]}):"Yes, Cancel Event"})]})]})})]})},Ar=d.forwardRef(({className:e,type:t,...n},r)=>i.jsx("input",{type:t,className:X("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));Ar.displayName="Input";function sy({state:e,activeLabel:t,doneLabel:n}){return e==="done"?i.jsxs("div",{className:"flex items-center gap-3 text-sm text-foreground",children:[i.jsx(es,{className:"h-4 w-4 text-primary shrink-0"}),i.jsx("span",{children:n})]}):e==="error"?i.jsxs("div",{className:"flex items-center gap-3 text-sm text-destructive",children:[i.jsx(AE,{className:"h-4 w-4 shrink-0"}),i.jsx("span",{children:"Import failed"})]}):e==="pending"?i.jsxs("div",{className:"flex items-center gap-3 text-sm text-muted-foreground/60",children:[i.jsx("div",{className:"h-4 w-4 rounded-full border border-muted-foreground/40 shrink-0"}),i.jsx("span",{children:t})]}):i.jsxs("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[i.jsx(to,{className:"h-4 w-4 animate-spin shrink-0"}),i.jsx("span",{children:t})]})}function q8({open:e,steps:t}){return i.jsx(ot,{open:e,onOpenChange:()=>{},children:i.jsxs(et,{className:"sm:max-w-[420px] bg-card border-2 border-primary/40 p-6 gap-4",onEscapeKeyDown:n=>n.preventDefault(),onPointerDownOutside:n=>n.preventDefault(),onInteractOutside:n=>n.preventDefault(),children:[i.jsx("div",{className:"text-base font-semibold text-foreground",children:"Importing event..."}),i.jsxs("div",{className:"flex flex-col gap-3",children:[i.jsx(sy,{state:t.detect,activeLabel:"Detecting platform...",doneLabel:"Platform detected"}),i.jsx(sy,{state:t.fetch,activeLabel:"Importing event information...",doneLabel:"Event information imported"}),i.jsx(sy,{state:t.fill,activeLabel:"Filling event form...",doneLabel:"Form ready"})]})]})})}function V8(e){try{const t=new URL(e.trim());return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}function Y8({open:e,onOpenChange:t,onImported:n}){const[r,s]=d.useState(""),[o,a]=d.useState(null),[l,c]=d.useState(!1),[u,f]=d.useState(!1),[p,h]=d.useState({detect:"pending",fetch:"pending",fill:"pending"}),m=()=>{s(""),a(null),c(!1),f(!1),h({detect:"pending",fetch:"pending",fill:"pending"})},v=x=>{l||(x||m(),t(x))},g=async()=>{const x=r.trim();if(!V8(x)){a("Please enter a valid event URL.");return}a(null),c(!0),f(!0),h({detect:"active",fetch:"pending",fill:"pending"});try{await new Promise(k=>setTimeout(k,250)),h({detect:"done",fetch:"active",fill:"pending"});const w="https://errlhmcitfpyyhnwtqrs.supabase.co",{data:{session:y}}=await pe.auth.getSession(),b=await fetch(`${w}/functions/v1/import-event-url`,{method:"POST",headers:{"Content-Type":"application/json",...y!=null&&y.access_token?{Authorization:`Bearer ${y.access_token}`}:{}},body:JSON.stringify({url:x})}),_=await b.json().catch(()=>null);if(!b.ok||!(_!=null&&_.ok)||!_.prefill){h(k=>({...k,fetch:"error"})),await new Promise(k=>setTimeout(k,400)),f(!1),c(!1),a("We couldn't import this event.");return}h({detect:"done",fetch:"done",fill:"active"}),await new Promise(k=>setTimeout(k,250)),h({detect:"done",fetch:"done",fill:"done"}),await new Promise(k=>setTimeout(k,250)),f(!1),c(!1),n(_.prefill),m(),t(!1)}catch(w){console.warn("[ImportFromUrlModal] error:",w),h(y=>({...y,fetch:"error"})),await new Promise(y=>setTimeout(y,400)),f(!1),c(!1),a("We couldn't import this event.")}};return i.jsxs(i.Fragment,{children:[i.jsx(ot,{open:e,onOpenChange:v,children:i.jsxs(et,{className:"sm:max-w-md",children:[i.jsx(Tt,{children:i.jsx(vt,{children:"Import from URL"})}),i.jsxs("div",{className:"flex flex-col gap-3 pt-2",children:[i.jsx(_t,{htmlFor:"import-url",children:"Paste your event URL"}),i.jsx(Ar,{id:"import-url",type:"url",inputMode:"url",autoFocus:!0,placeholder:"https://...",value:r,onChange:x=>{s(x.target.value),o&&a(null)},onKeyDown:x=>{x.key==="Enter"&&!l&&g()},disabled:l,maxLength:2048}),o&&i.jsx("p",{className:"text-sm text-destructive",children:o}),i.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[i.jsx(ee,{variant:"ghost",onClick:()=>v(!1),disabled:l,children:"Cancel"}),i.jsx(ee,{onClick:g,disabled:l||!r.trim(),children:"Import"})]})]})]})}),i.jsx(q8,{open:u,steps:p})]})}const Vc=({open:e,onOpenChange:t,onAuthSuccess:n,mode:r="signup"})=>{const[s,o]=d.useState(""),[a,l]=d.useState(""),[c,u]=d.useState(""),[f,p]=d.useState(""),[h,m]=d.useState(!1),v=d.useRef(null),g=d.useRef(null);d.useEffect(()=>{const{data:{subscription:_}}=pe.auth.onAuthStateChange(k=>{k==="SIGNED_IN"&&(console.log("[AuthPopup] SIGNED_IN detected in main window — closing modal"),x())});return()=>_.unsubscribe()},[t,n]),d.useEffect(()=>{const _=async k=>{var C;if(((C=k.data)==null?void 0:C.type)==="oauth-success"){console.log("[AuthPopup] Received oauth-success postMessage from popup");const{data:{session:E}}=await pe.auth.getSession();E&&x()}};return window.addEventListener("message",_),()=>window.removeEventListener("message",_)},[t,n]),d.useEffect(()=>{const _=async k=>
396{if(k.key==="oauth-popup-done"){console.log("[AuthPopup] Detected oauth-popup-done storage event");const{data:{session:C}}=await pe.auth.getSession();C&&x()}};return window.addEventListener("storage",_),()=>window.removeEventListener("storage",_)},[t,n]);const x=()=>{m(!1),t(!1),n(),g.current&&(clearInterval(g.current),g.current=null)};d.useEffect(()=>()=>{g.current&&(clearInterval(g.current),g.current=null)},[]);const w=async()=>{const _=window.location.origin,k=window.location.href,C=`google-auth-${Date.now()}`,E=window.open("about:blank",C,"width=500,height=600,scrollbars=yes");v.current=E,m(!0);const A=`https://staaake.in/auth/callback?return_to=${encodeURIComponent(k)}`;console.log("[AuthPopup] origin:",_,"| return_to:",k,"| redirectTo:",A);const{data:T,error:M}=await pe.auth.signInWithOAuth({provider:"google",options:{redirectTo:A,skipBrowserRedirect:!0,queryParams:{prompt:"select_account",access_type:"online",max_age:"0"}}});if(M||!(T!=null&&T.url)){console.error("[AuthPopup] Google OAuth error:",M),re.error("Failed to start Google sign in"),E==null||E.close(),m(!1);return}console.log("[AuthPopup] OAuth URL returned:",T.url);try{const P=new URL(T.url);console.log("[AuthPopup] authorize params:",Object.fromEntries(P.searchParams.entries()))}catch{}try{const $=new URL(T.url).searchParams.get("redirect_to");if(console.log("[AuthPopup] Parsed redirect_to:",$),console.log("[AuthPopup] Expected staaake callback with return_to:",_),!$){console.error("[AuthPopup] ABORT: redirect_to is missing from OAuth URL"),re.error("Login configuration error — redirect target missing. Please contact support."),E==null||E.close(),m(!1);return}const H=new URL($),z=H.searchParams.get("return_to"),B=H.origin==="https://staaake.in"&&H.pathname==="/auth/callback";let U=!1;try{U=!!z&&new URL(z).origin===_}catch{U=!1}if(!B||!U){console.error("[AuthPopup] ABORT: redirect_to validation failed.",{isStaaakeCallback:B,returnTo:z,currentOrigin:_,fullRedirectTo:$}),re.error("Login configuration error — redirect mismatch. Please contact support."),E==null||E.close(),m(!1);return}console.log("[AuthPopup] ✓ redirect_to validated — staaake callback with correct return_to")}catch(P){console.error("[AuthPopup] Failed to parse OAuth URL:",P),re.error("Login configuration error. Please contact support."),E==null||E.close(),m(!1);return}if(E&&!E.closed)console.log("[AuthPopup] Navigating popup to OAuth URL"),E.location.href=T.url;else{const P=window.open(T.url,C,"width=500,height=600,scrollbars=yes");v.current=P}g.current&&clearInterval(g.current),g.current=setInterval(async()=>{var P;if(v.current&&v.current.closed){console.log("[AuthPopup] Popup closed — stopping session poll"),g.current&&(clearInterval(g.current),g.current=null),m(!1);return}try{const{data:{session:$}}=await pe.auth.getSession();$&&(console.log("[AuthPopup] Session detected via polling — completing auth"),(P=v.current)==null||P.close(),x())}catch{}},1500),setTimeout(()=>{g.current&&(clearInterval(g.current),g.current=null),m(P=>(P&&re.error("Login timed out. Please try again."),!1))},3e4)},y=async()=>{if(r==="signup"){if(!c.trim()){re.error("Please enter your first name");return}if(!f.trim()){re.error("Please enter your last name");return}}if(!s||!s.includes("@")){re.error("Please enter a valid email");return}if(s.toLowerCase()!==a.toLowerCase()){re.error("Email addresses don't match");return}m(!0);const _=`https://staaake.in/auth/verify?event_return=${encodeURIComponent(window.location.href)}`;console.log("[AuthPopup] Magic link emailRedirectTo:",_);const{error:k}=await pe.auth.signInWithOtp({email:s,options:{emailRedirectTo:_,data:r==="signup"?{first_name:c.trim(),last_name:f.trim()}:void 0}});if(k){console.error("[AuthPopup] Magic link error:",k),re.error(k.message||"Failed to send login link"),m(!1);return}re.success("Check your email for the login link!"),t(!1),m(!1)},b=_=>{_||(o(""),l(""),u(""),p(""),m(!1),g.current&&(clearInterval(g.current),g.current=null)),t(_)};return i.jsx(ot,{open:e,onOpenChange:b,children:i.jsxs(et,{className:"sm:max-w-[400px] max-h-[calc(100dvh-2rem)] overflow-y-auto",children:[i.jsx(Tt,{children:i.jsx(vt,{className:"text-center text-xl",children:r==="login"?"Please sign in or sign up below":"Create your account to continue"})}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs(ee,{className:"w-full h-12 text-base",onClick:w,disabled:h,children:[h?i.jsx(to,{className:"w-5 h-5 mr-2 animate-spin"}):i.jsxs("svg",{className:"w-5 h-5 mr-2",viewBox:"0 0 24 24",children:[i.jsx("path",{fill:"currentColor",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),i.jsx("path",{fill:"currentColor",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),i.jsx("path",{fill:"currentColor",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),i.jsx("path",{fill:"currentColor",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),r==="login"?"Continue with Google":"Sign up with Google"]}),i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:"absolute inset-0 flex items-center",children:i.jsx("span",{className:"w-full border-t border-muted"})}),i.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:i.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"or"})})]}),i.jsxs("div",{className:"space-y-3",children:[r==="signup"&&i.jsxs(i.Fragment,{children:[i.jsx(Ar,{type:"text",value:c,onChange:_=>u(_.target.value),placeholder:"First Name *",className:"h-12",disabled:h}),i.jsx(Ar,{type:"text",value:f,onChange:_=>p(_.target.value),placeholder:"Last Name *",className:"h-12",disabled:h})]}),i.jsx(Ar,{type:"email",value:s,onChange:_=>o(_.target.value),placeholder:"Email *",className:"h-12",autoFocus:r==="login",disabled:h}),i.jsx(Ar,{type:"email",value:a,onChange:_=>l(_.target.value),onPaste:_=>_.preventDefault(),placeholder:"Confirm Email *",className:"h-12",disabled:h}),i.jsxs(ee,{variant:r==="login"?s&&a?"default":"outline":s&&a&&c.trim()&&f.trim()?"default":"outline",className:"w-full h-12 text-base",onClick:y,disabled:h||!s||!a||r==="signup"&&(!c.trim()||!f.trim()),children:[h?i.jsx(to,{className:"w-5 h-5 mr-2 animate-spin"}):i.jsx(VL,{className:"w-5 h-5 mr-2"}),r==="login"?"Send Login Link":"Create with Email"]})]}),r!=="login"&&i.jsx("p",{className:"text-xs text-center text-muted-foreground pt-2",children:"No spam. We only use this to verify your account."})]})]})})},G8=[{num:1,title:"create a themed power walk title",desc:"Be as niche as possible."}
396,{num:2,title:"add the basics",desc:"Date, time and location. Don't worry about the rest."},{num:3,title:"Share it everywhere",desc:"With one click, share your event on our Luma, Eventbrite and Meetup channels with 100K+ reach, plus LinkedIn, X and Instagram."},{num:4,title:"See your turnout",desc:"See how many people signed up for your event across all channels, all in one place."}],J8=[{num:1,title:"create a reverse network event name",desc:"it can be an event you are already hosting or any spot where people can meet and connect in person"},{num:2,title:"add the basics",desc:"Date, time and location. Don't worry about the rest."},{num:3,title:"Share it everywhere",desc:"With one click, share your event on our Luma, Eventbrite and Meetup channels with 100K+ reach, plus LinkedIn, X and Instagram."},{num:4,title:"See your turnout",desc:"See how many people signed up for your event across all channels, all in one place."}],Q8=[{num:1,title:"create a themed hoopers title",desc:"Let people know what you're looking for at the court."},{num:2,title:"add the basics",desc:"Date, time and location. Don't worry about the rest."},{num:3,title:"Share it everywhere",desc:"With one click, share your event on our Luma, Eventbrite and Meetup channels with 100K+ reach, plus LinkedIn, X and Instagram."},{num:4,title:"See your turnout",desc:"See how many people signed up for your event across all channels, all in one place."}],X8=[{num:1,title:"create a curated food club title",desc:"Curate a dinner, lunch, breakfast, or brunch club in your space."},{num:2,title:"add the basics",desc:"Date, time and location. Don't worry about the rest."},{num:3,title:"Share it everywhere",desc:"With one click, share your event on our Luma, Eventbrite and Meetup channels with 100K+ reach, plus LinkedIn, X and Instagram."},{num:4,title:"See your turnout",desc:"See how many people signed up for your event across all channels, all in one place."}],Z8=[{num:1,title:"create a themed online meet title",desc:"Invite your customers, community or friends to a regular weekly call."},{num:2,title:"add the basics",desc:"Date, time and link. Don't worry about the rest."},{num:3,title:"Share it everywhere",desc:"With one click, share your event on our Luma, Eventbrite and Meetup channels with 100K+ reach, plus LinkedIn, X and Instagram."},{num:4,title:"See your turnout",desc:"See how many people signed up for your event across all channels, all in one place."}
396],eH=[{num:1,title:"create an in person date idea",desc:"Something simple, safe, and easy to say yes to."},{num:2,title:"add the basics",desc:"Date, time and location. Don't worry about the rest."},{num:3,title:"click to share it",desc:"Share it on your socials or anywhere you might find a good match."},{num:4,title:"see your turnout",desc:"Choose up to 5 people you'd like to go on a casual first date with."}],tH=({open:e,onOpenChange:t})=>{const n=xn(),r=n.siteKey==="connectonlinemeets"?Z8:n.siteKey==="foodclubmeets"?X8:n.siteKey==="hoopersmeets"?Q8:n.siteKey==="reversenetwork"?J8:n.siteKey==="inpersondates"?eH:G8;return i.jsx(ot,{open:e,onOpenChange:t,children:i.jsxs(et,{className:"sm:max-w-md",children:[i.jsx(Tt,{children:i.jsx(vt,{className:"text-lg font-semibold",children:"how it works"})}),i.jsx("div",{className:"flex flex-col gap-3 mt-2",children:r.map(s=>i.jsxs("div",{className:"flex items-start gap-4 rounded-xl bg-muted/50 px-5 py-4",children:[i.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground text-sm font-bold mt-0.5",children:s.num}),i.jsxs("div",{className:"flex flex-col gap-0.5",children:[i.jsx("span",{className:"text-sm font-semibold text-foreground",children:s.title}),i.jsx("span",{className:"text-sm text-muted-foreground",children:s.desc})]})]},s.num))}),i.jsxs("div",{className:"flex flex-col items-center gap-0.5 mt-2",children:[i.jsx("span",{className:"text-xs text-muted-foreground",children:"No photo uploads."}),i.jsx("span",{className:"text-xs text-muted-foreground",children:"No writing text."}),i.jsx("span",{className:"text-xs text-muted-foreground",children:"We share our reach with you."})]})]})})},nH=[{title:"Most meetups are hit or miss.",desc:"You spend time getting there, and even if you realize in the first 5 minutes it sucks, you stay anyway. You already came all this way, so you stick around for hours and then go back. At the end, you might meet a few good people, but it often feels like you could have used that time better."},{title:"Power Walks are different.",desc:"If there are 10 people, 1 person, or even 10 jerks, you don't waste your time. You still get at least 6000 steps in. You are putting yourself in a winning position."},{title:"The idea is simple.",desc:"You look up or create in the city you live in, a themed Power Walk. A marketing power walk, developer power walk, founders power walk, New York Knicks Power Walk. By doing that you are saving time and killing two birds at once, getting your steps in and meeting people in a certain niche."}],rH=[{title:"Regular networking works like this.",desc:"You meet people at events, meetups or conferences, connect on LinkedIn, X or Instagram, and then plan coffee meetings or short calls. The problem is nobody has time. If you try to meet a few people, it can take your whole day."},{title:"Reverse Networking is different.",desc:"You connect online first, then meet people in real life at one location. Instead of doing five separate coffee meetings, you bring everyone together at once and save time."},{title:"The idea is simple.",desc:"You host or join a Reverse Networking event at places like parks, co-working spaces, bars, clubs and more. Invite the people you've connected with online and meet them all in one place in real life, without endless coffee meetings or 15-minute calls."}],sH=[{title:"Most runs at the court are random.",desc:"You show up and hope something happens, but a lot of times you just end up alone or wishing you had other people to shoot or practice with. It's hard to find your kind of hoopers."},{title:"Hoopers Meets is different.",desc:"People show up knowing exactly what they're coming for. Shooting, 1v1, 3v3, 5v5, or just getting reps in. You're not guessing anymore, everyone is there with the same intent."},{title:"The idea is simple.",desc:"You look up or create a Hoopers Meet in your city. You meet your kind of hoopers, get your reps in, play the games you want, and make the most of your time at the court."}],oH=[{title:"Most networking events are centered around work and business exchanges.",desc:"You meet people, talk about what you do, and move on. The problem is it rarely goes beyond that. Real relationships, trust, and meaningful connections don't come from surface-level conversations."},{title:"Dinner Club is different.",desc:"When people gather around food, the conversation shifts. It's no longer just about business. You talk about everything else, and that's where real connections are built. It's a more natural way to meet people in your space while building trust without forcing it."},{title:"The idea is simple.",desc:"You host or join a Dinner Club in your city. A small, curated group that meets regularly, monthly or weekly. It's a simple way to save time, stay consistent, and build real relationships with people in your field, whether you're building a startup, a network, or your own community."}],iH=[{title:"Most people have no time for 15 minute calls.",desc:"A 15 minute call is never just 15 minutes. You need at least 15 minutes before to prepare and another 15 minutes after to context switch back into work. What should be 15 minutes turns into at least 45 minutes. Do that five times a day and your whole day is gone."},{title:"Connect Online is different.",desc:"Instead of separate calls, bring people together in one session. Your customers, your community, and even new people you meet all in one place. It is more natural, more efficient, and creates better conversations."},{title:"The idea is simple.",desc:"Combine your 15 minute calls into one focused group call. Stay in touch regularly, stay relevant to your customers or community, use your time more efficiently, and build stronger relationships at the same time."}],aH=[{title:"who actually has time to text back and forth?",desc:"You swipe, you text, you build up an idea of someone. Most of the time it's not even real. People don't look the same, don't live the same way, and 
396you end up spending hours on something that might not even be worth it. Especially if you're talking to multiple people, it just becomes a time drain built on a fantasy that breaks the moment you meet."},{title:"in person dates are different.",desc:"You start by meeting. No long texting, no guessing, no build-up. You get a real interaction right away. Even if it's not a match, you didn't waste your time. You had a real experience, not just hours on your phone."},{title:"the idea is simple.",desc:"Meet people in person first. Get to know them face to face and see how it feels. Then decide if you want to continue. It might sound counterintuitive, but it saves time and leads to more real connections. Even if it doesn't work out, you still went out, experienced something, and learned more about what you want."}],lH=({open:e,onOpenChange:t})=>{const n=xn(),r=n.siteKey==="connectonlinemeets"?iH:n.siteKey==="foodclubmeets"?oH:n.siteKey==="hoopersmeets"?sH:n.siteKey==="reversenetwork"?rH:n.siteKey==="inpersondates"?aH:nH;return i.jsx(ot,{open:e,onOpenChange:t,children:i.jsxs(et,{className:"sm:max-w-md",children:[i.jsx(Tt,{children:i.jsx(vt,{className:"text-lg font-semibold",children:"Why"})}),i.jsx("div",{className:"flex flex-col gap-3 mt-2",children:r.map((s,o)=>i.jsx("div",{className:"rounded-xl bg-muted/50 px-5 py-4",children:i.jsxs("div",{className:"flex flex-col gap-0.5",children:[i.jsx("span",{className:"text-sm font-semibold text-foreground",children:s.title}),i.jsx("span",{className:"text-sm text-muted-foreground",children:s.desc})]})},o))})]})})};var bP={exports:{}},_P={};/**
397 * @license React
398 * use-sync-external-store-shim.production.js
399 *
400 * Copyright (c) Meta Platforms, Inc. and affiliates.
401 *
402 * This source code is licensed under the MIT license found in the
403 * LICENSE file in the root directory of this source tree.
404 */var Tc=d;function cH(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var uH=typeof Object.is=="function"?Object.is:cH,dH=Tc.useState,fH=Tc.useEffect,hH=Tc.useLayoutEffect,pH=Tc.useDebugValue;function mH(e,t){var n=t(),r=dH({inst:{value:n,getSnapshot:t}}),s=r[0].inst,o=r[1];return hH(function(){s.value=n,s.getSnapshot=t,oy(s)&&o({inst:s})},[e,n,t]),fH(function(){return oy(s)&&o({inst:s}),e(function(){oy(s)&&o({inst:s})})},[e]),pH(n),n}function oy(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!uH(e,n)}catch{return!0}}function gH(e,t){return t()}var yH=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?gH:mH;_P.useSyncExternalStore=Tc.useSyncExternalStore!==void 0?Tc.useSyncExternalStore:yH;bP.exports=_P;var vH=bP.exports;function wH(){return vH.useSyncExternalStore(xH,()=>!0,()=>!1)}function xH(){return()=>{}}var xb="Avatar",[bH,X7]=vr(xb),[_H,kP]=bH(xb),SP=d.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[s,o]=d.useState("idle");return i.jsx(_H,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:o,children:i.jsx(ve.span,{...r,ref:t})})});SP.displayName=xb;var CP="AvatarImage",EP=d.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:s=()=>{},...o}=e,a=kP(CP,n),l=kH(r,o),c=vn(u=>{s(u),a.onImageLoadingStatusChange(u)});return jn(()=>{l!=="idle"&&c(l)},[l,c]),l==="loaded"?i.jsx(ve.img,{...o,ref:t,src:r}):null});EP.displayName=CP;var jP="AvatarFallback",NP=d.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...s}=e,o=kP(jP,n),[a,l]=d.useState(r===void 0);return d.useEffect(()=>{if(r!==void 0){const c=window.setTimeout(()=>l(!0),r);return()=>window.clearTimeout(c)}},[r]),a&&o.imageLoadingStatus!=="loaded"?i.jsx(ve.span,{...s,ref:t}):null});NP.displayName=jP;function Wk(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function kH(e,{referrerPolicy:t,crossOrigin:n}){const r=wH(),s=d.useRef(null),o=r?(s.current||(s.current=new window.Image),s.current):null,[a,l]=d.useState(()=>Wk(o,e));return jn(()=>{l(Wk(o,e))},[o,e]),jn(()=>{const c=p=>()=>{l(p)};if(!o)return;const u=c("loaded"),f=c("error");return o.addEventListener("load",u),o.addEventListener("error",f),t&&(o.referrerPolicy=t),typeof n=="string"&&(o.crossOrigin=n),()=>{o.removeEventListener("load",u),o.removeEventListener("error",f)}},[o,n,t]),a}var TP=SP,PP=EP,RP=NP;
404const km=d.forwardRef(({className:e,...t},n)=>i.jsx(TP,{ref:n,className:X("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));km.displayName=TP.displayName;const SH=d.forwardRef(({className:e,...t},n)=>i.jsx(PP,{ref:n,className:X("aspect-square h-full w-full",e),...t}));SH.displayName=PP.displayName;const Sm=d.forwardRef(({className:e,...t},n)=>i.jsx(RP,{ref:n,className:X("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Sm.displayName=RP.displayName;function Pi(e){return`https://staaake.in/${e}`}async function AP(e){const t=Pi(e),n=window.open("about:blank","_blank");if(!n)return;try{n.opener=null}catch{}const r=s=>{n.location.href=s};try{const s=await bb("https://staaake.in");r(s?`https://staaake.in/auth/handoff?code=${encodeURIComponent(s)}&u=${encodeURIComponent(e)}`:t)}catch{r(t)}}async function bb(e){try{const{data:{session:t}}=await pe.auth.getSession(),n=t==null?void 0:t.access_token,r="https://uijpvjufahnqxxxickza.supabase.co",s="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InVpanB2anVmYWhucXh4eGlja3phIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjQ3Mjc2MTIsImV4cCI6MjA4MDMwMzYxMn0.cmf5m_XGhwIl1GHcaLkgSWzCHmphMd8Vw2-5qdQBGbQ";if(!n||!r||!s)return null;const o=new AbortController,a=setTimeout(()=>o.abort(),4e3);try{const l=await fetch(`${r}/functions/v1/create-handoff`,{method:"POST",headers:{Authorization:`Bearer ${n}`,apikey:s,"Content-Type":"application/json"},body:JSON.stringify(e?{destination_origin:e}:{}),signal:o.signal});if(!l.ok)return console.warn(`[staaakeHandoff] create-handoff failed with status ${l.status}`),null;const c=await l.json().catch(()=>null);return c!=null&&c.code?String(c.code):null}catch(l){return console.warn("[staaakeHandoff] create-handoff request error:",l instanceof Error?l.name:"unknown"),null}finally{clearTimeout(a)}}catch{return null}}async function CH(e){const t=o=>{window.location.href=o};let n;try{n=new URL(e,window.location.origin)}catch{t(e);return}if(n.origin===window.location.origin){t(e);return}const r=await bb(n.origin);if(!r){t(e);return}const s=`${n.pathname}${n.search}${n.hash}`||"/";t(`${n.origin}/auth/handoff?code=${encodeURIComponent(r)}&next=${encodeURIComponent(s)}`)}function IP(e,t){e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),CH(t))}function Aa(e,t){t&&(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),AP(t)))}var iy="rovingFocusGroup.onEntryFocus",EH={bubbles:!1,cancelable:!0},tf="RovingFocusGroup",[aw,OP,jH]=lm(tf),[NH,MP]=vr(tf,[jH]),[TH,PH]=NH(tf),LP=d.forwardRef((e,t)=>i.jsx(aw.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(aw.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(RH,{...e,ref:t})})}));LP.displayName=tf;var RH=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...p}=e,h=d.useRef(null),m=Pe(t,h),v=cm(o),[g,x]=ro({prop:a,defaultProp:l??null,onChange:c,caller:tf}),[w,y]=d.useState(!1),b=vn(u),_=OP(n),k=d.useRef(!1),[C,E]=d.useState(0);return d.useEffect(()=>{const A=h.current;if(A)return A.addEventListener(iy,b),()=>A.removeEventListener(iy,b)},[b]),i.jsx(TH,{scope:n,orientation:r,dir:v,loop:s,currentTabStopId:g,onItemFocus:d.useCallback(A=>x(A),[x]),onItemShiftTab:d.useCallback(()=>y(!0),[]),onFocusableItemAdd:d.useCallback(()=>E(A=>A+1),[]),onFocusableItemRemove:d.useCallback(()=>E(A=>A-1),[]),children:i.jsx(ve.div,{tabIndex:w||C===0?-1:0,"data-orientation":r,...p,ref:m,style:{outline:"none",...e.style},onMouseDown:ie(e.onMouseDown,()=>{k.current=!0}),onFocus:ie(e.onFocus,A=>{const T=!k.current;if(A.target===A.currentTarget&&T&&!w){const M=new CustomEvent(iy,EH);if(A.currentTarget.dispatchEvent(M),!M.defaultPrevented){const P=_().filter(U=>U.focusable),$=P.find(U=>U.active),H=P.find(U=>U.id===g),B=[$,H,...P].filter(Boolean).map(U=>U.ref.current);UP(B,f)}}k.current=!1}),onBlur:ie(e.onBlur,()=>y(!1))})})}),DP="RovingFocusGroupItem",$P=d.forwardRef((e,t)=>
vendor: 19,641 bytes, line 404
404{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,children:a,...l}=e,c=Gn(),u=o||c,f=PH(DP,n),p=f.currentTabStopId===u,h=OP(n),{onFocusableItemAdd:m,onFocusableItemRemove:v,currentTabStopId:g}=f;return d.useEffect(()=>{if(r)return m(),()=>v()},[r,m,v]),i.jsx(aw.ItemSlot,{scope:n,id:u,focusable:r,active:s,children:i.jsx(ve.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...l,ref:t,onMouseDown:ie(e.onMouseDown,x=>{r?f.onItemFocus(u):x.preventDefault()}),onFocus:ie(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:ie(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){f.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const w=OH(x,f.orientation,f.dir);if(w!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let b=h().filter(_=>_.focusable).map(_=>_.ref.current);if(w==="last")b.reverse();else if(w==="prev"||w==="next"){w==="prev"&&b.reverse();const _=b.indexOf(x.currentTarget);b=f.loop?MH(b,_+1):b.slice(_+1)}setTimeout(()=>UP(b))}}),children:typeof a=="function"?a({isCurrentTabStop:p,hasTabStop:g!=null}):a})})});$P.displayName=DP;var AH={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function IH(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function OH(e,t,n){const r=IH(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return AH[r]}function UP(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function MH(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var LH=LP,DH=$P,lw=["Enter"," "],$H=["ArrowDown","PageUp","Home"],FP=["ArrowUp","PageDown","End"],UH=[...$H,...FP],FH={ltr:[...lw,"ArrowRight"],rtl:[...lw,"ArrowLeft"]},zH={ltr:["ArrowLeft"],rtl:["ArrowRight"]},nf="Menu",[Nd,BH,WH]=lm(nf),[Ga,zP]=vr(nf,[WH,Hi,MP]),Cm=Hi(),BP=MP(),[HH,Ja]=Ga(nf),[KH,rf]=Ga(nf),WP=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:o,modal:a=!0}=e,l=Cm(t),[c,u]=d.useState(null),f=d.useRef(!1),p=vn(o),h=cm(s);return d.useEffect(()=>{const m=()=>{f.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>f.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),i.jsx(hm,{...l,children:i.jsx(HH,{scope:t,open:n,onOpenChange:p,content:c,onContentChange:u,children:i.jsx(KH,{scope:t,onClose:d.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:h,modal:a,children:r})})})};WP.displayName=nf;var qH="MenuAnchor",_b=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Cm(n);return i.jsx(Jd,{...s,...r,ref:t})});_b.displayName=qH;var kb="MenuPortal",[VH,HP]=Ga(kb,{forceMount:void 0}),KP=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,o=Ja(kb,t);return i.jsx(VH,{scope:t,forceMount:n,children:i.jsx(Qn,{present:n||o.open,children:i.jsx(Wc,{asChild:!0,container:s,children:r})})})};KP.displayName=kb;var ds="MenuContent",[YH,Sb]=Ga(ds),qP=d.forwardRef((e,t)=>{const n=HP(ds,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=Ja(ds,e.__scopeMenu),a=rf(ds,e.__scopeMenu);return i.jsx(Nd.Provider,{scope:e.__scopeMenu,children:i.jsx(Qn,{present:r||o.open,children:i.jsx(Nd.Slot,{scope:e.__scopeMenu,children:a.modal?i.jsx(GH,{...s,ref:t}):i.jsx(JH,{...s,ref:t})})})})}),GH=d.forwardRef((e,t)=>{const n=Ja(ds,e.__scopeMenu),r=d.useRef(null),s=Pe(t,r);return d.useEffect(()=>{const o=r.current;if(o)return rm(o)},[]),i.jsx(Cb,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ie(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),JH=d.forwardRef((e,t)=>{const n=Ja(ds,e.__scopeMenu);return i.jsx(Cb,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),QH=Mi("MenuContent.ScrollLock"),Cb=d.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:h,onDismiss:m,disableOutsideScroll:v,...g}=e,x=Ja(ds,n),w=rf(ds,n),y=Cm(n),b=BP(n),_=BH(n),[k,C]=d.useState(null),E=d.useRef(null),A=Pe(t,E,x.onContentChange),T=d.useRef(0),M=d.useRef(""),P=d.useRef(0),$=d.useRef(null),H=d.useRef("right"),z=d.useRef(0),B=v?Yd:d.Fragment,U=v?{as:QH,allowPinchZoom:!0}:void 0,D=N=>{var q,me;const W=M.current+N,G=_().filter(oe=>!oe.disabled),L=document.activeElement,K=(q=G.find(oe=>oe.ref.current===L))==null?void 0:q.textValue,J=G.map(oe=>oe.textValue),Z=cK(J,W,K),ce=(me=G.find(oe=>oe.textValue===Z))==null?void 0:me.ref.current;(function oe(ae){M.current=ae,window.clearTimeout(T.current),ae!==""&&(T.current=window.setTimeout(()=>oe(""),1e3))})(W),ce&&setTimeout(()=>ce.focus())};d.useEffect(()=>()=>window.clearTimeout(T.current),[]),tm();const j=d.useCallback(N=>{var G,L;return H.current===((G=$.current)==null?void 0:G.side)&&dK(N,(L=$.current)==null?void 0:L.area)},[]);return i.jsx(YH,{scope:n,searchRef:M,onItemEnter:d.useCallback(N=>{j(N)&&N.preventDefault()},[j]),onItemLeave:d.useCallback(N=>{var W;j(N)||((W=E.current)==null||W.focus(),C(null))},[j]),onTriggerLeave:d.useCallback(N=>{j(N)&&N.preventDefault()},[j]),pointerGraceTimerRef:P,onPointerGraceIntentChange:d.useCallback(N=>{$.current=N},[]),children:i.jsx(B,{...U,children:i.jsx(Vd,{asChild:!0,trapped:s,onMountAutoFocus:ie(o,N=>{var W;N.preventDefault(),(W=E.current)==null||W.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:i.jsx(Ya,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:h,onDismiss:m,children:i.jsx(LH,{asChild:!0,...b,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:k,onCurrentTabStopIdChange:C,onEntryFocus:ie(c,N=>{w.isUsingKeyboardRef.current||N.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(pm,{role:"menu","aria-orientation":"vertical","data-state":lR(x.open),"data-radix-menu-content":"",dir:w.dir,...y,...g,ref:A,style:{outline:"none",...g.style},onKeyDown:ie(g.onKeyDown,N=>{const G=N.target.closest("[data-radix-menu-content]")===N.currentTarget,L=N.ctrlKey||N.altKey||N.metaKey,K=N.key.length===1;G&&(N.key==="Tab"&&N.preventDefault(),!L&&K&&D(N.key));const J=E.current;if(N.target!==J||!UH.includes(N.key))return;N.preventDefault();const ce=_().filter(q=>!q.disabled).map(q=>q.ref.current);FP.includes(N.key)&&ce.reverse(),aK(ce)}),onBlur:ie(e.onBlur,N=>{N.currentTarget.contains(N.target)||(window.clearTimeout(T.current),M.current="")}),onPointerMove:ie(e.onPointerMove,Td(N=>{const W=N.target,G=z.current!==N.clientX;if(N.currentTarget.contains(W)&&G){const L=N.clientX>z.current?"right":"left";H.current=L,z.current=N.clientX}}))})})})})})})});qP.displayName=ds;var XH="MenuGroup",Eb=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(ve.div,{role:"group",...r,ref:t})});Eb.displayName=XH;var ZH="MenuLabel",VP=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(ve.div,{...r,ref:t})});VP.displayName=ZH;var vp="MenuItem",Hk="menu.itemSelect",Em=d.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,o=d.useRef(null),a=rf(vp,e.__scopeMenu),l=Sb(vp,e.__scopeMenu),c=Pe(t,o),u=d.useRef(!1),f=()=>{const p=o.current;if(!n&&p){const h=new CustomEvent(Hk,{bubbles:!0,cancelable:!0});p.addEventListener(Hk,m=>r==null?void 0:r(m),{once:!0}),Kx(p,h),h.defaultPrevented?u.current=!1:a.onClose()}};return i.jsx(YP,{...s,ref:c,disabled:n,onClick:ie(e.onClick,f),onPointerDown:p=>{var h;(h=e.onPointerDown)==null||h.call(e,p),u.current=!0},onPointerUp:ie(e.onPointerUp,p=>{var h;u.current||(h=p.currentTarget)==null||h.click()}),onKeyDown:ie(e.onKeyDown,p=>{const h=l.searchRef.current!=="";n||h&&p.key===" "||lw.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Em.displayName=vp;var YP=d.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...o}=e,a=Sb(vp,n),l=BP(n),c=d.useRef(null),u=Pe(t,c),[f,p]=d.useState(!1),[h,m]=d.useState("");return d.useEffect(()=>{const v=c.current;v&&m((v.textContent??"").trim())},[o.children]),i.jsx(Nd.ItemSlot,{scope:n,disabled:r,textValue:s??h,children:i.jsx(DH,{asChild:!0,...l,focusable:!r,children:i.jsx(ve.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:u,onPointerMove:ie(e.onPointerMove,Td(v=>{r?a.onItemLeave(v):(a.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ie(e.onPointerLeave,Td(v=>a.onItemLeave(v))),onFocus:ie(e.onFocus,()=>p(!0)),onBlur:ie(e.onBlur,()=>p(!1))})})})}),eK="MenuCheckboxItem",GP=d.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return i.jsx(eR,{scope:e.__scopeMenu,checked:n,children:i.jsx(Em,{role:"menuitemcheckbox","aria-checked":wp(n)?"mixed":n,...s,ref:t,"data-state":Nb(n),onSelect:ie(s.onSelect,()=>r==null?void 0:r(wp(n)?!0:!n),{checkForDefaultPrevented:!1})})})});GP.displayName=eK;var JP="MenuRadioGroup",[tK,nK]=Ga(JP,{value:void 0,onValueChange:()=>{}}),QP=d.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,o=vn(r);return i.jsx(tK,{scope:e.__scopeMenu,value:n,onValueChange:o,children:i.jsx(Eb,{...s,ref:t})})});QP.displayName=JP;var XP="MenuRadioItem",ZP=d.forwardRef((e,t)=>{const{value:n,...r}=e,s=nK(XP,e.__scopeMenu),o=n===s.value;return i.jsx(eR,{scope:e.__scopeMenu,checked:o,children:i.jsx(Em,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":Nb(o),onSelect:ie(r.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,n)},{checkForDefaultPrevented:!1})})})});ZP.displayName=XP;var jb="MenuItemIndicator",[eR,rK]=Ga(jb,{checked:!1}),tR=d.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,o=rK(jb,n);return i.jsx(Qn,{present:r||wp(o.checked)||o.checked===!0,children:i.jsx(ve.span,{...s,ref:t,"data-state":Nb(o.checked)})})});tR.displayName=jb;var sK="MenuSeparator",nR=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(ve.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});nR.displayName=sK;var oK="MenuArrow",rR=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Cm(n);return i.jsx(mm,{...s,...r,ref:t})});rR.displayName=oK;var iK="MenuSub",[Z7,sR]=Ga(iK),Tu="MenuSubTrigger",oR=d.forwardRef((e,t)=>{const n=Ja(Tu,e.__scopeMenu),r=rf(Tu,e.__scopeMenu),s=sR(Tu,e.__scopeMenu),o=Sb(Tu,e.__scopeMenu),a=d.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=o,u={__scopeMenu:e.__scopeMenu},f=d.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return d.useEffect(()=>f,[f]),d.useEffect(()=>{const p=l.current;return()=>{window.clearTimeout(p),c(null)}},[l,c]),i.jsx(_b,{asChild:!0,...u,children:i.jsx(YP,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":lR(n.open),...e,ref:Mo(t,s.onTriggerChange),onClick:p=>{var h;(h=e.onClick)==null||h.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ie(e.onPointerMove,Td(p=>{o.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:ie(e.onPointerLeave,Td(p=>{var m,v;f();const h=(m=n.content)==null?void 0:m.getBoundingClientRect();if(h){const g=(v=n.content)==null?void 0:v.dataset.side,x=g==="right",w=x?-5:5,y=h[x?"left":"right"],b=h[x?"right":"left"];o.onPointerGraceIntentChange({area:[{x:p.clientX+w,y:p.clientY},{x:y,y:h.top},{x:b,y:h.top},{x:b,y:h.bottom},{x:y,y:h.bottom}],side:g}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(p),p.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:ie(e.onKeyDown,p=>{var m;const h=o.searchRef.current!=="";e.disabled||h&&p.key===" "||FH[r.dir].includes(p.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),p.preventDefault())})})})});oR.displayName=Tu;var iR="MenuSubContent",aR=d.forwardRef((e,t)=>{const n=HP(ds,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=Ja(ds,e.__scopeMenu),a=rf(ds,e.__scopeMenu),l=sR(iR,e.__scopeMenu),c=d.useRef(null),u=Pe(t,c);return i.jsx(Nd.Provider,{scope:e.__scopeMenu,children:i.jsx(Qn,{present:r||o.open,children:i.jsx(Nd.Slot,{scope:e.__scopeMenu,children:i.jsx(Cb,{id:l.contentId,"aria-labelledby":l.triggerId,...s,ref:u,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var p;a.isUsingKeyboardRef.current&&((p=c.current)==null||p.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:ie(e.onFocusOutside,f=>{f.target!==l.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:ie(e.onEscapeKeyDown,f=>{a.onClose(),f.preventDefault()}),onKeyDown:ie(e.onKeyDown,f=>{var m;const p=f.currentTarget.contains(f.target),h=zH[a.dir].includes(f.key);p&&h&&(o.onOpenChange(!1),(m=l.trigger)==null||m.focus(),f.preventDefault())})})})})})});aR.displayName=iR;function lR(e){return e?"open":"closed"}function wp(e){return e==="indeterminate"}function Nb(e){return wp(e)?"indeterminate":e?"checked":"unchecked"}function aK(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function lK(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function cK(e,t,n){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=lK(e,Math.max(o,0));s.length===1&&(a=a.filter(u=>u!==n));const c=a.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function uK(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const l=t[o],c=t[a],u=l.x,f=l.y,p=c.x,h=c.y;f>r!=h>r&&n<(p-u)*(r-f)/(h-f)+u&&(s=!s)}return s}function dK(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return uK(n,t)}function Td(e){return t=>t.pointerType==="mouse"?e(t):void 0}var fK=WP,hK=_b,pK=KP,mK=qP,gK=Eb,yK=VP,vK=Em,wK=GP,xK=QP,bK=ZP,_K=tR,kK=nR,SK=rR,CK=oR,EK=aR,jm="DropdownMenu",[jK,eG]=vr(jm,[zP]),wr=zP(),[NK,cR]=jK(jm),uR=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:o,onOpenChange:a,modal:l=!0}=e,c=wr(t),u=d.useRef(null),[f,p]=ro({prop:s,defaultProp:o??!1,onChange:a,caller:jm});return i.jsx(NK,{scope:t,triggerId:Gn(),triggerRef:u,contentId:Gn(),open:f,onOpenChange:p,onOpenToggle:d.useCallback(()=>p(h=>!h),[p]),modal:l,children:i.jsx(fK,{...c,open:f,onOpenChange:p,dir:r,modal:l,children:n})})};uR.displayName=jm;var dR="DropdownMenuTrigger",fR=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,o=cR(dR,n),a=wr(n);return i.jsx(hK,{asChild:!0,...a,children:i.jsx(ve.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:Mo(t,o.triggerRef),onPointerDown:ie(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(o.onOpenToggle(),o.open||l.preventDefault())}),onKeyDown:ie(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&o.onOpenToggle(),l.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});fR.displayName=dR;var TK="DropdownMenuPortal",hR=e=>{const{__scopeDropdownMenu:t,...n}=e,r=wr(t);return i.jsx(pK,{...r,...n})};hR.displayName=TK;var pR="DropdownMenuContent",mR=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cR(pR,n),o=wr(n),a=d.useRef(!1);return i.jsx(mK,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...r,ref:t,onCloseAutoFocus:ie(e.onCloseAutoFocus,l=>{var c;a.current||(c=s.triggerRef.current)==null||c.focus(),a.current=!1,l.preventDefault()}),onInteractOutside:ie(e.onInteractOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,f=c.button===2||u;(!s.modal||f)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});mR.displayName=pR;var PK="DropdownMenuGroup",RK=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=wr(n);return i.jsx(gK,{...s,...r,ref:t})});RK.displayName=PK;var AK="DropdownMenuLabel",gR=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=wr(n);return i.jsx(yK,{...s,...r,ref:t})});gR.displayName=AK;var IK="DropdownMenuItem",yR=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=wr(n);return i.jsx(vK,{...s,...r,ref:t})});yR.displayName=IK;var OK="DropdownMenuCheckboxItem",vR=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=wr(n);return i.jsx(wK,{...s,...r,ref:t})});vR.displayName=OK;var MK="DropdownMenuRadioGroup",LK=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=wr(n);return i.jsx(xK,{...s,...r,ref:t})});LK.displayName=MK;var DK="DropdownMenuRadioItem",wR=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=wr(n);return i.jsx(bK,{...s,...r,ref:t})});wR.displayName=DK;var $K="DropdownMenuItemIndicator",xR=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=wr(n);return i.jsx(_K,{...s,...r,ref:t})});xR.displayName=$K;var UK="DropdownMenuSeparator",bR=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=wr(n);return i.jsx(kK,{...s,...r,ref:t})});bR.displayName=UK;var FK="DropdownMenuArrow",zK=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=wr(n);return i.jsx(SK,{...s,...r,ref:t})});zK.displayName=FK;var BK="DropdownMenuSubTrigger",_R=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=wr(n);return i.jsx(CK,{...s,...r,ref:t})});_R.displayName=BK;var WK="DropdownMenuSubContent",kR=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=wr(n);return i.jsx(EK,{...s,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});kR.displayName=WK;var HK=uR,KK=fR,qK=hR,SR=mR,CR=gR,ER=yR,jR=vR,NR=wR,TR=xR,PR=bR,RR=_R,AR=kR;const IR=HK,OR=KK,VK=d.forwardRef(({className:e,inset:t,children:n,...r},s)=>i.jsxs(RR,{ref:s,className:X("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",t&&"pl-8",e),...r,children:[n,i.jsx(xo,{className:"ml-auto h-4 w-4"})]}));VK.displayName=RR.displayName;const YK=d.forwardRef(({className:e,...t},n)=>i.jsx(AR,{ref:n,className:X("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
404de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));YK.displayName=AR.displayName;const Tb=d.forwardRef(({className:e,sideOffset:t=4,...n},r)=>i.jsx(qK,{children:i.jsx(SR,{ref:r,sideOffset:t,className:X("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Tb.displayName=SR.displayName;const Bu=d.forwardRef(({className:e,inset:t,...n},r)=>i.jsx(ER,{ref:r,className:X("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t&&"pl-8",e),...n}));Bu.displayName=ER.displayName;const GK=d.forwardRef(({className:e,children:t,checked:n,...r},s)=>i.jsxs(jR,{ref:s,className:X("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),checked:n,...r,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(TR,{children:i.jsx(es,{className:"h-4 w-4"})})}),t]}));GK.displayName=jR.displayName;const JK=d.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(NR,{ref:r,className:X("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(TR,{children:i.jsx(EE,{className:"h-2 w-2 fill-current"})})}),t]}));JK.displayName=NR.displayName;const QK=d.forwardRef(({className:e,inset:t,...n},r)=>i.jsx(CR,{ref:r,className:X("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));QK.displayName=CR.displayName;const MR=d.forwardRef(({className:e,...t},n)=>i.jsx(PR,{ref:n,className:X("-mx-1 my-1 h-px bg-muted",e),...t}));MR.displayName=PR.displayName;const ay="staaake-authdebug";function XK(){if(typeof window>"u")return!1;try{const e=new URLSearchParams(window.location.search);return e.get("authdebug")==="1"?(sessionStorage.setItem(ay,"1"),!0):e.get("authdebug")==="0"?(sessionStorage.removeItem(ay),!1):sessionStorage.getItem(ay)==="1"}catch{return!1}}const LR=XK();function Kk(){return new Date().toISOString().slice(11,23)}function ct(e,t){if(!LR)return;const n=window.location.origin;t===void 0?console.log(`[authdebug ${Kk()}] ${n} ${e}`):console.log(`[authdebug ${Kk()}] ${n} ${e}`,t)}function Gf(e,t){try{return e.getItem(t)}catch{return null}}function ZK(){const e=[];try{for(let t=0;t<localStorage.length;t+=1){const n=localStorage.key(t);n!=null&&n.startsWith("staaake-broker-established:")&&e.push(n)}}catch{}return e}function eq(e){var n;const t=new URLSearchParams(window.location.search);return{url:window.location.href,hasLocalSession:!!e,userId:((n=e==null?void 0:e.user)==null?void 0:n.id)??null,hasSupabaseTokenInStorage:!!Gf(localStorage,"staaake-auth-token"),ssoChecked:Gf(sessionStorage,"staaake-sso-checked"),signedOutMarker:Gf(localStorage,"staaake-signed-out"),establishAttempt:Gf(sessionStorage,"staaake-establish-attempt"),brokerEstablishedKeys:ZK(),params:{sso:t.get("sso"),sso_state:t.get("sso_state"),established:t.get("established"),code:t.has("code")?"(present)":null},visibility:document.visibilityState}}function Pc(e,t){LR&&ct(e,eq(t))}const tq="https://staaake.in/auth/sso",nq="https://staaake.in/auth/establish",xp="staaake-sso-checked",bp="staaake-establish-attempt",_p="staaake-signed-out",DR="staaake-broker-established:",rq=3e4,sq=6e4,oq=5e3;let Jf=!1;function $R(){try{localStorage.setItem(_p,String(Date.now()+oq))}catch{}}function UR(){try{localStorage.removeItem(_p)}catch{}}function iq(){try{const e=localStorage.getItem(_p);if(!e)return!1;const t=Number(e);return Number.isFinite(t)&&t>Date.now()?!0:(localStorage.removeItem(_p),!1)}catch{return!1}}function ly(){try{const e=sessionStorage.getItem(xp);if(!e)return null;const t=JSON.parse(e);return typeof t.state!="string"||t.phase!=="pending"||typeof t.expiresAt!="number"||t.expiresAt<=Date.now()?(sessionStorage.removeItem(xp),null):t}catch{return null}}function aq(e){try{sessionStorage.setItem(xp,JSON.stringify(e))}catch{}}function qk(){try{const e=Number(sessionStorage.getItem(bp));return Number.isFinite(e)&&e>Date.now()?!0:(sessionStorage.removeItem(bp),!1)}catch{return!1}}function FR(){try{sessionStorage.setItem(bp,String(Date.now()+sq))}catch{}}
404function zR(){try{sessionStorage.removeItem(bp)}catch{}}function Pb(){try{sessionStorage.removeItem(xp)}catch{}}function lq(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const e=new Uint8Array(16);return crypto.getRandomValues(e),Array.from(e,t=>t.toString(16).padStart(2,"0")).join("")}function Rb(e){return`${DR}${e}`}function cw(e){try{return localStorage.getItem(Rb(e))==="1"}catch{return!1}}function BR(e){try{localStorage.setItem(Rb(e),"1")}catch{}}function cq(e){try{localStorage.removeItem(Rb(e))}catch{}}function WR(){Pb(),zR();try{const e=[];for(let t=0;t<localStorage.length;t+=1){const n=localStorage.key(t);n!=null&&n.startsWith(DR)&&e.push(n)}e.forEach(t=>localStorage.removeItem(t))}catch{}}function uw(){UR(),Pb()}async function HR(e){if(ct("establishCentralBroker:enter",{userId:e,redirectingAlready:Jf,established:cw(e),cooldown:qk()}),Jf||cw(e)||qk())return ct("establishCentralBroker:skipped"),!1;Jf=!0;const t=await bb("https://staaake.in");if(!t)return Jf=!1,FR(),ct("establishCentralBroker:mint-failed -> cooldown started"),!1;const n=new URL(window.location.href);return n.searchParams.delete("code"),n.searchParams.delete("token_hash"),n.searchParams.delete("type"),n.searchParams.delete("network_established"),n.searchParams.delete("established"),ct("establishCentralBroker:navigating to /auth/establish",{returnTo:n.toString()}),window.location.replace(`${nq}?code=${encodeURIComponent(t)}&return_to=${encodeURIComponent(n.toString())}`),!0}async function kp(e){const t="https://uijpvjufahnqxxxickza.supabase.co",n="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InVpanB2anVmYWhucXh4eGlja3phIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjQ3Mjc2MTIsImV4cCI6MjA4MDMwMzYxMn0.cmf5m_XGhwIl1GHcaLkgSWzCHmphMd8Vw2-5qdQBGbQ";try{const r=await fetch(`${t}/functions/v1/network-session-status`,{method:"POST",headers:{Authorization:`Bearer ${e}`,apikey:n,"Content-Type":"application/json"},body:"{}"});if(r.status===404)return"unavailable";if(r.status===401||r.status===403)return"revoked";if(!r.ok)return"unavailable";const s=await r.json().catch(()=>null);return!s||typeof s!="object"?"unavailable":s.revoked===!0||s.valid===!1?"revoked":"active"}catch{return"unavailable"}}async function Sp(){Dj(),$R(),WR();try{await pe.auth.signOut({scope:"local"})}catch{}finally{Bx()}}function uq(){try{const e=new URL(window.location.href);if(!e.searchParams.has("sso")&&!e.searchParams.has("sso_state"))return;e.searchParams.delete("sso"),e.searchParams.delete("sso_state");const t=e.searchParams.toString();window.history.replaceState(null,"",`${e.pathname}${t?`?${t}`:""}${e.hash}`)}catch{}}async function Vk(){try{Pc("runSsoBootstrap:enter");const e=window.location.hostname;if(Xp(e))return ct("runSsoBootstrap:exit preview host"),!1;if(window.location.pathname.replace(/\/+$/,"")==="/auth/handoff")return ct("runSsoBootstrap:exit handoff route"),!1;const n=new URLSearchParams(window.location.search),r=n.get("established");if(r!==null||n.has("network_established")){ct("runSsoBootstrap:establish return",{established:r}),n.delete("established"),n.delete("network_established");const l=n.toString();window.history.replaceState(null,"",`${window.location.pathname}${l?`?${l}`:""}${window.location.hash}`)}if(n.has("sso")){const l=ly(),c=n.get("sso_state");return ct("runSsoBootstrap:broker return",{sso:n.get("sso"),stateMatches:!!l&&c===l.state,attempt:l}),Pb(),!1}if(n.has("code")||window.location.hash.includes("access_token"))return ct("runSsoBootstrap:exit auth callback in flight"),!1;if(ly())return ct("runSsoBootstrap:exit attempt record present",ly()),!1;const{data:{session:s}}=await pe.auth.getSession();if(Pc("runSsoBootstrap:session read",s),s!=null&&s.access_token)return(async()=>{const l=await kp(s.access_token);ct("runSsoBootstrap:revocation check",{status:l}),l==="revoked"&&(await Sp(),window.location.reload())})(),UR(),r==="1"?(BR(s.user.id),zR()):r==="failed"&&(cq(s.user.id),FR()),cw(s.user.id)?(ct("runSsoBootstrap:logged in, broker already established -> quiet"),!1):(ct("runSsoBootstrap:logged in, broker not established -> establish"),await HR(s.user.id));if(iq())return ct("runSsoBootstrap:exit signed-out marker present"),!1;const o=lq();aq({state:o,phase:"pending",expiresAt:Date.now()+rq});const a=new URL(window.location.href);return a.searchParams.set("sso_state",o),ct("runSsoBootstrap:navigating to /auth/sso",{returnTo:a.toString()}),window.location.replace(`${tq}?return_to=${encodeURIComponent(a.toString())}`),!0}catch(e){return ct("runSsoBootstrap:threw",e),!1}}const dq="staaake-profile-identity",fq="staaake-profile-flags-",Yk="selected_sheet_username",hq="staaake-auth-token",pq=1e4,mq=8e3,Gk="We could not log you out everywhere. Please try again.",gq="We could not confirm logout. Check your connection and try again.";async function yq(){$R(),WR(),Dj();try{await pe.auth.signOut({scope:"local"})}finally{Bx()}try{localStorage.removeItem(dq);const e=[];for(let n=0;n<localStorage.length;n++){const r=localStorage.key(n);r&&r.startsWith(fq)&&e.push(r)}e.forEach(n=>localStorage.removeItem(n));const t=[];for(let n=0;n<localStorage.length;n++){const r=localStorage.key(n);(r===Yk||r!=null&&r.startsWith(`${Yk}:`))&&t.push(r)}t.forEach(n=>localStorage.removeItem(n)),localStorage.removeItem(hq)}catch{}window.location.reload()}async function KR(e,t,n){const r=new AbortController,s=setTimeout(()=>r.abort(),n);try{return await fetch(e,{...t,signal:r.signal})}finally{clearTimeout(s)}}async function vq(e,t){try{const n=await KR(`${e}/functions/v1/verify-identity`,{method:"GET",headers:{Authorization:`Bearer ${t}`}},mq);return n.status===401||n.status===403?"revoked":n.ok?"alive":"unreachable"}catch{return"unreachable"}}async function qR(){const{data:{session:e}}=await pe.auth.getSession(),t="https://uijpvjufahnqxxxickza.supabase.co",n="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InVpanB2anVmYWhucXh4eGlja3phIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjQ3Mjc2MTIsImV4cCI6MjA4MDMwMzYxMn0.cmf5m_XGhwIl1GHcaLkgSWzCHmphMd8Vw2-5qdQBGbQ";if(!(e!=null&&e.access_token)||!t||!n)throw new Error("Your session could not be verified. Please try again.");const r=e.access_token;let s=null;try{s=await KR(`${t}/functions/v1/network-logout`,{method:"POST",headers:{Authorization:`Bearer ${r}`,apikey:n,"Content-Type":"application/json"},body:"{}"},pq)}catch{s=null}if(s&&!s.ok)throw new Error(Gk);if(!s){const o=await vq(t,r);
404if(o==="alive")throw new Error(Gk);if(o==="unreachable")throw new Error(gq)}await yq()}const wq=1,xq=1e6;let cy=0;function bq(){return cy=(cy+1)%Number.MAX_SAFE_INTEGER,cy.toString()}const uy=new Map,Jk=e=>{if(uy.has(e))return;const t=setTimeout(()=>{uy.delete(e),Wu({type:"REMOVE_TOAST",toastId:e})},xq);uy.set(e,t)},_q=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,wq)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?Jk(n):e.toasts.forEach(r=>{Jk(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Sh=[];let Ch={toasts:[]};function Wu(e){Ch=_q(Ch,e),Sh.forEach(t=>{t(Ch)})}function Eh({...e}){const t=bq(),n=s=>Wu({type:"UPDATE_TOAST",toast:{...s,id:t}}),r=()=>Wu({type:"DISMISS_TOAST",toastId:t});return Wu({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||r()}}}),{id:t,dismiss:r,update:n}}function kq(){const[e,t]=d.useState(Ch);return d.useEffect(()=>(Sh.push(t),()=>{const n=Sh.indexOf(t);n>-1&&Sh.splice(n,1)}),[e]),{...e,toast:Eh,dismiss:n=>Wu({type:"DISMISS_TOAST",toastId:n})}}const VR=({firstName:e,lastName:t,email:n,activeUsername:r,profileComplete:s,onUpdateProfile:o,avatarClassName:a})=>{const l=Dr(),[c,u]=d.useState(!1),[f,p]=d.useState(""),[h,m]=d.useState(""),[v,g]=d.useState(!1),[x,w]=d.useState(!1),[y,b]=d.useState(!1),[_,k]=d.useState(!1),C=()=>{var U,D,j;const z=(U=e==null?void 0:e[0])==null?void 0:U.toUpperCase(),B=(D=t==null?void 0:t[0])==null?void 0:D.toUpperCase();return z&&B?z+B:z||((j=n==null?void 0:n[0])==null?void 0:j.toUpperCase())||"U"},E=n.split("@")[0]||"",A=()=>{p(e||E),m(t||E),g(!1),w(!1),u(!0)},T=()=>{const z=!f.trim(),B=!h.trim();return g(z),w(B),!z&&!B},M=async()=>{if(!T())return;b(!0);const z=await o(f.trim(),h.trim());b(!1),z?(u(!1),l.invalidateQueries({queryKey:["event-attendees"]}),l.invalidateQueries({queryKey:["followed_users"]}),l.invalidateQueries({queryKey:["events"]}),Eh({title:"Profile updated"})):Eh({title:"Failed to update profile",variant:"destructive"})},P=()=>{T()&&u(!1)},$=async()=>{if(!_){k(!0);try{await qR()}catch(z){k(!1),Eh({title:z instanceof Error?z.message:"We could not log you out everywhere. Please try again.",variant:"destructive"})}}},H=!!r;return i.jsxs(i.Fragment,{children:[i.jsxs(IR,{children:[i.jsx(OR,{asChild:!0,children:i.jsx(ee,{variant:"ghost",className:"rounded-full w-9 h-9 p-0",children:i.jsx(km,{className:"w-9 h-9",children:i.jsx(Sm,{className:X("bg-primary text-primary-foreground text-sm font-medium",a),children:C()})})})}),i.jsxs(Tb,{align:"end",className:"w-64",children:[i.jsxs("div",{className:"px-3 py-2 flex items-start justify-between gap-2",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:e||E}),t&&i.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:t}),i.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:n})]}),i.jsx(ee,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",onClick:A,children:i.jsx(PE,{className:"w-3.5 h-3.5"})})]}),i.jsx(MR,{}),H?i.jsx(Bu,{asChild:!0,children:i.jsxs("a",{href:Pi(r),onClick:z=>Aa(z,r),target:"_blank",rel:"noopener noreferrer",className:"grid grid-cols-[1rem_1fr] items-start gap-x-2 gap-y-0",children:[i.jsx(m_,{className:"w-4 h-4 shrink-0 mt-0.5"}),i.jsx("span",{className:"text-sm leading-none",children:"My Sheet"}),i.jsx("span",{className:"col-start-2 text-xs text-muted-foreground mt-1",children:"Edit sheet"})]})}):i.jsxs(Bu,{disabled:!0,className:"opacity-50 grid grid-cols-[1rem_1fr] items-start gap-x-2 gap-y-0",children:[i.jsx(m_,{className:"w-4 h-4 shrink-0 mt-0.5"}),i.jsx("span",{className:"text-sm leading-none",children:"My Sheet"}),i.jsx("span",{className:"col-start-2 text-xs text-muted-foreground mt-1",children:"Edit sheet"})]}),i.jsxs(Bu,{onSelect:z=>{z.preventDefault(),$()},disabled:_,children:[i.jsx(TE,{className:"w-4 h-4 mr-2"}),_?"Logging out...":"Log Out"]})]})]}),i.jsx(ot,{open:c,onOpenChange:z=>{!z&&!T()||u(z)},children:i.jsxs(et,{className:"sm:max-w-sm",children:[i.jsx(Tt,{children:i.jsx(vt,{children:"Edit Name"})}),i.jsxs("div",{className:"space-y-4 py-2",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(_t,{htmlFor:"edit-first-name",children:"First Name"}),i.jsx(Ar,{id:"edit-first-name",value:f,onChange:z=>{p(z.target.value),g(!1)},placeholder:"First name",className:X(v&&"border-destructive")}
vendor: 13,888 bytes, line 404
404),v&&i.jsx("p",{className:"text-xs text-destructive",children:"This field is required"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(_t,{htmlFor:"edit-last-name",children:"Last Name"}),i.jsx(Ar,{id:"edit-last-name",value:h,onChange:z=>{m(z.target.value),w(!1)},placeholder:"Last name",className:X(x&&"border-destructive")}),x&&i.jsx("p",{className:"text-xs text-destructive",children:"This field is required"})]})]}),i.jsxs(so,{children:[i.jsx(ee,{variant:"outline",onClick:P,children:"Cancel"}),i.jsx(ee,{onClick:M,disabled:y,children:y?"Saving...":"Save"})]})]})})]})},YR=({className:e="text-white/80 hover:text-white"})=>{const{sheets:t,selectedUsername:n,setSelectedUsername:r}=Fo(),s=n||"username";return!t||t.length<=1?i.jsx("a",{href:Pi(s),onClick:o=>Aa(o,s),target:"_blank",rel:"noopener noreferrer",className:`text-sm font-bold transition-colors ${e}`,children:s}):i.jsxs(IR,{children:[i.jsx(OR,{asChild:!0,children:i.jsxs("button",{className:`inline-flex items-center gap-1 text-sm font-bold transition-colors focus:outline-none ${e}`,children:[s,i.jsx(Yp,{className:"h-3 w-3"})]})}),i.jsx(Tb,{align:"start",className:"min-w-[160px]",children:t.map(o=>i.jsxs(Bu,{onSelect:()=>{r(o.sheet_username)},className:"flex items-center justify-between gap-2 cursor-pointer",children:[i.jsx("span",{children:o.sheet_username}),o.sheet_username===n&&i.jsx(es,{className:"h-4 w-4 text-primary"})]},o.id))})]})};var Qk=1,Sq=.9,Cq=.8,Eq=.17,dy=.1,fy=.999,jq=.9999,Nq=.99,Tq=/[\\\/_+.#"@\[\(\{&]/,Pq=/[\\\/_+.#"@\[\(\{&]/g,Rq=/[\s-]/,GR=/[\s-]/g;function dw(e,t,n,r,s,o,a){if(o===t.length)return s===e.length?Qk:Nq;var l=`${s},${o}`;if(a[l]!==void 0)return a[l];for(var c=r.charAt(o),u=n.indexOf(c,s),f=0,p,h,m,v;u>=0;)p=dw(e,t,n,r,u+1,o+1,a),p>f&&(u===s?p*=Qk:Tq.test(e.charAt(u-1))?(p*=Cq,m=e.slice(s,u-1).match(Pq),m&&s>0&&(p*=Math.pow(fy,m.length))):Rq.test(e.charAt(u-1))?(p*=Sq,v=e.slice(s,u-1).match(GR),v&&s>0&&(p*=Math.pow(fy,v.length))):(p*=Eq,s>0&&(p*=Math.pow(fy,u-s))),e.charAt(u)!==t.charAt(o)&&(p*=jq)),(p<dy&&n.charAt(u-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(u-1)!==r.charAt(o))&&(h=dw(e,t,n,r,u+1,o+2,a),h*dy>p&&(p=h*dy)),p>f&&(f=p),u=n.indexOf(c,u+1);return a[l]=f,f}function Xk(e){return e.toLowerCase().replace(GR," ")}function Aq(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,dw(e,t,Xk(e),Xk(t),0,0,{})}var wu='[cmdk-group=""]',hy='[cmdk-group-items=""]',Iq='[cmdk-group-heading=""]',JR='[cmdk-item=""]',Zk=`${JR}:not([aria-disabled="true"])`,fw="cmdk-item-select",Tl="data-value",Oq=(e,t,n)=>Aq(e,t,n),QR=d.createContext(void 0),sf=()=>d.useContext(QR),XR=d.createContext(void 0),Ab=()=>d.useContext(XR),ZR=d.createContext(void 0),eA=d.forwardRef((e,t)=>{let n=Pl(()=>{var L,K;return{search:"",value:(K=(L=e.value)!=null?L:e.defaultValue)!=null?K:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Pl(()=>new Set),s=Pl(()=>new Map),o=Pl(()=>new Map),a=Pl(()=>new Set),l=tA(e),{label:c,children:u,value:f,onValueChange:p,filter:h,shouldFilter:m,loop:v,disablePointerSelection:g=!1,vimBindings:x=!0,...w}=e,y=Gn(),b=Gn(),_=Gn(),k=d.useRef(null),C=Kq();Ka(()=>{if(f!==void 0){let L=f.trim();n.current.value=L,E.emit()}},[f]),Ka(()=>{C(6,H)},[]);let E=d.useMemo(()=>({subscribe:L=>(a.current.add(L),()=>a.current.delete(L)),snapshot:()=>n.current,setState:(L,K,J)=>{var Z,ce,q,me;if(!Object.is(n.current[L],K)){if(n.current[L]=K,L==="search")$(),M(),C(1,P);else if(L==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let oe=document.getElementById(_);oe?oe.focus():(Z=document.getElementById(y))==null||Z.focus()}if(C(7,()=>{var oe;n.current.selectedItemId=(oe=z())==null?void 0:oe.id,E.emit()}),J||C(5,H),((ce=l.current)==null?void 0:ce.value)!==void 0){let oe=K??"";(me=(q=l.current).onValueChange)==null||me.call(q,oe);return}}E.emit()}},emit:()=>{a.current.forEach(L=>L())}}),[]),A=d.useMemo(()=>({value:(L,K,J)=>{var Z;K!==((Z=o.current.get(L))==null?void 0:Z.value)&&(o.current.set(L,{value:K,keywords:J}),n.current.filtered.items.set(L,T(K,J)),C(2,()=>{M(),E.emit()}))},item:(L,K)=>(r.current.add(L),K&&(s.current.has(K)?s.current.get(K).add(L):s.current.set(K,new Set([L]))),C(3,()=>{$(),M(),n.current.value||P(),E.emit()}),()=>{o.current.delete(L),r.current.delete(L),n.current.filtered.items.delete(L);let J=z();C(4,()=>{$(),(J==null?void 0:J.getAttribute("id"))===L&&P(),E.emit()})}),group:L=>(s.current.has(L)||s.current.set(L,new Set),()=>{o.current.delete(L),s.current.delete(L)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:y,inputId:_,labelId:b,listInnerRef:k}),[]);function T(L,K){var J,Z;let ce=(Z=(J=l.current)==null?void 0:J.filter)!=null?Z:Oq;return L?ce(L,n.current.search,K):0}function M(){if(!n.current.search||l.current.shouldFilter===!1)return;let L=n.current.filtered.items,K=[];n.current.filtered.groups.forEach(Z=>{let ce=s.current.get(Z),q=0;ce.forEach(me=>{let oe=L.get(me);q=Math.max(oe,q)}),K.push([Z,q])});let J=k.current;B().sort((Z,ce)=>{var q,me;let oe=Z.getAttribute("id"),ae=ce.getAttribute("id");return((q=L.get(ae))!=null?q:0)-((me=L.get(oe))!=null?me:0)}).forEach(Z=>{let ce=Z.closest(hy);ce?ce.appendChild(Z.parentElement===ce?Z:Z.closest(`${hy} > *`)):J.appendChild(Z.parentElement===J?Z:Z.closest(`${hy} > *`))}),K.sort((Z,ce)=>ce[1]-Z[1]).forEach(Z=>{var ce;let q=(ce=k.current)==null?void 0:ce.querySelector(`${wu}[${Tl}="${encodeURIComponent(Z[0])}"]`);q==null||q.parentElement.appendChild(q)})}function P(){let L=B().find(J=>J.getAttribute("aria-disabled")!=="true"),K=L==null?void 0:L.getAttribute(Tl);E.setState("value",K||void 0)}function $(){var L,K,J,Z;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ce=0;for(let q of r.current){let me=(K=(L=o.current.get(q))==null?void 0:L.value)!=null?K:"",oe=(Z=(J=o.current.get(q))==null?void 0:J.keywords)!=null?Z:[],ae=T(me,oe);n.current.filtered.items.set(q,ae),ae>0&&ce++}for(let[q,me]of s.current)for(let oe of me)if(n.current.filtered.items.get(oe)>0){n.current.filtered.groups.add(q);break}n.current.filtered.count=ce}function H(){var L,K,J;let Z=z();Z&&(((L=Z.parentElement)==null?void 0:L.firstChild)===Z&&((J=(K=Z.closest(wu))==null?void 0:K.querySelector(Iq))==null||J.scrollIntoView({block:"nearest"})),Z.scrollIntoView({block:"nearest"}))}function z(){var L;return(L=k.current)==null?void 0:L.querySelector(`${JR}[aria-selected="true"]`)}function B(){var L;return Array.from(((L=k.current)==null?void 0:L.querySelectorAll(Zk))||[])}function U(L){let K=B()[L];K&&E.setState("value",K.getAttribute(Tl))}function D(L){var K;let J=z(),Z=B(),ce=Z.findIndex(me=>me===J),q=Z[ce+L];(K=l.current)!=null&&K.loop&&(q=ce+L<0?Z[Z.length-1]:ce+L===Z.length?Z[0]:Z[ce+L]),q&&E.setState("value",q.getAttribute(Tl))}function j(L){let K=z(),J=K==null?void 0:K.closest(wu),Z;for(;J&&!Z;)J=L>0?Wq(J,wu):Hq(J,wu),Z=J==null?void 0:J.querySelector(Zk);Z?E.setState("value",Z.getAttribute(Tl)):D(L)}let N=()=>U(B().length-1),W=L=>{L.preventDefault(),L.metaKey?N():L.altKey?j(1):D(1)},G=L=>{L.preventDefault(),L.metaKey?U(0):L.altKey?j(-1):D(-1)};return d.createElement(ve.div,{ref:t,tabIndex:-1,...w,"cmdk-root":"",onKeyDown:L=>{var K;(K=w.onKeyDown)==null||K.call(w,L);let J=L.nativeEvent.isComposing||L.keyCode===229;if(!(L.defaultPrevented||J))switch(L.key){case"n":case"j":{x&&L.ctrlKey&&W(L);break}case"ArrowDown":{W(L);break}case"p":case"k":{x&&L.ctrlKey&&G(L);break}case"ArrowUp":{G(L);break}case"Home":{L.preventDefault(),U(0);break}case"End":{L.preventDefault(),N();break}case"Enter":{L.preventDefault();let Z=z();if(Z){let ce=new Event(fw);Z.dispatchEvent(ce)}}}}},d.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:Vq},c),Nm(e,L=>d.createElement(XR.Provider,{value:E},d.createElement(QR.Provider,{value:A},L))))}),Mq=d.forwardRef((e,t)=>{var n,r;let s=Gn(),o=d.useRef(null),a=d.useContext(ZR),l=sf(),c=tA(e),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:a==null?void 0:a.forceMount;Ka(()=>{if(!u)return l.item(s,a==null?void 0:a.id)},[u]);let f=nA(s,o,[e.value,e.children,o],e.keywords),p=Ab(),h=$i(C=>C.value&&C.value===f.current),m=$i(C=>u||l.filter()===!1?!0:C.search?C.filtered.items.get(s)>0:!0);d.useEffect(()=>{let C=o.current;if(!(!C||e.disabled))return C.addEventListener(fw,v),()=>C.removeEventListener(fw,v)},[m,e.onSelect,e.disabled]);function v(){var C,E;g(),(E=(C=c.current).onSelect)==null||E.call(C,f.current)}function g(){p.setState("value",f.current,!0)}if(!m)return null;let{disabled:x,value:w,onSelect:y,forceMount:b,keywords:_,...k}=e;return d.createElement(ve.div,{ref:Mo(o,t),...k,id:s,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!h,"data-disabled":!!x,"data-selected":!!h,onPointerMove:x||l.getDisablePointerSelection()?void 0:g,onClick:x?void 0:v},e.children)}),Lq=d.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...o}=e,a=Gn(),l=d.useRef(null),c=d.useRef(null),u=Gn(),f=sf(),p=$i(m=>s||f.filter()===!1?!0:m.search?m.filtered.groups.has(a):!0);Ka(()=>f.group(a),[]),nA(a,l,[e.value,e.heading,c]);let h=d.useMemo(()=>({id:a,forceMount:s}),[s]);return d.createElement(ve.div,{ref:Mo(l,t),...o,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&d.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Nm(e,m=>d.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},d.createElement(ZR.Provider,{value:h},m))))}),Dq=d.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=d.useRef(null),o=$i(a=>!a.search);return!n&&!o?null:d.createElement(ve.div,{ref:Mo(s,t),...r,"cmdk-separator":"",role:"separator"})}),$q=d.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,o=Ab(),a=$i(u=>u.search),l=$i(u=>u.selectedItemId),c=sf();return d.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),d.createElement(ve.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:s?e.value:a,onChange:u=>{s||o.setState("search",u.target.value),n==null||n(u.target.value)}})}),Uq=d.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,o=d.useRef(null),a=d.useRef(null),l=$i(u=>u.selectedItemId),c=sf();return d.useEffect(()=>{if(a.current&&o.current){let u=a.current,f=o.current,p,h=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let m=u.offsetHeight;f.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return h.observe(u),()=>{cancelAnimationFrame(p),h.unobserve(u)}}},[]),d.createElement(ve.div,{ref:Mo(o,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:c.listId},Nm(e,u=>d.createElement("div",{ref:Mo(a,c.listInnerRef),"cmdk-list-sizer":""},u)))}),Fq=d.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:o,container:a,...l}=e;return d.createElement(Gx,{open:n,onOpenChange:r},d.createElement(Jx,{container:a},d.createElement(om,{"cmdk-overlay":"",className:s}),d.createElement(im,{"aria-label":e.label,"cmdk-dialog":"",className:o},d.createElement(eA,{ref:t,...l}))))}),zq=d.forwardRef((e,t)=>$i(n=>n.filtered.count===0)?d.createElement(ve.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Bq=d.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...o}=e;return d.createElement(ve.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Nm(e,a=>d.createElement("div",{"aria-hidden":!0},a)))}),$r=Object.assign(eA,{List:Uq,Item:Mq,Input:$q,Group:Lq,Separator:Dq,Dialog:Fq,Empty:zq,Loading:Bq});function Wq(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Hq(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function tA(e){let t=d.useRef(e);return Ka(()=>{t.current=e}),t}var Ka=typeof window>"u"?d.useEffect:d.useLayoutEffect;function Pl(e){let t=d.useRef();return t.current===void 0&&(t.current=e()),t}function $i(e){let t=Ab(),n=()=>e(t.snapshot());return d.useSyncExternalStore(t.subscribe,n,n)}function nA(e,t,n,r=[]){let s=d.useRef(),o=sf();return Ka(()=>{var a;let l=(()=>{var u;for(let f of n){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(u=f.current.textContent)==null?void 0:u.trim():s.current}})(),c=r.map(u=>u.trim());o.value(e,l,c),(a=t.current)==null||a.setAttribute(Tl,l),s.current=l}),s}var Kq=()=>{let[e,t]=d.useState(),n=Pl(()=>new Map);return Ka(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function qq(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Nm({asChild:e,children:t},n){return e&&d.isValidElement(t)?d.cloneElement(qq(t),{ref:t.ref},n(t.props.children)):n(t)}var Vq={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const rA=d.forwardRef(({className:e,...t},n)=>i.jsx($r,{ref:n,className:X("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));rA.displayName=$r.displayName;const sA=d.forwardRef(({className:e,...t},n)=>i.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[i.jsx(GL,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),i.jsx($r.Input,{ref:n,className:X("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));sA.displayName=$r.Input.displayName;
404const oA=d.forwardRef(({className:e,...t},n)=>i.jsx($r.List,{ref:n,className:X("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));oA.displayName=$r.List.displayName;const iA=d.forwardRef((e,t)=>i.jsx($r.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));iA.displayName=$r.Empty.displayName;const aA=d.forwardRef(({className:e,...t},n)=>i.jsx($r.Group,{ref:n,className:X("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));aA.displayName=$r.Group.displayName;const Yq=d.forwardRef(({className:e,...t},n)=>i.jsx($r.Separator,{ref:n,className:X("-mx-1 h-px bg-border",e),...t}));Yq.displayName=$r.Separator.displayName;const lA=d.forwardRef(({className:e,...t},n)=>i.jsx($r.Item,{ref:n,className:X("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...t}));lA.displayName=$r.Item.displayName;const cA="profile:heightUnit",uA="profile:weightUnit";function Ib(e){const t=Math.round(e/2.54),n=Math.floor(t/12),r=t%12;return`${n}'${r}"`}function Ob(e){return`${Math.round(e*2.20462)} lbs`}function Gq(){return typeof window>"u"?"cm":window.localStorage.getItem(cA)==="ft-in"?"ft-in":"cm"}function Jq(e){typeof window>"u"||window.localStorage.setItem(cA,e)}function Qq(){return typeof window>"u"?"kg":window.localStorage.getItem(uA)==="lbs"?"lbs":"kg"}function Xq(e){typeof window>"u"||window.localStorage.setItem(uA,e)}const Mb=[{title:"Core",fields:[{key:"over_18",label:"Are you over 18?",kind:"yesno"},{key:"age",label:"Your age",kind:"roller",min:18,max:80,unit:"year"},{key:"gender",label:"Your gender",kind:"select",options:["male","female"]},{key:"interested_in",label:"Interested in",kind:"select",options:["men","women"]}]},{title:"Physical",fields:[{key:"height_matters",label:"Does height matter to you?",kind:"yesno"},{key:"height_cm",label:"Your height",kind:"roller",min:140,max:240,unit:"cm"},{key:"weight_matters",label:"Does weight matter to you?",kind:"yesno"},{key:"weight_kg",label:"Your weight",kind:"roller",min:40,max:140,unit:"kg"},{key:"hair_length_matters",label:"Does hair length matter to you?",kind:"yesno"},{key:"hair_length",label:"Your hair length",kind:"select",options:["short","medium","long","bald-shaved"]},{key:"hair_color",label:"Your hair color",kind:"select",options:["blonde","brown","black","red","grey","white","colored"]},{key:"eye_color",label:"Your eye color",kind:"select",options:["blue","green","brown","hazel","grey","black","other"]},{key:"skin_tone",label:"Your skin tone",kind:"select",options:["very fair","fair","medium","tan","olive","dark","very dark"]},{key:"tattoos",label:"Do you have tattoos?",kind:"yesno"},{key:"tattoos_5plus",label:"5 or more tattoos?",kind:"yesno"},{key:"piercings",label:"Do you have piercings?",kind:"yesno"},{key:"piercings_10plus",label:"10 or more piercings?",kind:"yesno"}]},{title:"Personality and Lifestyle",fields:[{key:"self_description",label:"How would you describe yourself?",kind:"select",options:["ambitious","chill","adventurous","creative","funny","intellectual","social","introverted","balanced","spontaneous","disciplined","other"]},{key:"zodiac_interest",label:"Interested in zodiac signs?",kind:"yesno"},{key:"zodiac_sign",label:"Your zodiac sign",kind:"select",options:["aries","taurus","gemini","cancer","leo","virgo","libra","scorpio","sagittarius","capricorn","aquarius","pisces"]},{key:"diet",label:"Your diet",kind:"select",options:["omnivore","carnivore","meat based diet","flexitarian","pescatarian","vegetarian","vegan","keto","paleo","mediterranean","halal","kosher","other","no specific diet"]},{key:"diet_strictness",label:"How strict is your diet?",kind:"select",options:["strict","80%","medium","not strict"]},{key:"smokes",label:"Do you smoke?",kind:"yesno"},{key:"smoke_freq",label:"How often do you smoke?",kind:"select",options:["never","sometimes","socially","often"]},{key:"drinks",label:"Do you drink alcohol?",kind:"yesno"},{key:"drink_freq",label:"How often do you drink?",kind:"select",options:["never","sometimes","socially","often"]},{key:"drugs",label:"Do you use recreational drugs?",kind:"yesno"},{key:"drug_freq",label:"How often do you use recreational drugs?",kind:"select",options:["never","every day","2x week","sometimes","rarely"]},{key:"cooks",label:"Do you cook?",kind:"yesno"},{key:"cook_freq",label:"How often do you cook?",kind:"select",options:["never","sometimes","80%","often"]},{key:"cleans",label:"Do you clean?",kind:"yesno"},{key:"clean_freq",label:"How often do you clean?",kind:"select",options:["never","rarely","sometimes","often"]},{key:"healthy_lifestyle",label:"Do you live a healthy lifestyle?",kind:"yesno"},{key:"body_type",label:"How would you describe your body type?",kind:"select",options:["slim","athletic","average","curvy","muscular","prefer not to say"]},{key:"exercises",label:"Do you exercise?",kind:"yesno"},{key:"exercise_freq",label:"How often do you exercise?",kind:"select",options:["daily","few times a week","rarely","never"]},{key:"walks",label:"Do you like to go for a walk?",kind:"yesno"},{key:"walk_freq",label:"How often do you walk?",kind:"select",options:["daily","few times a week","rarely","never"]},{key:"style",label:"How would you describe your style?",kind:"select",options:["casual","sporty","smart casual","classic","elegant","minimalist","trendy","streetwear","creative / artistic","luxury","relaxed","other"]}]},{title:"Communication",fields:[{key:"languages_count",label:"How many languages do you speak?",kind:"select",options:["1","2","3+"]},{key:"english_level",label:"Your English level",kind:"select",options:["native","fluent","good","little bit","none"]}]},{title:"Relationship",fields:[{key:"has_kids",label:"Do you have kids?",kind:"yesno"},{key:"kids_count",label:"How many kids do you have?",kind:"select",options:["1","2","3","4","5+","no kids"]},{key:"wants_kids",label:"Do you want kids?",kind:"yesno"},{key:"kids_want_count",label:"How many kids do you want to have?",kind:"select",options:["1","2","3","4","5+","no kids"]},{key:"been_married",label:"Have you been married?",kind:"yesno"}]},{title:"Education and Beliefs",fields:[{key:"education",label:"Your education",kind:"select",options:["high school","college","master's","phd","self-taught","prefer not to say"]},{key:"follows_religion",label:"Do you follow a religion?",kind:"yesno"},{key:"religion_type",label:"Religion type",kind:"select",options:["spiritual","christian","muslim","jewish","hindu","buddhist","atheist","none","other"]}]},{title:"Pets",fields:[{key:"has_pets",label:"Do you have pets?",kind:"yesno"},{key:"pet_type",label:"Pet type",kind:"select",options:["cat","dog","bunny","bird","fish","reptiles","exotic pets","none","other"]}]},{title:"Work",fields:[{key:"occupation_status",label:"Your occupation status",kind:"select",options:["self-employed","corporate","employed","unemployed","intern","student"]}]}],Zq=["English","Spanish","French","German","Italian","Portuguese","Dutch","Polish","Russian","Ukrainian","Turkish","Arabic","Hebrew","Hindi","Urdu","Bengali","Chinese","Japanese","Korean","Vietnamese","Thai","Indonesian","Filipino","Swahili","Greek","Czech","Romanian","Hungarian","Swedish","Norweg
404ian","Danish","Finnish","Other"],eV=["I am a man looking for women","I am a woman looking for men","I am a man looking for men","I am a woman looking for women"],eS={man_seeking_women:"m4w",woman_seeking_men:"w4m",man_seeking_men:"m4m",woman_seeking_women:"w4w"},hw={"I am a man looking for women":"man_seeking_women","I am a woman looking for men":"woman_seeking_men","I am a man looking for men":"man_seeking_men","I am a woman looking for women":"woman_seeking_women"},tS=Object.fromEntries(Object.entries(hw).map(([e,t])=>[t,e])),pw={man_seeking_women:"Man looking for women",woman_seeking_men:"Woman looking for men",man_seeking_men:"Man looking for men",woman_seeking_women:"Woman looking for women"},tV=["White / Caucasian","Black / African","Hispanic / Latino","East Asian","South Asian","Middle Eastern","Southeast Asian","Mixed","Other","Prefer not to say"],Qf=[{title:"Core",fields:[{key:"dob",label:"Date of birth",kind:"dob"},{key:"relationship_intent_label",label:"Looking for",kind:"select",options:eV},{key:"home_location",label:"Current home location",kind:"places"}]},...Mb.filter(e=>e.title!=="Core"&&e.title!=="Communication").map(e=>{if(e.title!=="Physical")return e;const t=[];for(const n of e.fields)t.push(n),n.key==="skin_tone"&&t.push({key:"ethnicity",label:"What is your ethnicity?",kind:"select",options:tV});return{...e,fields:t}}),{title:"Communication",fields:[{key:"mother_language",label:"Mother tongue",kind:"combobox",options:Zq,allowOther:!0},{key:"languages_count",label:"How many languages do you speak?",kind:"select",options:["1","2","3+"]},{key:"english_level",label:"Your English level",kind:"select",options:["native","fluent","good","little bit","none"]}]}],dA=(()=>{const e=Qf[0],t=Qf[Qf.length-1],n=Qf.slice(1,-1);return[e,t,...n]})();function nV(e){return e==="inpersondates"?dA:Mb}const rV=Mb.flatMap(e=>e.fields),fA=rV,Lb=dA.flatMap(e=>e.fields);function py(e){const t={};for(const n of e)t[n.key]=null;return t}function hA(e){return e!=null&&e!==""}function sV(e,t){let n=0;for(const r of t)hA(e[r.key])&&n++;return n}function oV(e){if(!e)return null;const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return null;const[,n,r,s]=t,o=+n,a=+r,l=+s,c=new Date;let u=c.getFullYear()-o;return(c.getMonth()+1<a||c.getMonth()+1===a&&c.getDate()<l)&&(u-=1),u}const iV=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function aV(e,t){return new Date(e,t,0).getDate()}const yo=40,lV=5;function jh({min:e,max:t,value:n,onChange:r,format:s,defaultScroll:o}){const a=d.useMemo(()=>{const x=[];for(let w=e;w<=t;w++)x.push(w);return x},[e,t]),l=d.useRef(null),c=d.useRef(null),u=d.useRef(!1),f=d.useRef(!1);d.useEffect(()=>{const x=l.current;if(x){if(n!=null){const w=Math.max(0,Math.min(a.length-1,n-e));x.scrollTop=w*yo}else if(o!=null){const w=Math.max(0,Math.min(a.length-1,o-e));x.scrollTop=w*yo}u.current=!0}},[]);const p=d.useCallback(()=>{const x=l.current;if(!x||!f.current)return;const w=Math.round(x.scrollTop/yo),y=Math.max(0,Math.min(a.length-1,w)),b=a[y];b!==n&&r(b),c.current&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>{const _=y*yo;Math.abs(x.scrollTop-_)>.5&&x.scrollTo({top:_,behavior:"smooth"})},120)},[a,n,r]),h=x=>{const w=l.current;if(!w)return;f.current=!0;const y=x-e;w.scrollTo({top:y*yo,behavior:"smooth"}),r(x)},m=x=>{if(x.key!=="ArrowUp"&&x.key!=="ArrowDown")return;x.preventDefault(),f.current=!0;const w=n??e,y=x.key==="ArrowDown"?Math.min(t,w+1):Math.max(e,w-1);h(y)},v=yo*lV,g=(v-yo)/2;return i.jsxs("div",{className:"relative w-full max-w-[180px] rounded-lg border border-border bg-background",style:{height:v},tabIndex:0,onKeyDown:m,children:[i.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-1/2 -translate-y-1/2 border-y border-primary/40 bg-primary/5",style:{height:yo}}),i.jsx("div",{ref:l,onScroll:p,className:"h-full overflow-y-scroll scrollbar-hide snap-y snap-mandatory",style:{scrollSnapType:"y mandatory"},children:i.jsx("div",{style:{paddingTop:g,paddingBottom:g},children:a.map(x=>{const w=x===n;return i.jsx("div",{onClick:()=>h(x),className:X("flex items-center justify-center cursor-pointer snap-center select-none transition-opacity",w?"text-foreground font-semibold":"text-muted-foreground opacity-70 hover:opacity-100"),style:{height:yo,scrollSnapAlign:"center"},children:s?s(x):x},x)})})})]})}
404function cV({value:e,onChange:t}){const n="rounded-full px-5 h-9 text-sm border transition-colors";return i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{type:"button",onClick:()=>t(!0),className:X(n,e===!0?"bg-primary text-primary-foreground border-primary":"border-border text-foreground hover:bg-foreground/10"),children:"Yes"}),i.jsx("button",{type:"button",onClick:()=>t(!1),className:X(n,e===!1?"bg-primary text-primary-foreground border-primary":"border-border text-foreground hover:bg-foreground/10"),children:"No"})]})}function Db({open:e,onOpenChange:t}){const n=xn().siteKey,r=d.useMemo(()=>nV(n),[n]),s=d.useMemo(()=>r.flatMap(B=>B.fields),[r]),o=s.length,a=Dr(),[l,c]=d.useState(()=>py(s)),[u,f]=d.useState(()=>py(s)),[p,h]=d.useState(!1),[m,v]=d.useState(!1),[g,x]=d.useState(!1),[w,y]=d.useState(()=>Gq()),[b,_]=d.useState(()=>Qq()),k=B=>{y(B),Jq(B)},C=B=>{_(B),Xq(B)},E=d.useMemo(()=>{for(const B of s)if(l[B.key]!==u[B.key])return!0;return!1},[l,u,s]),A=sV(l,s),T=A===o;d.useEffect(()=>{if(!e)return;let B=!1;return(async()=>{h(!0);try{const{data:{session:U}}=await pe.auth.getSession();if(!U)throw new Error("Not signed in");const j=await fetch("https://errlhmcitfpyyhnwtqrs.supabase.co/functions/v1/get-dating-profile",{method:"GET",headers:{Authorization:`Bearer ${U.access_token}`}});if(!j.ok)throw new Error(`Load failed (${j.status})`);const{profile:N}=await j.json();if(B)return;const W=py(s);if(N)for(const G of s){if(G.key==="relationship_intent_label"){const K=N.relationship_intent;typeof K=="string"&&tS[K]&&(W[G.key]=tS[K]);continue}if(G.key==="home_location"){const K=N.home_city,J=N.home_country;(K||J)&&(W[G.key]=[K,J].filter(Boolean).join(", "));continue}const L=N[G.key];L!=null&&(W[G.key]=L)}c(W),f(W)}catch(U){console.error("[ProfileEditModal] load error",U),re.error("Could not load your profile")}finally{B||h(!1)}})(),()=>{B=!0}},[e]);const M=(B,U)=>c(D=>({...D,[B]:U})),P=()=>{if(!E){t(!1);return}x(!0)},$=async()=>{if(T){v(!0);try{const{data:{session:B}}=await pe.auth.getSession();if(!B)throw new Error("Not signed in");const U="https://errlhmcitfpyyhnwtqrs.supabase.co/functions/v1/upsert-dating-profile",D={};for(const N of s){const W=l[N.key];if(N.key==="relationship_intent_label"){typeof W=="string"&&hw[W]&&(D.relationship_intent=hw[W]);continue}if(N.key==="home_location"){if(typeof W=="string"&&W.includes(",")){const[G,...L]=W.split(",");D.home_city=G.trim(),D.home_country=L.join(",").trim()}continue}D[N.key]=W}const j=await fetch(U,{method:"POST",headers:{Authorization:`Bearer ${B.access_token}`,"Content-Type":"application/json"},body:JSON.stringify(D)});if(!j.ok){const N=await j.text();throw new Error(N||`Save failed (${j.status})`)}re.success("Profile saved"),f(l),await a.invalidateQueries({queryKey:["viewer-dating-profile"]}),await a.refetchQueries({queryKey:["viewer-dating-profile"]}),await a.invalidateQueries({queryKey:["creator-match-profiles"]}),await a.invalidateQueries({queryKey:["creator-age-buckets"]}),t(!1)}catch(B){console.error("[ProfileEditModal] save error",B),re.error("Could not save your profile")}finally{v(!1)}}},H=Ib,z=Ob;return i.jsxs(i.Fragment,{children:[i.jsx(ot,{open:e,onOpenChange:B=>{B?t(!0):P()},children:i.jsxs(et,{overlayClassName:"z-[60] bg-black/80",className:"z-[60] max-w-none w-screen h-[100dvh] top-0 left-0 translate-x-0 translate-y-0 rounded-none border-0 p-0 gap-0 flex flex-col bg-background [&>button]:hidden",onEscapeKeyDown:B=>{B.preventDefault(),P()},onPointerDownOutside:B=>B.preventDefault(),onInteractOutside:B=>B.preventDefault(),children:[i.jsx(vt,{className:"sr-only",children:"Profile Edit"}),i.jsx(Ps,{className:"sr-only",children:"Complete your dating profile"}),i.jsxs("div",{className:"shrink-0 border-b border-border bg-card px-4 sm:px-6 py-3 flex items-center gap-3",children:[i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Profile Edit"}),i.jsxs("div",{className:"flex-1 flex items-center gap-2 min-w-0",children:[i.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums shrink-0",children:[A," / ",o]}),i.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-foreground
404/10 overflow-hidden",children:i.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${A/o*100}%`}})})]}),i.jsx(ee,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:P,"aria-label":"Close",children:i.jsx($c,{className:"w-4 h-4"})})]}),i.jsx("div",{className:"flex-1 overflow-y-auto overscroll-contain px-4 sm:px-6 py-6 pb-24",children:i.jsxs("div",{className:"max-w-2xl mx-auto space-y-8",children:[p&&i.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading..."}),!p&&r.map(B=>i.jsxs("section",{className:"space-y-4",children:[i.jsx("h3",{className:"text-xs uppercase tracking-wide text-muted-foreground border-t border-border pt-4",children:B.title}),i.jsx("div",{className:"space-y-5",children:B.fields.map(U=>{const D=l[U.key],j=hA(D);return i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsxs("label",{className:"text-sm font-medium text-foreground flex items-center gap-2",children:[j?i.jsx(FL,{className:"w-4 h-4 text-red-500 shrink-0",strokeWidth:2}):i.jsx(EE,{className:"w-4 h-4 text-muted-foreground/60 shrink-0",strokeWidth:1.75}),i.jsx("span",{children:U.label})]}),U.kind==="roller"&&U.unit==="cm"&&i.jsx(nS,{options:["cm","ft-in"],value:w,onChange:N=>k(N)}),U.kind==="roller"&&U.unit==="kg"&&i.jsx(nS,{options:["kg","lbs"],value:b,onChange:N=>C(N)})]}),U.kind==="yesno"&&i.jsx(cV,{value:D,onChange:N=>M(U.key,N)}),U.kind==="select"&&i.jsxs(Kr,{value:D??"",onValueChange:N=>M(U.key,N),children:[i.jsx(Nr,{className:"w-full sm:w-72 rounded-lg",children:i.jsx(qr,{placeholder:"Choose..."})}),i.jsx(Tr,{className:"z-[70]",children:U.options.map(N=>i.jsx(bt,{value:N,children:N},N))})]}),U.kind==="roller"&&i.jsxs(i.Fragment,{children:[D==null&&(U.key==="height_cm"||U.key==="weight_kg")&&i.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Click to select"}),i.jsx(jh,{min:U.min,max:U.max,value:D,onChange:N=>M(U.key,N),format:U.unit==="cm"?N=>w==="cm"?`${N} cm`:H(N):U.unit==="kg"?N=>b==="kg"?`${N} kg`:z(N):N=>`${N}`,defaultScroll:U.key==="height_cm"?170:U.key==="weight_kg"?60:void 0})]}),U.kind==="dob"&&i.jsxs(i.Fragment,{children:[D==null&&i.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Click to select"}),i.jsx(uV,{value:D,onChange:N=>M(U.key,N)})]}),U.kind==="places"&&i.jsx(dV,{value:D??"",onChange:N=>M(U.key,N)}),U.kind==="combobox"&&i.jsx(fV,{value:D??"",onChange:N=>M(U.key,N),options:U.options,allowOther:!!U.allowOther})]},U.key)})})]},B.title))]})}),i.jsx("div",{className:"shrink-0 border-t border-border bg-card px-4 sm:px-6 py-3 pb-[max(env(safe-area-inset-bottom),0.75rem)]",children:i.jsxs("div",{className:"max-w-2xl mx-auto flex items-center justify-between gap-3",children:[i.jsx("span",{className:"text-xs text-muted-foreground",children:T?`All ${o} questions answered`:`${o-A} remaining`}),i.jsx(ee,{onClick:$,disabled:!T||m,className:"min-w-[140px]",children:m?"Saving...":"Save Profile"})]})})]})}),i.jsx(Rt,{open:g,onOpenChange:x,children:i.jsxs(St,{children:[i.jsxs(Ct,{children:[i.jsx(jt,{children:"Discard changes?"}),i.jsx(Nt,{children:"Your answers will be lost."})]}),i.jsxs(Et,{children:[i.jsx(cn,{children:"Keep editing"}),i.jsx(ln,{onClick:()=>{x(!1),c(u),t(!1)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Discard"})]})]})})]})}function nS({options:e,value:t,onChange:n}){return i.jsx("div",{className:"inline-flex rounded-full border border-border bg-background p-0.5",children:e.map(r=>i.jsx("button",{type:"button",onClick:()=>n(r),className:X("text-xs px-2.5 h-6 rounded-full transition-colors",t===r?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:r},r))})}function uV({value:e,onChange:t}){const n=new Date,r=n.getFullYear()-13,s=n.getFullYear()-80,o=e&&/^(\d{4})-(\d{2})-(\d{2})$/.exec(e),[a,l]=d.useState(o?+o[1]:null),[c,u]=d.useState(o?+o[2]:null),[f,p]=d.useState(o?+o[3]:null),h=aV(a??2e3,c??1),m=f!=null?Math.min(f,h):null;return d.useEffect(()=>{if(f!=null&&m!==f&&p(m),a!=null&&c!=null&&m!=null){const v=`${a}-${String(c).padStart(2,"0")}-${String(m).padStart(2,"0")}`;v!==e&&t(v)}},[a,c,m]),i.jsxs("div",{className:"flex gap-3",children:[i.jsx(jh,{min:1,max:h,value:m,onChange:p,defaultScroll:15}),i.jsx(jh,{min:1,max:12,value:c,onChange:u,format:v=>iV[v-1],defaultScroll:5}),i.jsx(jh,{min:s,max:r,value:a,onChange:l,defaultScroll:1993})]})}
404function dV({value:e,onChange:t}){const[n,r]=d.useState(e),[s,o]=d.useState([]),[a,l]=d.useState(!1),c=d.useRef(null),u=d.useRef(null);d.useEffect(()=>r(e),[e]);const f=d.useCallback(async h=>{var m,v;if(!h.trim()||!((v=(m=window.google)==null?void 0:m.maps)!=null&&v.places)){o([]),l(!1);return}try{c.current||(c.current=new google.maps.places.AutocompleteSessionToken);const{suggestions:g}=await google.maps.places.AutocompleteSuggestion.fetchAutocompleteSuggestions({input:h,sessionToken:c.current,includedPrimaryTypes:["(cities)"]}),x=g.filter(w=>w.placePrediction).map(w=>({placeId:w.placePrediction.placeId,text:w.placePrediction.text.text}));o(x),l(x.length>0)}catch(g){console.warn("[PlacesCityCountry] suggestion error",g)}},[]),p=d.useCallback(async h=>{var m;l(!1);try{const v=new google.maps.places.Place({id:h.placeId});await v.fetchFields({fields:["addressComponents","displayName"]});const g=v.addressComponents||[],x=g.find(k=>k.types.includes("locality"))||g.find(k=>k.types.includes("postal_town"))||g.find(k=>k.types.includes("administrative_area_level_2"))||g.find(k=>k.types.includes("administrative_area_level_1")),w=g.find(k=>k.types.includes("country")),y=(x==null?void 0:x.longText)||((m=v.displayName)==null?void 0:m.text)||"",b=(w==null?void 0:w.longText)||"",_=[y,b].filter(Boolean).join(", ");r(_),t(_)}catch(v){console.warn("[PlacesCityCountry] fetch fields error",v),r(h.text),t(h.text)}},[t]);return i.jsxs("div",{className:"relative w-full sm:w-72",children:[i.jsx(Ar,{value:n,placeholder:"Start typing a city...",onChange:h=>{const m=h.target.value;r(m),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>f(m),200)},onFocus:()=>s.length>0&&l(!0),onBlur:()=>setTimeout(()=>l(!1),150)}),a&&s.length>0&&i.jsx("div",{className:"absolute z-[80] mt-1 w-full rounded-md border border-border bg-popover shadow-lg max-h-64 overflow-auto",children:s.map(h=>i.jsx("button",{type:"button",className:"w-full text-left px-3 py-2 text-sm hover:bg-accent",onMouseDown:m=>m.preventDefault(),onClick:()=>p(h),children:h.text},h.placeId))})]})}function fV({value:e,onChange:t,options:n,allowOther:r}){const[s,o]=d.useState(!1),a=!!e&&!n.includes(e),[l,c]=d.useState(a);return l?i.jsxs("div",{className:"flex gap-2 w-full sm:w-72",children:[i.jsx(Ar,{value:a?e:"",placeholder:"Type language...",onChange:u=>t(u.target.value)}),i.jsx(ee,{type:"button",variant:"ghost",size:"sm",onClick:()=>{c(!1),t("")},children:"Back"})]}):i.jsxs(gp,{open:s,onOpenChange:o,modal:!0,children:[i.jsx(yp,{asChild:!0,children:i.jsxs(ee,{type:"button",variant:"outline",role:"combobox",className:"w-full sm:w-72 justify-between font-normal",children:[e||"Choose language...",i.jsx(UL,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),i.jsx(jd,{className:"w-[18rem] p-0 z-[80] max-h-[min(20rem,var(--radix-popover-content-available-height))] overflow-hidden",sideOffset:4,collisionPadding:12,children:i.jsxs(rA,{children:[i.jsx(sA,{placeholder:"Search language..."}),i.jsxs(oA,{className:"max-h-[18rem]",children:[i.jsx(iA,{children:"No language found."}),i.jsx(aA,{children:n.map(u=>i.jsxs(lA,{value:u,onSelect:()=>{u==="Other"&&r?(c(!0),t("")):t(u),o(!1)},children:[i.jsx(es,{className:X("mr-2 h-4 w-4",e===u?"opacity-100":"opacity-0")}),u]},u))})]})]})})]})}const pA={reversenetwork:"https://reversenetworkmeets.com",powerwalk:"https://powerwalkmeets.com",hoopersmeets:"https://hoopersmeets.com",foodclubmeets:"https://foodclubmeets.com",connectonlinemeets:"https://connectonlinemeets.com",inpersondates:"https://www.inpersondates.com",staaakemeets:"https://staaakemeets.com"};function Cp(e){const t=typeof window<"u"?window.location.hostname:"";return Xp(t)?`/?site=${e}`:pA[e]??"/"}const hV={reversenetwork:"/reverse.png",powerwalk:"/powerwalk.png",hoopersmeets:"/hoopers.png",foodclubmeets:"/foodclub.png",connectonlinemeets:"/connectonline.png",inpersondates:"/inpersondates.png"};function pV(e){return e?hV[e]??null:null}function mA(e,t,n=""){const r=t.replace(/^\/+/,""),s=typeof window<"u"?window.location.hostname:"",o=n.replace(/^\?/,"");if(Xp(s)){const l=new URLSearchParams(o);return l.set("site",e),`/${r}?${l.toString()}`}return`${pA[e]??"/"}/${r}${o?`?${o}`:""}`}function mV(e){const t=/^#?([0-9a-f]{6})$/i.exec(e.trim());if(!t)return!1;const n=parseInt(t[1],16),r=n>>16&255,s=n>>8&255,o=n&255;return .299*r+.587*s+.114*o<60}const gV="https://errlhmcitfpyyhnwtqrs.supabase.co",yV="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImVycmxobWNpdGZweXlobnd0cXJzIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzIyOTY1NDcsImV4cCI6MjA4Nzg3MjU0N30.Vg5RxV3TAd2PGJ6pwFjMYEds0EtO_yQ07EbX5B_p7WU";function vV(e,t){const n=Dr();return Mj({mutationFn:async r=>{const{data:{session:s}}=await pe.auth.getSession();if(!(s!=null&&s.access_token))throw new Error("Not signed in");const o=await fetch(`${gV}/functions/v1/set-attendee-status`,{method:"POST",headers:{"Content-Type":"application/json",apikey:yV,Authorization:`Bearer ${s.access_token}`},body:JSON.stringify({event_id:e,event_date_id:t||void 0,target_user_id:r,status:"selected"})}),a=await o.json().catch(()=>({}));if(!o.ok)throw new Error((a==null?void 0:a.error)||"Failed to select");return a},onSuccess:()=>{re.success("Selected"),n.invalidateQueries({queryKey:["detailed-event-attendees"]}),n.invalidateQueries({queryKey:["rsvp-status"]}),n.invalidateQueries({queryKey:["event-attendees"]}),n.invalidateQueries({queryKey:["attendee-counts"]}),n.invalidateQueries({queryKey:["attendee-counts-by-date"]})},onError:r=>re.error(r.message)})}const wV="https://errlhmcitfpyyhnwtqrs.supabase.co",rS=typeof window<"u"&&(window.location.hostname.includes("lovableproject.com")||window.location.hostname.includes("lovable.app"));function xV(){if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).get("previewStakeUnlocked")==="1"}catch{return!1}}function gA(e){const{user:t,localUserId:n,activeUsername:r}
404=Fj(),s=xn().siteKey==="inpersondates",o=!!e.enabled&&s&&!!t&&!rS,{data:a,isLoading:l,isFetched:c}=Wt({queryKey:["staaake-stake-check",n,r],queryFn:async()=>{try{const{data:{session:u}}=await pe.auth.getSession();if(!(u!=null&&u.access_token))return{allowed:!1};const f=await fetch(`${wV}/functions/v1/check-staaake-stake`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${u.access_token}`},body:JSON.stringify(r?{viewer_username:r}:{})});if(!f.ok)return{allowed:!1};const p=await f.json().catch(()=>null);return{allowed:(p==null?void 0:p.allowed)===!0}}catch{return{allowed:!1}}},enabled:o,staleTime:5*6e4,retry:0});return rS&&e.enabled&&s?{allowed:xV(),isLoading:!1,isReady:!0}:{allowed:(a==null?void 0:a.allowed)===!0,isLoading:o&&l,isReady:!o||c}}const yA=new Set(["dob","height_cm","weight_kg","tattoos_5plus","piercings_10plus","diet_strictness","ethnicity","zodiac_sign","smoke_freq","drink_freq","drug_freq","cook_freq","clean_freq","body_type","exercise_freq","walk_freq","kids_count","kids_want_count","religion_type","pet_type"]);function Hu(e){try{const n=new URL(e.startsWith("http")?e:`https://${e}`).hostname.toLowerCase().replace(/^www\./,"");return n==="instagram.com"||n.endsWith(".instagram.com")?"Instagram":n==="linkedin.com"||n.endsWith(".linkedin.com")?"LinkedIn":n==="x.com"||n.endsWith(".x.com")||n==="twitter.com"||n.endsWith(".twitter.com")?"X":"Link"}catch{return"Link"}}function Hl({firstName:e,lastName:t,username:n}){var c;const r=e==null?void 0:e.trim(),s=t==null?void 0:t.trim(),o=(c=s==null?void 0:s[0])==null?void 0:c.toUpperCase(),l=[r,o].filter(Boolean).join(" ")||(!r&&!s?n==null?void 0:n.trim():"")||"-";return n?i.jsx("a",{href:Pi(n),target:"_blank",rel:"noopener noreferrer",onClick:u=>{u.stopPropagation(),Aa(u,n)},className:"font-medium text-foreground hover:underline",children:l}):i.jsx("span",{className:"font-medium text-foreground",children:l})}const bV=["Creator","Alex","Sam","Chris","Taylor","Jordan","Robin"],_l={Creator:{bio:"Building things, walking cities, mostly tea over coffee.",link:"https://instagram.com/creator"},Alex:{bio:"Designer in Berlin. Cinema, long dinners, slow weekends.",link:"https://linkedin.com/in/alex"},Sam:{bio:"Runner, reader, occasional cook. Honest conversation.",link:"https://x.com/sam"},Chris:{bio:"Software engineer. Bouldering, pasta, and stupid jokes.",link:"https://instagram.com/chris"},Taylor:{bio:"Photographer. Travels light, talks a lot, listens more.",link:"https://taylor.studio"},Jordan:{bio:"Music, museums, late-night walks. New to the city.",link:"https://linkedin.com/in/jordan"},Robin:{bio:"Writer. Slow mornings, long runs, very strong opinions.",link:"https://instagram.com/robin"}},sS=["m4w","w4m","m4m","w4w"],oS=["English","Spanish","French","German","Italian","Portuguese"],iS=["New York, USA","London, UK","Paris, France","Berlin, Germany","Tokyo, Japan","Sydney, Australia"],my=(e,t)=>{if(e.kind==="yesno")return t%2===0?"Yes":"No";if(e.kind==="select")return e.key==="relationship_intent_label"?sS[t%sS.length]:e.options[t%e.options.length];if(e.kind==="roller"){const n=Math.round((e.min+e.max)/2)+t%5;return e.key==="height_cm"?`${n} cm (${Ib(n)})`:e.key==="weight_kg"?`${n} kg (${Ob(n)})`:e.unit?`${n} ${e.unit}`:String(n)}return e.kind==="dob"?`${24+t*3%30}`:e.kind==="places"?iS[t%iS.length]:e.kind==="combobox"?oS[t%oS.length]:"-"};function mw(e){return e.kind==="dob"?"Age":e.key==="relationship_intent_label"?"Looking for":e.key==="home_location"?"Current home":e.key==="mother_language"?"Mother tongue":e.key==="height_cm"?"Height":e.key==="weight_kg"?"Weight":e.label}function Ku(e,t){if(t==null||t==="")return"-";if(e.kind==="yesno"){if(t===!0||t===1)return"Yes";if(t===!1||t===0)return"No";if(typeof t=="string"){const n=t.trim().toLowerCase();if(n==="true"||n==="yes"||n==="1")return"Yes";if(n==="false"||n==="no"||n==="0")return"No"}return"-"}if(typeof t=="boolean")return t?"Yes":"No";if(e.kind==="dob"){if(typeof t=="number"&&Number.isFinite(t))return String(t);const n=typeof t=="string"?oV(t):null;return n!=null?String(n):String(t)}if(e.key==="relationship_intent_label")return typeof t=="string"&&eS[t]?eS[t]:String(t);if(e.kind==="roller"){const n=typeof t=="number"?t:Number(t);if(Number.isFinite(n))return e.key==="height_cm"?`${n} cm (${Ib(n)})`:e.key==="weight_kg"?`${n} kg (${Ob(n)})`:e.unit?`${n} ${e.unit}`:String(n)}return String(t)}function ic(e,t){if(!t)return null;if(e.kind==="dob")return t.dob?t.dob:typeof t.age=="number"?t.age:null;if(e.key==="relationship_intent_label"){const n=t.relationship_intent;return typeof n=="string"&&pw[n]?pw[n]:null}if(e.key==="home_location"){const n=t.home_city,r=t.home_country;
404return[n,r].filter(Boolean).join(", ")||null}return t[e.key]??null}const ze="px-3 py-2 text-sm min-w-[110px] sm:min-w-[120px] shadow-[inset_0_0_0_1px_hsl(var(--border))] transition hover:shadow-[inset_0_0_0_1px_hsl(var(--destructive))] active:shadow-[inset_0_0_0_1px_hsl(var(--destructive))]";function _V({open:e,onOpenChange:t,isLocked:n,creatorAnswers:r,creatorBio:s,creatorLink:o,creatorLinkLabel:a,creatorFirstName:l,creatorLastName:c,creatorUsername:u,viewerAnswers:f,viewerBio:p,viewerLink:h,viewerLinkLabel:m,viewerFirstName:v,viewerLastName:g,viewerUsername:x,interestedSlot:w}){const _=(xn().siteKey==="inpersondates"?Lb:fA).filter(P=>P.key!=="relationship_intent_label"),[k,C]=d.useState(!1),E=gA({enabled:e}),A=E.isReady&&!E.allowed,T=P=>Ku(P,ic(P,r)),M=P=>Ku(P,ic(P,f));return i.jsx(ot,{open:e,onOpenChange:t,children:i.jsxs(et,{className:"max-w-3xl w-[95vw] max-h-[90vh] p-0 overflow-hidden flex flex-col gap-0",onOpenAutoFocus:P=>P.preventDefault(),children:[i.jsxs("div",{className:"px-5 py-4 pr-12 border-b border-border flex-shrink-0 flex items-baseline justify-between gap-4",children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Compatibility"}),i.jsx("span",{className:"hidden sm:inline text-xs text-muted-foreground",children:"Selections close 6 hours before the date starts."})]}),i.jsx("div",{className:"overflow-auto flex-1 overscroll-contain [touch-action:pan-x_pan-y] [-webkit-overflow-scrolling:touch]",children:i.jsxs("table",{className:"border-separate border-spacing-0 w-full min-w-max",children:[i.jsxs("thead",{children:[i.jsxs("tr",{children:[i.jsx("th",{className:`${ze} sm:sticky sm:top-0 sm:left-0 sm:z-30 bg-background text-left font-medium text-muted-foreground min-w-[120px] sm:min-w-[160px]`,children:"Question"}),i.jsx("th",{className:`${ze} sticky top-0 z-20 bg-background text-center font-medium text-foreground`,children:i.jsx(Hl,{firstName:l,lastName:c,username:u})}),i.jsx("th",{className:`${ze} sticky top-0 z-20 bg-background text-center font-medium text-foreground`,children:i.jsx(Hl,{firstName:v,lastName:g,username:x})})]}),i.jsxs("tr",{children:[i.jsx("th",{className:"p-2 align-middle bg-background sm:sticky sm:left-0 sm:z-10 min-w-[120px] sm:min-w-[160px] shadow-[inset_0_0_0_1px_hsl(var(--border))]",children:A?i.jsx(ee,{size:"lg",variant:"outline",className:"w-full rounded-xl text-base font-semibold h-12",onClick:()=>C(!0),children:"Unlock all answers"}):i.jsx(ee,{size:"lg",variant:"outline",disabled:!0,className:"w-full rounded-xl text-base font-semibold h-12",children:"Unlocked answers"})}),i.jsx("th",{className:"p-2 align-middle bg-background shadow-[inset_0_0_0_1px_hsl(var(--border))]",children:i.jsx("div",{className:"w-full",children:w})}),i.jsx("th",{className:"p-2 align-middle bg-background shadow-[inset_0_0_0_1px_hsl(var(--border))]",children:A?i.jsx(ee,{size:"lg",variant:"outline",className:"w-full rounded-xl text-base font-semibold h-12",onClick:()=>C(!0),children:"Unlock all answers"}):i.jsx(ee,{size:"lg",variant:"outline",disabled:!0,className:"w-full rounded-xl text-base font-semibold h-12",children:"Unlocked answers"})})]})]}),i.jsxs("tbody",{children:[i.jsxs("tr",{children:[i.jsx("td",{className:`${ze} sm:sticky sm:left-0 sm:z-10 bg-background text-left font-medium text-muted-foreground min-w-[120px] sm:min-w-[160px]`,children:"Bio"}),i.jsx("td",{className:`${ze} bg-background text-foreground align-top`,children:i.jsx("div",{className:"line-clamp-2 min-h-[2.5rem] text-center whitespace-normal break-words",children:s||"-"})}),i.jsx("td",{className:`${ze} bg-background text-foreground align-top`,children:i.jsx("div",{className:"line-clamp-2 min-h-[2.5rem] text-center whitespace-normal break-words",children:p||"-"})})]}),i.jsxs("tr",{children:[i.jsx("td",{className:`${ze} sm:sticky sm:left-0 sm:z-10 bg-background text-left font-medium text-muted-foreground min-w-[120px] sm:min-w-[160px]`,children:"Link"}),i.jsx("td",{className:`${ze} bg-background text-center text-foreground`,children:o?i.jsx("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"text-foreground font-medium hover:underline",children:a||Hu(o
404)}):"-"}),i.jsx("td",{className:`${ze} bg-background text-center text-foreground`,children:h?i.jsx("a",{href:h,target:"_blank",rel:"noopener noreferrer",className:"text-foreground font-medium hover:underline",children:m||Hu(h)}):"-"})]}),_.map(P=>{const $=T(P),H=M(P),z=$!=="-"&&H!=="-"&&$===H,B=A&&yA.has(P.key);return i.jsxs("tr",{children:[i.jsx("td",{className:`${ze} sm:sticky sm:left-0 sm:z-10 bg-background text-left font-medium text-muted-foreground min-w-[120px] sm:min-w-[160px]`,children:mw(P)}),i.jsx("td",{className:`${ze} bg-background text-center text-foreground`,children:B?i.jsx("button",{type:"button","aria-label":"Hidden — unlock to view",onClick:()=>C(!0),className:"block w-full h-6 rounded-sm select-none cursor-pointer hover:opacity-90 transition",style:{backgroundColor:"hsl(var(--foreground) / 0.08)",backgroundImage:"repeating-linear-gradient(135deg, hsl(var(--foreground) / 0.55) 0 2px, transparent 2px 6px)"}}):$}),i.jsx("td",{className:`${ze} bg-background text-center text-foreground ${!B&&z?"ring-1 ring-inset ring-primary":""}`,children:H})]},P.key)})]})]})}),i.jsx(Rt,{open:k,onOpenChange:C,children:i.jsxs(St,{children:[i.jsxs(Ct,{children:[i.jsx(jt,{children:"Stake Required"}),i.jsx(Nt,{children:'You need an "I" stake or higher in staaake to view these answers.'})]}),i.jsxs(Et,{children:[i.jsx(cn,{children:"Cancel"}),i.jsx(ln,{asChild:!0,children:i.jsx("a",{href:"https://www.staaake.in/staaake",target:"_blank",rel:"noopener noreferrer",children:"View staaake Sheet"})})]})]})})]})})}function kV({open:e,onOpenChange:t,eventId:n,eventDateId:r,isCreator:s=!1,isAdmin:o=!1,attendees:a,isLocked:l=!1,selectionCap:c=5,creatorAnswers:u=null,creatorBio:f=null,creatorLink:p=null,creatorLinkLabel:h=null,creatorUserId:m=null,creatorFirstName:v=null,creatorLastName:g=null,creatorUsername:x=null,viewerAnswers:w=null,viewerBio:y=null,viewerLink:b=null,viewerLinkLabel:_=null,viewerFirstName:k=null,viewerLastName:C=null,viewerUsername:E=null,viewerStatus:A=null,interestedSlot:T,useFakeFallback:M=!1}){return xn().siteKey==="inpersondates"&&!s&&!o&&!!T?i.jsx(_V,{open:e,onOpenChange:t,isLocked:l,creatorAnswers:u,creatorBio:f,creatorLink:p,creatorLinkLabel:h,creatorFirstName:v,creatorLastName:g,creatorUsername:x,viewerAnswers:w,viewerBio:y,viewerLink:b,viewerLinkLabel:_,viewerFirstName:k,viewerLastName:C,viewerUsername:E,interestedSlot:T}):i.jsx(SV,{open:e,onOpenChange:t,eventId:n,eventDateId:r,isCreator:s,isAdmin:o,attendees:a,isLocked:l,selectionCap:c,creatorAnswers:u,creatorBio:f,creatorLink:p,creatorLinkLabel:h,creatorUserId:m,creatorFirstName:v,creatorLastName:g,creatorUsername:x,viewerAnswers:w,viewerBio:y,viewerLink:b,viewerLinkLabel:_,viewerFirstName:k,viewerLastName:C,viewerUsername:E,viewerStatus:A,interestedSlot:T,useFakeFallback:M})}function SV({open:e,onOpenChange:t,eventId:n,eventDateId:r,isCreator:s=!1,isAdmin:o=!1,attendees:a,isLocked:l=!1,selectionCap:c=5,creatorAnswers:u=null,creatorBio:f=null,creatorLink:p=null,creatorLinkLabel:h=null,creatorUserId:m=null,creatorFirstName:v=null,creatorLastName:g=null,creatorUsername:x=null,viewerAnswers:w=null,viewerBio:y=null,viewerLink:b=null,viewerLinkLabel:_=null,viewerFirstName:k=null,viewerLastName:C=null,viewerUsername:E=null,viewerStatus:A=null,interestedSlot:T,useFakeFallback:M=!1}){const P=xn().siteKey,$=P==="inpersondates"?Lb:fA,H=vV(n,r),[z,B]=d.useState(null),[U,D]=d.useState(null),[j,N]=d.useState(null),[W,G]=d.useState(null),[L,K]=d.useState(!1),J=P==="inpersondates"&&!s&&!o,Z=gA({enabled:e&&J&&!s&&!o}),ce=P==="inpersondates"&&J&&!s&&!o&&Z.isReady&&!Z.allowed;if(J){const Q=$.filter(Fe=>Fe.key!=="relationship_intent_label"),V=M&&P==="inpersondates",je=!!T,Me=Fe=>my(Fe,0),xt=Fe=>my(Fe,1),lr=Fe=>{const _n=Ku(Fe,ic(Fe,u));return _n!=="-"?_n:V?Me(Fe):_n},br=Fe=>{const _n=Ku(Fe,ic(Fe,w));return _n!=="-"?_n:V?xt(Fe):_n},Zn=f??(V?_l.Creator.bio:null),Xt=p??(V?_l.Creator.link:null),rs=y??(V?_l.Alex.bio:null),Kt=b??(V?_l.Alex.link:null),bn=je?null:A??(V?W??"pending":null);let qt="";je||(l&&bn!=="selected"?qt="Closed":bn==="selected"?qt="Selected ✓":bn==="pending"&&(qt="Pending"));const Fr=!je&&!l&&bn!=="selected"&&(V||!!m),sn=()=>
404{if(bn==="selected")return i.jsxs("span",{className:"inline-flex items-center justify-center gap-1 rounded-md bg-secondary text-primary border border-primary font-medium px-3 py-1",children:["Selected ",i.jsx(es,{className:"h-4 w-4"})]});if(l)return i.jsx("span",{className:"text-muted-foreground",children:"Closed"});if(!V)return i.jsx("span",{className:"text-muted-foreground",children:"-"});const Fe=!Fr||H.isPending;return i.jsx("button",{type:"button",disabled:Fe,onClick:()=>{V&&!m?D("__viewer_creator__"):m&&B(m)},className:["px-3 py-1.5 rounded-md border-2 border-primary text-primary text-sm font-medium",Fe?"opacity-50 cursor-not-allowed":"hover:bg-accent/10 cursor-pointer"].join(" "),children:"Select"})};return i.jsx(ot,{open:e,onOpenChange:t,children:i.jsxs(et,{className:"max-w-3xl w-[95vw] max-h-[90vh] p-0 overflow-hidden flex flex-col gap-0",onOpenAutoFocus:Fe=>Fe.preventDefault(),children:[i.jsxs("div",{className:"px-5 py-4 pr-12 border-b border-border flex-shrink-0 flex items-baseline justify-between gap-4",children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Compatibility"}),i.jsx("span",{className:"hidden sm:inline text-xs text-muted-foreground",children:"Selections close 6 hours before the date starts."})]}),i.jsx("div",{className:"overflow-auto flex-1 overscroll-contain [touch-action:pan-x_pan-y] [-webkit-overflow-scrolling:touch]",children:i.jsxs("table",{className:"border-separate border-spacing-0 w-full min-w-max",children:[i.jsxs("thead",{children:[i.jsxs("tr",{children:[i.jsx("th",{className:`${ze} sm:sticky sm:top-0 sm:left-0 sm:z-30 bg-background text-left font-medium text-muted-foreground min-w-[120px] sm:min-w-[160px]`,children:"Question"}),i.jsx("th",{className:`${ze} sticky top-0 z-20 bg-background text-center font-medium text-foreground`,children:i.jsx(Hl,{firstName:v,lastName:g,username:x})}),i.jsx("th",{className:`${ze} sticky top-0 z-20 bg-background text-center font-medium text-foreground`,children:i.jsx(Hl,{firstName:k,lastName:C,username:E})})]}),i.jsxs("tr",{children:[i.jsx("th",{className:"p-2 align-middle bg-background sm:sticky sm:left-0 sm:z-10 min-w-[120px] sm:min-w-[160px] shadow-[inset_0_0_0_1px_hsl(var(--border))]",children:ce?i.jsx(ee,{size:"lg",variant:"outline",className:"w-full rounded-xl text-base font-semibold h-12",onClick:()=>K(!0),children:"Unlock all answers"}):i.jsx(ee,{size:"lg",variant:"outline",disabled:!0,className:"w-full rounded-xl text-base font-semibold h-12",children:"Unlocked answers"})}),i.jsx("th",{className:"p-2 align-middle bg-background shadow-[inset_0_0_0_1px_hsl(var(--border))]",children:T?i.jsx("div",{className:"w-full",children:T}):i.jsx("div",{className:"text-center",children:sn()})}),i.jsx("th",{className:"p-2 align-middle bg-background shadow-[inset_0_0_0_1px_hsl(var(--border))]",children:ce?i.jsx(ee,{size:"lg",variant:"outline",className:"w-full rounded-xl text-base font-semibold h-12",onClick:()=>K(!0),children:"Unlock all answers"}):i.jsx(ee,{size:"lg",variant:"outline",disabled:!0,className:"w-full rounded-xl text-base font-semibold h-12",children:"Unlocked answers"})})]}),!T&&qt&&i.jsxs("tr",{children:[i.jsx("th",{className:`${ze} sm:sticky sm:left-0 sm:z-10 bg-background text-left font-medium text-muted-foreground min-w-[120px] sm:min-w-[160px]`,children:"Status"}),i.jsx("th",{className:`${ze} bg-background text-center text-sm font-medium text-muted-foreground`,children:"-"}),i.jsx("th",{className:`${ze} bg-background text-center text-sm font-medium text-foreground`,children:qt})]})]}),i.jsxs("tbody",{children:[i.jsxs("tr",{children:[i.jsx("td",{className:`${ze} sm:sticky sm:left-0 sm:z-10 bg-background text-left font-medium text-muted-foreground min-w-[120px] sm:min-w-[160px]`,children:"Bio"}),i.jsx("td",{className:`${ze} bg-background text-foreground align-top`,children:i.jsx("div",{className:"line-clamp-2 min-h-[2.5rem] text-center whitespace-normal break-words",children:Zn||"-"})}),i.jsx("td",{className:`${ze} bg-background text-foreground align-top`,children:i.jsx("div",{className:"line-clamp-2 min-h-[2.5rem] text-center whitespace-normal break-words",children:rs||"-"})})]}),i.jsxs("tr",{children:[i.jsx("td",{className:`${ze} sm:sticky sm:left-0 sm:z-10 bg-background text-left font-medium text-muted-foreground min-w-[120px] sm:min-w-[160px]`,children:"Link"}),i.jsx("td",{className:`${ze} bg-background text-center text-foreground`,children:Xt?i.jsx("a",{href:Xt,target:"_blank",rel:"noopener noreferrer",className:"text-foreground font-medium hover:underline",children:h||Hu(Xt)}):"-"}),i.jsx("td",{className:`${ze} bg-background text-center text-foreground`,children:Kt?i.jsx("a",{href:Kt,target:"_blank",rel:"noopener noreferrer",className:"text-foreground font-medium hover:underline",children:_||Hu(Kt)}):"-"})]}),Q.map(Fe=>{const _n=lr(Fe),dt=br(Fe),_r=_n!=="-"&&dt!=="-"&&_n===dt,be=ce&&yA.has(Fe.key);return i.jsxs("tr",{children:[i.jsx("td",{className:`${ze} sm:sticky sm:left-0 sm:z-10 bg-background text-left font-medium text-muted-foreground min-w-[120px] sm:min-w-[160px]`,children:mw(Fe)}),i.jsx("td",{className:`${ze} bg-background text-center text-foreground`,children:be?i.jsx("button",{type:"button","aria-label":"Hidden — unlock to view",onClick:()=>K(!0),className:"block w-full h-6 rounded-sm select-none cursor-pointer hover:opacity-90 transition",style:{backgroundColor:"hsl(var(--foreground) / 0.08)",backgroundImage:"repeating-linear-gradient(135deg, hsl(var(--foreground) / 0.55) 0 2px, transparent 2px 6px)"}}):_n}),i.jsx("td",{className:`${ze} bg-background text-center text-foreground ${!be&&_r?"ring-1 ring-inset ring-primary":""}`,children:dt})]},Fe.key)})]})]})}),!je&&i.jsx(Rt,{open:!!z||!!U,onOpenChange:Fe=>{Fe||(B(null),D(null))},children:i.jsxs(St,{children:[i.jsxs(Ct,{children:[i.jsx(jt,{children:"Confirm selection"}),i.jsx(Nt,{children:"Once you select this person, you can't unselect them anymore unless they cancel themselves."})]}),i.jsxs(Et,{children:[i.jsx(cn,{children:"Cancel"}),i.jsx(ln,{onClick:async()=>
404{if(z){const Fe=z;B(null);try{await H.mutateAsync(Fe),G("selected")}catch{}}else U==="__viewer_creator__"&&(D(null),G("selected"))},children:"Confirm selection"})]})]})}),i.jsx(Rt,{open:L,onOpenChange:K,children:i.jsxs(St,{children:[i.jsxs(Ct,{children:[i.jsx(jt,{children:"Stake Required"}),i.jsx(Nt,{children:'You need an "I" stake or higher in staaake to view these answers.'})]}),i.jsxs(Et,{children:[i.jsx(cn,{children:"Cancel"}),i.jsx(ln,{asChild:!0,children:i.jsx("a",{href:"https://www.staaake.in/staaake",target:"_blank",rel:"noopener noreferrer",children:"View staaake Sheet"})})]})]})})]})})}const q=P==="inpersondates"&&(s||o)&&Array.isArray(a),me=a??[],oe=[{name:"Creator",idx:0,attendee:null},...me.map((Q,V)=>{const je=[Q.first_name,Q.last_name].filter(Boolean).join(" "),Me=bV[V+1]??`Attendee ${V+1}`;return{name:je||Q.username||(M?Me:`Attendee ${V+1}`),idx:V+1,attendee:Q}})],ae=c,fe=Q=>{var V;return(V=Q.attendee)!=null&&V.user_id?`uid:${Q.attendee.user_id}`:`name:${Q.name}`},[ge,$e]=d.useState(()=>new Set);d.useEffect(()=>{const Q=new Set;for(const V of me)(V==null?void 0:V.status)==="selected"&&V.user_id&&Q.add(`uid:${V.user_id}`);$e(Q)},[a]);const tt=ge.size,Lt=tt>=ae,ut=Q=>{$e(V=>{const je=new Set(V);return je.has(Q)?je.delete(Q):je.size<ae&&je.add(Q),je})};if(!q)return null;const Nn=Q=>ge.has(fe(Q))?"bg-accent/30":"bg-background",Ae=Q=>{var V,je;return(V=Q.attendee)!=null&&V.bio?Q.attendee.bio:Q.name==="Creator"&&f?f:M?((je=_l[Q.name])==null?void 0:je.bio)??null:null},Xn=Q=>{var V,je;return(V=Q.attendee)!=null&&V.link?Q.attendee.link:Q.name==="Creator"&&p?p:M?((je=_l[Q.name])==null?void 0:je.link)??null:null},rn=Q=>{var V;return(V=Q.attendee)!=null&&V.link?Q.attendee.link_label??null:Q.name==="Creator"&&p?h??null:null},ar=$.filter(Q=>Q.key!=="relationship_intent_label"),In=(Q,V)=>{var xt;const je=Q.name==="Creator"?u??null:((xt=Q.attendee)==null?void 0:xt.dating_profile)??null,Me=Ku(V,ic(V,je));return Me!=="-"?Me:M?my(V,Q.idx):"-"},On=Q=>ar.reduce((V,je)=>V+(In(Q,je)===In(oe[0],je)?1:0),0),xr=[oe[0],...oe.slice(1).sort((Q,V)=>On(V)-On(Q))],Ur=async()=>{var je;const Q=U;if(!Q)return;D(null);const V=oe.find(Me=>fe(Me)===Q);if((je=V==null?void 0:V.attendee)!=null&&je.user_id)try{await H.mutateAsync(V.attendee.user_id),ut(Q)}catch{return}else ut(Q)};return i.jsx(ot,{open:e,onOpenChange:t,children:i.jsxs(et,{className:"max-w-6xl w-[95vw] max-h-[90vh] p-0 overflow-hidden flex flex-col gap-0",onOpenAutoFocus:Q=>Q.preventDefault(),children:[i.jsx("div",{className:"px-5 py-4 pr-12 border-b border-border flex-shrink-0",children:i.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Compatibility"}),i.jsx("span",{className:"hidden sm:inline text-xs text-muted-foreground",children:"Selections close 6 hours before the date starts."})]})}),i.jsx("div",{className:"overflow-auto flex-1 overscroll-contain [touch-action:pan-x_pan-y] [-webkit-overflow-scrolling:touch]",children:i.jsxs("table",{className:"border-separate border-spacing-0 w-full min-w-max",children:[i.jsxs("thead",{children:[i.jsxs("tr",{children:[i.jsx("th",{className:`${ze} sm:sticky sm:top-0 sm:left-0 sm:z-30 bg-background text-left font-medium text-muted-foreground min-w-[120px] sm:min-w-[160px]`,children:"Question"}),xr.map(Q=>i.jsx("th",{className:`${ze} sticky top-0 z-20 ${Nn(Q)} text-center font-medium text-foreground`,children:Q.idx===0?i.jsx(Hl,{firstName:v,lastName:g,username:x}):Q.attendee?i.jsx(Hl,{firstName:Q.attendee.first_name,lastName:Q.attendee.last_name,username:Q.attendee.username}):i.jsx("span",{className:"font-medium text-foreground",children:Q.name})},Q.name))]}),i.jsxs("tr",{children:[i.jsxs("th",{className:`${ze} sm:sticky sm:left-0 sm:z-10 bg-background text-left font-medium text-muted-foreground min-w-[120px] sm:min-w-[160px]`,children:["Select up to ",ae," people (",tt,"/",ae,")"]}),xr.map(Q=>{const V=Q.name==="Creator",je=fe(Q),Me=ge.has(je),xt=!Me&&Lt,lr=l&&!Me,br=V||xt||lr?void 0:()=>{var Xt;const Zn=((Xt=Q.attendee)==null?void 0:Xt.status)==="selected";Me&&Zn?N(je):Me?ut(je):D(je)};return i.jsx("th",{onClick:br,role:V?void 0:"button","aria-pressed":V?void 0:Me,className:V?`${ze} ${Nn(Q)} text-center text-sm font-medium text-muted-foreground`:["px-3 py-2 text-sm min-w-[120px] text-center align-middle","border-2 border-primary text-primary rounded-md transition select-none",Me?"bg-secondary text-primary curs
404or-pointer":xt||lr?"bg-background opacity-50 cursor-not-allowed pointer-events-none":"bg-background hover:bg-accent/10 cursor-pointer"].join(" "),children:V?"Selector":Me?i.jsxs("span",{className:"inline-flex items-center justify-center gap-1",children:["Selected ",i.jsx(es,{className:"h-4 w-4"})]}):lr?"Closed":"Select"},`sel-${Q.name}`)})]})]}),i.jsxs("tbody",{children:[i.jsxs("tr",{children:[i.jsx("td",{className:`${ze} sm:sticky sm:left-0 sm:z-10 bg-background text-left font-medium text-muted-foreground min-w-[120px] sm:min-w-[160px]`,children:"Bio"}),xr.map(Q=>{const V=Ae(Q);return i.jsx("td",{className:`${ze} ${Nn(Q)} text-center text-foreground align-top`,children:i.jsx("div",{className:"line-clamp-2 min-h-[2.5rem] text-center whitespace-normal break-words",children:V||"-"})},`bio-${Q.name}`)})]}),i.jsxs("tr",{children:[i.jsx("td",{className:`${ze} sm:sticky sm:left-0 sm:z-10 bg-background text-left font-medium text-muted-foreground min-w-[120px] sm:min-w-[160px]`,children:"Link"}),xr.map(Q=>{const V=Xn(Q),je=rn(Q);return i.jsx("td",{className:`${ze} ${Nn(Q)} text-center text-foreground`,children:V?i.jsx("a",{href:V,target:"_blank",rel:"noopener noreferrer",className:"text-foreground font-medium hover:underline",children:je||Hu(V)}):"-"},`link-${Q.name}`)})]}),ar.map(Q=>i.jsxs("tr",{children:[i.jsx("td",{className:`${ze} sm:sticky sm:left-0 sm:z-10 bg-background text-left font-medium text-muted-foreground min-w-[120px] sm:min-w-[160px]`,children:mw(Q)}),xr.map(V=>{const je=In(V,Q),Me=In(xr[0],Q),xt=V.name!=="Creator"&&je!=="-"&&je===Me;return i.jsx("td",{className:`${ze} ${Nn(V)} text-center text-foreground ${xt?"ring-1 ring-inset ring-primary":""}`,children:je},V.name+Q.key)})]},Q.key))]})]})}),i.jsx(Rt,{open:!!U,onOpenChange:Q=>{Q||D(null)},children:i.jsxs(St,{children:[i.jsxs(Ct,{children:[i.jsx(jt,{children:"Confirm selection"}),i.jsx(Nt,{children:"Once you select this person, you can't unselect them anymore unless they cancel themselves."})]}),i.jsxs(Et,{children:[i.jsx(cn,{children:"Cancel"}),i.jsx(ln,{onClick:Ur,children:"Confirm selection"})]})]})}),i.jsx(Rt,{open:!!j,onOpenChange:Q=>{Q||N(null)},children:i.jsxs(St,{children:[i.jsxs(Ct,{children:[i.jsx(jt,{children:"Selection locked"}),i.jsx(Nt,{children:"You can't unselect this person anymore unless they cancel themselves."})]}),i.jsx(Et,{children:i.jsx(ln,{onClick:()=>N(null),children:"Understood"})})]})})]})})}const CV="https://errlhmcitfpyyhnwtqrs.supabase.co";function Tm(){const{user:e,localUserId:t}=ao(),{selectedUsername:n}=Fo(),r=xn().siteKey==="inpersondates",s=r&&!!e&&!!t,{data:o,isFetched:a}=Wt({queryKey:["viewer-dating-profile",t,n],queryFn:async()=>{const{data:{session:f}}=await pe.auth.getSession();if(!(f!=null&&f.access_token))return{profile:null,identity:null};const p=n?`?username=${encodeURIComponent(n)}`:"",h=await fetch(`${CV}/functions/v1/get-dating-profile${p}`,{headers:{Authorization:`Bearer ${f.access_token}`}});if(!h.ok)return{profile:null,identity:null};const m=await h.json();return{profile:(m==null?void 0:m.profile)??null,identity:(m==null?void 0:m.identity)??null}},enabled:s,staleTime:6e4}),l=(o==null?void 0:o.profile)??null,c=(o==null?void 0:o.identity)??null;if(!r)return{profile:null,identity:null,isReady:!0,isComplete:!1};if(!e)return{profile:null,identity:null,isReady:!0,isComplete:!1};if(!t)return{profile:null,identity:null,isReady:!1,isComplete:!1};const u=(()=>{if(!l)return!1;for(const f of Lb){const p=ic(f,l);if(p==null||p==="")return!1}return!0})();return{profile:l,identity:c,isReady:a,isComplete:u}}const EV=["site"];function jV(){if(typeof window>"u")return"";const e=new URLSearchParams(window.location.search),t=new URLSearchParams;for(const r of EV){const s=e.get(r);s&&t.set(r,s)}const n=t.toString();return n?`?${n}`:""}function qu(){return{pathname:"/",search:jV()}}async function vA(e,t){const n=`${window.location.origin}${window.location.pathname}`,r=`${e} on ${t}`;if(typeof navigator<"u"&&typeof navigator.share=="function")try{await navigator.share({title:r,url:n});return}catch(s){if((s==null?void 0:s.name)==="AbortError")return}try{await navigator.clipboard.writeText(n),re("Link copied",{position:"bottom-left"})}catch{}}const Kl=({shareUsername:e}={})=>{const t=Wi(),[n,r]=d.useState(!1),[s,o]=d.useState(!1),[a,l]=d.useState(null),[c,u]=d.useState(!1),[f,p]=d.useState(!1),[h,m]=d.useState(!1),[v,g]=d.useState(!1),[x,w]=d.use
404State(!1),{user:y,authOpen:b,setAuthOpen:_,showOnboarding:k,guardAction:C,onAuthSuccess:E,onOnboardingSuccess:A,firstName:T,lastName:M,email:P,activeUsername:$,profileComplete:H,updateProfile:z,localUserId:B,loading:U,isAdmin:D}=ao(),j=window.location.hostname.includes("lovableproject.com")||window.location.hostname.includes("lovable.app"),N=$||(j?"username":""),W=xn(),G=W.siteKey,{isComplete:L,isReady:K}=Tm(),[J,Z]=d.useState(!1);d.useEffect(()=>{if(J){if(G!=="inpersondates"){r(!0),Z(!1);return}if(K){if(L){r(!0),Z(!1);return}x||w(!0)}}},[J,G,K,L,x]),d.useEffect(()=>{c&&(o(!0),u(!1))},[c]);const ce=()=>{if(j){r(!0);return}C(()=>{if(G==="inpersondates"){Z(!0);return}r(!0)})},q=()=>{if(j){o(!0);return}C(()=>u(!0))},me=()=>{if(j){w(!0);return}C(()=>w(!0))},oe=()=>{j||C(()=>{},{preserveQueued:!0})};return i.jsxs("div",{className:"border-b border-border bg-card shadow-sm shrink-0",children:[i.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-border",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-0 sm:gap-2",children:[i.jsx("button",{onClick:()=>t(qu()),className:"text-foreground font-bold text-lg hover:text-primary transition-colors outline-none text-left",children:W.title}),y&&$||j&&!y?j&&!y?i.jsx("a",{href:Pi(N),onClick:ae=>Aa(ae,N),target:"_blank",rel:"noopener noreferrer",className:"text-white/80 text-sm font-bold hover:text-white transition-colors",children:N}):i.jsx(YR,{}):null]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("span",{className:"hidden md:block text-sm text-muted-foreground max-w-xs truncate",children:W.description}),i.jsx(ee,{variant:"ghost",size:"icon",className:"md:hidden h-8 w-8",onClick:()=>g(!0),children:i.jsx(jE,{className:"w-4 h-4"})}),e?i.jsx(ee,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Share this calendar",onClick:()=>vA(e,W.title),children:i.jsx(jx,{className:"w-4 h-4"})}):null,y&&$?i.jsx(VR,{firstName:T,lastName:M,email:P||y.email||"",activeUsername:$,profileComplete:H,onUpdateProfile:z}):i.jsxs(i.Fragment,{children:[i.jsx(ee,{variant:"ghost",size:"icon",className:"md:hidden",onClick:oe,children:i.jsx(NE,{className:"w-5 h-5"})}),i.jsx(ee,{variant:"outline",size:"sm",className:"hidden md:inline-flex",onClick:oe,children:"Login / Sign Up"})]})]})]}),i.jsx("div",{className:"px-6 py-3 overflow-x-auto scrollbar-hide",children:i.jsxs("div",{className:"flex items-center gap-1 flex-nowrap",children:[i.jsxs(ee,{variant:"ghost",size:"sm",className:"h-8 px-3 text-sm font-medium border-2 border-primary/50 hover:bg-foreground
404/40 transition-colors whitespace-nowrap flex-shrink-0",onClick:ce,children:[i.jsx(RE,{className:"w-4 h-4 mr-0.5"}),{powerwalk:"Host",reversenetwork:"Host",connectonlinemeets:"Host",foodclubmeets:"Host",hoopersmeets:"Host",inpersondates:"Create a Date"}[G]??"Create Event"]}),G!=="inpersondates"&&i.jsx(ee,{variant:"ghost",size:"sm",className:"h-8 px-3 text-sm font-medium hover:bg-foreground/40 transition-colors whitespace-nowrap flex-shrink-0",onClick:q,children:"Import from URL"}),i.jsx(ee,{variant:"ghost",size:"sm",className:"h-8 px-3 text-sm font-medium hover:bg-foreground/40 transition-colors whitespace-nowrap flex-shrink-0",onClick:()=>m(!0),children:"Why"}),i.jsx(ee,{variant:"ghost",size:"sm",className:"h-8 px-3 text-sm font-medium hover:bg-foreground/40 transition-colors whitespace-nowrap flex-shrink-0",onClick:()=>p(!0),children:"How it works"}),i.jsx(ee,{variant:"ghost",size:"sm",className:"h-8 px-3 text-sm font-medium hover:bg-foreground/40 transition-colors whitespace-nowrap flex-shrink-0",asChild:!0,children:i.jsx("a",{href:Cp("staaakemeets"),onClick:ae=>IP(ae,Cp("staaakemeets")),children:"staaake meets home"})}),G==="inpersondates"&&!!y&&!!$&&L&&i.jsxs(ee,{variant:"ghost",size:"sm",className:"h-8 px-3 text-sm font-medium hover:bg-foreground
404/40 transition-colors whitespace-nowrap flex-shrink-0",onClick:me,children:[i.jsx(IE,{className:"w-4 h-4 mr-2"}),"Profile Edit"]})]})}),i.jsx(iw,{open:n,onOpenChange:ae=>{r(ae),ae||l(null)},localUserId:B,importPrefill:a}),i.jsx(Y8,{open:s,onOpenChange:o,onImported:ae=>{l(ae),r(!0)}}),i.jsx(lH,{open:h,onOpenChange:m}),i.jsx(tH,{open:f,onOpenChange:p}),i.jsx(Vc,{open:b,onOpenChange:_,onAuthSuccess:E,mode:"login"}),i.jsx(Db,{open:x,onOpenChange:w}),i.jsx(ot,{open:v,onOpenChange:g,children:i.jsx(et,{className:"sm:max-w-md",children:i.jsxs(Tt,{children:[i.jsx(vt,{children:W.title}),i.jsx(Ps,{children:W.description})]})})})]})},ql=({activeTab:e,onTabChange:t,hasJoinedEvents:n=!1,hasCreatedEvents:r=!1})=>{const s=Wi(),a=$s().pathname==="/",l=p=>{a?t(p):s(qu(),{state:{tab:p}})},c=[{key:"events",label:"Events"},{key:"going",label:"Going"},{key:"created",label:"Created"}],f=window.location.hostname.includes("lovableproject.com")||window.location.hostname.includes("lovable.app")?c:c.filter(p=>p.key==="events"?!0:p.key==="going"?n:p.key==="created"?r:!1);return i.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-50 flex border-t border-border bg-transparent backdrop-blur-sm pb-[env(safe-area-inset-bottom)]",children:f.map(p=>i.jsx("button",{onClick:()=>l(p.key),className:X("relative flex-1 px-6 py-2.5 text-sm transition-all duration-200",e===p.key?"border-l border-r border-t border-b-2 border-border border-b-primary bg-transparent backdrop-blur-sm text-foreground font-bold":"border-l border-r border-t border-b border-border bg-transparent backdrop-blur-sm text-muted-foreground font-semibold hover:bg-background/30 hover:text-foreground"),children:p.label},p.key))})},NV={"Asia/Kolkata":["IST","IST"],"Asia/Calcutta":["IST","IST"],"America/New_York":["EST","EDT"],"America/Chicago":["CST","CDT"],"America/Denver":["MST","MDT"],"America/Los_Angeles":["PST","PDT"],"Europe/London":["GMT","BST"],"Europe/Zurich":["CET","CEST"],"Europe/Berlin":["CET","CEST"],"Europe/Paris":["CET","CEST"],"Asia/Tokyo":["JST","JST"],"Asia/Shanghai":["CST","CST"],"Australia/Sydney":["AEST","AEDT"]};function TV(e,t){const n=new Date(new Date(e).getFullYear(),0,1),r=new Date(new Date(e).getFullYear(),6,1),s=n.toLocaleString("en-US",{timeZone:t,timeZoneName:"shortOffset"}),o=r.toLocaleString("en-US",{timeZone:t,timeZoneName:"shortOffset"}),a=new Date(e).toLocaleString("en-US",{timeZone:t,timeZoneName:"shortOffset"});return a!==s||a!==o?a!==s:!1}function wA(e,t){const n=new Date(e).toLocaleString("en-US",{timeZone:t,timeZoneName:"short"}).split(" ").pop()||"";if(!n.includes("GMT")&&!n.includes("UTC"))return n;const r=NV[t];return r?TV(e,t)?r[1]:r[0]:n}function Vl(e,t){return new Date(e).toLocaleString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0,timeZone:t}).toUpperCase()}function PV(e,t,n){const r=n&&n>0?n*6e4:xn().siteKey==="foodclubmeets"?72e5:36e5,s=e+r,o=Intl.DateTimeFormat().resolvedOptions().timeZone,a=Vl(e,t),l=Vl(s,t),c=Vl(e,o),u=Vl(s,o),f=wA(e,t);return a===c?`${a} – ${l} ${f}`:`${a} – ${l} ${f} · ${c} – ${u} your time`}function RV(e,t){const n=Intl.DateTimeFormat().resolvedOptions().timeZone,r=Vl(e,t),s=Vl(e,n),o=wA(e,t);return r===s?`${r} ${o}`:`${r} ${o} · ${s} your time`}function AV(e,t){const n=new Date(e),r=n.toLocaleDateString("en-US",{weekday:"long",timeZone:t}),s=n.toLocaleDateString("en-US",{month:"short",timeZone:t}),o=n.toLocaleDateString("en-US",{day:"numeric",timeZone:t}),a=n.toLocaleDateString("en-US",{year:"numeric",timeZone:t});return`${r} ${s} ${o}, ${a}`}function IV(e,t){const n=new Date(e),r=n.toLocaleDateString("en-US",{month:"short",timeZone:t}),s=n.toLocaleDateString("en-US",{day:"numeric",timeZone:t}),o=n.toLocaleDateString("en-US",{year:"numeric",timeZone:t});return`${r} ${s}, ${o}`}function OV(e,t){return new Date(e).toLocaleDateString("en-US",{month:"short",timeZone:t}).toUpperCase()}function MV(e,t){return new Date(e).toLocaleDateString("en-US",{day:"numeric",timeZone:t})}function LV(e,t){return new Intl.DateTimeFormat("en-CA",{timeZone:t}).format(new Date(e))}function DV({className:e,...t}){return i.jsx("div",{className:X("animate-pulse rounded-md bg-muted",e),...t})}function $V(e){const r=e.split("·")[0].trim().split(/[–-]/)[0].trim().split(/\s+/);return r.length>=3&&/^[A-Z]+$/.test(r[r.length-1])&&r.pop(),r.join(" ")}const Vu=({events:e,mode:t="upcoming",hostUsername:n,onUnsubscribe:r,onFilterClick:s,isFilterActive:o,isLoading:a,crossSite:l=!1})=>{const c=Wi(),u=xn().logo,f={};for(const h of e){const m=LV(h.nextStart,h.timezone);f[m]||(f[m]=[]),f[m].push(h)}const p=t==="past"?Object.keys(f).sort().reverse():Object.keys(f).sort();for(const h of p)f[h].sort((m,v)=>t==="past"?v.nextStart-m.nextStart:m.nextStart-v.nextStart);return i.jsx("div",{className:"h-full overflow-y-auto pt-4",children:i.jsxs("div",{className:"w-full max-w-[430px] mx-auto px-4 pb-24",children:[n&&i.jsxs("div",{className:"flex items-center justify-between font-bold text-sm mb-4",children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-foreground",children:"Host: "}),i.jsx("span",{className:"text-primary",children:n})]}),r&&i.jsx("span",{className:"text-xs text-muted-foreground hover:text-destructive cursor-pointer transition-colors font-medium",onClick:()=>r(n),children:"Unsubscribe"})]}),e.length===0&&a&&i.jsx("div",{className:"space-y-3 pt-2",children:[0,1,2].map(h=>i.jsx(DV,{className:"h-[108px] w-full rounded-xl"},h))}),e.length===0&&!a&&i.jsx("p",{className:"text-center text-muted-foreground text-sm py-8",children:"No events to show."}),p.map((h,m)=>{const v=f[h][0];return i.jsxs("div",{className:m>0?"mt-6":"",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3",children:[i.jsx("h2",{className:"text-lg font-semibold tracking-wide text-foreground",children:AV(v.nextStart,v.timezone)}),m===0&&s&&i.jsxs("button",{onClick:g=>{g.stopPropagation(),s()},className:"relative p-1.5 rounded-md text-muted-foreground hover:text-foreground transition-colors",children:[i.jsx(JL,{className:"w-5 h-5"}),o&&i.jsx("span",{className:"absolute top-0.5 right-0.5 w-2 h-2 rounded-full bg-primary"})]})]}),i.jsx("div",{className:"space-y-3",children:f[h].map(g=>{const x=()=>{const k=new URLSearchParams(l?"":window.location.search);if(k.delete("date"),g.eventDateId&&k.set("date_id",g.eventDateId),l){window.location.assign(mA(g.event_type,g.event_c
404ode,k.toString()));return}c(`/${g.event_code}?${k.toString()}`)},w=$V(RV(g.nextStart,g.timezone)),y=g.event_type==="connectonlinemeets",b=!!g.join_url;let _="";return g.stake_required?_="Location visible after RSVP":y?_="Online":_=Zp(g.location_name),i.jsx("div",{onClick:x,className:"group rounded-xl border-2 border-border/60 bg-card p-1.5 cursor-pointer transition-all duration-300 hover:bg-card/70 hover:border-primary hover:shadow-[0_0_15px_hsl(var(--primary)/0.4)] active:bg-card/70 active:border-primary active:shadow-[0_0_20px_hsl(var(--primary)/0.5)]",children:i.jsxs("div",{className:"flex items-start gap-1.5",children:[i.jsx("img",{src:g.custom_image_url||(l?pV(g.event_type):null)||u,alt:"",className:"w-24 h-24 rounded-lg object-cover flex-shrink-0"}),i.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-1",children:[i.jsx("h3",{className:"text-base font-semibold text-foreground leading-tight break-words",children:g.event_name}),i.jsxs("p",{className:"text-sm text-muted-foreground truncate",children:[w,_&&i.jsxs(i.Fragment,{children:[" · ",_]}),y&&b&&i.jsxs(i.Fragment,{children:[" · ",i.jsx("a",{onClick:k=>{k.stopPropagation(),window.open(g.join_url,"_blank","noopener,noreferrer")},className:"text-primary hover:underline cursor-pointer",children:"Join"})]})]}),i.jsxs("div",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[i.jsx(xv,{strokeWidth:1.75,className:"w-4 h-4 min-w-[16px] text-muted-foreground/80"}),i.jsx("span",{children:g.attendee_count}),Hx()&&g.hasPolls&&i.jsx("span",{className:"font-bold text-foreground",children:"Vote"}),g.creator_direction&&i.jsxs("span",{className:"ml-4",children:[i.jsx("span",{className:"tracking-[-0.15em] mr-[0.15em]",children:(g.creator_direction[0]==="M"?"♂":"♀")+(g.creator_direction[g.creator_direction.length-1]==="M"?"♂":"♀")}),g.creator_direction]})]})]})]})},g.id)})})]},h)})]})})},UV="https://errlhmcitfpyyhnwtqrs.supabase.co",FV="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImVycmxobWNpdGZweXlobnd0cXJzIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzIyOTY1NDcsImV4cCI6MjA4Nzg3MjU0N30.Vg5RxV3TAd2PGJ6pwFjMYEds0EtO_yQ07EbX5B_p7WU",wn=bj(UV,FV,{auth:{persistSession:!1,autoRefreshToken:!1,detectSessionInUrl:!1}});function zV(e){return Wt({queryKey:["attendee-counts",...e.sort()],staleTime:3e4,queryFn:async()=>{const{data:t,error:n}=await wn.rpc("get_event_attendee_counts",{event_ids:e});if(n)throw n;const r=new Map;for(const s of t??[]){const o=Number(s.platform_count??0),a=Number(s.luma_count??0),l=Number(s.eventbrite_count??0),c=Number(s.meetup_count??0);r.set(s.event_id,{platform:o,luma:a,eventbrite:l,meetup:c,total:o+a+l+c})}return r},enabled:e.length>0})}function Pm(e){return Wt({queryKey:["attendee-counts-by-date",...e.sort()],staleTime:3e4,queryFn:async()=>{const{data:t,error:n}=await wn.rpc("get_event_attendee_counts_by_date",{event_date_ids:e});if(n)throw n;const r=new Map;for(const s of t??[]){const o=Number(s.platform_count??0),a=Number(s.luma_count??0),l=Number(s.eventbrite_count??0),c=Number(s.meetup_count??0);r.set(s.event_date_id,{platform:o,luma:a,eventbrite:l,meetup:c,total:o+a+l+c})}return r},enabled:e.length>0})}function BV(e,t){var l,c;const n=t?[t]:[],r=!t&&e?[e]:[],s=Pm(n),o=zV(r);return t?{counts:(l=s.data)==null?void 0:l.get(t),isLoading:s.isLoading,error:s.error}:{counts:e?(c=o.data)==null?void 0:c.get(e):void 0,isLoading:o.isLoading,error:o.error}}function xA(e){var p;const t=xn(),{data:n,isLoading:r}=Wt({queryKey:["host-events",e??"",t.siteKey],staleTime:6e4,enabled:!!e,queryFn:async()=>{let h=wn.from("events").select("id, event_code, event_name, venue_name, location_name, event_type, stake_required, capacity, timezone, creator_id, creator_username, custom_image_url, custom_duration_minutes, event_dates(id, start_time, join_url, overrides), event_polls(id, event_date_id)").ilike("creator_username",e).eq("status","active").eq("visibility","public");t.kind==="event"&&t.singleEventType&&t.event_type&&(h=h.eq("event_type",t.event_type));const{data:m,error:v}=await h;if(v)throw v;return m}}),s=(n??[]).flatMap(h=>(h.event_dates??[]).map(m=>m.id)),{data:o}=Pm(s),a=Date.now(),l=(n??[]).flatMap(h=>!h.event_dates||h.event_dates.length===0?[]:h.event_dates.map(m=>{const v=new Date(m.start_time).getTime(),g=o==null?void 0:o.get(m.id),x=em(h,m);return{id:`${h.id}-${v}
404`,event_code:h.event_code,event_name:x.event_name,venue_name:x.venue_name,location_name:x.location_name,event_type:h.event_type,stake_required:h.stake_required??!1,capacity:x.capacity??null,timezone:h.timezone,nextStart:v,attendee_count:(g==null?void 0:g.total)??0,eventDateId:m.id,join_url:m.join_url??null,creator_id:h.creator_id,custom_image_url:x.custom_image_url??null,custom_duration_minutes:x.custom_duration_minutes??null,hasPolls:(h.event_polls??[]).some(w=>w.event_date_id===m.id||w.event_date_id==null),creator_direction:null,_isUpcoming:v>a}})),c=l.filter(h=>h._isUpcoming).sort((h,m)=>h.nextStart-m.nextStart),u=l.filter(h=>!h._isUpcoming).sort((h,m)=>m.nextStart-h.nextStart),f=((p=(n??[]).find(h=>!!h.creator_id))==null?void 0:p.creator_id)??null;return{upcomingEvents:c,pastEvents:u,isLoading:r,creatorId:f}}function bA(e){const{data:t,isLoading:n}=Wt({queryKey:["host-profile",e??""],staleTime:3e5,enabled:!!e,queryFn:async()=>{const{data:r,error:s}=await wn.rpc("get_host_profile",{p_username:e});if(s)throw s;const o=(r==null?void 0:r[0])??null;if(o)return{id:o.id,username:o.username};try{const{data:a,error:l}=await pe.rpc("get_sheet_by_username",{p_username:e}),c=a;if(l||!(c!=null&&c.found)||!(c!=null&&c.sheet))return null;let u=null;if(c.sheet.owner_uid){const{data:f}=await wn.rpc("get_user_id_by_staaake_uid",{p_staaake_uid:c.sheet.owner_uid});u=f??null}return{id:u,username:c.sheet.sheet_username??e}}catch{return null}}});return{exists:t===void 0?void 0:!!t,creatorId:(t==null?void 0:t.id)??null,isLoading:n}}const gy="https://errlhmcitfpyyhnwtqrs.supabase.co",yy="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImVycmxobWNpdGZweXlobnd0cXJzIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzIyOTY1NDcsImV4cCI6MjA4Nzg3MjU0N30.Vg5RxV3TAd2PGJ6pwFjMYEds0EtO_yQ07EbX5B_p7WU";function _A({creatorId:e,username:t,localUserId:n,isPreview:r=!1,guardAction:s}){const o=Dr(),[a,l]=d.useState(!1),{data:c=[]}=Wt({queryKey:["creator_follows",n],queryFn:async()=>{const{data:{session:h}}=await pe.auth.getSession();if(!(h!=null&&h.access_token))return[];const m=await fetch(`${gy}/functions/v1/get-follows`,{headers:{Authorization:`Bearer ${h.access_token}`,apikey:yy}});return m.ok?m.json():[]},enabled:!!n&&!r,staleTime:3e4,placeholderData:h=>h}),u=c.some(h=>h.creatorUserId===e);return{isSubscribed:u,handleSubscribe:()=>{s(async()=>{if(e)if(u)l(!0);else{const h=o.getQueryData(["creator_follows",n]);o.setQueryData(["creator_follows",n],(m=[])=>[...m,{creatorUserId:e,username:t||"",events:[]}]),re.success("Subscribed!"),pe.auth.getSession().then(({data:{session:m}})=>{fetch(`${gy}/functions/v1/subscribe`,{method:"POST",headers:{Authorization:`Bearer ${m.access_token}`,apikey:yy,"Content-Type":"application/json"},body:JSON.stringify({creator_user_id:e,action:"follow"})}).then(v=>{v.ok?o.invalidateQueries({queryKey:["creator_follows",n]}):(o.setQueryData(["creator_follows",n],h),re.error("Failed to subscribe"))}).catch(()=>{o.setQueryData(["creator_follows",n],h),re.error("Failed to subscribe")})})}})},handleConfirmUnsub:()=>{if(!e)return;const h=o.getQueryData(["creator_follows",n]);o.setQueryData(["creator_follows",n],(m=[])=>m.filter(v=>v.creatorUserId!==e)),re.success("Unsubscribed"),l(!1),pe.auth.getSession().then(({data:{session:m}})=>{fetch(`${gy}/functions/v1/subscribe`,{method:"POST",headers:{Authorization:`Bearer ${m.access_token}`,apikey:yy,"Content-Type":"application/json"},body:JSON.stringify({creator_user_id:e,action:"unfollow"})}).then(v=>{v.ok||(o.setQueryData(["creator_follows",n],h),re.error("Failed to unsubscribe"))}).catch(()=>{o.setQueryData(["creator_follows",n],h),re.error("Failed to unsubscribe")})})},confirmUnsubOpen:a,setConfirmUnsubOpen:l}}var Rm="Checkbox",[WV,tG]=vr(Rm),[HV,$b]=WV(Rm);function KV(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:o,form:a,name:l,onCheckedChange:c,required:u,value:f="on",internal_do_not_use_render:p}=e,[h,m]=ro({prop:n,defaultProp:s??!1,onChange:c,caller:Rm}),[v,g]=d.useState(null),[x,w]=d.useState(null),y=d.useRef(!1),b=v?!!a||!!v.closest("form"):!0,_={checked:h,disabled:o,setChecked:m,control:v,setControl:g,name:l,form:a,value:f,hasConsumerStoppedPropagationRef:y,required:u,defaultChecked:Ri(s)?!1:s,isFormControl:b,bubbleInput:x,setBubbleInput:w};return i.jsx(HV,{scope:t,..._,children:qV(p)?p(_):r})}var kA="CheckboxTrigger",SA=d.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:o,value:a,disabled:l,checked:c,required:u,setControl:f,setChecked:p,hasConsumerStoppedPropagationRef:h,isFormControl:m,bubbleInput:v}=$b(kA,e),g=Pe(s,f),x=d.useRef(c);return d.useEffect(()=>{const w=o==null?void 0:o.form;if(w){const y=()=>p(x.current);return w.addEventListener("reset",y),()=>w.removeEventListener("reset",y)}},[o,p]),i.jsx(ve.button,{type:"button",role:"checkbox","aria-checked":Ri(c)?"mixed":c,"aria-required":u,"data-state":TA(c),"data-disabled":l?"":void 0,disabled:l,value:a,...r,ref:g,onKeyDown:ie(t,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:ie(n,w=>{p(y=>Ri(y)?!0:!y),v&&m&&(h.current=w.isPropagationStopped(),h.current||w.stopPropagation())})})});SA.displayName=kA;var Ub=d.forwardRef((e,t)=>
vendor: 4,341 bytes, line 404
404{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:o,required:a,disabled:l,value:c,onCheckedChange:u,form:f,...p}=e;return i.jsx(KV,{__scopeCheckbox:n,checked:s,defaultChecked:o,disabled:l,required:a,onCheckedChange:u,name:r,form:f,value:c,internal_do_not_use_render:({isFormControl:h})=>i.jsxs(i.Fragment,{children:[i.jsx(SA,{...p,ref:t,__scopeCheckbox:n}),h&&i.jsx(NA,{__scopeCheckbox:n})]})})});Ub.displayName=Rm;var CA="CheckboxIndicator",EA=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,o=$b(CA,n);return i.jsx(Qn,{present:r||Ri(o.checked)||o.checked===!0,children:i.jsx(ve.span,{"data-state":TA(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});EA.displayName=CA;var jA="CheckboxBubbleInput",NA=d.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:o,defaultChecked:a,required:l,disabled:c,name:u,value:f,form:p,bubbleInput:h,setBubbleInput:m}=$b(jA,e),v=Pe(n,m),g=ub(o),x=ab(r);d.useEffect(()=>{const y=h;if(!y)return;const b=window.HTMLInputElement.prototype,k=Object.getOwnPropertyDescriptor(b,"checked").set,C=!s.current;if(g!==o&&k){const E=new Event("click",{bubbles:C});y.indeterminate=Ri(o),k.call(y,Ri(o)?!1:o),y.dispatchEvent(E)}},[h,g,o,s]);const w=d.useRef(Ri(o)?!1:o);return i.jsx(ve.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??w.current,required:l,disabled:c,name:u,value:f,form:p,...t,tabIndex:-1,ref:v,style:{...t.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});NA.displayName=jA;function qV(e){return typeof e=="function"}function Ri(e){return e==="indeterminate"}function TA(e){return Ri(e)?"indeterminate":e?"checked":"unchecked"}const PA=d.forwardRef(({className:e,...t},n)=>i.jsx(Ub,{ref:n,className:X("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:i.jsx(EA,{className:X("flex items-center justify-center text-current"),children:i.jsx(es,{className:"h-4 w-4"})})}));PA.displayName=Ub.displayName;var[Am,nG]=vr("Tooltip",[Hi]),Im=Hi(),RA="TooltipProvider",VV=700,gw="tooltip.open",[YV,Fb]=Am(RA),AA=e=>{const{__scopeTooltip:t,delayDuration:n=VV,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:o}=e,a=d.useRef(!0),l=d.useRef(!1),c=d.useRef(0);return d.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),i.jsx(YV,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:d.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:d.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:d.useCallback(u=>{l.current=u},[]),disableHoverableContent:s,children:o})};AA.displayName=RA;var Pd="Tooltip",[GV,Om]=Am(Pd),IA=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:o,disableHoverableContent:a,delayDuration:l}=e,c=Fb(Pd,e.__scopeTooltip),u=Im(t),[f,p]=d.useState(null),h=Gn(),m=d.useRef(0),v=a??c.disableHoverableContent,g=l??c.delayDuration,x=d.useRef(!1),[w,y]=ro({prop:r,defaultProp:s??!1,onChange:E=>{E?(c.onOpen(),document.dispatchEvent(new CustomEvent(gw))):c.onClose(),o==null||o(E)},caller:Pd}),b=d.useMemo(()=>w?x.current?"delayed-open":"instant-open":"closed",[w]),_=d.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x.current=!1,y(!0)},[y]),k=d.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y(!1)},[y]),C=d.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{x.current=!0,y(!0),m.current=0},g)},[g,y]);return d.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),i.jsx(hm,{...u,children:i.jsx(GV,{scope:t,contentId:h,open:w,stateAttribute:b,trigger:f,onTriggerChange:p,onTriggerEnter:d.useCallback(()=>{c.isOpenDelayedRef.current?C():_()},[c.isOpenDelayedRef,C,_]),onTriggerLeave:d.useCallback(()=>{v?k():(window.clearTimeout(m.current),m.current=0)},[k,v]),onOpen:_,onClose:k,disableHoverableContent:v,children:n})})};IA.displayName=Pd;var yw="TooltipTrigger",OA=d.forwardRef((e,t)=>
vendor: 5,250 bytes, line 404
404{const{__scopeTooltip:n,...r}=e,s=Om(yw,n),o=Fb(yw,n),a=Im(n),l=d.useRef(null),c=Pe(t,l,s.onTriggerChange),u=d.useRef(!1),f=d.useRef(!1),p=d.useCallback(()=>u.current=!1,[]);return d.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),i.jsx(Jd,{asChild:!0,...a,children:i.jsx(ve.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:ie(e.onPointerMove,h=>{h.pointerType!=="touch"&&!f.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:ie(e.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:ie(e.onPointerDown,()=>{s.open&&s.onClose(),u.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:ie(e.onFocus,()=>{u.current||s.onOpen()}),onBlur:ie(e.onBlur,s.onClose),onClick:ie(e.onClick,s.onClose)})})});OA.displayName=yw;var JV="TooltipPortal",[rG,QV]=Am(JV,{forceMount:void 0}),Rc="TooltipContent",MA=d.forwardRef((e,t)=>{const n=QV(Rc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...o}=e,a=Om(Rc,e.__scopeTooltip);return i.jsx(Qn,{present:r||a.open,children:a.disableHoverableContent?i.jsx(LA,{side:s,...o,ref:t}):i.jsx(XV,{side:s,...o,ref:t})})}),XV=d.forwardRef((e,t)=>{const n=Om(Rc,e.__scopeTooltip),r=Fb(Rc,e.__scopeTooltip),s=d.useRef(null),o=Pe(t,s),[a,l]=d.useState(null),{trigger:c,onClose:u}=n,f=s.current,{onPointerInTransitChange:p}=r,h=d.useCallback(()=>{l(null),p(!1)},[p]),m=d.useCallback((v,g)=>{const x=v.currentTarget,w={x:v.clientX,y:v.clientY},y=r9(w,x.getBoundingClientRect()),b=s9(w,y),_=o9(g.getBoundingClientRect()),k=a9([...b,..._]);l(k),p(!0)},[p]);return d.useEffect(()=>()=>h(),[h]),d.useEffect(()=>{if(c&&f){const v=x=>m(x,f),g=x=>m(x,c);return c.addEventListener("pointerleave",v),f.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",v),f.removeEventListener("pointerleave",g)}}},[c,f,m,h]),d.useEffect(()=>{if(a){const v=g=>{const x=g.target,w={x:g.clientX,y:g.clientY},y=(c==null?void 0:c.contains(x))||(f==null?void 0:f.contains(x)),b=!i9(w,a);y?h():b&&(h(),u())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[c,f,a,u,h]),i.jsx(LA,{...e,ref:o})}),[ZV,e9]=Am(Pd,{isInside:!1}),t9=LE("TooltipContent"),LA=d.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:a,...l}=e,c=Om(Rc,n),u=Im(n),{onClose:f}=c;return d.useEffect(()=>(document.addEventListener(gw,f),()=>document.removeEventListener(gw,f)),[f]),d.useEffect(()=>{if(c.trigger){const p=h=>{const m=h.target;m!=null&&m.contains(c.trigger)&&f()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[c.trigger,f]),i.jsx(Ya,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:p=>p.preventDefault(),onDismiss:f,children:i.jsxs(pm,{"data-state":c.stateAttribute,...u,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[i.jsx(t9,{children:r}),i.jsx(ZV,{scope:n,isInside:!0,children:i.jsx(AB,{id:c.contentId,role:"tooltip",children:s||r})})]})})});MA.displayName=Rc;var DA="TooltipArrow",n9=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Im(n);return e9(DA,n).isInside?null:i.jsx(mm,{...s,...r,ref:t})});n9.displayName=DA;function r9(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,s,o)){case o:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function s9(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function o9(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function i9(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const l=t[o],c=t[a],u=l.x,f=l.y,p=c.x,h=c.y;f>r!=h>r&&n<(p-u)*(r-f)/(h-f)+u&&(s=!s)}return s}function a9(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),l9(t)}function l9(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(s.y-a.y)>=(o.y-a.y)*(s.x-a.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const o=n[n.length-1],a=n[n.length-2];if((o.x-a.x)*(s.y-a.y)>=(o.y-a.y)*(s.x-a.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var c9=AA,u9=IA,d9=OA,$A=MA;const aS=c9,vy=u9,wy=d9,Nh=d.forwardRef(({className:e,sideOffset:t=4,...n},r)=>
404i.jsx($A,{ref:r,sideOffset:t,className:X("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));Nh.displayName=$A.displayName;const lS=e=>e.length===0?{valid:!1,message:"Enter a username"}:e.length<4?{valid:!1,message:"Username must be at least 4 characters"}:e.length>30?{valid:!1,message:"Username must be 30 characters or less"}:/^[a-zA-Z0-9_.]+$/.test(e)?e.startsWith(".")||e.endsWith(".")?{valid:!1,message:"Username cannot start or end with a period"}:e.includes("..")?{valid:!1,message:"Username cannot have consecutive periods"}:{valid:!0,message:"Username is valid ✓"}:{valid:!1,message:"Only letters, numbers, underscores, and periods allowed"},f9=({open:e,onOpenChange:t,onConfirm:n,initialValue:r=""})=>{const[s,o]=d.useState(r),[a,l]=d.useState({valid:!1,message:""}),[c,u]=d.useState(!1),[f,p]=d.useState(null);d.useEffect(()=>{e&&(o(r),l(lS(r)),u(!1),p(null))},[e,r]);const h=g=>{const x=g.target.value;o(x),l(lS(x)),p(null)},m=async()=>{if(a.valid){u(!0),p(null);try{const{data:g,error:x}=await pe.functions.invoke("check-username",{body:{username:s.toLowerCase()}});if(x){p("Failed to check username. Please try again."),u(!1);return}if(g.ok===!1){p("Username already taken"),u(!1);return}n(s),t(!1)}catch{p("Failed to check username. Please try again."),u(!1)}}},v=()=>{t(!1)};return i.jsx(ot,{open:e,onOpenChange:t,children:i.jsxs(et,{className:"z-[110] max-h-[calc(100dvh-2rem)] overflow-y-auto",overlayClassName:"z-[110]",children:[i.jsx(Tt,{children:i.jsx(vt,{children:"Choose a Username"})}),i.jsxs("div",{className:"space-y-4",children:[i.jsx(Ar,{placeholder:"username",value:s,onChange:h}),s.length>0&&!f&&i.jsx("p",{className:`text-sm ${a.valid?"text-primary":"text-destructive"}`,children:a.message}),f&&i.jsx("p",{className:"text-sm text-destructive",children:f}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Use a unique name — no brands or other people's names. Accounts using impersonation may be removed."})]}),i.jsxs(so,{className:"gap-2 sm:gap-0",children:[i.jsx(ee,{variant:"outline",onClick:v,children:"Cancel"}),i.jsx(ee,{onClick:m,disabled:!a.valid||c,children:c?"Checking...":"Add Username"})]})]})})},h9=[{name:"Instagram",patterns:[/instagram\.com\/([^/?#]+)/i,/^@?([a-zA-Z0-9._]+)$/i],buildUrl:e=>`https://instagram.com/${e}`},{name:"TikTok",patterns:[/tiktok\.com\/@?([^/?#]+)/i],buildUrl:e=>`https://tiktok.com/@${e.replace(/^@/,"")}`},{name:"X",patterns:[/(?:twitter|x)\.com\/([^/?#]+)/i],buildUrl:e=>`https://x.com/${e}`},{name:"Threads",patterns:[/threads\.net\/@?([^/?#]+)/i],buildUrl:e=>`https://threads.net/@${e.replace(/^@/,"")}`},{name:"Snapchat",patterns:[/snapchat\.com\/add\/([^/?#]+)/i],buildUrl:e=>`https://snapchat.com/add/${e}`},{name:"YouTube",patterns:[/youtube\.com\/@?([^/?#]+)/i,/youtu\.be\/([^/?#]+)/i],buildUrl:e=>`https://youtube.com/@${e.replace(/^@/,"")}`},{name:"Twitch",patterns:[/twitch\.tv\/([^/?#]+)/i],buildUrl:e=>`https://twitch.tv/${e}`},{name:"Kick",patterns:[/kick\.com\/([^/?#]+)/i],buildUrl:e=>`https://kick.com/${e}`},{name:"Pinterest",patterns:[/pinterest\.com\/([^/?#]+)/i],buildUrl:e=>`https://pinterest.com/${e}`},{name:"Reddit",patterns:[/reddit\.com\/(?:u|user)\/([^/?#]+)/i],buildUrl:e=>`https://reddit.com/u/${e}`},{name:"Substack",patterns:[/([^.]+)\.substack\.com/i],buildUrl:e=>`https://${e}.substack.com`},{name:"Medium",patterns:[/medium\.com\/@?([^/?#]+)/i],buildUrl:e=>`https://medium.com/@${e.replace(/^@/,"")}`},{name:"GitHub",patterns:[/github\.com\/([^/?#]+)/i],buildUrl:e=>`https://github.com/${e}`},{name:"GitLab",patterns:[/gitlab\.com\/([^/?#]+)/i],buildUrl:e=>`https://gitlab.com/${e}`},{name:"Bitbucket",patterns:[/bitbucket\.org\/([^/?#]+)/i],buildUrl:e=>`https://bitbucket.org/${e}`},{name:"Dev.to",patterns:[/dev\.to\/([^/?#]+)/i],buildUrl:e=>`https://dev.to/${e}`},{name:"Discord",patterns:[/discord\.gg\/([^/?#]+)/i,/discord\.com\/invite\/([^/?#]+)/i],buildUrl:e=>`https://discord.gg/${e}`},{name:"Telegram",patterns:[/t\.me\/([^/?#]+)/i,/telegram\.me\/([^/?#]+)/i],buildUrl:e=>`https://t.me/${e}`},{name:"Signal",patterns:[/signal\.group\/([^/?#]+)/i]},{name:"Slack",patterns:[/([^.]+)\.slack\.com/i]},{name:"Etsy",patterns:[/etsy\.com\/shop\/([^/?#]+)/i],buildUrl:e=>`https://etsy.com/shop/${e}`},{name:"Shopify",patterns:[/([^.]+)\.myshopify\.com/i]},{name:"Gumroad",patterns:[/gumroad\.com\/([^/?#]+)/i,/([^.]+)\.gumroad\.com/i],buildUrl:e=>`https://${e}.gumroad.com`},{name:"Patreon",patterns:[/patreon\.com\/([^/?#]+)/i],buildUrl:e=>`https://patreon.com/${e}`},{name:"Ko-fi",patterns:[/ko-fi\.com\/([^/?#]+)/i],buildUrl:e=>`https://ko-fi.com/${e}`},{name:"Buy Me a Coffee",patterns:[/buymeacoffee\.com\/([^/?#]+)/i],buildUrl:e=>`https://buymeacoffee.com/${e}`},{name:"Fiverr",patterns:[/fiverr\.com\/([^/?#]+)/i],buildUrl:e=>`https://fiverr.com/${e}`},{name:"Upwork",patterns:[/upwork\.com\/freelancers\/([^/?#]+)/i],buildUrl:e=>`https://upwork.com/freelancers/${e}`},{name:"LinkedIn",patterns:[/linkedin\.com\/in\/([^/?#]+)/i,/linkedin\.com\/company\/([^/?#]+)/i],buildUrl:e=>`https://linkedin.com/in/${e}`},{name:"WhatsApp",patterns:[/wa\.me\/([^/?#]+)/i,/api\.whatsapp\.com\/send\?p
404hone=([^&]+)/i],buildUrl:e=>`https://wa.me/${e}`},{name:"Luma",patterns:[/lu\.ma(?:\/([^/?#]+))?/i,/luma\.com(?:\/([^/?#]+))?/i],buildUrl:e=>`https://lu.ma/${e||""}`},{name:"Eventbrite",patterns:[/eventbrite\.com\/([^/?#]+)/i,/eventbrite\.[a-z]+\/([^/?#]+)/i],buildUrl:e=>`https://eventbrite.com/${e}`}];function p9(e){const t=e.trim();if(!t)return{label:"Link",url:"",platform:"unknown"};let n=t;!n.startsWith("http://")&&!n.startsWith("https://")&&(n.startsWith("www.")||n.includes("."))&&(n=`https://${n}`);for(const r of h9)for(const s of r.patterns)if(n.match(s)||t.match(s))return{label:r.name,url:n,platform:r.name.toLowerCase().replace(/\s+/g,"-")};try{return new URL(n),{label:"Link",url:n,platform:"custom"}}catch{return{label:"Link",url:n,platform:"unknown"}}}function cS(e){return p9(e).label}const vw=e=>{const t=e.trim();return!t||t.startsWith("http://")||t.startsWith("https://")?t:t.startsWith("www.")||/^[a-zA-Z0-9][a-zA-Z0-9-]*\.[a-zA-Z]{2,}/.test(t)?`https://${t}`:t},xy=e=>{if(e.length===0)return{valid:!1,message:""};if(e.includes(" "))return{valid:!1,message:"Links cannot contain spaces"};if(e.startsWith("@"))return{valid:!1,message:"Enter a full URL, not a handle"};const t=vw(e);return/^https?:\/\/[a-zA-Z0-9][a-zA-Z0-9-]*(\.[a-zA-Z0-9][a-zA-Z0-9-]*)*\.[a-zA-Z]{2,}(\/.*)?$/.test(t)?{valid:!0,message:"Link looks good ✓"}:{valid:!1,message:"Enter a valid URL (e.g., example.com)"}},m9=({open:e,onOpenChange:t,onConfirm:n,initialValue:r=""})=>{const[s,o]=d.useState(r),[a,l]=d.useState({valid:!1,message:""}),[c,u]=d.useState("");d.useEffect(()=>{e&&(o(r),l(xy(r)),u(r?cS(r):""))},[e,r]);const f=m=>{const v=m.target.value;o(v),l(xy(v)),v&&xy(v).valid?u(cS(vw(v))):u("")},p=()=>{const m=vw(s);n(m),t(!1)},h=()=>{t(!1)};return i.jsx(ot,{open:e,onOpenChange:t,children:i.jsxs(et,{className:"z-[110] max-h-[calc(100dvh-2rem)] overflow-y-auto",overlayClassName:"z-[110]",children:[i.jsx(Tt,{children:i.jsx(vt,{children:"Add Your Link"})}),i.jsxs("div",{className:"space-y-4",children:[i.jsx(Ar,{placeholder:"https://example.com",value:s,onChange:f}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Paste your full link — not just your handle or username."}),c&&a.valid&&i.jsxs("p",{className:"text-sm text-primary",children:["Detected: ",c]}),a.message&&i.jsx("p",{className:`text-sm ${a.valid?"text-primary":"text-destructive"}`,children:a.message})]}),i.jsxs(so,{className:"gap-2 sm:gap-0",children:[i.jsx(ee,{variant:"outline",onClick:h,children:"Cancel"}),i.jsx(ee,{onClick:p,disabled:!a.valid,children:"Add Link"})]})]})})},uS=50,g9=({open:e,onOpenChange:t,onConfirm:n,initialValue:r=""})=>{const[s,o]=d.useState(r);d.useEffect(()=>{e&&o(r)},[e,r]);const a=h=>{o(h.target.value)},l=()=>{n(s.trim()),t(!1)},c=()=>{t(!1)},u=s.length>uS,p=!(s.trim().length===0)&&!u;return i.jsx(ot,{open:e,onOpenChange:t,children:i.jsxs(et,{className:"z-[110] max-h-[calc(100dvh-2rem)] overflow-y-auto",overlayClassName:"z-[110]",children:[i.jsx(Tt,{children:i.jsx(vt,{children:"Write Your Bio"})}),i.jsxs("div",{className:"space-y-4",children:[i.jsx(Zx,{placeholder:"Tell us about yourself...",value:s,onChange:a,rows:3}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Write a short 1-liner (max 50 characters) bio, niche or category."}),i.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground",children:[i.jsx("p",{children:"Example: Founder @ X, building Y"}),i.jsx("p",{children:"Example: AI, fintech, creator economy"})]}),i.jsxs("p",{className:`text-sm text-right ${u?"text-destructive":"text-primary"}`,children:[s.length," / ",uS]})]}),i.jsxs(so,{className:"gap-2 sm:gap-0",children:[i.jsx(ee,{variant:"outline",onClick:c,children:"Cancel"}),i.jsx(ee,{onClick:l,disabled:!p,children:"Add Bio"})]})]})})},y9=["Networking","Co-founder","Content Creator","Funding","Job"],v9=["Freelance Work","Content Creation","Technical Help","Marketing Help","Sales Help"],fa="Other",Yu=50,ww=(e,t)=>{if(!e)return null;if(e===fa){const n=t.trim();return n.length>0?n:null}return e},dS=e=>ww(e.select,e.custom)!==null,w9=({open:e,onOpenChange:t,onConfirm:n,label:r,placeholder:s,initialValue:o=""})=>{const[a,l]=d.useState(o);d.useEffect(()=>{e&&l(o)},[e,o]);const c=a.length>Yu,f=!(a.trim().length===0)&&!c,p=()=>{f&&(n(a.trim()),t(!1))};return i.jsx(ot,{open:e,onOpenChange:t,children:i.jsxs(et,{className:"sm:max-w-[425px]",children:[i.jsx(Tt,{children:i.jsx(vt,{children:r})}),i.jsxs("div",{className:"space-y-2 py-2",children:[i.jsx(Ar,{value:a,onChange:h=>
404l(h.target.value),placeholder:s,maxLength:Yu,autoFocus:!0,onKeyDown:h=>{h.key==="Enter"&&f&&(h.preventDefault(),p())}}),i.jsxs("p",{className:X("text-xs text-right",c?"text-destructive":"text-muted-foreground"),children:[a.length,"/",Yu]})]}),i.jsxs(so,{className:"gap-2 sm:gap-0",children:[i.jsx(ee,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),i.jsx(ee,{onClick:p,disabled:!f,children:"OK"})]})]})})},fS=({value:e,onChange:t,presets:n,placeholder:r,customPlaceholder:s,triggerClassName:o,contentClassName:a,showCounter:l=!0,autoFocusCustom:c=!0,id:u,useModalForCustom:f=!1,onRequireAuth:p})=>{const h=e.select===fa,m=e.custom.length>Yu,[v,g]=d.useState(!1),x=y=>{if(y===fa){if(p!=null&&p())return;if(f){g(!0);return}t({select:fa,custom:e.custom});return}t({select:y,custom:""})},w=h&&e.custom.trim().length>0;return i.jsxs("div",{className:"space-y-2",children:[i.jsxs(Kr,{value:e.select,onValueChange:x,children:[i.jsx(Nr,{id:u,className:X(o),children:f&&w?i.jsx("span",{className:"truncate",children:e.custom}):i.jsx(qr,{placeholder:r})}),i.jsxs(Tr,{className:X(a),children:[n.map(y=>i.jsx(bt,{value:y,children:y},y)),i.jsx(bt,{value:fa,children:"Write your own"})]})]}),!f&&h&&i.jsxs(i.Fragment,{children:[i.jsx(Ar,{value:e.custom,onChange:y=>t({select:fa,custom:y.target.value}),placeholder:s,autoFocus:c,className:"h-9 text-sm"}),l&&i.jsxs("p",{className:X("text-xs",m?"text-destructive":"text-muted-foreground"),children:[e.custom.length,"/",Yu," characters"]})]}),f&&i.jsx(w9,{open:v,onOpenChange:g,onConfirm:y=>t({select:fa,custom:y}),label:r,placeholder:s,initialValue:h?e.custom:""})]})},Mm=({onSuccess:e})=>{const[t,n]=d.useState(""),[r,s]=d.useState(!1),[o,a]=d.useState(""),[l,c]=d.useState(!1),[u,f]=d.useState(""),[p,h]=d.useState(!1),[m,v]=d.useState({select:"",custom:""}),[g,x]=d.useState({select:"",custom:""}),[w,y]=d.useState(!1),[b,_]=d.useState(!1),k=dS(m),C=dS(g),E=async()=>{try{await qR()}catch(T){re.error(T instanceof Error?T.message:"We could not log you out everywhere. Please try again.")}},A=async()=>{var T,M,P,$;if(!t||!o||!u){re.error("Please fill in all required fields");return}if(!k||!C){re.error("Please select Looking For and Offering");return}y(!0);try{const{data:H}=await pe.auth.getSession(),z=typeof window<"u"?window.location.hostname:"unknown";if(console.log("[CompleteSetupModal] Calling complete-profile EF",{site:z,hasSession:!!(H!=null&&H.session),staaakeUserId:((M=(T=H==null?void 0:H.session)==null?void 0:T.user)==null?void 0:M.id)??null}),!(H!=null&&H.session)){re.error("Session expired. Please sign in again."),y(!1);return}if(await kp(H.session.access_token)==="revoked"){await Sp(),window.location.reload();return}const{data:U,error:D}=await pe.functions.invoke("complete-profile",{body:{username:t.toLowerCase(),link:o,bio:u,looking_for:ww(m.select,m.custom),offering:ww(g.select,g.custom)}});if(D){let j=null,N=null,W=null;if(D instanceof kv)try{j=(($=(P=D.context)==null?void 0:P.response)==null?void 0:$.status)??null,N=await D.context.response.text();try{W=JSON.parse(N)}catch{}}catch(G){console.error("[CompleteSetupModal] Failed reading error body:",G)}console.error("[CompleteSetupModal] complete-profile failed:",{site:z,status:j,body:W??N,name:D==null?void 0:D.name,message:D==null?void 0:D.message}),re.error((W==null?void 0:W.error)||(D==null?void 0:D.message)||"Failed to complete setup"),y(!1);return}if(!(U!=null&&U.ok)){console.error("[CompleteSetupModal] Validation error:",U==null?void 0:U.error),re.error((U==null?void 0:U.error)||"Failed to create profile"),y(!1);return}console.log("[CompleteSetupModal] Success:",U),re.success("Account created!"),y(!1),e()}catch(H){console.error("[CompleteSetupModal] Unexpected error:",H),re.error("An unexpected error occurred"),y(!1)}};return Bi.createPortal(i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"fixed inset-0 z-[99] bg-black/60"}),i.jsxs("div",{className:"fixed inset-0 z-[100] bg-background overflow-y-auto overscroll-contain",children:[i.jsx("div",{className:"min-h-full flex items-center justify-center py-8",children:i.jsx("div",{className:"w-full max-w-md mx-auto px-6",children:i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"text-center space-y-2",children:[i.jsx("h1",{className:"text-2xl font-bold tracking-tight text-foreground",children:"Create staaake Account"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"To continue, you need to create your staaake profile."})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(_t,{children:"Username *"}
404),i.jsxs(vy,{children:[i.jsx(wy,{asChild:!0,children:i.jsx(Eg,{className:"h-3.5 w-3.5 text-muted-foreground"})}),i.jsx(Nh,{children:i.jsx("p",{children:"Choose a unique username for your account"})})]})]}),i.jsx("div",{onClick:()=>s(!0),className:"cursor-pointer flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm items-center hover:border-muted-foreground/50 transition-colors",children:t||i.jsx("span",{className:"text-muted-foreground",children:"Enter username"})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(_t,{children:"Link *"}),i.jsxs(vy,{children:[i.jsx(wy,{asChild:!0,children:i.jsx(Eg,{className:"h-3.5 w-3.5 text-muted-foreground"})}),i.jsx(Nh,{children:i.jsx("p",{children:"Add a link to your website or social profile"})})]})]}),i.jsx("div",{onClick:()=>c(!0),className:"cursor-pointer flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm items-center hover:border-muted-foreground/50 transition-colors",children:o||i.jsx("span",{className:"text-muted-foreground",children:"https://example.com"})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(_t,{children:"Bio *"}),i.jsxs(vy,{children:[i.jsx(wy,{asChild:!0,children:i.jsx(Eg,{className:"h-3.5 w-3.5 text-muted-foreground"})}),i.jsx(Nh,{children:i.jsx("p",{children:"Write a short bio about yourself"})})]})]}),i.jsx("div",{onClick:()=>h(!0),className:"cursor-pointer flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm items-start hover:border-muted-foreground/50 transition-colors",children:u||i.jsx("span",{className:"text-muted-foreground",children:"Enter bio"})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs(_t,{htmlFor:"lookingFor",children:["Looking For ",i.jsx("span",{className:"text-destructive",children:"*"})]}),i.jsx(fS,{id:"lookingFor",value:m,onChange:v,presets:y9,placeholder:"Select what you're looking for",customPlaceholder:"Describe what you're looking for",contentClassName:"z-[110]"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs(_t,{htmlFor:"offering",children:["Offering ",i.jsx("span",{className:"text-destructive",children:"*"})]}),i.jsx(fS,{id:"offering",value:g,onChange:x,presets:v9,placeholder:"Select what you're offering",customPlaceholder:"Describe what you're offering",contentClassName:"z-[110]"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:"This will be your profile for staaake Sheets."}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(PA,{id:"understand",checked:b,onCheckedChange:T=>_(T===!0)}),i.jsx(_t,{htmlFor:"understand",className:"cursor-pointer font-normal",children:"I understand"})]})]}),i.jsx(ee,{className:"w-full",onClick:A,disabled:w||!b,children:w?i.jsxs(i.Fragment,{children:[i.jsx(to,{className:"mr-2 h-4 w-4 animate-spin"}),"Creating account..."]}):"Create Account"}),i.jsxs(ee,{variant:"ghost",className:"w-full",onClick:E,children:[i.jsx(TE,{className:"mr-2 h-4 w-4"}),"Sign Out"]})]})]})})}),i.jsx(f9,{open:r,onOpenChange:s,onConfirm:T=>n(T),initialValue:t}),i.jsx(m9,{open:l,onOpenChange:c,onConfirm:T=>a(T),initialValue:o}),i.jsx(g9,{open:p,onOpenChange:h,onConfirm:T=>f(T),initialValue:u})]})]}),document.body)},zb=()=>{const e=typeof window<"u"&&(window.location.hostname.includes("lovableproject.com")||window.location.hostname.includes("lovable.app")),{localUserId:t,activeUsername:n,hasRsvps:r,hasCreated:s,loading:o}=Fo(),a=!!t&&!!n;return{hasJoinedEvents:e||a&&(o||r),hasCreatedEvents:e||a&&(o||s)}},ma=864e5,Ai=[{id:"preview1",event_code:"abc123",event_name:"Tech Power Walk",venue_name:"Central Park",location_name:"Central Park West, New York, NY",event_type:"powerwalk",nextStart:Date.now()+ma,attendee_count:10,capacity:null,timezone:"America/New_York",hasPolls:!0}
404,{id:"preview2",event_code:"xyz456",event_name:"Founder Coffee",venue_name:"Blue Bottle Coffee",location_name:"Soho, New York, NY",event_type:"powerwalk",nextStart:Date.now()+ma+144e5,attendee_count:6,capacity:12,timezone:"America/New_York"},{id:"preview-online",event_code:"online01",event_name:"Online Founder Roundtable",venue_name:null,location_name:null,event_type:"powerwalk",nextStart:Date.now()+ma+72e5,attendee_count:5,capacity:null,timezone:"America/New_York",join_url:"https://meet.google.com/abc-defg-hij"},{id:"preview3",event_code:"def789",event_name:"Weekend Meetup",venue_name:"Park Plaza",location_name:"50 Park Plaza, Boston, MA",event_type:"powerwalk",nextStart:Date.now()+ma*2,attendee_count:12,stake_required:!0,capacity:null,timezone:"Asia/Kolkata"},{id:"preview4",event_code:"ghi012",event_name:"Sunset Yoga",venue_name:"Rooftop Garden",location_name:"123 Main St, San Francisco, CA",event_type:"powerwalk",nextStart:Date.now()+ma*4,attendee_count:8,capacity:null,timezone:"America/Los_Angeles"}],Rd=[{id:"preview5",event_code:"past001",event_name:"Past Gathering",venue_name:"Old Venue",location_name:"456 Oak Ave, Chicago, IL",event_type:"powerwalk",nextStart:Date.now()-ma,attendee_count:8,capacity:null,timezone:"America/Chicago"},{id:"preview6",event_code:"past002",event_name:"Retro Night",venue_name:"Downtown Loft",location_name:"789 Elm St, Portland, OR",event_type:"powerwalk",nextStart:Date.now()-ma*3,attendee_count:15,capacity:null,timezone:"America/Los_Angeles"}],x9=[{creatorUserId:"preview-creator-1",username:"alexruns",events:[Ai[0],Ai[1],Ai[2]]}],Lm=()=>{const e=$s();return d.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),i.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:i.jsxs("div",{className:"text-center",children:[i.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),i.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),i.jsx(Ex,{to:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})},b9=()=>{const{event_code:e}=Wd(),t=e?decodeURIComponent(e):void 0,{user:n,showOnboarding:r,onOnboardingSuccess:s,loading:o,authOpen:a,setAuthOpen:l,onAuthSuccess:c,profileFetched:u,authCleanupInProgress:f,guardAction:p,localUserId:h}=ao(),m=typeof window<"u"&&(window.location.hostname.includes("lovableproject.com")||window.location.hostname.includes("lovable.app")),[v,g]=d.useState("upcoming"),{exists:x,creatorId:w,isLoading:y}=bA(t),{upcomingEvents:b,pastEvents:_,isLoading:k}=xA(t),C=m?!0:x,E=m?!1:y,A=m?Ai:b,T=m?Rd:_,M=m?!1:k,P=m?"preview-creator":w,{hasJoinedEvents:$,hasCreatedEvents:H}=zb(),{isSubscribed:z,handleSubscribe:B,handleConfirmUnsub:U,confirmUnsubOpen:D,setConfirmUnsubOpen:j}=_A({creatorId:P,username:t,localUserId:h,isPreview:m,guardAction:p}),N=mV(xn().color)?"text-foreground":"text-primary";return d.useEffect(()=>{const W=document.documentElement;return W.classList.add("app-shell-locked"),()=>W.classList.remove("app-shell-locked")},[]),C===!1&&!E?i.jsx(Lm,{}):i.jsxs("div",{className:"relative z-10 h-screen flex flex-col overflow-hidden",children:[i.jsx(Kl,{shareUsername:t}),i.jsx("div",{className:"relative flex-1 min-h-0 flex flex-col",children:i.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto pb-20 overscroll-contain",children:[i.jsx("div",{className:"sticky top-0 z-40 bg-background pb-3",children:i.jsx("div",{className:"flex justify-center pt-3 px-4",children:i.jsxs("div",{className:"w-full max-w-[430px] px-4",children:[i.jsxs("div",{className:"flex items-center justify-between gap-3 mb-3",children:[i.jsxs("div",{className:"font-bold text-sm",children:[i.jsx("span",{className:"text-foreground",children:"Host: "}),i.jsx("span",{className:N,children:t})]}),i.jsx(ee,{variant:z?"secondary":"outline",size:"sm",onClick:B,disabled:!P,className:"shrink-0",children:z?"Unsubscribe":"Subscribe"})]}),i.jsxs("div",{className:"flex rounded-lg bg-muted p-1",children:[i.jsx("button",{onClick:()=>g("upcoming"),className:`flex-1 py-2 text-sm font-medium rounded-md transition-colors ${v==="upcoming"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,children:"Upcoming Events"}),i.jsx("button",{onClick:()=>g("past"),className:`flex-1 py-2 text-sm font-medium rounded-md transition-colors ${v==="past"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,children:"Past Events"})]}),i.jsx("div",{className:"flex rounded-lg bg-muted p-1 mt-2",children:i.jsx("button",{onClick:()=>{t&&window.location.assign(mA("staaakemeets",t))},className:"flex-1 py-2 text-sm font-medium rounded-md transition-colors text-muted-foreground hover:text-foreground",children:"All events"})})]})})}),i.jsx("div",{className:"animate-fade-in",children:i.jsx(Vu,{events:v==="upcoming"?A:T,mode:v==="upcoming"?"upcoming":"past",isLoading:M||E})})]})}),i.jsx(ql,{activeTab:"events",onTabChange:()=>{},hasJoinedEvents:$,hasCreatedEvents:H}),n&&r&&u&&!f&&!o&&i.jsx(Mm,{onSuccess:s}),i.jsx(Vc,{open:a,onOpenChange:l,onAuthSuccess:c,mode:"login"}),i.jsx(Rt,{open:D,onOpenChange:j,children:i.jsxs(St,{children:[i.jsxs(Ct,{children:[i.jsx(jt,{children:"Unsubscribe from this host?"}),i.jsx(Nt,{children:"You will no longer see their events in your Subscribed tab."})]}),i.jsxs(Et,{children:[i.jsx(cn,{children:"Cancel"}),i.jsx(ln,{onClick:U,children:"Yes"})]})]})})]})},_9=/^[a-z]{3}[0-9]{4}$/,k9=new Set(["auth","login","logout","callback","oauth","api","privacy","terms","refunds","acceptable-use","favicon.ico","robots.txt","sitemap.xml","index.html"]);function S9(e){return _9.test(e)}function UA(e){const t=e.toLowerCase();return k9.has(t)?!0:/\.[a-z0-9]{2,5}$/i.test(t)}const C9=/^[a-z]{3,8}[0-9]{2,6}$/;function E9(){if(typeof window>"u")return!1;const e=window.location.hostname;return e.includes("lovableproject.com")||e.includes("lovable.app")}function j9(e){return S9(e)?"event":UA(e)?"reserved":E9()&&C9.test(e)?"event":"host"}var Bb="ToastProvider",[Wb,N9,T9]=lm("Toast"),[FA,sG]=vr("Toast",[T9]),[P9,Dm]=FA(Bb),zA=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:o=50,children:a}
404=e,[l,c]=d.useState(null),[u,f]=d.useState(0),p=d.useRef(!1),h=d.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Bb}\`. Expected non-empty \`string\`.`),i.jsx(Wb.Provider,{scope:t,children:i.jsx(P9,{scope:t,label:n,duration:r,swipeDirection:s,swipeThreshold:o,toastCount:u,viewport:l,onViewportChange:c,onToastAdd:d.useCallback(()=>f(m=>m+1),[]),onToastRemove:d.useCallback(()=>f(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:h,children:a})})};zA.displayName=Bb;var BA="ToastViewport",R9=["F8"],xw="toast.viewportPause",bw="toast.viewportResume",WA=d.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=R9,label:s="Notifications ({hotkey})",...o}=e,a=Dm(BA,n),l=N9(n),c=d.useRef(null),u=d.useRef(null),f=d.useRef(null),p=d.useRef(null),h=Pe(t,p,a.onViewportChange),m=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=a.toastCount>0;d.useEffect(()=>{const x=w=>{var b;r.length!==0&&r.every(_=>w[_]||w.code===_)&&((b=p.current)==null||b.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),d.useEffect(()=>{const x=c.current,w=p.current;if(v&&x&&w){const y=()=>{if(!a.isClosePausedRef.current){const C=new CustomEvent(xw);w.dispatchEvent(C),a.isClosePausedRef.current=!0}},b=()=>{if(a.isClosePausedRef.current){const C=new CustomEvent(bw);w.dispatchEvent(C),a.isClosePausedRef.current=!1}},_=C=>{!x.contains(C.relatedTarget)&&b()},k=()=>{x.contains(document.activeElement)||b()};return x.addEventListener("focusin",y),x.addEventListener("focusout",_),x.addEventListener("pointermove",y),x.addEventListener("pointerleave",k),window.addEventListener("blur",y),window.addEventListener("focus",b),()=>{x.removeEventListener("focusin",y),x.removeEventListener("focusout",_),x.removeEventListener("pointermove",y),x.removeEventListener("pointerleave",k),window.removeEventListener("blur",y),window.removeEventListener("focus",b)}}},[v,a.isClosePausedRef]);const g=d.useCallback(({tabbingDirection:x})=>{const y=l().map(b=>{const _=b.ref.current,k=[_,...H9(_)];return x==="forwards"?k:k.reverse()});return(x==="forwards"?y.reverse():y).flat()},[l]);return d.useEffect(()=>{const x=p.current;if(x){const w=y=>{var k,C,E;const b=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!b){const A=document.activeElement,T=y.shiftKey;if(y.target===x&&T){(k=u.current)==null||k.focus();return}const $=g({tabbingDirection:T?"backwards":"forwards"}),H=$.findIndex(z=>z===A);by($.slice(H+1))?y.preventDefault():T?(C=u.current)==null||C.focus():(E=f.current)==null||E.focus()}};return x.addEventListener("keydown",w),()=>x.removeEventListener("keydown",w)}},[l,g]),i.jsxs(s5,{ref:c,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&i.jsx(_w,{ref:u,onFocusFromOutsideViewport:()=>{const x=g({tabbingDirection:"forwards"});by(x)}}),i.jsx(Wb.Slot,{scope:n,children:i.jsx(ve.ol,{tabIndex:-1,...o,ref:h})}),v&&i.jsx(_w,{ref:f,onFocusFromOutsideViewport:()=>{const x=g({tabbingDirection:"backwards"});by(x)}})]})});WA.displayName=BA;var HA="ToastFocusProxy",_w=d.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=e,o=Dm(HA,n);return i.jsx(gm,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:a=>{var u;const l=a.relatedTarget;!((u=o.viewport)!=null&&u.contains(l))&&r()}})});_w.displayName=HA;var of="Toast",A9="toast.swipeStart",I9="toast.swipeMove",O9="toast.swipeCancel",M9="toast.swipeEnd",KA=d.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:o,...a}=e,[l,c]=ro({prop:r,defaultProp:s??!0,onChange:o,caller:of});return i.jsx(Qn,{present:n||l,children:i.jsx($9,{open:l,...a,ref:t,onClose:()=>c(!1),onPause:vn(e.onPause),onResume:vn(e.onResume),onSwipeStart:ie(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ie(e.onSwipeMove,u=>{const{x:f,y:p}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${p}px`)}),onSwipeCancel:ie(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ie(e.onSwipeEnd,u=>{const{x:f,y:p}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${p}px`),c(!1)})})})});KA.displayName=of;var[L9,D9]=FA(of,{onClose(){}}),$9=d.forwardRef((e,t)=>
404{const{__scopeToast:n,type:r="foreground",duration:s,open:o,onClose:a,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:f,onSwipeMove:p,onSwipeCancel:h,onSwipeEnd:m,...v}=e,g=Dm(of,n),[x,w]=d.useState(null),y=Pe(t,z=>w(z)),b=d.useRef(null),_=d.useRef(null),k=s||g.duration,C=d.useRef(0),E=d.useRef(k),A=d.useRef(0),{onToastAdd:T,onToastRemove:M}=g,P=vn(()=>{var B;(x==null?void 0:x.contains(document.activeElement))&&((B=g.viewport)==null||B.focus()),a()}),$=d.useCallback(z=>{!z||z===1/0||(window.clearTimeout(A.current),C.current=new Date().getTime(),A.current=window.setTimeout(P,z))},[P]);d.useEffect(()=>{const z=g.viewport;if(z){const B=()=>{$(E.current),u==null||u()},U=()=>{const D=new Date().getTime()-C.current;E.current=E.current-D,window.clearTimeout(A.current),c==null||c()};return z.addEventListener(xw,U),z.addEventListener(bw,B),()=>{z.removeEventListener(xw,U),z.removeEventListener(bw,B)}}},[g.viewport,k,c,u,$]),d.useEffect(()=>{o&&!g.isClosePausedRef.current&&$(k)},[o,k,g.isClosePausedRef,$]),d.useEffect(()=>(T(),()=>M()),[T,M]);const H=d.useMemo(()=>x?XA(x):null,[x]);return g.viewport?i.jsxs(i.Fragment,{children:[H&&i.jsx(U9,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:H}),i.jsx(L9,{scope:n,onClose:P,children:Bi.createPortal(i.jsx(Wb.ItemSlot,{scope:n,children:i.jsx(r5,{asChild:!0,onEscapeKeyDown:ie(l,()=>{g.isFocusedToastEscapeKeyDownRef.current||P(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:i.jsx(ve.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":g.swipeDirection,...v,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ie(e.onKeyDown,z=>{z.key==="Escape"&&(l==null||l(z.nativeEvent),z.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,P()))}),onPointerDown:ie(e.onPointerDown,z=>{z.button===0&&(b.current={x:z.clientX,y:z.clientY})}),onPointerMove:ie(e.onPointerMove,z=>{if(!b.current)return;const B=z.clientX-b.current.x,U=z.clientY-b.current.y,D=!!_.current,j=["left","right"].includes(g.swipeDirection),N=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,W=j?N(0,B):0,G=j?0:N(0,U),L=z.pointerType==="touch"?10:2,K={x:W,y:G},J={originalEvent:z,delta:K};D?(_.current=K,Xf(I9,p,J,{discrete:!1})):hS(K,g.swipeDirection,L)?(_.current=K,Xf(A9,f,J,{discrete:!1}),z.target.setPointerCapture(z.pointerId)):(Math.abs(B)>L||Math.abs(U)>L)&&(b.current=null)}),onPointerUp:ie(e.onPointerUp,z=>{const B=_.current,U=z.target;if(U.hasPointerCapture(z.pointerId)&&U.releasePointerCapture(z.pointerId),_.current=null,b.current=null,B){const D=z.currentTarget,j={originalEvent:z,delta:B};hS(B,g.swipeDirection,g.swipeThreshold)?Xf(M9,m,j,{discrete:!0}):Xf(O9,h,j,{discrete:!0}),D.addEventListener("click",N=>N.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),U9=e=>{const{__scopeToast:t,children:n,...r}=e,s=Dm(of,t),[o,a]=d.useState(!1),[l,c]=d.useState(!1);return B9(()=>a(!0)),d.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:i.jsx(Wc,{asChild:!0,children:i.jsx(gm,{...r,children:o&&i.jsxs(i.Fragment,{children:[s.label," ",n]})})})},F9="ToastTitle",qA=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return i.jsx(ve.div,{...r,ref:t})});qA.displayName=F9;var z9="ToastDescription",VA=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return i.jsx(ve.div,{...r,ref:t})});VA.displayName=z9;var YA="ToastAction",GA=d.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?i.jsx(QA,{altText:n,asChild:!0,children:i.jsx(Hb,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${YA}\`. Expected non-empty \`string\`.`),null)});GA.displayName=YA;var JA="ToastClose",Hb=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,s=D9(JA,n);return i.jsx(QA,{asChild:!0,children:i.jsx(ve.button,{type:"button",...r,ref:t,onClick:ie(e.onClick,s.onClose)})})});Hb.displayName=JA;var QA=d.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...s}=e;return i.jsx(ve.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:t})});function XA(e){const t=[];
404return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),W9(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",o=r.dataset.radixToastAnnounceExclude==="";if(!s)if(o){const a=r.dataset.radixToastAnnounceAlt;a&&t.push(a)}else t.push(...XA(r))}}),t}function Xf(e,t,n,{discrete:r}){const s=n.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?Kx(s,o):s.dispatchEvent(o)}var hS=(e,t,n=0)=>{const r=Math.abs(e.x),s=Math.abs(e.y),o=r>s;return t==="left"||t==="right"?o&&r>n:!o&&s>n};function B9(e=()=>{}){const t=vn(e);jn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function W9(e){return e.nodeType===e.ELEMENT_NODE}function H9(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function by(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var K9=zA,ZA=WA,eI=KA,tI=qA,nI=VA,rI=GA,sI=Hb;const q9=K9,oI=d.forwardRef(({className:e,...t},n)=>i.jsx(ZA,{ref:n,className:X("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));oI.displayName=ZA.displayName;const V9=Nx("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),iI=d.forwardRef(({className:e,variant:t,...n},r)=>i.jsx(eI,{ref:r,className:X(V9({variant:t}),e),...n}));iI.displayName=eI.displayName;const Y9=d.forwardRef(({className:e,...t},n)=>i.jsx(rI,{ref:n,className:X("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));Y9.displayName=rI.displayName;const aI=d.forwardRef(({className:e,...t},n)=>i.jsx(sI,{ref:n,className:X("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:i.jsx($c,{className:"h-4 w-4"})}));aI.displayName=sI.displayName;const lI=d.forwardRef(({className:e,...t},n)=>i.jsx(tI,{ref:n,className:X("text-sm font-semibold",e),...t}));lI.displayName=tI.displayName;const cI=d.forwardRef(({className:e,...t},n)=>i.jsx(nI,{ref:n,className:X("text-sm opacity-90",e),...t}));cI.displayName=nI.displayName;function uI(){const{toasts:e}=kq();return i.jsxs(q9,{children:[e.map(function({id:t,title:n,description:r,action:s,...o}){return i.jsxs(iI,{...o,children:[i.jsxs("div",{className:"grid gap-1",children:[n&&i.jsx(lI,{children:n}),r&&i.jsx(cI,{children:r})]}),s,i.jsx(aI,{})]},t)}),i.jsx(oI,{})]})}var pS=["light","dark"],G9="(prefers-color-scheme: dark)",J9=d.createContext(void 0),Q9={setTheme:e=>{},themes:[]},X9=()=>{var e;return(e=d.useContext(J9))!=null?e:Q9};d.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:o,value:a,attrs:l,nonce:c})=>{let u=o==="system",f=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(v=>`'${v}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,p=s?pS.includes(o)&&o?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${o}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",h=(v,g=!1,x=!0)=>{let w=a?a[v]:v,y=g?v+"|| ''":`'${w}'`,b="";return s&&x&&!g&&pS.includes(v)&&(b+=`d.style.colorScheme = '${v}';`),n==="class"?g||w?b+=`c.add(${y})`:b+="null":w&&(b+=`d[s](n,${y})`),b},m=e?`!function(){${f}${h(e)}}()`:r?`!function(){try{${f}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${G9}',m=window.matchMedia(t);if(m.media!==t||m.matches){${h("dark")}}else{${h("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${h(a?"x[e]":"e",!0)}}${u?"":"else{"+h(o,!1,!1)+"}"}${p}}catch(e){}}()`:`!function(){try{${f}var e=localStorage.getItem('${t}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${h(a?"x[e]":"e",!0)}}else{${h(o,!1,!1)};}${p}}catch(t){}}();`;return d.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:m}})});const dI=({...e})=>{const{theme:t="system"}=X9();return i.jsx(QF,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};function Z9(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var Kb="ScrollArea",[fI,oG]=vr(Kb),[eY,ms]=fI(Kb),hI=d.forwardRef((e,t)=>
vendor: 13,424 bytes, line 404
404{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:o=600,...a}=e,[l,c]=d.useState(null),[u,f]=d.useState(null),[p,h]=d.useState(null),[m,v]=d.useState(null),[g,x]=d.useState(null),[w,y]=d.useState(0),[b,_]=d.useState(0),[k,C]=d.useState(!1),[E,A]=d.useState(!1),T=Pe(t,P=>c(P)),M=cm(s);return i.jsx(eY,{scope:n,type:r,dir:M,scrollHideDelay:o,scrollArea:l,viewport:u,onViewportChange:f,content:p,onContentChange:h,scrollbarX:m,onScrollbarXChange:v,scrollbarXEnabled:k,onScrollbarXEnabledChange:C,scrollbarY:g,onScrollbarYChange:x,scrollbarYEnabled:E,onScrollbarYEnabledChange:A,onCornerWidthChange:y,onCornerHeightChange:_,children:i.jsx(ve.div,{dir:M,...a,ref:T,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":b+"px",...e.style}})})});hI.displayName=Kb;var pI="ScrollAreaViewport",mI=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:s,...o}=e,a=ms(pI,n),l=d.useRef(null),c=Pe(t,l,a.onViewportChange);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),i.jsx(ve.div,{"data-radix-scroll-area-viewport":"",...o,ref:c,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:i.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});mI.displayName=pI;var co="ScrollAreaScrollbar",qb=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=ms(co,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:a}=s,l=e.orientation==="horizontal";return d.useEffect(()=>(l?o(!0):a(!0),()=>{l?o(!1):a(!1)}),[l,o,a]),s.type==="hover"?i.jsx(tY,{...r,ref:t,forceMount:n}):s.type==="scroll"?i.jsx(nY,{...r,ref:t,forceMount:n}):s.type==="auto"?i.jsx(gI,{...r,ref:t,forceMount:n}):s.type==="always"?i.jsx(Vb,{...r,ref:t}):null});qb.displayName=co;var tY=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=ms(co,e.__scopeScrollArea),[o,a]=d.useState(!1);return d.useEffect(()=>{const l=s.scrollArea;let c=0;if(l){const u=()=>{window.clearTimeout(c),a(!0)},f=()=>{c=window.setTimeout(()=>a(!1),s.scrollHideDelay)};return l.addEventListener("pointerenter",u),l.addEventListener("pointerleave",f),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",u),l.removeEventListener("pointerleave",f)}}},[s.scrollArea,s.scrollHideDelay]),i.jsx(Qn,{present:n||o,children:i.jsx(gI,{"data-state":o?"visible":"hidden",...r,ref:t})})}),nY=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=ms(co,e.__scopeScrollArea),o=e.orientation==="horizontal",a=Um(()=>c("SCROLL_END"),100),[l,c]=Z9("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return d.useEffect(()=>{if(l==="idle"){const u=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[l,s.scrollHideDelay,c]),d.useEffect(()=>{const u=s.viewport,f=o?"scrollLeft":"scrollTop";if(u){let p=u[f];const h=()=>{const m=u[f];p!==m&&(c("SCROLL"),a()),p=m};return u.addEventListener("scroll",h),()=>u.removeEventListener("scroll",h)}},[s.viewport,o,c,a]),i.jsx(Qn,{present:n||l!=="hidden",children:i.jsx(Vb,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:ie(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:ie(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),gI=d.forwardRef((e,t)=>{const n=ms(co,e.__scopeScrollArea),{forceMount:r,...s}=e,[o,a]=d.useState(!1),l=e.orientation==="horizontal",c=Um(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,f=n.viewport.offsetHeight<n.viewport.scrollHeight;a(l?u:f)}},10);return Ac(n.viewport,c),Ac(n.content,c),i.jsx(Qn,{present:r||o,children:i.jsx(Vb,{"data-state":o?"visible":"hidden",...s,ref:t})})}),Vb=d.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,s=ms(co,e.__scopeScrollArea),o=d.useRef(null),a=d.useRef(0),[l,c]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=bI(l.viewport,l.content),f={...r,sizes:l,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:h=>o.current=h,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:h=>a.current=h};function p(h,m){return lY(h,a.current,l,m)}return n==="horizontal"?i.jsx(rY,{...f,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const h=s.viewport.scrollLeft,m=mS(h,l,s.dir);o.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:h=>{s.viewport&&(s.viewport.scrollLeft=h)},onDragScroll:h=>{s.viewport&&(s.viewport.scrollLeft=p(h,s.dir))}}):n==="vertical"?i.jsx(sY,{...f,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const h=s.viewport.scrollTop,m=mS(h,l);o.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:h=>{s.viewport&&(s.viewport.scrollTop=h)},onDragScroll:h=>{s.viewport&&(s.viewport.scrollTop=p(h))}}):null}),rY=d.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,o=ms(co,e.__scopeScrollArea),[a,l]=d.useState(),c=d.useRef(null),u=Pe(t,c,o.onScrollbarXChange);return d.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),i.jsx(vI,{"data-orientation":"horizontal",...s,ref:u,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":$m(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,p)=>{if(o.viewport){const h=o.viewport.scrollLeft+f.deltaX;e.onWheelScroll(h),kI(h,p)&&f.preventDefault()}},onResize:()=>{c.current&&o.viewport&&a&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:jp(a.paddingLeft),paddingEnd:jp(a.paddingRight)}})}})}),sY=d.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,o=ms(co,e.__scopeScrollArea),[a,l]=d.useState(),c=d.useRef(null),u=Pe(t,c,o.onScrollbarYChange);return d.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),i.jsx(vI,{"data-orientation":"vertical",...s,ref:u,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":$m(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,p)=>{if(o.viewport){const h=o.viewport.scrollTop+f.deltaY;e.onWheelScroll(h),kI(h,p)&&f.preventDefault()}},onResize:()=>{c.current&&o.viewport&&a&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:jp(a.paddingTop),paddingEnd:jp(a.paddingBottom)}})}})}),[oY,yI]=fI(co),vI=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:o,onThumbPointerUp:a,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:f,onResize:p,...h}=e,m=ms(co,n),[v,g]=d.useState(null),x=Pe(t,T=>g(T)),w=d.useRef(null),y=d.useRef(""),b=m.viewport,_=r.content-r.viewport,k=vn(f),C=vn(c),E=Um(p,10);function A(T){if(w.current){const M=T.clientX-w.current.left,P=T.clientY-w.current.top;u({x:M,y:P})}}return d.useEffect(()=>{const T=M=>{const P=M.target;(v==null?void 0:v.contains(P))&&k(M,_)};return document.addEventListener("wheel",T,{passive:!1}),()=>document.removeEventListener("wheel",T,{passive:!1})},[b,v,_,k]),d.useEffect(C,[r,C]),Ac(v,E),Ac(m.content,E),i.jsx(oY,{scope:n,scrollbar:v,hasThumb:s,onThumbChange:vn(o),onThumbPointerUp:vn(a),onThumbPositionChange:C,onThumbPointerDown:vn(l),children:i.jsx(ve.div,{...h,ref:x,style:{position:"absolute",...h.style},onPointerDown:ie(e.onPointerDown,T=>{T.button===0&&(T.target.setPointerCapture(T.pointerId),w.current=v.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),A(T))}),onPointerMove:ie(e.onPointerMove,A),onPointerUp:ie(e.onPointerUp,T=>{const M=T.target;M.hasPointerCapture(T.pointerId)&&M.releasePointerCapture(T.pointerId),document.body.style.webkitUserSelect=y.current,m.viewport&&(m.viewport.style.scrollBehavior=""),w.current=null})})})}),Ep="ScrollAreaThumb",wI=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=yI(Ep,e.__scopeScrollArea);return i.jsx(Qn,{present:n||s.hasThumb,children:i.jsx(iY,{ref:t,...r})})}),iY=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...s}=e,o=ms(Ep,n),a=yI(Ep,n),{onThumbPositionChange:l}=a,c=Pe(t,p=>a.onThumbChange(p)),u=d.useRef(void 0),f=Um(()=>{u.current&&(u.current(),u.current=void 0)},100);return d.useEffect(()=>{const p=o.viewport;if(p){const h=()=>{if(f(),!u.current){const m=cY(p,l);u.current=m,l()}};return l(),p.addEventListener("scroll",h),()=>p.removeEventListener("scroll",h)}},[o.viewport,f,l]),i.jsx(ve.div,{"data-state":a.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:ie(e.onPointerDownCapture,p=>{const m=p.target.getBoundingClientRect(),v=p.clientX-m.left,g=p.clientY-m.top;a.onThumbPointerDown({x:v,y:g})}),onPointerUp:ie(e.onPointerUp,a.onThumbPointerUp)})});wI.displayName=Ep;var Yb="ScrollAreaCorner",xI=d.forwardRef((e,t)=>{const n=ms(Yb,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?i.jsx(aY,{...e,ref:t}):null});xI.displayName=Yb;var aY=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,s=ms(Yb,n),[o,a]=d.useState(0),[l,c]=d.useState(0),u=!!(o&&l);return Ac(s.scrollbarX,()=>{var p;const f=((p=s.scrollbarX)==null?void 0:p.offsetHeight)||0;s.onCornerHeightChange(f),c(f)}),Ac(s.scrollbarY,()=>{var p;const f=((p=s.scrollbarY)==null?void 0:p.offsetWidth)||0;s.onCornerWidthChange(f),a(f)}),u?i.jsx(ve.div,{...r,ref:t,style:{width:o,height:l,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function jp(e){return e?parseInt(e,10):0}function bI(e,t){const n=e/t;return isNaN(n)?0:n}function $m(e){const t=bI(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function lY(e,t,n,r="ltr"){const s=$m(n),o=s/2,a=t||o,l=s-a,c=n.scrollbar.paddingStart+a,u=n.scrollbar.size-n.scrollbar.paddingEnd-l,f=n.content-n.viewport,p=r==="ltr"?[0,f]:[f*-1,0];return _I([c,u],p)(e)}function mS(e,t,n="ltr"){const r=$m(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-s,a=t.content-t.viewport,l=o-r,c=n==="ltr"?[0,a]:[a*-1,0],u=Qv(e,c);return _I([0,a],[0,l])(u)}function _I(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function kI(e,t){return e>0&&e<t}var cY=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function s(){const o={left:e.scrollLeft,top:e.scrollTop},a=n.left!==o.left,l=n.top!==o.top;(a||l)&&t(),n=o,r=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(r)};function Um(e,t){const n=vn(e),r=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(r.current),[]),d.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Ac(e,t){const n=vn(t);jn(()=>{let r=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(e),()=>{window.cancelAnimationFrame(r),s.unobserve(e)}}},[e,n])}var SI=hI,uY=mI,dY=xI;const CI=d.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(SI,{ref:r,className:X("relative overflow-hidden",e),...n,children:[i.jsx(uY,{className:"h-full w-full rounded-[inherit]",children:t}),i.jsx(EI,{}),i.jsx(dY,{})]}));CI.displayName=SI.displayName;const EI=d.forwardRef(({className:e,orientation:t="vertical",...n},r)=>i.jsx(qb,{ref:r,orientation:t,className:X("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:i.jsx(wI,{className:"relative flex-1 rounded-full bg-border"})}));EI.displayName=qb.displayName;function fY(e,t){var s,o;const n=((s=e==null?void 0:e.charAt(0))==null?void 0:s.toUpperCase())??"",r=((o=t==null?void 0:t.charAt(0))==null?void 0:o.toUpperCase())??"";return n+r||"?"}function hY(e){if(!e)return"";const t=Date.now(),n=new Date(e).getTime(),r=t-n,s=Math.floor(r/6e4);if(s<1)return"just now";if(s<60)return`${s} min ago`;const o=Math.floor(s/60);if(o<24)return`${o} h ago`;const a=Math.floor(o/24);return a===1?"yesterday":a<7?`${a} days ago`:new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"})}const pY=({open:e,onOpenChange:t,subscribers:n,loading:r})=>i.jsx(ot,{open:e,onOpenChange:t,children:i.jsxs(et,{className:"sm:max-w-md",children:[i.jsx(Tt,{children:i.jsx(vt,{className:"text-lg font-semibold",children:"My subscribers"})}),i.jsx(CI,{className:"max-h-[60vh]",children:r?i.jsx("div",{className:"py-8 text-center text-sm text-muted-foreground",children:"Loading…"}):n.length===0?i.jsx("div",{className:"py-8 text-center text-sm text-muted-foreground",children:"No subscribers, create an event to get subscribers"}):i.jsx("div",{className:"flex flex-col gap-2",children:n.map((s,o)=>
404{const a=[s.first_name,s.last_name].filter(Boolean).join(" ")||"Unknown";return i.jsxs("div",{className:"flex items-center gap-3 rounded-lg px-3 py-2 hover:bg-muted/50 transition-colors",children:[i.jsx(km,{className:"h-9 w-9 cursor-pointer shrink-0",onClick:()=>{s.username&&AP(s.username)},children:i.jsx(Sm,{className:"text-xs font-medium bg-primary/10 text-primary",children:fY(s.first_name,s.last_name)})}),i.jsx("div",{className:"flex-1 min-w-0",children:i.jsx("span",{className:"text-sm font-medium text-foreground truncate block",children:a})}),i.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:hY(s.created_at)})]},o)})})})]})});function mY(e){if(typeof e!="string")return null;const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return null;const n=+t[1],r=+t[2],s=+t[3],o=new Date;let a=o.getFullYear()-n;return(o.getMonth()+1<r||o.getMonth()+1===r&&o.getDate()<s)&&(a-=1),a}function gY(e){if(!e)return null;const t=e.over_18,n=e.age;if(t===!0||typeof n=="number"&&n>=18)return"adult";const r=mY(e.dob);return r!==null&&r>=18?"adult":t===!1||typeof n=="number"&&n<18||r!==null&&r<18?"minor":null}const yY="https://errlhmcitfpyyhnwtqrs.supabase.co";function Fm(){const{user:e,localUserId:t}=ao(),n=xn().siteKey==="inpersondates",r=n&&!!e&&!!t,{data:s,isFetched:o}=Wt({queryKey:["viewer-dating-profile",t],queryFn:async()=>{const{data:{session:a}}=await pe.auth.getSession();if(!(a!=null&&a.access_token))return null;const l=await fetch(`${yY}/functions/v1/get-dating-profile`,{headers:{Authorization:`Bearer ${a.access_token}`}});if(!l.ok)return null;const c=await l.json();return(c==null?void 0:c.profile)??null},enabled:r,staleTime:6e4});return n?r?{bucket:gY(s),isReady:o}:{bucket:null,isReady:!0}:{bucket:null,isReady:!0}}function zm(e,t){const n=[...new Set((e??[]).filter(Boolean))].sort(),{data:r,isFetched:s}=Wt({queryKey:["creator-age-buckets",n],queryFn:async()=>{if(n.length===0)return[];const{data:a,error:l}=await wn.rpc("get_creator_age_buckets",{creator_ids:n});if(l)throw l;return a??[]},enabled:t&&n.length>0,staleTime:6e4}),o=new Map;for(const a of r??[])o.set(a.creator_id,a.bucket);return t?n.length===0?{buckets:o,isReady:!0}:{buckets:o,isReady:s}:{buckets:o,isReady:!0}}const gS=e=>e==="male"?"men":e==="female"?"women":null;function jI(e){if(!(e!=null&&e.gender)||!(e!=null&&e.interested_in))return null;const t=e.gender==="male"?"M":"F",n=e.interested_in==="women"?"F":"M";return`${t}4${n}`}function Gb(e,t){return!(e!=null&&e.gender)||!(e!=null&&e.interested_in)||!(t!=null&&t.gender)||!(t!=null&&t.interested_in)?!1:gS(t.gender)===e.interested_in&&gS(e.gender)===t.interested_in}function vY(e){if(!e)return null;const t=e.gender??null,n=e.interested_in??null;return{gender:t==="male"||t==="female"?t:null,interested_in:n==="men"||n==="women"?n:null}}function Bm(){const e=xn().siteKey==="inpersondates",{profile:t,isReady:n}=Tm();return e?{profile:vY(t),isReady:n}:{profile:null,isReady:!0}}function Wm(e,t){const n=[...new Set((e??[]).filter(Boolean))].sort(),{data:r,isFetched:s}=Wt({queryKey:["creator-match-profiles",n],queryFn:async()=>{if(n.length===0)return[];const{data:a,error:l}=await wn.rpc("get_creator_match_profiles",{creator_ids:n});if(l)throw l;return a??[]},enabled:t&&n.length>0,staleTime:6e4}),o=new Map;for(const a of r??[]){const l=a.gender,c=a.interested_in;o.set(a.creator_id,{gender:l==="male"||l==="female"?l:null,interested_in:c==="men"||c==="women"?c:null})}return t?n.length===0?{profiles:o,isReady:!0}:{profiles:o,isReady:s}:{profiles:o,isReady:!0}}const Wr=typeof window<"u"&&(window.location.hostname.includes("lovableproject.com")||window.location.hostname.includes("lovable.app")),wY=[{first_name:"Alex",last_name:"Chen",username:"alexchen",created_at:new Date(Date.now()-1e3*60*23).toISOString()},{first_name:"Maria",last_name:"Lopez",username:"marialopez",created_at:new Date(Date.now()-1e3*60*60*5).toISOString()},{first_name:"James",last_name:"Wright",username:"jamesw",created_at:new Date(Date.now()-1e3*60*60*24*2).toISOString()},{first_name:"Priya",last_name:"Sharma",username:"priyasharma",created_at:new Date(Date.now()-1e3*60*60*24*7).toISOString()}],yS="https://errlhmcitfpyyhnwtqrs.supabase.co",xY="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImVycmxobWNpdGZweXlobnd0cXJzIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzIyOTY1NDcsImV4cCI6MjA4Nzg3MjU0N30.Vg5RxV3TAd2PGJ6pwFjMYEds0EtO_yQ07EbX5B_p7WU",bY=()=>{const{user:e,localUserId:t,isAdmin:n}=ao(),r=Wi(),[s,o]=d.useState(!1),{data:a=[],isFetching:l}=Wt({queryKey:["creator_follows",t],enabled:!!e&&!Wr,queryFn:async()=>{const{data:{session:P}}=await pe.auth.getSession();if(!(P!=null&&P.access_token))return[];const $=await fetch(`${yS}/functions/v1/get-follows`,{headers:{Authorization:`Bearer ${P.access_token}`,apikey:xY}});return $.ok?$.json():[]},staleTime:3e4,placeholderData:P=>P}
404),c=xn().siteKey==="inpersondates",{bucket:u,isReady:f}=Fm(),p=a.map(P=>P.creatorUserId).filter(Boolean),{buckets:h,isReady:m}=zm(p,c&&!Wr&&!n),{profile:v,isReady:g}=Bm(),{profiles:x,isReady:w}=Wm(p,c&&!Wr&&!n),y=c&&t&&!n?a.filter(P=>P.creatorUserId!==t):a,b=c&&!Wr&&!n?f&&m&&g&&w&&u&&v?y.filter(P=>h.get(P.creatorUserId)!==u?!1:Gb(v,x.get(P.creatorUserId)??null)):[]:y,{data:_=[],isLoading:k}=Wt({queryKey:["my-subscribers"],enabled:!!e&&!Wr,queryFn:async()=>{const{data:{session:P}}=await pe.auth.getSession();if(!(P!=null&&P.access_token))return[];const $=await fetch(`${yS}/functions/v1/get-subscribers`,{headers:{Authorization:`Bearer ${P.access_token}`}});return $.ok?$.json():[]},staleTime:6e4,placeholderData:P=>P}),C=Wr?wY:_,E=Wr?!1:k;if(!e&&!Wr)return i.jsx("div",{className:"h-full flex items-center justify-center",children:i.jsx("p",{className:"text-muted-foreground text-sm",children:"Sign in to see your subscriptions."})});const T=(Wr?x9:b).map(P=>i.jsx("button",{onClick:()=>r(`/${P.username}`),className:"w-full flex items-center justify-between px-4 py-3 rounded-xl border-2 border-border/60 bg-card hover:border-primary/50 transition-all duration-200 cursor-pointer",children:i.jsx("span",{className:"font-semibold text-sm text-foreground",children:P.username})},P.creatorUserId)),M=Wr?!1:b.length===0&&!l;return i.jsxs("div",{className:"h-full overflow-y-auto pt-4",children:[i.jsxs("div",{className:"w-full max-w-[430px] mx-auto px-4 space-y-2 pb-24",children:[(e||Wr)&&i.jsx("button",{onClick:()=>o(!0),className:"w-full flex items-center justify-between px-4 py-3 rounded-xl border-2 border-border/60 bg-card hover:border-primary/50 transition-all duration-200 cursor-pointer",children:i.jsx("span",{className:"font-semibold text-sm text-foreground",children:"My subscribers"})}),l&&b.length===0&&!Wr&&i.jsx("p",{className:"text-center text-muted-foreground text-sm py-4",children:"Loading..."}),T,M&&i.jsx("p",{className:"text-center text-muted-foreground text-sm py-8",children:"No subscriptions yet."})]}),(e||Wr)&&s&&i.jsx(pY,{open:s,onOpenChange:o,subscribers:C,loading:E})]})},_Y={usa:"USA",uk:"UK",uae:"UAE"},vS=e=>_Y[e.trim().toLowerCase()]??e,kY=({open:e,onOpenChange:t,events:n,onApply:r,onClear:s,activeCountry:o,activeCity:a})=>{const[l,c]=d.useState(""),[u,f]=d.useState(""),[p,h]=d.useState("country");d.useEffect(()=>{e&&(o?(c(o),h("city"),f(a)):(c(""),f(""),h("country")))},[e,o,a]);const{countries:m,citiesByCountry:v}=d.useMemo(()=>{const b={};for(const _ of n){const{country:k,city:C}=Wx(_.location_name);k&&(b[k]||(b[k]=new Set),C&&b[k].add(C))}return{countries:Object.keys(b).sort(),citiesByCountry:Object.fromEntries(Object.entries(b).map(([_,k])=>[_,[...k].sort()]))}},[n]),g=b=>{c(b),f("");const _=v[b]||[];_.length<=1&&f(_[0]||""),h("city")},x=()=>{r(l,u),t(!1)},w=()=>{s(),t(!1)},y=v[l]||[];return i.jsx(ot,{open:e,onOpenChange:t,children:i.jsxs(et,{className:"sm:max-w-[380px]",children:[i.jsx(Tt,{children:i.jsx(vt,{className:"text-center",children:p==="country"?"Filter by location":"Select city"})}),p==="country"?i.jsxs("div",{className:"space-y-1 max-h-[300px] overflow-y-auto",children:[m.length===0&&i.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No locations available"}),m.map(b=>i.jsxs("button",{onClick:()=>g(b),className:"w-full flex items-center justify-between px-3 py-2.5 rounded-lg text-sm font-medium text-foreground hover:bg-muted transition-colors capitalize",children:[i.jsx("span",{children:vS(b)}),l===b&&i.jsx(es,{className:"w-4 h-4 text-primary"})]},b))]}):i.jsxs("div",{className:"space-y-1",children:[i.jsxs("button",{onClick:()=>{h("country"),f("")},className:"flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors mb-2",children:[i.jsx(SE,{className:"w-4 h-4"}),i.jsx("span",{className:"capitalize",children:vS(l)})]}),y.length>1?i.jsx("div",{className:"space-y-1 max-h-[250px] overflow-y-auto",children:y.map(b=>i.jsxs("button",{onClick:()=>f(b),className:"w-full flex items-center justify-between px-3 py-2.5 rounded-lg text-sm font-medium text-foreground hover:bg-muted transition-colors capitalize",children:[i.jsx("span",{children:b}),u===b&&i.jsx(es,{className:"w-4 h-4 text-primary"})]},b))}):i.jsx("p",{className:"text-sm text-muted-foreground px-3 py-2 capitalize",children:y[0]||"No city data"}),i.jsxs("div",{className:"flex gap-2 pt-3",children:[i.jsx(ee,{variant:"outline",className:"flex-1",onClick:w,children:"Clear"}),i.jsx(ee,{className:"flex-1",onClick:x,children:"Apply"})]})]}),p==="country"&&(o||a)&&i.jsx("div",{className:"pt-1",children:i.jsx(ee,{variant:"outline",className:"w-full",onClick:w,children:"Clear filter"})})]})})},SY=typeof window<"u"&&(window.location.hostname.includes("lovableproject.com")||window.location.hostname.includes("lovable.app")),NI=e=>["events",e??"all",pt().event_type];async function TI(e){let t=wn.from("events").select("id, event_code, event_name, venue_name, location_name, event_type, stake_required, capacity, timezone, creator_id, custom_image_url, custom_duration_minutes, event_dates(id, start_time, join_url, overrides), event_polls(id, event_date_id)");
404e&&(t=t.eq("creator_id",e)),t=t.eq("status","active"),e||(t=t.eq("visibility","public"));const n=pt();n.singleEventType&&n.event_type&&(t=t.eq("event_type",n.event_type));const{data:r,error:s}=await t;if(s)throw s;return r}function wS(e={}){if(SY)return{upcomingEvents:Ai,pastEvents:Rd,allEvents:[...Ai,...Rd],isLoading:!1};const{creatorId:t,enabled:n=!0}=e,{data:r,isLoading:s}=Wt({queryKey:NI(t),staleTime:6e4,enabled:n,queryFn:()=>TI(t)}),o=(r??[]).flatMap(B=>(B.event_dates??[]).map(U=>U.id)),{data:a}=Pm(o),l=pt().siteKey==="inpersondates",{isAdmin:c,localUserId:u,user:f}=Fo(),p=!!f&&!!u,{bucket:h,isReady:m}=Fm(),v=(r??[]).map(B=>B.creator_id).filter(Boolean),{buckets:g,isReady:x}=zm(v,l&&!c);Bm();const{profiles:w,isReady:y}=Wm(v,l),b=Date.now(),_=l&&!!t&&!!u&&t===u,C=s||l&&!c&&!_&&!(p?m&&x&&h:x),E=(r??[]).flatMap(B=>!B.event_dates||B.event_dates.length===0?[]:B.event_dates.map(U=>{const D=new Date(U.start_time).getTime(),j=a==null?void 0:a.get(U.id),N=em(B,U);return{id:`${B.id}-${D}`,event_code:B.event_code,event_name:N.event_name,venue_name:N.venue_name,location_name:N.location_name,event_type:B.event_type,stake_required:B.stake_required??!1,capacity:N.capacity??null,timezone:B.timezone,nextStart:D,attendee_count:(j==null?void 0:j.total)??0,eventDateId:U.id,join_url:U.join_url??null,creator_id:B.creator_id,custom_image_url:N.custom_image_url??null,custom_duration_minutes:N.custom_duration_minutes??null,hasPolls:(B.event_polls??[]).some(W=>W.event_date_id===U.id||W.event_date_id==null),creator_direction:l?jI(w.get(B.creator_id)??null):null,_isUpcoming:D>b}})),A=p?h:"adult",P=l&&!c&&!_?(p?m&&x&&!!h:x)?E.filter(B=>{if(!B.creator_id)return!1;if(u&&B.creator_id===u)return!0;const U=g.get(B.creator_id);return!!U&&U===A}):[]:E,$=P.filter(B=>B._isUpcoming).sort((B,U)=>B.nextStart-U.nextStart),H=P.filter(B=>!B._isUpcoming).sort((B,U)=>U.nextStart-B.nextStart),z=[...$,...H];return{upcomingEvents:$,pastEvents:H,allEvents:z,isLoading:C}}function CY(e){const t=typeof window<"u"&&(window.location.hostname.includes("lovableproject.com")||window.location.hostname.includes("lovable.app")),{data:n,isLoading:r}=Wt({queryKey:["going-events",e,pt().event_type],staleTime:6e4,queryFn:async()=>{const{data:T,error:M}=await wn.from("event_attendees").select("event_id, event_date_id").eq("user_id",e);if(M)throw M;if(!T||T.length===0)return{events:[],rsvpDateIds:new Set};const P=[...new Set(T.map(D=>D.event_id))],$=new Set(T.map(D=>D.event_date_id).filter(Boolean));let H=wn.from("events").select("id, event_code, event_name, venue_name, location_name, event_type, capacity, timezone, creator_id, event_dates(id, start_time), event_polls(id, event_date_id)").in("id",P).eq("status","active");const z=pt();z.singleEventType&&z.event_type&&(H=H.eq("event_type",z.event_type));const{data:B,error:U}=await H;if(U)throw U;return{events:B??[],rsvpDateIds:$}},enabled:!!e&&!t}),s=(n==null?void 0:n.events)??[],o=(n==null?void 0:n.rsvpDateIds)??new Set,a=[...o],{data:l}=Pm(a),c=pt().siteKey==="inpersondates",{isAdmin:u}=Fo(),{bucket:f,isReady:p}=Fm(),h=s.map(T=>T.creator_id).filter(Boolean),{buckets:m,isReady:v}=zm(h,c&&!u),{profile:g,isReady:x}=Bm(),{profiles:w,isReady:y}=Wm(h,c),b=Date.now(),_=s.flatMap(T=>!T.event_dates||T.event_dates.length===0?[]:T.event_dates.filter(M=>o.has(M.id)).map(M=>{const P=new Date(M.start_time).getTime(),$=l==null?void 0:l.get(M.id);return{id:`${T.id}-${P}`,event_code:T.event_code,event_name:T.event_name,venue_name:T.venue_name,location_name:T.location_name,event_type:T.event_type||"",capacity:T.capacity??null,timezone:T.timezone,nextStart:P,attendee_count:($==null?void 0:$.total)??0,eventDateId:M.id,creator_id:T.creator_id,hasPolls:(T.event_polls??[]).some(H=>H.event_date_id===M.id||H.event_date_id==null),creator_direction:c?jI(w.get(T.creator_id)??null):null,_isUpcoming:P>b}})),k=c&&!u?p&&v&&x&&y&&f&&g?_.filter(T=>{if(!T.creator_id)return!1;const M=m.get(T.creator_id);return!M||M!==f?!1:Gb(g,w.get(T.creator_id)??null)}):[]:_,C=c&&e&&!u?k.filter(T=>T.creator_id!==e):k,E=C.filter(T=>T._isUpcoming).sort((T,M)=>T.nextStart-M.nextStart),A=C.filter(T=>!T._isUpcoming).sort((T,M)=>M.nextStart-T.nextStart);return{upcomingEvents:E,pastEvents:A,isLoading:r}}const EY=[{delay:"0s",top:"30%",size:16,duration:"6s"},{delay:"1.2s",top:"55%",size:20,duration:"7s"},{delay:"2.4s",top:"42%",size:14,duration:"5.5s"},{delay:"3.6s",top:"62%",size:18,duration:"6.5s"},{delay:"4.8s",top:"38%",size:15,duration:"6s"}],jY=()=>i.jsxs("div",{className:"fixed inset-0 z-[55] bg-background flex flex-col items-center justify-center overflow-hidden",children:[i.jsx("style",{children:`
405        @keyframes ipd-heart-drift {
406          0% { transform: translateX(-10vw); opacity: 0; }
407          15% { opacity: 0.85; }
408          85% { opacity: 0.85; }
409          100% { transform: translateX(110vw); opacity: 0; }
410        }
411      `}),i.jsx("div",{className:"absolute inset-x-0 top-1/2 -translate-y-1/2 h-40 pointer-events-none",children:EY.map((e,t)=>i.jsx(WL,{className:"absolute text-red-500 fill-current",style:{to
411p:e.top,left:0,width:e.size,height:e.size,animation:`ipd-heart-drift ${e.duration} linear ${e.delay} infinite`}},t))}),i.jsx("div",{className:"relative z-10 mt-48 text-sm text-muted-foreground tracking-wide",children:"Preparing your profile..."})]}),xS=({left:e,right:t,active:n,onLeft:r,onRight:s})=>i.jsx("div",{className:"flex justify-center pt-3 px-4",children:i.jsx("div",{className:"w-full max-w-[430px] px-4",children:i.jsxs("div",{className:"flex rounded-lg bg-muted p-1",children:[i.jsx("button",{onClick:r,className:`flex-1 py-2 text-sm font-medium rounded-md transition-colors ${n==="left"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,children:e}),i.jsx("button",{onClick:s,className:`flex-1 py-2 text-sm font-medium rounded-md transition-colors ${n==="right"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,children:t})]})})}),NY=()=>{const e=$s(),t=Wi(),[n,r]=d.useState("events"),[s,o]=d.useState("events"),[a,l]=d.useState("upcoming"),[c,u]=d.useState("upcoming"),[f,p]=d.useState(""),[h,m]=d.useState(""),[v,g]=d.useState(!1),{localUserId:x,user:w,showOnboarding:y,onOnboardingSuccess:b,loading:_,activeUsername:k,isAdmin:C,authOpen:E,setAuthOpen:A,onAuthSuccess:T,setShowOnboarding:M,profileFetched:P,authCleanupInProgress:$}=ao(),H=typeof window<"u"&&(window.location.hostname.includes("lovableproject.com")||window.location.hostname.includes("lovable.app")),z=xn().siteKey==="inpersondates",{isComplete:B,isReady:U}=Tm(),[D,j]=d.useState(!1),[N,W]=d.useState(!1),G=d.useCallback(async()=>{z&&!H&&W(!0),await b()},[z,H,b]),L=d.useRef(null);d.useEffect(()=>{if(!w){L.current=null,W(!1);return}if(!(!z||H)&&k&&L.current!==w.id&&!(y||D)&&U){if(B){W(!1);return}L.current=w.id,W(!0),j(!0)}},[w,z,H,k,U,B,y,D]),d.useEffect(()=>{if(!N||!D)return;const fe=requestAnimationFrame(()=>W(!1));return()=>cancelAnimationFrame(fe)},[N,D]),d.useEffect(()=>{(!z||H)&&W(!1)},[z,H]);const{upcomingEvents:K,isLoading:J}=wS(),{upcomingEvents:Z,pastEvents:ce}=wS({creatorId:x||void 0,enabled:n==="created"&&!!x}),{upcomingEvents:q,pastEvents:me}=CY(n==="going"?x:void 0),{hasJoinedEvents:oe,hasCreatedEvents:ae}=zb();return d.useEffect(()=>{const fe=document.documentElement;return fe.classList.add("app-shell-locked"),()=>fe.classList.remove("app-shell-locked")},[]),d.useEffect(()=>{var fe;if((fe=e.state)!=null&&fe.tab){r(e.state.tab);const ge=new URLSearchParams(window.location.search),$e=new URLSearchParams,tt=ge.get("site");tt&&$e.set("site",tt);const Lt=$e.toString()?`?${$e.toString()}`:"";t({pathname:e.pathname,search:Lt},{replace:!0,state:{}})}},[e.state]),d.useEffect(()=>{H||(n==="going"&&!oe&&r("events"),n==="created"&&!ae&&r("events"))},[n,oe,ae,H]),i.jsxs("div",{className:"relative z-10 h-screen flex flex-col overflow-hidden",children:[i.jsx(Kl,{}),i.jsx("div",{className:"relative flex-1 min-h-0 flex flex-col",children:i.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto pb-20 overscroll-contain",children:i.jsxs("div",{children:[n==="events"&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"sticky top-0 z-40 bg-background pb-3",children:i.jsx("div",{className:"flex justify-center pt-3 px-4",children:i.jsx("div",{className:"w-full max-w-[430px] px-4",children:i.jsxs("div",{className:"flex rounded-lg bg-muted p-1",children:[i.jsx("button",{onClick:()=>o("events"),className:`flex-1 py-2 text-sm font-medium rounded-md transition-colors ${s==="events"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,children:"Events"}),i.jsx("button",{onClick:()=>o("subscribed"),className:`flex-1 py-2 text-sm font-medium rounded-md transition-colors ${s==="subscribed"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,children:"Subscribed"})]})})})}),i.jsx("div",{className:"animate-fade-in",children:s==="events"?i.jsx(Vu,{events:K.filter(fe=>{if(!f)return!0;const{country:ge,city:$e}=Wx(fe.location_name);return!(ge!==f||h&&$e!==h)}),mode:"upcoming",onFilterClick:()=>g(!0),isFilterActive:!!f,isLoading:J}):i.jsx(bY,{})})]}),n==="going"&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"sticky top-0 z-40 bg-background pb-3",children:i.jsx(xS,{left:"Upcoming",right:"Past",active:a==="upcoming"?"left"
411:"right",onLeft:()=>l("upcoming"),onRight:()=>l("past")})}),i.jsx("div",{className:"animate-fade-in",children:i.jsx(Vu,{events:H?a==="upcoming"?Ai:Rd:a==="upcoming"?q:me,mode:a==="upcoming"?"upcoming":"past"})})]}),n==="created"&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"sticky top-0 z-40 bg-background pb-3",children:i.jsx(xS,{left:"Upcoming",right:"Past",active:c==="upcoming"?"left":"right",onLeft:()=>u("upcoming"),onRight:()=>u("past")})}),i.jsx("div",{className:"animate-fade-in",children:i.jsx(Vu,{events:c==="upcoming"?Z:ce,mode:c==="upcoming"?"upcoming":"past"})})]})]})})}),i.jsx(ql,{activeTab:n,onTabChange:r,hasJoinedEvents:oe,hasCreatedEvents:ae}),i.jsx(kY,{open:v,onOpenChange:g,events:K,activeCountry:f,activeCity:h,onApply:(fe,ge)=>{p(fe),m(ge)},onClear:()=>{p(""),m("")}}),w&&y&&P&&!$&&!_&&i.jsx(Mm,{onSuccess:G}),i.jsx(Vc,{open:E,onOpenChange:A,onAuthSuccess:T,mode:"login"}),i.jsx(Db,{open:D,onOpenChange:j}),N&&i.jsx(jY,{})]})},TY="https://errlhmcitfpyyhnwtqrs.supabase.co",PY="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImVycmxobWNpdGZweXlobnd0cXJzIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzIyOTY1NDcsImV4cCI6MjA4Nzg3MjU0N30.Vg5RxV3TAd2PGJ6pwFjMYEds0EtO_yQ07EbX5B_p7WU",kw=(e,t,n)=>["event",e,t??null,n??null];async function Sw(e,t,n){const r=await fetch(`${TY}/functions/v1/get-event?event_code=${encodeURIComponent(e)}${t?`&date_id=${encodeURIComponent(t)}`:""}`,{headers:{apikey:PY,...n?{Authorization:`Bearer ${n}`}:{}}});if(!r.ok)throw new Error("Event not found");return r.json()}const RY=({open:e,onOpenChange:t,actionType:n,onChoice:r})=>i.jsx(Rt,{open:e,onOpenChange:t,children:i.jsxs(St,{children:[i.jsxs(Ct,{children:[i.jsx(jt,{children:n==="edit"?"Edit recurring event":"Delete recurring event"}),i.jsx(Nt,{children:n==="edit"?"Would you like to edit just this instance or all events in the series?":"Would you like to delete just this instance or all events in the series?"})]}),i.jsxs(Et,{className:"flex flex-col gap-2 sm:flex-col",children:[i.jsx(ee,{variant:"default",className:"w-full",onClick:()=>{r("single"),t(!1)},children:"This event only"}),i.jsx(ee,{variant:"secondary",className:"w-full",onClick:()=>{r("all"),t(!1)},children:"All events"}),n==="edit"&&i.jsx(ee,{variant:"outline",className:"w-full",onClick:()=>{r("reset"),t(!1)},children:"All events (reset overrides)"}),i.jsx(cn,{className:"w-full mt-1",children:"Cancel"})]})]})});var AY="Separator",bS="horizontal",IY=["horizontal","vertical"],PI=d.forwardRef((e,t)=>{const{decorative:n,orientation:r=bS,...s}=e,o=OY(r)?r:bS,l=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return i.jsx(ve.div,{"data-orientation":o,...l,...s,ref:t})});PI.displayName=AY;function OY(e){return IY.includes(e)}var RI=PI;const Gu=d.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>i.jsx(RI,{ref:s,decorative:n,orientation:t,className:X("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Gu.displayName=RI.displayName;function MY(e,t){const n=t==="men"?"man":t==="women"?"woman":null,r=e==="male"?"men":e==="female"?"women":null;return!n||!r?null:`${n} looking for ${r}`}function LY({open:e,onOpenChange:t,creatorGender:n,creatorInterestedIn:r}){const s=MY(n,r);return i.jsx(ot,{open:e,onOpenChange:t,children:i.jsxs(et,{className:"sm:max-w-sm",children:[i.jsx(Tt,{children:i.jsx(vt,{children:"Not compatible with this date"})}),i.jsx("p",{className:"text-sm text-muted-foreground",children:s?`This date creator is interested in ${s}.`:"You are not compatible with this date."}),i.jsx(so,{children:i.jsx(ee,{variant:"outline",className:"w-full",onClick:()=>t(!1),children:"Close"})})]})})}function _S(e){return e.replace(/\\/g,"\\\\").replace(/;/g,"\\;").replace(/,/g,"\\,").replace(/\r\n|\n|\r/g,"\\n")}function Np(e){const t=n=>String(n).padStart(2,"0");return`${e.getUTCFullYear()}${t(e.getUTCMonth()+1)}${t(e.getUTCDate())}T${t(e.getUTCHours())}${t(e.getUTCMinutes())}${t(e.getUTCSeconds())}Z`}function DY({title:e,startTimeIso:t,eventUrl:n}){const r=new Date(t),s=Np(r),o=Np(new Date);return["BEGIN:VCALENDAR","VERSION:2.0","PRODID:-//staaake//events//EN","CALSCALE:GREGORIAN","METHOD:PUBLISH","BEGIN:VEVENT",`UID:${`${s}-${Math.random().toString(36).slice(2)}@staaake.events`}`,`DTSTAMP:${o}`,`DTSTART:${s}
411`,`SUMMARY:${_S(e)}`,`URL:${_S(n)}`,"END:VEVENT","END:VCALENDAR"].join(`\r
412`)+`\r
413`}function $Y(e){const t=e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return t?`${t}.ics`:"event.ics"}function UY(e){const t=DY(e),n=new Blob([t],{type:"text/calendar;charset=utf-8"}),r=URL.createObjectURL(n),s=document.createElement("a");s.href=r,s.download=$Y(e.title),document.body.appendChild(s),s.click(),document.body.removeChild(s),setTimeout(()=>URL.revokeObjectURL(r),0)}function FY({title:e,startTimeIso:t,eventUrl:n}){const r=new Date(t),s=new Date(r.getTime()+60*60*1e3);return`https://calendar.google.com/calendar/render?${new URLSearchParams({action:"TEMPLATE",text:e,dates:`${Np(r)}/${Np(s)}`,details:n}).toString()}`}function zY({open:e,onOpenChange:t,title:n,startTimeIso:r,eventUrl:s}){const[o,a]=d.useState("prompt"),l=n&&r&&s?{title:n,startTimeIso:r,eventUrl:s}:null,c=p=>{p||a("prompt"),t(p)},u=()=>{l&&window.open(FY(l),"_blank","noopener,noreferrer"),c(!1)},f=()=>{l&&UY(l),c(!1)};return i.jsx(ot,{open:e,onOpenChange:c,children:i.jsx(et,{className:"sm:max-w-md",children:o==="prompt"?i.jsxs(i.Fragment,{children:[i.jsxs(Tt,{children:[i.jsx(vt,{children:"Add this event to your calendar?"}),i.jsx(Ps,{children:"We don't send email reminders. Your calendar will remind you instead."})]}),i.jsxs(so,{className:"gap-2 sm:gap-2",children:[i.jsx(ee,{variant:"outline",onClick:()=>c(!1),children:"Maybe Later"}),i.jsx(ee,{onClick:()=>a("choose"),children:"Add to Calendar"})]})]}):i.jsxs(i.Fragment,{children:[i.jsx(Tt,{children:i.jsx(vt,{children:"Choose your calendar"})}),i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsx(ee,{onClick:u,children:"Google Calendar"}),i.jsx(ee,{variant:"outline",onClick:f,children:"Apple / Outlook / Other (.ics)"}),i.jsx(ee,{variant:"ghost",onClick:()=>a("prompt"),children:"Back"})]})]})})})}const BY=Array.from({length:48},(e,t)=>{const n=String(Math.floor(t/2)).padStart(2,"0"),r=t%2===0?"00":"30";return`${n}:${r}`});function Cw(e){const[t,n]=e.split(":");let r=parseInt(t,10);if(isNaN(r))return e;const s=r>=12?"PM":"AM";return r===0?r=12:r>12&&(r-=12),`${r}:${n} ${s}`}function WY({text:e}){const t=d.useRef(null),n=d.useRef(null);return d.useEffect(()=>{const r=t.current,s=n.current;if(!r||!s)return;let o=null;const a=()=>{o&&(o.cancel(),o=null),s.style.transform="";const c=s.scrollWidth-r.clientWidth;if(c<=1)return;const u=Math.max(1500,c/40*1e3),f=1200/(u*2+2400),p=u*2+2400;o=s.animate([{transform:"translateX(0)",offset:0},{transform:"translateX(0)",offset:f},{transform:`translateX(-${c}px)`,offset:.5-f},{transform:`translateX(-${c}px)`,offset:.5+f},{transform:"translateX(0)",offset:1-f},{transform:"translateX(0)",offset:1}],{duration:p,iterations:1/0,easing:"ease-in-out"})};a();const l=new ResizeObserver(a);return l.observe(r),l.observe(s),()=>{l.disconnect(),o&&o.cancel()}},[e]),i.jsx("span",{ref:t,className:"block min-w-0 flex-1 overflow-hidden",children:i.jsx("span",{ref:n,className:"inline-block whitespace-nowrap will-change-transform",children:e})})}const HY={title:"Pick the title",date:"Pick the date",time:"Pick the time",location:"Pick the location"},_y={title:"Pick Title",date:"Pick Date",time:"Pick Time",location:"Pick Location"};function ky(e,t,n=!1,r=""){if(e.poll_type==="date"){if(t.label)return t.label;const s=new Date(`${t.value}T00:00:00`);return isNaN(s.getTime())?t.value:tn(s,"EEE, MMM d, yyyy")}return e.poll_type==="time"?Cw(t.value):e.poll_type==="title"?z3(t.label??t.value):e.poll_type==="location"&&n?Zp(t.value)||r||"Location":t.label?t.label:t.value}function KY({eventCode:e,polls:t,canFinalize:n,previewMode:r=!1,viewerUserId:s=null,guardAction:o,onChanged:a,maskLocationToCity:l=!1,maskCityFallback:c="",hideOriginalLocationOption:u=!1,protectOriginalLocationOption:f=!1}){return!t||t.length===0?null:i.jsxs("section",{className:"space-y-3",children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Help shape this event"}),i.jsx(Gu,{className:"bg-border"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Suggest options and vote before the event happens."}),i.jsx("div",{className:"space-y-4",children:t.map(p=>i.jsx(qY,{poll:p,canFinalize:n,previewMode:r,viewerUserId:s,guardAction:o,onChanged:a,maskLocationToCity:l,maskCityFallback:c,hideOriginalLocationOption:u,protectOriginalLocationOption:f},p.id))})]})}function qY({poll:e,canFinalize:t,previewMode:n=!1,viewerUserId:r=null,guardAction:s,onChanged:o,maskLocationToCity:a=!1,maskCityFallback:l="",hideOriginalLocationOption:c=!1,protectOriginalLocationOption:u=!1}){const[f,p]=d.useState(!1),[h,m]=d.useState(!1),[v,g]=d.useState(e.final_option_id),[x,w]=d.use
413State(null),[y,b]=d.useState(!1),[_,k]=d.useState(e);d.useEffect(()=>{k(e),g(e.final_option_id)},[e]);const C=new Date(_.deadline).getTime()<=Date.now(),E=_.status==="finalized",A=C||E,T=c&&_.poll_type==="location"?_.options.filter(j=>j.suggested_by!=null):_.options,M=T.reduce((j,N)=>j+N.vote_count,0),P=_.options.length<10,$=d.useCallback(async j=>{const{data:{session:N}}=await pe.auth.getSession();if(!(N!=null&&N.access_token))return re.error("Please log in"),null;const G=await fetch("https://errlhmcitfpyyhnwtqrs.supabase.co/functions/v1/poll-action",{method:"POST",headers:{Authorization:`Bearer ${N.access_token}`,"Content-Type":"application/json",apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImVycmxobWNpdGZweXlobnd0cXJzIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzIyOTY1NDcsImV4cCI6MjA4Nzg3MjU0N30.Vg5RxV3TAd2PGJ6pwFjMYEds0EtO_yQ07EbX5B_p7WU"},body:JSON.stringify({poll_id:e.id,...j})}),L=await G.json().catch(()=>({}));return G.ok?L:(re.error(L.error||"Action failed"),null)},[e.id]),H=j=>{s(async()=>{const N=_,W=N.my_vote_option_id;if(W===j)return;k(L=>({...L,my_vote_option_id:j,options:L.options.map(K=>{let J=K.vote_count;return K.id===j&&(J+=1),W&&K.id===W&&(J=Math.max(0,J-1)),{...K,vote_count:J}})})),await $({action:"vote",option_id:j})||k(N)})},z=(j,N,W)=>{s(async()=>{const G=j.trim().toLowerCase();if(_.options.some(q=>q.value.trim().toLowerCase()===G)){m(!1);return}const L=_,K=`temp-${Date.now()}`,J={id:K,value:j,label:W??null,vote_count:0,suggested_by:r,...N??{}};m(!1),k(q=>({...q,options:[...q.options,J]}));const Z=await $({action:"suggest",value:j,label:W,...N??{}});if(!Z){k(L);return}const ce=Z.option_id;ce&&k(q=>({...q,options:q.options.map(me=>me.id===K?{...me,id:ce}:me)}))})},B=j=>{if(_.options.length<=1){re.error("A poll must have at least one option."),w(null);return}if(n){k(N=>({...N,options:N.options.filter(W=>W.id!==j.id)})),w(null);return}s(async()=>{const N=_;w(null),k(G=>({...G,options:G.options.filter(L=>L.id!==j.id)})),await $({action:"delete_option",option_id:j.id})||k(N)})},U=()=>{if(!v){re.error("Select an option first");return}b(!0)},D=()=>{if(b(!1),!!v){if(n){re.success("Preview: official option would be set");return}s(async()=>{p(!0);const j=await $({action:"finalize",option_id:v});p(!1),j&&(re.success("Option finalized"),o())})}};return i.jsxs("div",{className:"rounded-xl border border-border bg-card p-4 space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h3",{className:"text-sm font-semibold text-foreground",children:HY[_.poll_type]}),i.jsx("span",{className:"text-xs text-muted-foreground",children:E?"Finalized":A?"Voting Closed":`Closes ${tn(new Date(_.deadline),"MMM d, h:mm a")}`})]}),i.jsx("div",{className:"space-y-2",children:T.map(j=>{const N=M>0?Math.round(j.vote_count/M*100):0,W=_.my_vote_option_id===j.id,G=_.final_option_id===j.id,L=t&&!E,K=v===j.id,J=!!r&&j.suggested_by===r,Z=!E&&!G&&(t||J&&j.vote_count===0),ce=u&&_.poll_type==="location"&&j.suggested_by==null;return i.jsxs("div",{className:"relative flex items-center gap-1.5",children:[i.jsxs("button",{type:"button",disabled:f||A&&!L,onClick:()=>{L?g(j.id):A||H(j.id)},className:X("relative w-full overflow-hidden rounded-lg border px-3 py-2.5 text-left transition-colors",W||G||K?"border-primary":"border-border hover:border-muted-foreground/40",A&&!L&&"cursor-default"),children:[i.jsx("div",{className:"absolute inset-y-0 left-0 bg-primary/10",style:{width:`${N}%`}}),i.jsxs("div",{className:"relative flex items-center justify-between gap-2",children:[i.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2 text-sm text-foreground",children:[L?i.jsx("span",{className:X("flex h-4 w-4 shrink-0 items-center justify-center rounded-full border",K?"border-primary":"border-muted-foreground/50"),children:K&&i.jsx("span",{className:"h-2 w-2 rounded-full bg-primary"})}):(W||G)&&i.jsx(es,{className:"h-3.5 w-3.5 text-primary"}),_.poll_type==="title"?i.jsx(WY,{text:ky(_,j,a,l)}):i.jsxs("span",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:X("block truncate",ce&&"blur-[1px]"),title:ky(_,j,a,l),children:ky(_,j,a,l)}),ce&&i.jsx("span",{className:"mt-0.5 block text-[11px] text-muted-foreground",children:"Invisible for other people."})]}),G&&i.jsx("span",{className:"shrink-0 text-[11px] text-primary font-medium",children:"(official)"})]}),i.jsxs("span",{className:"shrink-0 whitespace-nowrap text-xs text-muted-foreground",children:[j.vote_count," ",j.vote_count===1?"vote":"votes"]})]})]}),Z&&i.jsx("button",{type:"button","aria-label":"Delete option",disabled:f,onClick:()=>w(j),className:"shrink-0 rounded-md p-1.5 text-muted-foreground transition-colors hover:text-destructive hover:bg-destructive/10",children:i.jsx(yh,{className:"h-4 w-4"})})]},j.id)})}),!A&&i.jsx("div",{children:h?i.jsx(VY,{type:_.poll_type,busy:f,onCancel:()=>m(!1),onSubmit:z}):P?i.jsxs(ee,{variant:"ghost",size:"sm",className:"text-xs",onClick:()=>m(!0),children:[i.jsx(RE,{className:"mr-1 h-3.5 w-3.5"})," Suggest a ",_.poll_type]}):i.jsx("p",{className:"text-xs text-muted-foreground",children:"Maximum options reached."})}),t&&!E&&i.jsx("div",{className:"pt-1",children:i.jsx(ee,{size:"sm",className:"w-full",disabled:f||!v,onClick:U,children:f?i.jsx(to,{className:"h-4 w-4 animate-spin"}):_y[_.poll_type]})}),i.jsx(Rt,{open:!!x,onOpenChange:j=>!j&&w(null),children:i.jsxs(St,{children:[i.jsxs(Ct,{children:[i.jsx(jt,{children:"Delete option?"}),i.jsx(Nt,{children:"Are you sure you want to delete this option?"})]}),i.jsxs(Et,{children:[i.jsx(cn,{children:"Cancel"}),i.jsx(ln,{onClick:()=>x&&B(x),children:"Delete"})]})]})}),i.jsx(Rt,{open:y,onOpenChange:b,children:i.jsxs(St,{children:[i.jsxs(Ct,{children:[i.jsxs(jt,{children:[_y[_.poll_type],"?"]}),i.jsxs(Nt,{children:["This will close the poll.",i.jsx("br",{}),i.jsx("br",{}),"People will no longer be able to vote or suggest new options."]})]}),i.jsxs(Et,{children:[i.jsx(cn,{children:"Cancel"}),i.jsx(ln,{onClick:D,children:_y[_.poll_type]})]})]})})]})}function VY({type:e,busy:t,onSubmit:n,onCancel:r}){const[s,o]=d.useState(),[a,l]=d.useState("16:00"),[c,u]=d.useState(""),[f,p]=d.useState([]),[h,m]=d.useState(null),v=d.useRef(null),g=d.useRef(null),x=d.useCallback(y=>{var b,_;if(!y.trim()||!((_=(b=window.google)==null?void 0:b.maps)!=null&&_.places)){p([]);return}
413try{v.current||(v.current=new window.google.maps.places.AutocompleteSessionToken),window.google.maps.places.AutocompleteSuggestion.fetchAutocompleteSuggestions({input:y,sessionToken:v.current}).then(({suggestions:k})=>{p(k.filter(C=>C.placePrediction).map(C=>({placeId:C.placePrediction.placeId,text:C.placePrediction.text.text})))})}catch{p([])}},[]),w=d.useCallback(async y=>{var b;p([]),u(y.text);try{const _=new window.google.maps.places.Place({id:y.placeId});await _.fetchFields({fields:["formattedAddress","location","displayName"]});const k=_.location,C=typeof _.displayName=="string"?_.displayName:((b=_.displayName)==null?void 0:b.text)||"";m({value:y.text,label:C||y.text.split(",")[0],lat:k==null?void 0:k.lat(),lng:k==null?void 0:k.lng(),place_id:y.placeId}),v.current=null}catch{}},[]);return e==="date"?i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsxs(gp,{children:[i.jsx(yp,{asChild:!0,children:i.jsxs(ee,{variant:"outline",size:"sm",className:X("justify-start font-normal",!s&&"text-muted-foreground"),children:[i.jsx(gh,{className:"mr-2 h-4 w-4"}),s?tn(s,"MMM d, yyyy"):"Pick a date"]})}),i.jsx(jd,{className:"w-auto p-0",align:"start",children:i.jsx(mp,{mode:"single",selected:s,onSelect:o,disabled:y=>y<new Date(new Date().setHours(0,0,0,0)),initialFocus:!0,className:"p-3 pointer-events-auto"})})]}),i.jsx(ee,{size:"sm",disabled:t||!s,onClick:()=>s&&n(tn(s,"yyyy-MM-dd"),void 0,tn(s,"EEE, MMM d, yyyy")),children:"Add"}),i.jsx(ee,{size:"sm",variant:"ghost",onClick:r,children:"Cancel"})]}):e==="time"?i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(ep,{className:"h-4 w-4 text-muted-foreground"}),i.jsxs(Kr,{value:a,onValueChange:l,children:[i.jsx(Nr,{className:"w-28",children:i.jsx(qr,{})}),i.jsx(Tr,{className:"max-h-60",children:BY.map(y=>i.jsx(bt,{value:y,children:Cw(y)},y))})]}),i.jsx(ee,{size:"sm",disabled:t,onClick:()=>n(a,void 0,Cw(a)),children:"Add"}),i.jsx(ee,{size:"sm",variant:"ghost",onClick:r,children:"Cancel"})]}):e==="title"?i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsx("input",{value:c,maxLength:50,placeholder:"Suggest a title",onChange:y=>u(y.target.value),className:"flex-1 min-w-[12rem] rounded-md border border-input bg-muted/30 py-2 px-3 text-sm outline-none focus:border-primary"}),i.jsx(ee,{size:"sm",disabled:t||!c.trim(),onClick:()=>n(c.trim(),void 0,c.trim()),children:"Add"}),i.jsx(ee,{size:"sm",variant:"ghost",onClick:r,children:"Cancel"})]}),i.jsxs("p",{className:"text-xs text-muted-foreground text-right",children:[c.length," / 50"]})]}):i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"relative",children:[i.jsx(Uu,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),i.jsx("input",{value:c,placeholder:"Search a place",onChange:y=>{u(y.target.value),m(null),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>x(y.target.value),250)},className:"w-full rounded-md border border-input bg-muted/30 py-2 pl-9 pr-3 text-sm outline-none focus:border-primary"}),f.length>0&&i.jsx("div",{className:"absolute z-30 mt-1 w-full rounded-md border border-border bg-popover shadow-lg",children:f.map(y=>i.jsx("button",{type:"button",onClick:()=>w(y),className:"block w-full px-3 py-2 text-left text-sm hover:bg-muted",children:y.text},y.placeId))})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(ee,{size:"sm",disabled:t||!h,onClick:()=>h&&n(h.value,{lat:h.lat,lng:h.lng,place_id:h.place_id},h.label),children:"Add"}),i.jsx(ee,{size:"sm",variant:"ghost",onClick:r,children:"Cancel"})]})]})}function YY(e,t,n){const r=e==null?void 0:e.trim(),s=t==null?void 0:t.trim();if(r&&s)return`${r} ${s[0].toUpperCase()}.`;const o=n==null?void 0:n.trim();return o||"Unknown"}const GY="https://errlhmcitfpyyhnwtqrs.supabase.co",JY="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImVycmxobWNpdGZweXlobnd0cXJzIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzIyOTY1NDcsImV4cCI6MjA4Nzg3MjU0N30.Vg5RxV3TAd2PGJ6pwFjMYEds0EtO_yQ07EbX5B_p7WU";
413function QY(e,t,n,r,s){const o=Dr(),[a,l]=d.useState(null),[c,u]=d.useState(!1),{data:f}=Wt({queryKey:["rsvp-status",e,t,r],queryFn:async()=>{let v=wn.from("event_attendees").select("id, status").eq("event_id",e).eq("user_id",t);r&&(v=v.eq("event_date_id",r));const{data:g}=await v.maybeSingle();return g??null},enabled:!!e&&!!t}),p=!!f,h=(f==null?void 0:f.status)??null,m=Mj({mutationFn:async v=>{const{data:{session:g}}=await pe.auth.getSession(),x=await fetch(`${GY}/functions/v1/rsvp`,{method:"POST",headers:{"Content-Type":"application/json",apikey:JY,...g!=null&&g.access_token?{Authorization:`Bearer ${g.access_token}`}:{}},body:JSON.stringify({event_id:e,event_date_id:r||void 0,action:v,viewer_username:n})}),w=await x.json();if(!x.ok){if(w.error==="stake_requirement_not_met")return l({host_username:w.host_username,min_tier:w.min_tier}),{stakeBlocked:!0,host_username:w.host_username,min_tier:w.min_tier};throw w.error==="selection_closed"?new Error("Selections are closed (within 6 hours of the date)."):new Error(w.error||"RSVP failed")}return w},onMutate:async v=>{await o.cancelQueries({queryKey:["rsvp-status",e,t,r]});const g=o.getQueryData(["rsvp-status",e,t,r]);o.setQueryData(["rsvp-status",e,t,r],v==="join"?{id:"optimistic",status:"pending"}:null);const x=[];if(v==="leave"){const w=o.getQueriesData({queryKey:["detailed-event-attendees",e]});for(const[b,_]of w)if(x.push([b,_]),_&&typeof _=="object"){const k=_;o.setQueryData(b,{...k,platform:Array.isArray(k.platform)?k.platform.filter(C=>C.user_id!==t):k.platform})}const y=o.getQueriesData({queryKey:["event-attendees",e]});for(const[b,_]of y)x.push([b,_])}return{previousStatus:g,attendeesSnapshots:x}},onSuccess:(v,g)=>{if(v!=null&&v.stakeBlocked){o.setQueryData(["rsvp-status",e,t,r],null);return}o.invalidateQueries({queryKey:["event-attendees"]}),o.invalidateQueries({queryKey:["going-events"]}),o.invalidateQueries({queryKey:["attendee-counts"]}),o.invalidateQueries({queryKey:["attendee-counts-by-date"]}),o.invalidateQueries({queryKey:["events"]}),o.invalidateQueries({queryKey:["detailed-event-attendees"]}),o.invalidateQueries({queryKey:["creator_follows"]}),o.invalidateQueries({queryKey:["rsvp-status"]}),g==="join"?(u(!0),o.setQueryData(["staaake-profile",pt().event_type],x=>{if(!x)return x;const w={...x,hasRsvps:!0};try{const y=pt().event_type;localStorage.setItem(`staaake-profile-flags-${y??"default"}`,JSON.stringify({hasRsvps:w.hasRsvps,hasCreated:w.hasCreated}))}catch{}return w}),re.success(s==="inpersondates"?"Interest sent":"RSVP confirmed!")):re.success("RSVP cancelled")},onError:(v,g,x)=>{if((x==null?void 0:x.previousStatus)!==void 0&&o.setQueryData(["rsvp-status",e,t,r],x.previousStatus),x!=null&&x.attendeesSnapshots)for(const[w,y]of x.attendeesSnapshots)o.setQueryData(w,y);re.error(v.message)}});return{isAttending:p,status:h,rsvp:m.mutateAsync,isLoading:m.isPending,stakeError:a,clearStakeError:()=>l(null),showAddToCalendar:c,setShowAddToCalendar:u,dismissAddToCalendar:()=>u(!1)}}function XY(e,t){return Wt({queryKey:["event-attendees",e,t],staleTime:3e4,queryFn:async()=>{const{data:n,error:r}=await wn.rpc("get_public_event_attendees",{p_event_id:e,p_event_date_id:t||null});if(r)throw r;return(n??[]).map(s=>({first_name:s.first_name??null,last_name:s.last_name??null,username:s.username??null}))},enabled:!!e})}function ZY(e,t,n){const r="https://errlhmcitfpyyhnwtqrs.supabase.co";return Wt({queryKey:["detailed-event-attendees",e,n,t],staleTime:0,queryFn:async()=>{const{data:{session:s}}=await pe.auth.getSession();if(!(s!=null&&s.access_token))throw new Error("No session");let o=`${r}/functions/v1/get-event-attendees-detailed?event_id=${encodeURIComponent(e)}`;n&&(o+=`&event_date_id=${encodeURIComponent(n)}`);const a=await fetch(o,{headers:{Authorization:`Bearer ${s.access_token}`}});if(!a.ok){const l=await a.text();throw new Error(`Failed: ${a.status} ${l}`)}return a.json()},enabled:!!e&&t})}const e7={platform:[{first_name:"Jake",last_name:"Miller",email:"[email protected]",created_at:new Date(Date.now()-23*6e4).toISOString()},{first_name:"Karen",last_name:"Lee",email:"[email protected]",created_at:new Date(Date.now()-2*36e5).toISOString()},{first_name:"Alex",last_name:"Park",email:"[email protected]",created_at:new Date(Date.now()-5*36e5).toISOString()}],luma:[{first_name:"Emma",last_name:"Wilson",email:"[email protected]",created_at:new Date(Date.now()-864e5).toISOString()},{first_name:"Raj",last_name:"Patel",email:"[email protected]",created_at:new Date(Date.now()-2*864e5).toISOString()}],eventbrite:[{first_name:"Sam",last_name:"Lee",email:"[email protected]",created_at:new Date(Date.now()-3*864e5).toISOString()}],meetup:[{first_name:"Chris",last_name:"Park",email:"[email protected]",created_at:new Date(Date.now()-4*864e5).toISOString()}]};function t7(e){const t=new Date(e),n=new Date,r=HD(n,t);if(r<60)return`${r} min ago`;const s=WD(n,t);return s<24&&K$(t)?`${s} h ago`:q$(t)?"yesterday":tn(t,"MMM d")}function n7(e){return tn(new Date(e),"MMM d")}function Zf({label:e,items:t,hideEmail:n,showEmailIfSelected:r,emailFallback:s}){if(t.length===0)return null;const o=[...t].sort((a,l)=>{const c=a.created_at?new Date(a.created_at).getTime():0;return(l.created_at?new Date(l.created_at).getTime():0)-c});return i.jsxs("div",{className:"mt-3",children:[i.jsxs("p",{className:"text-xs text-muted-foreground font-medium mb-1.5",children:[e," (",t.length,")"]}),i.jsx("div",{className:"space-y-0",children:o.map((a,l)=>
413{const c=[a.first_name,a.last_name].filter(Boolean).join(" ")||"Unknown",u=!n||r&&a.status==="selected",f=a.email?a.email:s;return i.jsxs("div",{className:"flex items-start justify-between py-2 border-b border-border last:border-b-0",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:c}),f&&u&&i.jsx("p",{className:"text-xs text-muted-foreground truncate",children:f})]}),a.created_at&&i.jsxs("div",{className:"text-right shrink-0 ml-3",children:[i.jsx("p",{className:"text-xs text-muted-foreground",children:t7(a.created_at)}),i.jsx("p",{className:"text-xs text-muted-foreground/60",children:n7(a.created_at)})]})]},l)})})]})}function r7({attendees:e,isPreview:t,siteKey:n,isAdmin:r}){const s=t?e7:e;if(!s)return null;const o=s.meetup??[];console.log("[PrivateAttendeeList] Attendee sources:",{platform:s.platform.length,luma:s.luma.length,eventbrite:s.eventbrite.length,meetup:o.length});const a=s.platform.length+s.luma.length+s.eventbrite.length+o.length;if(a===0)return null;const l=n==="inpersondates"&&!r;return i.jsxs("div",{className:"mt-4",children:[i.jsxs("p",{className:"text-xs text-muted-foreground font-medium",children:["Full attendee list (",a,")"]}),i.jsx(Zf,{label:"Platform",items:s.platform,hideEmail:l,showEmailIfSelected:!0}),i.jsx(Zf,{label:"Luma",items:s.luma,hideEmail:l,showEmailIfSelected:!1}),i.jsx(Zf,{label:"Eventbrite",items:s.eventbrite,hideEmail:l,showEmailIfSelected:!1}),i.jsx(Zf,{label:"Meetup",items:o,hideEmail:l,showEmailIfSelected:!1,emailFallback:"Private on Meetup"})]})}function s7(e,t){const n=Dr();return d.useEffect(()=>{if(!e)return;const r=wn.channel(`luma-attendees-${e}`).on("postgres_changes",{event:"*",schema:"public",table:"luma_attendees",filter:`event_id=eq.${e}`},()=>{n.invalidateQueries({queryKey:["luma-attendees",e,t]})}).subscribe();return()=>{wn.removeChannel(r)}},[e,t,n]),Wt({queryKey:["luma-attendees",e,t],staleTime:5e3,queryFn:async()=>{const{data:r,error:s}=await wn.rpc("get_public_luma_attendee_names",{p_event_id:e,p_luma_event_id:t??null});if(s)throw s;return r??[]},enabled:!!e&&!!t})}function o7(e,t){const n=Dr();return d.useEffect(()=>{if(!e)return;const r=wn.channel(`eventbrite-attendees-${e}`).on("postgres_changes",{event:"*",schema:"public",table:"eventbrite_attendees",filter:`event_id=eq.${e}`},()=>{n.invalidateQueries({queryKey:["eventbrite-attendees",e,t]})}).subscribe();return()=>{wn.removeChannel(r)}},[e,t,n]),Wt({queryKey:["eventbrite-attendees",e,t],staleTime:5e3,queryFn:async()=>{const{data:r,error:s}=await wn.rpc("get_public_eventbrite_attendee_names",{p_event_id:e,p_eventbrite_event_id:t??null});if(s)throw s;return r??[]},enabled:!!e})}function i7(e,t){const n=Dr();return d.useEffect(()=>{if(!e)return;const r=wn.channel(`meetup-attendees-${e}`).on("postgres_changes",{event:"*",schema:"public",table:"meetup_attendees",filter:`event_id=eq.${e}`},()=>{n.invalidateQueries({queryKey:["meetup-attendees",e,t]})}).subscribe();return()=>{wn.removeChannel(r)}},[e,t,n]),Wt({queryKey:["meetup-attendees",e,t],staleTime:5e3,queryFn:async()=>{const{data:r,error:s}=await wn.rpc("get_public_meetup_attendee_names",{p_event_id:e,p_meetup_event_id:t??null});if(s)throw s;return r??[]},enabled:!!e&&!!t})}const a7=(e,t)=>Wt({queryKey:["event-social-shares",e??null,t??null],enabled:!!e,queryFn:async()=>{let n=wn.from("event_social_shares").select("platform, event_date_id, status").eq("event_id",e).eq("status","sent");n=t?n.eq("event_date_id",t):n.is("event_date_id",null);const{data:r,error:s}=await n;if(s)throw s;return(r??[]).map(o=>o.platform)}}),Zo=864e5,l7={id:"preview-event",event_code:"abc123",event_name:"Tech Power Walk",event_type:"powerwalk",venue_name:"Central Park",location_name:"59th St & 5th Ave, New York, NY",location_lat:40.7812,location_lng:-73.9665,creator_id:"preview-creator",event_dates:[{start_time:new Date(Date.now()+Zo).toISOString(),end_time:new Date(Date.now()+Zo+36e5).toISOString()}],polls:[{id:"preview-poll-date",poll_type:"date",deadline:new Date(Date.now()-Zo).toISOString(),status:"open",final_option_id:null,my_vote_option_id:null,options:[{id:"pd1",poll_id:"preview-poll-date",value:new Date(Date.now()+Zo*3).toISOString().slice(0,10),label:null,lat:null,lng:null,place_id:null,
413suggested_by:null,vote_count:5},{id:"pd2",poll_id:"preview-poll-date",value:new Date(Date.now()+Zo*5).toISOString().slice(0,10),label:null,lat:null,lng:null,place_id:null,suggested_by:null,vote_count:7},{id:"pd3",poll_id:"preview-poll-date",value:new Date(Date.now()+Zo*7).toISOString().slice(0,10),label:null,lat:null,lng:null,place_id:null,suggested_by:null,vote_count:9}]},{id:"preview-poll-time",poll_type:"time",deadline:new Date(Date.now()-Zo).toISOString(),status:"open",final_option_id:null,my_vote_option_id:null,options:[{id:"pt1",poll_id:"preview-poll-time",value:"16:00",label:"16:00",lat:null,lng:null,place_id:null,suggested_by:null,vote_count:5},{id:"pt2",poll_id:"preview-poll-time",value:"17:00",label:"17:00",lat:null,lng:null,place_id:null,suggested_by:null,vote_count:7},{id:"pt3",poll_id:"preview-poll-time",value:"18:00",label:"18:00",lat:null,lng:null,place_id:null,suggested_by:null,vote_count:9}]},{id:"preview-poll-location",poll_type:"location",deadline:new Date(Date.now()-Zo).toISOString(),status:"open",final_option_id:null,my_vote_option_id:null,options:[{id:"pl1",poll_id:"preview-poll-location",value:"Central Park",label:"Central Park",lat:null,lng:null,place_id:null,suggested_by:null,vote_count:5},{id:"pl2",poll_id:"preview-poll-location",value:"Riverside Park",label:"Riverside Park",lat:null,lng:null,place_id:null,suggested_by:null,vote_count:7},{id:"pl3",poll_id:"preview-poll-location",value:"Battery Park",label:"Battery Park",lat:null,lng:null,place_id:null,suggested_by:null,vote_count:9}]}],users:{username:"jakemiller",first_name:"Jake",last_name:"Miller",bio:"Building things, walking cities, mostly tea over coffee.",link:"https://instagram.com/creator",dating_profiles:[{dob:"1996-05-15",relationship_intent:"man_seeking_women",home_city:"New York",home_country:"USA",mother_language:"English",english_level:"Native",hair_color:"brown",eye_color:"hazel",skin_tone:"light"}]}},c7=[{first_name:"Jake",last_name:"Miller",username:"jakemiller"},{first_name:"Karen",last_name:"Lee",username:"karenlee"},{first_name:"Alex",last_name:"Park",username:"alexpark"},{first_name:"Sofia",last_name:"Reyes",username:"sofiareyes"},{first_name:"Tyler",last_name:"Nguyen",username:"tylernguyen"}],u7=[{user_id:"demo-1",first_name:"Alex",last_name:"P",username:"alex",status:"pending"},{user_id:"demo-2",first_name:"Sam",last_name:"K",username:"sam",status:"pending"},{user_id:"demo-3",first_name:"Chris",last_name:"M",username:"chris",status:"pending"},{user_id:"demo-4",first_name:"Taylor",last_name:"R",username:"taylor",status:"pending"},{user_id:"demo-5",first_name:"Jordan",last_name:"L",username:"jordan",status:"pending"}],Sy={x:{label:"X",subtitle:"Prepare to post on X"},linkedin:{label:"LinkedIn",subtitle:"Prepare to post on LinkedIn"},whatsapp:{label:"WhatsApp",subtitle:"Prepare to send"},instagram:{label:"Instagram",subtitle:"Link copied - paste in your story"},native:{label:"Share",subtitle:"Prepare to share"}},kl={luma:"Luma",eventbrite:"Eventbrite",meetup:"Meetup"};class eh extends Error{}const ia={linkedin:"LinkedIn",x:"X",instagram:"Instagram"},d7={linkedin:"Your event will be featured on the staaake LinkedIn Company Page.",x:"Your event will be featured on the official staaake X account.",instagram:"Your event will be featured on the official staaake Instagram Story."},f7="You get one feature per event.",h7={linkedin:"https://www.linkedin.com/company/staaake",x:"https://x.com/staaake",instagram:"https://www.instagram.com/staaake"},p7=()=>{var Ot,Sr,yt,ke,Ie,Ft,Mt,Ve,Ln,lt,Le,vs,Vt;const{event_code:e}=Wd(),t=Dr(),n=Wi(),[r,s]=d.useState(!1),[o,a]=d.useState(!1),[l,c]=d.useState(!1),[u,f]=d.useState(!1),[p,h]=d.useState(!1),[m,v]=d.useState(!1),[g,x]=d.useState(null),[w,y]=d.useState(!1),[b,_]=d.useState(null),[k,C]=d.use
413State(null),[E,A]=d.useState(!1),[T,M]=d.useState(!1),[P,$]=d.useState(null),[H,z]=d.useState(null),[B,U]=d.useState(null),[D,j]=d.useState(!1),[N,W]=d.useState(!1),[G,L]=d.useState(!1),[K,J]=d.useState(!1),[Z,ce]=d.useState(!1),[q,me]=d.useState(!1),[oe,ae]=d.useState(!1),[fe,ge]=d.useState(!1),[$e,tt]=d.useState(null),[Lt,ut]=d.useState(null),[Nn,Ae]=d.useState(!1),[Xn,rn]=d.useState(!1),[ar,In]=d.useState(!1),[On,xr]=d.useState(!1),[Ur,Q]=d.useState(!1),V=typeof window<"u"&&(window.location.hostname.includes("lovableproject.com")||window.location.hostname.includes("lovable.app")),je=V&&typeof window<"u"&&new URL(window.location.href).searchParams.get("previewAs")==="creator",{user:Me,authOpen:xt,setAuthOpen:lr,showOnboarding:br,guardAction:Zn,onAuthSuccess:Xt,onOnboardingSuccess:rs,localUserId:Kt,loading:bn,profileFetched:qt,authCleanupInProgress:Fr,activeUsername:sn,isAdmin:Fe,setShowOnboarding:_n}=ao(),dt="https://errlhmcitfpyyhnwtqrs.supabase.co",_r="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImVycmxobWNpdGZweXlobnd0cXJzIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzIyOTY1NDcsImV4cCI6MjA4Nzg3MjU0N30.Vg5RxV3TAd2PGJ6pwFjMYEds0EtO_yQ07EbX5B_p7WU",be=typeof window<"u"?new URLSearchParams(window.location.search).get("date_id"):null,{data:We,isLoading:ft,error:kn,refetch:Hn}=Wt({queryKey:kw(e??"",(Me==null?void 0:Me.id)??null,be),queryFn:async()=>{let R=null;try{const{data:{session:Y}}=await pe.auth.getSession();R=(Y==null?void 0:Y.access_token)??null}catch{R=null}return Sw(e,be,R)},enabled:!!e&&!V&&(!!Me||!bn)}),{data:Tn}=Wt({queryKey:kw(e??"",null,be),queryFn:()=>Sw(e,be,null),staleTime:6e4,enabled:!!e&&!V}),S=V?l7:We??Tn,on=(S==null?void 0:S.status)==="cancelled",it=!on&&S&&!!Me&&!!Kt&&(S==null?void 0:S.creator_id)===Kt,mt=Fe,Zt=V?!0:!!Me&&!bn&&(it||mt),Sn=d.useRef(null),Yi=d.useRef(!1),Yc=$s(),Gc=((Ot=Yc.state)==null?void 0:Ot.justCreated)===!0,Gi=d.useRef(!1),Ji=Zt&&!(S!=null&&S.stake_required)&&(S==null?void 0:S.visibility)!=="private"&&(S==null?void 0:S.capacity)==null,Km=Zt;d.useEffect(()=>{!Gc||Gi.current||S&&(Gi.current=!0,Ji&&M(!0),n(`${Yc.pathname}${Yc.search}`,{replace:!0,state:null}))},[Gc,S,Ji]);const Qa=()=>
413{if(!(S!=null&&S.event_dates)||S.event_dates.length===0)return{displayDate:null,displayDateObj:null};const R=new URLSearchParams(window.location.search),Y=R.get("date_id");if(Y){const rt=S.event_dates.find(Yt=>Yt.id===Y);if(rt)return{displayDate:new Date(rt.start_time),displayDateObj:rt}}const ue=R.get("date");if(ue){const rt=new Date(ue).getTime(),Yt=S.event_dates.find(Ze=>new Date(Ze.start_time).getTime()===rt);if(Yt)return{displayDate:new Date(Yt.start_time),displayDateObj:Yt}}const we=Date.now(),Se=S.event_dates.map(rt=>new Date(rt.start_time).getTime()),Ke=Se.filter(rt=>rt>we),Qe=Ke.length?Math.min(...Ke):Math.max(...Se),ht=new Date(Qe),Xe=S.event_dates.find(rt=>new Date(rt.start_time).getTime()===Qe)??null;return{displayDate:ht,displayDateObj:Xe}},{displayDate:Dt,displayDateObj:F}=Qa(),{data:Xa,refetch:Bo}=a7(V||S==null?void 0:S.id,(F==null?void 0:F.id)??null),Za=["linkedin","x","instagram"].filter(R=>!(Xa??[]).includes(R)),Fs=async R=>{var Y;if(!H){z(R);try{const{data:ue}=await pe.auth.getSession(),we=(Y=ue==null?void 0:ue.session)==null?void 0:Y.access_token;if(!we){re.error("Not authenticated"),z(null);return}const Se=await fetch(`${dt}/functions/v1/share-event-social`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${we}`},body:JSON.stringify({event_id:S==null?void 0:S.id,event_date_id:(F==null?void 0:F.id)??null,platform:R})}),Ke=await Se.text();if(!Se.ok){let ht=Ke;try{const Xe=JSON.parse(Ke);ht=(Xe==null?void 0:Xe.details)||(Xe==null?void 0:Xe.error)||Ke}catch{}throw new Error(ht)}const Qe=JSON.parse(Ke);await Bo(),z(null),U({platform:R,url:(Qe==null?void 0:Qe.post_url)??null})}catch(ue){console.error("[share-event-social]",ue),z(null);const we=(ue==null?void 0:ue.message)||"";re.error(we?`Failed to feature on ${ia[R]}: ${we.slice(0,240)}`:`Failed to feature on ${ia[R]}`)}}},te=S&&em(S,F),{hasJoinedEvents:Wo,hasCreatedEvents:el}=zb(),{isAttending:uo,status:Mn,rsvp:Ho,isLoading:zr,showAddToCalendar:Ko,setShowAddToCalendar:tl,dismissAddToCalendar:Jc}=QY(S==null?void 0:S.id,Kt,sn,F==null?void 0:F.id,S==null?void 0:S.event_type),[qo,Qi]=d.useState(null);ST(!!qo&&!!(S!=null&&S.id)&&!V,async()=>{const{data:{session:R}}=await pe.auth.getSession();if(!(R!=null&&R.access_token))return;const Y=await fetch(`${dt}/functions/v1/check-staaake-stake`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${R.access_token}`},body:JSON.stringify({event_id:S.id,...sn?{viewer_username:sn}:{}})});if(!Y.ok)return;const ue=await Y.json().catch(()=>null);(ue==null?void 0:ue.allowed)===!0&&(Qi(null),re.success("Stake confirmed, you can now join."))});const gt=pt().siteKey==="inpersondates",lf=Dt?Dt.getTime()-6*60*60*1e3:null,fo=!!(lf&&Date.now()>=lf),{bucket:cf,isReady:Xi}=Fm(),uf=gt&&(S!=null&&S.creator_id)?[S.creator_id]:[],{buckets:nl,isReady:df}=zm(uf,gt&&!V&&!it&&!mt),{profile:Qc,isReady:Xc}=Bm(),{profiles:rl,isReady:Zi}=Wm(uf,gt&&!V&&!it&&!mt),Zc=gt&&!V&&!!Me&&!it&&!mt&&!!S&&Xi&&df&&(!cf||nl.get(S.creator_id)!==cf);d.useEffect(()=>{Zc&&n(qu(),{replace:!0})},[Zc,n]);const{profile:$t,identity:pn,isComplete:ea,isReady:eu}=Tm(),Br=gt&&!mt&&!V&&!(Me&&sn&&ea),ta=()=>{if(!Me){lr(!0);return}if(!sn){_n(!0);return}if(eu&&!ea){h(!0);return}},sl=R=>{if(Br){ta();return}Zn(R)},gs=S!=null&&S.creator_id?rl.get(S.creator_id)??null:null,tu=gt&&!V&&!it&&!mt&&!!S&&!!Me&&!!sn&&ea&&Xc&&Zi&&!Gb(Qc,gs),Vo=gt&&(it||Mn==="selected"),{data:Qb}=XY(V||S==null?void 0:S.id,F==null?void 0:F.id),{data:ff}=s7(V||S==null?void 0:S.id,F==null?void 0:F.luma_event_id),{data:qm}=o7(V||S==null?void 0:S.id,F==null?void 0:F.eventbrite_event_id),{data:na}=i7(V||S==null?void 0:S.id,F==null?void 0:F.meetup_event_id),{data:kr}=ZY(V||S==null?void 0:S.id,Zt,F==null?void 0:F.id),{counts:an}=BV(V||S==null?void 0:S.id,F==null?void 0:F.id),ys=V?c7:Qb??[],nu=V?[{first_name:"Emma",last_name:"Wilson"},{first_name:"Raj",last_name:"Patel"},{first_name:"Nina",last_name:"Chen"}]:ff??[],ru=V?[{first_name:"Alex",last_name:"Brown"},{first_name:"Sam",last_name:"Lee"}]:qm??[],il=V?[{first_name:"Chris",last_name:"Park"},{first_name:"Jordan",last_name:"Ng"}]:na??[];d.useEffect(()=>{const R=F==null?void 0:F.luma_event_id,Y=F==null?void 0:F.id,ue=`${S==null?void 0:S.id}-${Y}-${R}`;!R||V||!(S!=null&&S.id)||Sn.current!==ue&&(Sn.current=ue,fetch(`${dt}/functions/v1/check-luma-event`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${_r}`},body:JSON.stringify({event_id:S.id,event_date_id:Y,luma_event_id:R})}).then(we=>we.json()).then(we=>{we.exists===!1&&t.invalidateQueries({queryKey:["event",e]})}).catch(we=>console.error("[luma-check] error",we)))},[S==null?void 0:S.id,F==null?void 0:F.id,F==null?void 0:F.luma_event_id]),d.useEffect(()=>{const R=F==null?void 0:F.luma_event_id;if(!R||V||!(S!=null&&S.id))return;let Y=!1;const ue=async()=>
413{if(Y||document.hidden)return;const{data:{session:Se}}=await pe.auth.getSession();Se!=null&&Se.access_token&&(Y=!0,fetch(`${dt}/functions/v1/sync-luma-attendees`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${Se.access_token}`},body:JSON.stringify({event_id:S.id,luma_event_id:R})}).then(Ke=>Ke.json()).then(()=>{t.invalidateQueries({queryKey:["luma-attendees",S.id]}),t.invalidateQueries({queryKey:["event-attendees",S.id]}),t.invalidateQueries({queryKey:["attendee-counts"]}),t.invalidateQueries({queryKey:["detailed-event-attendees",S.id]})}).catch(Ke=>console.error("[luma-sync] error",Ke)).finally(()=>{Y=!1}))};ue();const we=setInterval(ue,15e3);return()=>clearInterval(we)},[S==null?void 0:S.id,F==null?void 0:F.luma_event_id]),d.useEffect(()=>{const R=F==null?void 0:F.eventbrite_event_id;if(!R||V||!(S!=null&&S.id))return;let Y=!1;const ue=async()=>{if(Y||document.hidden)return;const{data:{session:Se}}=await pe.auth.getSession();Se!=null&&Se.access_token&&(Y=!0,fetch(`${dt}/functions/v1/sync-eventbrite-attendees`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${Se.access_token}`},body:JSON.stringify({event_id:S.id,eventbrite_event_id:R})}).then(Ke=>Ke.json()).then(()=>{t.invalidateQueries({queryKey:["eventbrite-attendees",S.id]}),t.invalidateQueries({queryKey:["event-attendees",S.id]}),t.invalidateQueries({queryKey:["attendee-counts"]}),t.invalidateQueries({queryKey:["detailed-event-attendees",S.id]})}).catch(Ke=>console.error("[eb-sync] error",Ke)).finally(()=>{Y=!1}))};ue();const we=setInterval(ue,15e3);return()=>clearInterval(we)},[S==null?void 0:S.id,F==null?void 0:F.eventbrite_event_id]),d.useEffect(()=>{const R=F==null?void 0:F.meetup_event_id;if(!R||V||!(S!=null&&S.id))return;let Y=!1;const ue=async()=>{if(Y||document.hidden)return;const{data:{session:Se}}=await pe.auth.getSession();Se!=null&&Se.access_token&&(Y=!0,fetch(`${dt}/functions/v1/sync-meetup-attendees`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${Se.access_token}`},body:JSON.stringify({event_id:S.id,meetup_event_id:R})}).then(Ke=>Ke.json()).then(()=>{t.invalidateQueries({queryKey:["meetup-attendees",S.id]}),t.invalidateQueries({queryKey:["event-attendees",S.id]}),t.invalidateQueries({queryKey:["attendee-counts"]}),t.invalidateQueries({queryKey:["detailed-event-attendees",S.id]})}).catch(Ke=>console.error("[meetup-sync] error",Ke)).finally(()=>{Y=!1}))};ue();const we=setInterval(ue,15e3);return()=>clearInterval(we)},[S==null?void 0:S.id,F==null?void 0:F.meetup_event_id]);const zn=(()=>{var Y,ue;return te!=null&&te.venue_name?te.venue_name:((ue=(((Y=te==null?void 0:te.location_name)==null?void 0:Y.split(","))??[])[0])==null?void 0:ue.trim())||null})(),zs=(()=>{var Y;if(te!=null&&te.venue_name)return(te==null?void 0:te.location_name)||null;const R=((Y=te==null?void 0:te.location_name)==null?void 0:Y.split(","))??[];return R.length>1?R.slice(1).join(",").trim():null})(),ss=(S==null?void 0:S.creator_username)||((Sr=S==null?void 0:S.users)==null?void 0:Sr.username),Vm=()=>{var ue,we,Se;const R=(ue=S==null?void 0:S.users)==null?void 0:ue.first_name,Y=(we=S==null?void 0:S.users)==null?void 0:we.last_name;return R&&Y?`${R[0]}${Y[0]}`.toUpperCase():((Se=ss==null?void 0:ss[0])==null?void 0:Se.toUpperCase())??"?"},Ym=()=>S!=null&&S.location_lat&&(S!=null&&S.location_lng)?`https://www.google.com/maps?q=${S.location_lat},${S.location_lng}&z=15&output=embed`:te!=null&&te.location_name?`https://www.google.com/maps?q=${encodeURIComponent(S.location_name)}&z=15&output=embed`:null,al=()=>{const R=[zn,zs].filter(Boolean).join(" ");return R?`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(R)}`:null},ll=Ym(),cl=al(),ul=!!(S!=null&&S.stake_required)&&!uo,Gm=gt&&!Vo,I=R=>{if(S!=null&&S.id){if(Br){ta();return}if(!(gt&&!V&&!it&&!mt&&!l&&!(R!=null&&R.fromCompatibilityModal)&&(!Xc||!Zi))){if(tu){f(!0);return}Zn(async()=>{if(Kt)if(uo)v(!0);else try{const Y=await Ho("join");Y!=null&&Y.stakeBlocked&&Qi({host_username:Y.host_username,min_tier:Y.min_tier})}catch{}})}}},ne=()=>{if(V){c(!0);return}if(it||mt){c(!0);return}if(Br){ta();return}if(!(gt&&(!Xc||!Zi))){if(tu){f(!0);return}Zn(async()=>{c(!0)})}},de=async()=>{try{await Ho("leave")}catch{}v(!1)},_e=R=>{const Y=()=>I(R);return bn?i.jsx(ee,{size:"lg",disabled:!0,className:"w-full rounded-xl text-base font-semibold h-12",children:"Loading..."}):fo&&Mn!=="selected"?i.jsx(ee,{size:"lg",disabled:!0,className:"w-full rounded-xl text-base font-semibold h-12",children:"Closed"}):Mn==="selected"?i.jsxs("div",{className:"space-y-2",children:[i.jsx(ee,{size:"lg",disabled:!0,className:"w-full rounded-xl text-base font-semibold h-12 bg-secondary text-primary border border-primary hover:bg-secondary disabled:opacity-100",children:"Selected ✓"}),!fo&&i.jsx(ee,{variant:"outline",className:"w-full",onClick:()=>v(!0),disabled:zr,children:zr?"Cancelling...":"Cancel selection"})]}):Mn==="pending"?i.jsxs("div",{className:"w-full flex items-stretch h-12 rounded-xl overflow-hidden border border-border bg-secondary",children:[i.jsx("div",{className:"flex-1 flex items-center justify-center text-base font-semibold text-secondary-foreground",children:"Pending"}),!fo&&i.jsx("button",{type:"button",onClick:()=>v(!0),disabled:zr,className:"px-4 border-l border-border text-sm font-medium text-muted-foreground hover:text-foreground hover:bg-accent/10 transition-colors disabled:opacity-50",children:zr?"Cancelling...":"Cancel"})]}):i.jsx(ee,{size:"lg",className:"w-full rounded-xl text-base font-semibold h-12",onClick:Y,disabled:zr,children:zr?"Saving...":"Interested"})},Ge=async()=>{await navigator.clipboard.writeText(He().eventUrl),re.success("Link copied")},Re=async()=>{const R=F==null?void 0:F.luma_event_id;if(!R){x("luma");return}L(!0);try{const Y=await fetch(`${dt}/functions/v1/check-luma-event`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${_r}`},body:JSON.stringify({event_id:S==null?void 0:S.id,event_date_id:F==null?void 0:F.id,luma_event_id:R})});if(!Y.ok){re.error("Failed to check Luma status");return}
413(await Y.json()).exists?j(!0):(t.invalidateQueries({queryKey:["event",e]}),re("Luma event was already removed"))}catch(Y){console.error("[check-luma]",Y),re.error("Failed to check Luma status")}finally{L(!1)}},en=async()=>{const R=F==null?void 0:F.meetup_event_id;if(!R){x("meetup");return}ge(!0);try{const Y=await fetch(`${dt}/functions/v1/check-meetup-event`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${_r}`},body:JSON.stringify({event_id:S==null?void 0:S.id,event_date_id:F==null?void 0:F.id,meetup_event_id:R})});if(!Y.ok){re.error("Failed to check Meetup status");return}(await Y.json()).exists?me(!0):(t.invalidateQueries({queryKey:["event",e]}),re("Meetup event was already removed"))}catch(Y){console.error("[check-meetup]",Y),re.error("Failed to check Meetup status")}finally{ge(!1)}},Je=(R,Y,ue)=>{var we;return R&&Y?`${R[0]}${Y[0]}`.toUpperCase():((we=ue==null?void 0:ue[0])==null?void 0:we.toUpperCase())??"?"},at="w-8 h-8 flex items-center justify-center rounded-md border border-border text-muted-foreground hover:text-primary hover:border-primary transition",Pn=(R,Y)=>{tt(R),setTimeout(()=>{window.open(Y,"_blank","noopener,noreferrer"),tt(null)},2e3)},He=()=>{const R=new URL(window.location.href),Y=`${R.origin}${R.pathname}`,we=`${(S==null?void 0:S.title)||(S==null?void 0:S.event_name)||"Join this event"}
414${gt?"Who's interested?":"Who's going?"}
415${Y}`;return{eventUrl:Y,shareText:we}},At=()=>{const{shareText:R}=He();Pn("x",`https://twitter.com/intent/tweet?text=${encodeURIComponent(R)}`)},er=()=>{const{eventUrl:R}=He();Pn("linkedin",`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(R)}`)},Ut=()=>{const{shareText:R}=He();Pn("whatsapp",`https://wa.me/?text=${encodeURIComponent(R)}`)},nt=async()=>{const{eventUrl:R}=He();try{await navigator.clipboard.writeText(R)}catch{}tt("instagram"),setTimeout(()=>{window.open("https://www.instagram.com/","_blank","noopener,noreferrer"),tt(null)},2e3)},It=()=>{const{eventUrl:R}=He(),Y=(S==null?void 0:S.title)||(S==null?void 0:S.event_name)||"";tt("native"),setTimeout(()=>{tt(null),typeof navigator<"u"&&navigator.share?navigator.share({url:R,title:Y}).catch(()=>{}):navigator!=null&&navigator.clipboard&&navigator.clipboard.writeText(R).then(()=>re("Link copied",{position:"bottom-left"})).catch(()=>{})},2e3)};return!V&&!S&&(ft||bn)?i.jsxs("div",{className:"relative z-10 h-screen flex flex-col",children:[i.jsx(Kl,{}),i.jsx("div",{className:"flex-1 flex items-center justify-center",children:i.jsx("p",{className:"text-muted-foreground",children:"Loading event..."})}),i.jsx(ql,{activeTab:"events",onTabChange:()=>{},hasJoinedEvents:Wo,hasCreatedEvents:el})]}):!V&&gt&&S&&Me&&!it&&!mt&&(!Xi||!df)?i.jsxs("div",{className:"relative z-10 h-screen flex flex-col",children:[i.jsx(Kl,{}),i.jsx("div",{className:"flex-1 flex items-center justify-center",children:i.jsx("p",{className:"text-muted-foreground",children:"Loading event..."})}),i.jsx(ql,{activeTab:"events",onTabChange:()=>{},hasJoinedEvents:Wo,hasCreatedEvents:el})]}):!V&&(kn||!S)?i.jsxs("div",{className:"relative z-10 h-screen flex flex-col",children:[i.jsx(Kl,{}),i.jsx("div",{className:"flex-1 flex items-center justify-center",children:i.jsx("p",{className:"text-muted-foreground",children:"Event not found"})}),i.jsx(ql,{activeTab:"events",onTabChange:()=>{},hasJoinedEvents:Wo,hasCreatedEvents:el})]}):i.jsxs("div",{className:"relative z-10 h-screen flex flex-col",children:[i.jsx(Kl,{}),T&&i.jsx("div",{className:"fixed inset-0 z-[60] bg-background/80 animate-fade-in",onClick:()=>M(!1)}),i.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:i.jsxs("div",{className:"max-w-2xl mx-auto px-4 py-8 space-y-6 pb-20",children:[on&&i.jsx("div",{className:"bg-destructive/10 border border-destructive/30 rounded-lg px-4 py-3 text-destructive font-semibold text-sm",children:"This event has been cancelled."}),i.jsx("section",{className:"w-full",children:i.jsx("h1",{className:"w-full text-2xl md:text-3xl font-bold text-foreground leading-tight break-words",children:te==null?void 0:te.event_name})}),(()=>{const R=!!(F!=null&&F.luma_event_id),Y=!!(F!=null&&F.eventbrite_event_id),ue=!!(F!=null&&F.meetup_event_id),we=i.jsxs(i.Fragment,{children:[i.jsxs("button",{onClick:Ge,className:"inline-flex items-center gap-1.5 border-2 border-border text-foreground hover:bg-accent transition-colors rounded-lg px-3 py-1.5 text-sm font-semibold bg-background",children:[i.jsx(Cu,{className:"h-4 w-4"}),"Share"]}),i.jsxs("div",{className:`flex flex-col gap-2 items-end ${T?"relative z-[70]":""}`,children:[Zt&&!(S!=null&&S.stake_required)&&(S==null?void 0:S.visibility)!=="private"&&(S==null?void 0:S.capacity)==null&&i.jsxs("button",{onClick:Re,disabled:G,className:`inline-flex items-center gap-1.5 border-2 border-border text-foreground hover:bg-accent transition-colors rounded-lg px-3 py-1.5 text-sm font-semibold bg-background ${R||G?"opacity-60":""}`,children:[R||G?i.jsx(yh,{className:"h-4 w-4"}):i.jsx(Cu,{className:"h-4 w-4"}),"Luma"]}),Zt&&!(S!=null&&S.stake_required)&&(S==null?void 0:S.visibility)!=="private"&&(S==null?void 0:S.capacity)==null&&i.jsxs("button",{onClick:()=>{(F==null?void 0:F.eventbrite_event_id)?J(!0):x("eventbrite")},className:`inline-flex items-center gap-1.5 border-2 border-border text-foreground hover:bg-accent transition-colors rounded-lg px-3 py-1.5 text-sm font-semibold bg-background ${Y?"opacity-60":""}`,children:[Y?i.jsx(yh,{className:"h-4 w-4"}):i.jsx(Cu,{className:"h-4 w-4"}),"Eventbrite"]}),Zt&&!(S!=null&&S.stake_required)&&(S==null?void 0:S.visibility)!=="private"&&(S==null?void 0:S.capacity)==null&&i.jsxs("button",{onClick:en,disabled:fe,className:`inline-flex items-center gap-1.5 border-2 border-border text-foreground hover:bg-accent transition-colors rounded-lg px-3 py-1.5 text-sm font-semibold bg-background ${ue||fe?"opacity-60":""}`,children:[ue||fe?i.jsx(yh,{className:"h-4 w-4"}):i.jsx(Cu,{className:"h-4 w-4"}),"Meetup"]})]})]}),Se=pt().siteKey==="connectonlinemeets";return i.jsxs("div",{className:"flex gap-3 items-start",children:[i.jsx("div",{className:"relative w-[200px] h-[200px] flex-shrink-0",children:i.jsx("img",{src:(te==null?void 0:te.custom_image_url)||pt().logo,alt:"",className:"w-[200px] h-[200px] rounded-xl object-cover"})}),i.jsxs("div",{className:"relative flex-1",children:[!ul&&!Gm&&!Se&&ll&&cl&&i.jsx("a",{href:cl,target:"_blank",rel:"noopener noreferrer",className:"block",children:i.jsxs("div",{className:"rounded-xl overflow-hidden relative group cursor-pointer",children:[i.jsx("iframe",{title:"Event location map",src:ll,className:"w-full h-[200px] pointer-events-none",style:{border:0,filter:"invert(90%) hue-rotate(180deg) brightness(0.95) contrast(0.9)"},loading:"lazy",referrerPolicy:"no-referrer-when-downgrade"}),i.jsx("div",{className:"absolute inset-0 bg-transparent group-hover:bg-primary/10 transition-colors flex items-center justify-center",children:i.jsxs("span",{className:"opacity-0 group-hover:opacity-100 transition-opacity text-xs font-semibold text-primary bg-background/80 backdrop-blur-sm px-3 py-1.5 rounded-lg flex items-center gap-1.5",children:[i.jsx(Uu,{className:"h-3.5 w-3.5"})," Open in Maps"]})})]})}),i.jsx("div",{className:`absolute top-3 right-3 flex flex-col gap-2 items-end pointer-events-auto ${T?"":"z-20"}`,onClickCapture:()=>M(!1),children:we}),T&&i.jsx("div",{className:"absolute top-full right-3 mt-3 z-[70] flex items-start gap-2 animate-fade-in",children:i.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-card px-3 py-2 shadow-lg",children:[i.jsx(zL,{className:"h-4 w-4 text-primary"}),i.jsx("span",{className:"text-sm font-semibold text-card-foreground",children:"Sync your events"}),i.jsx("button",{type:"button","aria-label":"Dismiss",onClick:()=>M(!1),className:"ml-1 text-muted-foreground hover:text-foreground transition-colors",children:i.jsx($c,{
415className:"h-4 w-4"})})]})})]})]})})(),!on&&(()=>{const R=(F==null?void 0:F.luma_url)??(S==null?void 0:S.luma_url)??null,Y=(F==null?void 0:F.eventbrite_url)??(S==null?void 0:S.eventbrite_url)??null,ue=(F==null?void 0:F.meetup_url)??(S==null?void 0:S.meetup_url)??null,we=R??(V?"https://lu.ma/example":null),Se=Y??(V?"https://eventbrite.com/example":null),Ke=ue??(V?"https://meetup.com/example":null),Qe=!!(we||Se||Ke);return i.jsxs("div",{className:Qe?"space-y-2 !mt-2":"space-y-2",children:[Km&&(mt||Za.length>0)&&(()=>{const ht="shrink-0 flex items-center justify-center gap-2 px-3 h-10 rounded-md border-2 border-muted-foreground/40 text-foreground/80 hover:text-primary hover:border-primary transition",Xe=mt?["linkedin","x","instagram"]:Za,rt=Xe.length>1?"flex-1":"w-full";return i.jsx("div",{className:"relative",children:i.jsx("div",{className:"flex gap-3",children:Xe.map(Yt=>{const Ze=(Xa??[]).includes(Yt);return i.jsx("button",{type:"button",onClick:Ze?void 0:()=>$(Yt),disabled:Ze||!!H,title:Ze?"Already shared":void 0,className:`${rt} ${ht} ${Ze?"opacity-50 cursor-default hover:text-foreground/80 hover:border-muted-foreground/40":""} ${H&&!Ze?"opacity-60":""}`,children:i.jsxs("span",{className:"flex flex-col items-center justify-center leading-none",children:[i.jsx("span",{className:"text-sm leading-none",children:ia[Yt]}),i.jsx("span",{className:"mt-0.5 text-[10px] leading-none text-muted-foreground",children:"Feature"})]})},Yt)})})})})(),(()=>{if(!we&&!Se&&!Ke)return null;const ht="shrink-0 flex items-center gap-2 px-3 h-10 rounded-md border border-border text-muted-foreground hover:text-primary hover:border-primary transition",rt=[we,Se,Ke].filter(Boolean).length>1?"flex-1":"w-full";return i.jsxs("div",{className:"flex gap-3",children:[we&&i.jsx("button",{type:"button",className:`${rt} justify-center ${ht}`,onClick:()=>window.open(we,"_blank","noopener,noreferrer"),children:i.jsx("span",{className:"text-sm",children:"Luma"})}),Se&&i.jsx("button",{type:"button",className:`${rt} justify-center ${ht}`,onClick:()=>window.open(Se,"_blank","noopener,noreferrer"),children:i.jsx("span",{className:"text-sm",children:"Eventbrite"})}),Ke&&i.jsx("button",{type:"button",className:`${rt} justify-center ${ht}`,onClick:()=>window.open(Ke,"_blank","noopener,noreferrer"),children:i.jsx("span",{className:"text-sm",children:"Meetup"})})]})})(),(()=>{const ht=gt&&!it&&!mt;return gt&&(it||mt)?null:ht?_e():i.jsx(ee,{size:"lg",className:"w-full rounded-xl text-base font-semibold h-12",variant:uo?"secondary":"default",onClick:()=>I(),disabled:bn||zr,children:bn?"Loading...":zr?"Saving...":uo?"Cancel":"Attend"})})(),Zt&&i.jsxs(ee,{size:"lg",variant:"outline",className:"w-full rounded-xl text-base font-semibold h-12",onClick:()=>{var ht;S!=null&&S.is_recurring&&((ht=S==null?void 0:S.event_dates)==null?void 0:ht.length)>1?ut({type:"edit"}):(Ae(!1),rn(!1),s(!0))},children:[i.jsx(PE,{className:"h-4 w-4"}),"Edit"]})]})})(),Dt&&i.jsxs("section",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"flex items-center justify-center w-10 h-10 rounded-lg bg-card border border-border",children:i.jsxs("div",{className:"text-center leading-none",children:[i.jsx("div",{className:"text-[10px] font-semibold text-primary uppercase",children:OV(Dt.getTime(),(S==null?void 0:S.timezone)??Intl.DateTimeFormat().resolvedOptions().timeZone)}),i.jsx("div",{className:"text-sm font-bold text-foreground",children:MV(Dt.getTime(),(S==null?void 0:S.timezone)??Intl.DateTimeFormat().resolvedOptions().timeZone)})]})}),i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:IV(Dt.getTime(),(S==null?void 0:S.timezone)??Intl.DateTimeFormat().resolvedOptions().timeZone)}),i.jsx("p",{className:"text-xs text-muted-foreground",children:PV(Dt.getTime(),(S==null?void 0:S.timezone)??Intl.DateTimeFormat().resolvedOptions().timeZone,(F!=null&&F.end_time?Math.round((new Date(F.end_time).getTime()-Dt.getTime())/6e4):te==null?void 0:te.custom_duration_minutes)??null)}),(S==null?void 0:S.created_at)&&new Date(S.created_at)<new Date("2026-04-09")&&(S==null?void 0:S.timezone)&&S.timezone!=="Asia/Kolkata"&&i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Event time may have been affected by a re
415cent timezone update. If incorrect, the organizer can edit and re-save to fix."})]})]}),uo&&!V&&i.jsx("div",{className:"text-center",children:i.jsx("button",{type:"button",onClick:()=>tl(!0),className:"text-sm font-medium text-primary hover:underline",children:"Add to Calendar"})})]}),(()=>{if(pt().siteKey==="connectonlinemeets"){const Y=(F==null?void 0:F.join_url)||"",ue=/^https?:\/\//i.test(Y)?Y:Y.includes(".")?`https://${Y}`:"",we=/^https?:\/\/[^\s]+$/i.test(ue);return i.jsx("section",{className:"space-y-3",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("div",{className:"flex items-center justify-center w-10 h-10 rounded-lg bg-card border border-border flex-shrink-0",children:i.jsx(OE,{className:"h-4 w-4 min-w-[16px] flex-shrink-0 text-muted-foreground"})}),i.jsx("div",{children:we?i.jsx("a",{href:ue,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-bold text-primary hover:underline",children:"Join Call"}):i.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"To be announced"})})]})})}if(!zn&&!ul)return null;if(gt&&!Vo){const Y=((te==null?void 0:te.location_name)||"").split(",").map(we=>we.trim()).filter(Boolean),ue=Y.length>=2?`${Y[Y.length-2]}, ${Y[Y.length-1]}`:Y[Y.length-1]||"";return i.jsx("section",{className:"space-y-3",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("div",{className:"flex items-center justify-center w-10 h-10 rounded-lg bg-card border border-border flex-shrink-0",children:i.jsx(Uu,{className:"h-4 w-4 min-w-[16px] flex-shrink-0 text-muted-foreground"})}),i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-bold text-foreground",children:ue||"Location to be revealed"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"If selected, you'll receive the exact address."})]})]})})}return i.jsx("section",{className:"space-y-3",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("div",{className:"flex items-center justify-center w-10 h-10 rounded-lg bg-card border border-border flex-shrink-0",children:i.jsx(Uu,{className:"h-4 w-4 min-w-[16px] flex-shrink-0 text-muted-foreground"})}),i.jsx("div",{children:ul?i.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Location visible after RSVP"}):cl?i.jsxs("a",{href:cl,target:"_blank",rel:"noopener noreferrer",className:"block cursor-pointer hover:opacity-80 transition-opacity",children:[i.jsx("p",{className:"text-sm font-bold text-foreground",children:zn}),zs&&i.jsx("p",{className:"text-xs text-muted-foreground",children:zs}),(S==null?void 0:S.location_note)&&i.jsx("p",{className:"text-xs text-primary italic mt-0.5",children:S.location_note})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"text-sm font-bold text-foreground",children:zn}),zs&&i.jsx("p",{className:"text-xs text-muted-foreground",children:zs}),(S==null?void 0:S.location_note)&&i.jsx("p",{className:"text-xs text-primary italic mt-0.5",children:S.location_note})]})})]})})})(),pt().siteKey==="inpersondates"&&(()=>{var Yt,Ze;const R=((Ze=(Yt=S==null?void 0:S.users)==null?void 0:Yt.dating_profiles)==null?void 0:Ze[0])??null,Y=R!=null&&R.relationship_intent?pw[R.relationship_intent]??null:null,ue=[R==null?void 0:R.home_city,R==null?void 0:R.home_country].filter(Boolean).join(", ")||null;R!=null&&R.mother_language;const we=(R==null?void 0:R.english_level)||null,Se=Cn=>Cn?Cn.charAt(0).toUpperCase()+Cn.slice(1):null,Ke=Se(R==null?void 0:R.hair_color),Qe=Se(R==null?void 0:R.eye_color),ht=Se(R==null?void 0:R.skin_tone),Xe=Se(R==null?void 0:R.hair_length),rt=[["Current home",ue??"-"],["Hair color",Ke??"-"],["Eye color",Qe??"-"],["Skin tone",ht??"-"],["Hair length",Xe??"-"],["English level",we??"-"]];return i.jsxs("section",{className:"space-y-3",children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"About date creator"}),i.jsx(Gu,{className:"bg-border"}),i.jsxs("div",{className:"space-y-2",children:[Y&&i.jsx("div",{className:"text-sm text-foreground font-medium",children:Y}),rt.map(([Cn,hf])=>i.jsxs("div",{className:"flex items-center justify-between text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:Cn}),i.jsx("span",{className:"text-foreground font-medium",children:hf})]},Cn))]}),i.jsx(ee,{variant:"outline",className:"w-full border-primary",onClick:ne,children:"Full bio and compatibility"})]})})(),Hx()&&((yt=S==null?void 0:S.polls)==null?void 0:yt.length)>0&&i.jsx(KY,{eventCode:S.event_code,polls:S.polls,canFinalize:Zt,previewMode:V,viewerUserId:Kt,guardAction:sl,onChanged:()=>Hn(),maskLocationToCity:gt&&!Vo,maskCityFallback:Zp(te==null?void 0:te.location_name),hideOriginalLocationOption:gt&&!(it||mt),protectOriginalLocationOption:gt&&(it||mt)}),i.jsxs("section",{className:"space-y-3",children:[(te==null?void 0:te.custom_description)&&i.jsx("p",{className:"text-sm text-foreground leading-relaxed whitespace-pre-wrap",children:S.custom_description}),i.jsxs("h2",{className:"text-lg font-semibold text-foreground",children:["About ",pt().title]}),i.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed whitespace-pre-wrap",children:pt().descriptionText})]}),i.jsxs("section",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(IE,{className:"h-4 w-4 text-muted-foreground"}),i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Host"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{type:"button","aria-label":"Share on X",className:at,onClick:At,children:i.jsx("svg",{viewBox:"0 0 24 24",className:"w-4 h-4",fill:"
415currentColor","aria-hidden":"true",children:i.jsx("path",{d:"M18.244 2H21l-6.52 7.45L22 22h-6.93l-4.84-6.32L4.6 22H2l7-7.99L1.5 2h7.04l4.38 5.79L18.244 2zm-2.43 18h1.86L7.27 4H5.3l10.515 16z"})})}),i.jsx("button",{type:"button","aria-label":"Share on LinkedIn",className:at,onClick:er,children:i.jsx(KL,{className:"w-4 h-4"})}),i.jsx("button",{type:"button","aria-label":"Share on WhatsApp",className:at,onClick:Ut,children:i.jsx(YL,{className:"w-4 h-4"})}),i.jsx("button",{type:"button","aria-label":"Share on Instagram",className:at,onClick:nt,children:i.jsx(HL,{className:"w-4 h-4"})}),i.jsx("button",{type:"button","aria-label":"Share",className:at,onClick:It,children:i.jsx(jx,{className:"w-4 h-4"})})]})]}),i.jsx(Gu,{className:"bg-border"}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("a",{href:Pi(ss),onClick:R=>Aa(R,ss),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 flex-1",children:[i.jsx(km,{className:"h-10 w-10",children:i.jsx(Sm,{className:"bg-primary text-primary-foreground text-sm font-bold",children:Vm()})}),i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:ss||"unknown"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:[(ke=S==null?void 0:S.users)==null?void 0:ke.first_name," ",(Ie=S==null?void 0:S.users)==null?void 0:Ie.last_name]})]})]}),ss&&i.jsx(ee,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>n(`/${ss}`),children:"Full calendar"})]})]}),i.jsxs("section",{className:"space-y-3",children:[gt&&(Zt||Mn==="selected")&&(()=>{const R=((kr==null?void 0:kr.platform)??[]).filter(we=>(we==null?void 0:we.status)==="selected").length,ue=Zt?R:Mn==="selected"?1:0;return i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(xv,{className:"h-4 w-4 text-muted-foreground"}),i.jsxs("h2",{className:"text-lg font-semibold text-foreground",children:[ue," / 5 Selected"]})]})})(),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(xv,{className:"h-4 w-4 text-muted-foreground"}),i.jsxs("h2",{className:"text-lg font-semibold text-foreground",children:[V?ys.length+(nu??[]).length+(ru??[]).length+(il??[]).length:(an==null?void 0:an.total)??ys.length+(nu??[]).length+(ru??[]).length+(il??[]).length,(te==null?void 0:te.capacity)!=null&&` / ${te.capacity}`," ",gt?"Interested":"People going"]})]}),i.jsx(Gu,{className:"bg-border"}),Zt&&((an==null?void 0:an.platform)??ys.length)>0&&i.jsxs("p",{className:"text-xs text-muted-foreground mb-2",children:["Platform ",(an==null?void 0:an.platform)??ys.length]}),(!!Kt||V)&&ys.length>0&&i.jsx("div",{className:"flex flex-wrap gap-2",children:ys.map((R,Y)=>{const ue=YY(R.first_name,R.last_name,R.username),we=i.jsxs("div",{className:"flex items-center gap-1.5 bg-card border border-border rounded-full pl-1 pr-3 py-1 hover:border-primary/50 transition-colors",children:[i.jsx("div",{className:"flex items-center justify-center w-7 h-7 rounded-full text-[10px] font-bold text-primary-foreground bg-primary",children:Je(R.first_name,R.last_name,R.username)}),i.jsx("span",{className:"text-sm font-medium text-foreground",children:ue})]},Y);return R.username?i.jsx("a",{href:Pi(R.username),onClick:Se=>Aa(Se,R.username),target:"_blank",rel:"noopener noreferrer",children:we},Y):we})}),Zt&&(V||!!(F!=null&&F.luma_event_id))&&i.jsx("div",{className:"mt-4",children:i.jsxs("p",{className:"text-xs text-muted-foreground mb-2",children:["Luma ",(an==null?void 0:an.luma)??nu.length]})}),Zt&&(V||!!(F!=null&&F.eventbrite_event_id))&&i.jsx("div",{className:"mt-4",children:i.jsxs("p",{className:"text-xs text-muted-foreground mb-2",children:["Eventbrite ",(an==null?void 0:an.eventbrite)??ru.length]})}),Zt&&(V||!!(F!=null&&F.meetup_event_id))&&i.jsx("div",{className:"mt-4",children:i.jsxs("p",{className:"text-xs text-muted-foreground mb-2",children:["Meetup ",(an==null?void 0:an.meetup)??il.length]})}),Zt&&i.jsx(r7,{attendees:kr,isPreview:V,siteKey:pt().siteKey,isAdmin:mt})]})]})}),i.jsx(ql,{activeTab:"events",onTabChange:()=>{},hasJoinedEvents:Wo,hasCreatedEvents:el}),i.jsx(Vc,{open:xt,onOpenChange:lr,onAuthSuccess:Xt,mode:"login"}),i.jsx(Db,{open:p,onOpenChange:h}),i.jsx(RY,{open:!!Lt,onOpenChange:R=>{R||ut(null)},actionType:(Lt==null?void 0:Lt.type)||"edit",onChoice:async R=>{(Lt==null?void 0:Lt.type)==="edit"?(R==="single"?(Ae(!0),rn(!1)):R==="reset"?(Ae(!1),rn(!0)):(Ae(!1),rn(!1)),ut(null),s(!0)):(Lt==null?void 0:Lt.type)==="delete"&&(ut(null),R==="single"?xr(!0):In(!0))}}),S&&Zt&&i.jsx(iw,{open:r,onOpenChange:R=>{s(R),R||(Ae(!1),rn(!1))},mode:"edit",event:S,eventDateObj:F,localUserId:Kt,singleInstance:Nn,resetOverrides:Xn,onRequestDuplicate:()=>{s(!1),a(!0)},onRequestDelete:()=>{var R;s(!1),S!=null&&S.is_recurring&&((R=S==null?void 0:S.event_dates)==null?void 0:R.length)>1?ut({type:"delete"}):In(!0)}}),S&&Zt&&i.jsx(iw,{open:o,onOpenChange:a,mode:"duplicate",event:S,eventDateObj:F,localUserId:Kt}),i.jsx(LY,{open:u,onOpenChange:f,creatorGender:(gs==null?void 0:gs.gender)??null,creatorInterestedIn:(gs==null?void 0:gs.interested_in)??null}),i.jsx(kV,{open:l,onOpenChange:c,eventId:S==null?void 0:S.id,eventDateId:F==null?void 0:F.id,isCreator:it||je,isAdmin:mt,isLocked:fo,useFakeFallback:V,attendees:V?gt&&(it||je||mt)?u7:void 0:gt&&(it||mt)?((kr==null?void 0:kr.platform)??[]).filter(R=>R.status==="pending"||R.status==="selected").map(R=>({user_id:R.user_id??null,first_name:R.first_name,last_name:R.last_name,username:R.username??null,status:R.status??null,bio:R.bio??null,link:R.link??null,link_label:R.link_label??null,dating_profile:R.dating_profile??null})):void 0,creatorAnswers:((Mt=(Ft=S==null?void 0:S.users)==null?void 0:Ft.dating_profiles)==null?void 0:Mt[0])??null,creatorBio:((Ve=S==null?void 0:S.users)==null?void 0:Ve.bio)??null,creatorLink:((Ln=S==null?void 0:S.users)==null?void 0:Ln.link)??null,creatorLinkLabel:((lt=S==null?void 0:S.users)==null?void 0:lt.link_label)??null,creatorUserId:(S==null?void 0:S.creator_id)??null,creatorFirstName:((Le=S==null?void 0:S.users)==null?void 0:Le.first_name)??null,creatorLastName:((vs=S==null?void 0:S.users)==null?void 0:vs.last_name)??null,creatorUsername:(S==null?void 0:S.creator_username)??((Vt=S==null?void 0:S.users)==null?void 0:Vt.username)??null,viewerAnswers:$t,viewerBio:(pn==null?void 0:pn.bio)??null,viewerLink:(pn==null?void 0:pn.link)??null,viewerLinkLabel:(pn==null?void 0:pn.link_label)??null,viewerFirstName:(pn==null?void 0:pn.first_name)??null,viewerLastName:(pn==null?void 0:pn.last_name)??null,viewerUsername:(pn==null?void 0:pn.username)??null,viewerStatus:Mn==="pending"||Mn==="selected"?Mn:null,interestedSlot:gt&&!it&&!mt?_e({fromCompatibilityModal:!0}):void 0}),i.jsx(Rt,{open:ar,onOpenChange:In,children:i.jsxs(St,{children:[i.jsxs(Ct,{children:[i.jsx(jt,{children:"Cancel Event?"}),i.jsx(Nt,{children:"Are you sure you want to cancel this entire event? All dates will be removed and this cannot be undone."})]}),i.jsxs(Et,{children:[i.jsx(cn,{children:"No"}),i.jsx(ln,{onClick:async()=>{Q(!0);try{const{data:{session:R}}=await pe.auth.getSession();if(!(R!=null&&R.access_token)){re.error("You must be logged in");return}const ue=await fetch("https://errlhmcitfpyyhnwtqrs.supabase.co/functions/v1/cancel-event",{method:"POST",headers:{Authorization:`Bearer ${R.access_token}`,"Content-Type":"application/json"}
415,body:JSON.stringify({event_code:S==null?void 0:S.event_code})});if(!ue.ok){const Ke=await ue.json();throw new Error(Ke.error||"Failed to cancel event")}const we=await ue.json().catch(()=>({})),Se=Array.isArray(we==null?void 0:we.warnings)?we.warnings:[];if(Se.length>0){const Ke=Array.from(new Set(Se.map(Qe=>Qe.platform))).map(Qe=>Qe==="luma"?"Luma":Qe==="eventbrite"?"Eventbrite":Qe).join(" and ");re.warning(`Event cancelled, but ${Ke} did not respond. Please remove it manually on ${Ke}.`)}else re.success("Event cancelled");In(!1),t.invalidateQueries({queryKey:["events"]}),t.invalidateQueries({queryKey:["going-events"]}),n(qu())}catch(R){console.error("[EventDetailPage] Cancel event error:",R),re.error(R.message||"Failed to cancel event")}finally{Q(!1)}},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ur?"Cancelling...":"Yes, Cancel Event"})]})]})}),i.jsx(Rt,{open:On,onOpenChange:xr,children:i.jsxs(St,{children:[i.jsxs(Ct,{children:[i.jsx(jt,{children:"Delete this date?"}),i.jsx(Nt,{children:"Are you sure you want to delete this date from the series? This cannot be undone."})]}),i.jsxs(Et,{children:[i.jsx(cn,{children:"No"}),i.jsx(ln,{onClick:async()=>{try{const{data:{session:R}}=await pe.auth.getSession();if(!(R!=null&&R.access_token)){re.error("You must be logged in");return}const ue=await fetch("https://errlhmcitfpyyhnwtqrs.supabase.co/functions/v1/delete-event-date",{method:"POST",headers:{Authorization:`Bearer ${R.access_token}`,"Content-Type":"application/json"},body:JSON.stringify({event_code:S==null?void 0:S.event_code,event_date_id:F==null?void 0:F.id})}),we=await ue.json();if(!ue.ok)throw new Error(we.error||"Failed to delete date");re.success(we.remaining_dates===0?"Event cancelled":"Date removed"),Array.isArray(we.warnings)&&we.warnings.length>0&&re.warning(we.warnings.join(" ")),xr(!1),t.invalidateQueries({queryKey:["events"]}),t.invalidateQueries({queryKey:["going-events"]}),n(qu())}catch(R){console.error("[EventDetailPage] delete-event-date error:",R),re.error(R.message||"Failed to delete date")}},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Yes, Delete Date"})]})]})}),i.jsx(Rt,{open:m,onOpenChange:v,children:i.jsxs(St,{children:[i.jsxs(Ct,{children:[i.jsx(jt,{children:gt&&Mn==="selected"?"Cancel your date?":"Cancel?"}),i.jsx(Nt,{children:gt?Mn==="selected"?"Are you sure you want to cancel your date? If you cancel, someone else will take your spot.":"Are you sure you want to cancel? The date creator needs to pick dates until 6 hours before the event.":"Are you sure you want to cancel your attendance?"})]}),i.jsxs(Et,{children:[i.jsx(cn,{children:gt?Mn==="selected"?"Keep date":"Keep pending":"Keep attending"}),i.jsx(ln,{onClick:de,children:"Yes, cancel"})]})]})}),i.jsx(zY,{open:Ko,onOpenChange:R=>R?tl(!0):Jc(),title:(S==null?void 0:S.title)??(S==null?void 0:S.event_name)??null,startTimeIso:(F==null?void 0:F.start_time)??null,eventUrl:He().eventUrl}),i.jsx(Rt,{open:!!qo,onOpenChange:R=>{R||Qi(null)},children:i.jsxs(St,{children:[i.jsxs(Ct,{children:[i.jsx(jt,{children:"Stake Required"}),i.jsxs(Nt,{children:['You need a "',qo==null?void 0:qo.min_tier,'" stake or higher in this host to join this event.']})]}),i.jsxs(Et,{children:[i.jsx(cn,{onClick:()=>Qi(null),children:"Cancel"}),i.jsx(ln,{asChild:!0,children:i.jsx("a",{href:Pi(ss),onClick:R=>Aa(R,ss),target:"_blank",rel:"noopener noreferrer",children:"View Host Sheet"})})]})]})}),i.jsx(Rt,{open:!!g,onOpenChange:R=>{R||x(null)},children:i.jsxs(St,{children:[i.jsxs(Ct,{children:[i.jsxs(jt,{children:["Share on ",g?kl[g]:"","?"]}),i.jsxs(Nt,{children:["Are you sure you want to share this event on ",g?kl[g]:"","?"]})]}),i.jsxs(Et,{children:[i.jsx(cn,{children:"Cancel"}),i.jsx(ln,{onClick:async()=>{var we,Se,Ke;const R=g;if(x(null),S!=null&&S.stake_required){re.error("Only free events can be shared");return}if(!F){re.error("Missing event date");return}if(Yi.current)return;Yi.current=!0,_(R),A(!1),y(!0);const Y=setTimeout(()=>A(!0),15e3);let ue=null;try{if(R==="luma"){const{data:Qe}=await pe.auth.getSession(),ht=(we=Qe==null?void 0:Qe.session)==null?void 0:we.access_token;if(!ht){re.error("Not authenticated"),_(null),y(!1),clearTimeout(Y);return}const Xe=S==null?void 0:S.id,rt=await fetch(`${dt}/functions/v1/create-luma-event`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${ht}`},body:JSON.stringify({event_id:S==null?void 0:S.id,event_date_id:F.id,title:te==null?void 0:te.event_name,description:(()=>{const Cn=((te==null?void 0:te.custom_description)||"").trim(),hf=pt().descriptionText;return Cn?`${Cn}
416
417About ${pt().title}
418${hf}`:hf})(),summary:pt().eventbriteSummary,start_time:F.start_time,end_time:F.end_time,location:(S==null?void 0:S.event_type)==="connectonlinemeets"?(F==null?void 0:F.join_url)||"":(te==null?void 0:te.location_name)||"",capacity:S==null?void 0:S.capacity,timezone:(S==null?void 0:S.timezone)||Intl.DateTimeFormat().resolvedOptions().timeZone,event_type:(S==null?void 0:S.event_type)||void 0,username:sn||void 0,place_id:(S==null?void 0:S.event_type)==="connectonlinemeets"?void 0:(S==null?void 0:S.place_id)||void 0,venue_name:(S==null?void 0:S.event_type)==="connectonlinemeets"?void 0:(te==null?void 0:te.venue_name)||void 0,custom_image_url:(te==null?void 0:te.custom_image_url)||void 0,custom_description:(te==null?void 0:te.custom_description)||void 0})}),Yt=await rt.text();if(rt.status===409)throw new eh;if(!rt.ok)throw new Error(`Luma failed: ${Yt}`);const Ze=JSON.parse(Yt);Sn.current=`${Xe}-${F.id}-${Ze.luma_event_id}`,ue=Ze.luma_url??null,t.invalidateQueries({queryKey:["event",e]}),re.success(Ze.already_exists?"This date is already on Luma":"Event shared on Luma!"),Ze.luma_event_id&&fetch(`${dt}/functions/v1/backfill-luma-attendees`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${ht}`},body:JSON.stringify({event_id:S==null?void 0:S.id,luma_event_id:Ze.luma_event_id})}).catch(Cn=>console.error("[luma-backfill]",Cn))}else if(R==="eventbrite"){const{data:Qe}=await pe.auth.getSession(),ht=(Se=Qe==null?void 0:Qe.session)==null?void 0:Se.access_token;if(!ht){re.error("Not authenticated"),_(null),y(!1),clearTimeout(Y);return}const Xe=await fetch(`${dt}/functions/v1/create-eventbrite-event`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${ht}`},body:JSON.stringify({event_id:S==null?void 0:S.id,event_date_id:F.id,title:te==null?void 0:te.event_name,description:(()=>{const Ze=((te==null?void 0:te.custom_description)||"").trim(),Cn=pt().descriptionText;return Ze?`${Ze}
419
420About ${pt().title}
421${Cn}`:Cn})(),summary:pt().eventbriteSummary,start_time:F.start_time,end_time:F.end_time,location:(te==null?void 0:te.location_name)||"",venue_name:(S==null?void 0:S.event_type)==="connectonlinemeets"?null:(te==null?void 0:te.venue_name)||void 0,capacity:S==null?void 0:S.capacity,timezone:(S==null?void 0:S.timezone)||Intl.DateTimeFormat().resolvedOptions().timeZone,event_type:(S==null?void 0:S.event_type)||void 0,username:sn||void 0,...(S==null?void 0:S.event_type)==="connectonlinemeets"?{online_event:!0,join_url:(F==null?void 0:F.join_url)||null}:{},custom_image_url:(te==null?void 0:te.custom_image_url)||void 0,custom_description:(te==null?void 0:te.custom_description)||void 0})}),rt=await Xe.text();if(Xe.status===409)throw new eh;if(!Xe.ok)throw new Error(`Eventbrite failed: ${rt}`);const Yt=JSON.parse(rt);ue=Yt.eventbrite_url??null,t.invalidateQueries({queryKey:["event",e]}),re.success(Yt.already_exists?"This date is already on Eventbrite":"Event shared on Eventbrite!")}else if(R==="meetup"){const{data:Qe}=await pe.auth.getSession(),ht=(Ke=Qe==null?void 0:Qe.session)==null?void 0:Ke.access_token;if(!ht){re.error("Not authenticated"),_(null),y(!1),clearTimeout(Y);return}const Xe=await fetch(`${dt}/functions/v1/create-meetup-event`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${ht}`},body:JSON.stringify({event_id:S==null?void 0:S.id,event_date_id:F.id,title:te==null?void 0:te.event_name,description:(()=>{const Ze=((te==null?void 0:te.custom_description)||"").trim(),Cn=pt().descriptionText;return Ze?`${Ze}
422
423About ${pt().title}
424${Cn}`:Cn})(),start_time:F.start_time,end_time:F.end_time,location:(S==null?void 0:S.event_type)==="connectonlinemeets"?(F==null?void 0:F.join_url)||"":(te==null?void 0:te.location_name)||"",venue_name:(S==null?void 0:S.event_type)==="connectonlinemeets"?null:(te==null?void 0:te.venue_name)||null,timezone:(S==null?void 0:S.timezone)||Intl.DateTimeFormat().resolvedOptions().timeZone,event_type:(S==null?void 0:S.event_type)||void 0,username:sn||void 0,custom_description:(te==null?void 0:te.custom_description)||void 0,custom_image_url:(te==null?void 0:te.custom_image_url)||void 0})}),rt=await Xe.text();if(Xe.status===409)throw new eh;if(!Xe.ok)throw new Error(`Meetup failed: ${rt}`);const Yt=JSON.parse(rt);ue=Yt.meetup_url??null,t.invalidateQueries({queryKey:["event",e]}),re.success(Yt.already_exists?"This date is already on Meetup":"Event shared on Meetup!")}_(null),R&&C({platform:R,url:ue})}catch(Qe){const ht=R?kl[R]:"the platform";if(Qe instanceof eh){re.info(`This date is already being shared on ${ht}. Give it a moment, then refresh.`),_(null);return}console.error(`[${R}] Error:`,Qe);let Xe="";const rt=(Qe==null?void 0:Qe.message)||"";try{const Yt=rt.indexOf("{");
424if(Yt>=0){const Ze=JSON.parse(rt.slice(Yt)),Cn=typeof(Ze==null?void 0:Ze.error)=="string"?(()=>{try{return JSON.parse(Ze.error)}catch{return null}})():null;Xe=(Cn==null?void 0:Cn.message)||(typeof(Ze==null?void 0:Ze.error)=="string"?Ze.error:"")||(Ze==null?void 0:Ze.message)||""}}catch{}Xe||(Xe=rt),Xe.length>240&&(Xe=Xe.slice(0,240)+"…"),re.error(Xe?`Failed to share on ${ht}: ${Xe}`:`Failed to share on ${ht}`),_(null)}finally{Yi.current=!1,y(!1),clearTimeout(Y)}},children:"Confirm"})]})]})}),i.jsx(ot,{open:!!b,onOpenChange:R=>{!R&&E&&_(null)},children:i.jsxs(et,{className:`sm:max-w-md ${E?"":"[&>button.absolute]:hidden"}`,onPointerDownOutside:R=>{E||R.preventDefault()},onEscapeKeyDown:R=>{E||R.preventDefault()},children:[i.jsxs(Tt,{children:[i.jsxs(vt,{children:["Syncing to ",b?kl[b]:"","..."]}),i.jsx(Ps,{children:"Please wait while we sync your event."})]}),i.jsxs("div",{className:"flex items-center justify-center gap-3 py-8",children:[i.jsx("div",{className:"px-3 py-1.5 rounded-md bg-muted text-sm font-medium text-foreground",children:"Your Event"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"text-primary text-lg",style:{animation:"slide-arrow 1.2s ease-in-out infinite",animationDelay:"0s"},children:"→"}),i.jsx("span",{className:"text-primary text-lg",style:{animation:"slide-arrow 1.2s ease-in-out infinite",animationDelay:"0.2s"},children:"→"}),i.jsx("span",{className:"text-primary text-lg",style:{animation:"slide-arrow 1.2s ease-in-out infinite",animationDelay:"0.4s"},children:"→"})]}),i.jsx("div",{className:"px-3 py-1.5 rounded-md bg-primary text-primary-foreground text-sm font-medium",children:b?kl[b]:""})]}),E&&i.jsxs("p",{className:"text-center text-xs text-muted-foreground",children:["Still syncing… you can"," ",i.jsx("button",{className:"underline hover:text-foreground",onClick:()=>_(null),children:"close this"})," ","if needed."]})]})}),i.jsx(ot,{open:!!H,onOpenChange:()=>{},children:i.jsxs(et,{className:"sm:max-w-md [&>button.absolute]:hidden",onPointerDownOutside:R=>R.preventDefault(),onEscapeKeyDown:R=>R.preventDefault(),children:[i.jsxs(Tt,{children:[i.jsxs(vt,{children:["Sharing to ",H?ia[H]:"","..."]}),i.jsx(Ps,{children:"Please wait while we sync your event."})]}),i.jsxs("div",{className:"flex items-center justify-center gap-3 py-8",children:[i.jsx("div",{className:"px-3 py-1.5 rounded-md bg-muted text-sm font-medium text-foreground",children:"Your Event"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"text-primary text-lg",style:{animation:"slide-arrow 1.2s ease-in-out infinite",animationDelay:"0s"},children:"→"}),i.jsx("span",{className:"text-primary text-lg",style:{animation:"slide-arrow 1.2s ease-in-out infinite",animationDelay:"0.2s"},children:"→"}),i.jsx("span",{className:"text-primary text-lg",style:{animation:"slide-arrow 1.2s ease-in-out infinite",animationDelay:"0.4s"},children:"→"})]}),i.jsx("div",{className:"px-3 py-1.5 rounded-md bg-primary text-primary-foreground text-sm font-medium",children:H?ia[H]:""})]})]})}),i.jsx(Rt,{open:!!P,onOpenChange:R=>{R||$(null)},children:i.jsxs(St,{children:[i.jsxs(Ct,{children:[i.jsxs(jt,{children:["Get Featured on ",P?ia[P]:""]}),i.jsx(Nt,{asChild:!0,children:i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{children:P?d7[P]:""}),i.jsx("p",{className:"font-semibold text-foreground",children:f7})]})})]}),i.jsxs(Et,{children:[i.jsx(cn,{children:"Cancel"}),i.jsx(ln,{onClick:()=>{const R=P;$(null),R&&Fs(R)},children:"Share Event"})]})]})}),i.jsx(ot,{open:!!B,onOpenChange:R=>{R||U(null)},children:i.jsxs(et,{className:"sm:max-w-md",children:[i.jsxs(Tt,{children:[i.jsx(vt,{children:"Event shared successfully"}),i.jsx(Ps,{children:"It may take a moment to appear on the platform."})]}),i.jsx("div",{className:"py-2",children:(()=>{const R=B==null?void 0:B.platform;if(!R)return null;const Y=(B==null?void 0:B.url)||h7[R];return i.jsx("p",{className:"text-sm",children:i.jsxs("a",{href:Y,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline hover:text-primary/80",children:["View it on ",ia[R]]})})})()}),i.jsx(so,{children:i.jsx(Sk,{asChild:!0,children:i.jsx(ee,{variant:"outline",children:"Close"})})})]})}),i.jsx(ot,{open:!!k,onOpenChange:R=>{R||C(null)},children:i.jsxs(et,{className:"sm:max-w-md",children:[i.jsxs(Tt,{children:[i.jsx(vt,{children:"Event shared successfully"}),i.jsx(Ps,{children:"It may take a moment to appear on the platform."})]}),i.jsx("div",{className:"py-2",children:(()=>{const R=k==null?void 0:k.platform,Y=k==null?void 0:k.url,ue=R?kl[R]:"";return Y?i.jsxs("p",{className:"text-sm text-muted-foreground",children:["View your event on ",ue,":"," ",i.jsx("a",{href:Y,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline hover:text-primary/80",children:Y})]}):R==="eventbrite"?i.jsxs("p",{className:"text-sm text-muted-foreground",children:["View our Eventbrite channel:"," ",i.jsx("a",{href:"https://staaake.eventbrite.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline hover:text-primary/80",children:"staaake.eventbrite.com"})]}):R==="meetup"?i.jsx("p",{className:"text-sm text-muted-foreground",children:"Your event has been published to Meetup."}):i.jsxs("p",{className:"text-sm text-muted-foreground",children:["View our Luma page:"," ",i.jsx("a",{href:"https://luma.com/staaake",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline hover:text-primary/80",children:"luma.com/staaake"})]})})()}),i.jsx(so,{children:i.jsx(Sk,{asChild:!0,children:i.jsx(ee,{variant:"outline",children:"Close"})})})]})}),i.jsx(ot,{open:!!$e,onOpenChange:R=>{R||tt(null)},children:i.jsxs(et,{className:"sm:max-w-md [&>button.absolute]:hidden",onPointerDownOutside:R=>R.preventDefault(),onEscapeKeyDown:R=>R.preventDefault(),children:[i.jsxs(Tt,{children:[i.jsxs(vt,{children:["Event → ",$e?Sy[$e].label:""]}),i.jsx(Ps,{children:$e?Sy[$e].subtitle:""})]}),i.jsxs("div",{className:"flex items-center justify-center gap-3 py-8",children:[i.jsx("div",{className:"px-3 py-1.5 rounded-md bg-muted text-sm font-medium text-foreground",children:"Your Event"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"text-primary text-lg",style:{animation:"slide-arrow 1.2s ease-in-out infinite",animationDelay:"0s"},children:"→"}),i.jsx("span",{className:"text-primary text-lg",style:{animation:"slide-arrow 1.2s ease-in-out infinite",animationDelay:"0.2s"},children:"→"}),i.jsx("span",{className:"text-primary text-lg",style:{animation:"slide-arrow 1.2s ease-in-out infinite",animationDelay:"0.4s"},children:"→"})]}),i.jsx("div",{className:"px-3 py-1.5 rounded-md bg-primary text-primary-foreground text-sm font-medium",children:$e?Sy[$e].label:""})]})]})}),i.jsx(Rt,{open:D,onOpenChange:j,children:i.jsxs(St,{children:[i.jsxs(Ct,{children:[i.jsx(jt,{children:"Remove from Luma?"}),i.jsxs(Nt,{className:"whitespace-pre-line",children:["This event is already on Luma.",`
425`,"Do you want to remove it from Luma?",`
426
427`,"This will remove the event from Luma and all signups will be lost."]})]}),i.jsxs(Et,{children:[i.jsx(cn,{children:"Cancel"}),i.jsx(ln,{disabled:N,onClick:async()=>{var R;W(!0);try{const Y=await fetch(`${dt}/functions/v1/delete-luma-event`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${(R=(await pe.auth.getSession()).data.session)==null?void 0:R.access_token}`},body:JSON.stringify({event_id:S==null?void 0:S.id,event_date_id:F==null?void 0:F.id,luma_event_id:F==null?void 0:F.luma_event_id})});if(!Y.ok){const ue=await Y.text();throw new Error(ue)}await Y.text(),t.invalidateQueries({queryKey:["event",e]}),re.success("Removed from Luma")}catch(Y){console.error("[luma-delete]",Y),re.error("Failed to remove from Luma")}finally{W(!1),j(!1)}},children:N?"Removing...":"Remove"})]})]})}),i.jsx(Rt,{open:K,onOpenChange:J,children:i.jsxs(St,{children:[i.jsxs(Ct,{children:[i.jsx(jt,{children:"Remove from Eventbrite?"}),i.jsxs(Nt,{className:"whitespace-pre-line",children:["This event is already on Eventbrite.",`
428`,"Do you want to remove it from Eventbrite?",`
429
430`,"This will cancel the event on Eventbrite."]})]}),i.jsxs(Et,{children:[i.jsx(cn,{children:"Cancel"}),i.jsx(ln,{disabled:Z,onClick:async()=>{var R;ce(!0);try{const Y=await fetch(`${dt}/functions/v1/delete-eventbrite-event`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${(R=(await pe.auth.getSession()).data.session)==null?void 0:R.access_token}`},body:JSON.stringify({event_id:S==null?void 0:S.id,event_date_id:F==null?void 0:F.id,eventbrite_event_id:F==null?void 0:F.eventbrite_event_id})});if(!Y.ok){const ue=await Y.text();throw new Error(ue)}
430t.invalidateQueries({queryKey:["event",e]}),re.success("Removed from Eventbrite")}catch(Y){console.error("[eb-delete]",Y),re.error("Failed to remove from Eventbrite")}finally{ce(!1),J(!1)}},children:Z?"Removing...":"Remove"})]})]})}),i.jsx(Rt,{open:q,onOpenChange:me,children:i.jsxs(St,{children:[i.jsxs(Ct,{children:[i.jsx(jt,{children:"Remove from Meetup?"}),i.jsxs(Nt,{className:"whitespace-pre-line",children:["This event is already on Meetup.",`
431`,"Do you want to remove it from Meetup?",`
432
433`,"This will remove the event from Meetup and all signups will be lost."]})]}),i.jsxs(Et,{children:[i.jsx(cn,{children:"Cancel"}),i.jsx(ln,{disabled:oe,onClick:async()=>{var R;ae(!0);try{const Y=await fetch(`${dt}/functions/v1/delete-meetup-event`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${(R=(await pe.auth.getSession()).data.session)==null?void 0:R.access_token}`},body:JSON.stringify({event_id:S==null?void 0:S.id,event_date_id:F==null?void 0:F.id,meetup_event_id:F==null?void 0:F.meetup_event_id})});if(!Y.ok){const ue=await Y.text();throw new Error(ue)}await Y.text(),t.invalidateQueries({queryKey:["event",e]}),re.success("Removed from Meetup")}catch(Y){console.error("[meetup-delete]",Y),re.error("Failed to remove from Meetup")}finally{ae(!1),me(!1)}},children:oe?"Removing...":"Remove"})]})]})}),Me&&bn&&i.jsx("div",{className:"fixed inset-0 z-[98] bg-background/80 flex items-center justify-center",children:i.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}),Me&&br&&qt&&!Fr&&!bn&&i.jsx(Mm,{onSuccess:rs})]})};function AI(){d.useEffect(()=>{if(!(!!window.opener||window.name.startsWith("google-auth")))return;console.log("[OAuthPopupClose] Popup detected"),console.log("[OAuthPopupClose] URL:",window.location.href),console.log("[OAuthPopupClose] hostname:",window.location.hostname),console.log("[OAuthPopupClose] window.opener:",!!window.opener),console.log("[OAuthPopupClose] window.name:",window.name);const t=window.location.hash,n=window.location.search,s=new URLSearchParams(n).get("code");console.log("[OAuthPopupClose] code present:",!!s),console.log("[OAuthPopupClose] hash has access_token:",t.includes("access_token"));const o=()=>{console.log("[OAuthPopupClose] Closing popup"),window.name="";try{window.opener&&!window.opener.closed&&window.opener.postMessage({type:"oauth-success"},"*")}catch(u){console.log("[OAuthPopupClose] Could not postMessage to opener:",u)}try{localStorage.setItem("oauth-popup-done",Date.now().toString()),localStorage.removeItem("oauth-popup-done")}catch{}setTimeout(()=>window.close(),200)};(async()=>{var u,f;try{const{data:{session:p}}=await pe.auth.getSession();if(p){console.log("[OAuthPopupClose] Session already exists — closing immediately"),o();return}}catch(p){console.error("[OAuthPopupClose] getSession error:",p)}if(s){console.log("[OAuthPopupClose] Exchanging PKCE code for session");try{const{data:p,error:h}=await pe.auth.exchangeCodeForSession(s);if(h)console.error("[OAuthPopupClose] exchangeCodeForSession failed:",h);else{console.log("[OAuthPopupClose] Session exchanged:",(f=(u=p.session)==null?void 0:u.user)==null?void 0:f.email),o();return}}catch(p){console.error("[OAuthPopupClose] exchangeCodeForSession exception:",p)}}})();const{data:{subscription:l}}=pe.auth.onAuthStateChange(u=>{console.log("[OAuthPopupClose] Auth event:",u),(u==="SIGNED_IN"||u==="TOKEN_REFRESHED")&&o()}),c=setTimeout(()=>{console.log("[OAuthPopupClose] Timeout — closing popup anyway"),console.log("[OAuthPopupClose] Final URL:",window.location.href),window.name="",window.close()},8e3);return()=>{clearTimeout(c),l.unsubscribe()}},[])}function ei(e,t,n){var s,o;let r=document.querySelector(e);if(r)r.setAttribute(t,n);else{if(r=document.createElement("meta"),e.includes('property="')){const a=(s=e.match(/property="([^"]+)"/))==null?void 0:s[1];a&&r.setAttribute("property",a)}else if(e.includes('name="')){const a=(o=e.match(/name="([^"]+)"/))==null?void 0:o[1];a&&r.setAttribute("name",a)}r.setAttribute(t,n),document.head.appendChild(r)}}function Cy(e,t){let n=document.querySelector(`link[rel="${e}"]`);n?n.setAttribute("href",t):(n=document.createElement("link"),n.setAttribute("rel",e),n.setAttribute("href",t),document.head.appendChild(n))}function m7(e){const t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,s=Math.max(t,n,r),o=Math.min(t,n,r);let a=0,l=0;const c=(s+o)/2;if(s!==o){const u=s-o;l=c>.5?u/(2-s-o):u/(s+o),s===t?a=((n-r)/u+(n<r?6:0))/6:s===n?a=((r-t)/u+2)/6:a=((t-n)/u+4)/6}return`${Math.round(a*360)} ${Math.round(l*100)}% ${Math.round(c*100)}%`}function II(){d.useEffect(()=>{const e=xn();document.title=e.title,ei('meta[name="description"]',"content",e.description),ei('meta[property="og:title"]',"content",e.title),ei('meta[property="og:description"]',"content",e.description),ei('meta[property="og:image"]',"content",e.ogImage),ei('meta[property="og:url"]',"content",e.canonicalUrl),ei('meta[name="twitter:title"]',"content",e.title),ei('meta[name="twitter:description"]',"content",e.description),ei('meta[name="twitter:image"]',"content",e.ogImage);const t=`?v=${Date.now()}`;if(Cy("icon",e.favicon+t),Cy("apple-touch-icon",e.favicon+t),Cy("canonical",e.canonicalUrl),e.siteKey!=="powerwalk"){const n=m7(e.color);document.documentElement.style.setProperty("--primary",n),document.documentElement.style.setProperty("--ring",n),document.documentElement.style.setProperty("--accent",n),document.documentElement.style.setProperty("--stake-frame",n)}else document.documentElement.style.removeProperty("--primary"),document.documentElement.style.removeProperty("--ring"),document.documentElement.style.removeProperty("--accent"),document.documentElement.style.removeProperty("--stake-frame")},[])}const th=22,Sl=44;
433function af(){const e=d.useRef(null),[t,n]=d.useState({width:0,height:0}),r=d.useMemo(()=>{const{width:s,height:o}=t;if(!s||!o)return[];const a=Math.ceil((s+Sl*2)/th),l=Math.ceil((o+Sl*2)/th),c=s*.48,u=o*.42,f=Math.hypot(Math.max(c,s-c)+Sl,Math.max(u,o-u)+Sl),p=[];for(let h=0;h<=l;h+=1)for(let m=0;m<=a;m+=1){const v=m*th-Sl,g=h*th-Sl,x=Math.hypot(v-c,g-u),w=Math.max(.28,1-x/f);p.push({id:`${m}-${h}`,x:v,y:g,opacity:.08+w*.15,phase:Math.sin(m*12.9898+h*78.233)*43758.5453})}return p},[t]);return d.useEffect(()=>{const s=()=>{n({width:window.innerWidth,height:window.innerHeight})};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),d.useEffect(()=>{const s=e.current;if(!s||!r.length)return;const{width:o,height:a}=t;if(!o||!a)return;const l=s.getContext("2d");if(!l)return;const c=Math.min(window.devicePixelRatio||1,2);s.width=Math.round(o*c),s.height=Math.round(a*c),l.setTransform(c,0,0,c,0,0);const u=()=>getComputedStyle(document.documentElement).getPropertyValue("--meets-dot-rgb").trim()||"255, 255, 255",f=w=>{const y=u();l.clearRect(0,0,o,a);for(let b=0;b<r.length;b+=1){const _=r[b],k=.5+Math.sin(_.x*.008+_.y*.004-w*.158)*.5,C=.5+Math.sin(_.x*-.005+_.y*.011+w*.12+1.7)*.5,E=.5+Math.cos((_.x+_.y)*.006-w*.09+3.2)*.5,A=.5+Math.sin(Math.hypot(_.x-760,_.y-340)*.011-w*.135)*.5,T=Math.max(0,Math.min(1,k*.34+C*.28+E*.22+A*.16)),M=T*T*(3-2*T),P=Math.pow(M,3.2),$=.7+P*1.9,H=_.opacity*(.9+P*.2);l.beginPath(),l.arc(_.x,_.y,$,0,Math.PI*2),l.fillStyle=`rgba(${y}, ${H.toFixed(3)})`,l.fill()}};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){const w=u();l.clearRect(0,0,o,a);for(let y=0;y<r.length;y+=1){const b=r[y];l.beginPath(),l.arc(b.x,b.y,1.05,0,Math.PI*2),l.fillStyle=`rgba(${w}, ${b.opacity.toFixed(3)})`,l.fill()}return}let h=0,m=performance.now(),v=!0;const g=w=>{v&&(f((w-m)/1e3),h=requestAnimationFrame(g))},x=()=>{document.hidden?(v=!1,cancelAnimationFrame(h)):v||(v=!0,m=performance.now(),h=requestAnimationFrame(g))};return h=requestAnimationFrame(g),document.addEventListener("visibilitychange",x),()=>{v=!1,cancelAnimationFrame(h),document.removeEventListener("visibilitychange",x)}},[r,t]),i.jsx("canvas",{ref:e,"aria-hidden":"true",className:"pointer-events-none fixed inset-0 z-0 h-full w-full"})}const kS="Create once. Publish everywhere.",OI=({showNav:e=!1,shareUsername:t})=>{const[n,r]=d.useState(!1),{user:s,authOpen:o,setAuthOpen:a,showOnboarding:l,guardAction:c,onAuthSuccess:u,onOnboardingSuccess:f,firstName:p,lastName:h,email:m,activeUsername:v,profileComplete:g,profileFetched:x,authCleanupInProgress:w,loading:y,updateProfile:b}=ao(),_=window.location.hostname.includes("lovableproject.com")||window.location.hostname.includes("lovable.app"),k=()=>{_||c(()=>{},{preserveQueued:!0})};return i.jsxs("div",{className:"relative z-20 border-b border-border bg-card/80 backdrop-blur-sm",children:[i.jsxs("div",{className:"flex items-center justify-between gap-3 px-6 py-3",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("button",{type:"button",onClick:()=>window.location.assign(`/${window.location.search}`),className:"text-lg font-bold tracking-tight text-foreground hover:opacity-80 transition-opacity","aria-label":"staaake meets home",children:"staaake meets"}),s&&v?i.jsx(YR,{className:"text-foreground/80 hover:text-foreground"}):null]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("span",{className:"hidden md:block text-sm text-muted-foreground",children:kS}),i.jsx(ee,{variant:"ghost",size:"icon",className:"md:hidden h-8 w-8",onClick:()=>r(!0),"aria-label":"About staaake meets",children:i.jsx(jE,{className:"w-4 h-4"})}),t?i.jsx(ee,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Share this calendar",onClick:()=>vA(t,"staaake meets"),children:i.jsx(jx,{className:"w-4 h-4"})}):null,s&&v?i.jsx(VR,{firstName:p,lastName:h,email:m||s.email||"",activeUsername:v,profileComplete:g,onUpdateProfile:b,avatarClassName:"bg-neutral-900 text-neutral-50 border border-border hover:bg-neutral-800 transition-colors"}):i.jsxs(i.Fragment,{children:[i.jsx(ee,{variant:"ghost",size:"icon",className:"md:hidden",onClick:k,"aria-label":"Log in",children:i.jsx(NE,{className:"w-5 h-5"})}),i.jsx(ee,{variant:"outline",size:"sm",className:"hidden md:inline-flex",onClick:k,children:"Login / Sign Up"})]})]})]}),e&&s&&v?i.jsx("div",{className:"border-t border-b border-border px-6 py-3 overflow-x-auto scrollbar-hide",children:i.jsx("div",{className:"flex items-center gap-1 flex-nowrap",children:i.jsx("button",{type:"button",className:"text-sm font-medium text-foreground leading-5 hover:opacity-80 transition-opacity whitespace-nowrap flex-shrink-0",onClick:()=>window.location.assign(`/${encodeURIComponent(v)}${window.location.search}`),children:"My Full calendar"})})}):null,i.jsx(Vc,{open:o,onOpenChange:a,onAuthSuccess:u,mode:"login"}),s&&l&&x&&!w&&!y&&i.jsx(Mm,{onSuccess:f}),i.jsx(ot,{open:n,onOpenChange:r,children:i.jsx(et,{className:"sm:max-w-md",children:i.jsxs(Tt,{children:[i.jsx(vt,{children:"staaake meets"}),i.jsx(Ps,{children:kS})]})})})]})},g7={async fetchCoords(e){const t=await fetch("https://ipwho.is/",{signal:e});if(!t.ok)throw new Error(`ipwho.is HTTP ${t.status}`);const n=await t.json();if(!n||n.success===!1||typeof n.latitude!="number"||typeof n.longitude!="number")throw new Error("ipwho.is: invali
433d response");return{lat:n.latitude,lng:n.longitude}}},y7={async fetchSunTimes({lat:e,lng:t},n,r){var l,c;const s=`https://api.sunrise-sunset.org/json?lat=${e}&lng=${t}&date=${n}&formatted=0`,o=await fetch(s,{signal:r});if(!o.ok)throw new Error(`sunrise-sunset HTTP ${o.status}`);const a=await o.json();if(!a||a.status!=="OK"||!((l=a.results)!=null&&l.sunrise)||!((c=a.results)!=null&&c.sunset))throw new Error("sunrise-sunset: invalid response");return{sunriseMs:Date.parse(a.results.sunrise),sunsetMs:Date.parse(a.results.sunset)}}};let v7=g7,SS=y7;const Jb="staaakemeets:sun-cache:v2",w7=24*60*60*1e3;function Hm(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||""}catch{return""}}function CS(e=0){var l,c,u;const t=new Date(Date.now()+e*24*60*60*1e3),n=Hm()||void 0,r=new Intl.DateTimeFormat("en-CA",{timeZone:n,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(t),s=((l=r.find(f=>f.type==="year"))==null?void 0:l.value)??"1970",o=((c=r.find(f=>f.type==="month"))==null?void 0:c.value)??"01",a=((u=r.find(f=>f.type==="day"))==null?void 0:u.value)??"01";return`${s}-${o}-${a}`}function x7(){try{const e=localStorage.getItem(Jb);if(!e)return null;const t=JSON.parse(e);return!(t!=null&&t.coords)||typeof t.coords.lat!="number"||typeof t.coords.lng!="number"||typeof t.storedAt!="number"||Date.now()-t.storedAt>w7||t.tz&&t.tz!==Hm()?null:t}catch{return null}}function b7(e){try{const t={coords:e,tz:Hm(),storedAt:Date.now()};localStorage.setItem(Jb,JSON.stringify(t))}catch{}}function ES(){const e=new Date,t=new Date(e);t.setHours(7,0,0,0);const n=new Date(e);return n.setHours(19,0,0,0),{sunriseMs:t.getTime(),sunsetMs:n.getTime(),source:"fallback"}}let xu=null;function _7(e){if(xu)return jS(xu,e);const t=new AbortController;return xu=(async()=>{var n;try{let r=((n=x7())==null?void 0:n.coords)??null;if(!r)try{r=await v7.fetchCoords(t.signal),b7(r)}catch{return ES()}try{const s=CS(0);let o=await SS.fetchSunTimes(r,s,t.signal);if(Date.now()>=o.sunsetMs){const a=CS(1);try{o=await SS.fetchSunTimes(r,a,t.signal)}catch{}}return{...o,source:"api"}}catch{return ES()}}finally{queueMicrotask(()=>{xu=null})}})(),jS(xu,e)}function jS(e,t){return t?t.aborted?Promise.reject(new DOMException("Aborted","AbortError")):new Promise((n,r)=>{const s=()=>r(new DOMException("Aborted","AbortError"));t.addEventListener("abort",s,{once:!0}),e.then(o=>{t.removeEventListener("abort",s),n(o)},o=>{t.removeEventListener("abort",s),r(o)})}):e}function NS(){return Hm()}function k7(){try{localStorage.removeItem(Jb)}catch{}}function MI(e="light"){d.useEffect(()=>{const t=document.documentElement;let n=null,r=null,s=null,o=!1,a=NS(),l=!1;const c=()=>{n!==null&&(clearTimeout(n),n=null)},u=h=>{t.classList.toggle(e,h)},f=async()=>{if(!(o||l)){l=!0,s==null||s.abort(),s=new AbortController;try{const{sunriseMs:h,sunsetMs:m}=await _7(s.signal);if(o)return;const v=Date.now(),g=v>=h&&v<m;u(g);const x=v<h?h:m;c();const w=Math.min(Math.max(x-v+1e3,6e4),24*60*60*1e3);n=setTimeout(()=>{n=null,f()},w)}catch{}finally{l=!1}}},p=()=>{document.hidden||f()};return r=setInterval(()=>{const h=NS();h&&h!==a&&(a=h,k7(),f())},5*60*1e3),document.addEventListener("visibilitychange",p),f(),()=>{o=!0,c(),r!==null&&(clearInterval(r),r=null),s==null||s.abort(),document.removeEventListener("visibilitychange",p),t.classList.remove(e)}},[e])}const S7=[{siteKey:"reversenetwork",name:"Reverse Network Meets",lines:["Host IRL experiences.","Bring your online community into the real world."]},{siteKey:"powerwalk",name:"Power Walk Meets",lines:["Host themed power walks.","Get your steps in, talk, and meet new people."]},{siteKey:"connectonlinemeets",name:"Connect Online Meets",lines:["Host regular online meets.","Build your community or connect with your customers through recurring online calls."]},{siteKey:"foodclubmeets",name:"Food Club Meets",lines:["Start your own food club.","Bring people together over food."]},{siteKey:"hoopersmeets",name:"Hoopers Meets",lines:["Host basketball sessions.","Find people to shoot around or organize games."]},{siteKey:"inpersondates",name:"In Person Dates",lines:["Host real-life dates.","No swiping. No endless texting. Just meet."]}];function C7(){d.useEffect(()=>{const e=xn();document.title=e.title;const t=(r,s)=>{var a,l;let o=document.querySelector(r);if(!o){o=document.createElement("meta");const c=(a=r.match(/property="([^"]+)"/))==null?void 0:a[1],u=(l=r.match(/name="([^"]+)"/))==null?void 0:l[1];c&&o.setAttribute("property",c),u&&o.setAttribute("name",u),document.head.appendChild(o)}o.setAttribute("content",s)},n=(r,s)=>{let o=document.querySelector(`link[rel="${r}"]`);o||(o=document.createElement("link"),o.setAttribute("rel",r),document.head.appendChild(o)),o.setAttribute("href",s)};t('meta[name="description"]',e.description),t('meta[property="og:title"]',e.title),t('meta[property="og:description"]',e.description),t('meta[property="og:url"]',e.canonicalUrl),t('meta[property="og:type"]',"website"),t('meta[property="og:image"]',e.ogImage),t('meta[name="twitter:title"]',e.title),t('meta[name="twitter:description"]',e.description),t('meta[name="twitter:image"]',e.ogImage),t('meta[name="twitter:card"]',"summary_large_image"),n("icon",e.favicon),n("apple-touch-icon",e.favicon),n("canonical",e.canonicalUrl)},[])}function TS(){C7(),MI("light");const[e,t]=d.useState(!1),[n,r]=d.useState(!1),[s,o]=d.useState(!1),[a,l]=d.useState(!1);return i.jsxs("main",{className:"relative min-h-screen bg-background text-foreground",children:[i.jsx(af,{}),i.jsx(OI,{showNav:!0}),i.jsxs("div",{className:"relative z-10 mx-auto max-w-4xl px-6 py-4 md:py-6",children:[i.jsxs("section",{className:"mb-4",children:[i.jsx("h1",{className:"text-4xl md:text-5xl font-medium tracking-tight leading-[1.1]",children:"Create once. Publish everywhere."}),i.jsxs("div",{className:"mt-3 space-y-1 text-lg text-muted-foreground",children:[i.jsxs("p",{children:[i.jsxs("button",{type:"button",onClick:()=>t(!0),className:"inline-flex items-center gap-1 cursor-pointer outline-none hover:text-foreground focus-visible:text-foreground",children:[i.jsx("span",{children:"No description"}),i.jsx(xo,{className:"h-4 w-4","aria-hidden":"true"})]})," ",i.jsxs("button",{type:"button",onClick:()=>t(!0),className:"inline-flex items-center gap-1 cursor-pointer outline-none hover:text-foreground focus-visible:text-foreground",children:[i.jsx("span",{children:"No picture"}),i.jsx(xo,{className:"h-4 w-4","aria-hidden":"true"})]})]}),i.jsx("p",{children:"Title. Date. Time. Location."}),i.jsxs("p",{children:[i.jsxs("button",{type:"button",onClick:()=>l(!0),className:"inline-flex items-center gap-1 cursor-pointer outline-none hover:text-foreground focus-visible:text-foreground",children:[i.jsx("span",{children:"Import from URL"}),i.jsx(xo,{className:"h-4 w-4","aria-hidden":"true"})]})," ",i.jsxs("button",{type:"button",onClick:()=>r(!0),className:"inline-flex items-center gap-1 cursor-pointer outline-none hover:text-foreground focus-visible:text-foreground",children:[i.jsx("span",{children:"Add polls"}),i.jsx(xo,{className:"h-4 w-4","aria-hidden":"true"})]})]}),i.jsxs("p",{children:["Publish to"," ",i.jsxs("button",{type:"button",onClick:()=>o(!0),className:"inline-flex items-center gap-1 cursor-pointer outline-none hover:text-foreground focus-visible:text-foreground align-baseline",children:[i.jsx("span",{children:"Luma"}),i.jsx(xo,{className:"h-4 w-4","aria-hidden":"true"})]}),","," ",i.jsxs("button",{type:"button",onClick:()=>o(!0),className:"inline-flex items-center gap-1 cursor-pointer outline-none hover:text-foreground focus-visible:text-foreground align-baseline",children:[i.jsx("span",{children:"Eventbrite"}),i.jsx(xo,{className:"h-4 w-4","aria-hidden":"true"})]}),", and"," ",i.jsxs("button",{type:"button",onClick:()=>o(!0),className:"inline-flex items-center gap-1 cursor-pointer outline-none hover:text-foreground focus-visible:text-foreground align-baseline",children:[i.jsx("span",{children:"Meetup"}),i.jsx(xo,{className:"h-4 w-4","aria-hidden":"true"})]}),"."]})]})]}),i.jsx("p",{className:"mb-4 text-base text-muted-foreground",children:"Create events for founders, your community, or your customers."}),i.jsx("section",{className:"mb-4 grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:S7.map(c=>i.jsxs("a",{href:Cp(c.siteKey),onClick:u=>IP(u,Cp(c.siteKey)),className:"group rounded-lg border border-border bg-background p-4 transition-colors hover:bg-muted/50",children:[i.jsx("div",{className:"text-base font-medium tracking-tight",children:c.name}),i.jsxs("div",{className:"mt-1.5 space-y-0.5 text-sm text-muted-foreground",children:[i.jsx("p",{children:c.lines[0]}),i.jsx("p",{children:c.lines[1]})]})]},c.siteKey))}),i.jsxs("section",{className:"space-y-1 text-sm text-muted-foreground",children:[i.jsx("p",{children:"We don't compete with event platforms. We connect them."}
433),i.jsx("p",{children:"Create once. Publish to Luma, Eventbrite, Meetup, or use only our platform."})]}),i.jsxs("section",{className:"mt-4 space-y-1 text-base text-muted-foreground",children:[i.jsx("p",{children:"Part of the staaake ecosystem."}),i.jsx("p",{className:"font-bold",children:"Claim your staaake username:"}),i.jsx("p",{children:i.jsx("a",{href:"https://staaake.com",className:"underline hover:opacity-80",children:"https://staaake.com"})})]}),i.jsxs("footer",{className:"mt-12 flex flex-wrap items-center gap-x-1.5 gap-y-1 text-[10px] leading-normal text-muted-foreground",children:[i.jsx("a",{href:"/privacy",className:"hover:text-foreground",children:"Privacy"}),i.jsx("span",{"aria-hidden":"true",children:"·"}),i.jsx("a",{href:"/terms",className:"hover:text-foreground",children:"Terms"}),i.jsx("span",{"aria-hidden":"true",children:"·"}),i.jsx("a",{href:"/refunds",className:"hover:text-foreground",children:"Cancellation & Refunds"}),i.jsx("span",{"aria-hidden":"true",children:"·"}),i.jsx("a",{href:"/acceptable-use",className:"hover:text-foreground",children:"Acceptable Use"})]})]}),i.jsx(ot,{open:e,onOpenChange:t,children:i.jsxs(et,{className:"sm:max-w-md border-border [&>button]:text-foreground [&>button:hover]:bg-muted [&>button:active]:bg-muted [&>button:focus]:ring-0 [&>button:focus]:ring-offset-0 [&>button:focus]:ring-transparent [&>button:focus-visible]:ring-0 [&>button:focus-visible]:ring-offset-0 [&>button:focus-visible]:ring-transparent [&>button]:data-[state=open]:bg-muted [&>button]:data-[state=open]:text-foreground",children:[i.jsx(Tt,{children:i.jsx(vt,{className:"text-lg font-semibold",children:"Why no picture or description?"})}),i.jsxs("div",{className:"mt-2 space-y-3 text-sm text-muted-foreground",children:[i.jsx("p",{children:"One of the biggest barriers to creating an event is thinking about what image to use and what description to write."}),i.jsx("p",{children:"We remove that barrier."}),i.jsx("p",{children:"Every event automatically gets a default image and description, so you can focus on the only thing that really matters: the event title."}),i.jsx("p",{children:"In most cases, a good title says everything people need to know."}),i.jsx("p",{children:"If you want more customization later, you can always upgrade and add your own image and description."})]})]})}),i.jsx(ot,{open:n,onOpenChange:r,children:i.jsxs(et,{className:"sm:max-w-md border-border [&>button]:text-foreground [&>button:hover]:bg-muted [&>button:active]:bg-muted [&>button:focus]:ring-0 [&>button:focus]:ring-offset-0 [&>button:focus]:ring-transparent [&>button:focus-visible]:ring-0 [&>button:focus-visible]:ring-offset-0 [&>button:focus-visible]:ring-transparent [&>button]:data-[state=open]:bg-muted [&>button]:data-[state=open]:text-foreground",children:[i.jsx(Tt,{children:i.jsx(vt,{className:"text-lg font-semibold",children:"Why polls?"})}),i.jsxs("div",{className:"mt-2 space-y-3 text-sm text-muted-foreground",children:[i.jsx("p",{children:"Instead of creating a Doodle first and then creating the event, just create an event with polls."}),i.jsx("p",{children:"Let your community, customers, or attendees vote or suggest better options for the title, date, time, and location."}),i.jsx("p",{children:"Everything happens in one place, making it easier to plan your event together."})]})]})}),i.jsx(ot,{open:s,onOpenChange:o,children:i.jsxs(et,{className:"sm:max-w-md border-border [&>button]:text-foreground [&>button:hover]:bg-muted [&>button:active]:bg-muted [&>button:focus]:ring-0 [&>button:focus]:ring-offset-0 [&>button:focus]:ring-transparent [&>button:focus-visible]:ring-0 [&>button:focus-visible]:ring-offset-0 [&>button:focus-visible]:ring-transparent [&>button]:data-[state=open]:bg-muted [&>button]:data-[state=open]:text-foreground",children:[i.jsx(Tt,{children:i.jsx(vt,{className:"text-lg font-semibold",children:"Why Publish to Luma, Eventbrite, and Meetup"})}),i.jsxs("div",{className:"mt-2 space-y-3 text-sm text-muted-foreground",children:[i.jsx("p",{children:"You can choose to sync your event to our Luma, Eventbrite, and Meetup channels. You don't need your own accounts on those platforms."}),i.jsx("p",{children:"Your event is published through our channels, so you benefit from our audience and reach."}),i.jsx("p",{children:"Best of all, every signup from Luma, Eventbrite, and Meetup is synced back to your event, so you can manage all attendees in one place instead of checking each platform separately."})]})]})}),i.jsx(ot,{open:a,onOpenChange:l,children:i.jsxs(et,{className:"sm:max-w-md border-border [&>button]:text-foreground [&>button:hover]:bg-muted [&>button:active]:bg-muted [&>button:focus]:ring-0 [&>button:focus]:ring-offset-0 [&>button:focus]:ring-transparent [&>button:focus-visible]:ring-0 [&>button:focus-visible]:ring-offset-0 [&>button:focus-visible]:ring-transparent [&>button]:data-[state=open]:bg-muted [&>button]:data-[state=open]:text-foreground",children:[i.jsx(Tt,{children:i.jsx(vt,{className:"text-lg font-semibold",children:"Why Import from URL"})}),i.jsxs("div",{className:"mt-2 space-y-3 text-sm text-muted-foreground",children:[i.jsx("p",{children:"We make it easier to import your event. Just paste your event URL into the box, and we'll automatically fill in most of the event details, meaning less work for you."}),i.jsx("p",{children:"After you post it, you can choose to sync it to our Luma, Eventbrite, and Meetup channels."})]})]})})]})}const E7=()=>{const{segment:e}=Wd(),t=e?decodeURIComponent(e):void 0;MI("light");const{authOpen:n,setAuthOpen:r,onAuthSuccess:s,guardAction:o,localUserId:a}=ao(),l=typeof window<"u"&&(window.location.hostname.includes("lovableproject.com")||window.location.hostname.includes("lovable.app")),[c,u]=d.useState("upcoming"),{exists:f,creatorId:p,isLoading:h}=bA(t),{upcomingEvents:m,pastEvents:v,isLoading:g}=xA(t),x=l?!0:f,w=l?!1:h,y=l?Ai:m,b=l?Rd:v,_=l?!1:g,k=l?"preview-creator":p,{isSubscribed:C,handleSubscribe:E,handleConfirmUnsub:A,confirmUnsubOpen:T,setConfirmUnsubOpen:M}=_A({creatorId:k,username:t,localUserId:a,isPreview:l,guardAction:o}),P=!!k&&!!a&&k===a;return d.useEffect(()=>{const $=document.documentElement;return $.classList.add("app-shell-locked"),()=>$.classList.remove("app-shell-locked")},[]),x===!1&&!w?i.jsx(Lm,{}):i.jsxs("div",{className:"relative h-screen flex flex-col overflow-hidden bg-background text-foreground",children:[i.jsx(af,{}),i.jsxs("div",{className:"relative z-10 flex flex-col min-h-0 flex-1",children:[i.jsx(OI,{shareUsername:t,showNav:!0}),i.jsx("div",{className:"relative flex-1 min-h-0 flex flex-col",children:i.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto pb-8 overscroll-contain",children:[i.jsx("div",{className:"sticky top-0 z-40 bg-background/80 backdrop-blur pb-3",children:i.jsx("div",{className:"flex justify-center pt-3 px-4",children:i.jsxs("div",{className:"w-full max-w-[430px] px-4",children:[i.jsxs("div",{className:"flex items-center justify-between gap-3 mb-3",children:[i.jsxs("div",{className:"font-bold text-sm",children:[i.jsx("span",{className:"text-foreground",children:"Host: "}),i.jsx("span",{className:"text-foreground",children:t})]}),k&&!P&&i.jsx(ee,{variant:C?"secondary":"outline",size:"sm",onClick:E,className:"shrink-0",children:C?"Unsubscribe":"Subscribe"})]}),i.jsxs("div",{className:"flex rounded-lg bg-muted p-1",children:[i.jsx("button",{onClick:()=>u("upcoming"),className:`flex-1 py-2 text-sm font-medium rounded-md transition-colors ${c==="upcoming"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,children:"Upcoming Events"}),i.jsx("button",{onClick:()=>u("past"),className:`flex-1 py-2 text-sm font-medium rounded-md transition-colors ${c==="past"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,children:"Past Events"})]}),i.jsx("div",{className:"flex rounded-lg bg-muted p-1 mt-2",children:[{label:"Luma",href:"https://luma.com/staaake"},{label:"Eventbrite",href:"https://staaake.eventbrite.com"},{label:"Meetup",href:"https://www.meetup.com/staaake/"}].map($=>i.jsx("a",{href:$.href,target:"_blank",rel:"noopener noreferrer",className:"flex-1 py-2 text-sm font-medium rounded-md transition-colors text-muted-foreground hover:text-foreground text-center",children:$.label},$.label))})]})})}),i.jsx("div",{className:"animate-fade-in",children:i.jsx(Vu,{events:c==="upcoming"?y:b,mode:c==="upcoming"?"upcoming":"past",isLoading:_||w,crossSite:!0})})]})}),i.jsx(Vc,{open:n,onOpenChange:r,onAuthSuccess:s,mode:"login"}),i.jsx(Rt,{open:T,onOpenChange:M,children:i.jsxs(St,{children:[i.jsxs(Ct,{children:[i.jsx(jt,{children:"Unsubscribe from this host?"}),i.jsx(Nt,{children:"You will no longer see their events in your Subscribed tab."})]}),i.jsxs(Et,{children:[i.jsx(cn,{children:"Cancel"}),i.jsx(ln,{onClick:A,children:"Yes"})]})]})})]})]})};function Ew({children:e}){return i.jsxs(i.Fragment,{children:[i.jsx(af,{}),i.jsx("div",{className:"relative z-10 h-screen flex flex-col items-center justify-center bg-transparent",children:e??i.jsx("div",{role:"status","aria-label":"Loading",className:"h-6 w-6 rounded-full border-2 border-muted-foreground
433/30 border-t-foreground animate-spin"})})]})}function j7(e){if(!e)return"/";try{const t=new URL(e,window.location.origin);if(t.origin!==window.location.origin)return"/";t.searchParams.delete("sso"),t.searchParams.delete("sso_state");const n=t.searchParams.toString();return`${t.pathname}${n?`?${n}`:""}${t.hash}`}catch{return"/"}}const N7=()=>{const e=d.useRef(!1),[t,n]=d.useState(null);return d.useEffect(()=>{e.current||(e.current=!0,(async()=>{var a;const r=new URLSearchParams(window.location.search),s=r.get("code"),o=j7(r.get("next"));if(Pc("handoff:enter"),ct("handoff:params",{hasCode:r.has("code"),next:o}),!s){n("This sign-in link is missing its code.");return}try{const{data:{session:l}}=await pe.auth.getSession();if(l!=null&&l.access_token){ct("handoff:already signed in on this origin"),uw(),window.location.replace(o);return}const{data:c,error:u}=await pe.functions.invoke("redeem-handoff",{body:{code:s,destination_origin:window.location.origin}});if(u){ct("handoff:redeem failed",String(u)),console.error("[AuthHandoff] redeem request failed:",u);const h=u.context;(h==null?void 0:h.status)===400?n("This sign-in link has expired or was already used."):n("We could not reach the sign-in service. Please try again.");return}if(!(c!=null&&c.token_hash)){ct("handoff:redeem returned no token hash"),console.error("[AuthHandoff] redeem response missing token hash:",c),n("We could not complete your sign-in. Please try again.");return}const{data:f,error:p}=await pe.auth.verifyOtp({token_hash:c.token_hash,type:"email"});if(p){ct("handoff:verifyOtp failed",String(p)),console.error("[AuthHandoff] verifyOtp failed:",p),n("We could not complete your sign-in. Please try again.");return}Pc("handoff:verified",f==null?void 0:f.session),uw(),(a=f==null?void 0:f.user)!=null&&a.id&&BR(f.user.id);try{window.history.replaceState(null,"",window.location.pathname)}catch{}window.location.replace(o)}catch(l){console.error("[AuthHandoff] error:",l),n("Something went wrong while signing you in.")}})())},[]),t?i.jsx(Ew,{children:i.jsxs("div",{className:"text-center space-y-3 px-6",children:[i.jsx("p",{className:"text-foreground font-medium",children:t}),i.jsx("a",{href:"/",className:"text-sm text-muted-foreground underline underline-offset-4",children:"Back to home"})]})}):i.jsx(Ew,{})},T7=2e3,P7=2e3,R7=1e3;function A7(){const e=d.useRef(!1),t=d.useRef(!1),n=d.useRef(0),r=d.useRef(0),s=d.useRef(new URLSearchParams(window.location.search).has("sso")?Date.now():0),o=d.useRef(!1),a=d.useRef(document.visibilityState==="hidden"),l=d.useRef(null),c=d.useRef(null),u=d.useRef(null),[f,p]=d.useState(!0);return d.useEffect(()=>{Pc("startup");const{data:h}=pe.auth.onAuthStateChange((m,v)=>{var g,x;if(ct("authEvent",{event:m,userId:((g=v==null?void 0:v.user)==null?void 0:g.id)??null}),v!=null&&v.access_token&&((x=v.user)!=null&&x.id)&&(c.current=v.user.id,u.current=v.access_token),m==="SIGNED_OUT"){l.current=null;return}if(!(m!=="SIGNED_IN"&&m!=="INITIAL_SESSION"||!(v!=null&&v.user.id)||o.current)&&(m==="SIGNED_IN"&&uw(),window.location.pathname.replace(/\/+$/,"")!=="/auth/handoff")){if(l.current===v.user.id){ct("SIGNED_IN deduped (same user already established this tab)");return}l.current=v.user.id,o.current=!0,window.setTimeout(async()=>{await HR(v.user.id)||(o.current=!1)},0)}});return()=>h.subscription.unsubscribe()},[]),d.useEffect(()=>{if(e.current)return;e.current=!0;let h=!1;return(async()=>{const m=await Vk();h||m||(uq(),p(!1))})(),()=>{h=!0}},[]),d.useEffect(()=>{const h=()=>{document.visibilityState==="hidden"&&(a.current=!0)},m=async v=>{var x;if(document.visibilityState!=="visible"){h();return}if(!a.current){ct("foreground:ignored (tab was already visible)",{type:v.type});return}if(t.current){ct("foreground:ignored",{type:v.type,visibility:document.visibilityState,alreadyRunning:t.current});return}a.current=!1;const g=Date.now();t.current=!0;try{const{data:{session:w}}=await pe.auth.getSession();if(Pc(`foreground:${v.type}`,w),w!=null&&w.access_token&&((x=w.user)!=null&&x.id)&&(c.current=w.user.id,u.current=w.access_token),!(w!=null&&w.access_token)){if(u.current){const b=await kp(u.current);if(ct("foreground:empty read, network check",{status:b}),b!=="revoked")return;c.current=null,u.current=null,await Sp(),window.location.reload();return}if(s.current&&g-s.current<P7){ct("foreground:skipped by broker-return guard");return}
433if(g-r.current<R7){ct("foreground:skipped by logged-out recheck guard");return}r.current=g,ct("foreground:logged out -> runSsoBootstrap"),await Vk();return}if(g-n.current<T7){ct("foreground:skipped by revocation dedupe");return}n.current=g;const y=await kp(w.access_token);if(ct("foreground:revocation check",{status:y}),y!=="revoked")return;c.current=null,u.current=null,await Sp(),window.location.reload()}finally{t.current=!1}};return document.addEventListener("visibilitychange",h),document.addEventListener("visibilitychange",m),window.addEventListener("focus",m),()=>{document.removeEventListener("visibilitychange",h),document.removeEventListener("visibilitychange",m),window.removeEventListener("focus",m)}},[]),f}function I7({children:e}){const{authResolved:t,profileFailed:n,refreshProfile:r}=Fo(),s=d.useRef(!1),[,o]=d.useState(0);return d.useEffect(()=>{t&&!s.current&&(s.current=!0,o(l=>l+1))},[t]),window.location.pathname.replace(/\/+$/,"")==="/auth/handoff"||s.current||t?i.jsx(i.Fragment,{children:e}):i.jsx("div",{className:"relative z-10 h-screen flex flex-col items-center justify-center bg-transparent",children:n?i.jsxs("div",{className:"flex flex-col items-center gap-3 px-6 text-center",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:"We could not reach your account just now."}),i.jsx("button",{onClick:()=>{r()},className:"rounded-md border border-border px-4 py-2 text-sm text-foreground hover:bg-muted transition-colors",children:"Try again"})]}):i.jsx("div",{role:"status","aria-label":"Loading",className:"h-6 w-6 rounded-full border-2 border-muted-foreground/30 border-t-foreground animate-spin"})})}function O7(e){d.useEffect(()=>{document.title=`${e} | staaake meets`;let t=document.querySelector('meta[name="description"]');t||(t=document.createElement("meta"),t.setAttribute("name","description"),document.head.appendChild(t)),t.setAttribute("content",`${e} for staaake, operated by Dastider AG.`)},[e])}function M7({doc:e}){return O7(e.title),i.jsxs("main",{className:"relative min-h-screen bg-background text-foreground",children:[i.jsx(af,{}),i.jsxs("div",{className:"relative z-10 mx-auto max-w-3xl px-6 py-8",children:[i.jsx("a",{href:"/",className:"text-sm tracking-tight text-muted-foreground hover:text-foreground",children:"staaake meets"}),i.jsx("h1",{className:"mt-6 text-3xl font-medium tracking-tight leading-tight",children:e.title}),i.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["Last updated: ",e.lastUpdated]}),i.jsx("article",{className:"mt-8 space-y-4 text-sm leading-relaxed text-muted-foreground",children:e.blocks.map((t,n)=>t.type==="h"?i.jsx("h2",{className:"pt-4 text-base font-medium tracking-tight text-foreground",children:t.text},n):t.type==="ul"?i.jsx("ul",{className:"list-disc space-y-1 pl-5",children:t.items.map((r,s)=>i.jsx("li",{children:r},s))},n):i.jsx("p",{children:t.text},n))}),i.jsx("div",{className:"mt-10 text-sm",children:i.jsx("a",{href:"/",className:"text-muted-foreground hover:text-foreground",children:"Back to staaake meets"})})]})]})}const L7={title:"Privacy Policy",lastUpdated:"September 5, 2026",blocks:[{type:"h",text:"1. Who We Are"},{type:"p",text:"staaake and the services covered by this Privacy Policy are operated by:"},{type:"p",text:"Dastider AG"},{type:"p",text:"Switzerland"},{type:"p",text:"Email: [email protected]"},{type:"p",text:"Dastider AG is the controller of personal data processed for the purposes described in this Privacy Policy, unless otherwise stated."},{type:"p",text:"This Privacy Policy explains what personal data we collect, why we process it, how it may be shared, how long it may be retained, and the rights available to users."},{type:"p",text:"This Policy is intended to address applicable Swiss data-protection law, including the Swiss Federal Act on Data Protection (FADP), and, where applicable, the EU/EEA General Data Protection Regulation (GDPR). Swiss guidance requires privacy notices to transparently explain collected data, processing purposes, and disclosures to third parties."},{type:"h",text:"2. Services Covered"},{type:"p",text:"This Privacy Policy applies across the staaake ecosystem operated by Dastider AG, including:"},{type:"ul",items:["staaake","staaake Sheets","staaakemeets","Power Walk Meets","Reverse Network Meets","Hoopers Meets","Connect Online Meets","Food Club Meets","In Person Dates","staaake Connector","Related staaake websites, applications, events, APIs, MCP services, webhooks, SDKs, communications, and services"]},{type:"p",text:"References to “staaake,” “we,” “us,” and “our” mean Dastider AG and the applicable staaake service."},{type:"h",text:"3. Personal Data We Collect"},{type:"p",text:"The information we collect depends on how you use staaake."},{type:"p",text:"Account and authentication information"},{type:"p",text:"This may include:"},{type:"ul",items:["Name","Email address","Username","Profile picture","Account identifiers","Authentication information","Login activity","Account settings"]},{type:"p",text:"If you use a third-party login provider, we may receive information that the provider makes available to us."},{type:"p",text:"Profile and Sheet information"},{type:"p",text:"This may include:"},{type:"ul",items:["Username","Name","Biography","Profile image","Links","Looking For","Offering","Sheet information","Stakes","Sheet memberships or associations","Other information you choose to publish"]},{type:"p",text:"Event information"},{type:"p",text:"When you create, host, register for, or participate in an event, we may process:"},{type:"ul",items:["Registration information","Event information","Host information","Attendance information","Information submitted through forms","Event-related activity","Event communications"]},{type:"p",text:"Subscription and transaction information"},{type:"p",text:"When you purchase a paid service, we may process:"},{type:"ul",items:["Product or service purchased","Subscription tier","Price","Billing period","Transaction identifiers","Payment status","Subscription status","Renewal status","Cancellation information","Relevant billing information","Payout information"]}
433,{type:"p",text:"If you are eligible to receive payouts, information relating to those payouts may be processed."},{type:"p",text:"Stripe or Payoneer may collect additional banking, identity, tax, compliance, or financial information directly from you."},{type:"p",text:"staaake Connector information"},{type:"p",text:"When you use staaake Connector, we may process:"},{type:"ul",items:["Projects and connections","Connection configuration","API activity","MCP activity","Webhook activity","SDK-related activity","API-key metadata","Usage information","Request and response metadata","Logs","Error information","Technical information necessary to provide the service"]},{type:"p",text:"Depending on how a customer configures staaake Connector, information transmitted between connected applications, databases, websites, or services may pass through staaake infrastructure."},{type:"p",text:"Customers using staaake Connector are responsible for ensuring they have appropriate authorization and a lawful basis for data they connect or transmit."},{type:"p",text:"Technical and usage information"},{type:"p",text:"We may automatically receive:"},{type:"ul",items:["IP address","Browser type","Device information","Operating system","Login activity","Pages and features used","Dates and times of activity","Referring pages","Security information","Error logs","API and service usage"]},{type:"p",text:"Communications"},{type:"p",text:"If you contact us, we may process your:"},{type:"ul",items:["Name","Email address","Message","Support request","Related correspondence"]},{type:"h",text:"4. Public Information"},{type:"p",text:"staaake is partly a public visibility, networking, discovery, and event platform."},{type:"p",text:"Information you intentionally publish on a public Sheet, profile, list, event, or other public part of staaake may be accessible to anyone on the internet."},{type:"p",text:"This may include:"},{type:"ul",items:["Username","Name","Profile picture","Biography","Looking For","Offering","Links","Public Sheet information","Public stakes or memberships","Public event information"]},{type:"p",text:"Do not publish information that you want to remain private."},{type:"p",text:"Search engines and third parties may index, cache, copy, or redistribute information that you make public."},{type:"p",text:"Deleting information from staaake therefore may not remove copies independently maintained by search engines, social networks, archives, or other third parties."},{type:"h",text:"5. How and Why We Use Personal Data"},{type:"p",text:"We may process personal data to:"},{type:"ul",items:["Create and maintain accounts","Authenticate users","Provide usernames, profiles, and Sheets","Operate free and paid stakes","Provide subscriptions and paid tiers","Process payments","Facilitate payouts","Match users with relevant people, Sheets, events, or opportunities","Provide recommendations and discovery","Create, manage, and promote events","Provide staaake Connector","Operate APIs, MCP, webhooks, SDKs, and connected services","Publish requested content through official staaake social channels","Send transactional emails","Send matching, event, account, and service notifications","Provide customer support","Detect and prevent fraud, abuse, spam, and security threats","Maintain logs","Diagnose technical problems","Protect users and our infrastructure","Improve our services","Enforce our Terms and policies","Establish, exercise, or defend legal claims","Meet legal, tax, accounting, regulatory, and compliance obligations"]},{type:"h",text:"6. GDPR Legal Bases"},{type:"p",text:"Where the GDPR applies, we rely on one or more lawful bases."},{type:"p",text:"Contract"},{type:"p",text:"We may process information where necessary to provide something you requested, including:"},{type:"ul",items:["Accounts","Sheets","Stakes","Subscriptions","Events","Payments and payouts","staaake Connector","Other requested features"]},{type:"p",text:"Legitimate interests"},{type:"p",text:"We may process information where necessary for legitimate interests that are not overridden by your rights, including:"},{type:"ul",items:["Operating staaake","Maintaining security","Preventing fraud and abuse","Improving our services","Matching and discovery","Customer support","Protecting our legal r
433ights"]},{type:"p",text:"Consent"},{type:"p",text:"Where required, we may rely on consent for activities such as certain marketing communications or non-essential tracking technologies."},{type:"p",text:"Where processing depends on consent, you may withdraw your consent."},{type:"p",text:"Legal obligations"},{type:"p",text:"We may process information where necessary to comply with applicable legal, tax, accounting, regulatory, fraud-prevention, or governmental requirements."},{type:"p",text:"The European Commission identifies transparency about purposes, legal bases, retention, recipients, international transfers, rights, and automated processing as core GDPR notice requirements."},{type:"h",text:"7. Matching and Automated Processing"},{type:"p",text:"staaake may use information including:"},{type:"ul",items:["Looking For","Offering","Profile information","Sheet information","Stakes","Event activity","Platform activity"]},{type:"p",text:"to identify potentially relevant people, Sheets, events, or opportunities."},{type:"p",text:"Some matching and recommendations may be automated."},{type:"p",text:"A match does not constitute verification, endorsement, investment advice, employment advice, professional advice, or a guarantee of compatibility or results."},{type:"p",text:"Where applicable law provides rights relating to automated decisions that produce legal or similarly significant effects, we will respect those rights."},{type:"h",text:"8. Payments and Payouts"},{type:"p",text:"Payments may be processed through Stripe."},{type:"p",text:"Payouts to eligible users may be processed through Stripe or Payoneer."},{type:"p",text:"These providers may process information such as:"},{type:"ul",items:["Payment details","Bank information","Identity information","Transaction information","Tax information","Fraud-prevention and compliance information"]},{type:"p",text:"We generally do not need to receive or store complete payment-card information when it is collected directly by a payment processor."},{type:"p",text:"Their own privacy policies and legal obligations also apply to their independent processing."},{type:"h",text:"9. Service Providers"},{type:"p",text:"We use third-party providers to operate staaake."},{type:"p",text:"Known providers include:"},{type:"p",text:"Supabase"},{type:"p",text:"Used for backend infrastructure, databases, authentication, and related application functionality."},{type:"p",text:"Resend"},{type:"p",text:"Used to deliver transactional, account, matching, event, and other service emails."},{type:"p",text:"Buffer"},{type:"p",text:"Used where applicable to publish requested content through official staaake social-media channels."},{type:"p",text:"Vercel"},{type:"p",text:"Used for website and application hosting, deployment, and related infrastructure."},{type:"p",text:"Lovable"},{type:"p",text:"Used for application development and related technical infrastructure where applicable."},{type:"p",text:"Stripe"},{type:"p",text:"Used for payment processing and eligible payouts."},{type:"p",text:"Payoneer"},{type:"p",text:"Used for eligible payouts."},{type:"p",text:"We may also use other vendors where reasonably necessary to operate, secure, maintain, or support our services."},{type:"p",text:"Service providers may receive personal data only to the extent relevant to the services they provide, subject to applicable contractual and legal requirements."},{type:"p",text:"Under Swiss law, using a processor does not remove the controller's responsibility for complying with data-protection requirements."},{type:"h",text:"10. Social Media Featuring"},{type:"p",text:"Eligible users may request that a Sheet, profile, event, or other content be featured through official staaake social-media channels."},{type:"p",text:"When you request this feature, relevant content may be transmitted to Buffer and the selected social network for publication."},{type:"p",text:"Once content is published to a third-party social network, that network's own terms and privacy practices also apply."},{type:"h",text:"11. Other Disclosures"},{type:"p",text:"We may disclose information:"},{type:"ul",items:["To service providers that help us operate staaake","At your request or with your consent","To complete transactions or provide requested services","To protect users or our services","To investigate fraud, security incidents, or abuse","To enforce our agreements","To professional advisers where reasonably necessary","To governmental, regulatory, judicial, or law-enforcement authorities where required by applicable law","In connection with a merger, financing, acquisition, restructuring, sale, or transfer of some or all of our business, subject to applicable law"]},{type:"p",text:"We do not sell payment-card information."},{type:"h",text:"12. International Data Transfers"},{type:"p",text:"Dastider AG is based in Switzerland, while staaake operates internationally and uses providers that may process information in other countries."},{type:"p",text:"Personal data may therefore be transferred to or processed outside Switzerland or your country of residence."},{type:"p",text:"Where required, we use legally recognized safeguards, which may include:"},{type:"ul",items:["Countries recognized as providing adequate protection","Standard Contractual Clauses","Contractual safeguards","Other transfer mechanisms permitted by applicable law"]},{type:"p",text:"Swiss law imposes specific conditions on transfers abroad, and data subjects must be informed about foreign disclosures."},{type:"p",text:"Where the GDPR applies, transfers outside the EEA will be handled using an applicable GDPR transfer mechanism where required."},{type:"h",text:"13. Data Retention"},{type:"p",text:"We retain personal data for as long as reasonably necessary for the purposes for which it was collected and for legitimate legal or business requirements."},{type:"p",text:"Retention may depend on:"},{type:"ul",items:["Whether your account remains active","Whether your subscription remains active","The type of data","Transaction and payout requirements","Security and fraud-prevention requirements","Disputes","Legal claims","Tax and accounting obligations","Regulatory requirements"]},{type:"p",text:"Some transaction, payout, security, and legal records may need to be retained after account deleti
433on."},{type:"p",text:"When information is no longer reasonably necessary, we may delete or anonymize it, subject to applicable law."},{type:"h",text:"14. Your Privacy Rights"},{type:"p",text:"Depending on applicable law, you may have rights to:"},{type:"ul",items:["Know whether we process your personal data","Access your personal data","Correct inaccurate or incomplete data","Request deletion","Restrict certain processing","Object to certain processing","Receive qualifying information in a portable format","Withdraw consent where processing relies on consent","Object to direct marketing","Exercise applicable rights concerning automated decision-making"]},{type:"p",text:"Swiss law provides rights concerning information, access, correction, deletion, and qualifying portability."},{type:"h",text:"15. Additional EU/EEA GDPR Rights"},{type:"p",text:"Where the GDPR applies, you may have rights to:"},{type:"ul",items:["Access","Rectification","Erasure","Restriction of processing","Data portability","Object to processing","Object to direct marketing","Withdraw consent","Exercise applicable rights regarding automated decision-making and profiling","Lodge a complaint with the competent data-protection authority"]},{type:"p",text:"These rights are subject to the conditions and exceptions provided by applicable law."},{type:"h",text:"16. Privacy Requests"},{type:"p",text:"To exercise an applicable privacy right, contact:"},{type:"p",text:"[email protected]"},{type:"p",text:"We may request information reasonably necessary to verify your identity and protect your account."},{type:"p",text:"We will respond in accordance with applicable law."},{type:"h",text:"17. Account Deletion"},{type:"p",text:"You may request deletion of your account through available account controls or by contacting us."},{type:"p",text:"Deletion may result in deletion or anonymization of personal data that we are not required or permitted to retain."},{type:"p",text:"We may retain limited records where necessary for:"},{type:"ul",items:["Transactions","Payouts","Legal obligations","Tax and accounting","Security","Fraud prevention","Disputes","Enforcement"]},{type:"p",text:"Previously public information may remain in third-party search indexes, caches, social networks, archives, or other systems outside our control."},{type:"h",text:"18. Marketing and Service Communications"},{type:"p",text:"You may unsubscribe from marketing communications using the unsubscribe option provided or by contacting us."},{type:"p",text:"Even after opting out of marketing, we may continue sending necessary transactional, security, account, payment, event, or other service communications."},{type:"h",text:"19. Cookies and Similar Technologies"},{type:"p",text:"staaake may use cookies, local storage, and similar technologies to:"},{type:"ul",items:["Authenticate users","Keep users signed in","Maintain security","Remember settings","Provide application functionality","Understand and maintain service performance where applicable"]},{type:"p",text:"We may use analytics or other non-essential technologies where they are actually deployed."},{type:"p",text:"Where applicable law requires consent for non-essential cookies or similar technologies, we will request consent before using them."},{type:"h",text:"20. Security"},{type:"p",text:"We use reasonable technical and organizational safeguards designed to protect personal data against unauthorized access, disclosure, alteration, loss, or misuse."},{type:"p",text:"No internet service can guarantee absolute security."},{type:"h",text:"21. Children and Age Requirements"},{type:"p",text:"General staaake services are not intended for children under 13."},{type:"p",text:"Specific services may have higher age requirements."},{type:"p",text:"Dating and adult person-to-person introduction services are intended only for users aged 18 or older."},{type:"p",text:"Users must meet the minimum age applicable to the service they use."},{type:"h",text:"22. Third-Party Websites and Services"},{type:"p",text:"staaake may contain links to or integrations with third-party services."},{type:"p",text:"Third parties are responsible for their own independent privacy practices, and their privacy policies may apply when you interact with them."},{type:"h",text:"23. Changes to This Privacy Policy"},{type:"p",text:"We may update this Privacy Policy when our services, practices, or legal requirements change."},{type:"p",text:"The date at the top will identify the latest version."},{type:"p",text:"Where required by applicable law, we will provide additional notice or obtain consent for material changes."},{type:"h",text:"24. Contact"},{type:"p",text:"Dastider AG"},{type:"p",text:"Switzerland"},{type:"p",text:"[email protected]"}]},D7={title:"Terms of Service",lastUpdated:"September 5, 2026",blocks:[{type:"h",text:"1. Agreement"},{type:"p",text:"These Terms of Service (“Terms”) govern your use of staaake and related services operated by Dastider AG, Switzerland."},{type:"p",text:"By creating an account, purchasing a service, registering for an event, or otherwise using a covered service, you agree to these Terms."},{type:"p",text:"If you do not agree, do not use the services."},{type:"h",text:"2. Services Covered"},{type:"p",text:"These Terms apply across the staaake ecosystem, including:"},{type:"ul",items:["staaake","staaake Sheets","staaakemeets","Power Walk Meets","Reverse Network Meets","Hoopers Meets","Connect Online Meets","Food Club Meets","In Person Dates","staaake Connector","Related websites, applications, events, APIs, MCP services, webhooks, SDKs, and services operated by Dastider AG"]},{type:"h",text:"3. What staaake Provides"},{type:"p",text:"staaake provides products and services that may include:"},{type:"ul",items:["Public usernames and profiles","Visibility Sheets","Free and paid stakes","Networking and discovery","Matching","Events","Event creation and registration","Social-media featuring","Paid visibility and subscriptions","APIs","MCP","Webhooks","SDKs","Software connections and developer services"]},{type:"p",text:"Features may be added, changed, or removed as the services evolve."},{type:"h",text:"4. Accounts"},{type:"p",text:"You are responsible for:"},{type:"ul",items:["Providing reasonably accurate information","Maintaining control of your account","Protecting your login credentials","Protecting API keys and other technical credentials","Activity conducted through your account","Keeping relevant account information current"]},{type:"p",text:"You may not impersonate another person or organization or intentionally provide materially deceptive information."},{type:"h",text:"5. Public Profiles and Sheets"},{type:"p",text:"staaake is designed in part for public visibility."},{type:"p",text:"Information you publish on a public profile, Sheet, list, or event may be publicly accessible."},{type:"p",text:"You are responsible for the content you publish and must have the right to publish it."},{type:"h",text:"6. Stakes"},{type:"p",text:"A “stake” on staaake is a platform feature relating to visibility, membership, placement, access, discovery, or participation within staaake."},{type:"p",text:"A staaake stake is not:"},{type:"ul",items:["Equity","Stock","Ownership in a company","A security","Cryptocurrency","A financial investment product"]},{type:"p",text:"Purchasing or receiving a stake does not give you ownership of Dastider AG, staaake, a Sheet owner, or any associated company or project."},{type:"p",text:"Unless expressly stated otherwise, a stake does not guarantee financial returns, customers, leads, investment, employment, partnerships, introductions, or other outcomes."},{type:"h",text:"7. Paid Services and Subscriptions"},{type:"p",text:"Some staaake services require payment."},{type:"p",text:"Subscription prices, billing periods, included features, usage limits, and tiers are displayed when applicable."},{type:"p",text:"Unless otherwise stated at purchase, recurring subscriptions automatically renew according to the billing period selected."},{type:"p",text:"By starting a recurring subscription, you authorize the applicable payment provider to charge the applicable amount at each renewal until cancellation."},{type:"h",text:"8. Cancellation"},{type:"p",text:"Recurring subscriptions may be canceled at any time."},{type:"p",text:"Cancellation stops the next renewal."},{type:"p",text:"Unless specifically stated otherwise, cancellation does not immediately terminate benefits already paid for."},{type:"p",text:"You retain the applicable paid service, visibility, subscription tier, or access until the end of the current paid billing period."},{type:"p",text:"After that period ends, the applicable paid benefits expire or revert to an available free level."},{type:"h",text:"9. Refunds"},{type:"p",text:"Except where required by applicable law, payments are generally non-refundable once a paid billing period has begun."},{type:"p",text:"We generally do not provide prorated refunds for unused portions of a billing period."},{type:"p",text:"We may provide a refund, credit, extension, or other remedy at our discretion for circumstances including:"},{type:"ul",items:["Duplicate charges","Billing errors","Material technical failures","Charges incorrectly made after cancellation","Other exceptional circumstances"]},{type:"p",text:"Mandatory consumer rights that cannot legally be excluded remain unaffected."},{type:"h",text:"10. Payments"},{type:"p",text:"Payments may be processed through Stripe."},{type:"p",text:"Your transaction may also be subject to the payment provider's terms, privacy practices, fraud controls, and verification requirements."}
433,{type:"h",text:"11. Payouts and Earnings"},{type:"p",text:"Certain staaake services may allow eligible users to receive payouts."},{type:"p",text:"Payouts may be provided through Stripe or Payoneer."},{type:"p",text:"Payout eligibility, platform fees, processing fees, verification requirements, minimums, restrictions, and other conditions may apply."},{type:"p",text:"Payment or payout providers may require identity, banking, tax, or compliance information."},{type:"p",text:"Users receiving payouts are responsible for their own applicable taxes and reporting obligations."},{type:"p",text:"Dastider AG may delay or withhold a payout where reasonably necessary because of:"},{type:"ul",items:["Fraud","Chargebacks","Disputes","Account violations","Payment-provider requirements","Legal or regulatory requirements","Security investigations"]},{type:"h",text:"12. Matching and Discovery"},{type:"p",text:"staaake may automatically or manually match or recommend:"},{type:"ul",items:["People","Sheets","Events","Opportunities","Services"]},{type:"p",text:"Matches and recommendations are discovery tools only."},{type:"p",text:"We do not guarantee:"},{type:"ul",items:["Compatibility","Accuracy","Responses","Investment","Employment","Sales","Partnerships","Relationships","Event attendance","Business opportunities","Any particular outcome"]},{type:"p",text:"Users are responsible for their own decisions and due diligence before entering into personal, professional, commercial, or financial relationships."},{type:"h",text:"13. Events"},{type:"p",text:"Events may be organized by Dastider AG, staaake, independent hosts, community members, venues, or third parties."},{type:"p",text:"Unless expressly stated otherwise, staaake does not guarantee the identity, conduct, safety, accuracy, quality, attendance, or actions of independent organizers or participants."},{type:"p",text:"Event-specific terms, venue rules, age restrictions, ticket conditions, or cancellation policies may apply."},{type:"p",text:"Participants are responsible for their own safety and decisions when attending or meeting other people."},{type:"h",text:"14. Dating and Personal Introductions"},{type:"p",text:"Services involving dating or adult person-to-person introductions are intended only for users aged 18 or older."},{type:"p",text:"staaake provides discovery or introduction functionality and does not guarantee the identity, intentions, conduct, compatibility, safety, or suitability of another user."},{type:"p",text:"Users are responsible for exercising appropriate judgment and precautions when communicating with or meeting other people."},{type:"h",text:"15. staaake Connector"},{type:"p",text:"staaake Connector may enable customers to connect websites, applications, databases, backends, or other systems and expose authorized functionality through APIs, MCP, webhooks, SDKs, or related interfaces."},{type:"p",text:"You are responsible for:"},{type:"ul",items:["Having authority to connect the system","Having authorization to access relevant data","Choosing appropriate permissions","Protecting credentials and API keys","Configuring access appropriately","Complying with applicable laws","Complying with third-party platform terms","Data and content transmitted through your connections"]},{type:"p",text:"You may not use staaake Connector to obtain unauthorized access to systems, accounts, or information."},{type:"h",text:"16. Usage Limits"},{type:"p",text:"Certain services may have:"},{type:"ul",items:["API limits","MCP limits","Webhook limits","Storage limits","Connection limits","Rate limits","Event limits","Feature limits","Other usage allowances"]},{type:"p",text:"Applicable limits may depend on your tier."},{type:"p",text:"You may not intentionally circumvent technical or account limits."},{type:"h",text:"17. Social Featuring"},{type:"p",text:"Eligible users may be able to request that a Sheet, event, profile, or other content be published through official staaake social channels."},{type:"p",text:"By requesting publication, you authorize Dastider AG and its service providers to process and publish the relevant content."},{type:"p",text:"We do not guarantee:"},{type:"ul",items:["Publication timing","Reach","Views","Impressions","Engagement","Clicks","Followers","Leads","Continued availability of a third-party social post"]},{type:"h",text:"18. User Content"},{type:"p",text:"You retain ownership of content you submit to staaake."},{type:"p",text:"You grant Dastider AG a worldwide, non-exclusive license to host, store, process, reproduce, display, distribute, and otherwise use that c
433ontent to the extent reasonably necessary to:"},{type:"ul",items:["Operate the services","Provide features you request","Display public content","Promote content when you request or authorize promotion","Maintain and improve the services"]},{type:"p",text:"This license ends when the relevant content is deleted except where continued retention or use is reasonably necessary for legal, technical, security, archival, or previously authorized publication purposes."},{type:"h",text:"19. Intellectual Property"},{type:"p",text:"The staaake services, software, branding, designs, interfaces, logos, and original platform content belong to Dastider AG or its licensors and are protected by applicable intellectual-property laws."},{type:"p",text:"These Terms do not transfer ownership of staaake intellectual property to users."},{type:"h",text:"20. Third-Party Services"},{type:"p",text:"staaake may integrate with or rely on third-party services."},{type:"p",text:"Third-party services may have their own terms and policies."},{type:"p",text:"We are not responsible for the independent operation, policies, outages, changes, restrictions, or actions of third-party services."},{type:"h",text:"21. Acceptable Use"},{type:"p",text:"Your use of staaake is subject to the Acceptable Use & Community Policy."},{type:"p",text:"Serious or repeated violations may result in restrictions, suspension, or termination."},{type:"h",text:"22. Suspension and Termination"},{type:"p",text:"We may restrict, suspend, or terminate an account or service where reasonably necessary because of:"},{type:"ul",items:["Fraud","Abuse","Illegal activity","Security risks","Nonpayment","Chargebacks or payment abuse","Serious or repeated policy violations","Harm to other users","Harm to our services or infrastru
433cture","Legal or regulatory requirements"]},{type:"p",text:"Termination for a serious violation does not automatically entitle the user to a refund."},{type:"p",text:"You may stop using staaake at any time."},{type:"h",text:"23. No Guaranteed Results"},{type:"p",text:"staaake provides visibility, discovery, networking, community, events, and software services."},{type:"p",text:"We do not guarantee any particular:"},{type:"ul",items:["Visibility","Audience size","Followers","Leads","Customers","Revenue","Investment","Employment","Partnership","Relationship","Event attendance","Match","API usage","Commercial outcome"]},{type:"h",text:"24. Service Availability"},{type:"p",text:"We aim to provide reliable services but cannot guarantee uninterrupted, secure, or error-free operation."},{type:"p",text:"Maintenance, outages, technical problems, third-party failures, security incidents, or other circumstances may temporarily affect availability."},{type:"p",text:"Features may be modified, replaced, suspended, or discontinued."},{type:"h",text:"25. Disclaimers"},{type:"p",text:"To the extent permitted by applicable law, services are provided on an “as available” basis."},{type:"p",text:"Users are responsible for determining whether staaake is appropriate for their purposes."},{type:"p",text:"staaake does not provide legal, tax, investment, financial, employment, medical, or other regulated professional advice."},{type:"h",text:"26. Limitation of Liability"},{type:"p",text:"To the maximum extent permitted by applicable law, Dastider AG is not liable for indirect, incidental, special, consequential, or similar losses arising from use of or inability to use the services."},{type:"p",text:"Nothing in these Terms excludes or limits liability that cannot lawfully be excluded or limited."},{type:"h",text:"27. Indemnification"},{type:"p",text:"To the extent permitted by applicable law, you agree to be responsible for claims, losses, or costs arising from your unlawful use of the services, your violation of these Terms, or content or systems you connect without appropriate rights or authorization."},{type:"h",text:"28. Governing Law"},{type:"p",text:"These Terms are governed by the laws of Switzerland, without prejudice to mandatory consumer protections or other rights that applicable law may grant you."},{type:"h",text:"29. Changes to the Services or Terms"},{type:"p",text:"We may modify our services and these Terms as staaake evolves."},{type:"p",text:"When required by law, we will provide appropriate notice of material changes."},{type:"h",text:"30. Contact"},{type:"p",text:"Dastider AG"},{type:"p",text:"Switzerland"},{type:"p",text:"[email protected]"}]},$7={title:"Cancellation & Refund Policy",lastUpdated:"September 5, 2026",blocks:[{type:"p",text:"This Cancellation & Refund Policy applies to paid staaake services operated by Dastider AG, unless different terms are clearly presented for a specific purchase."},{type:"h",text:"1. Services Covered"},{type:"p",text:"This policy applies to paid services across the staaake ecosystem, including:"},{type:"ul",items:["staaake","staaake Sheets","staaakemeets and related event services","staaake Connector","Paid stakes","Paid visibility","Paid tiers","Recurring subscriptions","Other paid staaake services"]},{type:"h",text:"2. Recurring Subscriptions"},{type:"p",text:"Paid subscriptions may automatically renew according to the billing period displayed when you subscribe."},{type:"p",text:"For example, a monthly subscription generally renews each month until canceled."},{type:"p",text:"The applicable price, tier, billing interval, and benefits are displayed when you purchase the service."},{type:"h",text:"3. Cancel Anytime"},{type:"p",text:"You may cancel a recurring subscription at any time."},{type:"p",text:"When you cancel:"},{type:"ul",items:["Future automatic renewal stops.","You are not charged for the next billing period.","Your current paid period normally continues until its scheduled end.","You continue receiving the applicable paid service, visibility, tier, or access during the peri
433od you already paid for."]},{type:"p",text:"At the end of that period, the paid benefits expire or revert to the applicable free service where available."},{type:"p",text:"Cancellation does not normally terminate the already-paid period immediately."},{type:"h",text:"4. Refunds"},{type:"p",text:"Except where required by applicable law, payments are generally non-refundable after a paid billing period has begun."},{type:"p",text:"We generally do not provide prorated refunds for unused time."},{type:"p",text:"For example, if you purchase a one-month subscription and cancel after 10 days, you normally retain the service for the rest of that paid month rather than receiving a refund for the remaining days."},{type:"h",text:"5. Billing Errors"},{type:"p",text:"Contact us if you believe there has been:"},{type:"ul",items:["A duplicate charge","An incorrect amount charged","A technical billing error","A renewal after a properly completed cancellation","Another unauthorized or erroneous charge"]},{type:"p",text:"We will investigate legitimate billing disputes and provide an appropriate remedy where warranted."},{type:"h",text:"6. Material Service Problems"},{type:"p",text:"If a material technical problem prevents us from providing a paid service you purchased, we may, depending on the circumstances, provide:"},{type:"ul",items:["A refund","A partial refund","Account credit","An extension","Replacement service","Another reasonable remedy"]},{type:"h",text:"7. Paid Stakes and Visibility"},{type:"p",text:"Paid stakes or visibility benefits generally remain active for the period already purchased after cancellation."},{type:"p",text:"Cancellation prevents future renewal but does not ordinarily remove the paid stake or visibility immediately."},{type:"p",text:"When the paid period ends, the associated paid benefits expire according to the applicable service rules."},{type:"h",text:"8. staaake Connector"},{type:"p",text:"Canceling a paid staaake Connector subscription prevents the next renewal."},{type:"p",text:"Paid tier benefits normally remain available until the end of the current billing period."},{type:"p",text:"After expiration, usage limits, connections, features, logs, or other functionality may revert to the applicable free tier or become unavailable according to the product's current tier rules."},{type:"h",text:"9. Events and One-Time Purchases"},{type:"p",text:"Event tickets, one-time purchases, special programs, or other non-subscription purchases may have purchase-specific cancellation and refund conditions."},{type:"p",text:"If specific conditions are clearly displayed for a purchase, those conditions apply to that transaction."},{type:"p",text:"If no separate conditions are provided, payments for already-delivered one-time services are generally non-refundable except where required by law or where Dastider AG determines that a refund is appropriate."},{type:"h",text:"10. Account Suspension or Termination"},{type:"p",text:"If an account is suspended or terminated because of:"},{type:"ul",items:["Fraud","Abuse","Illegal activity","Chargeback abuse","Security threats","Serious or repeated Terms violations"]},{type:"p",text:"unused subscription time is not automatically refundable."},{type:"p",text:"Mandatory rights under applicable law remain unaffected."},{type:"h",text:"11. Payment Providers"},{type:"p",text:"Payments may be processed by Stripe."},{type:"p",text:"Refunds, where approved, may be returned through the original payment method or another method reasonably determined by Dastider AG and the applicable payment provider."},{type:"p",text:"Processing times after a refund is issued may depend on the payment provider or financial institution."},{type:"h",text:"12. Mandatory Consumer Rights"},{type:"p",text:"Nothing in this policy removes consumer cancellation, withdrawal, refund, or other rights that cannot legally be waived under applicable law."},{type:"p",text:"Where mandatory law gives you greater rights than this policy, those mandatory rights apply."},{type:"h",text:"13. Contact"},{type:"p",text:"For cancellation, payment, or refund questions:"},{type:"p",text:"Dastider AG"},{type:"p",text:"Switzerland"},{type:"p",text:"[email protected]"}]},U7={title:"Acceptable Use & Community Policy",lastUpdated:"September 5, 2026",blocks:[{type:"p",text:"This Acceptable Use & Community Policy applies to the staaake ecosystem operated by Dastider AG."},{type:"p",text:"staaake is designed for visibility, networking, discovery, events, communities, and software connectivity."},{type:"p",text:"Users must use the services responsibly and lawfully."},{type:"h",text:"1. Services Covered"},{type:"p",text:"This Policy applies to:"},{type:"ul",items:["staaake","staaake Sheets","staaakemeets","Power Walk Meets","Reverse Network Meets","Hoopers Meets","Connect Online Meets","Food Club Meets","In Person Dates","staaake Connector","Related websites, applications, events, APIs, MCP services, webhooks, SDKs, communities, and services"]},{type:"h",text:"2. General Rules"},{type:"p",text:"You may not use staaake to:"},{type:"ul",items:["Break applicable law","Commit or facilitate fraud","Scam or intentionally deceive users","Impersonate another person or organization","Create materially deceptive profiles, Sheets, events, or listings","Harass, threaten, stalk, intimidate, or abuse people","Facilitate violence or credible threats","Exploit or endanger minors","Publish another person's private information without authorization","Infringe intellectual-property rights","Distribute malware or malicious code","Gain unauthorized access to accounts, systems, databases, or information","Circumvent security controls","Cir
433cumvent platform limits","Interfere with the operation of the services","Facilitate unlawful transactions or activities","Facilitate money laundering or financial crime","Abuse staaake infrastructure or other users"]},{type:"h",text:"3. Spam and Platform Manipulation"},{type:"p",text:"You may not:"},{type:"ul",items:["Send unlawful or abusive spam","Artificially manipulate stakes","Manipulate rankings","Manipulate matching","Manipulate event registrations","Manipulate referrals","Manipulate engagement or platform metrics","Create accounts primarily to circumvent restrictions","Use automation to overwhelm or abuse the services","Circumvent usage or rate limits"]},{type:"p",text:"Reasonable use of permitted automation, APIs, MCP, webhooks, or SDKs is allowed when consistent with applicable product rules."},{type:"h",text:"4. Profiles, Sheets and Public Content"},{type:"p",text:"You are responsible for information and content you publish."},{type:"p",text:"You must have the right to publish your content."},{type:"p",text:"Do not publish:"},{type:"ul",items:["Confidential information without authorization","Another person's private information without authorization","Fraudulent or materially deceptive claims","Content that violates applicable law","Content that infringes another person's intellectual-property rights"]},{type:"p",text:"Because Sheets, profiles, lists, and events may be public, users should consider carefully what they choose to publish."},{type:"h",text:"5. Stakes"},{type:"p",text:"You may not use stakes to:"},{type:"ul",items:["Misrepresent ownership or investment relationships","Falsely claim that a stake represents equity or securities","Facilitate fraud","Manipulate platform rankings or limits","Mislead users about the nature of a relationship"]},{type:"p",text:"staaake stakes are visibility, membership, placement, access, discovery, or participation features, not financial securities or equity interests."},{type:"h",text:"6. Events"},{type:"p",text:"Event organizers and attendees must behave lawfully and responsibly."},{type:"p",text:"Events may not be used to facilitate:"},{type:"ul",items:["Fraud","Harassment","Violence","Exploitation","Illegal activity","Unsafe or deliberately deceptive conduct"]},{type:"p",text:"Hosts are responsible for complying with applicable venue rules, permits, licensing requirements, age restrictions, safety requirements, and local laws for events they organize."},{type:"p",text:"Participants are responsible for their own conduct."},{type:"h",text:"7. Dating and Personal Introductions"},{type:"p",text:"Users of dating or adult person-to-person introduction services must be at least 18 years old."},{type:"p",text:"The following are prohibited:"},{type:"ul",items:["Harassment","Stalking","Coercion","Sexual exploitation","Impersonation","Threats","Non-consensual sharing of intimate content","Solicitation involving minors","Fraudulent romantic or financial schemes"]},{type:"p",text:"Users are responsible for exercising appropriate judgment and precautions when communicating with or meeting other people."},{type:"h",text:"8. staaake Connector and Developer Services"},{type:"p",text:"You may use staaake Connector only with systems, accounts, applications, databases, and data you are authorized to access."},{type:"p",text:"You may not use staaake Connector, APIs, MCP, webhooks, SDKs, or related infrastructure to:"},{type:"ul",items:["Circumvent authentication","Obtain unauthorized access","Access data without authorization","Attack or compromise third-party systems","Distribute malware","Steal credentials","Exfiltrate information without authorization","Conceal unlawful activity","Intentionally overwhelm systems","Circumvent usage restrictions","Interfere with other customers","Expose credentials or sensitive information without authorization"]},{type:"p",text:"You are responsible for permissions you configure and credentials you create or distribute."},{type:"h",text:"9. API Keys and Credentials"},{type:"p",text:"API keys, access tokens, passwords, and other credentials must be handled securely."},{type:"p",text:"You may not knowingly publish or distribute credentials in a manner that enables unauthorized access."},{type:"p",text:"If you believe a credential has been compromised, you should revoke or replace it promptly."},{type:"h",text:"10. Social Featuring"},{type:"p",text:"Content submitted for publication through official staaake channels must comply with this Policy."},{type:"p",text:"You may not use social featuring to publish:"},{type:"ul",items:["Fraudulent content","Unauthorized personal information","Unlawful content","Content you do not have the right to publish","Material designed primarily to deceive users"]},{type:"p",text:"We may decline or remove a feature that violates this Policy or applicable third-party platform rules."},{type:"h",text:"11. Security"},{type:"p",text:"You may not:"},{type:"ul",items:["Probe or test vulnerabilities without authorization","Bypass authentication","Circumvent access controls","Intentionally interfere with service availability","Introduce mal
433icious code","Attempt to access another user's account","Abuse bugs or vulnerabilities to obtain unauthorized access or benefits"]},{type:"p",text:"Security concerns may be reported to [email protected]."},{type:"h",text:"12. Enforcement"},{type:"p",text:"Depending on the circumstances, violations may result in:"},{type:"ul",items:["Warnings","Content removal","Feature restrictions","Removal from events or communities","Removal of public listings","Suspension","Account termination","API or Connector access revocation","Payout holds where reasonably appropriate","Reporting to payment providers","Reporting to relevant authorities where required or appropriate under applicable law"]},{type:"p",text:"We may consider severity, intent, risk, previous violations, impact on other users, and platform safety when determining enforcement."},{type:"h",text:"13. Investigations"},{type:"p",text:"We may investigate suspected violations of these policies."},{type:"p",text:"Users may be required to provide information reasonably necessary to investigate fraud, abuse, payment disputes, security incidents, or other violations."},{type:"p",text:"We may preserve relevant records where reasonably necessary for an investigation, legal obligation, dispute, or enforcement action."},{type:"h",text:"14. Changes to This Policy"},{type:"p",text:"We may update this Policy as the staaake ecosystem evolves."},{type:"p",text:"The “Last updated” date identifies the current version."},{type:"h",text:"15. Reporting and Contact"},{type:"p",text:"To report abuse, security issues, or suspected violations:"},{type:"p",text:"Dastider AG"},{type:"p",text:"Switzerland"},{type:"p",text:"[email protected]"}]},Tp=new h3({defaultOptions:{queries:{refetchOnWindowFocus:!1}}});{const e=xn(),t=window.location.hostname.includes("lovableproject.com")||window.location.hostname.includes("lovable.app"),n=window.location.pathname.replace(/\/+$/,""),r=n==="/auth/handoff";if(e.kind!=="landing"&&!t&&!r){const s=n.split("/").filter(Boolean),o=s.length===1?decodeURIComponent(s[0]):null;if(o){const a=new URLSearchParams(window.location.search).get("date_id");Tp.prefetchQuery({queryKey:kw(o,null,a),queryFn:()=>Sw(o,a,null),staleTime:6e4})}else Tp.prefetchQuery({queryKey:NI(),queryFn:()=>TI(),staleTime:6e4})}}const F7=()=>(AI(),II(),window.name.startsWith("google-auth")||!!window.opener&&(window.location.search.includes("code=")||window.location.hash.includes("access_token"))?null:i.jsxs(i.Fragment,{children:[i.jsx(uI,{}),i.jsx(dI,{}),i.jsx(af,{}),i.jsx(I7,{children:i.jsx(xE,{children:i.jsxs(yE,{children:[i.jsx(Ra,{path:"/auth/handoff",element:i.jsx(N7,{})}),i.jsx(Ra,{path:"/:event_code",element:i.jsx(z7,{})}),i.jsx(Ra,{path:"*",element:i.jsx(NY,{})})]})})})]})),z7=()=>{const{event_code:e=""}=Wd(),t=j9(e);return t==="event"?i.jsx(p7,{}):t==="reserved"?i.jsx(Lm,{}):i.jsx(b9,{})},B7=()=>(AI(),II(),window.name.startsWith("google-auth")||!!window.opener&&(window.location.search.includes("code=")||window.location.hash.includes("access_token"))?null:i.jsxs(i.Fragment,{children:[i.jsx(uI,{}),i.jsx(dI,{}),i.jsx(xE,{children:i.jsxs(yE,{children:[i.jsx(Ra,{path:"/",element:i.jsx(TS,{})}),i.jsx(Ra,{path:"/:segment",element:i.jsx(W7,{})}),i.jsx(Ra,{path:"*",element:i.jsx(TS,{})})]})})]})),W7=()=>{const{segment:e=""}=Wd();return UA(e)?i.jsx(Lm,{}):i.jsx(E7,{})},H7={"/privacy":L7,"/terms":D7,"/refunds":$7,"/acceptable-use":U7},K7=()=>{const e=xn(),t=window.location.pathname.replace(/\/+$/,"")||"/",n=t==="/auth/handoff";if(A7())return i.jsx(Ew,{});if(e.kind==="landing"&&!n){const s=H7[t];return s?i.jsx(M7,{doc:s}):i.jsx(ak,{client:Tp,children:i.jsx(ck,{children:i.jsx(aS,{children:i.jsx(B7,{})})})})}return i.jsx(ak,{client:Tp,children:i.jsx(ck,{children:i.jsx(aS,{children:i.jsx(F7,{})})})})};try{localStorage.removeItem("sb-errlhmcitfpyyhnwtqrs-auth-token")}catch{}tE(document.getElementById("root")).render(i.jsx(K7,{}));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.