vendor: 4,918 bytes, lines 1-9
1var Bv=e=>{throw TypeError(e)};var Fh=(e,t,n)=>t.has(e)||Bv("Cannot "+n);var ce=(e,t,n)=>(Fh(e,t,"read from private field"),n?n.call(e):t.get(e)),Nt=(e,t,n)=>t.has(e)?Bv("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),it=(e,t,n,r)=>(Fh(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),xn=(e,t,n)=>(Fh(e,t,"access private method"),n);var Zc=(e,t,n,r)=>({set _(a){it(e,t,a,n)},get _(){return ce(e,t,r)}});function Zk(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();var yr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $w(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Qk(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),n}var Fw={exports:{}},zu={},Uw={exports:{}},ut={};/** 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 Cc=Symbol.for("react.element"),Jk=Symbol.for("react.portal"),Xk=Symbol.for("react.fragment"),eC=Symbol.for("react.strict_mode"),tC=Symbol.for("react.profiler"),nC=Symbol.for("react.provider"),rC=Symbol.for("react.context"),sC=Symbol.for("react.forward_ref"),aC=Symbol.for("react.suspense"),iC=Symbol.for("react.memo"),oC=Symbol.for("react.lazy"),Vv=Symbol.iterator;function lC(e){return e===null||typeof e!="object"?null:(e=Vv&&e[Vv]||e["@@iterator"],typeof e=="function"?e:null)}var zw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Bw=Object.assign,Vw={};function $o(e,t,n){this.props=e,this.context=t,this.refs=Vw,this.updater=n||zw}$o.prototype.isReactComponent={};$o.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")};$o.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ww(){}Ww.prototype=$o.prototype;function Cp(e,t,n){this.props=e,this.context=t,this.refs=Vw,this.updater=n||zw}var Ep=Cp.prototype=new Ww;Ep.constructor=Cp;Bw(Ep,$o.prototype);Ep.isPureReactComponent=!0;var Wv=Array.isArray,Hw=Object.prototype.hasOwnProperty,Pp={current:null},qw={key:!0,ref:!0,__self:!0,__source:!0};function Yw(e,t,n){var r,a={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)Hw.call(t,r)&&!qw.hasOwnProperty(r)&&(a[r]=t[r]);var l=arguments.length-2;if(l===1)a.children=n;else if(1<l){for(var c=Array(l),d=0;d<l;d++)c[d]=arguments[d+2];a.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)a[r]===void 0&&(a[r]=l[r]);return{$$typeof:Cc,type:e,key:i,ref:o,props:a,_owner:Pp.current}}function cC(e,t){return{$$typeof:Cc,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Tp(e){return typeof e=="object"&&e!==null&&e.$$typeof===Cc}function dC(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Hv=/\/+/g;function Uh(e,t){return typeof e=="object"&&e!==null&&e.key!=null?dC(""+e.key):t.toString(36)}function Cd(e,t,n,r,a){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Cc:case Jk:o=!0}}
vendor: 1,341 bytes, line 9
9if(o)return o=e,a=a(o),e=r===""?"."+Uh(o,0):r,Wv(a)?(n="",e!=null&&(n=e.replace(Hv,"$&/")+"/"),Cd(a,t,n,"",function(d){return d})):a!=null&&(Tp(a)&&(a=cC(a,n+(!a.key||o&&o.key===a.key?"":(""+a.key).replace(Hv,"$&/")+"/")+e)),t.push(a)),1;if(o=0,r=r===""?".":r+":",Wv(e))for(var l=0;l<e.length;l++){i=e[l];var c=r+Uh(i,l);o+=Cd(i,t,n,c,a)}else if(c=lC(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=r+Uh(i,l++),o+=Cd(i,t,n,c,a);else if(i==="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 o}function Qc(e,t,n){if(e==null)return e;var r=[],a=0;return Cd(e,r,"","",function(i){return t.call(n,i,a++)}),r}function uC(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 Mn={current:null},Ed={transition:null},hC={ReactCurrentDispatcher:Mn,ReactCurrentBatchConfig:Ed,ReactCurrentOwner:Pp};function Gw(){throw Error("act(...) is not supported in production builds of React.")}
vendor: 6,947 bytes, lines 9-25
9ut.Children={map:Qc,forEach:function(e,t,n){Qc(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Qc(e,function(){t++}),t},toArray:function(e){return Qc(e,function(t){return t})||[]},only:function(e){if(!Tp(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ut.Component=$o;ut.Fragment=Xk;ut.Profiler=tC;ut.PureComponent=Cp;ut.StrictMode=eC;ut.Suspense=aC;ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=hC;ut.act=Gw;ut.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=Bw({},e.props),a=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=Pp.current),t.key!==void 0&&(a=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)Hw.call(t,c)&&!qw.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 d=0;d<c;d++)l[d]=arguments[d+2];r.children=l}return{$$typeof:Cc,type:e.type,key:a,ref:i,props:r,_owner:o}};ut.createContext=function(e){return e={$$typeof:rC,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:nC,_context:e},e.Consumer=e};ut.createElement=Yw;ut.createFactory=function(e){var t=Yw.bind(null,e);return t.type=e,t};ut.createRef=function(){return{current:null}};ut.forwardRef=function(e){return{$$typeof:sC,render:e}};ut.isValidElement=Tp;ut.lazy=function(e){return{$$typeof:oC,_payload:{_status:-1,_result:e},_init:uC}};ut.memo=function(e,t){return{$$typeof:iC,type:e,compare:t===void 0?null:t}};ut.startTransition=function(e){var t=Ed.transition;Ed.transition={};try{e()}finally{Ed.transition=t}};ut.unstable_act=Gw;ut.useCallback=function(e,t){return Mn.current.useCallback(e,t)};ut.useContext=function(e){return Mn.current.useContext(e)};ut.useDebugValue=function(){};ut.useDeferredValue=function(e){return Mn.current.useDeferredValue(e)};ut.useEffect=function(e,t){return Mn.current.useEffect(e,t)};ut.useId=function(){return Mn.current.useId()};ut.useImperativeHandle=function(e,t,n){return Mn.current.useImperativeHandle(e,t,n)};ut.useInsertionEffect=function(e,t){return Mn.current.useInsertionEffect(e,t)};ut.useLayoutEffect=function(e,t){return Mn.current.useLayoutEffect(e,t)};ut.useMemo=function(e,t){return Mn.current.useMemo(e,t)};ut.useReducer=function(e,t,n){return Mn.current.useReducer(e,t,n)};ut.useRef=function(e){return Mn.current.useRef(e)};ut.useState=function(e){return Mn.current.useState(e)};ut.useSyncExternalStore=function(e,t,n){return Mn.current.useSyncExternalStore(e,t,n)};ut.useTransition=function(){return Mn.current.useTransition()};ut.version="18.3.1";Uw.exports=ut;var h=Uw.exports;const be=$w(h),Kw=Zk({__proto__:null,default:be},[h]);/** 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 fC=h,mC=Symbol.for("react.element"),pC=Symbol.for("react.fragment"),gC=Object.prototype.hasOwnProperty,vC=fC.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,xC={key:!0,ref:!0,__self:!0,__source:!0};function Zw(e,t,n){var r,a={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)gC.call(t,r)&&!xC.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)a[r]===void 0&&(a[r]=t[r]);return{$$typeof:mC,type:e,key:i,ref:o,props:a,_owner:vC.current}}zu.Fragment=pC;zu.jsx=Zw;zu.jsxs=Zw;Fw.exports=zu;var s=Fw.exports,Qw={exports:{}},dr={},Jw={exports:{}},Xw={};/** 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(_,O){var G=_.length;_.push(O);e:for(;0<G;){var Y=G-1>>>1,oe=_[Y];if(0<a(oe,O))_[Y]=O,_[G]=oe,G=Y;else break e}}function n(_){return _.length===0?null:_[0]}function r(_){if(_.length===0)return null;var O=_[0],G=_.pop();if(G!==O){_[0]=G;e:for(var Y=0,oe=_.length,M=oe>>>1;Y<M;){var I=2*(Y+1)-1,he=_[I],X=I+1,K=_[X];if(0>a(he,G))X<oe&&0>a(K,he)?(_[Y]=K,_[X]=G,Y=X):(_[Y]=he,_[I]=G,Y=I);else if(X<oe&&0>a(K,G))_[Y]=K,_[X]=G,Y=X;else break e}}return O}function a(_,O){var G=_.sortIndex-O.sortIndex;return G!==0?G:_.id-O.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],d=[],u=1,f=null,m=3,w=!1,x=!1,p=!1,b=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(_){for(var O=n(d);O!==null;){if(O.callback===null)r(d);else if(O.startTime<=_)r(d),O.sortIndex=O.expirationTime,t(c,O);else break;O=n(d)}}function j(_){if(p=!1,y(_),!x)if(n(c)!==null)x=!0,D(N);else{var O=n(d);O!==null&&T(j,O.startTime-_)}}function N(_,O){x=!1,p&&(p=!1,v(E),E=-1),w=!0;var G=m;try{for(y(O),f=n(c);f!==null&&(!(f.expirationTime>O)||_&&!F());){var Y=f.callback;if(typeof Y=="function"){f.callback=null,m=f.priorityLevel;var oe=Y(f.expirationTime<=O);O=e.unstable_now(),typeof oe=="function"?f.callback=oe:f===n(c)&&r(c),y(O)}else r(c);f=n(c)}if(f!==null)var M=!0;else{var I=n(d);I!==null&&T(j,I.startTime-O),M=!1}return M}finally{f=null,m=G,w=!1}}var k=!1,C=null,E=-1,H=5,A=-1;function F(){return!(e.unstable_now()-A<H)}function U(){if(C!==null){var _=e.unstable_now();A=_;var O=!0;try{O=C(!0,_)}finally{O?ae():(k=!1,C=null)}}else k=!1}var ae;if(typeof g=="function")ae=function(){g(U)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,se=q.port2;q.port1.onmessage=U,ae=function(){se.postMessage(null)}}else ae=function(){b(U,0)};function D(_){C=_,k||(k=!0,ae())}function T(_,O){E=b(function(){_(e.unstable_now())},O)}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(_){_.callback=null},e.unstable_continueExecution=function(){x||w||(x=!0,D(N))},e.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(_){switch(m){case 1:case 2:case 3:var O=3;break;default:O=m}var G=m;m=O;
vendor: 5,128 bytes, lines 25-33
25try{return _()}finally{m=G}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,O){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var G=m;m=_;try{return O()}finally{m=G}},e.unstable_scheduleCallback=function(_,O,G){var Y=e.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?Y+G:Y):G=Y,_){case 1:var oe=-1;break;case 2:oe=250;break;case 5:oe=1073741823;break;case 4:oe=1e4;break;default:oe=5e3}return oe=G+oe,_={id:u++,callback:O,priorityLevel:_,startTime:G,expirationTime:oe,sortIndex:-1},G>Y?(_.sortIndex=G,t(d,_),n(c)===null&&_===n(d)&&(p?(v(E),E=-1):p=!0,T(j,G-Y))):(_.sortIndex=oe,t(c,_),x||w||(x=!0,D(N))),_},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(_){var O=m;return function(){var G=m;m=O;try{return _.apply(this,arguments)}finally{m=G}}}})(Xw);Jw.exports=Xw;var yC=Jw.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 wC=h,lr=yC;function xe(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 e0=new Set,Ml={};function wi(e,t){wo(e,t),wo(e+"Capture",t)}function wo(e,t){for(Ml[e]=t,e=0;e<t.length;e++)e0.add(t[e])}var Ps=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wf=Object.prototype.hasOwnProperty,bC=/^[: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]*$/,qv={},Yv={};function jC(e){return Wf.call(Yv,e)?!0:Wf.call(qv,e)?!1:bC.test(e)?Yv[e]=!0:(qv[e]=!0,!1)}function _C(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 NC(e,t,n,r){if(t===null||typeof t>"u"||_C(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 In(e,t,n,r,a,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var vn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){vn[e]=new In(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];vn[t]=new In(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){vn[e]=new In(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){vn[e]=new In(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){vn[e]=new In(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){vn[e]=new In(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){vn[e]=new In(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){vn[e]=new In(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){vn[e]=new In(e,5,!1,e.toLowerCase(),null,!1,!1)});var Rp=/[\-:]([a-z])/g;function Dp(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
33-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(Rp,Dp);vn[t]=new In(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(Rp,Dp);vn[t]=new In(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(Rp,Dp);vn[t]=new In(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){vn[e]=new In(e,1,!1,e.toLowerCase(),null,!1,!1)});vn.xlinkHref=new In("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){vn[e]=new In(e,1,!1,e.toLowerCase(),null,!0,!0)});function Op(e,t,n,r){var a=vn.hasOwnProperty(t)?vn[t]:null;(a!==null?a.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(NC(t,n,a,r)&&(n=null),r||a===null?jC(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):a.mustUseProperty?e[a.propertyName]=n===null?a.type===3?!1:"":n:(t=a.attributeName,r=a.attributeNamespace,n===null?e.removeAttribute(t):(a=a.type,n=a===3||a===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Ls=wC.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Jc=Symbol.for("react.element"),Fi=Symbol.for("react.portal"),Ui=Symbol.for("react.fragment"),Ap=Symbol.for("react.strict_mode"),Hf=Symbol.for("react.profiler"),t0=Symbol.for("react.provider"),n0=Symbol.for("react.context"),Mp=Symbol.for("react.forward_ref"),qf=Symbol.for("react.suspense"),Yf=Symbol.for("react.suspense_list"),Ip=Symbol.for("react.memo"),Gs=Symbol.for("react.lazy"),r0=Symbol.for("react.offscreen"),Gv=Symbol.iterator;function Jo(e){return e===null||typeof e!="object"?null:(e=Gv&&e[Gv]||e["@@iterator"],typeof e=="function"?e:null)}var Jt=Object.assign,zh;function ul(e){if(zh===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);zh=t&&t[1]||""}return` 34`+zh+e}var Bh=!1;function Vh(e,t){if(!e||Bh)return"";Bh=!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(d){var r=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){r=d}e.call(t.prototype)}else{try{throw Error()}catch(d){r=d}e()}}catch(d){if(d&&r&&typeof d.stack=="string"){for(var a=d.stack.split(` 35`),i=r.stack.split(` 36`),o=a.length-1,l=i.length-1;1<=o&&0<=l&&a[o]!==i[l];)l--;for(;1<=o&&0<=l;o--,l--)if(a[o]!==i[l]){if(o!==1||l!==1)do if(o--,l--,0>l||a[o]!==i[l]){var c=` 37`+a[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{Bh=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ul(e):""}function SC(e){switch(e.tag){case 5:return ul(e.type);case 16:return ul("Lazy");case 13:return ul("Suspense");case 19:return ul("SuspenseList");case 0:case 2:case 15:return e=Vh(e.type,!1),e;case 11:return e=Vh(e.type.render,!1),e;case 1:return e=Vh(e.type,!0),e;default:return""}}function Gf(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 Ui:return"Fragment";case Fi:return"Portal";case Hf:return"Profiler";case Ap:return"StrictMode";case qf:return"Suspense";case Yf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case n0:return(e.displayName||"Context")+".Consumer";case t0:return(e._context.displayName||"Context")+".Provider";case Mp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ip:return t=e.displayName||null,t!==null?t:Gf(e.type)||"Memo";case Gs:t=e._payload,e=e._init;try{return Gf(e(t))}catch{}}return null}function kC(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 Gf(t);case 8:return t===Ap?"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 wa(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function s0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function CC(e){var t=s0(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 a=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Xc(e){e._valueTracker||(e._valueTracker=CC(e))}function a0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=s0(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function qd(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 Kf(e,t){var n=t.checked;return Jt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Kv(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=wa(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 i0(e,t){t=t.checked,t!=null&&Op(e,"checked",t,!1)}function Zf(e,t){i0(e,t);var n=wa(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")?Qf(e,t.type,n):t.hasOwnProperty("defaultValue")&&Qf(e,t.type,wa(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Zv(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 Qf(e,t,n){(t!=="number"||qd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var hl=Array.isArray;function Ji(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+wa(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,r&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function Jf(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(xe(91));return Jt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Qv(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(xe(92));if(hl(n)){if(1<n.length)throw Error(xe(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:wa(n)}}function o0(e,t){var n=wa(t.value),r=wa(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 Jv(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function l0(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 Xf(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?l0(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ed,c0=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,a){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ed=ed||document.createElement("div"),ed.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ed.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Il(e,t){if(t){var n=e.firstChild;
vendor: 7,959 bytes, line 37
37if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var bl={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},EC=["Webkit","ms","Moz","O"];Object.keys(bl).forEach(function(e){EC.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),bl[t]=bl[e]})});function d0(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||bl.hasOwnProperty(e)&&bl[e]?(""+t).trim():t+"px"}function u0(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,a=d0(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}var PC=Jt({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 em(e,t){if(t){if(PC[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(xe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(xe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(xe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(xe(62))}}function tm(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 nm=null;function Lp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var rm=null,Xi=null,eo=null;function Xv(e){if(e=Tc(e)){if(typeof rm!="function")throw Error(xe(280));var t=e.stateNode;t&&(t=qu(t),rm(e.stateNode,e.type,t))}}function h0(e){Xi?eo?eo.push(e):eo=[e]:Xi=e}function f0(){if(Xi){var e=Xi,t=eo;if(eo=Xi=null,Xv(e),t)for(e=0;e<t.length;e++)Xv(t[e])}}function m0(e,t){return e(t)}function p0(){}var Wh=!1;function g0(e,t,n){if(Wh)return e(t,n);Wh=!0;try{return m0(e,t,n)}finally{Wh=!1,(Xi!==null||eo!==null)&&(p0(),f0())}}function Ll(e,t){var n=e.stateNode;if(n===null)return null;var r=qu(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(xe(231,t,typeof n));return n}var sm=!1;if(Ps)try{var Xo={};Object.defineProperty(Xo,"passive",{get:function(){sm=!0}}),window.addEventListener("test",Xo,Xo),window.removeEventListener("test",Xo,Xo)}catch{sm=!1}function TC(e,t,n,r,a,i,o,l,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(u){this.onError(u)}}var jl=!1,Yd=null,Gd=!1,am=null,RC={onError:function(e){jl=!0,Yd=e}};function DC(e,t,n,r,a,i,o,l,c){jl=!1,Yd=null,TC.apply(RC,arguments)}function OC(e,t,n,r,a,i,o,l,c){if(DC.apply(this,arguments),jl){if(jl){var d=Yd;jl=!1,Yd=null}else throw Error(xe(198));Gd||(Gd=!0,am=d)}}function bi(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 v0(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 ex(e){if(bi(e)!==e)throw Error(xe(188))}function AC(e){var t=e.alternate;if(!t){if(t=bi(e),t===null)throw Error(xe(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var i=a.alternate;if(i===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===n)return ex(a),e;if(i===r)return ex(a),t;i=i.sibling}throw Error(xe(188))}if(n.return!==r.return)n=a,r=i;else{for(var o=!1,l=a.child;l;){if(l===n){o=!0,n=a,r=i;break}if(l===r){o=!0,r=a,n=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===n){o=!0,n=i,r=a;break}if(l===r){o=!0,r=i,n=a;break}l=l.sibling}if(!o)throw Error(xe(189))}}if(n.alternate!==r)throw Error(xe(190))}if(n.tag!==3)throw Error(xe(188));return n.stateNode.current===n?e:t}function x0(e){return e=AC(e),e!==null?y0(e):null}function y0(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=y0(e);if(t!==null)return t;e=e.sibling}return null}var w0=lr.unstable_scheduleCallback,tx=lr.unstable_cancelCallback,MC=lr.unstable_shouldYield,IC=lr.unstable_requestPaint,rn=lr.unstable_now,LC=lr.unstable_getCurrentPriorityLevel,$p=lr.unstable_ImmediatePriority,b0=lr.unstable_UserBlockingPriority,Kd=lr.unstable_NormalPriority,$C=lr.unstable_LowPriority,j0=lr.unstable_IdlePriority,Bu=null,as=null;function FC(e){if(as&&typeof as.onCommitFiberRoot=="function")try{as.onCommitFiberRoot(Bu,e,void 0,(e.current.flags&128)===128)}catch{}}var Or=Math.clz32?Math.clz32:BC,UC=Math.log,zC=Math.LN2;function BC(e){return e>>>=0,e===0?32:31-(UC(e)/zC|0)|0}var td=64,nd=4194304;function fl(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 Zd(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,a=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~a;l!==0?r=fl(l):(i&=o,i!==0&&(r=fl(i)))}else o=n&~a,o!==0?r=fl(o):i!==0&&(r=fl(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&a)&&(a=r&-r,i=t&-t,a>=i||a===16&&(i&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-Or(t),a=1<<n,r|=e[n],t&=~a;return r}function VC(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 WC(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-Or(i),l=1<<o,c=a[o];c===-1?(!(l&n)||l&r)&&(a[o]=VC(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function im(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function _0(){var e=td;return td<<=1,!(td&4194240)&&(td=64),e}function Hh(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ec(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Or(t),e[t]=n}function HC(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 a=31-Or(n),i=1<<a;t[a]=0,r[a]=-1,e[a]=-1,n&=~i}}function Fp(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Or(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}var Ct=0;function N0(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}
vendor: 13,580 bytes, line 37
37var S0,Up,k0,C0,E0,om=!1,rd=[],da=null,ua=null,ha=null,$l=new Map,Fl=new Map,Zs=[],qC="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 nx(e,t){switch(e){case"focusin":case"focusout":da=null;break;case"dragenter":case"dragleave":ua=null;break;case"mouseover":case"mouseout":ha=null;break;case"pointerover":case"pointerout":$l.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fl.delete(t.pointerId)}}function el(e,t,n,r,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[a]},t!==null&&(t=Tc(t),t!==null&&Up(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function YC(e,t,n,r,a){switch(t){case"focusin":return da=el(da,e,t,n,r,a),!0;case"dragenter":return ua=el(ua,e,t,n,r,a),!0;case"mouseover":return ha=el(ha,e,t,n,r,a),!0;case"pointerover":var i=a.pointerId;return $l.set(i,el($l.get(i)||null,e,t,n,r,a)),!0;case"gotpointercapture":return i=a.pointerId,Fl.set(i,el(Fl.get(i)||null,e,t,n,r,a)),!0}return!1}function P0(e){var t=Ga(e.target);if(t!==null){var n=bi(t);if(n!==null){if(t=n.tag,t===13){if(t=v0(n),t!==null){e.blockedOn=t,E0(e.priority,function(){k0(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 Pd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=lm(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);nm=r,n.target.dispatchEvent(r),nm=null}else return t=Tc(n),t!==null&&Up(t),e.blockedOn=n,!1;t.shift()}return!0}function rx(e,t,n){Pd(e)&&n.delete(t)}function GC(){om=!1,da!==null&&Pd(da)&&(da=null),ua!==null&&Pd(ua)&&(ua=null),ha!==null&&Pd(ha)&&(ha=null),$l.forEach(rx),Fl.forEach(rx)}function tl(e,t){e.blockedOn===t&&(e.blockedOn=null,om||(om=!0,lr.unstable_scheduleCallback(lr.unstable_NormalPriority,GC)))}function Ul(e){function t(a){return tl(a,e)}if(0<rd.length){tl(rd[0],e);for(var n=1;n<rd.length;n++){var r=rd[n];r.blockedOn===e&&(r.blockedOn=null)}}for(da!==null&&tl(da,e),ua!==null&&tl(ua,e),ha!==null&&tl(ha,e),$l.forEach(t),Fl.forEach(t),n=0;n<Zs.length;n++)r=Zs[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Zs.length&&(n=Zs[0],n.blockedOn===null);)P0(n),n.blockedOn===null&&Zs.shift()}var to=Ls.ReactCurrentBatchConfig,Qd=!0;function KC(e,t,n,r){var a=Ct,i=to.transition;to.transition=null;try{Ct=1,zp(e,t,n,r)}finally{Ct=a,to.transition=i}}function ZC(e,t,n,r){var a=Ct,i=to.transition;to.transition=null;try{Ct=4,zp(e,t,n,r)}finally{Ct=a,to.transition=i}}function zp(e,t,n,r){if(Qd){var a=lm(e,t,n,r);if(a===null)tf(e,t,r,Jd,n),nx(e,r);else if(YC(a,e,t,n,r))r.stopPropagation();else if(nx(e,r),t&4&&-1<qC.indexOf(e)){for(;a!==null;){var i=Tc(a);if(i!==null&&S0(i),i=lm(e,t,n,r),i===null&&tf(e,t,r,Jd,n),i===a)break;a=i}a!==null&&r.stopPropagation()}else tf(e,t,r,null,n)}}var Jd=null;function lm(e,t,n,r){if(Jd=null,e=Lp(r),e=Ga(e),e!==null)if(t=bi(e),t===null)e=null;else if(n=t.tag,n===13){if(e=v0(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 Jd=e,null}function T0(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(LC()){case $p:return 1;case b0:return 4;case Kd:case $C:return 16;case j0:return 536870912;default:return 16}default:return 16}}var aa=null,Bp=null,Td=null;function R0(){if(Td)return Td;var e,t=Bp,n=t.length,r,a="value"in aa?aa.value:aa.textContent,i=a.length;for(e=0;e<n&&t[e]===a[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===a[i-r];r++);return Td=a.slice(e,1<r?1-r:void 0)}function Rd(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 sd(){return!0}function sx(){return!1}function ur(e){function t(n,r,a,i,o){this._reactName=n,this._targetInst=a,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?sd:sx,this.isPropagationStopped=sx,this}return Jt(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=sd)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=sd)},persist:function(){},isPersistent:sd}),t}var Fo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vp=ur(Fo),Pc=Jt({},Fo,{view:0,detail:0}),QC=ur(Pc),qh,Yh,nl,Vu=Jt({},Pc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wp,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!==nl&&(nl&&e.type==="mousemove"?(qh=e.screenX-nl.screenX,Yh=e.screenY-nl.screenY):Yh=qh=0,nl=e),qh)},movementY:function(e){return"movementY"in e?e.movementY:Yh}}),ax=ur(Vu),JC=Jt({},Vu,{dataTransfer:0}),XC=ur(JC),eE=Jt({},Pc,{relatedTarget:0}),Gh=ur(eE),tE=Jt({},Fo,{animationName:0,elapsedTime:0,pseudoElement:0}),nE=ur(tE),rE=Jt({},Fo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),sE=ur(rE),aE=Jt({},Fo,{data:0}),ix=ur(aE),iE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},oE={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"},lE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function cE(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=lE[e])?!!t[e]:!1}function Wp(){return cE}var dE=Jt({},Pc,{key:function(e){if(e.key){var t=iE[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Rd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?oE[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wp,charCode:function(e){return e.type==="keypress"?Rd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Rd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),uE=ur(dE),hE=Jt({},Vu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ox=ur(hE),fE=Jt({},Pc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wp}),mE=ur(fE),pE=Jt({},Fo,{propertyName:0,elapsedTime:0,pseudoElement:0}),gE=ur(pE),vE=Jt({},Vu,{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}),xE=ur(vE),yE=[9,13,27,32],Hp=Ps&&"CompositionEvent"in window,_l=null;Ps&&"documentMode"in document&&(_l=document.documentMode);var wE=Ps&&"TextEvent"in window&&!_l,D0=Ps&&(!Hp||_l&&8<_l&&11>=_l),lx=" ",cx=!1;function O0(e,t){switch(e){case"keyup":return yE.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function A0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zi=!1;function bE(e,t){switch(e){case"compositionend":return A0(t);case"keypress":return t.which!==32?null:(cx=!0,lx);case"textInput":return e=t.data,e===lx&&cx?null:e;default:return null}}function jE(e,t){if(zi)return e==="compositionend"||!Hp&&O0(e,t)?(e=R0(),Td=Bp=aa=null,zi=!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 D0&&t.locale!=="ko"?null:t.data;default:return null}}var _E={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 dx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!_E[e.type]:t==="textarea"}function M0(e,t,n,r){h0(r),t=Xd(t,"onChange"),0<t.length&&(n=new Vp("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Nl=null,zl=null;function NE(e){q0(e,0)}function Wu(e){var t=Wi(e);if(a0(t))return e}function SE(e,t){if(e==="change")return t}var I0=!1;if(Ps){var Kh;if(Ps){var Zh="oninput"in document;if(!Zh){var ux=document.createElement("div");ux.setAttribute("oninput","return;"),Zh=typeof ux.oninput=="function"}Kh=Zh}else Kh=!1;I0=Kh&&(!document.documentMode||9<document.documentMode)}function hx(){Nl&&(Nl.detachEvent("onpropertychange",L0),zl=Nl=null)}function L0(e){if(e.propertyName==="value"&&Wu(zl)){var t=[];M0(t,zl,e,Lp(e)),g0(NE,t)}}function kE(e,t,n){e==="focusin"?(hx(),Nl=t,zl=n,Nl.attachEvent("onpropertychange",L0)):e==="focusout"&&hx()}function CE(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Wu(zl)}function EE(e,t){if(e==="click")return Wu(t)}function PE(e,t){if(e==="input"||e==="change")return Wu(t)}function TE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Fr=typeof Object.is=="function"?Object.is:TE;function Bl(e,t){if(Fr(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 a=n[r];if(!Wf.call(t,a)||!Fr(e[a],t[a]))return!1}return!0}function fx(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function mx(e,t){var n=fx(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=fx(n)}}function $0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?$0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function F0(){for(var e=window,t=qd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=qd(e.document)}return t}function qp(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 RE(e){var t=F0(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&$0(n.ownerDocument.documentElement,n)){if(r!==null&&qp(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 a=n.textContent.length,i=Math.min(r.start,a);r=r.end===void 0?i:Math.min(r.end,a),!e.extend&&i>r&&(a=r,r=i,i=a),a=mx(n,i);var o=mx(n,r);a&&o&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.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 DE=Ps&&"documentMode"in document&&11>=document.documentMode,Bi=null,cm=null,Sl=null,dm=!1;
vendor: 4,120 bytes, line 37
37function px(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;dm||Bi==null||Bi!==qd(r)||(r=Bi,"selectionStart"in r&&qp(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Sl&&Bl(Sl,r)||(Sl=r,r=Xd(cm,"onSelect"),0<r.length&&(t=new Vp("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Bi)))}function ad(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Vi={animationend:ad("Animation","AnimationEnd"),animationiteration:ad("Animation","AnimationIteration"),animationstart:ad("Animation","AnimationStart"),transitionend:ad("Transition","TransitionEnd")},Qh={},U0={};Ps&&(U0=document.createElement("div").style,"AnimationEvent"in window||(delete Vi.animationend.animation,delete Vi.animationiteration.animation,delete Vi.animationstart.animation),"TransitionEvent"in window||delete Vi.transitionend.transition);function Hu(e){if(Qh[e])return Qh[e];if(!Vi[e])return e;var t=Vi[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in U0)return Qh[e]=t[n];return e}var z0=Hu("animationend"),B0=Hu("animationiteration"),V0=Hu("animationstart"),W0=Hu("transitionend"),H0=new Map,gx="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 Ra(e,t){H0.set(e,t),wi(t,[e])}for(var Jh=0;Jh<gx.length;Jh++){var Xh=gx[Jh],OE=Xh.toLowerCase(),AE=Xh[0].toUpperCase()+Xh.slice(1);Ra(OE,"on"+AE)}Ra(z0,"onAnimationEnd");Ra(B0,"onAnimationIteration");Ra(V0,"onAnimationStart");Ra("dblclick","onDoubleClick");Ra("focusin","onFocus");Ra("focusout","onBlur");Ra(W0,"onTransitionEnd");wo("onMouseEnter",["mouseout","mouseover"]);wo("onMouseLeave",["mouseout","mouseover"]);wo("onPointerEnter",["pointerout","pointerover"]);wo("onPointerLeave",["pointerout","pointerover"]);wi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));wi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));wi("onBeforeInput",["compositionend","keypress","textInput","paste"]);wi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));wi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));wi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ml="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(" "),ME=new Set("cancel close invalid load scroll toggle".split(" ").concat(ml));function vx(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,OC(r,t,void 0,e),e.currentTarget=null}function q0(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var l=r[o],c=l.instance,d=l.currentTarget;if(l=l.listener,c!==i&&a.isPropagationStopped())break e;vx(a,l,d),i=c}else for(o=0;o<r.length;o++){if(l=r[o],c=l.instance,d=l.currentTarget,l=l.listener,c!==i&&a.isPropagationStopped())break e;vx(a,l,d),i=c}}}if(Gd)throw e=am,Gd=!1,am=null,e}function $t(e,t){var n=t[pm];n===void 0&&(n=t[pm]=new Set);var r=e+"__bubble";n.has(r)||(Y0(t,e,2,!1),n.add(r))}function ef(e,t,n){var r=0;t&&(r|=4),Y0(n,e,r,t)}var id="_reactListening"+Math.random().toString(36).slice(2);
vendor: 4,224 bytes, line 37
37function Vl(e){if(!e[id]){e[id]=!0,e0.forEach(function(n){n!=="selectionchange"&&(ME.has(n)||ef(n,!1,e),ef(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[id]||(t[id]=!0,ef("selectionchange",!1,t))}}function Y0(e,t,n,r){switch(T0(t)){case 1:var a=KC;break;case 4:a=ZC;break;default:a=zp}n=a.bind(null,t,n,e),a=void 0,!sm||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),r?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function tf(e,t,n,r,a){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;if(l===a||l.nodeType===8&&l.parentNode===a)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===a||c.nodeType===8&&c.parentNode===a))return;o=o.return}for(;l!==null;){if(o=Ga(l),o===null)return;if(c=o.tag,c===5||c===6){r=i=o;continue e}l=l.parentNode}}r=r.return}g0(function(){var d=i,u=Lp(n),f=[];e:{var m=H0.get(e);if(m!==void 0){var w=Vp,x=e;switch(e){case"keypress":if(Rd(n)===0)break e;case"keydown":case"keyup":w=uE;break;case"focusin":x="focus",w=Gh;break;case"focusout":x="blur",w=Gh;break;case"beforeblur":case"afterblur":w=Gh;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":w=ax;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":w=XC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":w=mE;break;case z0:case B0:case V0:w=nE;break;case W0:w=gE;break;case"scroll":w=QC;break;case"wheel":w=xE;break;case"copy":case"cut":case"paste":w=sE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":w=ox}var p=(t&4)!==0,b=!p&&e==="scroll",v=p?m!==null?m+"Capture":null:m;p=[];for(var g=d,y;g!==null;){y=g;var j=y.stateNode;if(y.tag===5&&j!==null&&(y=j,v!==null&&(j=Ll(g,v),j!=null&&p.push(Wl(g,j,y)))),b)break;g=g.return}0<p.length&&(m=new w(m,x,null,n,u),f.push({event:m,listeners:p}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",w=e==="mouseout"||e==="pointerout",m&&n!==nm&&(x=n.relatedTarget||n.fromElement)&&(Ga(x)||x[Ts]))break e;if((w||m)&&(m=u.window===u?u:(m=u.ownerDocument)?m.defaultView||m.parentWindow:window,w?(x=n.relatedTarget||n.toElement,w=d,x=x?Ga(x):null,x!==null&&(b=bi(x),x!==b||x.tag!==5&&x.tag!==6)&&(x=null)):(w=null,x=d),w!==x)){if(p=ax,j="onMouseLeave",v="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(p=ox,j="onPointerLeave",v="onPointerEnter",g="pointer"),b=w==null?m:Wi(w),y=x==null?m:Wi(x),m=new p(j,g+"leave",w,n,u),m.target=b,m.relatedTarget=y,j=null,Ga(u)===d&&(p=new p(v,g+"enter",x,n,u),p.target=y,p.relatedTarget=b,j=p),b=j,w&&x)t:{for(p=w,v=x,g=0,y=p;y;y=ki(y))g++;for(y=0,j=v;j;j=ki(j))y++;for(;0<g-y;)p=ki(p),g--;for(;0<y-g;)v=ki(v),y--;for(;g--;){if(p===v||v!==null&&p===v.alternate)break t;p=ki(p),v=ki(v)}p=null}else p=null;w!==null&&xx(f,m,w,p,!1),x!==null&&b!==null&&xx(f,b,x,p,!0)}}e:{if(m=d?Wi(d):window,w=m.nodeName&&m.nodeName.toLowerCase(),w==="select"||w==="input"&&m.type==="file")var N=SE;else if(dx(m))if(I0)N=PE;else{N=CE;var k=kE}else(w=m.nodeName)&&w.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(N=EE);if(N&&(N=N(e,d))){M0(f,N,n,u);break e}k&&k(e,m,d),e==="focusout"&&(k=m._wrapperState)&&k.controlled&&m.type==="number"&&Qf(m,"number",m.value)}switch(k=d?Wi(d):window,e){case"focusin":(dx(k)||k.contentEditable==="true")&&(Bi=k,cm=d,Sl=null);break;case"focusout":Sl=cm=Bi=null;break;case"mousedown":dm=!0;break;case"contextmenu":case"mouseup":case"dragend":dm=!1,px(f,n,u);break;case"selectionchange":if(DE)break;case"keydown":case"keyup":px(f,n,u)}var C;if(Hp)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else zi?O0(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");
vendor: 5,381 bytes, lines 37-38
37E&&(D0&&n.locale!=="ko"&&(zi||E!=="onCompositionStart"?E==="onCompositionEnd"&&zi&&(C=R0()):(aa=u,Bp="value"in aa?aa.value:aa.textContent,zi=!0)),k=Xd(d,E),0<k.length&&(E=new ix(E,e,null,n,u),f.push({event:E,listeners:k}),C?E.data=C:(C=A0(n),C!==null&&(E.data=C)))),(C=wE?bE(e,n):jE(e,n))&&(d=Xd(d,"onBeforeInput"),0<d.length&&(u=new ix("onBeforeInput","beforeinput",null,n,u),f.push({event:u,listeners:d}),u.data=C))}q0(f,t)})}function Wl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Xd(e,t){for(var n=t+"Capture",r=[];e!==null;){var a=e,i=a.stateNode;a.tag===5&&i!==null&&(a=i,i=Ll(e,n),i!=null&&r.unshift(Wl(e,i,a)),i=Ll(e,t),i!=null&&r.push(Wl(e,i,a))),e=e.return}return r}function ki(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function xx(e,t,n,r,a){for(var i=t._reactName,o=[];n!==null&&n!==r;){var l=n,c=l.alternate,d=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&d!==null&&(l=d,a?(c=Ll(n,i),c!=null&&o.unshift(Wl(n,c,l))):a||(c=Ll(n,i),c!=null&&o.push(Wl(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var IE=/\r\n?/g,LE=/\u0000|\uFFFD/g;function yx(e){return(typeof e=="string"?e:""+e).replace(IE,` 38`).replace(LE,"")}function od(e,t,n){if(t=yx(t),yx(e)!==t&&n)throw Error(xe(425))}function eu(){}var um=null,hm=null;function fm(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 mm=typeof setTimeout=="function"?setTimeout:void 0,$E=typeof clearTimeout=="function"?clearTimeout:void 0,wx=typeof Promise=="function"?Promise:void 0,FE=typeof queueMicrotask=="function"?queueMicrotask:typeof wx<"u"?function(e){return wx.resolve(null).then(e).catch(UE)}:mm;function UE(e){setTimeout(function(){throw e})}function nf(e,t){var n=t,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(r===0){e.removeChild(a),Ul(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=a}while(n);Ul(t)}function fa(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 bx(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 Uo=Math.random().toString(36).slice(2),ts="__reactFiber$"+Uo,Hl="__reactProps$"+Uo,Ts="__reactContainer$"+Uo,pm="__reactEvents$"+Uo,zE="__reactListeners$"+Uo,BE="__reactHandles$"+Uo;function Ga(e){var t=e[ts];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ts]||n[ts]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=bx(e);e!==null;){if(n=e[ts])return n;e=bx(e)}return t}e=n,n=e.parentNode}return null}function Tc(e){return e=e[ts]||e[Ts],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Wi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(xe(33))}function qu(e){return e[Hl]||null}var gm=[],Hi=-1;function Da(e){return{current:e}}function Bt(e){0>Hi||(e.current=gm[Hi],gm[Hi]=null,Hi--)}function Dt(e,t){Hi++,gm[Hi]=e.current,e.current=t}var ba={},Sn=Da(ba),Wn=Da(!1),si=ba;function bo(e,t){var n=e.type.contextTypes;if(!n)return ba;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in n)a[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function Hn(e){return e=e.childContextTypes,e!=null}function tu(){Bt(Wn),Bt(Sn)}function jx(e,t,n){if(Sn.current!==ba)throw Error(xe(168));Dt(Sn,t),Dt(Wn,n)}function G0(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var a in r)if(!(a in t))throw Error(xe(108,kC(e)||"Unknown",a));return Jt({},n,r)}function nu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ba,si=Sn.current,Dt(Sn,e),Dt(Wn,Wn.current),!0}function _x(e,t,n){var r=e.stateNode;if(!r)throw Error(xe(169));n?(e=G0(e,t,si),r.__reactInternalMemoizedMergedChildContext=e,Bt(Wn),Bt(Sn),Dt(Sn,e)):Bt(Wn),Dt(Wn,n)}var _s=null,Yu=!1,rf=!1;function K0(e){_s===null?_s=[e]:_s.push(e)}function VE(e){Yu=!0,K0(e)}function Oa(){if(!rf&&_s!==null){rf=!0;var e=0,t=Ct;try{var n=_s;for(Ct=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}_s=null,Yu=!1}catch(a){throw _s!==null&&(_s=_s.slice(e+1)),w0($p,Oa),a}finally{Ct=t,rf=!1}}return null}var qi=[],Yi=0,ru=null,su=0,fr=[],mr=0,ai=null,Ns=1,Ss="";function Ba(e,t){qi[Yi++]=su,qi[Yi++]=ru,ru=e,su=t}function Z0(e,t,n){fr[mr++]=Ns,fr[mr++]=Ss,fr[mr++]=ai,ai=e;var r=Ns;e=Ss;var a=32-Or(r)-1;r&=~(1<<a),n+=1;var i=32-Or(t)+a;if(30<i){var o=a-a%5;i=(r&(1<<o)-1).toString(32),r>>=o,a-=o,Ns=1<<32-Or(t)+a|n<<a|r,Ss=i+e}else Ns=1<<i|n<<a|r,Ss=e}function Yp(e){e.return!==null&&(Ba(e,1),Z0(e,1,0))}function Gp(e){for(;e===ru;)ru=qi[--Yi],qi[Yi]=null,su=qi[--Yi],qi[Yi]=null;for(;e===ai;)ai=fr[--mr],fr[mr]=null,Ss=fr[--mr],fr[mr]=null,Ns=fr[--mr],fr[mr]=null}var ar=null,sr=null,qt=!1,Tr=null;function Q0(e,t){var n=pr(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 Nx(e,t){switch(e.tag){case 5:var n=e.type;
vendor: 14,903 bytes, line 38
38return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ar=e,sr=fa(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ar=e,sr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ai!==null?{id:Ns,overflow:Ss}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=pr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ar=e,sr=null,!0):!1;default:return!1}}function vm(e){return(e.mode&1)!==0&&(e.flags&128)===0}function xm(e){if(qt){var t=sr;if(t){var n=t;if(!Nx(e,t)){if(vm(e))throw Error(xe(418));t=fa(n.nextSibling);var r=ar;t&&Nx(e,t)?Q0(r,n):(e.flags=e.flags&-4097|2,qt=!1,ar=e)}}else{if(vm(e))throw Error(xe(418));e.flags=e.flags&-4097|2,qt=!1,ar=e}}}function Sx(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ar=e}function ld(e){if(e!==ar)return!1;if(!qt)return Sx(e),qt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!fm(e.type,e.memoizedProps)),t&&(t=sr)){if(vm(e))throw J0(),Error(xe(418));for(;t;)Q0(e,t),t=fa(t.nextSibling)}if(Sx(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(xe(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){sr=fa(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}sr=null}}else sr=ar?fa(e.stateNode.nextSibling):null;return!0}function J0(){for(var e=sr;e;)e=fa(e.nextSibling)}function jo(){sr=ar=null,qt=!1}function Kp(e){Tr===null?Tr=[e]:Tr.push(e)}var WE=Ls.ReactCurrentBatchConfig;function rl(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(xe(309));var r=n.stateNode}if(!r)throw Error(xe(147,e));var a=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var l=a.refs;o===null?delete l[i]:l[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(xe(284));if(!n._owner)throw Error(xe(290,e))}return e}function cd(e,t){throw e=Object.prototype.toString.call(t),Error(xe(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function kx(e){var t=e._init;return t(e._payload)}function X0(e){function t(v,g){if(e){var y=v.deletions;y===null?(v.deletions=[g],v.flags|=16):y.push(g)}}function n(v,g){if(!e)return null;for(;g!==null;)t(v,g),g=g.sibling;return null}function r(v,g){for(v=new Map;g!==null;)g.key!==null?v.set(g.key,g):v.set(g.index,g),g=g.sibling;return v}function a(v,g){return v=va(v,g),v.index=0,v.sibling=null,v}function i(v,g,y){return v.index=y,e?(y=v.alternate,y!==null?(y=y.index,y<g?(v.flags|=2,g):y):(v.flags|=2,g)):(v.flags|=1048576,g)}function o(v){return e&&v.alternate===null&&(v.flags|=2),v}function l(v,g,y,j){return g===null||g.tag!==6?(g=uf(y,v.mode,j),g.return=v,g):(g=a(g,y),g.return=v,g)}function c(v,g,y,j){var N=y.type;return N===Ui?u(v,g,y.props.children,j,y.key):g!==null&&(g.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Gs&&kx(N)===g.type)?(j=a(g,y.props),j.ref=rl(v,g,y),j.return=v,j):(j=$d(y.type,y.key,y.props,null,v.mode,j),j.ref=rl(v,g,y),j.return=v,j)}function d(v,g,y,j){return g===null||g.tag!==4||g.stateNode.containerInfo!==y.containerInfo||g.stateNode.implementation!==y.implementation?(g=hf(y,v.mode,j),g.return=v,g):(g=a(g,y.children||[]),g.return=v,g)}function u(v,g,y,j,N){return g===null||g.tag!==7?(g=ni(y,v.mode,j,N),g.return=v,g):(g=a(g,y),g.return=v,g)}function f(v,g,y){if(typeof g=="string"&&g!==""||typeof g=="number")return g=uf(""+g,v.mode,y),g.return=v,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Jc:return y=$d(g.type,g.key,g.props,null,v.mode,y),y.ref=rl(v,null,g),y.return=v,y;case Fi:return g=hf(g,v.mode,y),g.return=v,g;case Gs:var j=g._init;return f(v,j(g._payload),y)}if(hl(g)||Jo(g))return g=ni(g,v.mode,y,null),g.return=v,g;cd(v,g)}return null}function m(v,g,y,j){var N=g!==null?g.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return N!==null?null:l(v,g,""+y,j);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Jc:return y.key===N?c(v,g,y,j):null;case Fi:return y.key===N?d(v,g,y,j):null;case Gs:return N=y._init,m(v,g,N(y._payload),j)}if(hl(y)||Jo(y))return N!==null?null:u(v,g,y,j,null);cd(v,y)}return null}function w(v,g,y,j,N){if(typeof j=="string"&&j!==""||typeof j=="number")return v=v.get(y)||null,l(g,v,""+j,N);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case Jc:return v=v.get(j.key===null?y:j.key)||null,c(g,v,j,N);case Fi:return v=v.get(j.key===null?y:j.key)||null,d(g,v,j,N);case Gs:var k=j._init;return w(v,g,y,k(j._payload),N)}if(hl(j)||Jo(j))return v=v.get(y)||null,u(g,v,j,N,null);cd(g,j)}return null}function x(v,g,y,j){for(var N=null,k=null,C=g,E=g=0,H=null;C!==null&&E<y.length;E++){C.index>E?(H=C,C=null):H=C.sibling;var A=m(v,C,y[E],j);if(A===null){C===null&&(C=H);break}e&&C&&A.alternate===null&&t(v,C),g=i(A,g,E),k===null?N=A:k.sibling=A,k=A,C=H}if(E===y.length)return n(v,C),qt&&Ba(v,E),N;if(C===null){for(;E<y.length;E++)C=f(v,y[E],j),C!==null&&(g=i(C,g,E),k===null?N=C:k.sibling=C,k=C);return qt&&Ba(v,E),N}for(C=r(v,C);E<y.length;E++)H=w(C,v,E,y[E],j),H!==null&&(e&&H.alternate!==null&&C.delete(H.key===null?E:H.key),g=i(H,g,E),k===null?N=H:k.sibling=H,k=H);return e&&C.forEach(function(F){return t(v,F)}),qt&&Ba(v,E),N}function p(v,g,y,j){var N=Jo(y);if(typeof N!="function")throw Error(xe(150));if(y=N.call(y),y==null)throw Error(xe(151));for(var k=N=null,C=g,E=g=0,H=null,A=y.next();C!==null&&!A.done;E++,A=y.next()){C.index>E?(H=C,C=null):H=C.sibling;var F=m(v,C,A.value,j);if(F===null){C===null&&(C=H);break}e&&C&&F.alternate===null&&t(v,C),g=i(F,g,E),k===null?N=F:k.sibling=F,k=F,C=H}if(A.done)return n(v,C),qt&&Ba(v,E),N;if(C===null){for(;!A.done;E++,A=y.next())A=f(v,A.value,j),A!==null&&(g=i(A,g,E),k===null?N=A:k.sibling=A,k=A);return qt&&Ba(v,E),N}for(C=r(v,C);!A.done;E++,A=y.next())A=w(C,v,E,A.value,j),A!==null&&(e&&A.alternate!==null&&C.delete(A.key===null?E:A.key),g=i(A,g,E),k===null?N=A:k.sibling=A,k=A);return e&&C.forEach(function(U){return t(v,U)}),qt&&Ba(v,E),N}function b(v,g,y,j){if(typeof y=="object"&&y!==null&&y.type===Ui&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Jc:e:{for(var N=y.key,k=g;k!==null;){if(k.key===N){if(N=y.type,N===Ui){if(k.tag===7){n(v,k.sibling),g=a(k,y.props.children),g.return=v,v=g;break e}}else if(k.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Gs&&kx(N)===k.type){n(v,k.sibling),g=a(k,y.props),g.ref=rl(v,k,y),g.return=v,v=g;break e}n(v,k);break}else t(v,k);k=k.sibling}y.type===Ui?(g=ni(y.props.children,v.mode,j,y.key),g.return=v,v=g):(j=$d(y.type,y.key,y.props,null,v.mode,j),j.ref=rl(v,g,y),j.return=v,v=j)}return o(v);case Fi:e:{for(k=y.key;g!==null;){if(g.key===k)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){n(v,g.sibling),g=a(g,y.children||[]),g.return=v,v=g;break e}else{n(v,g);break}else t(v,g);g=g.sibling}g=hf(y,v.mode,j),g.return=v,v=g}return o(v);case Gs:return k=y._init,b(v,g,k(y._payload),j)}if(hl(y))return x(v,g,y,j);if(Jo(y))return p(v,g,y,j);cd(v,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,g!==null&&g.tag===6?(n(v,g.sibling),g=a(g,y),g.return=v,v=g):(n(v,g),g=uf(y,v.mode,j),g.return=v,v=g),o(v)):n(v,g)}return b}var _o=X0(!0),eb=X0(!1),au=Da(null),iu=null,Gi=null,Zp=null;function Qp(){Zp=Gi=iu=null}function Jp(e){var t=au.current;Bt(au),e._currentValue=t}function ym(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 no(e,t){iu=e,Zp=Gi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Un=!0),e.firstContext=null)}function wr(e){var t=e._currentValue;if(Zp!==e)if(e={context:e,memoizedValue:t,next:null},Gi===null){if(iu===null)throw Error(xe(308));Gi=e,iu.dependencies={lanes:0,firstContext:e}}else Gi=Gi.next=e;return t}var Ka=null;function Xp(e){Ka===null?Ka=[e]:Ka.push(e)}function tb(e,t,n,r){var a=t.interleaved;return a===null?(n.next=n,Xp(t)):(n.next=a.next,a.next=n),t.interleaved=n,Rs(e,r)}function Rs(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 Ks=!1;function eg(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function nb(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 ks(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ma(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,bt&2){var a=r.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),r.pending=t,Rs(e,n)}return a=r.interleaved,a===null?(t.next=t,Xp(r)):(t.next=a.next,a.next=t),r.interleaved=t,Rs(e,n)}function Dd(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,Fp(e,n)}}function Cx(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var a=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?a=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?a=i=t:i=i.next=t}else a=i=t;n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:i,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 ou(e,t,n,r){var a=e.updateQueue;Ks=!1;var i=a.firstBaseUpdate,o=a.lastBaseUpdate,l=a.shared.pending;if(l!==null){a.shared.pending=null;var c=l,d=c.next;c.next=null,o===null?i=d:o.next=d,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==o&&(l===null?u.firstBaseUpdate=d:l.next=d,u.lastBaseUpdate=c))}if(i!==null){var f=a.baseState;o=0,u=d=c=null,l=i;do{var m=l.lane,w=l.eventTime;if((r&m)===m){u!==null&&(u=u.next={eventTime:w,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var x=e,p=l;switch(m=t,w=n,p.tag){case 1:if(x=p.payload,typeof x=="function"){f=x.call(w,f,m);break e}f=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=p.payload,m=typeof x=="function"?x.call(w,f,m):x,m==null)break e;f=Jt({},f,m);break e;case 2:Ks=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,m=a.effects,m===null?a.effects=[l]:m.push(l))}else w={eventTime:w,lane:m,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(d=u=w,c=f):u=u.next=w,o|=m;if(l=l.next,l===null){if(l=a.shared.pending,l===null)break;m=l,l=m.next,m.next=null,a.lastBaseUpdate=m,a.shared.pending=null}}while(!0);if(u===null&&(c=f),a.baseState=c,a.firstBaseUpdate=d,a.lastBaseUpdate=u,t=a.shared.interleaved,t!==null){a=t;do o|=a.lane,a=a.next;while(a!==t)}else i===null&&(a.shared.lanes=0);oi|=o,e.lanes=o,e.memoizedState=f}}function Ex(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],a=r.callback;if(a!==null){if(r.callback=null,r=n,typeof a!="function")throw Error(xe(191,a));a.call(r)}}}var Rc={},is=Da(Rc),ql=Da(Rc),Yl=Da(Rc);function Za(e){if(e===Rc)throw Error(xe(174));return e}function tg(e,t){switch(Dt(Yl,t),Dt(ql,e),Dt(is,Rc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Xf(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Xf(t,e)}Bt(is),Dt(is,t)}function No(){Bt(is),Bt(ql),Bt(Yl)}function rb(e){Za(Yl.current);var t=Za(is.current),n=Xf(t,e.type);t!==n&&(Dt(ql,e),Dt(is,n))}function ng(e){ql.current===e&&(Bt(is),Bt(ql))}var Kt=Da(0);function lu(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 sf=[];function rg(){for(var e=0;e<sf.length;e++)sf[e]._workInProgressVersionPrimary=null;sf.length=0}var Od=Ls.ReactCurrentDispatcher,af=Ls.ReactCurrentBatchConfig,ii=0,Qt=null,ln=null,hn=null,cu=!1,kl=!1,Gl=0,HE=0;function yn(){throw Error(xe(321))}function sg(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Fr(e[n],t[n]))return!1;return!0}function ag(e,t,n,r,a,i){if(ii=i,Qt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Od.current=e===null||e.memoizedState===null?KE:ZE,e=n(r,a),kl){i=0;do{if(kl=!1,Gl=0,25<=i)throw Error(xe(301));i+=1,hn=ln=null,t.updateQueue=null,Od.current=QE,e=n(r,a)}while(kl)}if(Od.current=du,t=ln!==null&&ln.next!==null,ii=0,hn=ln=Qt=null,cu=!1,t)throw Error(xe(300));return e}function ig(){var e=Gl!==0;return Gl=0,e}function Qr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return hn===null?Qt.memoizedState=hn=e:hn=hn.next=e,hn}function br(){if(ln===null){var e=Qt.alternate;e=e!==null?e.memoizedState:null}else e=ln.next;var t=hn===null?Qt.memoizedState:hn.next;if(t!==null)hn=t,ln=e;else{if(e===null)throw Error(xe(310));ln=e,e={memoizedState:ln.memoizedState,baseState:ln.baseState,baseQueue:ln.baseQueue,queue:ln.queue,next:null},hn===null?Qt.memoizedState=hn=e:hn=hn.next=e}return hn}function Kl(e,t){return typeof t=="function"?t(e):t}function of(e){var t=br(),n=t.queue;if(n===null)throw Error(xe(311));n.lastRenderedReducer=e;var r=ln,a=r.baseQueue,i=n.pending;if(i!==null){if(a!==null){var o=a.next;a.next=i.next,i.next=o}r.baseQueue=a=i,n.pending=null}if(a!==null){i=a.next,r=r.baseState;var l=o=null,c=null,d=i;do{var u=d.lane;if((ii&u)===u)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),r=d.hasEagerState?d.eagerState:e(r,d.action);else{var f={lane:u,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(l=c=f,o=r):c=c.next=f,Qt.lanes|=u,oi|=u}d=d.next}while(d!==null&&d!==i);c===null?o=r:c.next=l,Fr(r,t.memoizedState)||(Un=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){a=e;do i=a.lane,Qt.lanes|=i,oi|=i,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function lf(e){var t=br(),n=t.queue;if(n===null)throw Error(xe(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,i=t.memoizedState;if(a!==null){n.pending=null;var o=a=a.next;do i=e(i,o.action),o=o.next;while(o!==a);Fr(i,t.memoizedState)||(Un=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}
vendor: 4,524 bytes, line 38
38function sb(){}function ab(e,t){var n=Qt,r=br(),a=t(),i=!Fr(r.memoizedState,a);if(i&&(r.memoizedState=a,Un=!0),r=r.queue,og(lb.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||hn!==null&&hn.memoizedState.tag&1){if(n.flags|=2048,Zl(9,ob.bind(null,n,r,a,t),void 0,null),fn===null)throw Error(xe(349));ii&30||ib(n,t,a)}return a}function ib(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Qt.updateQueue,t===null?(t={lastEffect:null,stores:null},Qt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ob(e,t,n,r){t.value=n,t.getSnapshot=r,cb(t)&&db(e)}function lb(e,t,n){return n(function(){cb(t)&&db(e)})}function cb(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Fr(e,n)}catch{return!0}}function db(e){var t=Rs(e,1);t!==null&&Ar(t,e,1,-1)}function Px(e){var t=Qr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Kl,lastRenderedState:e},t.queue=e,e=e.dispatch=GE.bind(null,Qt,e),[t.memoizedState,e]}function Zl(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Qt.updateQueue,t===null?(t={lastEffect:null,stores:null},Qt.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 ub(){return br().memoizedState}function Ad(e,t,n,r){var a=Qr();Qt.flags|=e,a.memoizedState=Zl(1|t,n,void 0,r===void 0?null:r)}function Gu(e,t,n,r){var a=br();r=r===void 0?null:r;var i=void 0;if(ln!==null){var o=ln.memoizedState;if(i=o.destroy,r!==null&&sg(r,o.deps)){a.memoizedState=Zl(t,n,i,r);return}}Qt.flags|=e,a.memoizedState=Zl(1|t,n,i,r)}function Tx(e,t){return Ad(8390656,8,e,t)}function og(e,t){return Gu(2048,8,e,t)}function hb(e,t){return Gu(4,2,e,t)}function fb(e,t){return Gu(4,4,e,t)}function mb(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 pb(e,t,n){return n=n!=null?n.concat([e]):null,Gu(4,4,mb.bind(null,t,e),n)}function lg(){}function gb(e,t){var n=br();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&sg(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function vb(e,t){var n=br();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&sg(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function xb(e,t,n){return ii&21?(Fr(n,t)||(n=_0(),Qt.lanes|=n,oi|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Un=!0),e.memoizedState=n)}function qE(e,t){var n=Ct;Ct=n!==0&&4>n?n:4,e(!0);var r=af.transition;af.transition={};try{e(!1),t()}finally{Ct=n,af.transition=r}}function yb(){return br().memoizedState}function YE(e,t,n){var r=ga(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},wb(e))bb(t,n);else if(n=tb(e,t,n,r),n!==null){var a=On();Ar(n,e,r,a),jb(n,t,r)}}function GE(e,t,n){var r=ga(e),a={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(wb(e))bb(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,l=i(o,n);if(a.hasEagerState=!0,a.eagerState=l,Fr(l,o)){var c=t.interleaved;c===null?(a.next=a,Xp(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}n=tb(e,t,a,r),n!==null&&(a=On(),Ar(n,e,r,a),jb(n,t,r))}}function wb(e){var t=e.alternate;return e===Qt||t!==null&&t===Qt}function bb(e,t){kl=cu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function jb(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Fp(e,n)}}var du={readContext:wr,useCallback:yn,useContext:yn,useEffect:yn,useImperativeHandle:yn,useInsertionEffect:yn,useLayoutEffect:yn,useMemo:yn,useReducer:yn,useRef:yn,useState:yn,useDebugValue:yn,useDeferredValue:yn,useTransition:yn,useMutableSource:yn,useSyncExternalStore:yn,useId:yn,unstable_isNewReconciler:!1},KE={readContext:wr,useCallback:function(e,t){return Qr().memoizedState=[e,t===void 0?null:t],e},useContext:wr,useEffect:Tx,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ad(4194308,4,mb.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ad(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ad(4,2,e,t)},useMemo:function(e,t){var n=Qr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Qr();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=YE.bind(null,Qt,e),[r.memoizedState,e]}
vendor: 7,433 bytes, lines 38-40
38,useRef:function(e){var t=Qr();return e={current:e},t.memoizedState=e},useState:Px,useDebugValue:lg,useDeferredValue:function(e){return Qr().memoizedState=e},useTransition:function(){var e=Px(!1),t=e[0];return e=qE.bind(null,e[1]),Qr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Qt,a=Qr();if(qt){if(n===void 0)throw Error(xe(407));n=n()}else{if(n=t(),fn===null)throw Error(xe(349));ii&30||ib(r,t,n)}a.memoizedState=n;var i={value:n,getSnapshot:t};return a.queue=i,Tx(lb.bind(null,r,i,e),[e]),r.flags|=2048,Zl(9,ob.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Qr(),t=fn.identifierPrefix;if(qt){var n=Ss,r=Ns;n=(r&~(1<<32-Or(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Gl++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=HE++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ZE={readContext:wr,useCallback:gb,useContext:wr,useEffect:og,useImperativeHandle:pb,useInsertionEffect:hb,useLayoutEffect:fb,useMemo:vb,useReducer:of,useRef:ub,useState:function(){return of(Kl)},useDebugValue:lg,useDeferredValue:function(e){var t=br();return xb(t,ln.memoizedState,e)},useTransition:function(){var e=of(Kl)[0],t=br().memoizedState;return[e,t]},useMutableSource:sb,useSyncExternalStore:ab,useId:yb,unstable_isNewReconciler:!1},QE={readContext:wr,useCallback:gb,useContext:wr,useEffect:og,useImperativeHandle:pb,useInsertionEffect:hb,useLayoutEffect:fb,useMemo:vb,useReducer:lf,useRef:ub,useState:function(){return lf(Kl)},useDebugValue:lg,useDeferredValue:function(e){var t=br();return ln===null?t.memoizedState=e:xb(t,ln.memoizedState,e)},useTransition:function(){var e=lf(Kl)[0],t=br().memoizedState;return[e,t]},useMutableSource:sb,useSyncExternalStore:ab,useId:yb,unstable_isNewReconciler:!1};function Sr(e,t){if(e&&e.defaultProps){t=Jt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function wm(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Jt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ku={isMounted:function(e){return(e=e._reactInternals)?bi(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=On(),a=ga(e),i=ks(r,a);i.payload=t,n!=null&&(i.callback=n),t=ma(e,i,a),t!==null&&(Ar(t,e,a,r),Dd(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=On(),a=ga(e),i=ks(r,a);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=ma(e,i,a),t!==null&&(Ar(t,e,a,r),Dd(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=On(),r=ga(e),a=ks(n,r);a.tag=2,t!=null&&(a.callback=t),t=ma(e,a,r),t!==null&&(Ar(t,e,r,n),Dd(t,e,r))}};function Rx(e,t,n,r,a,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!Bl(n,r)||!Bl(a,i):!0}function _b(e,t,n){var r=!1,a=ba,i=t.contextType;return typeof i=="object"&&i!==null?i=wr(i):(a=Hn(t)?si:Sn.current,r=t.contextTypes,i=(r=r!=null)?bo(e,a):ba),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ku,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=i),t}function Dx(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&&Ku.enqueueReplaceState(t,t.state,null)}function bm(e,t,n,r){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs={},eg(e);var i=t.contextType;typeof i=="object"&&i!==null?a.context=wr(i):(i=Hn(t)?si:Sn.current,a.context=bo(e,i)),a.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(wm(e,t,i,n),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&Ku.enqueueReplaceState(a,a.state,null),ou(e,n,a,r),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function So(e,t){try{var n="",r=t;do n+=SC(r),r=r.return;while(r);var a=n}catch(i){a=` 39Error generating stack: `+i.message+` 40`+i.stack}return{value:e,source:t,stack:a,digest:null}}function cf(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function jm(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var JE=typeof WeakMap=="function"?WeakMap:Map;function Nb(e,t,n){n=ks(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){hu||(hu=!0,Dm=r),jm(e,t)},n}function Sb(e,t,n){n=ks(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var a=t.value;n.payload=function(){return r(a)},n.callback=function(){jm(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){jm(e,t),typeof r!="function"&&(pa===null?pa=new Set([this]):pa.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Ox(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new JE;var a=new Set;r.set(t,a)}else a=r.get(t),a===void 0&&(a=new Set,r.set(t,a));a.has(n)||(a.add(n),e=hP.bind(null,e,t,n),t.then(e,e))}function Ax(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}function Mx(e,t,n,r,a){return e.mode&1?(e.flags|=65536,e.lanes=a,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=ks(-1,1),t.tag=2,ma(n,t,1))),n.lanes|=1),e)}var XE=Ls.ReactCurrentOwner,Un=!1;function Tn(e,t,n,r){t.child=e===null?eb(t,null,n,r):_o(t,e.child,n,r)}function Ix(e,t,n,r,a){n=n.render;var i=t.ref;return no(t,a),r=ag(e,t,n,r,i,a),n=ig(),e!==null&&!Un?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Ds(e,t,a)):(qt&&n&&Yp(t),t.flags|=1,Tn(e,t,r,a),t.child)}function Lx(e,t,n,r,a){if(e===null){var i=n.type;return typeof i=="function"&&!gg(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,kb(e,t,i,r,a)):(e=$d(n.type,null,r,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&a)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:Bl,n(o,r)&&e.ref===t.ref)return Ds(e,t,a)}return t.flags|=1,e=va(i,r),e.ref=t.ref,e.return=t,t.child=e}function kb(e,t,n,r,a){if(e!==null){var i=e.memoizedProps;if(Bl(i,r)&&e.ref===t.ref)if(Un=!1,t.pendingProps=r=i,(e.lanes&a)!==0)e.flags&131072&&(Un=!0);else return t.lanes=e.lanes,Ds(e,t,a)}return _m(e,t,n,r,a)}function Cb(e,t,n){var r=t.pendingProps,a=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Dt(Zi,tr),tr|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Dt(Zi,tr),tr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Dt(Zi,tr),tr|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Dt(Zi,tr),tr|=r;return Tn(e,t,a,n),t.child}function Eb(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}
vendor: 5,661 bytes, line 40
40function _m(e,t,n,r,a){var i=Hn(n)?si:Sn.current;return i=bo(t,i),no(t,a),n=ag(e,t,n,r,i,a),r=ig(),e!==null&&!Un?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Ds(e,t,a)):(qt&&r&&Yp(t),t.flags|=1,Tn(e,t,n,a),t.child)}function $x(e,t,n,r,a){if(Hn(n)){var i=!0;nu(t)}else i=!1;if(no(t,a),t.stateNode===null)Md(e,t),_b(t,n,r),bm(t,n,r,a),r=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,d=n.contextType;typeof d=="object"&&d!==null?d=wr(d):(d=Hn(n)?si:Sn.current,d=bo(t,d));var u=n.getDerivedStateFromProps,f=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==r||c!==d)&&Dx(t,o,r,d),Ks=!1;var m=t.memoizedState;o.state=m,ou(t,r,o,a),c=t.memoizedState,l!==r||m!==c||Wn.current||Ks?(typeof u=="function"&&(wm(t,n,u,r),c=t.memoizedState),(l=Ks||Rx(t,n,l,r,m,c,d))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=d,r=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,nb(e,t),l=t.memoizedProps,d=t.type===t.elementType?l:Sr(t.type,l),o.props=d,f=t.pendingProps,m=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=wr(c):(c=Hn(n)?si:Sn.current,c=bo(t,c));var w=n.getDerivedStateFromProps;(u=typeof w=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==f||m!==c)&&Dx(t,o,r,c),Ks=!1,m=t.memoizedState,o.state=m,ou(t,r,o,a);var x=t.memoizedState;l!==f||m!==x||Wn.current||Ks?(typeof w=="function"&&(wm(t,n,w,r),x=t.memoizedState),(d=Ks||Rx(t,n,d,r,m,x,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,x,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,x,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=x),o.props=r,o.state=x,o.context=c,r=d):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return Nm(e,t,n,r,i,a)}function Nm(e,t,n,r,a,i){Eb(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return a&&_x(t,n,!1),Ds(e,t,i);r=t.stateNode,XE.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=_o(t,e.child,null,i),t.child=_o(t,null,l,i)):Tn(e,t,l,i),t.memoizedState=r.state,a&&_x(t,n,!0),t.child}function Pb(e){var t=e.stateNode;t.pendingContext?jx(e,t.pendingContext,t.pendingContext!==t.context):t.context&&jx(e,t.context,!1),tg(e,t.containerInfo)}function Fx(e,t,n,r,a){return jo(),Kp(a),t.flags|=256,Tn(e,t,n,r),t.child}var Sm={dehydrated:null,treeContext:null,retryLane:0};function km(e){return{baseLanes:e,cachePool:null,transitions:null}}function Tb(e,t,n){var r=t.pendingProps,a=Kt.current,i=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(a&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),Dt(Kt,a&1),e===null)return xm(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):(o=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=Ju(o,r,0,null),e=ni(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=km(n),t.memoizedState=Sm,e):cg(t,o));if(a=e.memoizedState,a!==null&&(l=a.dehydrated,l!==null))return eP(e,t,o,r,l,a,n);if(i){i=r.fallback,o=t.mode,a=e.child,l=a.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&t.child!==a?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=va(a,c),r.subtreeFlags=a.subtreeFlags&14680064),l!==null?i=va(l,i):(i=ni(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?km(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=Sm,r}return i=e.child,e=i.sibling,r=va(i,{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 cg(e,t){return t=Ju({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function dd(e,t,n,r){return r!==null&&Kp(r),_o(t,e.child,null,n),e=cg(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function eP(e,t,n,r,a,i,o){if(n)return t.flags&256?(t.flags&=-257,r=cf(Error(xe(422))),dd(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,a=t.mode,r=Ju({mode:"visible",children:r.children},a,0,null),i=ni(i,a,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&_o(t,e.child,null,o),t.child.memoizedState=km(o
vendor: 4,739 bytes, line 40
40),t.memoizedState=Sm,i);if(!(t.mode&1))return dd(e,t,o,null);if(a.data==="$!"){if(r=a.nextSibling&&a.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(xe(419)),r=cf(i,r,void 0),dd(e,t,o,r)}if(l=(o&e.childLanes)!==0,Un||l){if(r=fn,r!==null){switch(o&-o){case 4:a=2;break;case 16:a=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:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(r.suspendedLanes|o)?0:a,a!==0&&a!==i.retryLane&&(i.retryLane=a,Rs(e,a),Ar(r,e,a,-1))}return pg(),r=cf(Error(xe(421))),dd(e,t,o,r)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=fP.bind(null,e),a._reactRetry=t,null):(e=i.treeContext,sr=fa(a.nextSibling),ar=t,qt=!0,Tr=null,e!==null&&(fr[mr++]=Ns,fr[mr++]=Ss,fr[mr++]=ai,Ns=e.id,Ss=e.overflow,ai=t),t=cg(t,r.children),t.flags|=4096,t)}function Ux(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ym(e.return,t,n)}function df(e,t,n,r,a){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=a)}function Rb(e,t,n){var r=t.pendingProps,a=r.revealOrder,i=r.tail;if(Tn(e,t,r.children,n),r=Kt.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&&Ux(e,n,t);else if(e.tag===19)Ux(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(Dt(Kt,r),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&lu(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),df(t,!1,a,n,i);break;case"backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&lu(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}df(t,!0,n,null,i);break;case"together":df(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Md(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ds(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),oi|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(xe(153));if(t.child!==null){for(e=t.child,n=va(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=va(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function tP(e,t,n){switch(t.tag){case 3:Pb(t),jo();break;case 5:rb(t);break;case 1:Hn(t.type)&&nu(t);break;case 4:tg(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,a=t.memoizedProps.value;Dt(au,r._currentValue),r._currentValue=a;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Dt(Kt,Kt.current&1),t.flags|=128,null):n&t.child.childLanes?Tb(e,t,n):(Dt(Kt,Kt.current&1),e=Ds(e,t,n),e!==null?e.sibling:null);Dt(Kt,Kt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Rb(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),Dt(Kt,Kt.current),r)break;return null;case 22:case 23:return t.lanes=0,Cb(e,t,n)}return Ds(e,t,n)}var Db,Cm,Ob,Ab;Db=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}};Cm=function(){};Ob=function(e,t,n,r){var a=e.memoizedProps;if(a!==r){e=t.stateNode,Za(is.current);var i=null;switch(n){case"input":a=Kf(e,a),r=Kf(e,r),i=[];break;case"select":a=Jt({},a,{value:void 0}),r=Jt({},r,{value:void 0}),i=[];break;case"textarea":a=Jf(e,a),r=Jf(e,r),i=[];break;default:typeof a.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=eu)}em(n,r);var o;n=null;for(d in a)if(!r.hasOwnProperty(d)&&a.hasOwnProperty(d)&&a[d]!=null)if(d==="style"){var l=a[d];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(Ml.hasOwnProperty(d)?i||(i=[]):(i=i||[]).push(d,null));for(d in r){var c=r[d];if(l=a!=null?a[d]:void 0,r.hasOwnProperty(d)&&c!==l&&(c!=null||l!=null))if(d==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}
vendor: 5,030 bytes, line 40
40else n||(i||(i=[]),i.push(d,n)),n=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(Ml.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&$t("scroll",e),i||l===c||(i=[])):(i=i||[]).push(d,c))}n&&(i=i||[]).push("style",n);var d=i;(t.updateQueue=d)&&(t.flags|=4)}};Ab=function(e,t,n,r){n!==r&&(t.flags|=4)};function sl(e,t){if(!qt)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 wn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags&14680064,r|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function nP(e,t,n){var r=t.pendingProps;switch(Gp(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wn(t),null;case 1:return Hn(t.type)&&tu(),wn(t),null;case 3:return r=t.stateNode,No(),Bt(Wn),Bt(Sn),rg(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ld(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Tr!==null&&(Mm(Tr),Tr=null))),Cm(e,t),wn(t),null;case 5:ng(t);var a=Za(Yl.current);if(n=t.type,e!==null&&t.stateNode!=null)Ob(e,t,n,r,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(xe(166));return wn(t),null}if(e=Za(is.current),ld(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[ts]=t,r[Hl]=i,e=(t.mode&1)!==0,n){case"dialog":$t("cancel",r),$t("close",r);break;case"iframe":case"object":case"embed":$t("load",r);break;case"video":case"audio":for(a=0;a<ml.length;a++)$t(ml[a],r);break;case"source":$t("error",r);break;case"img":case"image":case"link":$t("error",r),$t("load",r);break;case"details":$t("toggle",r);break;case"input":Kv(r,i),$t("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},$t("invalid",r);break;case"textarea":Qv(r,i),$t("invalid",r)}em(n,i),a=null;for(var o in i)if(i.hasOwnProperty(o)){var l=i[o];o==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&od(r.textContent,l,e),a=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&od(r.textContent,l,e),a=["children",""+l]):Ml.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&$t("scroll",r)}switch(n){case"input":Xc(r),Zv(r,i,!0);break;case"textarea":Xc(r),Jv(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=eu)}r=a,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=l0(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[ts]=t,e[Hl]=r,Db(e,t,!1,!1),t.stateNode=e;e:{switch(o=tm(n,r),n){case"dialog":$t("cancel",e),$t("close",e),a=r;break;case"iframe":case"object":case"embed":$t("load",e),a=r;break;case"video":case"audio":for(a=0;a<ml.length;a++)$t(ml[a],e);a=r;break;case"source":$t("error",e),a=r;break;case"img":case"image":case"link":$t("error",e),$t("load",e),a=r;break;case"details":$t("toggle",e),a=r;break;case"input":Kv(e,r),a=Kf(e,r),$t("invalid",e);break;case"option":a=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},a=Jt({},r,{value:void 0}),$t("invalid",e);break;case"textarea":Qv(e,r),a=Jf(e,r),$t("invalid",e);break;default:a=r}em(n,a),l=a;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?u0(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&c0(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Il(e,c):typeof c=="number"&&Il(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Ml.hasOwnProperty(i)?c!=null&&i==="onScroll"&&$t("scroll",e):c!=null&&Op(e,i,c,o))}switch(n){case"input":Xc(e),Zv(e,r,!1);break;case"textarea":Xc(e),Jv(e);break;case"option":r.value!=null&&e.setAttribute("value",""+wa(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Ji(e,!!r.multiple,i,!1):r.defaultValue!=null&&Ji(e,!!r.multiple,r.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=eu)}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)}
vendor: 30,031 bytes, line 40
40return wn(t),null;case 6:if(e&&t.stateNode!=null)Ab(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(xe(166));if(n=Za(Yl.current),Za(is.current),ld(t)){if(r=t.stateNode,n=t.memoizedProps,r[ts]=t,(i=r.nodeValue!==n)&&(e=ar,e!==null))switch(e.tag){case 3:od(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&od(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[ts]=t,t.stateNode=r}return wn(t),null;case 13:if(Bt(Kt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(qt&&sr!==null&&t.mode&1&&!(t.flags&128))J0(),jo(),t.flags|=98560,i=!1;else if(i=ld(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(xe(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(xe(317));i[ts]=t}else jo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;wn(t),i=!1}else Tr!==null&&(Mm(Tr),Tr=null),i=!0;if(!i)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||Kt.current&1?cn===0&&(cn=3):pg())),t.updateQueue!==null&&(t.flags|=4),wn(t),null);case 4:return No(),Cm(e,t),e===null&&Vl(t.stateNode.containerInfo),wn(t),null;case 10:return Jp(t.type._context),wn(t),null;case 17:return Hn(t.type)&&tu(),wn(t),null;case 19:if(Bt(Kt),i=t.memoizedState,i===null)return wn(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)sl(i,!1);else{if(cn!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=lu(e),o!==null){for(t.flags|=128,sl(i,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Dt(Kt,Kt.current&1|2),t.child}e=e.sibling}i.tail!==null&&rn()>ko&&(t.flags|=128,r=!0,sl(i,!1),t.lanes=4194304)}else{if(!r)if(e=lu(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),sl(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!qt)return wn(t),null}else 2*rn()-i.renderingStartTime>ko&&n!==1073741824&&(t.flags|=128,r=!0,sl(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=rn(),t.sibling=null,n=Kt.current,Dt(Kt,r?n&1|2:n&1),t):(wn(t),null);case 22:case 23:return mg(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?tr&1073741824&&(wn(t),t.subtreeFlags&6&&(t.flags|=8192)):wn(t),null;case 24:return null;case 25:return null}throw Error(xe(156,t.tag))}function rP(e,t){switch(Gp(t),t.tag){case 1:return Hn(t.type)&&tu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return No(),Bt(Wn),Bt(Sn),rg(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ng(t),null;case 13:if(Bt(Kt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(xe(340));jo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Bt(Kt),null;case 4:return No(),null;case 10:return Jp(t.type._context),null;case 22:case 23:return mg(),null;case 24:return null;default:return null}}var ud=!1,_n=!1,sP=typeof WeakSet=="function"?WeakSet:Set,Re=null;function Ki(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){en(e,t,r)}else n.current=null}function Em(e,t,n){try{n()}catch(r){en(e,t,r)}}var zx=!1;function aP(e,t){if(um=Qd,e=F0(),qp(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 a=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,d=0,u=0,f=e,m=null;t:for(;;){for(var w;f!==n||a!==0&&f.nodeType!==3||(l=o+a),f!==i||r!==0&&f.nodeType!==3||(c=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(w=f.firstChild)!==null;)m=f,f=w;for(;;){if(f===e)break t;if(m===n&&++d===a&&(l=o),m===i&&++u===r&&(c=o),(w=f.nextSibling)!==null)break;f=m,m=f.parentNode}f=w}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(hm={focusedElem:e,selectionRange:n},Qd=!1,Re=t;Re!==null;)if(t=Re,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Re=e;else for(;Re!==null;){t=Re;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var p=x.memoizedProps,b=x.memoizedState,v=t.stateNode,g=v.getSnapshotBeforeUpdate(t.elementType===t.type?p:Sr(t.type,p),b);v.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(xe(163))}}catch(j){en(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,Re=e;break}Re=t.return}return x=zx,zx=!1,x}function Cl(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var a=r=r.next;do{if((a.tag&e)===e){var i=a.destroy;a.destroy=void 0,i!==void 0&&Em(t,n,i)}a=a.next}while(a!==r)}}function Zu(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 Pm(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 Mb(e){var t=e.alternate;t!==null&&(e.alternate=null,Mb(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ts],delete t[Hl],delete t[pm],delete t[zE],delete t[BE])),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 Ib(e){return e.tag===5||e.tag===3||e.tag===4}function Bx(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ib(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 Tm(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=eu));else if(r!==4&&(e=e.child,e!==null))for(Tm(e,t,n),e=e.sibling;e!==null;)Tm(e,t,n),e=e.sibling}function Rm(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(Rm(e,t,n),e=e.sibling;e!==null;)Rm(e,t,n),e=e.sibling}var pn=null,Er=!1;function Us(e,t,n){for(n=n.child;n!==null;)Lb(e,t,n),n=n.sibling}function Lb(e,t,n){if(as&&typeof as.onCommitFiberUnmount=="function")try{as.onCommitFiberUnmount(Bu,n)}catch{}switch(n.tag){case 5:_n||Ki(n,t);case 6:var r=pn,a=Er;pn=null,Us(e,t,n),pn=r,Er=a,pn!==null&&(Er?(e=pn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):pn.removeChild(n.stateNode));break;case 18:pn!==null&&(Er?(e=pn,n=n.stateNode,e.nodeType===8?nf(e.parentNode,n):e.nodeType===1&&nf(e,n),Ul(e)):nf(pn,n.stateNode));break;case 4:r=pn,a=Er,pn=n.stateNode.containerInfo,Er=!0,Us(e,t,n),pn=r,Er=a;break;case 0:case 11:case 14:case 15:if(!_n&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){a=r=r.next;do{var i=a,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Em(n,t,o),a=a.next}while(a!==r)}Us(e,t,n);break;case 1:if(!_n&&(Ki(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){en(n,t,l)}Us(e,t,n);break;case 21:Us(e,t,n);break;case 22:n.mode&1?(_n=(r=_n)||n.memoizedState!==null,Us(e,t,n),_n=r):Us(e,t,n);break;default:Us(e,t,n)}}function Vx(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new sP),t.forEach(function(r){var a=mP.bind(null,e,r);n.has(r)||(n.add(r),r.then(a,a))})}}function jr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r];try{var i=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:pn=l.stateNode,Er=!1;break e;case 3:pn=l.stateNode.containerInfo,Er=!0;break e;case 4:pn=l.stateNode.containerInfo,Er=!0;break e}l=l.return}if(pn===null)throw Error(xe(160));Lb(i,o,a),pn=null,Er=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(d){en(a,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)$b(t,e),t=t.sibling}function $b(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(jr(t,e),Gr(e),r&4){try{Cl(3,e,e.return),Zu(3,e)}catch(p){en(e,e.return,p)}try{Cl(5,e,e.return)}catch(p){en(e,e.return,p)}}break;case 1:jr(t,e),Gr(e),r&512&&n!==null&&Ki(n,n.return);break;case 5:if(jr(t,e),Gr(e),r&512&&n!==null&&Ki(n,n.return),e.flags&32){var a=e.stateNode;try{Il(a,"")}catch(p){en(e,e.return,p)}}if(r&4&&(a=e.stateNode,a!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&i0(a,i),tm(l,o);var d=tm(l,i);for(o=0;o<c.length;o+=2){var u=c[o],f=c[o+1];u==="style"?u0(a,f):u==="dangerouslySetInnerHTML"?c0(a,f):u==="children"?Il(a,f):Op(a,u,f,d)}switch(l){case"input":Zf(a,i);break;case"textarea":o0(a,i);break;case"select":var m=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!i.multiple;var w=i.value;w!=null?Ji(a,!!i.multiple,w,!1):m!==!!i.multiple&&(i.defaultValue!=null?Ji(a,!!i.multiple,i.defaultValue,!0):Ji(a,!!i.multiple,i.multiple?[]:"",!1))}a[Hl]=i}catch(p){en(e,e.return,p)}}break;case 6:if(jr(t,e),Gr(e),r&4){if(e.stateNode===null)throw Error(xe(162));a=e.stateNode,i=e.memoizedProps;try{a.nodeValue=i}catch(p){en(e,e.return,p)}}break;case 3:if(jr(t,e),Gr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ul(t.containerInfo)}catch(p){en(e,e.return,p)}break;case 4:jr(t,e),Gr(e);break;case 13:jr(t,e),Gr(e),a=e.child,a.flags&8192&&(i=a.memoizedState!==null,a.stateNode.isHidden=i,!i||a.alternate!==null&&a.alternate.memoizedState!==null||(hg=rn())),r&4&&Vx(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(_n=(d=_n)||u,jr(t,e),_n=d):jr(t,e),Gr(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!u&&e.mode&1)for(Re=e,u=e.child;u!==null;){for(f=Re=u;Re!==null;){switch(m=Re,w=m.child,m.tag){case 0:case 11:case 14:case 15:Cl(4,m,m.return);break;case 1:Ki(m,m.return);var x=m.stateNode;if(typeof x.componentWillUnmount=="function"){r=m,n=m.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(p){en(r,n,p)}}break;case 5:Ki(m,m.return);break;case 22:if(m.memoizedState!==null){Hx(f);continue}}w!==null?(w.return=m,Re=w):Hx(f)}u=u.sibling}e:for(u=null,f=e;;){if(f.tag===5){if(u===null){u=f;try{a=f.stateNode,d?(i=a.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=f.stateNode,c=f.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=d0("display",o))}catch(p){en(e,e.return,p)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=d?"":f.memoizedProps}catch(p){en(e,e.return,p)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:jr(t,e),Gr(e),r&4&&Vx(e);break;case 21:break;default:jr(t,e),Gr(e)}}function Gr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Ib(n)){var r=n;break e}n=n.return}throw Error(xe(160))}switch(r.tag){case 5:var a=r.stateNode;r.flags&32&&(Il(a,""),r.flags&=-33);var i=Bx(e);Rm(e,i,a);break;case 3:case 4:var o=r.stateNode.containerInfo,l=Bx(e);Tm(e,l,o);break;default:throw Error(xe(161))}}catch(c){en(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function iP(e,t,n){Re=e,Fb(e)}function Fb(e,t,n){for(var r=(e.mode&1)!==0;Re!==null;){var a=Re,i=a.child;if(a.tag===22&&r){var o=a.memoizedState!==null||ud;if(!o){var l=a.alternate,c=l!==null&&l.memoizedState!==null||_n;l=ud;var d=_n;if(ud=o,(_n=c)&&!d)for(Re=a;Re!==null;)o=Re,c=o.child,o.tag===22&&o.memoizedState!==null?qx(a):c!==null?(c.return=o,Re=c):qx(a);for(;i!==null;)Re=i,Fb(i),i=i.sibling;Re=a,ud=l,_n=d}Wx(e)}else a.subtreeFlags&8772&&i!==null?(i.return=a,Re=i):Wx(e)}}function Wx(e){for(;Re!==null;){var t=Re;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:_n||Zu(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!_n)if(n===null)r.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:Sr(t.type,n.memoizedProps);r.componentDidUpdate(a,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Ex(t,i,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Ex(t,o,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 d=t.alternate;if(d!==null){var u=d.memoizedState;if(u!==null){var f=u.dehydrated;f!==null&&Ul(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(xe(163))}_n||t.flags&512&&Pm(t)}catch(m){en(t,t.return,m)}}if(t===e){Re=null;break}if(n=t.sibling,n!==null){n.return=t.return,Re=n;break}Re=t.return}}function Hx(e){for(;Re!==null;){var t=Re;if(t===e){Re=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Re=n;break}Re=t.return}}function qx(e){for(;Re!==null;){var t=Re;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Zu(4,t)}catch(c){en(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var a=t.return;try{r.componentDidMount()}catch(c){en(t,a,c)}}var i=t.return;try{Pm(t)}catch(c){en(t,i,c)}break;case 5:var o=t.return;try{Pm(t)}catch(c){en(t,o,c)}}}catch(c){en(t,t.return,c)}if(t===e){Re=null;break}var l=t.sibling;if(l!==null){l.return=t.return,Re=l;break}Re=t.return}}var oP=Math.ceil,uu=Ls.ReactCurrentDispatcher,dg=Ls.ReactCurrentOwner,vr=Ls.ReactCurrentBatchConfig,bt=0,fn=null,sn=null,gn=0,tr=0,Zi=Da(0),cn=0,Ql=null,oi=0,Qu=0,ug=0,El=null,$n=null,hg=0,ko=1/0,ws=null,hu=!1,Dm=null,pa=null,hd=!1,ia=null,fu=0,Pl=0,Om=null,Id=-1,Ld=0;function On(){return bt&6?rn():Id!==-1?Id:Id=rn()}function ga(e){return e.mode&1?bt&2&&gn!==0?gn&-gn:WE.transition!==null?(Ld===0&&(Ld=_0()),Ld):(e=Ct,e!==0||(e=window.event,e=e===void 0?16:T0(e.type)),e):1}function Ar(e,t,n,r){if(50<Pl)throw Pl=0,Om=null,Error(xe(185));Ec(e,n,r),(!(bt&2)||e!==fn)&&(e===fn&&(!(bt&2)&&(Qu|=n),cn===4&&Qs(e,gn)),qn(e,r),n===1&&bt===0&&!(t.mode&1)&&(ko=rn()+500,Yu&&Oa()))}function qn(e,t){var n=e.callbackNode;WC(e,t);var r=Zd(e,e===fn?gn:0);if(r===0)n!==null&&tx(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&tx(n),t===1)e.tag===0?VE(Yx.bind(null,e)):K0(Yx.bind(null,e)),FE(function(){!(bt&6)&&Oa()}),n=null;else{switch(N0(r)){case 1:n=$p;break;case 4:n=b0;break;case 16:n=Kd;break;case 536870912:n=j0;break;default:n=Kd}n=Yb(n,Ub.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Ub(e,t){if(Id=-1,Ld=0,bt&6)throw Error(xe(327));var n=e.callbackNode;if(ro()&&e.callbackNode!==n)return null;var r=Zd(e,e===fn?gn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=mu(e,r);else{t=r;var a=bt;bt|=2;var i=Bb();(fn!==e||gn!==t)&&(ws=null,ko=rn()+500,ti(e,t));do try{dP();break}catch(l){zb(e,l)}while(!0);Qp(),uu.current=i,bt=a,sn!==null?t=0:(fn=null,gn=0,t=cn)}if(t!==0){if(t===2&&(a=im(e),a!==0&&(r=a,t=Am(e,a))),t===1)throw n=Ql,ti(e,0),Qs(e,r),qn(e,rn()),n;if(t===6)Qs(e,r);else{if(a=e.current.alternate,!(r&30)&&!lP(a)&&(t=mu(e,r),t===2&&(i=im(e),i!==0&&(r=i,t=Am(e,i))),t===1))throw n=Ql,ti(e,0),Qs(e,r),qn(e,rn()),n;switch(e.finishedWork=a,e.finishedLanes=r,t){case 0:case 1:throw Error(xe(345));case 2:Va(e,$n,ws);break;case 3:if(Qs(e,r),(r&130023424)===r&&(t=hg+500-rn(),10<t)){if(Zd(e,0)!==0)break;if(a=e.suspendedLanes,(a&r)!==r){On(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=mm(Va.bind(null,e,$n,ws),t);break}Va(e,$n,ws);break;case 4:if(Qs(e,r),(r&4194240)===r)break;for(t=e.eventTimes,a=-1;0<r;){var o=31-Or(r);i=1<<o,o=t[o],o>a&&(a=o),r&=~i}if(r=a,r=rn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*oP(r/1960))-r,10<r){e.timeoutHandle=mm(Va.bind(null,e,$n,ws),r);break}Va(e,$n,ws);break;case 5:Va(e,$n,ws);break;default:throw Error(xe(329))}}}return qn(e,rn()),e.callbackNode===n?Ub.bind(null,e):null}function Am(e,t){var n=El;return e.current.memoizedState.isDehydrated&&(ti(e,t).flags|=256),e=mu(e,t),e!==2&&(t=$n,$n=n,t!==null&&Mm(t)),e}function Mm(e){$n===null?$n=e:$n.push.apply($n,e)}function lP(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 a=n[r],i=a.getSnapshot;a=a.value;try{if(!Fr(i(),a))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 Qs(e,t){for(t&=~ug,t&=~Qu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Or(t),r=1<<n;e[n]=-1,t&=~r}}function Yx(e){if(bt&6)throw Error(xe(327));ro();var t=Zd(e,0);if(!(t&1))return qn(e,rn()),null;var n=mu(e,t);if(e.tag!==0&&n===2){var r=im(e);r!==0&&(t=r,n=Am(e,r))}if(n===1)throw n=Ql,ti(e,0),Qs(e,t),qn(e,rn()),n;if(n===6)throw Error(xe(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Va(e,$n,ws),qn(e,rn()),null}function fg(e,t){var n=bt;bt|=1;try{return e(t)}finally{bt=n,bt===0&&(ko=rn()+500,Yu&&Oa())}}function li(e){ia!==null&&ia.tag===0&&!(bt&6)&&ro();var t=bt;bt|=1;var n=vr.transition,r=Ct;try{if(vr.transition=null,Ct=1,e)return e()}finally{Ct=r,vr.transition=n,bt=t,!(bt&6)&&Oa()}}function mg(){tr=Zi.current,Bt(Zi)}function ti(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,$E(n)),sn!==null)for(n=sn.return;n!==null;){var r=n;switch(Gp(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&tu();break;case 3:No(),Bt(Wn),Bt(Sn),rg();break;case 5:ng(r);break;case 4:No();break;case 13:Bt(Kt);break;case 19:Bt(Kt);break;case 10:Jp(r.type._context);break;case 22:case 23:mg()}n=n.return}if(fn=e,sn=e=va(e.current,null),gn=tr=t,cn=0,Ql=null,ug=Qu=oi=0,$n=El=null,Ka!==null){for(t=0;t<Ka.length;t++)if(n=Ka[t],r=n.interleaved,r!==null){n.interleaved=null;var a=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=a,r.next=o}n.pending=r}Ka=null}return e}function zb(e,t){do{var n=sn;try{if(Qp(),Od.current=du,cu){for(var r=Qt.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}cu=!1}if(ii=0,hn=ln=Qt=null,kl=!1,Gl=0,dg.current=null,n===null||n.return===null){cn=1,Ql=t,sn=null;break}e:{var i=e,o=n.return,l=n,c=t;if(t=gn,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,u=l,f=u.tag;if(!(u.mode&1)&&(f===0||f===11||f===15)){var m=u.alternate;m?(u.updateQueue=m.updateQueue,u.memoizedState=m.memoizedState,u.lanes=m.lanes):(u.updateQueue=null,u.memoizedState=null)}var w=Ax(o);if(w!==null){w.flags&=-257,Mx(w,o,l,i,t),w.mode&1&&Ox(i,d,t),t=w,c=d;var x=t.updateQueue;if(x===null){var p=new Set;p.add(c),t.updateQueue=p}else x.add(c);break e}else{if(!(t&1)){Ox(i,d,t),pg();break e}c=Error(xe(426))}}else if(qt&&l.mode&1){var b=Ax(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),Mx(b,o,l,i,t),Kp(So(c,l));break e}}i=c=So(c,l),cn!==4&&(cn=2),El===null?El=[i]:El.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var v=Nb(i,c,t);Cx(i,v);break e;case 1:l=c;var g=i.type,y=i.stateNode;if(!(i.flags&128)&&(typeof g.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(pa===null||!pa.has(y)))){i.flags|=65536,t&=-t,i.lanes|=t;var j=Sb(i,l,t);Cx(i,j);break e}}i=i.return}while(i!==null)}Wb(n)}catch(N){t=N,sn===n&&n!==null&&(sn=n=n.return);continue}break}while(!0)}function Bb(){var e=uu.current;return uu.current=du,e===null?du:e}function pg(){(cn===0||cn===3||cn===2)&&(cn=4),fn===null||!(oi&268435455)&&!(Qu&268435455)||Qs(fn,gn)}function mu(e,t){var n=bt;bt|=2;var r=Bb();(fn!==e||gn!==t)&&(ws=null,ti(e,t));do try{cP();break}catch(a){zb(e,a)}while(!0);if(Qp(),bt=n,uu.current=r,sn!==null)throw Error(xe(261));return fn=null,gn=0,cn}function cP(){for(;sn!==null;)Vb(sn)}function dP(){for(;sn!==null&&!MC();)Vb(sn)}function Vb(e){var t=qb(e.alternate,e,tr);e.memoizedProps=e.pendingProps,t===null?Wb(e):sn=t,dg.current=null}function Wb(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=rP(n,t),n!==null){n.flags&=32767,sn=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{cn=6,sn=null;return}}else if(n=nP(n,t,tr),n!==null){sn=n;return}if(t=t.sibling,t!==null){sn=t;return}sn=t=e}while(t!==null);cn===0&&(cn=5)}function Va(e,t,n){var r=Ct,a=vr.transition;try{vr.transition=null,Ct=1,uP(e,t,n,r)}finally{vr.transition=a,Ct=r}return null}function uP(e,t,n,r){do ro();while(ia!==null);if(bt&6)throw Error(xe(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(xe(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(HC(e,i),e===fn&&(sn=fn=null,gn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||hd||(hd=!0,Yb(Kd,function(){return ro(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=vr.transition,vr.transition=null;var o=Ct;Ct=1;var l=bt;bt|=4,dg.current=null,aP(e,n),$b(n,e),RE(hm),Qd=!!um,hm=um=null,e.current=n,iP(n),IC(),bt=l,Ct=o,vr.transition=i}else e.current=n;if(hd&&(hd=!1,ia=e,fu=a),i=e.pendingLanes,i===0&&(pa=null),FC(n.stateNode),qn(e,rn()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],r(a.value,{componentStack:a.stack,digest:a.digest});if(hu)throw hu=!1,e=Dm,Dm=null,e;return fu&1&&e.tag!==0&&ro(),i=e.pendingLanes,i&1?e===Om?Pl++:(Pl=0,Om=e):Pl=0,Oa(),null}function ro(){if(ia!==null){var e=N0(fu),t=vr.transition,n=Ct;try{if(vr.transition=null,Ct=16>e?16:e,ia===null)var r=!1;else{if(e=ia,ia=null,fu=0,bt&6)throw Error(xe(331));var a=bt;for(bt|=4,Re=e.current;Re!==null;){var i=Re,o=i.child;if(Re.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var d=l[c];for(Re=d;Re!==null;){var u=Re;switch(u.tag){case 0:case 11:case 15:Cl(8,u,i)}var f=u.child;if(f!==null)f.return=u,Re=f;else for(;Re!==null;){u=Re;var m=u.sibling,w=u.return;if(Mb(u),u===d){Re=null;break}if(m!==null){m.return=w,Re=m;break}Re=w}}}var x=i.alternate;if(x!==null){var p=x.child;if(p!==null){x.child=null;do{var b=p.sibling;p.sibling=null,p=b}while(p!==null)}}Re=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,Re=o;else e:for(;Re!==null;){if(i=Re,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Cl(9,i,i.return)}var v=i.sibling;if(v!==null){v.return=i.return,Re=v;break e}Re=i.return}}var g=e.current;for(Re=g;Re!==null;){o=Re;var y=o.child;if(o.subtreeFlags&2064&&y!==null)y.return=o,Re=y;else e:for(o=g;Re!==null;){if(l=Re,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Zu(9,l)}}catch(N){en(l,l.return,N)}if(l===o){Re=null;break e}var j=l.sibling;if(j!==null){j.return=l.return,Re=j;break e}Re=l.return}}if(bt=a,Oa(),as&&typeof as.onPostCommitFiberRoot=="function")try{as.onPostCommitFiberRoot(Bu,e)}catch{}r=!0}return r}finally{Ct=n,vr.transition=t}}return!1}function Gx(e,t,n){t=So(n,t),t=Nb(e,t,1),e=ma(e,t,1),t=On(),e!==null&&(Ec(e,1,t),qn(e,t))}function en(e,t,n){if(e.tag===3)Gx(e,e,n);else for(;t!==null;){if(t.tag===3){Gx(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(pa===null||!pa.has(r))){e=So(n,e),e=Sb(t,e,1),t=ma(t,e,1),e=On(),t!==null&&(Ec(t,1,e),qn(t,e));break}}t=t.return}}function hP(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=On(),e.pingedLanes|=e.suspendedLanes&n,fn===e&&(gn&n)===n&&(cn===4||cn===3&&(gn&130023424)===gn&&500>rn()-hg?ti(e,0):ug|=n),qn(e,t)}function Hb(e,t){t===0&&(e.mode&1?(t=nd,nd<<=1,!(nd&130023424)&&(nd=4194304)):t=1);var n=On();e=Rs(e,t),e!==null&&(Ec(e,t,n),qn(e,n))}function fP(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Hb(e,n)}function mP(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(xe(314))}r!==null&&r.delete(t),Hb(e,n)}var qb;qb=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Wn.current)Un=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Un=!1,tP(e,t,n);Un=!!(e.flags&131072)}else Un=!1,qt&&t.flags&1048576&&Z0(t,su,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Md(e,t),e=t.pendingProps;var a=bo(t,Sn.current);no(t,n),a=ag(null,t,r,e,a,n);var i=ig();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Hn(r)?(i=!0,nu(t)):i=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,eg(t),a.updater=Ku,t.stateNode=a,a._reactInternals=t,bm(t,r,e,n),t=Nm(null,t,r,!0,i,n)):(t.tag=0,qt&&i&&Yp(t),Tn(null,t,a,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Md(e,t),e=t.pendingProps,a=r._init,r=a(r._payload),t.type=r,a=t.tag=gP(r),e=Sr(r,e),a){case 0:t=_m(null,t,r,e,n);break e;case 1:t=$x(null,t,r,e,n);break e;case 11:t=Ix(null,t,r,e,n);break e;case 14:t=Lx(null,t,r,Sr(r.type,e),n);break e}throw Error(xe(306,r,""))}return t;case 0:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Sr(r,a),_m(e,t,r,a,n);case 1:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Sr(r,a),$x(e,t,r,a,n);case 3:e:{if(Pb(t),e===null)throw Error(xe(387));r=t.pendingProps,i=t.memoizedState,a=i.element,nb(e,t),ou(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){a=So(Error(xe(423)),t),t=Fx(e,t,r,n,a);break e}else if(r!==a){a=So(Error(xe(424)),t),t=Fx(e,t,r,n,a);break e}else for(sr=fa(t.stateNode.containerInfo.firstChild),ar=t,qt=!0,Tr=null,n=eb(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(jo(),r===a){t=Ds(e,t,n);break e}Tn(e,t,r,n)}t=t.child}return t;case 5:return rb(t),e===null&&xm(t),r=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,o=a.children,fm(r,a)?o=null:i!==null&&fm(r,i)&&(t.flags|=32),Eb(e,t),Tn(e,t,o,n),t.child;case 6:return e===null&&xm(t),null;case 13:return Tb(e,t,n);case 4:return tg(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=_o(t,null,r,n):Tn(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Sr(r,a),Ix(e,t,r,a,n);case 7:return Tn(e,t,t.pendingProps,n),t.child;case 8:return Tn(e,t,t.pendingProps.children,n),t.child;case 12:return Tn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,a=t.pendingProps,i=t.memoizedProps,o=a.value,Dt(au,r._currentValue),r._currentValue=o,i!==null)if(Fr(i.value,o)){if(i.children===a.children&&!Wn.current){t=Ds(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){o=i.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=ks(-1,n&-n),c.tag=2;var d=i.updateQueue;if(d!==null){d=d.shared;var u=d.pending;u===null?c.next=c:(c.next=u.next,u.next=c),d.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),ym(i.return,n,t),l.lanes|=n;break}c=c.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(xe(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),ym(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}Tn(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=t.pendingProps.children,no(t,n),a=wr(a),r=r(a),t.flags|=1,Tn(e,t,r,n),t.child;case 14:return r=t.type,a=Sr(r,t.pendingProps),a=Sr(r.type,a),Lx(e,t,r,a,n);case 15:return kb(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Sr(r,a),Md(e,t),t.tag=1,Hn(r)?(e=!0,nu(t)):e=!1,no(t,n),_b(t,r,a),bm(t,r,a,n),Nm(null,t,r,!0,e,n);case 19:return Rb(e,t,n);case 22:return Cb(e,t,n)}throw Error(xe(156,t.tag))};function Yb(e,t){return w0(e,t)}function pP(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 pr(e,t,n,r){return new pP(e,t,n,r)}function gg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function gP(e){if(typeof e=="function")return gg(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Mp)return 11;if(e===Ip)return 14}return 2}function va(e,t){var n=e.alternate;return n===null?(n=pr(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.deleti
vendor: 4,552 bytes, line 40
40ons=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 $d(e,t,n,r,a,i){var o=2;if(r=e,typeof e=="function")gg(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ui:return ni(n.children,a,i,t);case Ap:o=8,a|=8;break;case Hf:return e=pr(12,n,t,a|2),e.elementType=Hf,e.lanes=i,e;case qf:return e=pr(13,n,t,a),e.elementType=qf,e.lanes=i,e;case Yf:return e=pr(19,n,t,a),e.elementType=Yf,e.lanes=i,e;case r0:return Ju(n,a,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case t0:o=10;break e;case n0:o=9;break e;case Mp:o=11;break e;case Ip:o=14;break e;case Gs:o=16,r=null;break e}throw Error(xe(130,e==null?e:typeof e,""))}return t=pr(o,n,t,a),t.elementType=e,t.type=r,t.lanes=i,t}function ni(e,t,n,r){return e=pr(7,e,r,t),e.lanes=n,e}function Ju(e,t,n,r){return e=pr(22,e,r,t),e.elementType=r0,e.lanes=n,e.stateNode={isHidden:!1},e}function uf(e,t,n){return e=pr(6,e,null,t),e.lanes=n,e}function hf(e,t,n){return t=pr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function vP(e,t,n,r,a){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=Hh(0),this.expirationTimes=Hh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Hh(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function vg(e,t,n,r,a,i,o,l,c){return e=new vP(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=pr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},eg(i),e}function xP(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Fi,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Gb(e){if(!e)return ba;e=e._reactInternals;e:{if(bi(e)!==e||e.tag!==1)throw Error(xe(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Hn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(xe(171))}if(e.tag===1){var n=e.type;if(Hn(n))return G0(e,n,t)}return t}function Kb(e,t,n,r,a,i,o,l,c){return e=vg(n,r,!0,e,a,i,o,l,c),e.context=Gb(null),n=e.current,r=On(),a=ga(n),i=ks(r,a),i.callback=t??null,ma(n,i,a),e.current.lanes=a,Ec(e,a,r),qn(e,r),e}function Xu(e,t,n,r){var a=t.current,i=On(),o=ga(a);return n=Gb(n),t.context===null?t.context=n:t.pendingContext=n,t=ks(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ma(a,t,o),e!==null&&(Ar(e,a,o,i),Dd(e,a,o)),o}function pu(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 Kx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function xg(e,t){Kx(e,t),(e=e.alternate)&&Kx(e,t)}function yP(){return null}var Zb=typeof reportError=="function"?reportError:function(e){console.error(e)};function yg(e){this._internalRoot=e}eh.prototype.render=yg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(xe(409));Xu(e,t,null,null)};eh.prototype.unmount=yg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;li(function(){Xu(null,e,null,null)}),t[Ts]=null}};function eh(e){this._internalRoot=e}eh.prototype.unstable_scheduleHydration=function(e){if(e){var t=C0();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Zs.length&&t!==0&&t<Zs[n].priority;n++);Zs.splice(n,0,e),n===0&&P0(e)}};function wg(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function th(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Zx(){}function wP(e,t,n,r,a){if(a){if(typeof r=="function"){var i=r;r=function(){var d=pu(o);i.call(d)}}var o=Kb(t,r,e,0,null,!1,!1,"",Zx);return e._reactRootContainer=o,e[Ts]=o.current,Vl(e.nodeType===8?e.parentNode:e),li(),o}for(;
vendor: 4,940 bytes, line 40
40a=e.lastChild;)e.removeChild(a);if(typeof r=="function"){var l=r;r=function(){var d=pu(c);l.call(d)}}var c=vg(e,0,!1,null,null,!1,!1,"",Zx);return e._reactRootContainer=c,e[Ts]=c.current,Vl(e.nodeType===8?e.parentNode:e),li(function(){Xu(t,c,n,r)}),c}function nh(e,t,n,r,a){var i=n._reactRootContainer;if(i){var o=i;if(typeof a=="function"){var l=a;a=function(){var c=pu(o);l.call(c)}}Xu(t,o,e,a)}else o=wP(n,t,e,a,r);return pu(o)}S0=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=fl(t.pendingLanes);n!==0&&(Fp(t,n|1),qn(t,rn()),!(bt&6)&&(ko=rn()+500,Oa()))}break;case 13:li(function(){var r=Rs(e,1);if(r!==null){var a=On();Ar(r,e,1,a)}}),xg(e,1)}};Up=function(e){if(e.tag===13){var t=Rs(e,134217728);if(t!==null){var n=On();Ar(t,e,134217728,n)}xg(e,134217728)}};k0=function(e){if(e.tag===13){var t=ga(e),n=Rs(e,t);if(n!==null){var r=On();Ar(n,e,t,r)}xg(e,t)}};C0=function(){return Ct};E0=function(e,t){var n=Ct;try{return Ct=e,t()}finally{Ct=n}};rm=function(e,t,n){switch(t){case"input":if(Zf(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 a=qu(r);if(!a)throw Error(xe(90));a0(r),Zf(r,a)}}}break;case"textarea":o0(e,n);break;case"select":t=n.value,t!=null&&Ji(e,!!n.multiple,t,!1)}};m0=fg;p0=li;var bP={usingClientEntryPoint:!1,Events:[Tc,Wi,qu,h0,f0,fg]},al={findFiberByHostInstance:Ga,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},jP={bundleType:al.bundleType,version:al.version,rendererPackageName:al.rendererPackageName,rendererConfig:al.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ls.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=x0(e),e===null?null:e.stateNode},findFiberByHostInstance:al.findFiberByHostInstance||yP,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 fd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fd.isDisabled&&fd.supportsFiber)try{Bu=fd.inject(jP),as=fd}catch{}}dr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=bP;dr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!wg(t))throw Error(xe(200));return xP(e,t,null,n)};dr.createRoot=function(e,t){if(!wg(e))throw Error(xe(299));var n=!1,r="",a=Zb;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=vg(e,1,!1,null,null,n,!1,r,a),e[Ts]=t.current,Vl(e.nodeType===8?e.parentNode:e),new yg(t)};dr.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(xe(188)):(e=Object.keys(e).join(","),Error(xe(268,e)));return e=x0(t),e=e===null?null:e.stateNode,e};dr.flushSync=function(e){return li(e)};dr.hydrate=function(e,t,n){if(!th(t))throw Error(xe(200));return nh(null,e,t,!0,n)};dr.hydrateRoot=function(e,t,n){if(!wg(e))throw Error(xe(405));var r=n!=null&&n.hydratedSources||null,a=!1,i="",o=Zb;if(n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=Kb(t,null,e,1,n??null,a,!1,i,o),e[Ts]=t.current,Vl(e),r)for(e=0;e<r.length;e++)n=r[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new eh(t)};dr.render=function(e,t,n){if(!th(t))throw Error(xe(200));return nh(null,e,t,!1,n)};dr.unmountComponentAtNode=function(e){if(!th(e))throw Error(xe(40));return e._reactRootContainer?(li(function(){nh(null,null,e,!1,function(){e._reactRootContainer=null,e[Ts]=null})}),!0):!1};dr.unstable_batchedUpdates=fg;dr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!th(n))throw Error(xe(200));if(e==null||e._reactInternals===void 0)throw Error(xe(38));return nh(e,t,n,!1,r)};dr.version="18.3.1-next-f1338f8080-20240426";function Qb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Qb)}catch(e){console.error(e)}}Qb(),Qw.exports=dr;var ji=Qw.exports;const Jb=$w(ji);var Xb,Qx=ji;Xb=Qx.createRoot,Qx.hydrateRoot;const _P=1,NP=1e6;let ff=0;function SP(){return ff=(ff+1)%Number.MAX_SAFE_INTEGER,ff.toString()}const mf=new Map,Jx=e=>{if(mf.has(e))return;const t=setTimeout(()=>{mf.delete(e),Tl({type:"REMOVE_TOAST",toastId:e})},NP);mf.set(e,t)},kP=(e,t)=>
40{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,_P)};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?Jx(n):e.toasts.forEach(r=>{Jx(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)}}},Fd=[];let Ud={toasts:[]};function Tl(e){Ud=kP(Ud,e),Fd.forEach(t=>{t(Ud)})}function Zr({...e}){const t=SP(),n=a=>Tl({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>Tl({type:"DISMISS_TOAST",toastId:t});return Tl({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}function _t(){const[e,t]=h.useState(Ud);return h.useEffect(()=>(Fd.push(t),()=>{const n=Fd.indexOf(t);n>-1&&Fd.splice(n,1)}),[e]),{...e,toast:Zr,dismiss:n=>Tl({type:"DISMISS_TOAST",toastId:n})}}function Le(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function CP(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ej(...e){return t=>e.forEach(n=>CP(n,t))}function wt(...e){return h.useCallback(ej(...e),e)}function EP(e,t=[]){let n=[];function r(i,o){const l=h.createContext(o),c=n.length;n=[...n,o];function d(f){const{scope:m,children:w,...x}=f,p=(m==null?void 0:m[e][c])||l,b=h.useMemo(()=>x,Object.values(x));return s.jsx(p.Provider,{value:b,children:w})}
vendor: 8,714 bytes, line 40
40function u(f,m){const w=(m==null?void 0:m[e][c])||l,x=h.useContext(w);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return d.displayName=i+"Provider",[d,u]}const a=()=>{const i=n.map(o=>h.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[r,PP(a,...t)]}function PP(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=r.reduce((l,{useScope:c,scopeName:d})=>{const f=c(i)[`__scope${d}`];return{...l,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var ja=h.forwardRef((e,t)=>{const{children:n,...r}=e,a=h.Children.toArray(n),i=a.find(TP);if(i){const o=i.props.children,l=a.map(c=>c===i?h.Children.count(o)>1?h.Children.only(null):h.isValidElement(o)?o.props.children:null:c);return s.jsx(Im,{...r,ref:t,children:h.isValidElement(o)?h.cloneElement(o,void 0,l):null})}return s.jsx(Im,{...r,ref:t,children:n})});ja.displayName="Slot";var Im=h.forwardRef((e,t)=>{const{children:n,...r}=e;if(h.isValidElement(n)){const a=DP(n);return h.cloneElement(n,{...RP(r,n.props),ref:t?ej(t,a):a})}return h.Children.count(n)>1?h.Children.only(null):null});Im.displayName="SlotClone";var bg=({children:e})=>s.jsx(s.Fragment,{children:e});function TP(e){return h.isValidElement(e)&&e.type===bg}function RP(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...l)=>{i(...l),a(...l)}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function DP(e){var r,a;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=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function jg(e){const t=e+"CollectionProvider",[n,r]=EP(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=w=>{const{scope:x,children:p}=w,b=be.useRef(null),v=be.useRef(new Map).current;return s.jsx(a,{scope:x,itemMap:v,collectionRef:b,children:p})};o.displayName=t;const l=e+"CollectionSlot",c=be.forwardRef((w,x)=>{const{scope:p,children:b}=w,v=i(l,p),g=wt(x,v.collectionRef);return s.jsx(ja,{ref:g,children:b})});c.displayName=l;const d=e+"CollectionItemSlot",u="data-radix-collection-item",f=be.forwardRef((w,x)=>{const{scope:p,children:b,...v}=w,g=be.useRef(null),y=wt(x,g),j=i(d,p);return be.useEffect(()=>(j.itemMap.set(g,{ref:g,...v}),()=>void j.itemMap.delete(g))),s.jsx(ja,{[u]:"",ref:y,children:b})});f.displayName=d;function m(w){const x=i(e+"CollectionConsumer",w);return be.useCallback(()=>{const b=x.collectionRef.current;if(!b)return[];const v=Array.from(b.querySelectorAll(`[${u}]`));return Array.from(x.itemMap.values()).sort((j,N)=>v.indexOf(j.ref.current)-v.indexOf(N.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:o,Slot:c,ItemSlot:f},m,r]}function OP(e,t){const n=h.createContext(t),r=i=>{const{children:o,...l}=i,c=h.useMemo(()=>l,Object.values(l));return s.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function a(i){const o=h.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,a]}function Hr(e,t=[]){let n=[];function r(i,o){const l=h.createContext(o),c=n.length;n=[...n,o];const d=f=>{var v;const{scope:m,children:w,...x}=f,p=((v=m==null?void 0:m[e])==null?void 0:v[c])||l,b=h.useMemo(()=>x,Object.values(x));return s.jsx(p.Provider,{value:b,children:w})};d.displayName=i+"Provider";function u(f,m){var p;const w=((p=m==null?void 0:m[e])==null?void 0:p[c])||l,x=h.useContext(w);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[d,u]}const a=()=>{const i=n.map(o=>h.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[r,AP(a,...t)]}function AP(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=r.reduce((l,{useScope:c,scopeName:d})=>{const f=c(i)[`__scope${d}`];return{...l,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var MP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ye=MP.reduce((e,t)=>{const n=h.forwardRef((r,a)=>{const{asChild:i,...o}=r,l=i?ja:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(l,{...o,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function tj(e,t){e&&ji.flushSync(()=>e.dispatchEvent(t))}function Gn(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function IP(e,t=globalThis==null?void 0:globalThis.document){const n=Gn(e);h.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var LP="DismissableLayer",Lm="dismissableLayer.update",$P="dismissableLayer.pointerDownOutside",FP="dismissableLayer.focusOutside",Xx,nj=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),zo=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...c}=e,d=h.useContext(nj),[u,f]=h.useState(null),m=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,w]=h.useState({}),x=wt(t,C=>f(C)),p=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),v=p.indexOf(b),g=u?p.indexOf(u):-1,y=d.layersWithOutsidePointerEventsDisabled.size>0,j=g>=v,N=zP(C=>{const E=C.target,H=[...d.branches].some(A=>A.contains(E));!j||H||(a==null||a(C),o==null||o(C),C.defaultPrevented||l==null||l())},m),k=BP(C=>{const E=C.target;[...d.branches].some(A=>A.contains(E))||(i==null||i(C),o==null||o(C),C.defaultPrevented||l==null||l())},m);return IP(C=>{g===d.layers.size-1&&(r==null||r(C),!C.defaultPrevented&&l&&(C.preventDefault(),l()))},m),h.useEffect(()=>{if(u)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Xx=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),ey(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Xx)}},[u,m,n,d]),h.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),ey())},[u,d]),h.useEffect(()=>{const C=()=>w({});return document.addEventListener(Lm,C),()=>document.removeEventListener(Lm,C)},[]),s.jsx(Ye.div,{...c,ref:x,style:{pointerEvents:y?j?"auto":"none":void 0,...e.style},onFocusCapture:Le(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Le(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Le(e.onPointerDownCapture,N.onPointerDownCapture)})});zo.displayName=LP;var UP="DismissableLayerBranch",rj=h.forwardRef((e,t)=>{const n=h.useContext(nj),r=h.useRef(null),a=wt(t,r);return h.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),s.jsx(Ye.div,{...e,ref:a})});rj.displayName=UP;function zP(e,t=globalThis==null?void 0:globalThis.document){const n=Gn(e),r=h.useRef(!1),a=h.useRef(()=>{});return h.useEffect(()=>{const i=l=>{if(l.target&&!r.current){let c=function(){sj($P,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=c,t.addEventListener("click",a.current,{once:!0})):c()}else t.removeEventListener("click",a.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function BP(e,t=globalThis==null?void 0:globalThis.document){const n=Gn(e),r=h.useRef(!1);return h.useEffect(()=>{const a=i=>{i.target&&!r.current&&sj(FP,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ey(){const e=new CustomEvent(Lm);document.dispatchEvent(e)}function sj(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?tj(a,i):a.dispatchEvent(i)}
40var VP=zo,WP=rj,kn=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},HP="Portal",Dc=h.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[a,i]=h.useState(!1);kn(()=>i(!0),[]);const o=n||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?Jb.createPortal(s.jsx(Ye.div,{...r,ref:t}),o):null});Dc.displayName=HP;function qP(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var qr=e=>{const{present:t,children:n}=e,r=YP(t),a=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),i=wt(r.ref,GP(a));return typeof n=="function"||r.isPresent?h.cloneElement(a,{ref:i}):null};qr.displayName="Presence";function YP(e){const[t,n]=h.useState(),r=h.useRef({}),a=h.useRef(e),i=h.useRef("none"),o=e?"mounted":"unmounted",[l,c]=qP(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const d=md(r.current);i.current=l==="mounted"?d:"none"},[l]),kn(()=>{const d=r.current,u=a.current;if(u!==e){const m=i.current,w=md(d);e?c("MOUNT"):w==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(u&&m!==w?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,c]),kn(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,f=w=>{const p=md(r.current).includes(w.animationName);if(w.target===t&&p&&(c("ANIMATION_END"),!a.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},m=w=>{w.target===t&&(i.current=md(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:h.useCallback(d=>{d&&(r.current=getComputedStyle(d)),n(d)},[])}}function md(e){return(e==null?void 0:e.animationName)||"none"}function GP(e){var r,a;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=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function cs({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,a]=KP({defaultProp:t,onChange:n}),i=e!==void 0,o=i?e:r,l=Gn(n),c=h.useCallback(d=>{if(i){const f=typeof d=="function"?d(e):d;f!==e&&l(f)}else a(d)},[i,e,a,l]);return[o,c]}function KP({defaultProp:e,onChange:t}){const n=h.useState(e),[r]=n,a=h.useRef(r),i=Gn(t);return h.useEffect(()=>{a.current!==r&&(i(r),a.current=r)},[r,a,i]),n}var ZP="VisuallyHidden",Oc=h.forwardRef((e,t)=>s.jsx(Ye.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Oc.displayName=ZP;var QP=Oc,_g="ToastProvider",[Ng,JP,XP]=jg("Toast"),[aj,P6]=Hr("Toast",[XP]),[e2,rh]=aj(_g),ij=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:a="right",swipeThreshold:i=50,children:o}=e,[l,c]=h.useState(null),[d,u]=h.useState(0),f=h.useRef(!1),m=h.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${_g}\`. Expected non-empty \`string\`.`),s.jsx(Ng.Provider,{scope:t,children:s.jsx(e2,{scope:t,label:n,duration:r,swipeDirection:a,swipeThreshold:i,toastCount:d,viewport:l,onViewportChange:c,onToastAdd:h.useCallback(()=>u(w=>w+1),[]),onToastRemove:h.useCallback(()=>u(w=>w-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:m,children:o})})};ij.displayName=_g;var oj="ToastViewport",t2=["F8"],$m="toast.viewportPause",Fm="toast.viewportResume",lj=h.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=t2,label:a="Notifications ({hotkey})",...i}=e,o=rh(oj,n),l=JP(n),c=h.useRef(null),d=h.useRef(null),u=h.useRef(null),f=h.useRef(null),m=wt(t,f,o.onViewportChange),w=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),x=o.toastCount>0;h.useEffect(()=>{const b=v=>{var y;r.length!==0&&r.every(j=>v[j]||v.code===j)&&((y=f.current)==null||y.focus())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[r]),h.useEffect(()=>{const b=c.current,v=f.current;if(x&&b&&v){const g=()=>{if(!o.isClosePausedRef.current){const k=new CustomEvent($m);v.dispatchEvent(k),o.isClosePausedRef.current=!0}},y=()=>
40{if(o.isClosePausedRef.current){const k=new CustomEvent(Fm);v.dispatchEvent(k),o.isClosePausedRef.current=!1}},j=k=>{!b.contains(k.relatedTarget)&&y()},N=()=>{b.contains(document.activeElement)||y()};return b.addEventListener("focusin",g),b.addEventListener("focusout",j),b.addEventListener("pointermove",g),b.addEventListener("pointerleave",N),window.addEventListener("blur",g),window.addEventListener("focus",y),()=>{b.removeEventListener("focusin",g),b.removeEventListener("focusout",j),b.removeEventListener("pointermove",g),b.removeEventListener("pointerleave",N),window.removeEventListener("blur",g),window.removeEventListener("focus",y)}}},[x,o.isClosePausedRef]);const p=h.useCallback(({tabbingDirection:b})=>{const g=l().map(y=>{const j=y.ref.current,N=[j,...m2(j)];return b==="forwards"?N:N.reverse()});return(b==="forwards"?g.reverse():g).flat()},[l]);return h.useEffect(()=>{const b=f.current;if(b){const v=g=>{var N,k,C;const y=g.altKey||g.ctrlKey||g.metaKey;if(g.key==="Tab"&&!y){const E=document.activeElement,H=g.shiftKey;if(g.target===b&&H){(N=d.current)==null||N.focus();return}const U=p({tabbingDirection:H?"backwards":"forwards"}),ae=U.findIndex(q=>q===E);pf(U.slice(ae+1))?g.preventDefault():H?(k=d.current)==null||k.focus():(C=u.current)==null||C.focus()}};return b.addEventListener("keydown",v),()=>b.removeEventListener("keydown",v)}},[l,p]),s.jsxs(WP,{ref:c,role:"region","aria-label":a.replace("{hotkey}",w),tabIndex:-1,style:{pointerEvents:x?void 0:"none"},children:[x&&s.jsx(Um,{ref:d,onFocusFromOutsideViewport:()=>{const b=p({tabbingDirection:"forwards"});pf(b)}}),s.jsx(Ng.Slot,{scope:n,children:s.jsx(Ye.ol,{tabIndex:-1,...i,ref:m})}),x&&s.jsx(Um,{ref:u,onFocusFromOutsideViewport:()=>{const b=p({tabbingDirection:"backwards"});pf(b)}})]})});lj.displayName=oj;var cj="ToastFocusProxy",Um=h.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,i=rh(cj,n);return s.jsx(Oc,{"aria-hidden":!0,tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:o=>{var d;const l=o.relatedTarget;!((d=i.viewport)!=null&&d.contains(l))&&r()}})});Um.displayName=cj;var sh="Toast",n2="toast.swipeStart",r2="toast.swipeMove",s2="toast.swipeCancel",a2="toast.swipeEnd",dj=h.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:i,...o}=e,[l=!0,c]=cs({prop:r,defaultProp:a,onChange:i});return s.jsx(qr,{present:n||l,children:s.jsx(l2,{open:l,...o,ref:t,onClose:()=>c(!1),onPause:Gn(e.onPause),onResume:Gn(e.onResume),onSwipeStart:Le(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Le(e.onSwipeMove,d=>{const{x:u,y:f}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:Le(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Le(e.onSwipeEnd,d=>{const{x:u,y:f}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),c(!1)})})})});dj.displayName=sh;var[i2,o2]=aj(sh,{onClose(){}}),l2=h.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:a,open:i,onClose:o,onEscapeKeyDown:l,onPause:c,onResume:d,onSwipeStart:u,onSwipeMove:f,onSwipeCancel:m,onSwipeEnd:w,...x}=e,p=rh(sh,n),[b,v]=h.useState(null),g=wt(t,q=>v(q)),y=h.useRef(null),j=h.useRef(null),N=a||p.duration,k=h.useRef(0),C=h.useRef(N),E=h.useRef(0),{onToastAdd:H,onToastRemove:A}=p,F=Gn(()=>{var se;(b==null?void 0:b.contains(document.activeElement))&&((se=p.viewport)==null||se.focu
40s()),o()}),U=h.useCallback(q=>{!q||q===1/0||(window.clearTimeout(E.current),k.current=new Date().getTime(),E.current=window.setTimeout(F,q))},[F]);h.useEffect(()=>{const q=p.viewport;if(q){const se=()=>{U(C.current),d==null||d()},D=()=>{const T=new Date().getTime()-k.current;C.current=C.current-T,window.clearTimeout(E.current),c==null||c()};return q.addEventListener($m,D),q.addEventListener(Fm,se),()=>{q.removeEventListener($m,D),q.removeEventListener(Fm,se)}}},[p.viewport,N,c,d,U]),h.useEffect(()=>{i&&!p.isClosePausedRef.current&&U(N)},[i,N,p.isClosePausedRef,U]),h.useEffect(()=>(H(),()=>A()),[H,A]);const ae=h.useMemo(()=>b?vj(b):null,[b]);return p.viewport?s.jsxs(s.Fragment,{children:[ae&&s.jsx(c2,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:ae}),s.jsx(i2,{scope:n,onClose:F,children:ji.createPortal(s.jsx(Ng.ItemSlot,{scope:n,children:s.jsx(VP,{asChild:!0,onEscapeKeyDown:Le(l,()=>{p.isFocusedToastEscapeKeyDownRef.current||F(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(Ye.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":p.swipeDirection,...x,ref:g,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Le(e.onKeyDown,q=>{q.key==="Escape"&&(l==null||l(q.nativeEvent),q.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,F()))}),onPointerDown:Le(e.onPointerDown,q=>{q.button===0&&(y.current={x:q.clientX,y:q.clientY})}),onPointerMove:Le(e.onPointerMove,q=>{if(!y.current)return;const se=q.clientX-y.current.x,D=q.clientY-y.current.y,T=!!j.current,_=["left","right"].includes(p.swipeDirection),O=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,G=_?O(0,se):0,Y=_?0:O(0,D),oe=q.pointerType==="touch"?10:2,M={x:G,y:Y},I={originalEvent:q,delta:M};T?(j.current=M,pd(r2,f,I,{discrete:!1})):ty(M,p.swipeDirection,oe)?(j.current=M,pd(n2,u,I,{discrete:!1}),q.target.setPointerCapture(q.pointerId)):(Math.abs(se)>oe||Math.abs(D)>oe)&&(y.current=null)}),onPointerUp:Le(e.onPointerUp,q=>{const se=j.current,D=q.target;if(D.hasPointerCapture(q.pointerId)&&D.releasePointerCapture(q.pointerId),j.current=null,y.current=null,se){const T=q.currentTarget,_={originalEvent:q,delta:se};ty(se,p.swipeDirection,p.swipeThreshold)?pd(a2,w,_,{discrete:!0}):pd(s2,m,_,{discrete:!0}),T.addEventListener("click",O=>O.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),c2=e=>{const{__scopeToast:t,children:n,...r}=e,a=rh(sh,t),[i,o]=h.useState(!1),[l,c]=h.useState(!1);return h2(()=>o(!0)),h.useEffect(()=>{const d=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(d)},[]),l?null:s.jsx(Dc,{asChild:!0,children:s.jsx(Oc,{...r,children:i&&s.jsxs(s.Fragment,{children:[a.label," ",n]})})})},d2="ToastTitle",uj=h.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(Ye.div,{...r,ref:t})});uj.displayName=d2;var u2="ToastDescription",hj=h.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(Ye.div,{...r,ref:t})});hj.displayName=u2;var fj="ToastAction",mj=h.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?s.jsx(gj,{altText:n,asChild:!0,children:s.jsx(Sg,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${fj}\`. Expected non-empty \`string\`.`),null)});mj.displayName=fj;var pj="ToastClose",Sg=h.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=o2(pj,n);return s.jsx(gj,{asChild:!0,children:s.jsx(Ye.button,{type:"button",...r,ref:t,onClick:Le(e.onClick,a.onClose)})})});Sg.displayName=pj;var gj=h.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return s.jsx(Ye.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function vj(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),f2(r)){const a=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!a)if(i){const o=r.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...vj(r))}}),t}function pd(e,t,n,{discrete:r}){const a=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?tj(a,i):a.dispatchEvent(i)}var ty=(e,t,n=0)=>{const r=Math.abs(e.x),a=Math.abs(e.y),i=r>a;return t==="left"||t==="right"?i&&r>n:!i&&a>n};function h2(e=()=>{}){const t=Gn(e);kn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}
vendor: 8,385 bytes, lines 40-149
40function f2(e){return e.nodeType===e.ELEMENT_NODE}function m2(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function pf(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var p2=ij,xj=lj,yj=dj,wj=uj,bj=hj,jj=mj,_j=Sg;function Nj(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=Nj(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Sj(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=Nj(e))&&(r&&(r+=" "),r+=t);return r}const ny=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ry=Sj,Ac=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return ry(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:i}=t,o=Object.keys(a).map(d=>{const u=n==null?void 0:n[d],f=i==null?void 0:i[d];if(u===null)return null;const m=ny(u)||ny(f);return a[d][m]}),l=n&&Object.entries(n).reduce((d,u)=>{let[f,m]=u;return m===void 0||(d[f]=m),d},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,u)=>{let{class:f,className:m,...w}=u;return Object.entries(w).every(x=>{let[p,b]=x;return Array.isArray(b)?b.includes({...i,...l}[p]):{...i,...l}[p]===b})?[...d,f,m]:d},[]);return ry(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)};/** 41 * @license lucide-react v0.462.0 - ISC 42 * 43 * This source code is licensed under the ISC license. 44 * See the LICENSE file in the root directory of this source tree. 45 */const g2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),kj=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** 46 * @license lucide-react v0.462.0 - ISC 47 * 48 * This source code is licensed under the ISC license. 49 * See the LICENSE file in the root directory of this source tree. 50 */var v2={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"};/** 51 * @license lucide-react v0.462.0 - ISC 52 * 53 * This source code is licensed under the ISC license. 54 * See the LICENSE file in the root directory of this source tree. 55 */const x2=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:o,...l},c)=>h.createElement("svg",{ref:c,...v2,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:kj("lucide",a),...l},[...o.map(([d,u])=>h.createElement(d,u)),...Array.isArray(i)?i:[i]]));/** 56 * @license lucide-react v0.462.0 - ISC 57 * 58 * This source code is licensed under the ISC license. 59 * See the LICENSE file in the root directory of this source tree. 60 */const Ue=(e,t)=>{const n=h.forwardRef(({className:r,...a},i)=>h.createElement(x2,{ref:i,iconNode:t,className:kj(`lucide-${g2(e)}`,r),...a}));return n.displayName=`${e}`,n};/** 61 * @license lucide-react v0.462.0 - ISC 62 * 63 * This source code is licensed under the ISC license. 64 * See the LICENSE file in the root directory of this source tree. 65 */const Kn=Ue("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** 66 * @license lucide-react v0.462.0 - ISC 67 * 68 * This source code is licensed under the ISC license. 69 * See the LICENSE file in the root directory of this source tree. 70 */const y2=Ue("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** 71 * @license lucide-react v0.462.0 - ISC 72 * 73 * This source code is licensed under the ISC license. 74 * See the LICENSE file in the root directory of this source tree. 75 */const w2=Ue("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/** 76 * @license lucide-react v0.462.0 - ISC 77 * 78 * This source code is licensed under the ISC license. 79 * See the LICENSE file in the root directory of this source tree. 80 */const zm=Ue("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/** 81 * @license lucide-react v0.462.0 - ISC 82 * 83 * This source code is licensed under the ISC license. 84 * See the LICENSE file in the root directory of this source tree. 85 */const rr=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"}]]);/** 86 * @license lucide-react v0.462.0 - ISC 87 * 88 * This source code is licensed under the ISC license. 89 * See the LICENSE file in the root directory of this source tree. 90 */const zd=Ue("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/** 91 * @license lucide-react v0.462.0 - ISC 92 * 93 * This source code is licensed under the ISC license. 94 * See the LICENSE file in the root directory of this source tree. 95 */const b2=Ue("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** 96 * @license lucide-react v0.462.0 - ISC 97 * 98 * This source code is licensed under the ISC license. 99 * See the LICENSE file in the root directory of this source tree. 100 */const gr=Ue("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 101 * @license lucide-react v0.462.0 - ISC 102 * 103 * This source code is licensed under the ISC license. 104 * See the LICENSE file in the root directory of this source tree. 105 */const Cj=Ue("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 106 * @license lucide-react v0.462.0 - ISC 107 * 108 * This source code is licensed under the ISC license. 109 * See the LICENSE file in the root directory of this source tree. 110 */const Ej=Ue("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** 111 * @license lucide-react v0.462.0 - ISC 112 * 113 * This source code is licensed under the ISC license. 114 * See the LICENSE file in the root directory of this source tree. 115 */const Pj=Ue("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 116 * @license lucide-react v0.462.0 - ISC 117 * 118 * This source code is licensed under the ISC license. 119 * See the LICENSE file in the root directory of this source tree. 120 */const j2=Ue("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 121 * @license lucide-react v0.462.0 - ISC 122 * 123 * This source code is licensed under the ISC license. 124 * See the LICENSE file in the root directory of this source tree. 125 */const ci=Ue("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** 126 * @license lucide-react v0.462.0 - ISC 127 * 128 * This source code is licensed under the ISC license. 129 * See the LICENSE file in the root directory of this source tree. 130 */const gd=Ue("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 131 * @license lucide-react v0.462.0 - ISC 132 * 133 * This source code is licensed under the ISC license. 134 * See the LICENSE file in the root directory of this source tree. 135 */const _2=Ue("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** 136 * @license lucide-react v0.462.0 - ISC 137 * 138 * This source code is licensed under the ISC license. 139 * See the LICENSE file in the root directory of this source tree. 140 */const N2=Ue("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** 141 * @license lucide-react v0.462.0 - ISC 142 * 143 * This source code is licensed under the ISC license. 144 * See the LICENSE file in the root directory of this source tree. 145 */const ah=Ue("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** 146 * @license lucide-react v0.462.0 - ISC 147 * 148 * This source code is licensed under the ISC license. 149 * See the LICENSE file in the root directory of this source tree.
150 */const gu=Ue("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** 151 * @license lucide-react v0.462.0 - ISC 152 * 153 * This source code is licensed under the ISC license. 154 * See the LICENSE file in the root directory of this source tree. 155 */const kg=Ue("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/** 156 * @license lucide-react v0.462.0 - ISC 157 * 158 * This source code is licensed under the ISC license. 159 * See the LICENSE file in the root directory of this source tree. 160 */const di=Ue("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** 161 * @license lucide-react v0.462.0 - ISC 162 * 163 * This source code is licensed under the ISC license. 164 * See the LICENSE file in the root directory of this source tree. 165 */const Co=Ue("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** 166 * @license lucide-react v0.462.0 - ISC 167 * 168 * This source code is licensed under the ISC license. 169 * See the LICENSE file in the root directory of this source tree. 170 */const ui=Ue("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** 171 * @license lucide-react v0.462.0 - ISC 172 * 173 * This source code is licensed under the ISC license. 174 * See the LICENSE file in the root directory of this source tree. 175 */const Os=Ue("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 176 * @license lucide-react v0.462.0 - ISC 177 * 178 * This source code is licensed under the ISC license. 179 * See the LICENSE file in the root directory of this source tree. 180 */const S2=Ue("Facebook",[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]]);/** 181 * @license lucide-react v0.462.0 - ISC 182 * 183 * This source code is licensed under the ISC license. 184 * See the LICENSE file in the root directory of this source tree. 185 */const k2=Ue("FileDown",[["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:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/** 186 * @license lucide-react v0.462.0 - ISC 187 * 188 * This source code is licensed under the ISC license. 189 * See the LICENSE file in the root directory of this source tree. 190 */const C2=Ue("FileImage",[["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"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]);/** 191 * @license lucide-react v0.462.0 - ISC 192 * 193 * This source code is licensed under the ISC license. 194 * See the LICENSE file in the root directory of this source tree. 195 */const E2=Ue("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** 196 * @license lucide-react v0.462.0 - ISC 197 * 198 * This source code is licensed under the ISC license. 199 * See the LICENSE file in the root directory of this source tree. 200 */const Eo=Ue("Gift",[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]]);/** 201 * @license lucide-react v0.462.0 - ISC 202 * 203 * This source code is licensed under the ISC license. 204 * See the LICENSE file in the root directory of this source tree. 205 */const Tj=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"}]]);/** 206 * @license lucide-react v0.462.0 - ISC 207 * 208 * This source code is licensed under the ISC license. 209 * See the LICENSE file in the root directory of this source tree. 210 */const ih=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"}]]);/** 211 * @license lucide-react v0.462.0 - ISC 212 * 213 * This source code is licensed under the ISC license. 214 * See the LICENSE file in the root directory of this source tree. 215 */const sy=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"}]]);/** 216 * @license lucide-react v0.462.0 - ISC 217 * 218 * This source code is licensed under the ISC license. 219 * See the LICENSE file in the root directory of this source tree. 220 */const P2=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"}]]);/** 221 * @license lucide-react v0.462.0 - ISC 222 * 223 * This source code is licensed under the ISC license. 224 * See the LICENSE file in the root directory of this source tree. 225 */const T2=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"}]]);/** 226 * @license lucide-react v0.462.0 - ISC 227 * 228 * This source code is licensed under the ISC license. 229 * See the LICENSE file in the root directory of this source tree. 230 */const Rr=Ue("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 231 * @license lucide-react v0.462.0 - ISC 232 * 233 * This source code is licensed under the ISC license. 234 * See the LICENSE file in the root directory of this source tree. 235 */const R2=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"}]]);/** 236 * @license lucide-react v0.462.0 - ISC 237 * 238 * This source code is licensed under the ISC license. 239 * See the LICENSE file in the root directory of this source tree. 240 */const Rj=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"}]]);/** 241 * @license lucide-react v0.462.0 - ISC 242 * 243 * This source code is licensed under the ISC license. 244 * See the LICENSE file in the root directory of this source tree. 245 */const dn=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"}]]);/** 246 * @license lucide-react v0.462.0 - ISC 247 * 248 * This source code is licensed under the ISC license. 249 * See the LICENSE file in the root directory of this source tree. 250 */const Dj=Ue("Map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);/** 251 * @license lucide-react v0.462.0 - ISC 252 * 253 * This source code is licensed under the ISC license. 254 * See the LICENSE file in the root directory of this source tree.
255 */const Oj=Ue("Megaphone",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]]);/** 256 * @license lucide-react v0.462.0 - ISC 257 * 258 * This source code is licensed under the ISC license. 259 * See the LICENSE file in the root directory of this source tree. 260 */const D2=Ue("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/** 261 * @license lucide-react v0.462.0 - ISC 262 * 263 * This source code is licensed under the ISC license. 264 * See the LICENSE file in the root directory of this source tree. 265 */const pl=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"}]]);/** 266 * @license lucide-react v0.462.0 - ISC 267 * 268 * This source code is licensed under the ISC license. 269 * See the LICENSE file in the root directory of this source tree. 270 */const O2=Ue("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/** 271 * @license lucide-react v0.462.0 - ISC 272 * 273 * This source code is licensed under the ISC license. 274 * See the LICENSE file in the root directory of this source tree. 275 */const Aj=Ue("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** 276 * @license lucide-react v0.462.0 - ISC 277 * 278 * This source code is licensed under the ISC license. 279 * See the LICENSE file in the root directory of this source tree. 280 */const os=Ue("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** 281 * @license lucide-react v0.462.0 - ISC 282 * 283 * This source code is licensed under the ISC license. 284 * See the LICENSE file in the root directory of this source tree. 285 */const Mj=Ue("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** 286 * @license lucide-react v0.462.0 - ISC 287 * 288 * This source code is licensed under the ISC license. 289 * See the LICENSE file in the root directory of this source tree. 290 */const Ij=Ue("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/** 291 * @license lucide-react v0.462.0 - ISC 292 * 293 * This source code is licensed under the ISC license. 294 * See the LICENSE file in the root directory of this source tree. 295 */const A2=Ue("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/** 296 * @license lucide-react v0.462.0 - ISC 297 * 298 * This source code is licensed under the ISC license. 299 * See the LICENSE file in the root directory of this source tree. 300 */const oa=Ue("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/** 301 * @license lucide-react v0.462.0 - ISC 302 * 303 * This source code is licensed under the ISC license. 304 * See the LICENSE file in the root directory of this source tree. 305 */const vu=Ue("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/** 306 * @license lucide-react v0.462.0 - ISC 307 * 308 * This source code is licensed under the ISC license. 309 * See the LICENSE file in the root directory of this source tree.
310 */const M2=Ue("Store",[["path",{d:"m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7",key:"ztvudi"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["path",{d:"M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4",key:"2ebpfo"}],["path",{d:"M2 7h20",key:"1fcdvo"}],["path",{d:"M22 7v3a2 2 0 0 1-2 2a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12a2 2 0 0 1-2-2V7",key:"6c3vgh"}]]);/** 311 * @license lucide-react v0.462.0 - ISC 312 * 313 * This source code is licensed under the ISC license. 314 * See the LICENSE file in the root directory of this source tree. 315 */const Mr=Ue("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/** 316 * @license lucide-react v0.462.0 - ISC 317 * 318 * This source code is licensed under the ISC license. 319 * See the LICENSE file in the root directory of this source tree. 320 */const Lj=Ue("Ticket",[["path",{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",key:"qn84l0"}],["path",{d:"M13 5v2",key:"dyzc3o"}],["path",{d:"M13 17v2",key:"1ont0d"}],["path",{d:"M13 11v2",key:"1wjjxi"}]]);/** 321 * @license lucide-react v0.462.0 - ISC 322 * 323 * This source code is licensed under the ISC license. 324 * See the LICENSE file in the root directory of this source tree. 325 */const xr=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"}],["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"}]]);/** 326 * @license lucide-react v0.462.0 - ISC 327 * 328 * This source code is licensed under the ISC license. 329 * See the LICENSE file in the root directory of this source tree. 330 */const xu=Ue("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** 331 * @license lucide-react v0.462.0 - ISC 332 * 333 * This source code is licensed under the ISC license. 334 * See the LICENSE file in the root directory of this source tree. 335 */const I2=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"}]]);/** 336 * @license lucide-react v0.462.0 - ISC 337 * 338 * This source code is licensed under the ISC license. 339 * See the LICENSE file in the root directory of this source tree. 340 */const L2=Ue("Twitter",[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]]);/** 341 * @license lucide-react v0.462.0 - ISC 342 * 343 * This source code is licensed under the ISC license. 344 * See the LICENSE file in the root directory of this source tree. 345 */const hi=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"}]]);/** 346 * @license lucide-react v0.462.0 - ISC 347 * 348 * This source code is licensed under the ISC license. 349 * See the LICENSE file in the root directory of this source tree. 350 */const rs=Ue("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** 351 * @license lucide-react v0.462.0 - ISC 352 * 353 * This source code is licensed under the ISC license. 354 * See the LICENSE file in the root directory of this source tree. 355 */const $2=Ue("Youtube",[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]]),Cg="-",F2=e=>{const t=z2(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const l=o.split(Cg);return l[0]===""&&l.length!==1&&l.shift(),$j(l,t)||U2(o)},getConflictingClassGroupIds:(o,l)=>{const c=n[o]||[];return l&&r[o]?[...c,...r[o]]:c}}},$j=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?$j(e.slice(1),r):void 0;if(a)return a;
vendor: 5,459 bytes, line 355
355if(t.validators.length===0)return;const i=e.join(Cg);return(o=t.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},ay=/^\[(.+)\]$/,U2=e=>{if(ay.test(e)){const t=ay.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},z2=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return V2(Object.entries(e.classGroups),n).forEach(([i,o])=>{Bm(o,r,i,t)}),r},Bm=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:iy(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(B2(a)){Bm(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,o])=>{Bm(o,iy(t,i),n,r)})})},iy=(e,t)=>{let n=e;return t.split(Cg).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},B2=e=>e.isThemeGetter,V2=(e,t)=>t?e.map(([n,r])=>{const a=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,l])=>[t+o,l])):i);return[n,a]}):e,W2=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return a(i,o),o},set(i,o){n.has(i)?n.set(i,o):a(i,o)}}},Fj="!",H2=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,a=t[0],i=t.length,o=l=>{const c=[];let d=0,u=0,f;for(let b=0;b<l.length;b++){let v=l[b];if(d===0){if(v===a&&(r||l.slice(b,b+i)===t)){c.push(l.slice(u,b)),u=b+i;continue}if(v==="/"){f=b;continue}}v==="["?d++:v==="]"&&d--}const m=c.length===0?l:l.substring(u),w=m.startsWith(Fj),x=w?m.substring(1):m,p=f&&f>u?f-u:void 0;return{modifiers:c,hasImportantModifier:w,baseClassName:x,maybePostfixModifierPosition:p}};return n?l=>n({className:l,parseClassName:o}):o},q2=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},Y2=e=>({cache:W2(e.cacheSize),parseClassName:H2(e),...F2(e)}),G2=/\s+/,K2=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],o=e.trim().split(G2);let l="";for(let c=o.length-1;c>=0;c-=1){const d=o[c],{modifiers:u,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:w}=n(d);let x=!!w,p=r(x?m.substring(0,w):m);if(!p){if(!x){l=d+(l.length>0?" "+l:l);continue}if(p=r(m),!p){l=d+(l.length>0?" "+l:l);continue}x=!1}const b=q2(u).join(":"),v=f?b+Fj:b,g=v+p;if(i.includes(g))continue;i.push(g);const y=a(p,x);for(let j=0;j<y.length;++j){const N=y[j];i.push(v+N)}l=d+(l.length>0?" "+l:l)}return l};function Z2(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Uj(t))&&(r&&(r+=" "),r+=n);return r}const Uj=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Uj(e[r]))&&(n&&(n+=" "),n+=t);return n};function Q2(e,...t){let n,r,a,i=o;function o(c){const d=t.reduce((u,f)=>f(u),e());return n=Y2(d),r=n.cache.get,a=n.cache.set,i=l,l(c)}function l(c){const d=r(c);if(d)return d;const u=K2(c,n);return a(c,u),u}return function(){return i(Z2.apply(null,arguments))}}const Lt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},zj=/^\[(?:([a-z-]+):)?(.+)\]$/i,J2=/^\d+\/\d+$/,X2=new Set(["px","full","screen"]),eT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,tT=/\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$/,nT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,rT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,sT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ps=e=>so(e)||X2.has(e)||J2.test(e),zs=e=>Bo(e,"length",hT),so=e=>!!e&&!Number.isNaN(Number(e)),gf=e=>Bo(e,"number",so),il=e=>!!e&&Number.isInteger(Number(e)),aT=e=>e.endsWith("%")&&so(e.slice(0,-1)),rt=e=>zj.test(e),Bs=e=>eT.test(e),iT=new Set(["length","size","percentage"]),oT=e=>Bo(e,iT,Bj),lT=e=>Bo(e,"position",Bj),cT=new Set(["image","url"]),dT=e=>Bo(e,cT,mT),uT=e=>Bo(e,"",fT),ol=()=>!0,Bo=(e,t,n)=>{const r=zj.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},hT=e=>tT.test(e)&&!nT.test(e),Bj=()=>!1,fT=e=>rT.test(e),mT=e=>sT.test(e),pT=()=>{const e=Lt("colors"),t=Lt("spacing"),n=Lt("blur"),r=Lt("brightness"),a=Lt("borderColor"),i=Lt("borderRadius"),o=Lt("borderSpacing"),l=Lt("borderWidth"),c=Lt("contrast"),d=Lt("grayscale"),u=Lt("hueRotate"),f=Lt("invert"),m=Lt("gap"),w=Lt("gradientColorStops"),x=Lt("gradientColorStopPositions"),p=Lt("inset"),b=Lt("margin"),v=Lt("opacity"),g=Lt("padding"),y=Lt("saturate"),j=Lt("scale"),N=Lt("sepia"),k=Lt("skew"),C=Lt("space"),E=Lt("translate"),H=()=>["auto","contain","none"],A=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",rt,t],U=()=>[rt,t],ae=()=>["",ps,zs],q=()=>["auto",so,rt],se=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],D=()=>["solid","dashed","dotted","double","none"],T=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],_=()=>["start","end","center","between","around","evenly","stretch"],O=()=>["","0",rt],G=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Y=()=>[so,rt];return{cacheSize:500,separator:":",theme:{colors:[ol],spacing:[ps,zs],blur:["none","",Bs,rt],brightness:Y(),borderColor:[e],borderRadius:["n
355one","","full",Bs,rt],borderSpacing:U(),borderWidth:ae(),contrast:Y(),grayscale:O(),hueRotate:Y(),invert:O(),gap:U(),gradientColorStops:[e],gradientColorStopPositions:[aT,zs],inset:F(),margin:F(),opacity:Y(),padding:U(),saturate:Y(),scale:Y(),sepia:O(),skew:Y(),space:U(),translate:U()},classGroups:{aspect:[{aspect:["auto","square","video",rt]}],container:["container"],columns:[{columns:[Bs]}],"break-after":[{"break-after":G()}],"break-before":[{"break-before":G()}],"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:[...se(),rt]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:H()}],"overscroll-x":[{"overscroll-x":H()}],"overscroll-y":[{"overscroll-y":H()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",il,rt]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",rt]}],grow:[{grow:O()}],shrink:[{shrink:O()}],order:[{order:["first","last","none",il,rt]}],"grid-cols":[{"grid-cols":[ol]}],"col-start-end":[{col:["auto",{span:["full",il,rt]},rt]}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":[ol]}],"row-start-end":[{row:["auto",{span:[il,rt]},rt]}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",rt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",rt]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",..._()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",..._(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[..._(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",rt,t]}],"min-w":[{"min-w":[rt,t,"min","max","fit"]}],"max-w":[{"max-w":[rt,t,"none","full","min","max","fit","prose",{screen:[Bs]},Bs]}],h:[{h:[rt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[rt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[rt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[rt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Bs,zs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",gf]}],"font-family":[{font:[ol]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",rt]}],"line-clamp":[{"line-clamp":["none",so,gf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ps,rt]}],"list-image":[{"list-image":["none",rt]}],"list-style-type":[{list:["none","disc","decimal",rt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...D(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ps,zs]}],"underline-offset":[{"underline-offset":["auto",ps,rt]}],"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:U()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",rt]}],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",rt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...se(),lT]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",oT]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},dT]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}
vendor: 5,181 bytes, line 355
355],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[w]}],"gradient-via":[{via:[w]}],"gradient-to":[{to:[w]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"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":[v]}],"border-style":[{border:[...D(),"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":[v]}],"divide-style":[{divide:D()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...D()]}],"outline-offset":[{"outline-offset":[ps,rt]}],"outline-w":[{outline:[ps,zs]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[ps,zs]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Bs,uT]}],"shadow-color":[{shadow:[ol]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...T(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":T()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Bs,rt]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[y]}],sepia:[{sepia:[N]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[N]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",rt]}],duration:[{duration:Y()}],ease:[{ease:["linear","in","out","in-out",rt]}],delay:[{delay:Y()}],animate:[{animate:["none","spin","ping","pulse","bounce",rt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[il,rt]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",rt]}],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",rt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"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"]}
vendor: 4,647 bytes, line 355
355],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",rt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ps,zs,gf]}],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"]}}},gT=Q2(pT);function ke(...e){return gT(Sj(e))}const vT=p2,Vj=h.forwardRef(({className:e,...t},n)=>s.jsx(xj,{ref:n,className:ke("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}));Vj.displayName=xj.displayName;const xT=Ac("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"}}),Wj=h.forwardRef(({className:e,variant:t,...n},r)=>s.jsx(yj,{ref:r,className:ke(xT({variant:t}),e),...n}));Wj.displayName=yj.displayName;const Eg=h.forwardRef(({className:e,...t},n)=>s.jsx(jj,{ref:n,className:ke("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 hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));Eg.displayName=jj.displayName;const Hj=h.forwardRef(({className:e,...t},n)=>s.jsx(_j,{ref:n,className:ke("absolute right-2 top-2 rounded-md p-1 text-foreground
355/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:s.jsx(rs,{className:"h-4 w-4"})}));Hj.displayName=_j.displayName;const qj=h.forwardRef(({className:e,...t},n)=>s.jsx(wj,{ref:n,className:ke("text-sm font-semibold",e),...t}));qj.displayName=wj.displayName;const Yj=h.forwardRef(({className:e,...t},n)=>s.jsx(bj,{ref:n,className:ke("text-sm opacity-90",e),...t}));Yj.displayName=bj.displayName;function yT(){const{toasts:e}=_t();return s.jsxs(vT,{children:[e.map(function({id:t,title:n,description:r,action:a,...i}){return s.jsxs(Wj,{...i,children:[s.jsxs("div",{className:"grid gap-1",children:[n&&s.jsx(qj,{children:n}),r&&s.jsx(Yj,{children:r})]}),a,s.jsx(Hj,{})]},t)}),s.jsx(Vj,{})]})}var oy=["light","dark"],wT="(prefers-color-scheme: dark)",bT=h.createContext(void 0),jT={setTheme:e=>{},themes:[]},_T=()=>{var e;return(e=h.useContext(bT))!=null?e:jT};h.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:a,defaultTheme:i,value:o,attrs:l,nonce:c})=>{let d=i==="system",u=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(x=>`'${x}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,f=a?oy.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",m=(x,p=!1,b=!0)=>{let v=o?o[x]:x,g=p?x+"|| ''":`'${v}'`,y="";return a&&b&&!p&&oy.includes(x)&&(y+=`d.style.colorScheme = '${x}';`),n==="class"?p||v?y+=`c.add(${g})`:y+="null":v&&(y+=`d[s](n,${g})`),y},w=e?`!function(){${u}${m(e)}}()`:r?`!function(){try{${u}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${d})){var t='${wT}',m=window.matchMedia(t);if(m.media!==t||m.matches){${m("dark")}}else{${m("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${m(o?"x[e]":"e",!0)}}${d?"":"else{"+m(i,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${m(o?"x[e]":"e",!0)}}else{${m(i,!1,!1)};}${f}}catch(t){}}();`;return h.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:w}})});var NT=e=>{switch(e){case"success":return CT;case"info":return PT;case"warning":return ET;case"error":return TT;default:return null}},ST=Array(12).fill(0),kT=({visible:e})=>be.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},be.createElement("div",{className:"sonner-spinner"},ST.map((t,n)=>be.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),CT=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},be.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"})),ET=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},be.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"})),PT=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},be.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"})),TT=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},be.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"})),RT=()=>{let[e,t]=be.useState(document.hidden);return be.useEffect(()=>{let n=()=>{t(document.hidden)};
355return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Vm=1,DT=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,a=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Vm++,i=this.toasts.find(l=>l.id===a),o=e.dismissible===void 0?!0:e.dismissible;return i?this.toasts=this.toasts.map(l=>l.id===a?(this.publish({...l,...e,id:a,title:n}),{...l,...e,id:a,dismissible:o,title:n}):l):this.addToast({title:n,...r,dismissible:o,id:a}),a},this.dismiss=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)=>
355this.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(),a=n!==void 0;return r.then(async i=>{if(AT(i)&&!i.ok){a=!1;let o=typeof t.error=="function"?await t.error(`HTTP error! status: ${i.status}`):t.error,l=typeof t.description=="function"?await t.description(`HTTP error! status: ${i.status}`):t.description;this.create({id:n,type:"error",message:o,description:l})}else if(t.success!==void 0){a=!1;let o=typeof t.success=="function"?await t.success(i):t.success,l=typeof t.description=="function"?await t.description(i):t.description;this.create({id:n,type:"success",message:o,description:l})}}).catch(async i=>{if(t.error!==void 0){a=!1;let o=typeof t.error=="function"?await t.error(i):t.error,l=typeof t.description=="function"?await t.description(i):t.description;this.create({id:n,type:"error",message:o,description:l})}}).finally(()=>{var i;a&&(this.dismiss(n),n=void 0),(i=t.finally)==null||i.call(t)}),n},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||Vm++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},Jn=new DT,OT=(e,t)=>{let n=(t==null?void 0:t.id)||Vm++;return Jn.addToast({title:e,...t,id:n}),n},AT=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",MT=OT,IT=()=>Jn.toasts;Object.assign(MT,{success:Jn.success,info:Jn.info,warning:Jn.warning,error:Jn.error,custom:Jn.custom,message:Jn.message,promise:Jn.promise,dismiss:Jn.dismiss,loading:Jn.loading},{getHistory:IT});function LT(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))}LT(`: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}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-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;
355left: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;background:var(--gray1);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}: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:0;right:0;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}
355: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, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);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-border: hsl(0, 0%, 20%);--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%);--error-text: hsl(358, 100%, 81%)}[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%)} 356`);function vd(e){return e.label!==void 0}var $T=3,FT="32px",UT=4e3,zT=356,BT=14,VT=20,WT=200;function HT(...e){return e.filter(Boolean).join(" ")}var qT=e=>{var t,n,r,a,i,o,l,c,d,u;let{invert:f,toast:m,unstyled:w,interacting:x,setHeights:p,visibleToasts:b,heights:v,index:g,toasts:y,exp
356anded:j,removeToast:N,defaultRichColors:k,closeButton:C,style:E,cancelButtonStyle:H,actionButtonStyle:A,className:F="",descriptionClassName:U="",duration:ae,position:q,gap:se,loadingIcon:D,expandByDefault:T,classNames:_,icons:O,closeButtonAriaLabel:G="Close toast",pauseWhenPageIsHidden:Y,cn:oe}=e,[M,I]=be.useState(!1),[he,X]=be.useState(!1),[K,P]=be.useState(!1),[Z,ee]=be.useState(!1),[le,z]=be.useState(0),[_e,ue]=be.useState(0),De=be.useRef(null),Ve=be.useRef(null),lt=g===0,vt=g+1<=b,Qe=m.type,re=m.dismissible!==!1,ie=m.className||"",Ce=m.descriptionClassName||"",V=be.useMemo(()=>v.findIndex(Se=>Se.toastId===m.id)||0,[v,m.id]),ge=be.useMemo(()=>{var Se;return(Se=m.closeButton)!=null?Se:C},[m.closeButton,C]),Ne=be.useMemo(()=>m.duration||ae||UT,[m.duration,ae]),Pe=be.useRef(0),We=be.useRef(0),xt=be.useRef(0),Je=be.useRef(null),[It,on]=q.split("-"),tn=be.useMemo(()=>v.reduce((Se,He,Xe)=>Xe>=V?Se:Se+He.height,0),[v,V]),nn=RT(),En=m.invert||f,$=Qe==="loading";We.current=be.useMemo(()=>V*se+tn,[V,tn]),be.useEffect(()=>{I(!0)},[]),be.useLayoutEffect(()=>{if(!M)return;let Se=Ve.current,He=Se.style.height;Se.style.height="auto";let Xe=Se.getBoundingClientRect().height;Se.style.height=He,ue(Xe),p(je=>je.find(st=>st.toastId===m.id)?je.map(st=>st.toastId===m.id?{...st,height:Xe}:st):[{toastId:m.id,height:Xe,position:m.position},...je])},[M,m.title,m.description,p,m.id]);let ne=be.useCallback(()=>{X(!0),z(We.current),p(Se=>Se.filter(He=>He.toastId!==m.id)),setTimeout(()=>{N(m)},WT)},[m,N,p,We]);be.useEffect(()=>{if(m.promise&&Qe==="loading"||m.duration===1/0||m.type==="loading")return;let Se,He=Ne;return j||x||Y&&nn?(()=>{if(xt.current<Pe.current){let Xe=new Date().getTime()-Pe.current;He=He-Xe}xt.current=new Date().getTime()})():He!==1/0&&(Pe.current=new Date().getTime(),Se=setTimeout(()=>{var Xe;(Xe=m.onAutoClose)==null||Xe.call(m,m),ne()},He)),()=>clearTimeout(Se)},[j,x,T,m,Ne,ne,m.promise,Qe,Y,nn]),be.useEffect(()=>{let Se=Ve.current;if(Se){let He=Se.getBoundingClientRect().height;return ue(He),p(Xe=>[{toastId:m.id,height:He,position:m.position},...Xe]),()=>p(Xe=>Xe.filter(je=>je.toastId!==m.id))}},[p,m.id]),be.useEffect(()=>{m.delete&&ne()},[ne,m.delete]);function $e(){return O!=null&&O.loading?be.createElement("div",{className:"sonner-loader","data-visible":Qe==="loading"},O.loading):D?be.createElement("div",{className:"sonner-loader","data-visible":Qe==="loading"},D):be.createElement(kT,{visible:Qe==="loading"})}return be.createElement("li",{"aria-live":m.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:Ve,className:oe(F,ie,_==null?void 0:_.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,_==null?void 0:_.default,_==null?void 0:_[Qe],(n=m==null?void 0:m.classNames)==null?void 0:n[Qe]),"data-sonner-toast":"","data-rich-colors":(r=m.richColors)!=null?r:k,"data-styled":!(m.jsx||m.unstyled||w),"data-mounted":M,"data-promise":!!m.promise,"data-removed":he,"data-visible":vt,"data-y-position":It,"data-x-position":on,"data-index":g,"data-front":lt,"data-swiping":K,"data-dismissible":re,"data-type":Qe,"data-invert":En,"data-swipe-out":Z,"data-expanded":!!(j||T&&M),style:{"--index":g,"--toasts-before":g,"--z-index":y.length-g,"--offset":`${he?le:We.current}px`,"--initial-height":T?"auto":`${_e}px`,...E,...m.style},onPointerDown:Se=>{$||!re||(De.current=new Date,z(We.current),Se.target.setPointerCapture(Se.pointerId),Se.target.tagName!=="BUTTON"&&(P(!0),Je.current={x:Se.clientX,y:Se.clientY}))},onPointerUp:()=>{var Se,He,Xe,je;if(Z||!re)return;Je.current=null;let st=Number(((Se=Ve.current)==null?void 0:Se.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Yt=new Date().getTime()-((He=De.current)==null?void 0:He.getTime()),et=Math.abs(st)/Yt;if(Math.abs(st)>=VT||et>.11){z(We.current),(Xe=m.onDismiss)==null||Xe.call(m,m),ne(),ee(!0);return}(je=Ve.current)==null||je.style.setProperty("--swipe-amount","0px"),P(!1)},onPointerMove:Se=>{var He;if(!Je.current||!re)return;let Xe=Se.clientY-Je.current.y,je=Se.clientX-Je.current.x,st=(It==="top"?Math.min:Math.max)(0,Xe),Yt=Se.pointerType==="touch"?10:2;Math.abs(st)>Yt?(He=Ve.current)==null||He.style.setProperty("--swipe-amount",`${Xe}px`):Math.abs(je)>Yt&&(Je.current=null)}},ge&&!m.jsx?be.createElement("button",{"aria-label":G,"data-disabled":$,"data-close-button":!0,onClick:$||!re?()=>{}:()=>{var Se;ne(),(Se=m.onDismiss)==null||Se.call(m,m)},className:oe(_==null?void 0:_.closeButton,(a=m==null?void 0:m.classNames)==null?void 0:a.closeButton)},be.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"},be.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),be.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,m.jsx||be.isValidElement(m.title)?m.jsx||m.title:be.createElement(be.Fragment,null,Qe||m.icon||m.promise?be.createElement("div",{"data-icon":"",className:oe(_==null?void 0:_.icon,(i=m==null?void 0:m.classNames)==null?void 0:i.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||$e():null,m.type!=="loading"?m.
356icon||(O==null?void 0:O[Qe])||NT(Qe):null):null,be.createElement("div",{"data-content":"",className:oe(_==null?void 0:_.content,(o=m==null?void 0:m.classNames)==null?void 0:o.content)},be.createElement("div",{"data-title":"",className:oe(_==null?void 0:_.title,(l=m==null?void 0:m.classNames)==null?void 0:l.title)},m.title),m.description?be.createElement("div",{"data-description":"",className:oe(U,Ce,_==null?void 0:_.description,(c=m==null?void 0:m.classNames)==null?void 0:c.description)},m.description):null),be.isValidElement(m.cancel)?m.cancel:m.cancel&&vd(m.cancel)?be.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||H,onClick:Se=>{var He,Xe;vd(m.cancel)&&re&&((Xe=(He=m.cancel).onClick)==null||Xe.call(He,Se),ne())},className:oe(_==null?void 0:_.cancelButton,(d=m==null?void 0:m.classNames)==null?void 0:d.cancelButton)},m.cancel.label):null,be.isValidElement(m.action)?m.action:m.action&&vd(m.action)?be.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||A,onClick:Se=>{var He,Xe;vd(m.action)&&(Se.defaultPrevented||((Xe=(He=m.action).onClick)==null||Xe.call(He,Se),ne()))},className:oe(_==null?void 0:_.actionButton,(u=m==null?void 0:m.classNames)==null?void 0:u.actionButton)},m.action.label):null))};function ly(){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}var YT=e=>{let{invert:t,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:a,closeButton:i,className:o,offset:l,theme:c="light",richColors:d,duration:u,style:f,visibleToasts:m=$T,toastOptions:w,dir:x=ly(),gap:p=BT,loadingIcon:b,icons:v,containerAriaLabel:g="Notifications",pauseWhenPageIsHidden:y,cn:j=HT}=e,[N,k]=be.useState([]),C=be.useMemo(()=>Array.from(new Set([n].concat(N.filter(Y=>Y.position).map(Y=>Y.position)))),[N,n]),[E,H]=be.useState([]),[A,F]=be.useState(!1),[U,ae]=be.useState(!1),[q,se]=be.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),D=be.useRef(null),T=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),_=be.useRef(null),O=be.useRef(!1),G=be.useCallback(Y=>{var oe;(oe=N.find(M=>M.id===Y.id))!=null&&oe.delete||Jn.dismiss(Y.id),k(M=>M.filter(({id:I})=>I!==Y.id))},[N]);return be.useEffect(()=>Jn.subscribe(Y=>{if(Y.dismiss){k(oe=>oe.map(M=>M.id===Y.id?{...M,delete:!0}:M));return}setTimeout(()=>{Jb.flushSync(()=>{k(oe=>{let M=oe.findIndex(I=>I.id===Y.id);return M!==-1?[...oe.slice(0,M),{...oe[M],...Y},...oe.slice(M+1)]:[Y,...oe]})})})}),[]),be.useEffect(()=>{if(c!=="system"){se(c);return}c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?se("dark"):se("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:Y})=>{se(Y?"dark":"light")})},[c]),be.useEffect(()=>{N.length<=1&&F(!1)},[N]),be.useEffect(()=>{let Y=oe=>{var M,I;r.every(he=>oe[he]||oe.code===he)&&(F(!0),(M=D.current)==null||M.focus()),oe.code==="Escape"&&(document.activeElement===D.current||(I=D.current)!=null&&I.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",Y),()=>document.removeEventListener("keydown",Y)},[r]),be.useEffect(()=>{if(D.current)return()=>{_.current&&(_.current.focus({preventScroll:!0}),_.current=null,O.current=!1)}},[D.current]),N.length?be.createElement("section",{"aria-label":`${g} ${T}`,tabIndex:-1},C.map((Y,oe)=>{var M;let[I,he]=Y.split("-");return be.createElement("ol",{key:Y,dir:x==="auto"?ly():x,tabIndex:-1,ref:D,className:o,"data-sonner-toaster":!0,"data-theme":q,"data-y-position":I,"data-x-position":he,style:{"--front-toast-height":`${((M=E[0])==null?void 0:M.height)||0}px`,"--offset":typeof l=="number"?`${l}px`:l||FT,"--width":`${zT}px`,"--gap":`${p}px`,...f},onBlur:X=>{O.current&&!X.currentTarget.contains(X.relatedTarget)&&(O.current=!1,_.current&&(_.current.focus({preventScroll:!0}),_.current=null))},onFocus:X=>{X.target instanceof HTMLElement&&X.target.dataset.dismissible==="false"||O.current||(O.current=!0,_.current=X.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{U||F(!1)},onPointerDown:X=>{X.target instanceof HTMLElement&&X.target.dataset.dismissible==="false"||ae(!0)},onPointerUp:()=>ae(!1)},N.filter(X=>!X.position&&oe===0||X.position===Y).map((X,K)=>{var P,Z;return be.createElement(qT,{key:X.id,icons:v,index:K,toast:X,defaultRichColors:d,duration:(P=w==null?void 0:w.duration)!=null?P:u,className:w==null?void 0:w.className,descriptionClassName:w==null?void 0:w.descriptionClassName,invert:t,visibleToasts:m,closeButton:(Z=w==null?void 0:w.closeButton)!=null?Z:i,interacting:U,position:Y,style:w==null?void 0:w.style,unstyled:w==null?void 0:w.unstyled,classNames:w==null?void 0:w.classNames,cancelButtonStyle:w==null?void 0:w.cancelButtonStyle,actionButtonStyle:w==null?void 0:w.actionButtonStyle,removeToast:G,toasts:N.filter(ee=>ee.position==X.position),heights:E.filter(ee=>ee.position==X.position),setHeights:H,expandByDefault:a,gap:p,loadingIcon:b,expanded:A,pauseWhenPageIsHidden:y,cn:j})}))})):null};const GT=({...e})=>{const{theme:t="system"}=_T();return s.jsx(YT,{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})};var KT=Kw.useId||(()=>{}),ZT=0;function Cs(e){const[t,n]=h.useState(KT());return kn(()=>{n(r=>r??String(ZT++))},[e]),t?`radix-${t}`:""}const QT=["top","right","bottom","left"],_a=Math.min,nr=Math.max,yu=Math.round,xd=Math.floor,Na=e=>({x:e,y:e}
vendor: 5,052 bytes, line 356
356),JT={left:"right",right:"left",bottom:"top",top:"bottom"},XT={start:"end",end:"start"};function Wm(e,t,n){return nr(e,_a(t,n))}function As(e,t){return typeof e=="function"?e(t):e}function Ms(e){return e.split("-")[0]}function Vo(e){return e.split("-")[1]}function Pg(e){return e==="x"?"y":"x"}function Tg(e){return e==="y"?"height":"width"}function Sa(e){return["top","bottom"].includes(Ms(e))?"y":"x"}function Rg(e){return Pg(Sa(e))}function eR(e,t,n){n===void 0&&(n=!1);const r=Vo(e),a=Rg(e),i=Tg(a);let o=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=wu(o)),[o,wu(o)]}function tR(e){const t=wu(e);return[Hm(e),t,Hm(t)]}function Hm(e){return e.replace(/start|end/g,t=>XT[t])}function nR(e,t,n){const r=["left","right"],a=["right","left"],i=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?a:r:t?r:a;case"left":case"right":return t?i:o;default:return[]}}function rR(e,t,n,r){const a=Vo(e);let i=nR(Ms(e),n==="start",r);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(Hm)))),i}function wu(e){return e.replace(/left|right|bottom|top/g,t=>JT[t])}function sR(e){return{top:0,right:0,bottom:0,left:0,...e}}function Gj(e){return typeof e!="number"?sR(e):{top:e,right:e,bottom:e,left:e}}function bu(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function cy(e,t,n){let{reference:r,floating:a}=e;const i=Sa(t),o=Rg(t),l=Tg(o),c=Ms(t),d=i==="y",u=r.x+r.width/2-a.width/2,f=r.y+r.height/2-a.height/2,m=r[l]/2-a[l]/2;let w;switch(c){case"top":w={x:u,y:r.y-a.height};break;case"bottom":w={x:u,y:r.y+r.height};break;case"right":w={x:r.x+r.width,y:f};break;case"left":w={x:r.x-a.width,y:f};break;default:w={x:r.x,y:r.y}}switch(Vo(t)){case"start":w[o]-=m*(n&&d?-1:1);break;case"end":w[o]+=m*(n&&d?-1:1);break}return w}const aR=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:o}=n,l=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let d=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:f}=cy(d,r,c),m=r,w={},x=0;for(let p=0;p<l.length;p++){const{name:b,fn:v}=l[p],{x:g,y,data:j,reset:N}=await v({x:u,y:f,initialPlacement:r,placement:m,strategy:a,middlewareData:w,rects:d,platform:o,elements:{reference:e,floating:t}});u=g??u,f=y??f,w={...w,[b]:{...w[b],...j}},N&&x<=50&&(x++,typeof N=="object"&&(N.placement&&(m=N.placement),N.rects&&(d=N.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):N.rects),{x:u,y:f}=cy(d,m,c)),p=-1)}return{x:u,y:f,placement:m,strategy:a,middlewareData:w}};async function Jl(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:o,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:m=!1,padding:w=0}=As(t,e),x=Gj(w),b=l[m?f==="floating"?"reference":"floating":f],v=bu(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),g=f==="floating"?{x:r,y:a,width:o.floating.width,height:o.floating.height}:o.reference,y=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),j=await(i.isElement==null?void 0:i.isElement(y))?await(i.getScale==null?void 0:i.getScale(y))||{x:1,y:1}:{x:1,y:1},N=bu(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:y,strategy:c}):g);return{top:(v.top-N.top+x.top)/j.y,bottom:(N.bottom-v.bottom+x.bottom)/j.y,left:(v.left-N.left+x.left)/j.x,right:(N.right-v.right+x.right)/j.x}}const iR=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:o,elements:l,middlewareData:c}=t,{element:d,padding:u=0}=As(e,t)||{};if(d==null)return{};const f=Gj(u),m={x:n,y:r},w=Rg(a),x=Tg(w),p=await o.getDimensions(d),b=w==="y",v=b?"top":"left",g=b?"bottom":"right",y=b?"clientHeight":"clientWidth",j=i.reference[x]+i.reference[w]-m[w]-i.floating[x],N=m[w]-i.reference[w],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let C=k?k[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(k)))&&(C=l.floating[y]||i.floating[x]);const E=j/2-N/2,H=C/2-p[x]/2-1,A=_a(f[v],H),F=_a(f[g],H),U=A,ae=C-p[x]-F,q=C/2-p[x]/2+E,se=Wm(U,q,ae),D=!c.arrow&&Vo(a)!=null&&q!==se&&i.reference[x]/2-(q<U?A:F)-p[x]/2<0,T=D?q<U?q-U:q-ae:0;return{[w]:m[w]+T,data:{[w]:se,centerOffset:q-se-T,...D&&{alignmentOffset:T}},reset:D}}}),oR=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:p=!0,...b}=As(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=Ms(a),g=Sa(l),y=Ms(l)===l,j=await(c.isRTL==null?void 0:c.isRTL(d.floating)),N=m||(y||!p?[wu(l)]:tR(l)),
vendor: 5,162 bytes, line 356
356k=x!=="none";!m&&k&&N.push(...rR(l,p,x,j));const C=[l,...N],E=await Jl(t,b),H=[];let A=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&H.push(E[v]),f){const q=eR(a,o,j);H.push(E[q[0]],E[q[1]])}if(A=[...A,{placement:a,overflows:H}],!H.every(q=>q<=0)){var F,U;const q=(((F=i.flip)==null?void 0:F.index)||0)+1,se=C[q];if(se)return{data:{index:q,overflows:A},reset:{placement:se}};let D=(U=A.filter(T=>T.overflows[0]<=0).sort((T,_)=>T.overflows[1]-_.overflows[1])[0])==null?void 0:U.placement;if(!D)switch(w){case"bestFit":{var ae;const T=(ae=A.filter(_=>{if(k){const O=Sa(_.placement);return O===g||O==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(O=>O>0).reduce((O,G)=>O+G,0)]).sort((_,O)=>_[1]-O[1])[0])==null?void 0:ae[0];T&&(D=T);break}case"initialPlacement":D=l;break}if(a!==D)return{reset:{placement:D}}}return{}}}};function dy(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function uy(e){return QT.some(t=>e[t]>=0)}const lR=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=As(e,t);switch(r){case"referenceHidden":{const i=await Jl(t,{...a,elementContext:"reference"}),o=dy(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:uy(o)}}}case"escaped":{const i=await Jl(t,{...a,altBoundary:!0}),o=dy(i,n.floating);return{data:{escapedOffsets:o,escaped:uy(o)}}}default:return{}}}}};async function cR(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),o=Ms(n),l=Vo(n),c=Sa(n)==="y",d=["left","top"].includes(o)?-1:1,u=i&&c?-1:1,f=As(t,e);let{mainAxis:m,crossAxis:w,alignmentAxis:x}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof x=="number"&&(w=l==="end"?x*-1:x),c?{x:w*u,y:m*d}:{x:m*d,y:w*u}}const dR=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:o,middlewareData:l}=t,c=await cR(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:a+c.x,y:i+c.y,data:{...c,placement:o}}}}},uR=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:l={fn:b=>{let{x:v,y:g}=b;return{x:v,y:g}}},...c}=As(e,t),d={x:n,y:r},u=await Jl(t,c),f=Sa(Ms(a)),m=Pg(f);let w=d[m],x=d[f];if(i){const b=m==="y"?"top":"left",v=m==="y"?"bottom":"right",g=w+u[b],y=w-u[v];w=Wm(g,w,y)}if(o){const b=f==="y"?"top":"left",v=f==="y"?"bottom":"right",g=x+u[b],y=x-u[v];x=Wm(g,x,y)}const p=l.fn({...t,[m]:w,[f]:x});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[m]:i,[f]:o}}}}}},hR=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:i,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=As(e,t),u={x:n,y:r},f=Sa(a),m=Pg(f);let w=u[m],x=u[f];const p=As(l,t),b=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const y=m==="y"?"height":"width",j=i.reference[m]-i.floating[y]+b.mainAxis,N=i.reference[m]+i.reference[y]-b.mainAxis;w<j?w=j:w>N&&(w=N)}if(d){var v,g;const y=m==="y"?"width":"height",j=["top","left"].includes(Ms(a)),N=i.reference[f]-i.floating[y]+(j&&((v=o.offset)==null?void 0:v[f])||0)+(j?0:b.crossAxis),k=i.reference[f]+i.reference[y]+(j?0:((g=o.offset)==null?void 0:g[f])||0)-(j?b.crossAxis:0);x<N?x=N:x>k&&(x=k)}return{[m]:w,[f]:x}}}},fR=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:i,platform:o,elements:l}=t,{apply:c=()=>{},...d}=As(e,t),u=await Jl(t,d),f=Ms(a),m=Vo(a),w=Sa(a)==="y",{width:x,height:p}=i.floating;let b,v;f==="top"||f==="bottom"?(b=f,v=m===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(v=f,b=m==="end"?"top":"bottom");const g=p-u.top-u.bottom,y=x-u.left-u.right,j=_a(p-u[b],g),N=_a(x-u[v],y),k=!t.middlewareData.shift;let C=j,E=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(E=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=g),k&&!m){const A=nr(u.left,0),F=nr(u.right,0),U=nr(u.top,0),ae=nr(u.bottom,0);w?E=x-2*(A!==0||F!==0?A+F:nr(u.left,u.right)):C=p-2*(U!==0||ae!==0?U+ae:nr(u.top,u.bottom))}await c({...t,availableWidth:E,availableHeight:C});const H=await o.getDimensions(l.floating);return x!==H.width||p!==H.height?{reset:{rects:!0}}:{}}}};function oh(){return typeof window<"u"}function Wo(e){return Kj(e)?(e.nodeName||"").toLowerCase():"#document"}function ir(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ms(e){var t;return(t=(Kj(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Kj(e){return oh()?e instanceof Node||e instanceof ir(e).Node:!1}function Ur(e){return oh()?e instanceof Element||e instanceof ir(e).Element:!1}function ds(e){return oh()?e instanceof HTMLElement||e instanceof ir(e).HTMLElement:!1}function hy(e){return!oh()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ir(e).ShadowRoot}function Mc(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=zr(e);
vendor: 5,184 bytes, line 356
356return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(a)}function mR(e){return["table","td","th"].includes(Wo(e))}function lh(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Dg(e){const t=Og(),n=Ur(e)?zr(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function pR(e){let t=ka(e);for(;ds(t)&&!Po(t);){if(Dg(t))return t;if(lh(t))return null;t=ka(t)}return null}function Og(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Po(e){return["html","body","#document"].includes(Wo(e))}function zr(e){return ir(e).getComputedStyle(e)}function ch(e){return Ur(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ka(e){if(Wo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||hy(e)&&e.host||ms(e);return hy(t)?t.host:t}function Zj(e){const t=ka(e);return Po(t)?e.ownerDocument?e.ownerDocument.body:e.body:ds(t)&&Mc(t)?t:Zj(t)}function Xl(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=Zj(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),o=ir(a);if(i){const l=qm(o);return t.concat(o,o.visualViewport||[],Mc(a)?a:[],l&&n?Xl(l):[])}return t.concat(a,Xl(a,[],n))}function qm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Qj(e){const t=zr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=ds(e),i=a?e.offsetWidth:n,o=a?e.offsetHeight:r,l=yu(n)!==i||yu(r)!==o;return l&&(n=i,r=o),{width:n,height:r,$:l}}function Ag(e){return Ur(e)?e:e.contextElement}function ao(e){const t=Ag(e);if(!ds(t))return Na(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=Qj(t);let o=(i?yu(n.width):n.width)/r,l=(i?yu(n.height):n.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const gR=Na(0);function Jj(e){const t=ir(e);return!Og()||!t.visualViewport?gR:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vR(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ir(e)?!1:t}function fi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=Ag(e);let o=Na(1);t&&(r?Ur(r)&&(o=ao(r)):o=ao(e));const l=vR(i,n,r)?Jj(i):Na(0);let c=(a.left+l.x)/o.x,d=(a.top+l.y)/o.y,u=a.width/o.x,f=a.height/o.y;if(i){const m=ir(i),w=r&&Ur(r)?ir(r):r;let x=m,p=qm(x);for(;p&&r&&w!==x;){const b=ao(p),v=p.getBoundingClientRect(),g=zr(p),y=v.left+(p.clientLeft+parseFloat(g.paddingLeft))*b.x,j=v.top+(p.clientTop+parseFloat(g.paddingTop))*b.y;c*=b.x,d*=b.y,u*=b.x,f*=b.y,c+=y,d+=j,x=ir(p),p=qm(x)}}return bu({width:u,height:f,x:c,y:d})}function xR(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",o=ms(r),l=t?lh(t.floating):!1;if(r===o||l&&i)return n;let c={scrollLeft:0,scrollTop:0},d=Na(1);const u=Na(0),f=ds(r);if((f||!f&&!i)&&((Wo(r)!=="body"||Mc(o))&&(c=ch(r)),ds(r))){const m=fi(r);d=ao(r),u.x=m.x+r.clientLeft,u.y=m.y+r.clientTop}return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+u.x,y:n.y*d.y-c.scrollTop*d.y+u.y}}function yR(e){return Array.from(e.getClientRects())}function Ym(e,t){const n=ch(e).scrollLeft;return t?t.left+n:fi(ms(e)).left+n}function wR(e){const t=ms(e),n=ch(e),r=e.ownerDocument.body,a=nr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=nr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Ym(e);const l=-n.scrollTop;return zr(r).direction==="rtl"&&(o+=nr(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:o,y:l}}function bR(e,t){const n=ir(e),r=ms(e),a=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,l=0,c=0;if(a){i=a.width,o=a.height;const d=Og();(!d||d&&t==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}return{width:i,height:o,x:l,y:c}}function jR(e,t){const n=fi(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=ds(e)?ao(e):Na(1),o=e.clientWidth*i.x,l=e.clientHeight*i.y,c=a*i.x,d=r*i.y;return{width:o,height:l,x:c,y:d}}function fy(e,t,n){let r;if(t==="viewport")r=bR(e,n);else if(t==="document")r=wR(ms(e));else if(Ur(t))r=jR(t,n);else{const a=Jj(e);r={...t,x:t.x-a.x,y:t.y-a.y}}return bu(r)}function Xj(e,t){const n=ka(e);return n===t||!Ur(n)||Po(n)?!1:zr(n).position==="fixed"||Xj(n,t)}function _R(e,t){const n=t.get(e);if(n)return n;let r=Xl(e,[],!1).filter(l=>Ur(l)&&Wo(l)!=="body"),a=null;const i=zr(e).position==="fixed";let o=i?ka(e):e;for(;Ur(o)&&!Po(o);){const l=zr(o),c=Dg(o);!c&&l.position==="fixed"&&(a=null),(i?!c&&!a:!c&&l.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||Mc(o)&&!c&&Xj(e,o))?r=r.filter(u=>u!==o):a=l,o=ka(o)}return t.set(e,r),r}function NR(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[...n==="clippingAncestors"?lh(t)?[]:_R(t,this._c):[].concat(n),r],l=o[0],c=o.reduce((d,u)=>{const f=fy(t,u,a);return d.top=nr(f.top,d.top),d.right=_a(f.right,d.right),d.bottom=_a(f.bottom,d.bottom),d.left
vendor: 12,980 bytes, line 356
356=nr(f.left,d.left),d},fy(t,l,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function SR(e){const{width:t,height:n}=Qj(e);return{width:t,height:n}}function kR(e,t,n){const r=ds(t),a=ms(t),i=n==="fixed",o=fi(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Na(0);if(r||!r&&!i)if((Wo(t)!=="body"||Mc(a))&&(l=ch(t)),r){const w=fi(t,!0,i,t);c.x=w.x+t.clientLeft,c.y=w.y+t.clientTop}else a&&(c.x=Ym(a));let d=0,u=0;if(a&&!r&&!i){const w=a.getBoundingClientRect();u=w.top+l.scrollTop,d=w.left+l.scrollLeft-Ym(a,w)}const f=o.left+l.scrollLeft-c.x-d,m=o.top+l.scrollTop-c.y-u;return{x:f,y:m,width:o.width,height:o.height}}function vf(e){return zr(e).position==="static"}function my(e,t){if(!ds(e)||zr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ms(e)===n&&(n=n.ownerDocument.body),n}function e_(e,t){const n=ir(e);if(lh(e))return n;if(!ds(e)){let a=ka(e);for(;a&&!Po(a);){if(Ur(a)&&!vf(a))return a;a=ka(a)}return n}let r=my(e,t);for(;r&&mR(r)&&vf(r);)r=my(r,t);return r&&Po(r)&&vf(r)&&!Dg(r)?n:r||pR(e)||n}const CR=async function(e){const t=this.getOffsetParent||e_,n=this.getDimensions,r=await n(e.floating);return{reference:kR(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ER(e){return zr(e).direction==="rtl"}const PR={convertOffsetParentRelativeRectToViewportRelativeRect:xR,getDocumentElement:ms,getClippingRect:NR,getOffsetParent:e_,getElementRects:CR,getClientRects:yR,getDimensions:SR,getScale:ao,isElement:Ur,isRTL:ER};function TR(e,t){let n=null,r;const a=ms(e);function i(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const{left:d,top:u,width:f,height:m}=e.getBoundingClientRect();if(l||t(),!f||!m)return;const w=xd(u),x=xd(a.clientWidth-(d+f)),p=xd(a.clientHeight-(u+m)),b=xd(d),g={rootMargin:-w+"px "+-x+"px "+-p+"px "+-b+"px",threshold:nr(0,_a(1,c))||1};let y=!0;function j(N){const k=N[0].intersectionRatio;if(k!==c){if(!y)return o();k?o(!1,k):r=setTimeout(()=>{o(!1,1e-7)},1e3)}y=!1}try{n=new IntersectionObserver(j,{...g,root:a.ownerDocument})}catch{n=new IntersectionObserver(j,g)}n.observe(e)}return o(!0),i}function RR(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=Ag(e),u=a||i?[...d?Xl(d):[],...Xl(t)]:[];u.forEach(v=>{a&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const f=d&&l?TR(d,n):null;let m=-1,w=null;o&&(w=new ResizeObserver(v=>{let[g]=v;g&&g.target===d&&w&&(w.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var y;(y=w)==null||y.observe(t)})),n()}),d&&!c&&w.observe(d),w.observe(t));let x,p=c?fi(e):null;c&&b();function b(){const v=fi(e);p&&(v.x!==p.x||v.y!==p.y||v.width!==p.width||v.height!==p.height)&&n(),p=v,x=requestAnimationFrame(b)}return n(),()=>{var v;u.forEach(g=>{a&&g.removeEventListener("scroll",n),i&&g.removeEventListener("resize",n)}),f==null||f(),(v=w)==null||v.disconnect(),w=null,c&&cancelAnimationFrame(x)}}const DR=dR,OR=uR,AR=oR,MR=fR,IR=lR,py=iR,LR=hR,$R=(e,t,n)=>{const r=new Map,a={platform:PR,...n},i={...a.platform,_c:r};return aR(e,t,{...a,platform:i})};var Bd=typeof document<"u"?h.useLayoutEffect:h.useEffect;function ju(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,a;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(!ju(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!ju(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function t_(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gy(e,t){const n=t_(e);return Math.round(t*n)/n}function xf(e){const t=h.useRef(e);return Bd(()=>{t.current=e}),t}function FR(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,f]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,w]=h.useState(r);ju(m,r)||w(r);const[x,p]=h.useState(null),[b,v]=h.useState(null),g=h.useCallback(_=>{_!==k.current&&(k.current=_,p(_))},[]),y=h.useCallback(_=>{_!==C.current&&(C.current=_,v(_))},[]),j=i||x,N=o||b,k=h.useRef(null),C=h.useRef(null),E=h.useRef(u),H=c!=null,A=xf(c),F=xf(a),U=xf(d),ae=h.useCallback(()=>{if(!k.current||!C.current)return;const _={placement:t,strategy:n,middleware:m};F.current&&(_.platform=F.current),$R(k.current,C.current,_).then(O=>{const G={...O,isPositioned:U.current!==!1};q.current&&!ju(E.current,G)&&(E.current=G,ji.flushSync(()=>{f(G)}))})},[m,t,n,F,U]);Bd(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(_=>({..._,isPositioned:!1})))},[d]);const q=h.useRef(!1);Bd(()=>(q.current=!0,()=>{q.current=!1}),[]),Bd(()=>{if(j&&(k.current=j),N&&(C.current=N),j&&N){if(A.current)return A.current(j,N,ae);ae()}},[j,N,ae,A,H]);const se=h.useMemo(()=>({reference:k,floating:C,setReference:g,setFloating:y}),[g,y]),D=h.useMemo(()=>({reference:j,floating:N}),[j,N]),T=h.useMemo(()=>{const _={position:n,left:0,top:0};if(!D.floating)return _;const O=gy(D.floating,u.x),G=gy(D.floating,u.y);return l?{..._,transform:"translate("+O+"px, "+G+"px)",...t_(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:G}},[n,l,D.floating,u.x,u.y]);return h.useMemo(()=>({...u,update:ae,refs:se,elements:D,floatingStyles:T}),[u,ae,se,D,T])}const UR=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?py({element:r.current,padding:a}).fn(n):{}:r?py({element:r,padding:a}).fn(n):{}}}},zR=(e,t)=>({...DR(e),options:[e,t]}),BR=(e,t)=>({...OR(e),options:[e,t]}),VR=(e,t)=>({...LR(e),options:[e,t]}),WR=(e,t)=>({...AR(e),options:[e,t]}),HR=(e,t)=>({...MR(e),options:[e,t]}),qR=(e,t)=>({...IR(e),options:[e,t]}),YR=(e,t)=>({...UR(e),options:[e,t]});var GR="Arrow",n_=h.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return s.jsx(Ye.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});n_.displayName=GR;var KR=n_;function ZR(e,t=[]){let n=[];function r(i,o){const l=h.createContext(o),c=n.length;n=[...n,o];function d(f){const{scope:m,children:w,...x}=f,p=(m==null?void 0:m[e][c])||l,b=h.useMemo(()=>x,Object.values(x));return s.jsx(p.Provider,{value:b,children:w})}function u(f,m){const w=(m==null?void 0:m[e][c])||l,x=h.useContext(w);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return d.displayName=i+"Provider",[d,u]}const a=()=>{const i=n.map(o=>h.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[r,QR(a,...t)]}function QR(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=r.reduce((l,{useScope:c,scopeName:d})=>{const f=c(i)[`__scope${d}`];return{...l,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function dh(e){const[t,n]=h.useState(void 0);return kn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let o,l;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;o=d.inlineSize,l=d.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Mg="Popper",[r_,Ho]=ZR(Mg),[JR,s_]=r_(Mg),a_=e=>{const{__scopePopper:t,children:n}=e,[r,a]=h.useState(null);return s.jsx(JR,{scope:t,anchor:r,onAnchorChange:a,children:n})};a_.displayName=Mg;var i_="PopperAnchor",o_=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=s_(i_,n),o=h.useRef(null),l=wt(t,o);return h.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:s.jsx(Ye.div,{...a,ref:l})});o_.displayName=i_;var Ig="PopperContent",[XR,eD]=r_(Ig),l_=h.forwardRef((e,t)=>{var K,P,Z,ee,le,z;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:m=!1,updatePositionStrategy:w="optimized",onPlaced:x,...p}=e,b=s_(Ig,n),[v,g]=h.useState(null),y=wt(t,_e=>g(_e)),[j,N]=h.useState(null),k=dh(j),C=(k==null?void 0:k.width)??0,E=(k==null?void 0:k.height)??0,H=r+(i!=="center"?"-"+i:""),A=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},F=Array.isArray(d)?d:[d],U=F.length>0,ae={padding:A,boundary:F.filter(nD),altBoundary:U},{refs:q,floatingStyles:se,placement:D,isPositioned:T,middlewareData:_}=FR({strategy:"fixed",placement:H,whileElementsMounted:(..._e)=>RR(..._e,{animationFrame:w==="always"}),elements:{reference:b.anchor},middleware:[zR({mainAxis:a+E,alignmentAxis:o}),c&&BR({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?VR():void 0,...ae}),c&&WR({...ae}),HR({...ae,apply:({elements:_e,rects:ue,availableWidth:De,availableHeight:Ve})=>{const{width:lt,height:vt}=ue.reference,Qe=_e.floating.style;Qe.setProperty("--radix-popper-available-width",`${De}px`),Qe.setProperty("--radix-popper-available-height",`${Ve}px`),Qe.setProperty("--radix-popper-anchor-width",`${lt}px`),Qe.setProperty("--radix-popper-anchor-height",`${vt}px`)}}),j&&YR({element:j,padding:l}),rD({arrowWidth:C,arrowHeight:E}),m&&qR({strategy:"referenceHidden",...ae})]}),[O,G]=u_(D),Y=Gn(x);kn(()=>{T&&(Y==null||Y())},[T,Y]);const oe=(K=_.arrow)==null?void 0:K.x,M=(P=_.arrow)==null?void 0:P.y,I=((Z=_.arrow)==null?void 0:Z.centerOffset)!==0,[he,X]=h.useState();return kn(()=>{v&&X(window.getComputedStyle(v).zIndex)},[v]),s.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...se,transform:T?se.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:he,"--radix-popper-transform-origin":[(ee=_.transformOrigin)==null?void 0:ee.x,(le=_.transformOrigin)==null?void 0:le.y].join(" "),...((z=_.hide)==null?void 0:z.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(XR,{scope:n,placedSide:O,onArrowChange:N,arrowX:oe,arrowY:M,shouldHideArrow:I,children:s.jsx(Ye.div,{"data-side":O,"data-align":G,...p,ref:y,style:{...p.style,animation:T?void 0:"none"}})})})});l_.displayName=Ig;var c_="PopperArrow",tD={top:"bottom",right:"left",bottom:"top",left:"right"},d_=h.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=eD(c_,r),o=tD[i.placedSide];return s.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:s.jsx(KR,{...a,ref:n,style:{...a.style,display:"block"}})})});d_.displayName=c_;function nD(e){return e!==null}var rD=e=>({name:"transformOrigin",options:e,fn(t){var b,v,g;const{placement:n,rects:r,middlewareData:a}=t,o=((b=a.arrow)==null?void 0:b.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[d,u]=u_(n),f={start:"0%",center:"50%",end:"100%"}[u],m=(((v=a.arrow)==null?void 0:v.x)??0)+l/2,w=(((g=a.arrow)==null?void 0:g.y)??0)+c/2;let x="",p="";return d==="bottom"?(x=o?f:`${m}px`,p=`${-c}px`):d==="top"?(x=o?f:`${m}px`,p=`${r.floating.height+c}px`):d==="right"?(x=`${-c}px`,p=o?f:`${w}px`):d==="left"&&(x=`${r.floating.width+c}px`,p=o?f:`${w}px`),{data:{x,y:p}}}});function u_(e){const[t,n="center"]=e.split("-");return[t,n]}var h_=a_,uh=o_,Lg=l_,$g=d_,[hh,T6]=Hr("Tooltip",[Ho]),Fg=Ho(),f_="TooltipProvider",sD=700,vy="tooltip.open",[aD,m_]=hh(f_),p_=e=>{const{__scopeTooltip:t,delayDuration:n=sD,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=e,[o,l]=h.useState(!0),c=h.useRef(!1),d=h.useRef(0);return h.useEffect(()=>{const u=d.current;return()=>window.clearTimeout(u)},[]),s.jsx(aD,{scope:t,isOpenDelayed:o,delayDuration:n,onOpen:h.useCallback(()=>{window.clearTimeout(d.current),l(!1)},[]),onClose:h.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l(!0),r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:h.useCallback(u=>{c.current=u},[]),disableHoverableContent:a,children:i})};p_.displayName=f_;var g_="Tooltip",[R6,fh]=hh(g_),Gm="TooltipTrigger",iD=h.forwardRef((e,t)=>
vendor: 5,097 bytes, line 356
356{const{__scopeTooltip:n,...r}=e,a=fh(Gm,n),i=m_(Gm,n),o=Fg(n),l=h.useRef(null),c=wt(t,l,a.onTriggerChange),d=h.useRef(!1),u=h.useRef(!1),f=h.useCallback(()=>d.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),s.jsx(uh,{asChild:!0,...o,children:s.jsx(Ye.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:c,onPointerMove:Le(e.onPointerMove,m=>{m.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),u.current=!0)}),onPointerLeave:Le(e.onPointerLeave,()=>{a.onTriggerLeave(),u.current=!1}),onPointerDown:Le(e.onPointerDown,()=>{d.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Le(e.onFocus,()=>{d.current||a.onOpen()}),onBlur:Le(e.onBlur,a.onClose),onClick:Le(e.onClick,a.onClose)})})});iD.displayName=Gm;var oD="TooltipPortal",[D6,lD]=hh(oD,{forceMount:void 0}),To="TooltipContent",v_=h.forwardRef((e,t)=>{const n=lD(To,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,o=fh(To,e.__scopeTooltip);return s.jsx(qr,{present:r||o.open,children:o.disableHoverableContent?s.jsx(x_,{side:a,...i,ref:t}):s.jsx(cD,{side:a,...i,ref:t})})}),cD=h.forwardRef((e,t)=>{const n=fh(To,e.__scopeTooltip),r=m_(To,e.__scopeTooltip),a=h.useRef(null),i=wt(t,a),[o,l]=h.useState(null),{trigger:c,onClose:d}=n,u=a.current,{onPointerInTransitChange:f}=r,m=h.useCallback(()=>{l(null),f(!1)},[f]),w=h.useCallback((x,p)=>{const b=x.currentTarget,v={x:x.clientX,y:x.clientY},g=fD(v,b.getBoundingClientRect()),y=mD(v,g),j=pD(p.getBoundingClientRect()),N=vD([...y,...j]);l(N),f(!0)},[f]);return h.useEffect(()=>()=>m(),[m]),h.useEffect(()=>{if(c&&u){const x=b=>w(b,u),p=b=>w(b,c);return c.addEventListener("pointerleave",x),u.addEventListener("pointerleave",p),()=>{c.removeEventListener("pointerleave",x),u.removeEventListener("pointerleave",p)}}},[c,u,w,m]),h.useEffect(()=>{if(o){const x=p=>{const b=p.target,v={x:p.clientX,y:p.clientY},g=(c==null?void 0:c.contains(b))||(u==null?void 0:u.contains(b)),y=!gD(v,o);g?m():y&&(m(),d())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[c,u,o,d,m]),s.jsx(x_,{...e,ref:i})}),[dD,uD]=hh(g_,{isInside:!1}),x_=h.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...l}=e,c=fh(To,n),d=Fg(n),{onClose:u}=c;return h.useEffect(()=>(document.addEventListener(vy,u),()=>document.removeEventListener(vy,u)),[u]),h.useEffect(()=>{if(c.trigger){const f=m=>{const w=m.target;w!=null&&w.contains(c.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,u]),s.jsx(zo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:s.jsxs(Lg,{"data-state":c.stateAttribute,...d,...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:[s.jsx(bg,{children:r}),s.jsx(dD,{scope:n,isInside:!0,children:s.jsx(QP,{id:c.contentId,role:"tooltip",children:a||r})})]})})});v_.displayName=To;var y_="TooltipArrow",hD=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Fg(n);return uD(y_,n).isInside?null:s.jsx($g,{...a,...r,ref:t})});hD.displayName=y_;function fD(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,a,i)){case i:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function mD(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 pD(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function gD(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const l=t[i].x,c=t[i].y,d=t[o].x,u=t[o].y;c>r!=u>r&&n<(d-l)*(r-c)/(u-c)+l&&(a=!a)}return a}function vD(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),xD(t)}function xD(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const a=e[r];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))n.pop();else break}n.push(a)}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)}
vendor: 23,806 bytes, line 356
356var yD=p_,w_=v_;const wD=yD,bD=h.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(w_,{ref:r,sideOffset:t,className:ke("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}));bD.displayName=w_.displayName;var mh=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(){}},ph=typeof window>"u"||"Deno"in globalThis;function kr(){}function jD(e,t){return typeof e=="function"?e(t):e}function _D(e){return typeof e=="number"&&e>=0&&e!==1/0}function ND(e,t){return Math.max(e+(t||0)-Date.now(),0)}function xy(e,t){return typeof e=="function"?e(t):e}function SD(e,t){return typeof e=="function"?e(t):e}function yy(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:i,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==Ug(o,t.options))return!1}else if(!tc(t.queryKey,o))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||a&&a!==t.state.fetchStatus||i&&!i(t))}function wy(e,t){const{exact:n,status:r,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(ec(t.options.mutationKey)!==ec(i))return!1}else if(!tc(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function Ug(e,t){return((t==null?void 0:t.queryKeyHashFn)||ec)(e)}function ec(e){return JSON.stringify(e,(t,n)=>Km(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function tc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!tc(e[n],t[n])):!1}function b_(e,t){if(e===t)return e;const n=by(e)&&by(t);if(n||Km(e)&&Km(t)){const r=n?e:Object.keys(e),a=r.length,i=n?t:Object.keys(t),o=i.length,l=n?[]:{};let c=0;for(let d=0;d<o;d++){const u=n?d:i[d];(!n&&r.includes(u)||n)&&e[u]===void 0&&t[u]===void 0?(l[u]=void 0,c++):(l[u]=b_(e[u],t[u]),l[u]===e[u]&&e[u]!==void 0&&c++)}return a===o&&c===a?e:l}return t}function by(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Km(e){if(!jy(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!jy(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function jy(e){return Object.prototype.toString.call(e)==="[object Object]"}function kD(e){return new Promise(t=>{setTimeout(t,e)})}function CD(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?b_(e,t):t}function ED(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function PD(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var zg=Symbol();function j_(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===zg?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Qa,ea,uo,Tw,TD=(Tw=class extends mh{constructor(){super();Nt(this,Qa);Nt(this,ea);Nt(this,uo);it(this,uo,t=>{if(!ph&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ce(this,ea)||this.setEventListener(ce(this,uo))}onUnsubscribe(){var t;this.hasListeners()||((t=ce(this,ea))==null||t.call(this),it(this,ea,void 0))}setEventListener(t){var n;it(this,uo,t),(n=ce(this,ea))==null||n.call(this),it(this,ea,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){ce(this,Qa)!==t&&(it(this,Qa,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof ce(this,Qa)=="boolean"?ce(this,Qa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Qa=new WeakMap,ea=new WeakMap,uo=new WeakMap,Tw),__=new TD,ho,ta,fo,Rw,RD=(Rw=class extends mh{constructor(){super();Nt(this,ho,!0);Nt(this,ta);Nt(this,fo);it(this,fo,t=>{if(!ph&&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(){ce(this,ta)||this.setEventListener(ce(this,fo))}onUnsubscribe(){var t;this.hasListeners()||((t=ce(this,ta))==null||t.call(this),it(this,ta,void 0))}setEventListener(t){var n;it(this,fo,t),(n=ce(this,ta))==null||n.call(this),it(this,ta,t(this.setOnline.bind(this)))}setOnline(t){ce(this,ho)!==t&&(it(this,ho,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return ce(this,ho)}},ho=new WeakMap,ta=new WeakMap,fo=new WeakMap,Rw),_u=new RD;function DD(){let e,t;const n=new Promise((a,i)=>{e=a,t=i});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}function OD(e){return Math.min(1e3*2**e,3e4)}function N_(e){return(e??"online")==="online"?_u.isOnline():!0}var S_=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function yf(e){return e instanceof S_}function k_(e){let t=!1,n=0,r=!1,a;const i=DD(),o=p=>{var b;r||(m(new S_(p)),(b=e.abort)==null||b.call(e))},l=()=>{t=!0},c=()=>{t=!1},d=()=>__.isFocused()&&(e.networkMode==="always"||_u.isOnline())&&e.canRun(),u=()=>N_(e.networkMode)&&e.canRun(),f=p=>{var b;r||(r=!0,(b=e.onSuccess)==null||b.call(e,p),a==null||a(),i.resolve(p))},m=p=>{var b;r||(r=!0,(b=e.onError)==null||b.call(e,p),a==null||a(),i.reject(p))},w=()=>new Promise(p=>{var b;a=v=>{(r||d())&&p(v)},(b=e.onPause)==null||b.call(e)}).then(()=>{var p;a=void 0,r||(p=e.onContinue)==null||p.call(e)}),x=()=>{if(r)return;let p;const b=n===0?e.initialPromise:void 0;try{p=b??e.fn()}catch(v){p=Promise.reject(v)}Promise.resolve(p).then(f).catch(v=>{var k;if(r)return;const g=e.retry??(ph?0:3),y=e.retryDelay??OD,j=typeof y=="function"?y(n,v):y,N=g===!0||typeof g=="number"&&n<g||typeof g=="function"&&g(n,v);if(t||!N){m(v);return}n++,(k=e.onFail)==null||k.call(e,n,v),kD(j).then(()=>d()?void 0:w()).then(()=>{t?m(v):x()})})};return{promise:i,cancel:o,continue:()=>(a==null||a(),i),cancelRetry:l,continueRetry:c,canStart:u,start:()=>(u()?x():w().then(x),i)}}function AD(){let e=[],t=0,n=l=>{l()},r=l=>{l()},a=l=>setTimeout(l,0);const i=l=>{t?e.push(l):a(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&a(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{i(()=>{l(...c)})},schedule:i,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{a=l}}}var Dn=AD(),Ja,Dw,C_=(Dw=class{constructor(){Nt(this,Ja)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),_D(this.gcTime)&&it(this,Ja,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ph?1/0:5*60*1e3))}clearGcTimeout(){ce(this,Ja)&&(clearTimeout(ce(this,Ja)),it(this,Ja,void 0))}},Ja=new WeakMap,Dw),mo,po,hr,jn,Sc,Xa,Cr,vs,Ow,MD=(Ow=class extends C_{constructor(t){super();Nt(this,Cr);Nt(this,mo);Nt(this,po);Nt(this,hr);Nt(this,jn);Nt(this,Sc);Nt(this,Xa);it(this,Xa,!1),it(this,Sc,t.defaultOptions),this.setOptions(t.options),this.observers=[],it(this,hr,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,it(this,mo,LD(this.options)),this.state=t.state??ce(this,mo),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=ce(this,jn))==null?void 0:t.promise}setOptions(t){this.options={...ce(this,Sc),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ce(this,hr).remove(this)}setData(t,n){const r=CD(this.state.data,t,this.options);return xn(this,Cr,vs).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){xn(this,Cr,vs).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,a;const n=(r=ce(this,jn))==null?void 0:r.promise;return(a=ce(this,jn))==null||a.cancel(t),n?n.then(kr).catch(kr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ce(this,mo))}isActive(){return this.observers.some(t=>SD(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===zg||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!ND(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=ce(this,jn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=ce(this,jn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),ce(this,hr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(ce(this,jn)&&(ce(this,Xa)?ce(this,jn).cancel({revert:!0}):ce(this,jn).cancelRetry()),this.scheduleGc()),ce(this,hr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||xn(this,Cr,vs).call(this,{type:"invalidate"})}fetch(t,n){var c,d,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ce(this,jn))return ce(this,jn).continueRetry(),ce(this,jn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(m=>m.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,a=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(it(this,Xa,!0),r.signal)})},i=()=>{const f=j_(this.options,n),m={queryKey:this.queryKey,meta:this.meta};return a(m),it(this,Xa,!1),this.options.persister?this.options.persister(f,m,this):f(m)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:i};a(o),(c=this.options.behavior)==null||c.onFetch(o,this),it(this,po,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&xn(this,Cr,vs).call(this,{type:"fetch",meta:(u=o.fetchOptions)==null?void 0:u.meta});const l=f=>{var m,w,x,p;yf(f)&&f.silent||xn(this,Cr,vs).call(this,{type:"error",error:f}),yf(f)||((w=(m=ce(this,hr).config).onError)==null||w.call(m,f,this),(p=(x=ce(this,hr).config).onSettled)==null||p.call(x,this.state.data,f,this)),this.scheduleGc()};return it(this,jn,k_({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var m,w,x,p;if(f===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(b){l(b);return}(w=(m=ce(this,hr).config).onSuccess)==null||w.call(m,f,this),(p=(x=ce(this,hr).config).onSettled)==null||p.call(x,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,m)=>{xn(this,Cr,vs).call(this,{type:"failed",failureCount:f,error:m})},onPause:()=>{xn(this,Cr,vs).call(this,{type:"pause"})},onContinue:()=>{xn(this,Cr,vs).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),ce(this,jn).start()}},mo=new WeakMap,po=new WeakMap,hr=new WeakMap,jn=new WeakMap,Sc=new WeakMap,Xa=new WeakMap,Cr=new WeakSet,vs=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,...ID(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...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 a=t.error;return yf(a)&&a.revert&&ce(this,po)?{...ce(this,po),fetchStatus:"idle"}:{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Dn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),ce(this,hr).notify({query:this,type:"updated",action:t})})},Ow);function ID(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:N_(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function LD(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 Jr,Aw,$D=(Aw=class extends mh{constructor(t={}){super();Nt(this,Jr);this.config=t,it(this,Jr,new Map)}build(t,n,r){const a=n.queryKey,i=n.queryHash??Ug(a,n);let o=this.get(i);return o||(o=new MD({cache:this,queryKey:a,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(o)),o}add(t){ce(this,Jr).has(t.queryHash)||(ce(this,Jr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=ce(this,Jr).get(t.queryHash);n&&(t.destroy(),n===t&&ce(this,Jr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Dn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return ce(this,Jr).get(t)}getAll(){return[...ce(this,Jr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>yy(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>yy(t,r)):n}notify(t){Dn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Dn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Dn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Jr=new WeakMap,Aw),Xr,Pn,ei,es,Hs,Mw,FD=(Mw=class extends C_{constructor(t){super();Nt(this,es);Nt(this,Xr);Nt(this,Pn);Nt(this,ei);this.mutationId=t.mutationId,it(this,Pn,t.mutationCache),it(this,Xr,[]),this.state=t.state||UD(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){ce(this,Xr).includes(t)||(ce(this,Xr).push(t),this.clearGcTimeout(),ce(this,Pn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){it(this,Xr,ce(this,Xr).filter(n=>n!==t)),this.scheduleGc(),ce(this,Pn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){ce(this,Xr).length||(this.state.status==="pending"?this.scheduleGc():ce(this,Pn).remove(this))}continue(){var t;return((t=ce(this,ei))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,i,o,l,c,d,u,f,m,w,x,p,b,v,g,y,j,N,k,C;it(this,ei,k_({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(E,H)=>{xn(this,es,Hs).call(this,{type:"failed",failureCount:E,error:H})},onPause:()=>{xn(this,es,Hs).call(this,{type:"pause"})},onContinue:()=>{xn(this,es,Hs).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ce(this,Pn).canRun(this)}));const n=this.state.status==="pending",r=!ce(this,ei).canStart();try{if(!n){xn(this,es,Hs).call(this,{type:"pending",variables:t,isPaused:r}),await((i=(a=ce(this,Pn).config).onMutate)==null?void 0:i.call(a,t,this));const H=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t));H!==this.state.context&&xn(this,es,Hs).call(this,{type:"pending",context:H,variables:t,isPaused:r})}const E=await ce(this,ei).start();return await((d=(c=ce(this,Pn).config).onSuccess)==null?void 0:d.call(c,E,t,this.state.context,this)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,E,t,this.state.context)),await((w=(m=ce(this,Pn).config).onSettled)==null?void 0:w.call(m,E,null,this.state.variables,this.state.context,this)),await((p=(x=this.options).onSettled)==null?void 0:p.call(x,E,null,t,this.state.context)),xn(this,es,Hs).call(this,{type:"success",data:E}),E}catch(E){try{throw await((v=(b=ce(this,Pn).config).onError)==null?void 0:v.call(b,E,t,this.state.context,this)),await((y=(g=this.options).onError)==null?void 0:y.call(g,E,t,this.state.context)),await((N=(j=ce(this,Pn).config).onSettled)==null?void 0:N.call(j,void 0,E,this.state.variables,this.state.context,this)),await((C=(k=this.options).onSettled)==null?void 0:C.call(k,void 0,E,t,this.state.context)),E}finally{xn(this,es,Hs).call(this,{type:"error",error:E})}}finally{ce(this,Pn).runNext(this)}}},Xr=new WeakMap,Pn=new WeakMap,ei=new WeakMap,es=new WeakSet,Hs=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),Dn.batch(()=>{ce(this,Xr).forEach(r=>{r.onMutationUpdate(t)}),ce(this,Pn).notify({mutation:this,type:"updated",action:t})})},Mw);function UD(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Qn,kc,Iw,zD=(Iw=class extends mh{constructor(t={}){super();Nt(this,Qn);Nt(this,kc);this.config=t,it(this,Qn,new Map),it(this,kc,Date.now())}build(t,n,r){const a=new FD({mutationCache:this,mutationId:++Zc(this,kc)._,options:t.defaultMutationOptions(n),state:r});return this.add(a),a}add(t){const n=yd(t),r=ce(this,Qn).get(n)??[];r.push(t),ce(this,Qn).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=yd(t);if(ce(this,Qn).has(n)){const a=(r=ce(this,Qn).get(n))==null?void 0:r.filter(i=>i!==t);a&&(a.length===0?ce(this,Qn).delete(n):ce(this,Qn).set(n,a))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=ce(this,Qn).get(yd(t)))==null?void 0:r.find(a=>a.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=ce(this,Qn).get(yd(t)))==null?void 0:r.find(a=>a!==t&&a.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){Dn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...ce(this,Qn).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>wy(n,r))}findAll(t={}){return this.getAll().filter(n=>wy(t,n))}notify(t){Dn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Dn.batch(()=>Promise.all(t.map(n=>n.continue().catch(kr))))}},Qn=new WeakMap,kc=new WeakMap,Iw);function yd(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function _y(e){return{onFetch:(t,n)=>{var u,f,m,w,x;const r=t.options,a=(m=(f=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:f.fetchMore)==null?void 0:m.direction,i=((w=t.state.data)==null?void 0:w.pages)||[],o=((x=t.state.data)==null?void 0:x.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const d=async()=>{let p=!1;const b=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},v=j_(t.options,t.fetchOptions),g=async(y,j,N)=>{if(p)return Promise.reject();if(j==null&&y.pages.length)return Promise.resolve(y);const k={queryKey:t.queryKey,pageParam:j,direction:N?"backward":"forward",meta:t.options.meta};b(k);const C=await v(k),{maxPages:E}=t.options,H=N?PD:ED;return{pages:H(y.pages,C,E),pageParams:H(y.pageParams,j,E)}};if(a&&i.length){const y=a==="backward",j=y?BD:Ny,N={pages:i,pageParams:o},k=j(r,N);l=await g(N,k,y)}else{const y=e??i.length;do{const j=c===0?o[0]??r.initialPageParam:Ny(r,l);if(c>0&&j==null)break;l=await g(l,j),c++}while(c<y)}return l};t.options.persister?t.fetchFn=()=>{var p,b;return(b=(p=t.options).persister)==null?void 0:b.call(p,d,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function Ny(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 BD(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 Xt,na,ra,go,vo,sa,xo,yo,Lw,VD=(Lw=class{constructor(e={}){Nt(this,Xt);Nt(this,na);Nt(this,ra);Nt(this,go);Nt(this,vo);Nt(this,sa);Nt(this,xo);Nt(this,yo);it(this,Xt,e.queryCache||new $D),it(this,na,e.mutationCache||new zD),it(this,ra,e.defaultOptions||{}),it(this,go,new Map),it(this,vo,new Map),it(this,sa,0)}mount(){Zc(this,sa)._++,ce(this,sa)===1&&(it(this,xo,__.subscribe(async e=>{e&&(await this.resumePausedMutations(),ce(this,Xt).onFocus())})),it(this,yo,_u.subscribe(async e=>{e&&(await this.resumePausedMutations(),ce(this,Xt).onOnline())})))}unmount(){var e,t;Zc(this,sa)._--,ce(this,sa)===0&&((e=ce(this,xo))==null||e.call(this),it(this,xo,void 0),(t=ce(this,yo))==null||t.call(this),it(this,yo,void 0))}isFetching(e){return ce(this,Xt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ce(this,na).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ce(this,Xt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=ce(this,Xt).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(xy(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return ce(this,Xt).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=ce(this,Xt).get(r.queryHash),i=a==null?void 0:a.state.data,o=jD(t,i);if(o!==void 0)return ce(this,Xt).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Dn.batch(()=>ce(this,Xt).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ce(this,Xt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=ce(this,Xt);Dn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=ce(this,Xt),r={type:"active",...e};return Dn.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=Dn.batch(()=>ce(this,Xt).findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(kr).catch(kr)}invalidateQueries(e={},t={}){return Dn.batch(()=>
356{if(ce(this,Xt).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=Dn.batch(()=>ce(this,Xt).findAll(e).filter(a=>!a.isDisabled()).map(a=>{let i=a.fetch(void 0,n);return n.throwOnError||(i=i.catch(kr)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(kr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=ce(this,Xt).build(this,t);return n.isStaleByTime(xy(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(kr).catch(kr)}fetchInfiniteQuery(e){return e.behavior=_y(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(kr).catch(kr)}ensureInfiniteQueryData(e){return e.behavior=_y(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return _u.isOnline()?ce(this,na).resumePausedMutations():Promise.resolve()}getQueryCache(){return ce(this,Xt)}getMutationCache(){return ce(this,na)}getDefaultOptions(){return ce(this,ra)}setDefaultOptions(e){it(this,ra,e)}setQueryDefaults(e,t){ce(this,go).set(ec(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ce(this,go).values()];let n={};return t.forEach(r=>{tc(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){ce(this,vo).set(ec(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ce(this,vo).values()];let n={};return t.forEach(r=>{tc(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...ce(this,ra).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ug(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.enabled!==!0&&t.queryFn===zg&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ce(this,ra).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ce(this,Xt).clear(),ce(this,na).clear()}},Xt=new WeakMap,na=new WeakMap,ra=new WeakMap,go=new WeakMap,vo=new WeakMap,sa=new WeakMap,xo=new WeakMap,yo=new WeakMap,Lw),WD=h.createContext(void 0),HD=({client:e,children:t})=>(h.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(WD.Provider,{value:e,children:t}));/** 357 * @remix-run/router v1.20.0 358 * 359 * Copyright (c) Remix Software Inc. 360 * 361 * This source code is licensed under the MIT license found in the 362 * LICENSE.md file in the root directory of this source tree. 363 * 364 * @license MIT 365 */function nc(){return nc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nc.apply(this,arguments)}var la;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(la||(la={}));const Sy="popstate";function qD(e){e===void 0&&(e={});function t(r,a){let{pathname:i,search:o,hash:l}=r.location;return Zm("",{pathname:i,search:o,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:Nu(a)}return GD(t,n,null,e)}function an(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function E_(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function YD(){return Math.random().toString(36).substr(2,8)}function ky(e,t){return{usr:e.state,key:e.key,idx:t}}function Zm(e,t,n,r){return n===void 0&&(n=null),nc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?qo(t):t,{state:n,key:t&&t.key||r||YD()})}function Nu(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function qo(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function GD(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:i=!1}=r,o=a.history,l=la.Pop,c=null,d=u();d==null&&(d=0,o.replaceState(nc({},o.state,{idx:d}),""));function u(){return(o.state||{idx:null}).idx}function f(){l=la.Pop;let b=u(),v=b==null?null:b-d;d=b,c&&c({action:l,location:p.location,delta:v})}function m(b,v){l=la.Push;let g=Zm(p.location,b,v);d=u()+1;let y=ky(g,d),j=p.createHref(g);try{o.pushState(y,"",j)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;a.location.assign(j)}i&&c&&c({action:l,location:p.location,delta:1})}function w(b,v){l=la.Replace;let g=Zm(p.location,b,v);d=u();let y=ky(g,d),j=p.createHref(g);o.replaceState(y,"",j),i&&c&&c({action:l,location:p.location,delta:0})}function x(b){let v=a.location.origin!=="null"?a.location.origin:a.location.href,g=typeof b=="string"?b:Nu(b);return g=g.replace(/ $/,"%20"),an(v,"No window.location.(origin|href) available to create URL for href: "+g),new URL(g,v)}let p={get action(){return l},get location(){return e(a,o)},listen(b){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(Sy,f),c=b,()=>{a.removeEventListener(Sy,f),c=null}},createHref(b){return t(a,b)},createURL:x,encodeLocation(b){let v=x(b);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:m,replace:w,go(b){return o.go(b)}};return p}var Cy;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Cy||(Cy={}));function KD(e,t,n){return n===void 0&&(n="/"),ZD(e,t,n,!1)}function ZD(e,t,n,r){let a=typeof t=="string"?qo(t):t,i=Bg(a.pathname||"/",n);if(i==null)return null;let o=P_(e);QD(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let d=l4(i);l=i4(o[c],d,r)}return l}function P_(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let a=(i,o,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(an(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not val
365id. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let d=xa([r,c.relativePath]),u=n.concat(c);i.children&&i.children.length>0&&(an(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),P_(i.children,t,u,d)),!(i.path==null&&!i.index)&&t.push({path:d,score:s4(d,i.index),routesMeta:u})};return e.forEach((i,o)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))a(i,o);else for(let c of T_(i.path))a(i,o,c)}),t}function T_(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return a?[i,""]:[i];let o=T_(r.join("/")),l=[];return l.push(...o.map(c=>c===""?i:[i,c].join("/"))),a&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function QD(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:a4(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const JD=/^:[\w-]+$/,XD=3,e4=2,t4=1,n4=10,r4=-2,Ey=e=>e==="*";function s4(e,t){let n=e.split("/"),r=n.length;return n.some(Ey)&&(r+=r4),t&&(r+=e4),n.filter(a=>!Ey(a)).reduce((a,i)=>a+(JD.test(i)?XD:i===""?t4:n4),r)}function a4(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function i4(e,t,n){let{routesMeta:r}=e,a={},i="/",o=[];for(let l=0;l<r.length;++l){let c=r[l],d=l===r.length-1,u=i==="/"?t:t.slice(i.length)||"/",f=Py({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},u),m=c.route;if(!f&&d&&n&&!r[r.length-1].route.index&&(f=Py({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},u)),!f)return null;
vendor: 9,495 bytes, lines 365-374
365Object.assign(a,f.params),o.push({params:a,pathname:xa([i,f.pathname]),pathnameBase:h4(xa([i,f.pathnameBase])),route:m}),f.pathnameBase!=="/"&&(i=xa([i,f.pathnameBase]))}return o}function Py(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=o4(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let i=a[0],o=i.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:r.reduce((d,u,f)=>{let{paramName:m,isOptional:w}=u;if(m==="*"){let p=l[f]||"";o=i.slice(0,i.length-p.length).replace(/(.)\/+$/,"$1")}const x=l[f];return w&&!x?d[m]=void 0:d[m]=(x||"").replace(/%2F/g,"/"),d},{}),pathname:i,pathnameBase:o,pattern:e}}function o4(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),E_(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=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function l4(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return E_(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Bg(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)||"/"}function c4(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?qo(e):e;return{pathname:n?n.startsWith("/")?n:d4(n,t):t,search:f4(r),hash:m4(a)}}function d4(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function wf(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 u4(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function R_(e,t){let n=u4(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function D_(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=qo(e):(a=nc({},e),an(!a.pathname||!a.pathname.includes("?"),wf("?","pathname","search",a)),an(!a.pathname||!a.pathname.includes("#"),wf("#","pathname","hash",a)),an(!a.search||!a.search.includes("#"),wf("#","search","hash",a)));let i=e===""||a.pathname==="",o=i?"/":a.pathname,l;if(o==null)l=n;else{let f=t.length-1;if(!r&&o.startsWith("..")){let m=o.split("/");for(;m[0]==="..";)m.shift(),f-=1;a.pathname=m.join("/")}l=f>=0?t[f]:"/"}let c=c4(a,l),d=o&&o!=="/"&&o.endsWith("/"),u=(i||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}const xa=e=>e.join("/").replace(/\/\/+/g,"/"),h4=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),f4=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,m4=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function p4(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const O_=["post","put","patch","delete"];new Set(O_);const g4=["get",...O_];new Set(g4);/** 366 * React Router v6.27.0 367 * 368 * Copyright (c) Remix Software Inc. 369 * 370 * This source code is licensed under the MIT license found in the 371 * LICENSE.md file in the root directory of this source tree. 372 * 373 * @license MIT 374 */function rc(){return rc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rc.apply(this,arguments)}const Vg=h.createContext(null),v4=h.createContext(null),_i=h.createContext(null),gh=h.createContext(null),Aa=h.createContext({outlet:null,matches:[],isDataRoute:!1}),A_=h.createContext(null);function x4(e,t){let{relative:n}=t===void 0?{}:t;Ic()||an(!1);let{basename:r,navigator:a}=h.useContext(_i),{hash:i,pathname:o,search:l}=I_(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:xa([r,o])),a.createHref({pathname:c,search:l,hash:i})}function Ic(){return h.useContext(gh)!=null}function Yo(){return Ic()||an(!1),h.useContext(gh).location}function M_(e){h.useContext(_i).static||h.useLayoutEffect(e)}function Et(){let{isDataRoute:e}=h.useContext(Aa);return e?R4():y4()}function y4(){Ic()||an(!1);let e=h.useContext(Vg),{basename:t,future:n,navigator:r}=h.useContext(_i),{matches:a}=h.useContext(Aa),{pathname:i}=Yo(),o=JSON.stringify(R_(a,n.v7_relativeSplatPath)),l=h.useRef(!1);return M_(()=>{l.current=!0}),h.useCallback(function(d,u){if(u===void 0&&(u={}),!l.current)return;if(typeof d=="number"){r.go(d);return}let f=D_(d,JSON.parse(o),i,u.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:xa([t,f.pathname])),(u.replace?r.replace:r.push)(f,u.state,u)},[t,r,o,i,e])}function vh(){let{matches:e}=h.useContext(Aa),t=e[e.length-1];return t?t.params:{}}function I_(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=h.useContext(_i),{matches:a}=h.useContext(Aa),{pathname:i}=Yo(),o=JSON.stringify(R_(a,r.v7_relativeSplatPath));return h.useMemo(()=>D_(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function w4(e,t){return b4(e,t)}function b4(e,t,n,r){Ic()||an(!1);let{navigator:a}=h.useContext(_i),{matches:i}=h.useContext(Aa),o=i[i.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let d=Yo(),u;if(t){var f;let b=typeof t=="string"?qo(t):t;c==="/"||(f=b.pathname)!=null&&f.startsWith(c)||an(!1),u=b}else u=d;let m=u.pathname||"/",w=m;if(c!=="/"){let b=c.replace(/^\//,"").split("/");w="/"+m.replace(/^\//,"").split("/").slice(b.length).join("/")}let x=KD(e,{pathname:w}),p=k4(x&&x.map(b=>Object.assign({},b,{params:Object.assign({},l,b.params),pathname:xa([c,a.encodeLocation?a.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?c:xa([c,a.encodeLocation?a.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),i,n,r);return t&&p?h.createElement(gh.Provider,{value:{location:rc({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:la.Pop}},p):p}function j4(){let e=T4(),t=p4(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),n?h.createElement("pre",{style:a},n):null,null)}const _4=h.createElement(j4,null);class N4 extends h.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?h.createElement(Aa.Provider,{value:this.props.routeContext},h.createElement(A_.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function S4(e){let{routeContext:t,match:n,children:r}=e,a=h.useContext(Vg);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),h.createElement(Aa.Provider,{value:t},r)}function k4(e,t,n,r){var a;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(a=n)==null?void 0:a.errors;if(l!=null){let u=o.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);u>=0||an(!1),o=o.slice(0,Math.min(o.length,u+1))}let c=!1,d=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u<o.length;u++){let f=o[u];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(d=u),f.route.id){let{loaderData:m,errors:w}=n,x=f.route.loader&&m[f.route.id]===void 0&&(!w||w[f.route.id]===void 0);if(f.route.lazy||x){c=!0,d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}return o.reduceRight((u,f,m)=>{let w,x=!1,p=null,b=null;n&&(w=l&&f.route.id?l[f.route.id]:void 0,p=f.route.errorElement||_4,c&&(d<0&&m===0?(x=!0,b=null):d===m&&(x=!0,b=f.route.hydrateFallbackElement||null)));let v=t.concat(o.slice(0,m+1)),g=()=>{let y;return w?y=p:x?y=b:f.route.Component?y=h.createElement(f.route.Component,null):f.route.element?y=f.route.element:y=u,h.createElement(S4,{match:f,routeContext:{outlet:u,matches:v,isDataRoute:n!=null},children:y})};return n&&(f.route.ErrorBoundary||f.route.errorElement||m===0)?h.createElement(N4,{location:n.location,revalidation:n.revalidation,component:p,error:w,children:g(),routeC
374ontext:{outlet:null,matches:v,isDataRoute:!0}}):g()},null)}var L_=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(L_||{}),Su=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Su||{});function C4(e){let t=h.useContext(Vg);return t||an(!1),t}function E4(e){let t=h.useContext(v4);return t||an(!1),t}function P4(e){let t=h.useContext(Aa);return t||an(!1),t}function $_(e){let t=P4(),n=t.matches[t.matches.length-1];return n.route.id||an(!1),n.route.id}function T4(){var e;let t=h.useContext(A_),n=E4(Su.UseRouteError),r=$_(Su.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function R4(){let{router:e}=C4(L_.UseNavigateStable),t=$_(Su.UseNavigateStable),n=h.useRef(!1);return M_(()=>{n.current=!0}),h.useCallback(function(a,i){i===void 0&&(i={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,rc({fromRouteId:t},i)))},[e,t])}function pt(e){an(!1)}function D4(e){let{basename:t="/",children:n=null,location:r,navigationType:a=la.Pop,navigator:i,static:o=!1,future:l}=e;Ic()&&an(!1);let c=t.replace(/^\/*/,"/"),d=h.useMemo(()=>({basename:c,navigator:i,static:o,future:rc({v7_relativeSplatPath:!1},l)}),[c,l,i,o]);typeof r=="string"&&(r=qo(r));let{pathname:u="/",search:f="",hash:m="",state:w=null,key:x="default"}=r,p=h.useMemo(()=>{let b=Bg(u,c);return b==null?null:{location:{pathname:b,search:f,hash:m,state:w,key:x},navigationType:a}},[c,u,f,m,w,x,a]);return p==null?null:h.createElement(_i.Provider,{value:d},h.createElement(gh.Provider,{children:n,value:p}))}function O4(e){let{children:t,location:n}=e;return w4(Qm(t),n)}new Promise(()=>{});function Qm(e,t){t===void 0&&(t=[]);let n=[];return h.Children.forEach(e,(r,a)=>{if(!h.isValidElement(r))return;let i=[...t,a];if(r.type===h.Fragment){n.push.apply(n,Qm(r.props.children,i));return}r.type!==pt&&an(!1),!r.props.index||!r.props.children||an(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=Qm(r.props.children,i)),n.push(o)}),n}/** 375 * React Router DOM v6.27.0 376 * 377 * Copyright (c) Remix Software Inc. 378 * 379 * This source code is licensed under the MIT license found in the 380 * LICENSE.md file in the root directory of this source tree. 381 * 382 * @license MIT 383 */function Jm(){return Jm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jm.apply(this,arguments)}function A4(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function M4(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function I4(e,t){return e.button===0&&(!t||t==="_self")&&!M4(e)}function Xm(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function L4(e,t){let n=Xm(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}const $4=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],F4="6";try{window.__reactRouterVersion=F4}catch{}const U4="startTransition",Ty=Kw[U4];function z4(e){let{basename:t,children:n,future:r,window:a}=e,i=h.useRef();i.current==null&&(i.current=qD({window:a,v5Compat:!0}));let o=i.current,[l,c]=h.useState({action:o.action,location:o.location}),{v7_startTransition:d}=r||{},u=h.useCallback(f=>{d&&Ty?Ty(()=>c(f)):c(f)},[c,d]);return h.useLayoutEffect(()=>o.listen(u),[o,u]),h.createElement(D4,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const B4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",V4=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Es=h.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:i,replace:o,state:l,target:c,to:d,preventScrollReset:u,viewTransition:f}=t,m=A4(t,$4),{basename:w}=h.useContext(_i),x,p=!1;
383if(typeof d=="string"&&V4.test(d)&&(x=d,B4))try{let y=new URL(window.location.href),j=d.startsWith("//")?new URL(y.protocol+d):new URL(d),N=Bg(j.pathname,w);j.origin===y.origin&&N!=null?d=N+j.search+j.hash:p=!0}catch{}let b=x4(d,{relative:a}),v=W4(d,{replace:o,state:l,target:c,preventScrollReset:u,relative:a,viewTransition:f});function g(y){r&&r(y),y.defaultPrevented||v(y)}return h.createElement("a",Jm({},m,{href:x||b,onClick:p||i?r:g,ref:n,target:c}))});var Ry;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ry||(Ry={}));var Dy;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Dy||(Dy={}));function W4(e,t){let{target:n,replace:r,state:a,preventScrollReset:i,relative:o,viewTransition:l}=t===void 0?{}:t,c=Et(),d=Yo(),u=I_(e,{relative:o});return h.useCallback(f=>{if(I4(f,n)){f.preventDefault();let m=r!==void 0?r:Nu(d)===Nu(u);c(e,{replace:m,state:a,preventScrollReset:i,relative:o,viewTransition:l})}},[d,c,u,r,a,n,e,i,o,l])}function Wg(e){let t=h.useRef(Xm(e)),n=h.useRef(!1),r=Yo(),a=h.useMemo(()=>L4(r.search,n.current?null:t.current),[r.search]),i=Et(),o=h.useCallback((l,c)=>{const d=Xm(typeof l=="function"?l(a):l);n.current=!0,i("?"+d,c)},[i,a]);return[a,o]}const sc=Ac("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-0.5 sm:px-4 py-2",sm:"h-9 rounded-md px-0.5 sm:px-3",lg:"h-11 rounded-md px-3 sm:px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),L=h.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},i)=>{const o=r?ja:"button";return s.jsx(o,{className:ke(sc({variant:t,size:n,className:e})),ref:i,...a})});L.displayName="Button";const Q=h.forwardRef(({className:e,type:t,...n},r)=>s.jsx("input",{type:t,className:ke("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}));Q.displayName="Input";const pe=h.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ke("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));pe.displayName="Card";const Ae=h.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ke("flex flex-col space-y-1.5 p-6",e),...t}));Ae.displayName="CardHeader";const Me=h.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:ke("text-2xl font-semibold leading-none tracking-tight",e),...t}));Me.displayName="CardTitle";const St=h.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:ke("text-sm text-muted-foreground",e),...t}));St.displayName="CardDescription";const ve=h.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ke("p-6 pt-0",e),...t}));ve.displayName="CardContent";const Hg=h.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ke("flex items-center p-6 pt-0",e),...t}));Hg.displayName="CardFooter";const H4=Ac("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground",vip:"border-transparent bg-[#ff0000] text-white hover:bg-[#ff0000]/80"}},defaultVariants:{variant:"default"}});function Ie({className:e,variant:t,...n}){return s.jsx("div",{className:ke(H4({variant:t}),e),...n})}var bf="focusScope.autoFocusOnMount",jf="focusScope.autoFocusOnUnmount",Oy={bubbles:!1,cancelable:!0},q4="FocusScope",xh=h.forwardRef((e,t)=>
vendor: 5,047 bytes, line 383
383{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[l,c]=h.useState(null),d=Gn(a),u=Gn(i),f=h.useRef(null),m=wt(t,p=>c(p)),w=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(r){let p=function(y){if(w.paused||!l)return;const j=y.target;l.contains(j)?f.current=j:qs(f.current,{select:!0})},b=function(y){if(w.paused||!l)return;const j=y.relatedTarget;j!==null&&(l.contains(j)||qs(f.current,{select:!0}))},v=function(y){if(document.activeElement===document.body)for(const N of y)N.removedNodes.length>0&&qs(l)};document.addEventListener("focusin",p),document.addEventListener("focusout",b);const g=new MutationObserver(v);return l&&g.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",b),g.disconnect()}}},[r,l,w.paused]),h.useEffect(()=>{if(l){My.add(w);const p=document.activeElement;if(!l.contains(p)){const v=new CustomEvent(bf,Oy);l.addEventListener(bf,d),l.dispatchEvent(v),v.defaultPrevented||(Y4(J4(F_(l)),{select:!0}),document.activeElement===p&&qs(l))}return()=>{l.removeEventListener(bf,d),setTimeout(()=>{const v=new CustomEvent(jf,Oy);l.addEventListener(jf,u),l.dispatchEvent(v),v.defaultPrevented||qs(p??document.body,{select:!0}),l.removeEventListener(jf,u),My.remove(w)},0)}}},[l,d,u,w]);const x=h.useCallback(p=>{if(!n&&!r||w.paused)return;const b=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,v=document.activeElement;if(b&&v){const g=p.currentTarget,[y,j]=G4(g);y&&j?!p.shiftKey&&v===j?(p.preventDefault(),n&&qs(y,{select:!0})):p.shiftKey&&v===y&&(p.preventDefault(),n&&qs(j,{select:!0})):v===g&&p.preventDefault()}},[n,r,w.paused]);return s.jsx(Ye.div,{tabIndex:-1,...o,ref:m,onKeyDown:x})});xh.displayName=q4;function Y4(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(qs(r,{select:t}),document.activeElement!==n)return}function G4(e){const t=F_(e),n=Ay(t,e),r=Ay(t.reverse(),e);return[n,r]}function F_(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ay(e,t){for(const n of e)if(!K4(n,{upTo:t}))return n}function K4(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 Z4(e){return e instanceof HTMLInputElement&&"select"in e}function qs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Z4(e)&&t&&e.select()}}var My=Q4();function Q4(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Iy(e,t),e.unshift(t)},remove(t){var n;e=Iy(e,t),(n=e[0])==null||n.resume()}}}function Iy(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function J4(e){return e.filter(t=>t.tagName!=="A")}var _f=0;function qg(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ly()),document.body.insertAdjacentElement("beforeend",e[1]??Ly()),_f++,()=>{_f===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),_f--}},[])}function Ly(){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 ns=function(){return ns=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},ns.apply(this,arguments)};function U_(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 a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function X4(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,i;r<a;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Vd="right-scroll-bar-position",Wd="width-before-scroll-bar",eO="with-scroll-bars-hidden",tO="--removed-body-scroll-bar-size";function Nf(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function nO(e,t){var n=h.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var rO=typeof window<"u"?h.useLayoutEffect:h.useEffect,$y=new WeakMap;function sO(e,t){var n=nO(null,function(r){return e.forEach(function(a){return Nf(a,r)})});return rO(function(){var r=$y.get(n);if(r){var a=new Set(r),i=new Set(e),o=n.current;a.forEach(function(l){i.has(l)||Nf(l,null)}
vendor: 4,112 bytes, lines 383-398
383),i.forEach(function(l){a.has(l)||Nf(l,o)})}$y.set(n,e)},[e]),n}function aO(e){return e}function iO(e,t){t===void 0&&(t=aO);var n=[],r=!1,a={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(i){var o=t(i,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(i),o=n}var c=function(){var u=o;o=[],u.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(u){o.push(u),d()},filter:function(u){return o=o.filter(u),n}}}};return a}function oO(e){e===void 0&&(e={});var t=iO(null);return t.options=ns({async:!0,ssr:!1},e),t}var z_=function(e){var t=e.sideCar,n=U_(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 h.createElement(r,ns({},n))};z_.isSideCarExport=!0;function lO(e,t){return e.useMedium(t),z_}var B_=oO(),Sf=function(){},yh=h.forwardRef(function(e,t){var n=h.useRef(null),r=h.useState({onScrollCapture:Sf,onWheelCapture:Sf,onTouchMoveCapture:Sf}),a=r[0],i=r[1],o=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,f=e.shards,m=e.sideCar,w=e.noIsolation,x=e.inert,p=e.allowPinchZoom,b=e.as,v=b===void 0?"div":b,g=e.gapMode,y=U_(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=m,N=sO([n,t]),k=ns(ns({},y),a);return h.createElement(h.Fragment,null,u&&h.createElement(j,{sideCar:B_,removeScrollBar:d,shards:f,noIsolation:w,inert:x,setCallbacks:i,allowPinchZoom:!!p,lockRef:n,gapMode:g}),o?h.cloneElement(h.Children.only(l),ns(ns({},k),{ref:N})):h.createElement(v,ns({},k,{className:c,ref:N}),l))});yh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};yh.classNames={fullWidth:Wd,zeroRight:Vd};var cO=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function dO(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=cO();return t&&e.setAttribute("nonce",t),e}function uO(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function hO(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var fO=function(){var e=0,t=null;return{add:function(n){e==0&&(t=dO())&&(uO(t,n),hO(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},mO=function(){var e=fO();return function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},V_=function(){var e=mO(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},pO={left:0,top:0,right:0,gap:0},kf=function(e){return parseInt(e||"",10)||0},gO=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[kf(n),kf(r),kf(a)]},vO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return pO;var t=gO(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])}},xO=V_(),io="data-scroll-locked",yO=function(e,t,n,r){var a=e.left,i=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),` 384 .`.concat(eO,` { 385 overflow: hidden `).concat(r,`; 386 padding-right: `).concat(l,"px ").concat(r,`; 387 } 388 body[`).concat(io,`] { 389 overflow: hidden `).concat(r,`; 390 overscroll-behavior: contain; 391 `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` 392 padding-left: `.concat(a,`px; 393 padding-top: `).concat(i,`px; 394 padding-right: `).concat(o,`px; 395 margin-left:0; 396 margin-top:0; 397 margin-right: `).concat(l,"px ").concat(r,`; 398 `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";
398")].filter(Boolean).join(""),` 399 } 400 401 .`).concat(Vd,` { 402 right: `).concat(l,"px ").concat(r,`; 403 } 404 405 .`).concat(Wd,` { 406 margin-right: `).concat(l,"px ").concat(r,`; 407 } 408 409 .`).concat(Vd," .").concat(Vd,` { 410 right: 0 `).concat(r,`; 411 } 412 413 .`).concat(Wd," .").concat(Wd,` { 414 margin-right: 0 `).concat(r,`; 415 } 416 417 body[`).concat(io,`] { 418 `).concat(tO,": ").concat(l,`px; 419 } 420`)},Fy=function(){var e=parseInt(document.body.getAttribute(io)||"0",10);return isFinite(e)?e:0},wO=function(){h.useEffect(function(){return document.body.setAttribute(io,(Fy()+1).toString()),function(){var e=Fy()-1;e<=0?document.body.removeAttribute(io):document.body.setAttribute(io,e.toString())}},[])},bO=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;wO();var i=h.useMemo(function(){return vO(a)},[a]);return h.createElement(xO,{styles:yO(i,!t,a,n?"":"!important")})},ep=!1;if(typeof window<"u")try{var wd=Object.defineProperty({},"passive",{get:function(){return ep=!0,!0}});window.addEventListener("test",wd,wd),window.removeEventListener("test",wd,wd)}catch{ep=!1}var Ci=ep?{passive:!1}:!1,jO=function(e){return e.tagName==="TEXTAREA"},W_=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!jO(e)&&n[t]==="visible")},_O=function(e){return W_(e,"overflowY")},NO=function(e){return W_(e,"overflowX")},Uy=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=H_(e,r);if(a){var i=q_(e,r),o=i[1],l=i[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},SO=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},kO=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},H_=function(e,t){return e==="v"?_O(t):NO(t)},q_=function(e,t){return e==="v"?SO(t):kO(t)},CO=function(e,t){return e==="h"&&t==="rtl"?-1:1},EO=function(e,t,n,r,a){var i=CO(e,window.getComputedStyle(t).direction),o=i*r,l=n.target,c=t.contains(l),d=!1,u=o>0,f=0,m=0;do{var w=q_(e,l),x=w[0],p=w[1],b=w[2],v=p-b-i*x;(x||v)&&H_(e,l)&&(f+=v,m+=x),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(u&&(Math.abs(f)<1||!a)||!u&&(Math.abs(m)<1||!a))&&(d=!0),d},bd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},zy=function(e){return[e.deltaX,e.deltaY]},By=function(e){return e&&"current"in e?e.current:e},PO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},TO=function(e){return` 421 .block-interactivity-`.concat(e,` {pointer-events: none;} 422 .allow-interactivity-`).concat(e,` {pointer-events: all;} 423`)},RO=0,Ei=[];function DO(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),a=h.useState(RO++)[0],i=h.useState(V_)[0],o=h.useRef(e);h.useEffect(function(){o.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var p=X4([e.lockRef.current],(e.shards||[]).map(By),!0).filter(Boolean);return p.forEach(function(b){return b.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),p.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=h.useCallback(function(p,b){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!o.current.allowPinchZoom;var v=bd(p),g=n.current,y="deltaX"in p?p.deltaX:g[0]-v[0],j="deltaY"in p?p.deltaY:g[1]-v[1],N,k=p.target,C=Math.abs(y)>Math.abs(j)?"h":"v";if("touches"in p&&C==="h"&&k.type==="range")return!1;var E=Uy(C,k);if(!E)return!0;if(E?N=C:(N=C==="v"?"h":"v",E=Uy(C,k)),!E)return!1;if(!r.current&&"changedTouches"in p&&(y||j)&&(r.current=N),!N)return!0;var H=r.current||N;return EO(H,b,p,H==="h"?y:j,!0)},[]),c=h.useCallback(function(p){var b=p;if(!(!Ei.length||Ei[Ei.length-1]!==i)){var v="deltaY"in b?zy(b):bd(b),g=t.current.filter(function(N){return N.name===b.type&&(N.target===b.target||b.target===N.shadowParent)&&PO(N.delta,v)}
vendor: 8,964 bytes, lines 423-427
423)[0];if(g&&g.should){b.cancelable&&b.preventDefault();return}if(!g){var y=(o.current.shards||[]).map(By).filter(Boolean).filter(function(N){return N.contains(b.target)}),j=y.length>0?l(b,y[0]):!o.current.noIsolation;j&&b.cancelable&&b.preventDefault()}}},[]),d=h.useCallback(function(p,b,v,g){var y={name:p,delta:b,target:v,should:g,shadowParent:OO(v)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(j){return j!==y})},1)},[]),u=h.useCallback(function(p){n.current=bd(p),r.current=void 0},[]),f=h.useCallback(function(p){d(p.type,zy(p),p.target,l(p,e.lockRef.current))},[]),m=h.useCallback(function(p){d(p.type,bd(p),p.target,l(p,e.lockRef.current))},[]);h.useEffect(function(){return Ei.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",c,Ci),document.addEventListener("touchmove",c,Ci),document.addEventListener("touchstart",u,Ci),function(){Ei=Ei.filter(function(p){return p!==i}),document.removeEventListener("wheel",c,Ci),document.removeEventListener("touchmove",c,Ci),document.removeEventListener("touchstart",u,Ci)}},[]);var w=e.removeScrollBar,x=e.inert;return h.createElement(h.Fragment,null,x?h.createElement(i,{styles:TO(a)}):null,w?h.createElement(bO,{gapMode:e.gapMode}):null)}function OO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const AO=lO(B_,DO);var wh=h.forwardRef(function(e,t){return h.createElement(yh,ns({},e,{ref:t,sideCar:AO}))});wh.classNames=yh.classNames;var MO=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Pi=new WeakMap,jd=new WeakMap,_d={},Cf=0,Y_=function(e){return e&&(e.host||Y_(e.parentNode))},IO=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Y_(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})},LO=function(e,t,n,r){var a=IO(t,Array.isArray(e)?e:[e]);_d[n]||(_d[n]=new WeakMap);var i=_d[n],o=[],l=new Set,c=new Set(a),d=function(f){!f||l.has(f)||(l.add(f),d(f.parentNode))};a.forEach(d);var u=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(m){if(l.has(m))u(m);else try{var w=m.getAttribute(r),x=w!==null&&w!=="false",p=(Pi.get(m)||0)+1,b=(i.get(m)||0)+1;Pi.set(m,p),i.set(m,b),o.push(m),p===1&&x&&jd.set(m,!0),b===1&&m.setAttribute(n,"true"),x||m.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",m,v)}})};return u(t),l.clear(),Cf++,function(){o.forEach(function(f){var m=Pi.get(f)-1,w=i.get(f)-1;Pi.set(f,m),i.set(f,w),m||(jd.has(f)||f.removeAttribute(r),jd.delete(f)),w||f.removeAttribute(n)}),Cf--,Cf||(Pi=new WeakMap,Pi=new WeakMap,jd=new WeakMap,_d={})}},Yg=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=MO(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live]"))),LO(r,a,n,"aria-hidden")):function(){return null}},Gg="Dialog",[G_,K_]=Hr(Gg),[$O,Yr]=G_(Gg),Z_=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!0}=e,l=h.useRef(null),c=h.useRef(null),[d=!1,u]=cs({prop:r,defaultProp:a,onChange:i});return s.jsx($O,{scope:t,triggerRef:l,contentRef:c,contentId:Cs(),titleId:Cs(),descriptionId:Cs(),open:d,onOpenChange:u,onOpenToggle:h.useCallback(()=>u(f=>!f),[u]),modal:o,children:n})};Z_.displayName=Gg;var Q_="DialogTrigger",J_=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Yr(Q_,n),i=wt(t,a.triggerRef);return s.jsx(Ye.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Qg(a.open),...r,ref:i,onClick:Le(e.onClick,a.onOpenToggle)})});J_.displayName=Q_;var Kg="DialogPortal",[FO,X_]=G_(Kg,{forceMount:void 0}),eN=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=Yr(Kg,t);return s.jsx(FO,{scope:t,forceMount:n,children:h.Children.map(r,o=>s.jsx(qr,{present:n||i.open,children:s.jsx(Dc,{asChild:!0,container:a,children:o})}))})};eN.displayName=Kg;var ku="DialogOverlay",tN=h.forwardRef((e,t)=>{const n=X_(ku,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Yr(ku,e.__scopeDialog);return i.modal?s.jsx(qr,{present:r||i.open,children:s.jsx(UO,{...a,ref:t})}):null});tN.displayName=ku;var UO=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Yr(ku,n);return s.jsx(wh,{as:ja,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(Ye.div,{"data-state":Qg(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),mi="DialogContent",nN=h.forwardRef((e,t)=>{const n=X_(mi,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Yr(mi,e.__scopeDialog);return s.jsx(qr,{present:r||i.open,children:i.modal?s.jsx(zO,{...a,ref:t}):s.jsx(BO,{...a,ref:t})})});nN.displayName=mi;var zO=h.forwardRef((e,t)=>{const n=Yr(mi,e.__scopeDialog),r=h.useRef(null),a=wt(t,n.contentRef,r);return h.useEffect(()=>{const i=r.current;if(i)return Yg(i)},[]),s.jsx(rN,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Le(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Le(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&i.preventDefault()}),onFocusOutside:Le(e.onFocusOutside,i=>i.preventDefault())})}),BO=h.forwardRef((e,t)=>{const n=Yr(mi,e.__scopeDialog),r=h.useRef(!1),a=h.useRef(!1);return s.jsx(rN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),rN=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,l=Yr(mi,n),c=h.useRef(null),d=wt(t,c);return qg(),s.jsxs(s.Fragment,{children:[s.jsx(xh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(zo,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Qg(l.open),...o,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(WO,{titleId:l.titleId}),s.jsx(qO,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Zg="DialogTitle",sN=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Yr(Zg,n);return s.jsx(Ye.h2,{id:a.titleId,...r,ref:t})});sN.displayName=Zg;var aN="DialogDescription",iN=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Yr(aN,n);return s.jsx(Ye.p,{id:a.descriptionId,...r,ref:t})});iN.displayName=aN;var oN="DialogClose",lN=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Yr(oN,n);return s.jsx(Ye.button,{type:"button",...r,ref:t,onClick:Le(e.onClick,()=>a.onOpenChange(!1))})});lN.displayName=oN;function Qg(e){return e?"open":"closed"}var cN="DialogTitleWarning",[VO,dN]=OP(cN,{contentName:mi,titleName:Zg,docsSlug:"dialog"}),WO=({titleId:e})=>{const t=dN(cN),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 424 425If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 426 427For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return h.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},HO="DialogDescriptionWarning",qO=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${dN(HO).contentName}}.`;return h.useEffect(()=>{var i;const a=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},uN=Z_,hN=J_,fN=eN,Jg=tN,Xg=nN,ev=sN,tv=iN,nv=lN;const ht=uN,Nn=hN,YO=fN,mN=h.forwardRef(({className:e,...t},n)=>s.jsx(Jg,{ref:n,className:ke("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}));mN.displayName=Jg.displayName;const dt=h.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(YO,{children:[s.jsx(mN,{}),s.jsxs(Xg,{ref:r,className:ke("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
427nded-lg",e),...n,children:[t,s.jsxs(nv,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[s.jsx(rs,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));dt.displayName=Xg.displayName;const ft=({className:e,...t})=>s.jsx("div",{className:ke("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ft.displayName="DialogHeader";const mt=h.forwardRef(({className:e,...t},n)=>s.jsx(ev,{ref:n,className:ke("text-lg font-semibold leading-none tracking-tight",e),...t}));mt.displayName=ev.displayName;const oo=h.forwardRef(({className:e,...t},n)=>s.jsx(tv,{ref:n,className:ke("text-sm text-muted-foreground",e),...t}));oo.displayName=tv.displayName;const GO="modulepreload",KO=function(e){return"/"+e},Vy={},Lc=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));a=Promise.allSettled(n.map(c=>{if(c=KO(c),c in Vy)return;Vy[c]=!0;const d=c.endsWith(".css"),u=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${u}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":GO,d||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),d)return new Promise((m,w)=>{f.addEventListener("load",m),f.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return a.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},ZO=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...n)=>Lc(async()=>{const{default:r}=await Promise.resolve().then(()=>Go);return{default:r}},void 0).then(({default:r})=>r(...n)):t=fetch,(...n)=>t(...n)};class rv extends Error{constructor(t,n="FunctionsError",r){super(t),this.name=n,this.context=r}}class QO extends rv{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class Wy extends rv{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class Hy extends rv{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var tp;(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"})(tp||(tp={}));var JO=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function l(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(l,c)}d((r=r.apply(e,t||[])).next())})};class XO{constructor(t,{headers:n={},customFetch:r,region:a=tp.Any}={}){this.url=t,this.headers=n,this.region=a,this.fetch=ZO(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t,n={}){var r;return JO(this,void 0,void 0,function*(){try{const{headers:a,method:i,body:o}=n;let l={},{region:c}=n;c||(c=this.region);const d=new URL(`${this.url}/${t}`);c&&c!=="any"&&(l["x-region"]=c,d.searchParams.set("forceFunctionRegion",c));let u;o&&(a&&!Object.prototype.hasOwnProperty.call(a,"Content-Type")||!a)&&(typeof Blob<"u"&&o instanceof Blob||o instanceof ArrayBuffer?(l["Content-Type"]="application/octet-stream",u=o):typeof o=="string"?(l["Content-Type"]="text/plain",u=o):typeof FormData<"u"&&o instanceof FormData?u=o:(l["Content-Type"]="application/json",u=JSON.stringify(o)));const f=yield this.fetch(d.toString(),{method:i||"POST",headers:Object.assign(Object.assign(Object.assign({},l),this.headers),a),body:u}).catch(p=>{throw new QO(p)}),m=f.headers.get("x-relay-error");
427if(m&&m==="true")throw new Wy(f);if(!f.ok)throw new Hy(f);let w=((r=f.headers.get("Content-Type"))!==null&&r!==void 0?r:"text/plain").split(";")[0].trim(),x;return w==="application/json"?x=yield f.json():w==="application/octet-stream"?x=yield f.blob():w==="text/event-stream"?x=f:w==="multipart/form-data"?x=yield f.formData():x=yield f.text(),{data:x,error:null,response:f}}catch(a){return{data:null,error:a,response:a instanceof Hy||a instanceof Wy?a.context:void 0}}})}}var Fn={},sv={},bh={},$c={},jh={},_h={},eA=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},Ro=eA();const tA=Ro.fetch,pN=Ro.fetch.bind(Ro),gN=Ro.Headers,nA=Ro.Request,rA=Ro.Response,Go=Object.freeze(Object.defineProperty({__proto__:null,Headers:gN,Request:nA,Response:rA,default:pN,fetch:tA},Symbol.toStringTag,{value:"Module"})),sA=Qk(Go);var Nh={};Object.defineProperty(Nh,"__esModule",{value:!0});let aA=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.co
427de=t.code}};Nh.default=aA;var vN=yr&&yr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_h,"__esModule",{value:!0});const iA=vN(sA),oA=vN(Nh);let lA=class{constructor(t){this.shouldThrowOnError=!1,this.method=t.method,this.url=t.url,this.headers=t.headers,this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=t.shouldThrowOnError,this.signal=t.signal,this.isMaybeSingle=t.isMaybeSingle,t.fetch?this.fetch=t.fetch:typeof fetch>"u"?this.fetch=iA.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,n){return this.headers=Object.assign({},this.headers),this.headers[t]=n,this}then(t,n){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");const r=this.fetch;let a=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async i=>{var o,l,c;let d=null,u=null,f=null,m=i.status,w=i.statusText;if(i.ok){if(this.method!=="HEAD"){const v=await i.text();v===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?u=v:u=JSON.parse(v))}const p=(o=this.headers.Prefer)===null||o===void 0?void 0:o.match(/count=(exact|planned|estimated)/),b=(l=i.headers.get("content-range"))===null||l===void 0?void 0:l.split("/");p&&b&&b.length>1&&(f=parseInt(b[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(u)&&(u.length>1?(d={code:"PGRST116",details:`Results contain ${u.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},u=null,f=null,m=406,w="Not Acceptable"):u.length===1?u=u[0]:u=null)}else{const p=await i.text();try{d=JSON.parse(p),Array.isArray(d)&&i.status===404&&(u=[],d=null,m=200,w="OK")}catch{i.status===404&&p===""?(m=204,w="No Content"):d={message:p}}if(d&&this.isMaybeSingle&&(!((c=d==null?void 0:d.details)===null||c===void 0)&&c.includes("0 rows"))&&(d=null,m=200,w="OK"),d&&this.shouldThrowOnError)throw new oA.default(d)}return{error:d,data:u,count:f,status:m,statusText:w}});return this.shouldThrowOnError||(a=a.catch(i=>{var o,l,c;return{error:{message:`${(o=i==null?void 0:i.name)!==null&&o!==void 0?o:"FetchError"}: ${i==null?void 0:i.message}`,details:`${(l=i==null?void 0:i.stack)!==null&&l!==void 0?l:""}`,hint:"",code:`${(c=i==null?void 0:i.code)!==null&&c!==void 0?c:""}`},data:null,count:null,status:0,statusText:""}})),a.then(t,n)}returns(){return this}overrideTypes(){return this}};_h.default=lA;var cA=yr&&yr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(jh,"__esModule",{value:!0});const dA=cA(_h);let uA=class extends dA.default{select(t){let n=!1;const r=(t??"*").split("").map(a=>/\s/.test(a)&&!n?"":(a==='"'&&(n=!n),a)).join("");return this.url.searchParams.set("select",r),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(t,{ascending:n=!0,nullsFirst:r,foreignTable:a,referencedTable:i=a}={}){const o=i?`${i}.order`:"order",l=this.url.searchParams.get(o);return this.url.searchParams.set(o,`${l?`${l},`:""}${t}.${n?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:n,referencedTable:r=n}={}){const a=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(a,`${t}`),this}range(t,n,{foreignTable:r,referencedTable:a=r}={}){const i=typeof a>"u"?"offset":`${a}.offset`,o=typeof a>"u"?"limit":`${a}.limit`;return this.url.searchParams.set(i,`${t}`),this.url.searchParams.set(o,`${n-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}
427explain({analyze:t=!1,verbose:n=!1,settings:r=!1,buffers:a=!1,wal:i=!1,format:o="text"}={}){var l;const c=[t?"analyze":null,n?"verbose":null,r?"settings":null,a?"buffers":null,i?"wal":null].filter(Boolean).join("|"),d=(l=this.headers.Accept)!==null&&l!==void 0?l:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${o}; for="${d}"; options=${c};`,o==="json"?this:this}rollback(){var t;return((t=this.headers.Prefer)!==null&&t!==void 0?t:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}};jh.default=uA;var hA=yr&&yr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($c,"__esModule",{value:!0});const fA=hA(jh);let mA=class extends fA.default{eq(t,n){return this.url.searchParams.append(t,`eq.${n}`),this}neq(t,n){return this.url.searchParams.append(t,`neq.${n}`),this}gt(t,n){return this.url.searchParams.append(t,`gt.${n}`),this}gte(t,n){return this.url.searchParams.append(t,`gte.${n}`),this}lt(t,n){return this.url.searchParams.append(t,`lt.${n}`),this}lte(t,n){return this.url.searchParams.append(t,`lte.${n}`),this}like(t,n){return this.url.searchParams.append(t,`like.${n}`),this}likeAllOf(t,n){return this.url.searchParams.append(t,`like(all).{${n.join(",")}}`),this}likeAnyOf(t,n){return this.url.searchParams.append(t,`like(any).{${n.join(",")}}`),this}ilike(t,n){return this.url.searchParams.append(t,`ilike.${n}`),this}ilikeAllOf(t,n){return this.url.searchParams.append(t,`ilike(all).{${n.join(",")}}`),this}ilikeAnyOf(t,n){return this.url.searchParams.append(t,`ilike(any).{${n.join(",")}}`),this}is(t,n){return this.url.searchParams.append(t,`is.${n}`),this}in(t,n){const r=Array.from(new Set(n)).map(a=>typeof a=="string"&&new RegExp("[,()]").test(a)?`"${a}"`:`${a}`).join(",");return this.url.searchParams.append(t,`in.(${r})`),this}contains(t,n){return typeof n=="string"?this.url.searchParams.append(t,`cs.${n}`):Array.isArray(n)?this.url.searchParams.append(t,`cs.{${n.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(n)}`),this}containedBy(t,n){return typeof n=="string"?this.url.searchParams.append(t,`cd.${n}`):Array.isArray(n)?this.url.searchParams.append(t,`cd.{${n.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(n)}`),this}rangeGt(t,n){return this.url.searchParams.append(t,`sr.${n}`),this}rangeGte(t,n){return this.url.searchParams.append(t,`nxl.${n}`),this}rangeLt(t,n){return this.url.searchParams.append(t,`sl.${n}`),this}rangeLte(t,n){return this.url.searchParams.append(t,`nxr.${n}`),this}rangeAdjacent(t,n){return this.url.searchParams.append(t,`adj.${n}`),this}overlaps(t,n){return typeof n=="string"?this.url.searchParams.append(t,`ov.${n}`):this.url.searchParams.append(t,`ov.{${n.join(",")}}`),this}textSearch(t,n,{config:r,type:a}={}){let i="";a==="plain"?i="pl":a==="phrase"?i="ph":a==="websearch"&&(i="w");const o=r===void 0?"":`(${r})`;return this.url.searchParams.append(t,`${i}fts${o}.${n}`),this}match(t){return Object.entries(t).forEach(([n,r])=>{this.url.searchParams.append(n,`eq.${r}`)}),this}not(t,n,r){return this.url.searchParams.append(t,`not.${n}.${r}`),this}or(t,{foreignTable:n,referencedTable:r=n}={}){const a=r?`${r}.or`:"or";return this.url.searchParams.append(a,`(${t})`),this}filter(t,n,r){return this.url.searchParams.append(t,`${n}.${r}`),this}};$c.default=mA;var pA=yr&&yr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bh,"__esModule",{value:!0});const ll=pA($c);let gA=class{constructor(t,{headers:n={},schema:r,fetch:a}){this.url=t,this.headers=n,this.schema=r,this.fetch=a}select(t,{head:n=!1,count:r}={}){const a=n?"HEAD":"GET";let i=!1;const o=(t??"*").split("").map(l=>/\s/.test(l)&&!i?"":(l==='"'&&(i=!i),l)).join("");return this.url.searchParams.set("select",o),r&&(this.headers.Prefer=`count=${r}`),new ll.default({method:a,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(t,{count:n,defaultToNull:r=!0}={}){const a="POST",i=[];if(this.headers.Prefer&&i.push(this.headers.Prefer),n&&i.push(`count=${n}`),r||i.push("missing=default"),this.headers.Prefer=i.join(","),Array.isArray(t)){const o=t.reduce((l,c)=>l.concat(Object.keys(c)),[]);if(o.length>0){const l=[...new Set(o)].map(c=>`"${c}"`);this.url.searchParams.set("columns",l.join(","))}}return new ll.default({method:a,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}upsert(t,{onConflict:n,ignoreDuplicates:r=!1,count:a,defaultToNull:i=!0}={}){const o="POST",l=[`resolution=${r?"ignore":"merge"}-duplicates`];if(n!==void 0&&this.url.searchParams.set("on_conflict",n),this.headers.Prefer&&l.push(this.headers.Prefer),a&&l.push(`count=${a}`),i||l.push("missing=default"),this.headers.Prefer=l.join(","),Array.isArray(t)){const c=t.reduce((d,u)=>d.concat(Object.keys(u)),[]);if(c.length>0){const d=[...new Set(c)].map(u=>`"${u}"`);this.url.searchParams.set("columns",d.join(","))}}return new ll.default({method:o,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}update(t,{count:n}={}){const r="PATCH",a=[];return this.headers.Prefer&&a.push(this.headers.Prefer),n&&a.push(`count=${n}`),this.headers.Prefer=a.join(","),new ll.default({method:r,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}delete({count:t}={}){const n="DELETE",r=[];return t&&r.push(`count=${t}`),this.headers.Prefer&&r.unshift(this.headers.Prefer),this.headers.Prefer=r.join(","),new ll.default({method:n,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};bh.default=gA;var Sh={},kh={};Object.defineProperty(kh,"__esModule",{value:!0});kh.version=void 0;kh.version="0.0.0-automated";Object.defineProperty(Sh,"__esModule",{value:!0});Sh.DEFAULT_HEADERS=void 0;const vA=kh;Sh.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${vA.version}`};
427var xN=yr&&yr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(sv,"__esModule",{value:!0});const xA=xN(bh),yA=xN($c),wA=Sh;let bA=class yN{constructor(t,{headers:n={},schema:r,fetch:a}={}){this.url=t,this.headers=Object.assign(Object.assign({},wA.DEFAULT_HEADERS),n),this.schemaName=r,this.fetch=a}from(t){const n=new URL(`${this.url}/${t}`);return new xA.default(n,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new yN(this.url,{headers:this.headers,schema:t,fetch:this.fetch})}rpc(t,n={},{head:r=!1,get:a=!1,count:i}={}){let o;const l=new URL(`${this.url}/rpc/${t}`);let c;r||a?(o=r?"HEAD":"GET",Object.entries(n).filter(([u,f])=>f!==void 0).map(([u,f])=>[u,Array.isArray(f)?`{${f.join(",")}}`:`${f}`]).forEach(([u,f])=>{l.searchParams.append(u,f)})):(o="POST",c=n);const d=Object.assign({},this.headers);return i&&(d.Prefer=`count=${i}`),new yA.default({method:o,url:l,headers:d,schema:this.schemaName,body:c,fetch:this.fetch,allowEmpty:!1})}};sv.default=bA;var Ko=yr&&yr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Fn,"__esModule",{value:!0});Fn.PostgrestError=Fn.PostgrestBuilder=Fn.PostgrestTransformBuilder=Fn.PostgrestFilterBuilder=Fn.PostgrestQueryBuilder=Fn.PostgrestClient=void 0;const wN=Ko(sv);Fn.PostgrestClient=wN.default;const bN=Ko(bh);Fn.PostgrestQueryBuilder=bN.default;const jN=Ko($c);Fn.PostgrestFilterBuilder=jN.default;const _N=Ko(jh);Fn.PostgrestTransformBuilder=_N.default;const NN=Ko(_h);Fn.PostgrestBuilder=NN.default;const SN=Ko(Nh);Fn.PostgrestError=SN.default;var jA=Fn.default={PostgrestClient:wN.default,PostgrestQueryBuilder:bN.default,PostgrestFilterBuilder:jN.default,PostgrestTransformBuilder:_N.default,PostgrestBuilder:NN.default,PostgrestError:SN.default};const{PostgrestClient:_A,PostgrestQueryBuilder:$6,PostgrestFilterBuilder:F6,PostgrestTransformBuilder:U6,PostgrestBuilder:z6,PostgrestError:B6}=jA;function NA(){if(typeof WebSocket<"u")return WebSocket;if(typeof global.WebSocket<"u")return global.WebSocket;if(typeof window.WebSocket<"u")return window.WebSocket;if(typeof self.WebSocket<"u")return self.WebSocket;throw new Error("`WebSocket` is not supported in this environment")}const SA=NA(),kA="2.11.15",CA=`realtime-js/${kA}`,EA="1.0.0",kN=1e4,PA=1e3;var Rl;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(Rl||(Rl={}));var bn;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(bn||(bn={}));var Pr;(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"})(Pr||(Pr={}));var np;(function(e){e.websocket="websocket"})(np||(np={}));var Ya;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(Ya||(Ya={}));class TA{constructor(){this.HEADER_LENGTH=1}decode(t,n){return t.constructor===ArrayBuffer?n(this._binaryDecode(t)):n(typeof t=="string"?JSON.parse(t):{})}_binaryDecode(t){const n=new DataView(t),r=new TextDecoder;return this._decodeBroadcast(t,n,r)}_decodeBroadcast(t,n,r){const a=n.getUint8(1),i=n.getUint8(2);let o=this.HEADER_LENGTH+2;const l=r.decode(t.slice(o,o+a));o=o+a;const c=r.decode(t.slice(o,o+i));o=o+i;const d=JSON.parse(r.decode(t.slice(o,t.byteLength)));return{ref:null,topic:l,event:c,payload:d}}}class CN{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)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var Rt;(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"})(Rt||(Rt={}));const qy=(e,t,n={})=>{var r;const a=(r=n.skipTypes)!==null&&r!==void 0?r:[];return Object.keys(t).reduce((i,o)=>(i[o]=RA(o,e,t,a),i),{})},RA=(e,t,n,r)=>{const a=t.find(l=>
vendor: 7,985 bytes, line 427
427l.name===e),i=a==null?void 0:a.type,o=n[e];return i&&!r.includes(i)?EN(i,o):rp(o)},EN=(e,t)=>{if(e.charAt(0)==="_"){const n=e.slice(1,e.length);return MA(t,n)}switch(e){case Rt.bool:return DA(t);case Rt.float4:case Rt.float8:case Rt.int2:case Rt.int4:case Rt.int8:case Rt.numeric:case Rt.oid:return OA(t);case Rt.json:case Rt.jsonb:return AA(t);case Rt.timestamp:return IA(t);case Rt.abstime:case Rt.date:case Rt.daterange:case Rt.int4range:case Rt.int8range:case Rt.money:case Rt.reltime:case Rt.text:case Rt.time:case Rt.timestamptz:case Rt.timetz:case Rt.tsrange:case Rt.tstzrange:return rp(t);default:return rp(t)}},rp=e=>e,DA=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},OA=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},AA=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch(t){return console.log(`JSON parse error: ${t}`),e}return e},MA=(e,t)=>{if(typeof e!="string")return e;const n=e.length-1,r=e[n];if(e[0]==="{"&&r==="}"){let i;const o=e.slice(1,n);try{i=JSON.parse("["+o+"]")}catch{i=o?o.split(","):[]}return i.map(l=>EN(t,l))}return e},IA=e=>typeof e=="string"?e.replace(" ","T"):e,PN=e=>{let t=e;return t=t.replace(/^ws/i,"http"),t=t.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),t.replace(/\/+$/,"")};class Ef{constructor(t,n,r={},a=kN){this.channel=t,this.event=n,this.payload=r,this.timeout=a,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 Yy;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(Yy||(Yy={}));class Dl{constructor(t,n){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const r=(n==null?void 0:n.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},a=>{const{onJoin:i,onLeave:o,onSync:l}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Dl.syncState(this.state,a,i,o),this.pendingDiffs.forEach(c=>{this.state=Dl.syncDiff(this.state,c,i,o)}),this.pendingDiffs=[],l()}),this.channel._on(r.diff,{},a=>{const{onJoin:i,onLeave:o,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(a):(this.state=Dl.syncDiff(this.state,a,i,o),l())}),this.onJoin((a,i,o)=>{this.channel._trigger("presence",{event:"join",key:a,currentPresences:i,newPresences:o})}),this.onLeave((a,i,o)=>{this.channel._trigger("presence",{event:"leave",key:a,currentPresences:i,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,n,r,a){const i=this.cloneDeep(t),o=this.transformState(n),l={},c={};return this.map(i,(d,u)=>{o[d]||(c[d]=u)}),this.map(o,(d,u)=>{const f=i[d];if(f){const m=u.map(b=>b.presence_ref),w=f.map(b=>b.presence_ref),x=u.filter(b=>w.indexOf(b.presence_ref)<0),p=f.filter(b=>m.indexOf(b.presence_ref)<0);x.length>0&&(l[d]=x),p.length>0&&(c[d]=p)}else l[d]=u}),this.syncDiff(i,{joins:l,leaves:c},r,a)}static syncDiff(t,n,r,a){const{joins:i,leaves:o}={joins:this.transformState(n.joins),leaves:this.transformState(n.leaves)};return r||(r=()=>{}),a||(a=()=>{}),this.map(i,(l,c)=>{var d;const u=(d=t[l])!==null&&d!==void 0?d:[];if(t[l]=this.cloneDeep(c),u.length>0){const f=t[l].map(w=>w.presence_ref),m=u.filter(w=>f.indexOf(w.presence_ref)<0);t[l].unshift(...m)}r(l,u,c)}),this.map(o,(l,c)=>{let d=t[l];if(!d)return;const u=c.map(f=>f.presence_ref);d=d.filter(f=>u.indexOf(f.presence_ref)<0),t[l]=d,a(l,d,c),d.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 a=t[r];return"metas"in a?n[r]=a.metas.map(i=>(i.presence_ref=i.phx_ref,delete i.phx_ref,delete i.phx_ref_prev,i)):n[r]=a,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 Gy;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(Gy||(Gy={}));var Ky;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(Ky||(Ky={}));var bs;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(bs||(bs={}));class av{constructor(t,n={config:{}},r){this.topic=t,this.params=n,this.socket=r,this.bindings={},this.state=bn.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""},private:!1},n.config),this.timeout=this.socket.timeout,this.joinPush=new Ef(this,Pr.join,this.params,this.timeout),this.rejoinTimer=new CN(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=bn.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=bn.closed,this.socket._remove(this)}),this._onError(a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=bn.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=bn.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Pr.reply,{},(a,i)=>{this._trigger(this._replyEventName(i),a)}),this.presence=new Dl(this),this.broadcastEndpointURL=PN(this.socket.endPoint)+"/api/broadcast",this.private=this.params.config.private||!1}subscribe(t,n=this.timeout){var r,a;if(this.socket.isConnected()||this.socket.connect(),this.state==bn.closed){const{config:{broadcast:i,presence:o,private:l}}=this.params;this._onError(u=>t==null?void 0:t(bs.CHANNEL_ERROR,u)),this._onClose(()=>t==null?void 0:t(bs.CLOSED));const c={},d={broadcast:i,presence:o,postgres_changes:(a=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(u=>u.filter))!==null&&a!==void 0?a:[],private:l};this.socket.accessTokenValue&&(c.access_token=this.socket.accessTokenValue),this.updateJoinPayload(Object.assign({config:d},c)),this.joinedOnce=!0,this._rejoin(n),this.joinPush.receive("ok",async({postgres_changes:u})=>{var f;if(this.socket.setAuth(),u===void 0){t==null||t(bs.SUBSCRIBED);return}else{const m=this.bindings.postgres_changes,w=(f=m==null?void 0:m.length)!==null&&f!==void 0?f:0,x=[];for(let p=0;p<w;
427p++){const b=m[p],{filter:{event:v,schema:g,table:y,filter:j}}=b,N=u&&u[p];if(N&&N.event===v&&N.schema===g&&N.table===y&&N.filter===j)x.push(Object.assign(Object.assign({},b),{id:N.id}));else{this.unsubscribe(),this.state=bn.errored,t==null||t(bs.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=x,t&&t(bs.SUBSCRIBED);return}}).receive("error",u=>{this.state=bn.errored,t==null||t(bs.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(u).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(bs.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._on(t,n,r)}async send(t,n={}){var r,a;if(!this._canPush()&&t.type==="broadcast"){const{event:i,payload:o}=t,c={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const d=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((a=d.body)===null||a===void 0?void 0:a.cancel()),d.ok?"ok":"error"}catch(d){return d.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,l,c;const d=this._push(t.type,t,n.timeout||this.timeout);t.type==="broadcast"&&!(!((c=(l=(o=this.params)===null||o===void 0?void 0:o.config)===null||l===void 0?void 0:l.broadcast)===null||c===void 0)&&c.ack)&&i("ok"),d.receive("ok",()=>i("ok")),d.receive("error",()=>i("error")),d.receive("timeout",()=>i("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=bn.leaving;const n=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Pr.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(a=>{r=new Ef(this,Pr.leave,{},t),r.receive("ok",()=>{n(),a("ok")}).receive("timeout",()=>{n(),a("timed out")}).receive("error",()=>{a("error")}),r.send(),this._canPush()||r.trigger("ok",{})}).finally(()=>{r==null||r.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.rejoinTimer&&clearTimeout(this.rejoinTimer.timer),this.joinPush.destroy()}async _fetchWithTimeout(t,n,r){const a=new AbortController,i=setTimeout(()=>a.abort(),r),o=await this.socket.fetch(t,Object.assign(Object.assign({},n),{signal:a.signal}));return clearTimeout(i),o}_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 a=new Ef(this,t,n,r);return this._canPush()?a.send():(a.startTimeout(),this.pushBuffer.push(a)),a}_onMessage(t,n,r){return n}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,n,r){var a,i;const o=t.toLocaleLowerCase(),{close:l,error:c,leave:d,join:u}=Pr;if(r&&[l,c,d,u].indexOf(o)>=0&&r!==this._joinRef())return;let m=this._onMessage(o,n,r);if(n&&!m)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(a=this.bindings.postgres_changes)===null||a===void 0||a.filter(w=>{var x,p,b;return((x=w.filter)===null||x===void 0?void 0:x.event)==="*"||((b=(p=w.filter)===null||p===void 0?void 0:p.event)===null||b===void 0?void 0:b.toLocaleLowerCase())===o}).map(w=>w.callback(m,r)):(i=this.bindings[o])===null||i===void 0||i.filter(w=>{var x,p,b,v,g,y;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in w){const j=w.id,N=(x=w.filter)===null||x===void 0?void 0:x.event;return j&&((p=n.ids)===null||p===void 0?void 0:p.includes(j))&&(N==="*"||(N==null?void 0:N.toLocaleLowerCase())===((b=n.data)===null||b===void 0?void 0:b.type.toLocaleLowerCase()))}else{const j=(g=(v=w==null?void 0:w.filter)===null||v===void 0?void 0:v.event)===null||g===void 0?void 0:g.toLocaleLowerCase();return j==="*"||j===((y=n==null?void 0:n.event)===null||y===void 0?void 0:y.toLocaleLowerCase())}else return w.type.toLocaleLowerCase()===o}).map(w=>{if(typeof m=="object"&&"ids"in m){const x=m.data,{schema:p,table:b,commit_timestamp:v,type:g,errors:y}=x;m=Object.assign(Object.assign({},{schema:p,table:b,commit_timestamp:v,eventType:g,new:{},old:{},errors:y}),this._getPayloadRecords(x))}w.callback(m,r)})}_isClosed(){return this.state===bn.closed}_isJoined(){return this.state===bn.joined}_isJoining(){return this.state===bn.joining}_isLeaving(){return this.state===bn.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,n,r){const a=t.toLocaleLowerCase(),i={type:a,filter:n,callback:r};return this.bindings[a]?this.bindings[a].push(i):this.bindings[a]=[i],this}_off(t,n){const r=t.toLocaleLowerCase();return this.bindings[r]=this.bindings[r].filter(a=>{var i;return!(((i=a.type)===null||i===void 0?void 0:i.toLocaleLowerCase())===r&&av.isEqual(a.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}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(Pr.close,{},t)}_onError(t){this._on(Pr.error,{},n=>t(n))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=bn.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const n={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(n.new=qy(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(n.old=qy(t.columns,t.old_record)),n}}const Zy=()=>{},LA=` 428 addEventListener("message", (e) => { 429 if (e.data.event === "start") { 430 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 431 } 432 });`;class $A{constructor(t,n){var r;this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=kN,this.heartbeatIntervalMs=25e3,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=Zy,this.ref=0,this.logger=Zy,this.conn=null,this.sendBuffer=[],this.serializer
432=new TA,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._resolveFetch=i=>{let o;return i?o=i:typeof fetch>"u"?o=(...l)=>Lc(async()=>{const{default:c}=await Promise.resolve().then(()=>Go);return{default:c}},void 0).then(({default:c})=>c(...l)):o=fetch,(...l)=>o(...l)},this.endPoint=`${t}/${np.websocket}`,this.httpEndpoint=PN(t),n!=null&&n.transport?this.transport=n.transport:this.transport=null,n!=null&&n.params&&(this.params=n.params),n!=null&&n.timeout&&(this.timeout=n.timeout),n!=null&&n.logger&&(this.logger=n.logger),(n!=null&&n.logLevel||n!=null&&n.log_level)&&(this.logLevel=n.logLevel||n.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),n!=null&&n.heartbeatIntervalMs&&(this.heartbeatIntervalMs=n.heartbeatIntervalMs);const a=(r=n==null?void 0:n.params)===null||r===void 0?void 0:r.apikey;if(a&&(this.accessTokenValue=a,this.apiKey=a),this.reconnectAfterMs=n!=null&&n.reconnectAfterMs?n.reconnectAfterMs:i=>[1e3,2e3,5e3,1e4][i-1]||1e4,this.encode=n!=null&&n.encode?n.encode:(i,o)=>o(JSON.stringify(i)),this.decode=n!=null&&n.decode?n.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new CN(async()=>{this.disconnect(),this.connect()},this.reconnectAfterMs),this.fetch=this._resolveFetch(n==null?void 0:n.fetch),n!=null&&n.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.worker=(n==null?void 0:n.worker)||!1,this.workerUrl=n==null?void 0:n.workerUrl}this.accessToken=(n==null?void 0:n.accessToken)||null}connect(){if(!this.conn){if(this.transport||(this.transport=SA),!this.transport)throw new Error("No transport provided");this.conn=new this.transport(this.endpointURL()),this.setupConnection()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:EA}))}disconnect(t,n){this.conn&&(this.conn.onclose=function(){},t?this.conn.close(t,n??""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset(),this.channels.forEach(r=>r.teardown()))}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 Rl.connecting:return Ya.Connecting;case Rl.open:return Ya.Open;case Rl.closing:return Ya.Closing;default:return Ya.Closed}}isConnected(){return this.connectionState()===Ya.Open}channel(t,n={config:{}}){const r=`realtime:${t}`,a=this.getChannels().find(i=>i.topic===r);if(a)return a;{const i=new av(`realtime:${t}`,n,this);return this.channels.push(i),i}}push(t){const{topic:n,event:r,payload:a,ref:i}=t,o=()=>{this.encode(t,l=>{var c;(c=this.conn)===null||c===void 0||c.send(l)})};this.log("push",`${n} ${r} (${i})`,a),this.isConnected()?o():this.sendBuffer.push(o)}async setAuth(t=null){let n=t||this.accessToken&&await this.accessToken()||this.accessTokenValue;this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(r=>{const a={access_token:n,version:CA};n&&r.updateJoinPayload(a),r.joinedOnce&&r._isJoined()&&r._push(Pr.access_token,{access_token:n})}))}async sendHeartbeat(){var t;if(!this.isConnected()){this.heartbeatCallback("disconnected");return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.heartbeatCallback("timeout"),(t=this.conn)===null||t===void 0||t.close(PA,"hearbeat timeout");return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatCallback("sent"),await this.setAuth()}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)}setupConnection(){this.conn&&(this.conn.binaryType="arraybuffer",this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=t=>this._onConnError(t),this.conn.onmessage=t=>
432this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t))}_onConnMessage(t){this.decode(t.data,n=>{let{topic:r,event:a,payload:i,ref:o}=n;r==="phoenix"&&a==="phx_reply"&&this.heartbeatCallback(n.payload.status=="ok"?"ok":"error"),o&&o===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null),this.log("receive",`${i.status||""} ${r} ${a} ${o&&"("+o+")"||""}`,i),Array.from(this.channels).filter(l=>l._isMember(r)).forEach(l=>l._trigger(a,i,o)),this.stateChangeCallbacks.message.forEach(l=>l(n))})}_onConnOpen(){this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this.reconnectTimer.reset(),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this.stateChangeCallbacks.open.forEach(t=>t())}_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.workerRef.terminate()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(t){this.log("transport","close",t),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(n=>n(t))}_onConnError(t){this.log("transport",`${t}`),this._triggerChanError(),this.stateChangeCallbacks.error.forEach(n=>n(t))}_triggerChanError(){this.channels.forEach(t=>t._trigger(Pr.error))}_appendParams(t,n){if(Object.keys(n).length===0)return t;const r=t.match(/\?/)?"&":"?",a=new URLSearchParams(n);return`${t}${r}${a}`}_workerObjectUrl(t){let n;if(t)n=t;else{const r=new Blob([LA],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}}class iv extends Error{constructor(t){super(t),this.__isStorageError=!0,this.name="StorageError"}}function un(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}class FA extends iv{constructor(t,n,r){super(t),this.name="StorageApiError",this.status=n,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class sp extends iv{constructor(t,n){super(t),this.name="StorageUnknownError",this.originalError=n}}var UA=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function l(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(l,c)}d((r=r.apply(e,t||[])).next())})};const TN=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...n)=>Lc(async()=>{const{default:r}=await Promise.resolve().then(()=>Go);return{default:r}},void 0).then(({default:r})=>r(...n)):t=fetch,(...n)=>t(...n)},zA=()=>UA(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Lc(()=>Promise.resolve().then(()=>Go),void 0)).Response:Response}),ap=e=>{if(Array.isArray(e))return e.map(n=>ap(n));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([n,r])=>{const a=n.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));t[a]=ap(r)}),t},BA=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)};var Ni=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function l(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(l,c)}d((r=r.apply(e,t||[])).next())})};const Pf=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),VA=(e,t,n)=>Ni(void 0,void 0,void 0,function*(){const r=yield zA();e instanceof r&&!(n!=null&&n.noResolveJson)?e.json().then(a=>{const i=e.status||500,o=(a==null?void 0:a.statusCode)||i+"";t(new FA(Pf(a),i,o))}).catch(a=>{t(new sp(Pf(a),a))}):t(new sp(Pf(e),e))}),WA=(e,t,n,r)=>{const a={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"||!r?a:(BA(r)?(a.headers=Object.assign({"Content-Type":"application/json"},t==null?void 0:t.headers),a.body=JSON.stringify(r)):a.body=r,Object.assign(Object.assign({},a),n))};function Fc(e,t,n,r,a,i){return Ni(this,void 0,void 0,function*(){return new Promise((o,l)=>{e(n,WA(t,r,a,i)).then(c=>{if(!c.ok)throw c;return r!=null&&r.noResolveJson?c:c.json()}).then(c=>o(c)).catch(c=>VA(c,l,r))})})}function Cu(e,t,n,r){return Ni(this,void 0,void 0,function*(){return Fc(e,"GET",t,n,r)})}function js(e,t,n,r,a){return Ni(this,void 0,void 0,function*(){return Fc(e,"POST",t,r,a,n)})}function ip(e,t,n,r,a){return Ni(this,void 0,void 0,function*(){return Fc(e,"PUT",t,r,a,n)})}function HA(e,t,n,r){return Ni(this,void 0,void 0,function*(){return Fc(e,"HEAD",t,Object.assign(Object.assign({},n),{noResolveJson:!0}),r)})}function RN(e,t,n,r,a){return Ni(this,void 0,void 0,function*(){return Fc(e,"DELETE",t,r,a,n)})}var Ln=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}
432return new(n||(n=Promise))(function(i,o){function l(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(l,c)}d((r=r.apply(e,t||[])).next())})};const qA={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Qy={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class YA{constructor(t,n={},r,a){this.url=t,this.headers=n,this.bucketId=r,this.fetch=TN(a)}uploadOrUpdate(t,n,r,a){return Ln(this,void 0,void 0,function*(){try{let i;const o=Object.assign(Object.assign({},Qy),a);let l=Object.assign(Object.assign({},this.headers),t==="POST"&&{"x-upsert":String(o.upsert)});const c=o.metadata;typeof Blob<"u"&&r instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",this.encodeMetadata(c)),i.append("",r)):typeof FormData<"u"&&r instanceof FormData?(i=r,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",this.encodeMetadata(c))):(i=r,l["cache-control"]=`max-age=${o.cacheControl}`,l["content-type"]=o.contentType,c&&(l["x-metadata"]=this.toBase64(this.encodeMetadata(c)))),a!=null&&a.headers&&(l=Object.assign(Object.assign({},l),a.headers));const d=this._removeEmptyFolders(n),u=this._getFinalPath(d),f=yield(t=="PUT"?ip:js)(this.fetch,`${this.url}/object/${u}`,i,Object.assign({headers:l},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{data:{path:d,id:f.Id,fullPath:f.Key},error:null}}catch(i){if(un(i))return{data:null,error:i};throw i}})}upload(t,n,r){return Ln(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",t,n,r)})}uploadToSignedUrl(t,n,r,a){return Ln(this,void 0,void 0,function*(){const i=this._removeEmptyFolders(t),o=this._getFinalPath(i),l=new URL(this.url+`/object/upload/sign/${o}`);l.searchParams.set("token",n);try{let c;const d=Object.assign({upsert:Qy.upsert},a),u=Object.assign(Object.assign({},this.headers),{"x-upsert":String(d.upsert)});typeof Blob<"u"&&r instanceof Blob?(c=new FormData,c.append("cacheControl",d.cacheControl),c.append("",r)):typeof FormData<"u"&&r instanceof FormData?(c=r,c.append("cacheControl",d.cacheControl)):(c=r,u["cache-control"]=`max-age=${d.cacheControl}`,u["content-type"]=d.contentType);const f=yield ip(this.fetch,l.toString(),c,{headers:u});return{data:{path:i,fullPath:f.Key},error:null}}catch(c){if(un(c))return{data:null,error:c};throw c}})}createSignedUploadUrl(t,n){return Ln(this,void 0,void 0,function*(){try{let r=this._getFinalPath(t);const a=Object.assign({},this.headers);n!=null&&n.upsert&&(a["x-upsert"]="true");const i=yield js(this.fetch,`${this.url}/object/upload/sign/${r}`,{},{headers:a}),o=new URL(this.url+i.url),l=o.searchParams.get("token");if(!l)throw new iv("No token returned by API");return{data:{signedUrl:o.toString(),path:t,token:l},error:null}}catch(r){if(un(r))return{data:null,error:r};throw r}})}update(t,n,r){return Ln(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",t,n,r)})}move(t,n,r){return Ln(this,void 0,void 0,function*(){try{return{data:yield js(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:t,destinationKey:n,destinationBucket:r==null?void 0:r.destinationBucket},{headers:this.headers}),error:null}}catch(a){if(un(a))return{data:null,error:a};throw a}})}copy(t,n,r){return Ln(this,void 0,void 0,function*(){try{return{data:{path:(yield js(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:t,destinationKey:n,destinationBucket:r==null?void 0:r.destinationBucket},{headers:this.headers})).Key},error:null}}catch(a){if(un(a))return{data:null,error:a};throw a}})}createSignedUrl(t,n,r){return Ln(this,void 0,void 0,function*(){try{let a=this._getFinalPath(t),i=yield js(this.fetch,`${this.url}/object/sign/${a}`,Object.assign({expiresIn:n},r!=null&&r.transform?{transform:r.transform}:{}),{headers:this.headers});const o=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return i={signedUrl:encodeURI(`${this.url}${i.signedURL}${o}`)},{data:i,error:null}}catch(a){if(un(a))return{data:null,error:a};throw a}})}createSignedUrls(t,n,r){return Ln(this,void 0,void 0,function*(){try{const a=yield js(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:n,paths:t},{headers:this.headers}),i=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return{data:a.map(o=>Object.assign(Object.assign({},o),{signedUrl:o.signedURL?encodeURI(`${this.url}${o.signedURL}${i}`):null})),error:null}}catch(a){if(un(a))return{data:null,error:a};throw a}})}download(t,n){return Ln(this,void 0,void 0,function*(){const a=typeof(n==null?void 0:n.transform)<"u"?"render/image/authenticated":"object",i=this.transformOptsToQueryString((n==null?void 0:n.transform)||{}),o=i?`?${i}`:"";try{const l=this._getFinalPath(t);return{data:yield(yield Cu(this.fetch,`${this.url}/${a}/${l}${o}
432`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(l){if(un(l))return{data:null,error:l};throw l}})}info(t){return Ln(this,void 0,void 0,function*(){const n=this._getFinalPath(t);try{const r=yield Cu(this.fetch,`${this.url}/object/info/${n}`,{headers:this.headers});return{data:ap(r),error:null}}catch(r){if(un(r))return{data:null,error:r};throw r}})}exists(t){return Ln(this,void 0,void 0,function*(){const n=this._getFinalPath(t);try{return yield HA(this.fetch,`${this.url}/object/${n}`,{headers:this.headers}),{data:!0,error:null}}catch(r){if(un(r)&&r instanceof sp){const a=r.originalError;if([400,404].includes(a==null?void 0:a.status))return{data:!1,error:r}}throw r}})}getPublicUrl(t,n){const r=this._getFinalPath(t),a=[],i=n!=null&&n.download?`download=${n.download===!0?"":n.download}`:"";i!==""&&a.push(i);const l=typeof(n==null?void 0:n.transform)<"u"?"render/image":"object",c=this.transformOptsToQueryString((n==null?void 0:n.transform)||{});c!==""&&a.push(c);let d=a.join("&");return d!==""&&(d=`?${d}`),{data:{publicUrl:encodeURI(`${this.url}/${l}/public/${r}${d}`)}}}remove(t){return Ln(this,void 0,void 0,function*(){try{return{data:yield RN(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:t},{headers:this.headers}),error:null}}catch(n){if(un(n))return{data:null,error:n};throw n}})}list(t,n,r){return Ln(this,void 0,void 0,function*(){try{const a=Object.assign(Object.assign(Object.assign({},qA),n),{prefix:t||""});return{data:yield js(this.fetch,`${this.url}/object/list/${this.bucketId}`,a,{headers:this.headers},r),error:null}}catch(a){if(un(a))return{data:null,error:a};throw a}})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(t){const n=[];return t.width&&n.push(`width=${t.width}`),t.height&&n.push(`height=${t.height}`),t.resize&&n.push(`resize=${t.resize}`),t.format&&n.push(`format=${t.format}`),t.quality&&n.push(`quality=${t.quality}`),n.join("&")}}const GA="2.10.4",KA={"X-Client-Info":`storage-js/${GA}`};var Ti=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function l(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(l,c)}d((r=r.apply(e,t||[])).next())})};class ZA{constructor(t,n={},r,a){const i=new URL(t);a!=null&&a.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase.")),this.url=i.href,this.headers=Object.assign(Object.assign({},KA),n),this.fetch=TN(r)}listBuckets(){return Ti(this,void 0,void 0,function*(){try{return{data:yield Cu(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(t){if(un(t))return{data:null,error:t};throw t}})}getBucket(t){return Ti(this,void 0,void 0,function*(){try{return{data:yield Cu(this.fetch,`${this.url}/bucket/${t}`,{headers:this.headers}),error:null}}catch(n){if(un(n))return{data:null,error:n};throw n}})}createBucket(t,n={public:!1}){return Ti(this,void 0,void 0,function*(){try{return{data:yield js(this.fetch,`${this.url}/bucket`,{id:t,name:t,type:n.type,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(un(r))return{data:null,error:r};throw r}})}updateBucket(t,n){return Ti(this,void 0,void 0,function*(){try{return{data:yield ip(this.fetch,`${this.url}/bucket/${t}`,{id:t,name:t,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(un(r))return{data:null,error:r};throw r}})}emptyBucket(t){return Ti(this,void 0,void 0,function*(){try{return{data:yield js(this.fetch,`${this.url}/bucket/${t}/empty`,{},{headers:this.headers}),error:null}}catch(n){if(un(n))return{data:null,error:n};throw n}})}deleteBucket(t){return Ti(this,void 0,void 0,function*(){try{return{data:yield RN(this.fetch,`${this.url}/bucket/${t}`,{},{headers:this.headers}),error:null}}catch(n){if(un(n))return{data:null,error:n};throw n}})}}class QA extends ZA{constructor(t,n={},r,a){super(t,n,r,a)}from(t){return new YA(this.url,this.headers,t,this.fetch)}}const JA="2.53.0";let gl="";typeof Deno<"u"?gl="deno":typeof document<"u"?gl="web":typeof navigator<"u"&&navigator.product==="ReactNative"?gl="react-native":gl="node";const XA={"X-Client-Info":`supabase-js-${gl}/${JA}`},eM={headers:XA},tM={schema:"public"},nM={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},rM={};var sM=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}
432return new(n||(n=Promise))(function(i,o){function l(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(l,c)}d((r=r.apply(e,t||[])).next())})};const aM=e=>{let t;return e?t=e:typeof fetch>"u"?t=pN:t=fetch,(...n)=>t(...n)},iM=()=>typeof Headers>"u"?gN:Headers,oM=(e,t,n)=>{const r=aM(n),a=iM();return(i,o)=>sM(void 0,void 0,void 0,function*(){var l;const c=(l=yield t())!==null&&l!==void 0?l:e;let d=new a(o==null?void 0:o.headers);return d.has("apikey")||d.set("apikey",e),d.has("Authorization")||d.set("Authorization",`Bearer ${c}`),r(i,Object.assign(Object.assign({},o),{headers:d}))})};var lM=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function l(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(l,c)}d((r=r.apply(e,t||[])).next())})};function cM(e){return e.endsWith("/")?e:e+"/"}function dM(e,t){var n,r;const{db:a,auth:i,realtime:o,global:l}=e,{db:c,auth:d,realtime:u,global:f}=t,m={db:Object.assign(Object.assign({},c),a),auth:Object.assign(Object.assign({},d),i),realtime:Object.assign(Object.assign({},u),o),storage:{},global:Object.assign(Object.assign(Object.assign({},f),l),{headers:Object.assign(Object.assign({},(n=f==null?void 0:f.headers)!==null&&n!==void 0?n:{}),(r=l==null?void 0:l.headers)!==null&&r!==void 0?r:{})}),accessToken:()=>lM(this,void 0,void 0,function*(){return""})};return e.accessToken?m.accessToken=e.accessToken:delete m.accessToken,m}const DN="2.71.1",Ii=30*1e3,op=3,Tf=op*Ii,uM="http://localhost:9999",hM="supabase.auth.token",fM={"X-Client-Info":`gotrue-js/${DN}`},lp="X-Supabase-Api-Version",ON={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},mM=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,pM=10*60*1e3;class ov extends Error{constructor(t,n,r){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}}function tt(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class gM extends ov{constructor(t,n,r){super(t,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function vM(e){return tt(e)&&e.name==="AuthApiError"}class AN extends ov{constructor(t,n){super(t),this.name="AuthUnknownError",this.originalError=n}}class Ma extends ov{constructor(t,n,r,a){super(t,r,a),this.name=n,this.status=r}}class Ys extends Ma{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function xM(e){return tt(e)&&e.name==="AuthSessionMissingError"}class Nd extends Ma{constructor(){super("Auth session or user missing","AuthInvalidToken
432ResponseError",500,void 0)}}class Sd extends Ma{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class kd extends Ma{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 yM(e){return tt(e)&&e.name==="AuthImplicitGrantRedirectError"}class Jy extends Ma{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 cp extends Ma{constructor(t,n){super(t,"AuthRetryableFetchError",n,void 0)}}function Rf(e){return tt(e)&&e.name==="AuthRetryableFetchError"}class Xy extends Ma{constructor(t,n,r){super(t,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}}class dp extends Ma{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const Eu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),ew=` 433\r=`.split(""),wM=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<ew.length;t+=1)e[ew[t].charCodeAt(0)]=-2;for(let t=0;t<Eu.length;t+=1)e[Eu[t].charCodeAt(0)]=t;return e})();function tw(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(Eu[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(Eu[r]),t.queuedBits-=6}}function MN(e,t,n){const r=wM[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 nw(e){const t=[],n=o=>{t.push(String.fromCodePoint(o))},r={utf8seq:0,codepoint:0},a={queue:0,queuedBits:0},i=o=>{_M(o,r,n)};for(let o=0;o<e.length;o+=1)MN(e.charCodeAt(o),a,i);return t.join("")}function bM(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 jM(e,t){for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r>55295&&r<=56319){const a=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|a)+65536,n+=1}bM(r,t)}}function _M(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 NM(e){const t=[],n={queue:0,queuedBits:0},r=a=>{t.push(a)};for(let a=0;a<e.length;a+=1)MN(e.charCodeAt(a),n,r);return new Uint8Array(t)}function SM(e){const t=[];return jM(e,n=>t.push(n)),new Uint8Array(t)}function kM(e){const t=[],n={queue:0,queuedBits:0},r=a=>{t.push(a)};return e.forEach(a=>tw(a,n,r)),tw(null,n,r),t.join("")}function CM(e){return Math.round(Date.now()/1e3)+e}function EM(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}const _r=()=>typeof window<"u"&&typeof document<"u",Ua={tested:!1,writable:!1},IN=()=>{if(!_r())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Ua.tested)return Ua.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Ua.tested=!0,Ua.writable=!0}catch{Ua.tested=!0,Ua.writable=!1}return Ua.writable};function PM(e){const t={},n=new URL(e);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((a,i)=>{t[i]=a})}catch{}return n.searchParams.forEach((r,a)=>{t[a]=r}),t}const LN=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...n)=>Lc(async()=>{const{default:r}=await Promise.resolve().then(()=>Go);return{default:r}},void 0).then(({default:r})=>r(...n)):t=fetch,(...n)=>t(...n)},TM=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Li=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},za=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return n}},Vs=async(e,t)=>{await e.removeItem(t)};class Ch{constructor(){this.promise=new Ch.promiseConstructor((t,n)=>{this.resolve=t,this.reject=n})}}Ch.promiseConstructor=Promise;function Df(e){const t=e.split(".");if(t.length!==3)throw new dp("Invalid JWT structure");for(let r=0;r<t.length;r++)if(!mM.test(t[r]))throw new dp("JWT not in base64url format");return{header:JSON.parse(nw(t[0])),payload:JSON.parse(nw(t[1])),signature:NM(t[2]),raw:{header:t[0],payload:t[1]}}}async function RM(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function DM(e,t){return new Promise((r,a)=>{(async()=>{for(let i=0;i<1/0;i++)try{const o=await e(i);if(!t(i,null,o)){r(o);return}}catch(o){if(!t(i,o)){a(o);return}}})()})}function OM(e){return("0"+e.toString(16)).substr(-2)}function AM(){const t=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let a="";for(let i=0;i<56;i++)a+=n.charAt(Math.floor(Math.random()*r));return a}return crypto.getRandomValues(t),Array.from(t,OM).join("")}async function MM(e){const n=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",
433n),a=new Uint8Array(r);return Array.from(a).map(i=>String.fromCharCode(i)).join("")}async function IM(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 MM(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Ri(e,t,n=!1){const r=AM();let a=r;n&&(a+="/PASSWORD_RECOVERY"),await Li(e,`${t}-code-verifier`,a);const i=await IM(r);return[i,r===i?"plain":"s256"]}const LM=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function $M(e){const t=e.headers.get(lp);if(!t||!t.match(LM))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function FM(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 UM(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 zM=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Di(e){if(!zM.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Of(){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 rw(e){return JSON.parse(JSON.stringify(e))}var BM=function(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 a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};const Wa=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),VM=[502,503,504];async function sw(e){var t;if(!TM(e))throw new cp(Wa(e),0);if(VM.includes(e.status))throw new cp(Wa(e),e.status);let n;try{n=await e.json()}catch(i){throw new AN(Wa(i),i)}let r;const a=$M(e);if(a&&a.getTime()>=ON["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 Xy(Wa(n),e.status,((t=n.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new Ys}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((i,o)=>i&&typeof o=="string",!0))throw new Xy(Wa(n),e.status,n.weak_password.reasons);throw new gM(Wa(n),e.status||500,r)}const WM=(e,t,n,r)=>{const a={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?a:(a.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),a.body=JSON.stringify(r),Object.assign(Object.assign({},a),n))};async function ct(e,t,n,r){var a;const i=Object.assign({},r==null?void 0:r.headers);i[lp]||(i[lp]=ON["2024-01-01"].name),r!=null&&r.jwt&&(i.Authorization=`Bearer ${r.jwt}`);const o=(a=r==null?void 0:r.query)!==null&&a!==void 0?a:{};r!=null&&r.redirectTo&&(o.redirect_to=r.redirectTo);const l=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await HM(e,t,n+l,{headers:i,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 HM(e,t,n,r,a,i){const o=WM(t,r,a,i);let l;try{l=await e(n,Object.assign({},o))}catch(c){throw console.error(c),new cp(Wa(c),0)}if(l.ok||await sw(l),r!=null&&r.noResolveJson)return l;try{return await l.json()}catch(c){await sw(c)}}function xs(e){var t;let n=null;KM(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=CM(e.expires_in)));const r=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:n,user:r},error:null}}function aw(e){const t=xs(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 Js(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function qM(e){return{data:e,error:null}}function YM(e){const{action_link:t,email_otp:n,hashed_token:r,redirect_to:a,verification_type:i}=e,o=BM(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:t,email_otp:n,hashed_token:r,redirect_to:a,verification_type:i},c=Object.assign({},o);return{data:{properties:l,user:c},error:null}}function GM(e){return e}function KM(e){return e.access_token&&e.refresh_token&&e.expires_in}const Af=["global","local","others"];var ZM=function(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 a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};class QM{constructor({url:t="",headers:n={},fetch:r}){this.url=t,this.headers=n,this.fetch=LN(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(t,n=Af[0]){if(Af.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Af.join(", ")}`);try{return await ct(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(r){if(tt(r))return{data:null,error:r};throw r}}async inviteUserByEmail(t,n={}){try{return await ct(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:Js})}catch(r){if(tt(r))return{data:{user:null},error:r};throw r}}async generateLink(t){try{const{options:n}=t,r=ZM(t,["options"]),a=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(a.new_email=r==null?void 0:r.newEmail,delete a.newEmail),await ct(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:a,headers:this.headers,xform:YM,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(tt(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(t){try{return await ct(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:Js})}catch(n){if(tt(n))return{data:{user:null},error:n};throw n}}async listUsers(t){var n,r,a,i,o,l,c;try{const d={nextPage:null,lastPage:0,total:0},u=await ct(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:(i=(a=t==null?void 0:t.perPage)===null||a===void 0?void 0:a.toString())!==null&&i!==void 0?i:""},xform:GM});if(u.error)throw u.error;const f=await u.json(),m=(o=u.headers.get("x-total-count"))!==null&&o!==void 0?o:0,w=(c=(l=u.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return w.length>0&&(w.forEach(x=>{const p=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(x.split(";")[1].split("=")[1]);d[`${b}Page`]=p}),d.total=parseInt(m)),{data:Object.assign(Object.assign({},f),d),error:null}}catch(d){if(tt(d))return{data:{users:[]},error:d};throw d}}async getUserById(t){Di(t);try{return await ct(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:Js})}catch(n){if(tt(n))return{data:{user:null},error:n};throw n}}async updateUserById(t,n){Di(t);try{return await ct(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:n,headers:this.headers,xform:Js})}catch(r){if(tt(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,n=!1){Di(t);
433try{return await ct(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:n},xform:Js})}catch(r){if(tt(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){Di(t.userId);try{const{data:n,error:r}=await ct(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:a=>({data:{factors:a},error:null})});return{data:n,error:r}}catch(n){if(tt(n))return{data:null,error:n};throw n}}async _deleteFactor(t){Di(t.userId),Di(t.id);try{return{data:await ct(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(n){if(tt(n))return{data:null,error:n};throw n}}}function iw(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}function JM(){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)}}const Oi={debug:!!(globalThis&&IN()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class $N extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class XM extends $N{}async function eI(e,t,n){Oi.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const r=new globalThis.AbortController;return t>0&&setTimeout(()=>{r.abort(),Oi.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async a=>{if(a){Oi.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,a.name);try{return await n()}finally{Oi.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,a.name)}}else{if(t===0)throw Oi.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new XM(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(Oi.debug)try{const i=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(i,null," "))}catch(i){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",i)}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()}}))}JM();const tI={url:uM,storageKey:hM,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:fM,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function ow(e,t,n){return await n()}const Ai={};class ac{constructor(t){var n,r;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=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,this.instanceID=ac.nextInstanceID,ac.nextInstanceID+=1,this.instanceID>0&&_r()&&console.warn("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.");const a=Object.assign(Object.assign({},tI),t);if(this.logDebugMessages=!!a.debug,typeof a.debug=="function"&&(this.logger=a.debug),this.persistSession=a.persistSession,this.storageKey=a.storageKey,this.autoRefreshToken=a.autoRefreshToken,this.admin=new QM({url:a.url,headers:a.headers,fetch:a.fetch}),this.url=a.url,this.headers=a.headers,this.fetch=LN(a.fetch),this.lock=a.lock||ow,this.detectSessionInUrl=a.detectSessionInUrl,this.flowType=a.flowType,this.hasCustomAuthorizationHeader=a.hasCustomAuthorizationHeader,a.lock?this.lock=a.lock:_r()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=eI:this.lock=ow,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)},this.persistSession?(a.storage?this.storage=a.storage:IN()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=iw(this.memoryStorage)),a.userStorage&&(this.userStorage=a.userStorage)):(this.memoryStorage={},this.storage=iw(this.memoryStorage)),_r()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(i){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",i)}(r=this.broadcastChannel)===null||r===void 0||r.addEventListener("message",async i=>{this._debug("received broadcast notification from other tab or client",i),await this._notifyAllSubscribers(i.data.event,i.data.session,!1)})}this.initialize()}get jwks(){var t,n;return(n=(t=Ai[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(t){Ai[this.storageKey]=Object.assign(Object.assign({},Ai[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,n;return(n=(t=Ai[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Ai[this.storageKey]=Object.assign(Object.assign({},Ai[this.storageKey]),{cachedAt:t})}_debug(...t){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${DN}) ${new Date().toISOString()}`,...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{const n=PM(window.location.href);let r="none";if(this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce"),_r()&&this.detectSessionInUrl&&r!=="none"){const{data:a,error:i}=await this._getSessionFromURL(n,r);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),yM(i)){const c=(t=i.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:i}}return await this._removeSession(),{error:i}}const{session:o,redirectType:l}=a;return this._debug("#_initialize()","detected session in URL",o,"redirect type",l),await this._saveSession(o),setTimeout(async()=>{l==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return tt(n)?{error:n}:{error:new AN("Unexpected error during initialization",n)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var n,r,a;try{const i=await ct(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:(a=t==null?void 0:t.options)===null||a===void 0?void 0:a.captchaToken}},xform:xs}),{data:o,error:l}=i;if(l||!o)return{data:{user:null,session:null},error:l};const c=o.session,d=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),{data:{user:d,session:c},error:null}}catch(i){if(tt(i))return{data:{user:null,session:null},error:i};throw i}}async signUp(t){var n,r,a;try{let i;if("email"in t){const{email:u,password:f,options:m}=t;let w=null,x=null;this.flowType==="pkce"&&([w,x]=await Ri(this.storage,this.storageKey)),i=await ct(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:m==null?void 0:m.emailRedirectTo,body:{email:u,password:f,data:(n=m==null?void 0:m.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:m==null?void 0:m.captchaToken},code_challenge:w,code_challenge_method:x},xform:xs})}else if("phone"in t){const{phone:u,password:f,options:m}=t;i=await ct(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:u,password:f,data:(r=m==null?void 0:m.data)!==null&&r!==void 0?r:{},channel:(a=m==null?void 0:m.channel)!==null&&a!==void 0?a:"sms",gotrue_meta_security:{captcha_token:m==null?void 0:m.captchaToken}},xform:xs})}else throw new Sd("You must provide either an email or phone number and a password");const{data:o,error:l}=i;if(l||!o)return{data:{user:null,session:null},error:l};const c=o.session,d=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),{data:{user:d,session:c},error:null}}catch(i){if(tt(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithPassword(t){try{let n;if("email"in t){const{email:i,password:o,options:l}=t;n=await ct(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:aw}
433)}else if("phone"in t){const{phone:i,password:o,options:l}=t;n=await ct(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:aw})}else throw new Sd("You must provide either an email or phone number and a password");const{data:r,error:a}=n;return a?{data:{user:null,session:null},error:a}:!r||!r.session||!r.user?{data:{user:null,session:null},error:new Nd}:(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),{data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:a})}catch(n){if(tt(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithOAuth(t){var n,r,a,i;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:(a=t.options)===null||a===void 0?void 0:a.queryParams,skipBrowserRedirect:(i=t.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:n}=t;if(n==="solana")return await this.signInWithSolana(t);throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}async signInWithSolana(t){var n,r,a,i,o,l,c,d,u,f,m,w;let x,p;if("message"in t)x=t.message,p=t.signature;else{const{chain:b,wallet:v,statement:g,options:y}=t;let j;if(_r())if(typeof v=="object")j=v;else{const k=window;if("solana"in k&&typeof k.solana=="object"&&("signIn"in k.solana&&typeof k.solana.signIn=="function"||"signMessage"in k.solana&&typeof k.solana.signMessage=="function"))j=k.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 v!="object"||!(y!=null&&y.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");j=v}const N=new URL((n=y==null?void 0:y.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in j&&j.signIn){const k=await j.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},y==null?void 0:y.signInWithSolana),{version:"1",domain:N.host,uri:N.href}),g?{statement:g}:null));let C;if(Array.isArray(k)&&k[0]&&typeof k[0]=="object")C=k[0];else if(k&&typeof k=="object"&&"signedMessage"in k&&"signature"in k)C=k;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in C&&"signature"in C&&(typeof C.signedMessage=="string"||C.signedMessage instanceof Uint8Array)&&C.signature instanceof Uint8Array)x=typeof C.signedMessage=="string"?C.signedMessage:new TextDecoder().decode(C.signedMessage),p=C.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in j)||typeof j.signMessage!="function"||!("publicKey"in j)||typeof j!="object"||!j.publicKey||!("toBase58"in j.publicKey)||typeof j.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");x=[`${N.host} wants you to sign in with your Solana account:`,j.publicKey.toBase58(),...g?["",g,""]:[""],"Version: 1",`URI: ${N.href}`,`Issued At: ${(a=(r=y==null?void 0:y.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&a!==void 0?a:new Date().toISOString()}`,...!((i=y==null?void 0:y.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${y.signInWithSolana.notBefore}`]:[],...!((o=y==null?void 0:y.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${y.signInWithSolana.expirationTime}`]:[],...!((l=y==null?void 0:y.signInWithSolana)===null||l===void 0)&&l.chainId?[`Chain ID: ${y.signInWithSolana.chainId}`]:[],...!((c=y==null?void 0:y.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${y.signInWithSolana.nonce}`]:[],...!((d=y==null?void 0:y.signInWithSolana)===null||d===void 0)&&d.requestId?[`Request ID: ${y.signInWithSolana.requestId}`]:[],...!((f=(u=y==null?void 0:y.signInWithSolana)===null||u===void 0?void 0:u.resources)===null||f===void 0)&&f.length?["Resources",...y.signInWithSolana.resources.map(C=>
433`- ${C}`)]:[]].join(` 434`);const k=await j.signMessage(new TextEncoder().encode(x),"utf8");if(!k||!(k instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");p=k}}try{const{data:b,error:v}=await ct(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:x,signature:kM(p)},!((m=t.options)===null||m===void 0)&&m.captchaToken?{gotrue_meta_security:{captcha_token:(w=t.options)===null||w===void 0?void 0:w.captchaToken}}:null),xform:xs});if(v)throw v;return!b||!b.session||!b.user?{data:{user:null,session:null},error:new Nd}:(b.session&&(await this._saveSession(b.session),await this._notifyAllSubscribers("SIGNED_IN",b.session)),{data:Object.assign({},b),error:v})}catch(b){if(tt(b))return{data:{user:null,session:null},error:b};throw b}}async _exchangeCodeForSession(t){const n=await za(this.storage,`${this.storageKey}-code-verifier`),[r,a]=(n??"").split("/");try{const{data:i,error:o}=await ct(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:xs});if(await Vs(this.storage,`${this.storageKey}-code-verifier`),o)throw o;return!i||!i.session||!i.user?{data:{user:null,session:null,redirectType:null},error:new Nd}:(i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),{data:Object.assign(Object.assign({},i),{redirectType:a??null}),error:o})}catch(i){if(tt(i))return{data:{user:null,session:null,redirectType:null},error:i};throw i}}async signInWithIdToken(t){try{const{options:n,provider:r,token:a,access_token:i,nonce:o}=t,l=await ct(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:a,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:xs}),{data:c,error:d}=l;return d?{data:{user:null,session:null},error:d}:!c||!c.session||!c.user?{data:{user:null,session:null},error:new Nd}:(c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),{data:c,error:d})}catch(n){if(tt(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithOtp(t){var n,r,a,i,o;try{if("email"in t){const{email:l,options:c}=t;let d=null,u=null;this.flowType==="pkce"&&([d,u]=await Ri(this.storage,this.storageKey));const{error:f}=await ct(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:d,code_challenge_method:u},redirectTo:c==null?void 0:c.emailRedirectTo});return{data:{user:null,session:null},error:f}}if("phone"in t){const{phone:l,options:c}=t,{data:d,error:u}=await ct(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(a=c==null?void 0:c.data)!==null&&a!==void 0?a:{},create_user:(i=c==null?void 0:c.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(o=c==null?void 0:c.channel)!==null&&o!==void 0?o:"sms"}});return{data:{user:null,session:null,messageId:d==null?void 0:d.message_id},error:u}}throw new Sd("You must provide either an email or phone number.")}catch(l){if(tt(l))return{data:{user:null,session:null},error:l};throw l}}async verifyOtp(t){var n,r;try{let a,i;"options"in t&&(a=(n=t.options)===null||n===void 0?void 0:n.redirectTo,i=(r=t.options)===null||r===void 0?void 0:r.captchaToken);const{data:o,error:l}=await ct(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:i}}),redirectTo:a,xform:xs});if(l)throw l;if(!o)throw new Error("An error occurred on token verification.");const c=o.session,d=o.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),{data:{user:d,session:c},error:null}}catch(a){if(tt(a))return{data:{user:null,session:null},error:a};throw a}}async signInWithSSO(t){var n,r,a;try{let i=null,o=null;return this.flowType==="pkce"&&([i,o]=await Ri(this.storage,this.storageKey)),await ct(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}),!((a=t==null?void 0:t.options)===null||a===void 0)&&a.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:i,code_challenge_method:o}),headers:this.headers,xform:qM})}catch(i){if(tt(i))return{data:null,error:i};throw i}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,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 Ys;const{error:a}=await ct(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return{data:{user:null,session:null},error:a}})}catch(t){if(tt(t))return{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:a,options:i}=t,{error:o}=await ct(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:a,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},redirectTo:i==null?void 0:i.emailRedirectTo});return{data:{user:null,session:null},error:o}}else if("phone"in t){const{phone:r,type:a,options:i}=t,{data:o,error:l}=await ct(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:a,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}}});return{data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:l}}throw new Sd("You must provide either an email or phone number and a type")}catch(n){if(tt(n))return{data:{user:null,session:null},error:n};throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,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(),a=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await a}catch{}})()),a}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 a=[...this.pendingInLock];await Promise.all(a),this.pendingInLock.splice(0,a.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 za(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
434id"),await this._removeSession())),!t)return{data:{session:null},error:null};const r=t.expires_at?t.expires_at*1e3-Date.now()<Tf:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.userStorage){const o=await za(this.userStorage,this.storageKey+"-user");o!=null&&o.user?t.user=o.user:t.user=Of()}if(this.storage.isServer&&t.user){let o=this.suppressGetSessionWarning;t=new Proxy(t,{get:(c,d,u)=>(!o&&d==="user"&&(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."),o=!0,this.suppressGetSessionWarning=!0),Reflect.get(c,d,u))})}return{data:{session:t},error:null}}const{session:a,error:i}=await this._callRefreshToken(t.refresh_token);return i?{data:{session:null},error:i}:{data:{session:a},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(t){return t?await this._getUser(t):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(t){try{return t?await ct(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:Js}):await this._useSession(async n=>{var r,a,i;const{data:o,error:l}=n;if(l)throw l;return!(!((r=o.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Ys}:await ct(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(a=o.session)===null||a===void 0?void 0:a.access_token)!==null&&i!==void 0?i:void 0,xform:Js})})}catch(n){if(tt(n))return xM(n)&&(await this._removeSession(),await Vs(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:n};throw n}}async updateUser(t,n={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(t,n))}async _updateUser(t,n={}){try{return await this._useSession(async r=>{const{data:a,error:i}=r;if(i)throw i;if(!a.session)throw new Ys;const o=a.session;let l=null,c=null;this.flowType==="pkce"&&t.email!=null&&([l,c]=await Ri(this.storage,this.storageKey));const{data:d,error:u}=await ct(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:o.access_token,xform:Js});if(u)throw u;return o.user=d.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),{data:{user:o.user},error:null}})}catch(r){if(tt(r))return{data:{user:null},error:r};throw r}}async setSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new Ys;const n=Date.now()/1e3;let r=n,a=!0,i=null;const{payload:o}=Df(t.access_token);if(o.exp&&(r=o.exp,a=r<=n),a){const{session:l,error:c}=await this._callRefreshToken(t.refresh_token);if(c)return{data:{user:null,session:null},error:c};if(!l)return{data:{user:null,session:null},error:null};i=l}else{const{data:l,error:c}=await this._getUser(t.access_token);if(c)throw c;i={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(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return{data:{user:i.user,session:i},error:null}}catch(n){if(tt(n))return{data:{session:null,user:null},error:n};throw n}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async n=>{var r;if(!t){const{data:o,error:l}=n;if(l)throw l;t=(r=o.session)!==null&&r!==void 0?r:void 0}if(!(t!=null&&t.refresh_token))throw new Ys;const{session:a,error:i}=await this._callRefreshToken(t.refresh_token);return i?{data:{user:null,session:null},error:i}:a?{data:{user:a.user,session:a},error:null}:{data:{user:null,session:null},error:null}})}catch(n){if(tt(n))return{data:{user:null,session:null},error:n};throw n}}async _getSessionFromURL(t,n){try{if(!_r())throw new kd("No browser detected.");
434if(t.error||t.error_description||t.error_code)throw new kd(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 Jy("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new kd("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 Jy("No code detected.");const{data:g,error:y}=await this._exchangeCodeForSession(t.code);if(y)throw y;const j=new URL(window.location.href);return j.searchParams.delete("code"),window.history.replaceState(window.history.state,"",j.toString()),{data:{session:g.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:a,access_token:i,refresh_token:o,expires_in:l,expires_at:c,token_type:d}=t;if(!i||!l||!o||!d)throw new kd("No session defined in URL");const u=Math.round(Date.now()/1e3),f=parseInt(l);let m=u+f;c&&(m=parseInt(c));const w=m-u;w*1e3<=Ii&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${w}s, should have been closer to ${f}s`);const x=m-f;u-x>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",x,m,u):u-x<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",x,m,u);const{data:p,error:b}=await this._getUser(i);if(b)throw b;const v={provider_token:r,provider_refresh_token:a,access_token:i,expires_in:f,expires_at:m,refresh_token:o,token_type:d,user:p.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:v,redirectType:t.type},error:null}}catch(r){if(tt(r))return{data:{session:null,redirectType:null},error:r};throw r}}_isImplicitGrantCallback(t){return!!(t.access_token||t.error_description)}async _isPKCECallback(t){const n=await za(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&n)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async n=>{var r;const{data:a,error:i}=n;if(i)return{error:i};const o=(r=a.session)===null||r===void 0?void 0:r.access_token;if(o){const{error:l}=await this.admin.signOut(o,t);if(l&&!(vM(l)&&(l.status===404||l.status===401||l.status===403)))return{error:l}}return t!=="others"&&(await this._removeSession(),await Vs(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(t){const n=EM(),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(-1,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:r}}}async _emitInitialSession(t){return await this._useSession(async n=>{var r,a;try{const{data:{session:i},error:o}=n;if(o)throw o;await((r=this.stateChangeEmitters.get(t))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",t,"session",i)}catch(i){await((a=this.stateChangeEmitters.get(t))===null||a===void 0?void 0:a.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",i),console.error(i)}})}async resetPasswordForEmail(t,n={}){let r=null,a=null;this.flowType==="pkce"&&([r,a]=await Ri(this.storage,this.storageKey,!0));try{return await ct(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:r,code_challenge_method:a,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(i){if(tt(i))return{data:null,error:i};throw i}}async getUserIdentities(){var t;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return{data:{identities:(t=n.user.identities)!==null&&t!==void 0?t:[]},error:null}}catch(n){if(tt(n))return{data:null,error:n};throw n}}async linkIdentity(t){var n;try{const{data:r,error:a}=await this._useSession(async i=>{var o,l,c,d,u;const{data:f,error:m}=i;if(m)throw m;const w=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(o=t.options)===null||o===void 0?void 0:o.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 ct(this.fetch,"GET",w,{headers:this.headers,jwt:(u=(d=f.session)===null||d===void 0?void 0:d.access_token)!==null&&u!==void 0?u:void 0})});if(a)throw a;return _r()&&!(!((n=t.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),{data:{provider:t.provider,url:r==null?void 0:r.url},error:null}}catch(r){if(tt(r))return{data:{provider:t.provider,url:null},error:r};throw r}}async unlinkIdentity(t){try{return await this._useSession(async n=>{var r,a;const{data:i,error:o}=n;
434if(o)throw o;return await ct(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(a=(r=i.session)===null||r===void 0?void 0:r.access_token)!==null&&a!==void 0?a:void 0})})}catch(n){if(tt(n))return{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 DM(async a=>(a>0&&await RM(200*Math.pow(2,a-1)),this._debug(n,"refreshing attempt",a),await ct(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:xs})),(a,i)=>{const o=200*Math.pow(2,a);return i&&Rf(i)&&Date.now()+o-r<Ii})}catch(r){if(this._debug(n,"error",r),tt(r))return{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),_r()&&!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 a=await za(this.storage,this.storageKey);if(a&&this.userStorage){let o=await za(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:a.user},await Li(this.userStorage,this.storageKey+"-user",o)),a.user=(t=o==null?void 0:o.user)!==null&&t!==void 0?t:Of()}else if(a&&!a.user&&!a.user){const o=await za(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(a.user=o.user,await Vs(this.storage,this.storageKey+"-user"),await Li(this.storage,this.storageKey,a)):a.user=Of()}if(this._debug(r,"session from storage",a),!this._isValidSession(a)){this._debug(r,"session is not valid"),a!==null&&await this._removeSession();return}const i=((n=a.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<Tf;if(this._debug(r,`session has${i?"":" not"} expired with margin of ${Tf}s`),i){if(this.autoRefreshToken&&a.refresh_token){const{error:o}=await this._callRefreshToken(a.refresh_token);o&&(console.error(o),Rf(o)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(a.user&&a.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:l}=await this._getUser(a.access_token);!l&&(o!=null&&o.user)?(a.user=o.user,await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(r,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",a)}catch(a){this._debug(r,"error",a),console.error(a);return}finally{this._debug(r,"end")}}async _callRefreshToken(t){var n,r;if(!t)throw new Ys;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const a=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(a,"begin");try{this.refreshingDeferred=new Ch;const{data:i,error:o}=await this._refreshAccessToken(t);if(o)throw o;if(!i.session)throw new Ys;await this._saveSession(i.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const l={session:i.session,error:null};return this.refreshingDeferred.resolve(l),l}catch(i){if(this._debug(a,"error",i),tt(i)){const o={session:null,error:i};return Rf(i)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(o),o}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(i),i}finally{this.refreshingDeferred=null,this._debug(a,"end")}}async _notifyAllSubscribers(t,n,r=!0){const a=`#_notifyAllSubscribers(${t})`;this._debug(a,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:t,session:n});const i=[],o=Array.from(this.stateChangeEmitters.values()).map(async l=>{try{await l.callback(t,n)}catch(c){i.push(c)}});if(await Promise.all(o),i.length>0){for(let l=0;l<i.length;l+=1)console.error(i[l]);throw i[0]}}finally{this._debug(a,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0;const n=Object.assign({},t),r=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&n.user&&await Li(this.userStorage,this.storageKey+"-user",{user:n.user});const a=Object.assign({},n);delete a.user;const i=rw(a);await Li(this.storage,this.storageKey,i)}else{const a=rw(n);await Li(this.storage,this.storageKey,a)}}async _removeSession(){this._debug("#_removeSession()"),await Vs(this.storage,this.storageKey),await Vs(this.storage,this.storageKey+"-code-verifier"),await Vs(this.storage,this.storageKey+"-user"),this.userStorage&&await Vs(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&_r()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}
434catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),Ii);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t)}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 a=Math.floor((r.expires_at*1e3-t)/Ii);this._debug("#_autoRefreshTokenTick()",`access token expires in ${a} ticks, a tick lasts ${Ii}ms, refresh threshold is ${op} ticks`),a<=op&&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 $N)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!_r()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),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(-1,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 a=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&a.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&a.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[i,o]=await Ri(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(o)}`});a.push(l.toString())}if(r!=null&&r.queryParams){const i=new URLSearchParams(r.queryParams);a.push(i.toString())}return r!=null&&r.skipBrowserRedirect&&a.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${t}?${a.join("&")}`}async _unenroll(t){try{return await this._useSession(async n=>{var r;const{data:a,error:i}=n;return i?{data:null,error:i}:await ct(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(r=a==null?void 0:a.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(tt(n))return{data:null,error:n};throw n}}async _enroll(t){try{return await this._useSession(async n=>{var r,a;const{data:i,error:o}=n;if(o)return{data:null,error:o};const l=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:{issuer:t.issuer}),{data:c,error:d}=await ct(this.fetch,"POST",`${this.url}/factors`,{body:l,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});return d?{data:null,error:d}:(t.factorType==="totp"&&(!((a=c==null?void 0:c.totp)===null||a===void 0)&&a.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),{data:c,error:null})})}catch(n){if(tt(n))return{data:null,error:n};throw n}}async _verify(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async n=>{var r;const{data:a,error:i}=n;if(i)return{data:null,error:i};const{data:o,error:l}=await ct(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:{code:t.code,challenge_id:t.challengeId},headers:this.headers,jwt:(r=a==null?void 0:a.session)===null||r===void 0?void 0:r.access_token});return l?{data:null,error:l}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),{data:o,error:l})})}catch(n){if(tt(n))return{data:null,error:n};throw n}})}async _challenge(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async n=>{var r;const{data:a,error:i}=n;return i?{data:null,error:i}:await ct(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:{channel:t.channel},headers:this.headers,jwt:(r=a==null?void 0:a.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(tt(n))return{data:null,error:n};throw n}})}async _challengeAndVerify(t){const{data:n,error:r}=await this._challenge({factorId:t.factorId});return r?{data:null,error:r}:await this._verify({factorId:t.factorId,challengeId:n.id,code:t.code})}async _listFactors(){const{data:{user:t},error:n}=await this.getUser();if(n)return{data:null,error:n};const r=(t==null?void 0:t.factors)||[],a=r.filter(o=>o.factor_type==="totp"&&o.status==="verified"),i=r.filter(o=>o.factor_type==="phone"&&o.status==="verified");return{data:{all:r,totp:a,phone:i},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async t=>{var n,r;const{data:{session:a},error:i}=t;if(i)return{data:null,error:i};if(!a)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:o}=Df(a.access_token);let l=null;o.aal&&(l=o.aal);let c=l;((r=(n=a.user.factors)===null||n===void 0?void 0:n.filter(f=>f.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(c="aal2");const u=o.amr||[];return{data:{currentLevel:l,nextLevel:c,currentAuthenticationMethods:u},error:null}}))}async fetchJwk(t,n={keys:[]}){let r=n.keys.find(l=>l.kid===t);if(r)return r;const a=Date.now();if(r=this.jwks.keys.find(l=>l.kid===t),r&&this.jwks_cached_at+pM>a)return r;const{data:i,error:o}=await ct(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=a,r=i.keys.find(l=>l.kid===t),!r)?null:r}async getClaims(t,n={}){try{let r=t;if(!r){const{data:w,error:x}
434=await this.getSession();if(x||!w.session)return{data:null,error:x};r=w.session.access_token}const{header:a,payload:i,signature:o,raw:{header:l,payload:c}}=Df(r);n!=null&&n.allowExpired||FM(i.exp);const d=!a.alg||a.alg.startsWith("HS")||!a.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(a.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!d){const{error:w}=await this.getUser(r);if(w)throw w;return{data:{claims:i,header:a,signature:o},error:null}}const u=UM(a.alg),f=await crypto.subtle.importKey("jwk",d,u,!0,["verify"]);if(!await crypto.subtle.verify(u,f,o,SM(`${l}.${c}`)))throw new dp("Invalid JWT signature");return{data:{claims:i,header:a,signature:o},error:null}}catch(r){if(tt(r))return{data:null,error:r};throw r}}}ac.nextInstanceID=0;const nI=ac;class rI extends nI{constructor(t){super(t)}}var sI=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function l(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(l,c)}d((r=r.apply(e,t||[])).next())})};class aI{constructor(t,n,r){var a,i,o;if(this.supabaseUrl=t,this.supabaseKey=n,!t)throw new Error("supabaseUrl is required.");if(!n)throw new Error("supabaseKey is required.");const l=cM(t),c=new URL(l);this.realtimeUrl=new URL("realtime/v1",c),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",c),this.storageUrl=new URL("storage/v1",c),this.functionsUrl=new URL("functions/v1",c);const d=`sb-${c.hostname.split(".")[0]}-auth-token`,u={db:tM,realtime:rM,auth:Object.assign(Object.assign({},nM),{storageKey:d}),global:eM},f=dM(r??{},u);this.storageKey=(a=f.auth.storageKey)!==null&&a!==void 0?a:"",this.headers=(i=f.global.headers)!==null&&i!==void 0?i:{},f.accessToken?(this.accessToken=f.accessToken,this.auth=new Proxy({},{get:(m,w)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(w)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((o=f.auth)!==null&&o!==void 0?o:{},this.headers,f.global.fetch),this.fetch=oM(n,this._getAccessToken.bind(this),f.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},f.realtime)),this.rest=new _A(new URL("rest/v1",c).href,{headers:this.headers,schema:f.db.schema,fetch:this.fetch}),this.storage=new QA(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),f.accessToken||this._listenForAuthEvents()}get functions(){return new XO(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,n={},r={}){return this.rest.rpc(t,n,r)}channel(t,n={config:{}}){return this.realtime.channel(t,n)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var t,n;return sI(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();const{data:r}=yield this.auth.getSession();return(n=(t=r.session)===null||t===void 0?void 0:t.access_token)!==null&&n!==void 0?n:null})}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:n,detectSessionInUrl:r,storage:a,storageKey:i,flowType:o,lock:l,debug:c},d,u){const f={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new rI({url:this.authUrl.href,headers:Object.assign(Object.assign({},f),d),storageKey:i,autoRefreshToken:t,persistSession:n,detectSessionInUrl:r,storage:a,flowType:o,lock:l,debug:c,fetch:u,hasCustomAuthorizationHeader:"Authorization"in this.headers})}_initRealtimeClient(t){return new $A(this.realtimeUrl.href,Object.assign(Object.assign({},t),{params:Object.assign({apikey:this.supabaseKey},t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((n,r)=>{this._handleTokenChanged(n,"CLIENT",r==null?void 0:r.access_token)})}_handleTokenChanged(t,n,r){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==r?this.changedAccessToken=r:t==="SIGNED_OUT"&&(this.realtime.setAuth(),n=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const iI=(e,t,n)=>
434new aI(e,t,n);function oI(){if(typeof window<"u"||typeof process>"u"||process.version===void 0||process.version===null)return!1;const e=process.version.match(/^v(\d+)\./);return e?parseInt(e[1],10)<=18:!1}oI()&&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");function lI(){var b,v;if(typeof window>"u")return;const e=location.hostname,n=["lovableproject.com","lovableproject-dev.com","lovable.app","gpt-eng.com","gptengineer.run"].some(g=>e===g||e.endsWith("."+g)),r="[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",a=n?((b=e.match(new RegExp("^(?:id-preview(?:-[a-z0-9]+)?|project)--("+r+")(?:-dev)?(?=\\.|$)","i")))==null?void 0:b[1])??((v=e.match(new RegExp("^("+r+")(?=[.-])","i")))==null?void 0:v[1]):void 0,i=window.parent&&window.parent!==window;if(!a||!i)return localStorage;const o=e.endsWith(".lovableproject-dev.com")||e.endsWith(".gpt-eng.com"),l=o?/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$|^http:\/\/localhost:3000$/:/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$/,c=location.ancestorOrigins&&location.ancestorOrigins[0]||(document.referrer?new URL(document.referrer).origin:""),d=c&&l.test(c)?[c]:o?["https://lovable.dev","http://localhost:3000"]:["https://lovable.dev"],u="lovable-preview-auth:result",f=2e3,m=()=>Math.random().toString(36).slice(2)+Date.now().toString(36),w=(g,y,j)=>new Promise(N=>{const k=m();let C=!1,E;const H=U=>{C||(C=!0,clearTimeout(E),window.removeEventListener("message",A),N(U))},A=U=>{if(d.indexOf(U.origin)<0)return;const ae=U.data;ae&&ae.type===u&&ae.requestId===k&&H(ae)};window.addEventListener("message",A);const F={type:g,requestId:k,projectId:a,key:y};j!==void 0&&(F.value=j);for(const U of d)window.parent.postMessage(F,U);E=setTimeout(()=>H(null),f)});let x=!0;const p=250;return{getItem:async g=>{let y=await w("lovable-preview-auth:get",g);return!y&&x&&(await new Promise(j=>setTimeout(j,p)),y=await w("lovable-preview-auth:get",g)),x=!1,y&&y.ok&&typeof y.value=="string"?y.value===""?(localStorage.removeItem(g),null):y.value:localStorage.getItem(g)},setItem:(g,y)=>(localStorage.setItem(g,y),w("lovable-preview-auth:set",g,y).then(()=>{})),removeItem:g=>(localStorage.removeItem(g),w("lovable-preview-auth:remove",g).then(()=>{}))}}const cI="https://lparckgffeksgssxyihs.supabase.co",dI="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImxwYXJja2dmZmVrc2dzc3h5aWhzIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTEyMTc3OTYsImV4cCI6MjA2Njc5Mzc5Nn0.cEZtOO5r5cWY1k3NUf42Xxl5ePYtGbv7oIUr_LxXOLk",R=iI(cI,dI,{auth:{storage:lI(),persistSession:!0,autoRefreshToken:!0}});var uI="Label",FN=h.forwardRef((e,t)=>s.jsx(Ye.label,{...e,ref:t,onMouseDown:n=>{var a;n.target.closest("button, input, select, textarea")||((a=e.onMouseDown)==null||a.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));FN.displayName=uI;var UN=FN;const hI=Ac("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),B=h.forwardRef(({className:e,...t},n)=>s.jsx(UN,{ref:n,className:ke(hI(),e),...t}));B.displayName=UN.displayName;function lw(e,[t,n]){return Math.min(n,Math.max(t,e))}var fI=h.createContext(void 0);function Eh(e){const t=h.useContext(fI);return e||t||"ltr"}function Ph(e){const t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var mI=[" ","Enter","ArrowUp","ArrowDown"],pI=[" ","Enter"],Uc="Select",[Th,Rh,gI]=jg(Uc),[Zo,V6]=Hr(Uc,[gI,Ho]),Dh=Ho(),[vI,Ia]=Zo(Uc),[xI,yI]=Zo(Uc),zN=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:i,value:o,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:f,disabled:m,required:w,form:x}=e,p=Dh(t),[b,v]=h.useState(null),[g,y]=h.useState(null),[j,N]=h.useState(!1),k=Eh(d),[C=!1,E]=cs({prop:r,defaultProp:a,onChange:i}),[H,A]=cs({prop:o,defaultProp:l,onChange:c}),F=h.useRef(null),U=b?x||!!b.closest("form"):!0,[ae,q]=h.useState(new Set),se=Array.from(ae).map(D=>D.props.value).join(";");return s.jsx(h_,{...p,children:s.jsxs(vI,{required:w,scope:t,trigger:b,onTriggerChange:v,valueNode:g,onValueNodeChange:y,valueNodeHasChildren:j,onValueNodeHasChildrenChange:N,contentId:Cs(),value:H,onValueChange:A,open:C,onOpenChange:E,dir:k,triggerPointerDownPosRef:F,disabled:m,children:[s.jsx(Th.Provider,{scope:t,children:s.jsx(xI,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(D=>{q(T=>new Set(T).add(D))},[]),onNativeOptionRemove:h.useCallback(D=>{q(T=>{const _=new Set(T);return _.delete(D),_})},[]),children:n})}),U?s.jsxs(h1,{"aria-hidden":!0,required:w,tabIndex:-1,name:u,autoComplete:f,value:H,onChange:D=>
vendor: 16,877 bytes, line 434
434A(D.target.value),disabled:m,form:x,children:[H===void 0?s.jsx("option",{value:""}):null,Array.from(ae)]},se):null]})})};zN.displayName=Uc;var BN="SelectTrigger",VN=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,i=Dh(n),o=Ia(BN,n),l=o.disabled||r,c=wt(t,o.onTriggerChange),d=Rh(n),u=h.useRef("touch"),[f,m,w]=f1(p=>{const b=d().filter(y=>!y.disabled),v=b.find(y=>y.value===o.value),g=m1(b,p,v);g!==void 0&&o.onValueChange(g.value)}),x=p=>{l||(o.onOpenChange(!0),w()),p&&(o.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return s.jsx(uh,{asChild:!0,...i,children:s.jsx(Ye.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":u1(o.value)?"":void 0,...a,ref:c,onClick:Le(a.onClick,p=>{p.currentTarget.focus(),u.current!=="mouse"&&x(p)}),onPointerDown:Le(a.onPointerDown,p=>{u.current=p.pointerType;const b=p.target;b.hasPointerCapture(p.pointerId)&&b.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(x(p),p.preventDefault())}),onKeyDown:Le(a.onKeyDown,p=>{const b=f.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&m(p.key),!(b&&p.key===" ")&&mI.includes(p.key)&&(x(),p.preventDefault())})})})});VN.displayName=BN;var WN="SelectValue",HN=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:i,placeholder:o="",...l}=e,c=Ia(WN,n),{onValueNodeHasChildrenChange:d}=c,u=i!==void 0,f=wt(t,c.onValueNodeChange);return kn(()=>{d(u)},[d,u]),s.jsx(Ye.span,{...l,ref:f,style:{pointerEvents:"none"},children:u1(c.value)?s.jsx(s.Fragment,{children:o}):i})});HN.displayName=WN;var wI="SelectIcon",qN=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return s.jsx(Ye.span,{"aria-hidden":!0,...a,ref:t,children:r||"â¼"})});qN.displayName=wI;var bI="SelectPortal",YN=e=>s.jsx(Dc,{asChild:!0,...e});YN.displayName=bI;var pi="SelectContent",GN=h.forwardRef((e,t)=>{const n=Ia(pi,e.__scopeSelect),[r,a]=h.useState();if(kn(()=>{a(new DocumentFragment)},[]),!n.open){const i=r;return i?ji.createPortal(s.jsx(KN,{scope:e.__scopeSelect,children:s.jsx(Th.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),i):null}return s.jsx(ZN,{...e,ref:t})});GN.displayName=pi;var Nr=10,[KN,La]=Zo(pi),jI="SelectContentImpl",ZN=h.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:o,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:f,collisionBoundary:m,collisionPadding:w,sticky:x,hideWhenDetached:p,avoidCollisions:b,...v}=e,g=Ia(pi,n),[y,j]=h.useState(null),[N,k]=h.useState(null),C=wt(t,K=>j(K)),[E,H]=h.useState(null),[A,F]=h.useState(null),U=Rh(n),[ae,q]=h.useState(!1),se=h.useRef(!1);h.useEffect(()=>{if(y)return Yg(y)},[y]),qg();const D=h.useCallback(K=>{const[P,...Z]=U().map(z=>z.ref.current),[ee]=Z.slice(-1),le=document.activeElement;for(const z of K)if(z===le||(z==null||z.scrollIntoView({block:"nearest"}),z===P&&N&&(N.scrollTop=0),z===ee&&N&&(N.scrollTop=N.scrollHeight),z==null||z.focus(),document.activeElement!==le))return},[U,N]),T=h.useCallback(()=>D([E,y]),[D,E,y]);h.useEffect(()=>{ae&&T()},[ae,T]);const{onOpenChange:_,triggerPointerDownPosRef:O}=g;h.useEffect(()=>{if(y){let K={x:0,y:0};const P=ee=>{var le,z;K={x:Math.abs(Math.round(ee.pageX)-(((le=O.current)==null?void 0:le.x)??0)),y:Math.abs(Math.round(ee.pageY)-(((z=O.current)==null?void 0:z.y)??0))}},Z=ee=>{K.x<=10&&K.y<=10?ee.preventDefault():y.contains(ee.target)||_(!1),document.removeEventListener("pointermove",P),O.current=null};return O.current!==null&&(document.addEventListener("pointermove",P),document.addEventListener("pointerup",Z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",P),document.removeEventListener("pointerup",Z,{capture:!0})}}},[y,_,O]),h.useEffect(()=>{const K=()=>_(!1);return window.addEventListener("blur",K),window.addEventListener("resize",K),()=>{window.removeEventListener("blur",K),window.removeEventListener("resize",K)}},[_]);const[G,Y]=f1(K=>{const P=U().filter(le=>!le.disabled),Z=P.find(le=>le.ref.current===document.activeElement),ee=m1(P,K,Z);ee&&setTimeout(()=>ee.ref.current.focus())}),oe=h.useCallback((K,P,Z)=>{const ee=!se.current&&!Z;(g.value!==void 0&&g.value===P||ee)&&(H(K),ee&&(se.current=!0))},[g.value]),M=h.useCallback(()=>y==null?void 0:y.focus(),[y]),I=h.useCallback((K,P,Z)=>{const ee=!se.current&&!Z;(g.value!==void 0&&g.value===P||ee)&&F(K)},[g.value]),he=r==="popper"?up:QN,X=he===up?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:f,collisionBoundary:m,collisionPadding:w,sticky:x,hideWhenDetached:p,avoidCollisions:b}:{};return s.jsx(KN,{scope:n,content:y,viewport:N,onViewportChange:k,itemRefCallback:oe,selectedItem:E,onItemLeave:M,itemTextRefCallback:I,focusSelectedItem:T,selectedItemText:A,position:r,isPositioned:ae,searchRef:G,children:s.jsx(wh,{as:ja,allowPinchZoom:!0,children:s.jsx(xh,{asChild:!0,trapped:g.open,onMountAutoFocus:K=>{K.preventDefault()},onUnmountAutoFocus:Le(a,K=>{var P;(P=g.trigger)==null||P.focus({preventScroll:!0}),K.preventDefault()}),children:s.jsx(zo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:K=>K.preventDefault(),onDismiss:()=>g.onOpenChange(!1),children:s.jsx(he,{role:"listbox",id:g.contentId,"data-state":g.open?"open":"closed",dir:g.dir,onContextMenu:K=>K.preventDefault(),...v,...X,onPlaced:()=>q(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:Le(v.onKeyDown,K=>{const P=K.ctrlKey||K.altKey||K.metaKey;if(K.key==="Tab"&&K.preventDefault(),!P&&K.key.length===1&&Y(K.key),["ArrowUp","ArrowDown","Home","End"].includes(K.key)){let ee=U().filter(le=>!le.disabled).map(le=>le.ref.current);if(["ArrowUp","End"].includes(K.key)&&(ee=ee.slice().reverse()),["ArrowUp","ArrowDown"].includes(K.key)){const le=K.target,z=ee.indexOf(le);ee=ee.slice(z+1)}setTimeout(()=>D(ee)),K.preventDefault()}})})})})})})});ZN.displayName=jI;var _I="SelectItemAlignedPosition",QN=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,i=Ia(pi,n),o=La(pi,n),[l,c]=h.useState(null),[d,u]=h.useState(null),f=wt(t,C=>u(C)),m=Rh(n),w=h.useRef(!1),x=h.useRef(!0),{viewport:p,selectedItem:b,selectedItemText:v,focusSelectedItem:g}=o,y=h.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&d&&p&&b&&v){const C=i.trigger.getBoundingClientRect(),E=d.getBoundingClientRect(),H=i.valueNode.getBoundingClientRect(),A=v.getBoundingClientRect();if(i.dir!=="rtl"){const le=A.left-E.left,z=H.left-le,_e=C.left-z,ue=C.width+_e,De=Math.max(ue,E.width),Ve=window.innerWidth-Nr,lt=lw(z,[Nr,Math.max(Nr,Ve-De)]);l.style.minWidth=ue+"px",l.style.left=lt+"px"}else{const le=E.right-A.right,z=window.innerWidth-H.right-le,_e=window.innerWidth-C.right-z,ue=C.width+_e,De=Math.max(ue,E.width),Ve=window.innerWidth-Nr,lt=lw(z,[Nr,Math.max(Nr,Ve-De)]);l.style.minWidth=ue+"px",l.style.right=lt+"px"}const F=m(),U=window.innerHeight-Nr*2,ae=p.scrollHeight,q=window.getComputedStyle(d),se=parseInt(q.borderTopWidth,10),D=parseInt(q.paddingTop,10),T=parseInt(q.borderBottomWidth,10),_=parseInt(q.paddingBottom,10),O=se+D+ae+_+T,G=Math.min(b.offsetHeight*5,O),Y=window.getComputedStyle(p),oe=parseInt(Y.paddingTop,10),M=parseInt(Y.paddingBottom,10),I=C.top+C.height/2-Nr,he=U-I,X=b.offsetHeight/2,K=b.offsetTop+X,P=se+D+K,Z=O-P;if(P<=I){const le=F.length>0&&b===F[F.length-1].ref.current;l.style.bottom="0px";const z=d.clientHeight-p.offsetTop-p.offsetHeight,_e=Math.max(he,X+(le?M:0)+z+T),ue=P+_e;l.style.height=ue+"px"}else{const le=F.length>0&&b===F[0].ref.current;l.style.top="0px";const _e=Math.max(I,se+p.offsetTop+(le?oe:0)+X)+Z;l.style.height=_e+"px",p.scrollTop=P-I+p.offsetTop}l.style.margin=`${Nr}px 0`,l.style.minHeight=G+"px",l.style.maxHeight=U+"px",r==null||r(),requestAnimationFrame(()=>w.current=!0)}},[m,i.trigger,i.valueNode,l,d,p,b,v,i.dir,r]);kn(()=>y(),[y]);const[j,N]=h.useState();kn(()=>{d&&N(window.getComputedStyle(d).zIndex)},[d]);const k=h.useCallback(C=>{C&&x.current===!0&&(y(),g==null||g(),x.current=!1)},[y,g]);return s.jsx(SI,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:k,children:s.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:s.jsx(Ye.div,{...a,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});QN.displayName=_I;var NI="SelectPopperPosition",up=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=Nr,...i}=e,o=Dh(n);return s.jsx(Lg,{...o,...i,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...i.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)"}})});up.displayName=NI;var[SI,lv]=Zo(pi,{}),hp="SelectViewport",JN=h.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,i=La(hp,n),o=lv(hp,n),l=wt(t,i.onViewportChange),c=h.useRef(0);return s.jsxs(s.Fragment,{children:[s.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}),s.jsx(Th.Slot,{scope:n,children:s.jsx(Ye.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Le(a.onScroll,d=>{const u=d.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:m}=o;if(m!=null&&m.current&&f){const w=Math.abs(c.current-u.scrollTop);if(w>0){const x=window.innerHeight-Nr*2,p=parseFloat(f.style.minHeight),b=parseFloat(f.style.height),v=Math.max(p,b);if(v<x){const g=v+w,y=Math.min(x,g),j=g-y;f.style.height=y+"px",f.style.bottom==="0px"&&(u.scrollTop=j>0?j:0,f.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});JN.displayName=hp;var XN="SelectGroup",[kI,CI]=Zo(XN),EI=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Cs();return s.jsx(kI,{scope:n,id:a,children:s.jsx(Ye.div,{role:"group","aria-labelledby":a,...r,ref:t})})});EI.displayName=XN;var e1="SelectLabel",t1=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=CI(e1,n);return s.jsx(Ye.div,{id:a.id,...r,ref:t})});t1.displayName=e1;var Pu="SelectItem",[PI,n1]=Zo(Pu),r1=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:i,...o}=e,l=Ia(Pu,n),c=La(Pu,n),d=l.value===r,[u,f]=h.useState(i??""),[m,w]=h.useState(!1),x=wt(t,g=>{var y;return(y=c.itemRefCallback)==null?void 0:y.call(c,g,r,a)}),p=Cs(),b=h.useRef("touch"),v=()=>{a||(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 s.jsx(PI,{scope:n,value:r,disabled:a,textId:p,isSelected:d,onItemTextChange:h.useCallback(g=>{f(y=>y||((g==null?void 0:g.textContent)??"").trim())},[]),children:s.jsx(Th.ItemSlot,{scope:n,value:r,disabled:a,textValue:u,children:s.jsx(Ye.div,{role:"option","aria-labelledby":p,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...o,ref:x,onFocus:Le(o.onFocus,()=>w(!0)),onBlur:Le(o.onBlur,()=>w(!1)),onClick:Le(o.onClick,()=>{b.current!=="mouse"&&v()}),onPointerUp:Le(o.onPointerUp,()=>{b.current==="mouse"&&v()}),onPointerDown:Le(o.onPointerDown,g=>{b.current=g.pointerType}),onPointerMove:Le(o.onPointerMove,g=>{var y;b.current=g.pointerType,a?(y=c.onItemLeave)==null||y.call(c):b.current==="mouse"&&g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Le(o.onPointerLeave,g=>{var y;g.currentTarget===document.activeElement&&((y=c.onItemLeave)==null||y.call(c))}),onKeyDown:Le(o.onKeyDown,g=>{var j;((j=c.searchRef)==null?void 0:j.current)!==""&&g.key===" "||(pI.includes(g.key)&&v(),g.key===" "&&g.preventDefault())})})})})});r1.displayName=Pu;var vl="SelectItemText",s1=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...i}=e,o=Ia(vl,n),l=La(vl,n),c=n1(vl,n),d=yI(vl,n),[u,f]=h.useState(null),m=wt(t,v=>f(v),c.onItemTextChange,v=>{var g;return(g=l.itemTextRefCallback)==null?void 0:g.call(l,v,c.value,c.disabled)}),w=u==null?void 0:u.textContent,x=h.useMemo(()=>s.jsx("option",{value:c.value,disabled:c.disabled,children:w},c.value),[c.disabled,c.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:b}=d;return kn(()=>(p(x),()=>b(x)),[p,b,x]),s.jsxs(s.Fragment,{children:[s.jsx(Ye.span,{id:c.textId,...i,ref:m}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?ji.createPortal(i.children,o.valueNode):null]})});s1.displayName=vl;var a1="SelectItemIndicator",i1=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return n1(a1,n).isSelected?s.jsx(Ye.span,{"aria-hidden":!0,...r,ref:t}):null});i1.displayName=a1;var fp="SelectScrollUpButton",o1=h.forwardRef((e,t)=>{const n=La(fp,e.__scopeSelect),r=lv(fp,e.__scopeSelect),[a,i]=h.useState(!1),o=wt(t,r.onScrollButtonChange);return kn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollTop>0;i(d)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),a?s.jsx(c1,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});o1.displayName=fp;var mp="SelectScrollDownButton",l1=h.forwardRef((e,t)=>{const n=La(mp,e.__scopeSelect),r=lv(mp,e.__scopeSelect),[a,i]=h.useState(!1),o=wt(t,r.onScrollButtonChange);return kn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;i(u)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),a?s.jsx(c1,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});l1.displayName=mp;var c1=h.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,i=La("SelectScrollButton",n),o=h.useRef(null),l=Rh(n),c=h.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return h.useEffect(()=>()=>c(),[c]),kn(()=>{var u;const d=l().find(f=>f.ref.current===document.activeElement);(u=d==null?void 0:d.ref.current)==null||u.scrollIntoView({block:"nearest"})},[l]),s.jsx(Ye.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Le(a.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Le(a.onPointerMove,()=>{var d;(d=i.onItemLeave)==null||d.call(i),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Le(a.onPointerLeave,()=>{c()})})}),TI="SelectSeparator",d1=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(Ye.div,{"aria-hidden":!0,...r,ref:t})});d1.displayName=TI;var pp="SelectArrow",RI=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Dh(n),i=Ia(pp,n),o=La(pp,n);return i.open&&o.position==="popper"?s.jsx($g,{...a,...r,ref:t}):null});RI.displayName=pp;function u1(e){return e===""||e===void 0}var h1=h.forwardRef((e,t)=>{const{value:n,...r}=e,a=h.useRef(null),i=wt(t,a),o=Ph(n);return h.useEffect(()=>{const l=a.current,c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==n&&u){const f=new Event("change",{bubbles:!0});u.call(l,n),l.dispatchEvent(f)}},[o,n]),s.jsx(Oc,{asChild:!0,children:s.jsx("select",{...r,ref:i,defaultValue:n})})});h1.displayName="BubbleSelect";function f1(e){const t=Gn(e),n=h.useRef(""),r=h.useRef(0),a=h.useCallback(o=>{const l=n.current+o;t(l),function c(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),i=h.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}function m1(e,t,n){const a=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=DI(e,Math.max(i,0));a.length===1&&(o=o.filter(d=>d!==n));const c=o.find(d=>d.textValue.toLowerCase().startsWith(a.toLowerCase()));return c!==n?c:void 0}function DI(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var OI=zN,p1=VN,AI=HN,MI=qN,II=YN,g1=GN,LI=JN,v1=t1,x1=r1,$I=s1,FI=i1,y1=o1,w1=l1,b1=d1;const Vt=OI,Wt=AI,Ot=h.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(p1,{ref:r,className:ke("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
434ing-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,s.jsx(MI,{asChild:!0,children:s.jsx(Cj,{className:"h-4 w-4 opacity-50"})})]}));Ot.displayName=p1.displayName;const j1=h.forwardRef(({className:e,...t},n)=>s.jsx(y1,{ref:n,className:ke("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(j2,{className:"h-4 w-4"})}));j1.displayName=y1.displayName;const _1=h.forwardRef(({className:e,...t},n)=>s.jsx(w1,{ref:n,className:ke("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Cj,{className:"h-4 w-4"})}));_1.displayName=w1.displayName;const At=h.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>s.jsx(II,{children:s.jsxs(g1,{ref:a,className:ke("relative z-50 max-h-96 min-w-[8rem] overflow-hidden 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:[s.jsx(j1,{}),s.jsx(LI,{className:ke("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(_1,{})]})}));At.displayName=g1.displayName;const UI=h.forwardRef(({className:e,...t},n)=>s.jsx(v1,{ref:n,className:ke("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));UI.displayName=v1.displayName;const gt=h.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(x1,{ref:r,className:ke("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(FI,{children:s.jsx(gr,{className:"h-4 w-4"})})}),s.jsx($I,{children:t})]}));gt.displayName=x1.displayName;const zI=h.forwardRef(({className:e,...t},n)=>s.jsx(b1,{ref:n,className:ke("-mx-1 my-1 h-px bg-muted",e),...t}));zI.displayName=b1.displayName;const Ft=h.forwardRef(({className:e,containerClassName:t,...n},r)=>s.jsx("div",{className:ke("relative w-full overflow-auto max-w-[50vw] mx-auto px-4 md:max-w-none",t),children:s.jsx("table",{ref:r,className:ke("w-full caption-bottom text-sm",e),...n})}));Ft.displayName="Table";const Ut=h.forwardRef(({className:e,...t},n)=>s.jsx("thead",{ref:n,className:ke("[&_tr]:border-b",e),...t}));Ut.displayName="TableHeader";const zt=h.forwardRef(({className:e,...t},n)=>s.jsx("tbody",{ref:n,className:ke("[&_tr:last-child]:border-0",e),...t}));zt.displayName="TableBody";const BI=h.forwardRef(({className:e,...t},n)=>s.jsx("tfoot",{ref:n,className:ke("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));BI.displayName="TableFooter";const Fe=h.forwardRef(({className:e,...t},n)=>s.jsx("tr",{ref:n,className:ke("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Fe.displayName="TableRow";const te=h.forwardRef(({className:e,...t},n)=>s.jsx("th",{ref:n,className:ke("h-12 px-0.5 sm:px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));te.displayName="TableHead";const J=h.forwardRef(({className:e,...t},n)=>s.jsx("td",{ref:n,className:ke("p-1 sm:p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));J.displayName="TableCell";const VI=h.forwardRef(({className:e,...t},n)=>s.jsx("caption",{ref:n,className:ke("mt-4 text-sm text-muted-foreground",e),...t}));VI.displayName="TableCaption";const WI=({profile:e})=>{const[t,n]=h.useState([]),[r,a]=h.useState(!1),[i,o]=h.useState(""),[l,c]=h.useState(""),[d,u]=h.useState(!1),{toast:f}=_t(),m=(e==null?void 0:e.membership_plan_id)===3,w=(e==null?void 0:e.membership_plan_id)===4,x=(e==null?void 0:e.membership_plan_id)===5,p=m||w||x;if(h.useEffect(()=>{p&&b()},[p]),!e||!p)return null;const b=async()=>{try{const{data:A,error:F}=await R.from("payout_requests").select("*").order("created_at",{ascending:!1});if(F)throw F;n(A||[])}catch(A){console.error("Error loading payout requests:",A)}},v=async()=>
434{if(!i||!l.trim()){f({title:"Error",description:"Please fill in all fields",variant:"destructive"});return}u(!0);try{const{error:A}=await R.rpc("request_payout",{p_payment_method:i,p_payment_handle:l.trim()});if(A)throw A;f({title:"Payout Requested",description:"Your payout request has been submitted for review"}),a(!1),o(""),c(""),await b()}catch(A){f({title:"Error",description:A.message,variant:"destructive"})}finally{u(!1)}},g=A=>{const F={pending:{variant:"secondary",label:"Pending"},approved:{variant:"default",label:"Approved"},paid:{variant:"default",label:"Paid"},rejected:{variant:"destructive",label:"Rejected"}},U=F[A]||F.pending;return s.jsx(Ie,{variant:U.variant,children:U.label})},y=A=>A==="cashapp"?"Cash App":"PayPal",j=A=>{if(!A)return"***";if(A.includes("@")){const[F,U]=A.split("@");return`${F.length>2?F.substring(0,2)+"***":"***"}@${U}`}return A.startsWith("$")?A.length>3?A.substring(0,3)+"***":"***":A.length>4?A.substring(0,2)+"***"+A.substring(A.length-2):"***"},N=()=>m?"VIP Referral Earnings":w?"Ambassador Commission Earnings":"Executive Commission Earnings",k=()=>m?"Earn 25% referral bonus when your referrals upgrade to VIP":w?"Earn 35% commission from membership referrals":"Earn 50% commission from Standard and VIP membership referrals",C=e.referral_count||0,E=Math.max(0,10-C),H=Math.min(C,10);return s.jsxs("div",{className:"space-y-6",children:[s.jsxs(pe,{children:[s.jsxs(Ae,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(xu,{className:"w-5 h-5 text-primary"}),s.jsx(Me,{children:N()})]}),s.jsx(St,{children:k()})]}),s.jsxs(ve,{children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(kg,{className:"w-4 h-4 text-green-600"}),s.jsx("span",{className:"text-sm font-medium",children:"Available Balance"})]}),s.jsxs("div",{className:"text-2xl font-bold text-green-600",children:["$",(e.earnings||0).toFixed(2)]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(xu,{className:"w-4 h-4 text-blue-600"}),s.jsx("span",{className:"text-sm font-medium",children:"Referrals"})]}),s.jsx("div",{className:"text-2xl font-bold text-blue-600",children:C})]})]}),s.jsxs("div",{className:"mt-6 p-4 bg-gradient-to-r from-amber-50 to-yellow-50 dark:from-amber-950/20 dark:to-yellow-950/20 rounded-lg border border-amber-200 dark:border-amber-800",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx(w2,{className:"w-5 h-5 text-amber-600"}),s.jsx("span",{className:"font-semibold text-amber-800 dark:text-amber-300",children:"High Achiever Bonus"})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-amber-700 dark:text-amber-400",children:"Progress to $250 Bonus"}),s.jsxs("span",{className:"font-medium text-amber-800 dark:text-amber-300",children:[H,"/10 upgrades"]})]}),s.jsx("div",{className:"w-full bg-amber-200 dark:bg-amber-900 rounded-full h-3",children:s.jsx("div",{className:"bg-gradient-to-r from-amber-500 to-yellow-500 h-3 rounded-full transition-all duration-500",style:{width:`${H/10*100}%`}})}),E>0?s.jsxs("p",{className:"text-sm text-amber-700 dark:text-amber-400",children:[s.jsxs("span",{className:"font-semibold",children:[E," more"]})," VIP upgrades needed this month to unlock your $250 bonus!"]}):s.jsx("p",{className:"text-sm font-semibold text-green-600 dark:text-green-400",children:"ð Congratulations! You've qualified for the $250 High Achiever Bonus!"})]})]}),s.jsx("div",{className:"mt-6",children:s.jsxs(ht,{open:r,onOpenChange:a,children:[s.jsx(Nn,{asChild:!0,children:s.jsx(L,{className:"w-full",disabled:(e.earnings||0)<=0,children:"Request Payout"})}),s.jsxs(dt,{children:[s.jsxs(ft,{children:[s.jsx(mt,{children:"Request Payout"}),s.jsxs(oo,{children:["Request a payout of your available commission earnings. Amount: $",(e.earnings||0).toFixed(2)]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(B,{htmlFor:"payment-method",children:"Payment Method"}),s.jsxs(Vt,{value:i,onValueChange:o,children:[s.jsx(Ot,{children:s.jsx(Wt,{placeholder:"Select payment method"})}),s.jsxs(At,{children:[s.jsx(gt,{value:"cashapp",children:"Cash App"}),s.jsx(gt,{value:"paypal",children:"PayPal"})]})]})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"payment-handle",children:i==="cashapp"?"Cash App Handle (e.g., $username)":"PayPal Email"}
434),s.jsx(Q,{id:"payment-handle",value:l,onChange:A=>c(A.target.value),placeholder:i==="cashapp"?"$username":"[email protected]"})]}),s.jsx(L,{onClick:v,disabled:d,className:"w-full",children:d?"Submitting...":"Submit Payout Request"})]})]})]})})]})]}),t.length>0&&s.jsxs(pe,{children:[s.jsxs(Ae,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ah,{className:"w-5 h-5 text-primary"}),s.jsx(Me,{children:"Payout History"})]}),s.jsx(St,{children:"Track your payout requests and their status"})]}),s.jsx(ve,{children:s.jsxs(Ft,{children:[s.jsx(Ut,{children:s.jsxs(Fe,{children:[s.jsx(te,{children:"Amount"}),s.jsx(te,{children:"Method"}),s.jsx(te,{children:"Handle/Email"}),s.jsx(te,{children:"Status"}),s.jsx(te,{children:"Requested"})]})}),s.jsx(zt,{children:t.map(A=>s.jsxs(Fe,{children:[s.jsxs(J,{className:"font-medium",children:["$",A.amount.toFixed(2)]}),s.jsx(J,{children:y(A.payment_method)}),s.jsx(J,{className:"max-w-[150px] truncate",children:j(A.payment_handle)}),s.jsx(J,{children:g(A.status)}),s.jsx(J,{children:new Date(A.created_at).toLocaleDateString()})]},A.id))})]})})]}),s.jsxs(pe,{children:[s.jsx(Ae,{children:s.jsx(Me,{className:"text-lg",children:m?"How VIP Referral Bonuses Work":w?"How Ambassador Commissions Work":"How Executive Commissions Work"})}),s.jsx(ve,{className:"space-y-3",children:s.jsx("div",{className:"text-sm text-muted-foreground text-justify",children:m?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:"⢠Earn 25% bonus when someone you referred upgrades to VIP ($99) = $25"}),s.jsx("p",{children:"⢠Bonuses are automatically added to your earnings when referrals upgrade"}),s.jsx("p",{children:"⢠Request payouts via PayPal once you have $100+ in earnings"}),s.jsx("p",{children:"⢠Payouts are processed by admin approval"}),s.jsxs("p",{className:"mt-2 pt-2 border-t border-amber-200 dark:border-amber-800 text-amber-700 dark:text-amber-400",children:[s.jsx("strong",{children:"ð High Achiever Bonus:"})," Earn an additional $250 bonus when at least 10 members sign up AND upgrade to VIP within the same calendar month!"]})]}):w?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:"⢠Earn 35% commission on Standard Membership ($24.99) referrals = $8.75"}),s.jsx("p",{children:"⢠Earn 35% commission on VIP Membership ($49.99) referrals = $17.50"}),s.jsx("p",{children:"⢠Commissions are automatically calculated when referred users upgrade"}),s.jsx("p",{children:"⢠Request payouts via PayPal once you have $10+ in earnings"}),s.jsx("p",{children:"⢠Payouts are processed by admin approval"}),s.jsxs("p",{className:"mt-2 pt-2 border-t border-amber-200 dark:border-amber-800 text-amber-700 dark:text-amber-400",children:[s.jsx("strong",{children:"ð High Achiever Bonus:"})," Earn an additional $250 bonus when at least 10 members sign up AND upgrade to VIP within the same calendar month!"]})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{children:"⢠Earn 50% commission on Standard Membership ($24.99) referrals = $12.50"}),s.jsx("p",{children:"⢠Earn 50% commission on VIP Membership ($49.99) referrals = $25.00"}),s.jsx("p",{children:"⢠Commissions are automatically calculated when referred users upgrade"}),s.jsx("p",{children:"⢠Request payouts via PayPal once you have $10+ in earnings"}),s.jsx("p",{children:"⢠Payouts are processed by admin approval"}),s.jsxs("p",{className:"mt-2 pt-2 border-t border-amber-200 dark:border-amber-800 text-amber-700 dark:text-amber-400",children:[s.jsx("strong",{children:"ð High Achiever Bonus:"})," Earn an additional $250 bonus when at least 10 members sign up AND upgrade to VIP within the same calendar month!"]})]})})})]})]})},zc="id, user_id, business_name, description, image_url, city_id, category_id, status, check_in_enabled, created_at, updated_at, approved_at, approved_by, address, phone_number, hours_of_operation, website, facebook_url, instagram_url, twitter_url, linkedin_url, tiktok_url, youtube_url, category_id_secondary, google_maps_url, deal_type, deal_value, deal_code, deal_version, checkin_count, accepts_street_cash",HI="id, created_at, name, date, points, is_active, address, latitude, longitude, check_in_radius",Tu="id, title, description, event_date, event_time, venue, address, image_url, tickets_url, city_id, status, created_by, approved_by, approved_at, created_at, updated_at, event_end_time, check_in_enabled, price, google_maps_url, is_recurring, recurrence_type, recurrence_days_of_week, recurrence_day_of_month, recurrence_pattern, soundcloud_url, youtube_url, mixcloud_url, comp_tickets_total, comp_tickets_claimed, latitude, longitude, check_in_radius",qI="id, name, description, points_cost, category_id, active, membership_levels, created_at, updated_at, file_url, external_url",YI=()=>{const[e,t]=h.useState([]),[n,r]=h.useState(!0),[a,i]=h.useState(null),[o,l]=h.useState(null),[c,d]=h.useState(null);h.useEffect(()=>{f(),!(/iPad|iPhone|iPod/.test(navigator.userAgent)||navigator.userAgent.includes("Mac")&&"ontouchend"in document)&&navigator.permissions&&navigator.permissions.query?navigator.permissions.query({name:"geolocation"}).then(N=>{N.state==="granted"||N.state==="prompt"?u():d("Location access denied. Please enable location services in your browser settings.")}).catch(()=>{u()}):u()},[]);const u=async()=>
434{if(d(null),!navigator.geolocation){d("Geolocation is not supported by this browser");return}const j=k=>new Promise((C,E)=>{navigator.geolocation.getCurrentPosition(C,E,k)}),N=(k,C=12e3)=>new Promise((E,H)=>{let A=!1;const F=navigator.geolocation.watchPosition(U=>{A||(A=!0,navigator.geolocation.clearWatch(F),E(U))},U=>{A||(A=!0,navigator.geolocation.clearWatch(F),H(U))},k);setTimeout(()=>{A||(A=!0,navigator.geolocation.clearWatch(F),H({code:3,message:"watchPosition timeout"}))},C)});try{const k=await N({enableHighAccuracy:!1,maximumAge:6e5,timeout:15e3},12e3);if(k.coords.latitude==null||k.coords.longitude==null)throw new Error("watchPosition returned invalid coordinates");l({latitude:k.coords.latitude,longitude:k.coords.longitude}),d(null),k.coords.accuracy&&k.coords.accuracy>100&&Zr({title:"Location Accuracy Warning",description:`Location accuracy is ${Math.round(k.coords.accuracy)}m. For best results, move to an open area.`})}catch{}try{const k=await j({enableHighAccuracy:!0,timeout:2e4,maximumAge:3e5});if(k.coords.latitude===void 0||k.coords.longitude===void 0||k.coords.latitude===null||k.coords.longitude===null)throw new Error("Coordinates are undefined or null");l({latitude:k.coords.latitude,longitude:k.coords.longitude}),d(null),k.coords.accuracy&&k.coords.accuracy>100&&Zr({title:"Location Accuracy Warning",description:`Location accuracy is ${Math.round(k.coords.accuracy)}m. For best results, move to an open area.`})}catch{try{const C=await j({enableHighAccuracy:!1,timeout:6e4,maximumAge:6e5});if(C.coords.latitude===void 0||C.coords.longitude===void 0||C.coords.latitude===null||C.coords.longitude===null)throw new Error("Fallback coordinates are undefined or null");l({latitude:C.coords.latitude,longitude:C.coords.longitude}),d(null);const E=C.coords.accuracy?` (accuracy: ${Math.round(C.coords.accuracy)}m)`:"";Zr({title:"Location Found",description:"Using network-based location (less precise but functional)"})}catch(C){let E="Unable to get your location. ";switch(C.code){case C.PERMISSION_DENIED:E+="Please allow location access when prompted and ensure location services are enabled on your device.";break;case C.POSITION_UNAVAILABLE:E+="Location information is unavailable. Try moving to an area with better signal.";break;case C.TIMEOUT:E+="Location request timed out. Try moving outdoors or near a window for better GPS signal, then tap Retry Location.";break;default:E+="Please enable location services and ensure you have internet connectivity.";break}try{window.top!==window.self&&(E+=" If you are using the in-app preview, open the app in a new tab or window to allow GPS permissions.")}catch{}d(E)}}},f=async()=>{try{const j=new Date;j.setHours(0,0,0,0);const N=j.toISOString().split("T")[0],[k,C]=await Promise.all([R.from("events").select(HI).eq("is_active",!0).order("date",{ascending:!0}),R.from("public_events").select("id, title, event_date, address, venue, latitude, longitude, check_in_radius, is_recurring").eq("status","approved").eq("check_in_enabled",!0).or(`event_date.gte.${N},is_recurring.eq.true`).order("event_date",{ascending:!0})]);if(k.error)throw k.error;if(C.error)throw C.error;const E=(k.data||[]).map(U=>({...U,source:"event"}));let H=C.data||[];const A=H.filter(U=>(U.latitude==null||U.longitude==null)&&(U.address||U.venue));if(A.length>0)try{const{data:U}=await R.functions.invoke("resolve-event-location",{body:{eventIds:A.map(q=>q.id)}}),ae=(U==null?void 0:U.results)||{};H=H.map(q=>{const se=ae[q.id];return se?{...q,latitude:se.latitude,longitude:se.longitude}:q})}catch{}const F=H.filter(U=>U.latitude!=null&&U.longitude!=null).map(U=>({id:U.id,name:U.title,date:U.event_date,points:10,address:U.address||U.venue||null,latitude:Number(U.latitude),longitude:Number(U.longitude),check_in_radius:U.check_in_radius??100,is_active:!0,source:"public"}));t([...E,...F])}catch(j){Zr({title:"Error",description:j.message,variant:"destructive"})}finally{r(!1)}},m=async j=>{if(!o){Zr({title:"Location Required",description:"Please enable location services to check in",variant:"destructive"});return}if(!j.latitude||!j.longitude){Zr({title:"Location Not Configured",description:"This event doesn't have GPS check-in enabled",variant:"destructive"});return}i(j.id);try{const{data:N,error:k}=await R.rpc(j.source==="public"?"process_public_event_checkin":"process_checkin",{p_event_id:j.id,p_user_latitude:o.latitude,p_user_longitude:o.longitude});if(k)throw k;const C=N;C.success?(Zr({title:"Check-in Successful!",description:C.message}),await f()):Zr({title:"Check-in Failed",description:C.message,variant:"destructive"})}catch(N){Zr({title:"Error",description:N.message,variant:"destructive"})}finally{i(null)}},w=(j,N,k,C)=>{const H=(k-j)*Math.PI/180,A=(C-N)*Math.PI/180,F=Math.sin(H/2)*Math.sin(H/2)+Math.cos(j*Math.PI/180)*Math.cos(k*Math.PI/180)*Math.sin(A/2)*Math.sin(A/2),U=2*Math.atan2(Math.sqrt(F),Math.sqrt(1-F));return Math.round(6371e3*U)};if(n)return s.jsx("div",{className:"flex justify-center items-center p-8",children:s.jsx(Rr,{className:"h-8 w-8 animate-spin"})});const x=e.filter(j=>j.latitude!==null&&j.longitude!==null),p=j=>typeof j=="number"?j:Number(j),b=1e3,v=o?x.filter(j=>{const N=p(j.latitude),k=p(j.longitude);return w(o.latitude,o.longitude,N,k)<=(j.check_in_radius??50)}):[],g=o?x.map(j=>{const N=p(j.latitude),k=p(j.longitude),C=w(o.latitude,o.longitude,N,k);return{event:j,distance:C}}).filter(({distance:j})=>j<=b).sort((j,N)=>j.distance-N.distance).map(({event:j})=>j):[],y=(()=>{try{return window.self!==window.top}catch{return!0}})();return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Event Check-ins"}),s.jsx("p",{className:"text-muted-foreground mb-4",children:"Check in to events near you to earn points"}),y&&s.jsx(pe,{className:"mb-4 border-primary",children:s.jsxs(ve,{className:"pt-6",children:[s.jsx("p",{className:"text-sm mb-3",children:"GPS check-in requires opening this page in a separate browser window."}),s.jsxs(L,{onClick:()=>window.open(window.location.href,"_blank"),className:"w-full",children:[s.jsx(dn,{className:"h-4 w-4 mr-2"}),"Open GPS Check-in in New Tab"]})]})}),c&&s.jsxs("div",{className:"bg-destructive/10 text-destructive p-3 rounded-md mb-4",children:[s.jsx("p",{className:"text-sm",children:c}),s.jsx(L,{variant:"outline",size:"sm",onClick:u,className:"mt-2",children:"Retry Location"})]}),o&&!c&&s.jsx("div",{className:"bg-green-50 dark:bg-green-900/20 text-green-700 dark:text-green-400 p-3 rounded-md mb-4",children:s.jsxs("p",{className:"text-sm flex items-center justify-center gap-2",children:[s.jsx(dn,{className:"h-4 w-4"}),"Location enabled - ready to check in!"]})})]}),o&&v.length>0&&s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Available Check-ins"}),s.jsx("div",{className:"grid gap-4",children:v.map(j=>{const N=w(o.latitude,o.longitude,Number(j.latitude),Number(j.longitude));return s.jsxs(pe,{className:"ring-2 ring-primary transition-all",children:[s.jsx(Ae,{children:s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsxs("div",{children:[s.jsx(Me,{className:"text-lg",children:j.name}),s.jsxs(St,{children:[new Date(j.date).toLocaleDateString()," ⢠",j.points," points"]})]}),s.jsxs(Ie,{variant:"default",children:[N,"m away"]})]})}),s.jsxs(ve,{children:[j.address&&s.jsxs("p",{className:"text-sm text-muted-foreground mb-3 flex items-center gap-2",children:[s.jsx(dn,{className:"h-4 w-4"}),j.address]}),s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsxs("div",{className:"text-sm text-muted-foreground",children:["Required distance: ",j.check_in_radius??50,"m"]}),s.jsx(L,{onClick:()=>m(j),disabled:a===j.id,size:"sm",children:a===j.id?s.jsxs(s.Fragment,{children:[s.jsx(Rr,{className:"h-4 w-4 mr-2 animate-spin"}),"Checking in..."]}):s.jsxs(s.Fragment,{children:[s.jsx(ci,{className:"h-4 w-4 mr-2"}),"Check In"]})})]})]})]},j.id)})})]}),o&&v.length===0&&x.length>0&&s.jsxs("div",{className:"space-y-4",children:[s.jsx(pe,{children:s.jsxs(ve,{className:"text-center py-8",children:[s.jsx(dn,{className:"h-12 w-12 mx-auto mb-4 text-muted-foreground"}),s.jsx("p",{className:"text-muted-foreground",children:"You are not near any available check-in events. Make sure you are inside the event before checking in."})]})}),g.length>0&&s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Nearby events (move closer to check in)"}),s.jsx("div",{className:"grid gap-4",children:g.map(j=>{const N=w(o.latitude,o.longitude,Number(j.latitude),Number(j.longitude)),k=j.check_in_radius??50,C=N<=k;return s.jsxs(pe,{children:[s.jsx(Ae,{children:s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsxs("div",{children:[s.jsx(Me,{className:"text-lg",children:j.name}),s.jsxs(St,{children:[new Date(j.date).toLocaleDateString()," ⢠",j.points," points"]})]}),s.jsxs(Ie,{variant:"secondary",children:[N,"m away"]})]})}),s.jsx(ve,{children:s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsxs("div",{className:"text-sm text-muted-foreground",children:["Required distance: ",k,"m"]}),s.jsx(L,{onClick:()=>m(j),disabled:!C||a===j.id,size:"sm",variant:C?"default":"outline",children:a===j.id?s.jsxs(s.Fragment,{children:[s.jsx(Rr,{className:"h-4 w-4 mr-2 animate-spin"}),"Checking in..."]}):s.jsxs(s.Fragment,{children:[s.jsx(ci,{className:"h-4 w-4 mr-2"}),C?"Check In":"Move closer"]})})]})})]},j.id)})})]})]}),e.length===0&&s.jsx(pe,{children:s.jsx(ve,{className:"text-center py-8",children:s.jsx("p",{className:"text-muted-foreground",children:"No active events available for check-in"})})})]})},Ir=h.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{className:ke("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
434ing-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}));Ir.displayName="Textarea";var cv="Checkbox",[GI,W6]=Hr(cv),[KI,ZI]=GI(cv),N1=h.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:i,required:o,disabled:l,value:c="on",onCheckedChange:d,form:u,...f}=e,[m,w]=h.useState(null),x=wt(t,j=>w(j)),p=h.useRef(!1),b=m?u||!!m.closest("form"):!0,[v=!1,g]=cs({prop:a,defaultProp:i,onChange:d}),y=h.useRef(v);return h.useEffect(()=>{const j=m==null?void 0:m.form;if(j){const N=()=>g(y.current);return j.addEventListener("reset",N),()=>j.removeEventListener("reset",N)}},[m,g]),s.jsxs(KI,{scope:n,state:v,disabled:l,children:[s.jsx(Ye.button,{type:"button",role:"checkbox","aria-checked":ya(v)?"mixed":v,"aria-required":o,"data-state":C1(v),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:x,onKeyDown:Le(e.onKeyDown,j=>{j.key==="Enter"&&j.preventDefault()}),onClick:Le(e.onClick,j=>{g(N=>ya(N)?!0:!N),b&&(p.current=j.isPropagationStopped(),p.current||j.stopPropagation())})}),b&&s.jsx(QI,{control:m,bubbles:!p.current,name:r,value:c,checked:v,required:o,disabled:l,form:u,style:{transform:"translateX(-100%)"},defaultChecked:ya(i)?!1:i})]})});N1.displayName=cv;var S1="CheckboxIndicator",k1=h.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,i=ZI(S1,n);return s.jsx(qr,{present:r||ya(i.state)||i.state===!0,children:s.jsx(Ye.span,{"data-state":C1(i.state),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});k1.displayName=S1;var QI=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:a,...i}=e,o=h.useRef(null),l=Ph(n),c=dh(t);h.useEffect(()=>{const u=o.current,f=window.HTMLInputElement.prototype,w=Object.getOwnPropertyDescriptor(f,"checked").set;if(l!==n&&w){const x=new Event("click",{bubbles:r});u.indeterminate=ya(n),w.call(u,ya(n)?!1:n),u.dispatchEvent(x)}},[l,n,r]);const d=h.useRef(ya(n)?!1:n);return s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a??d.current,...i,tabIndex:-1,ref:o,style:{...e.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function ya(e){return e==="indeterminate"}function C1(e){return ya(e)?"indeterminate":e?"checked":"unchecked"}var E1=N1,JI=k1;const Do=h.forwardRef(({className:e,...t},n)=>s.jsx(E1,{ref:n,className:ke("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:s.jsx(JI,{className:ke("flex items-center justify-center text-current"),children:s.jsx(gr,{className:"h-4 w-4"})})}));Do.displayName=E1.displayName;function XI(e,t=[]){let n=[];function r(i,o){const l=h.createContext(o),c=n.length;n=[...n,o];function d(f){const{scope:m,children:w,...x}=f,p=(m==null?void 0:m[e][c])||l,b=h.useMemo(()=>x,Object.values(x));return s.jsx(p.Provider,{value:b,children:w})}
vendor: 4,757 bytes, line 434
434function u(f,m){const w=(m==null?void 0:m[e][c])||l,x=h.useContext(w);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return d.displayName=i+"Provider",[d,u]}const a=()=>{const i=n.map(o=>h.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[r,eL(a,...t)]}function eL(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=r.reduce((l,{useScope:c,scopeName:d})=>{const f=c(i)[`__scope${d}`];return{...l,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var Mf="rovingFocusGroup.onEntryFocus",tL={bubbles:!1,cancelable:!0},Oh="RovingFocusGroup",[gp,P1,nL]=jg(Oh),[rL,Ah]=XI(Oh,[nL]),[sL,aL]=rL(Oh),T1=h.forwardRef((e,t)=>s.jsx(gp.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(gp.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(iL,{...e,ref:t})})}));T1.displayName=Oh;var iL=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...f}=e,m=h.useRef(null),w=wt(t,m),x=Eh(i),[p=null,b]=cs({prop:o,defaultProp:l,onChange:c}),[v,g]=h.useState(!1),y=Gn(d),j=P1(n),N=h.useRef(!1),[k,C]=h.useState(0);return h.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(Mf,y),()=>E.removeEventListener(Mf,y)},[y]),s.jsx(sL,{scope:n,orientation:r,dir:x,loop:a,currentTabStopId:p,onItemFocus:h.useCallback(E=>b(E),[b]),onItemShiftTab:h.useCallback(()=>g(!0),[]),onFocusableItemAdd:h.useCallback(()=>C(E=>E+1),[]),onFocusableItemRemove:h.useCallback(()=>C(E=>E-1),[]),children:s.jsx(Ye.div,{tabIndex:v||k===0?-1:0,"data-orientation":r,...f,ref:w,style:{outline:"none",...e.style},onMouseDown:Le(e.onMouseDown,()=>{N.current=!0}),onFocus:Le(e.onFocus,E=>{const H=!N.current;if(E.target===E.currentTarget&&H&&!v){const A=new CustomEvent(Mf,tL);if(E.currentTarget.dispatchEvent(A),!A.defaultPrevented){const F=j().filter(D=>D.focusable),U=F.find(D=>D.active),ae=F.find(D=>D.id===p),se=[U,ae,...F].filter(Boolean).map(D=>D.ref.current);O1(se,u)}}N.current=!1}),onBlur:Le(e.onBlur,()=>g(!1))})})}),R1="RovingFocusGroupItem",D1=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,...o}=e,l=Cs(),c=i||l,d=aL(R1,n),u=d.currentTabStopId===c,f=P1(n),{onFocusableItemAdd:m,onFocusableItemRemove:w}=d;return h.useEffect(()=>{if(r)return m(),()=>w()},[r,m,w]),s.jsx(gp.ItemSlot,{scope:n,id:c,focusable:r,active:a,children:s.jsx(Ye.span,{tabIndex:u?0:-1,"data-orientation":d.orientation,...o,ref:t,onMouseDown:Le(e.onMouseDown,x=>{r?d.onItemFocus(c):x.preventDefault()}),onFocus:Le(e.onFocus,()=>d.onItemFocus(c)),onKeyDown:Le(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){d.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const p=cL(x,d.orientation,d.dir);if(p!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let v=f().filter(g=>g.focusable).map(g=>g.ref.current);if(p==="last")v.reverse();else if(p==="prev"||p==="next"){p==="prev"&&v.reverse();const g=v.indexOf(x.currentTarget);v=d.loop?dL(v,g+1):v.slice(g+1)}setTimeout(()=>O1(v))}})})})});D1.displayName=R1;var oL={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lL(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function cL(e,t,n){const r=lL(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return oL[r]}function O1(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function dL(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var A1=T1,M1=D1,dv="Radio",[uL,I1]=Hr(dv),[hL,fL]=uL(dv),L1=h.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:a=!1,required:i,disabled:o,value:l="on",onCheck:c,form:d,...u}=e,[f,m]=h.useState(null),w=wt(t,b=>m(b)),x=h.useRef(!1),p=f?d||!!f.closest("form"):!0;return s.jsxs(hL,{scope:n,checked:a,disabled:o,children:[s.jsx(Ye.button,{type:"button",role:"radio","aria-checked":a,"data-state":U1(a),"data-disabled":o?"":void 0,disabled:o,value:l,...u,ref:w,onClick:Le(e.onClick,b=>{a||c==null||c(),p&&(x.current=b.isPropagationStopped(),x.current||b.stopPropagation())})}),p&&s.jsx(mL,{control:f,bubbles:!x.current,name:r,value:l,checked:a,required:i,disabled:o,form:d,style:{transform:"translateX(-100%)"}})]})});L1.displayName=dv;var $1="RadioIndicator",F1=h.forwardRef((e,t)=>
vendor: 1,949 bytes, line 434
434{const{__scopeRadio:n,forceMount:r,...a}=e,i=fL($1,n);return s.jsx(qr,{present:r||i.checked,children:s.jsx(Ye.span,{"data-state":U1(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t})})});F1.displayName=$1;var mL=e=>{const{control:t,checked:n,bubbles:r=!0,...a}=e,i=h.useRef(null),o=Ph(n),l=dh(t);return h.useEffect(()=>{const c=i.current,d=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(d,"checked").set;if(o!==n&&f){const m=new Event("click",{bubbles:r});f.call(c,n),c.dispatchEvent(m)}},[o,n,r]),s.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:i,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function U1(e){return e?"checked":"unchecked"}var pL=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],uv="RadioGroup",[gL,H6]=Hr(uv,[Ah,I1]),z1=Ah(),B1=I1(),[vL,xL]=gL(uv),V1=h.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:a,value:i,required:o=!1,disabled:l=!1,orientation:c,dir:d,loop:u=!0,onValueChange:f,...m}=e,w=z1(n),x=Eh(d),[p,b]=cs({prop:i,defaultProp:a,onChange:f});return s.jsx(vL,{scope:n,name:r,required:o,disabled:l,value:p,onValueChange:b,children:s.jsx(A1,{asChild:!0,...w,orientation:c,dir:x,loop:u,children:s.jsx(Ye.div,{role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":l?"":void 0,dir:x,...m,ref:t})})})});V1.displayName=uv;var W1="RadioGroupItem",H1=h.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...a}=e,i=xL(W1,n),o=i.disabled||r,l=z1(n),c=B1(n),d=h.useRef(null),u=wt(t,d),f=i.value===a.value,m=h.useRef(!1);return h.useEffect(()=>{const w=p=>{pL.includes(p.key)&&(m.current=!0)},x=()=>m.current=!1;return document.addEventListener("keydown",w),document.addEventListener("keyup",x),()=>{document.removeEventListener("keydown",w),document.removeEventListener("keyup",x)}},[]),s.jsx(M1,{asChild:!0,...l,focusable:!o,active:f,children:s.jsx(L1,{disabled:o,required:i.required,
434checked:f,...c,...a,name:i.name,ref:u,onCheck:()=>i.onValueChange(a.value),onKeyDown:Le(w=>{w.key==="Enter"&&w.preventDefault()}),onFocus:Le(a.onFocus,()=>{var w;m.current&&((w=d.current)==null||w.click())})})})});H1.displayName=W1;var yL="RadioGroupIndicator",q1=h.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,a=B1(n);return s.jsx(F1,{...a,...r,ref:t})});q1.displayName=yL;var Y1=V1,G1=H1,wL=q1;const vp=h.forwardRef(({className:e,...t},n)=>s.jsx(Y1,{className:ke("grid gap-2",e),...t,ref:n}));vp.displayName=Y1.displayName;const Ha=h.forwardRef(({className:e,...t},n)=>s.jsx(G1,{ref:n,className:ke("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus: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:s.jsx(wL,{className:"flex items-center justify-center",children:s.jsx(N2,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Ha.displayName=G1.displayName;const bL=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:2,label:"Tuesday"},{value:3,label:"Wednesday"},{value:4,label:"Thursday"},{value:5,label:"Friday"},{value:6,label:"Saturday"}],cw=[{value:"first_sunday",label:"First Sunday"},{value:"first_monday",label:"First Monday"},{value:"first_tuesday",label:"First Tuesday"},{value:"first_wednesday",label:"First Wednesday"},{value:"first_thursday",label:"First Thursday"},{value:"first_friday",label:"First Friday"},{value:"first_saturday",label:"First Saturday"},{value:"second_sunday",label:"Second Sunday"},{value:"second_monday",label:"Second Monday"},{value:"second_tuesday",label:"Second Tuesday"},{value:"second_wednesday",label:"Second Wednesday"},{value:"second_thursday",label:"Second Thursday"},{value:"second_friday",label:"Second Friday"},{value:"second_saturday",label:"Second Saturday"},{value:"third_sunday",label:"Third Sunday"},{value:"third_monday",label:"Third Monday"},{value:"third_tuesday",label:"Third Tuesday"},{value:"third_wednesday",label:"Third Wednesday"},{value:"third_thursday",label:"Third Thursday"},{value:"third_friday",label:"Third Friday"},{value:"third_saturday",label:"Third Saturday"},{value:"fourth_sunday",label:"Fourth Sunday"},{value:"fourth_monday",label:"Fourth Monday"},{value:"fourth_tuesday",label:"Fourth Tuesday"},{value:"fourth_wednesday",label:"Fourth Wednesday"},{value:"fourth_thursday",label:"Fourth Thursday"},{value:"fourth_friday",label:"Fourth Friday"},{value:"fourth_saturday",label:"Fourth Saturday"},{value:"last_sunday",label:"Last Sunday"},{value:"last_monday",label:"Last Monday"},{value:"last_tuesday",label:"Last Tuesday"},{value:"last_wednesday",label:"Last Wednesday"},{value:"last_thursday",label:"Last Thursday"},{value:"last_friday",label:"Last Friday"},{value:"last_saturday",label:"Last Saturday"}],jL=[{value:"first_third_sunday",label:"1st & 3rd Sunday"},{value:"first_third_monday",label:"1st & 3rd Monday"},{value:"first_third_tuesday",label:"1st & 3rd Tuesday"},{value:"first_third_wednesday",label:"1st & 3rd Wednesday"},{value:"first_third_thursday",label:"1st & 3rd Thursday"},{value:"first_third_friday",label:"1st & 3rd Friday"},{value:"first_third_saturday",label:"1st & 3rd Saturday"},{value:"second_fourth_sunday",label:"2nd & 4th Sunday"},{value:"second_fourth_monday",label:"2nd & 4th Monday"},{value:"second_fourth_tuesday",label:"2nd & 4th Tuesday"},{value:"second_fourth_wednesday",label:"2nd & 4th Wednesday"},{value:"second_fourth_thursday",label:"2nd & 4th Thursday"},{value:"second_fourth_friday",label:"2nd & 4th Friday"},{value:"second_fourth_saturday",label:"2nd & 4th Saturday"}],K1=({data:e,onChange:t,onDateDisabledChange:n})=>{var d;const r=u=>{const f={...e,is_recurring:u,recurrence_type:u?"weekly":"",recurrence_days_of_week:[],recurrence_day_of_month:null,recurrence_pattern:"",monthly_type:"day_of_month"};t(f),n==null||n(u)},a=u=>{t({...e,recurrence_type:u,recurrence_days_of_week:[],recurrence_day_of_month:null,recurrence_pattern:"",monthly_type:"day_of_month"})},i=u=>{const f=e.recurrence_days_of_week.includes(u)?e.recurrence_days_of_week.filter(m=>m!==u):[...e.recurrence_days_of_week,u].sort((m,w)=>m-w);t({...e,recurrence_days_of_week:f})},o=u=>{const f=parseInt(u,10);t({...e,recurrence_day_of_month:isNaN(f)?null:f,recurrence_pattern:""})},l=u=>{t({...e,recurrence_pattern:u,recurrence_day_of_month:null})},c=u=>{t({...e,monthly_type:u,recurrence_day_of_month:null,recurrence_pattern:""})};return s.jsxs("div",{className:"space-y-4 p-4 border rounded-lg bg-muted/50",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Do,{id:"is_recurring",checked:e.is_recurring,onCheckedChange:r}),s.jsx(B,{htmlFor:"is_recurring",className:"cursor-pointer font-medium",children:"Recurring Event"})]}),e.is_recurring&&s.jsxs("div",{className:"space-y-4 pt-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"When enabled, the single event date picker is disabled. Configure the recurrence pattern below."}),s.jsxs("div",{children:[s.jsx(B,{className:"mb-2 block",children:"Recurrence Type"}),s.jsxs(vp,{value:e.recurrence_type,onValueChange:u=>a(u),className:"flex flex-wrap gap-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Ha,{value:"weekly",id:"weekly"}),s.jsx(B,{htmlFor:"weekly",className:"cursor-pointer",children:"Weekly"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Ha,{value:"monthly",id:"monthly"}),s.jsx(B,{htmlFor:"monthly",className:"cursor-pointer",children:"Monthly"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Ha,{value:"bi_weekly",id:"bi_weekly"}),s.jsx(B,{htmlFor:"bi_weekly",className:"cursor-pointer",children:"Bi-Weekly (twice a month)"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Ha,{value:"bi_monthly",id:"bi_monthly"}),s.jsx(B,{htmlFor:"bi_monthly",className:"cursor-pointer",children:"Bi-Monthly"})]})]})]}),e.recurrence_type==="weekly"&&s.jsxs("div",{children:[s.jsx(B,{className:"mb-2 block",children:"Select Days of the Week *"}),s.jsx("div",{className:"flex flex-wrap gap-2",children:bL.map(u=>s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx(Do,{id:`day-${u.value}`,checked:e.recurrence_days_of_week.includes(u.value),onCheckedChange:()=>i(u.value)}),s.jsx(B,{htmlFor:`day-${u.value}`,className:"cursor-pointer text-sm",children:u.label.slice(0,3)})]},u.value))}),e.recurrence_days_of_week.length===0&&s.jsx("p",{className:"text-sm text-destructive mt-1",children:"Select at least one day"})]}),e.recurrence_type==="monthly"&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(B,{className:"mb-2 block",children:"Monthly Recurrence Type"}),s.jsxs(vp,{value:e.monthly_type,onValueChange:u=>c(u),className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Ha,{value:"day_of_month",id:"day_of_month"}),s.jsx(B,{htmlFor:"day_of_month",className:"cursor-pointer",children:"Specific day of the month"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Ha,{value:"pattern",
434id:"pattern"}),s.jsx(B,{htmlFor:"pattern",className:"cursor-pointer",children:"Pattern (e.g., first Friday)"})]})]})]}),e.monthly_type==="day_of_month"&&s.jsxs("div",{children:[s.jsx(B,{className:"mb-2 block",children:"Day of Month *"}),s.jsxs(Vt,{value:((d=e.recurrence_day_of_month)==null?void 0:d.toString())||"",onValueChange:o,children:[s.jsx(Ot,{className:"w-32",children:s.jsx(Wt,{placeholder:"Select day"})}),s.jsx(At,{className:"bg-popover z-50 max-h-60",children:Array.from({length:31},(u,f)=>f+1).map(u=>s.jsx(gt,{value:u.toString(),children:u},u))})]}),!e.recurrence_day_of_month&&s.jsx("p",{className:"text-sm text-destructive mt-1",children:"Select a day of the month"})]}),e.monthly_type==="pattern"&&s.jsxs("div",{children:[s.jsx(B,{className:"mb-2 block",children:"Pattern *"}),s.jsxs(Vt,{value:e.recurrence_pattern,onValueChange:l,children:[s.jsx(Ot,{children:s.jsx(Wt,{placeholder:"Select pattern"})}),s.jsx(At,{className:"bg-popover z-50 max-h-60",children:cw.map(u=>s.jsx(gt,{value:u.value,children:u.label},u.value))})]}),!e.recurrence_pattern&&s.jsx("p",{className:"text-sm text-destructive mt-1",children:"Select a recurrence pattern"})]})]}),e.recurrence_type==="bi_weekly"&&s.jsxs("div",{children:[s.jsx(B,{className:"mb-2 block",children:"Bi-Weekly Pattern (1st & 3rd or 2nd & 4th) *"}),s.jsxs(Vt,{value:e.recurrence_pattern,onValueChange:l,children:[s.jsx(Ot,{children:s.jsx(Wt,{placeholder:"Select pattern (e.g., 1st & 3rd Friday)"})}),s.jsx(At,{className:"bg-popover z-50 max-h-60",children:jL.map(u=>s.jsx(gt,{value:u.value,children:u.label},u.value))})]}),!e.recurrence_pattern&&s.jsx("p",{className:"text-sm text-destructive mt-1",children:"Select a bi-weekly recurrence pattern"})]}),e.recurrence_type==="bi_monthly"&&s.jsxs("div",{children:[s.jsx(B,{className:"mb-2 block",children:"Bi-Monthly Pattern (every other month) *"}),s.jsxs(Vt,{value:e.recurrence_pattern,onValueChange:l,children:[s.jsx(Ot,{children:s.jsx(Wt,{placeholder:"Select pattern (e.g., Second Saturday)"})}),s.jsx(At,{className:"bg-popover z-50 max-h-60",children:cw.map(u=>s.jsx(gt,{value:u.value,children:u.label},u.value))})]}),!e.recurrence_pattern&&s.jsx("p",{className:"text-sm text-destructive mt-1",children:"Select a recurrence pattern"})]})]})]})},xp=e=>{if(!e.is_recurring)return{valid:!0};if(!e.recurrence_type)return{valid:!1,message:"Please select a recurrence type"};if(e.recurrence_type==="weekly"&&e.recurrence_days_of_week.length===0)return{valid:!1,message:"Please select at least one day of the week"};if(e.recurrence_type==="monthly"){if(e.monthly_type==="day_of_month"&&!e.recurrence_day_of_month)return{valid:!1,message:"Please select a day of the month"};if(e.monthly_type==="pattern"&&!e.recurrence_pattern)return{valid:!1,message:"Please select a recurrence pattern"}}return e.recurrence_type==="bi_weekly"&&!e.recurrence_pattern?{valid:!1,message:"Please select a bi-weekly recurrence pattern"}:e.recurrence_type==="bi_monthly"&&!e.recurrence_pattern?{valid:!1,message:"Please select a bi-monthly recurrence pattern"}:{valid:!0}},Ol=()=>({is_recurring:!1,recurrence_type:"",recurrence_days_of_week:[],recurrence_day_of_month:null,recurrence_pattern:"",monthly_type:"day_of_month"}),Z1=({youtube_url:e,onChange:t})=>s.jsxs("div",{className:"space-y-3 border-t pt-4",children:[s.jsx(B,{className:"text-base font-semibold",children:"Media"}),s.jsx("p",{className:"text-xs text-muted-foreground -mt-1",children:"Add a YouTube link to embed a player on your event page"}),s.jsxs("div",{children:[s.jsx(B,{className:"text-sm",children:"YouTube URL"}),s.jsx(Q,{type:"url",value:e,onChange:n=>t("youtube_url",n.target.value),placeholder:"https://youtube.com/watch?v=..."})]})]}),_L=({userId:e})=>{const[t,n]=h.useState([]),[r,a]=h.useState([]),[i,o]=h.useState(!0),[l,c]=h.useState(!1),[d,u]=h.useState(!1),[f,m]=h.useState([]),[w,x]=h.useState(""),[p,b]=h.useState(!1),[v,g]=h.useState(!1),{toast:y}=_t(),[j,N]=h.useState({title:"",description:"",event_date:"",event_time:"",event_end_time:"",venue:"",address:"",tickets_url:"",city_id:"",image_url:"",price:"",google_maps_url:"",youtube_url:""}),[k,C]=h.useState(Ol()),[E,H]=h.useState(!1);h.useEffect(()=>{A(),F()},[e]);const A=async()=>{const{data:_,error:O}=await R.from("event_cities").select("*").order("name");_&&!O&&a(_)},F=async()=>{try{const{data:_,error:O}=await R.from("public_events").select(` 435 ${Tu}, 436 event_cities(name) 437 `).eq("created_by",e).order("created_at",{ascending:!1});if(O)throw O;n(_||[])}catch(_){console.error("Error fetching events:",_)}finally{o(!1)}},U=async _=>{var G;const O=(G=_.target.files)==null?void 0:G[0];if(O){if(!O.type.startsWith("image/")){y({title:"Invalid File",description:"Please upload an image file",variant:"destructive"});return}if(O.size>5*1024*1024){y({title:"File Too Large",description:"Image must be less than 5MB",variant:"destructive"});return}g(!0);try{const Y=O.name.split(".").pop(),oe=`${e}/${Date.now()}.${Y}`,{error:M}=await R.storage.from("event-images").upload(oe,O);if(M)throw M;const{data:{publicUrl:I}}=R.storage.from("event-images").getPublicUrl(oe);N(he=>({...he,image_url:I})),y({title:"Image Uploaded",description:"Event flyer uploaded successfully"})}catch(Y){y({title:"Upload Failed",description:Y.message,variant:"destructive"})}finally{g(!1)}}},ae=async()=>
437{if(!j.title.trim()||!j.city_id){y({title:"Missing Information",description:"Please fill in the required fields (title, city)",variant:"destructive"});return}if(!k.is_recurring&&!j.event_date){y({title:"Missing Date",description:"Please select an event date or enable recurring event",variant:"destructive"});return}const _=xp(k);if(!_.valid){y({title:"Invalid Recurrence Settings",description:_.message,variant:"destructive"});return}b(!0);try{const{error:O}=await R.from("public_events").insert({title:j.title.trim(),description:j.description.trim()||null,event_date:k.is_recurring?new Date().toISOString().split("T")[0]:j.event_date,event_time:j.event_time||null,event_end_time:j.event_end_time||null,venue:j.venue.trim()||null,address:j.address.trim()||null,tickets_url:j.tickets_url.trim()||null,city_id:j.city_id,image_url:j.image_url||null,price:j.price.trim()||null,google_maps_url:j.google_maps_url.trim()||null,youtube_url:j.youtube_url.trim()||null,created_by:e,is_recurring:k.is_recurring,recurrence_type:k.is_recurring?k.recurrence_type:null,recurrence_days_of_week:k.is_recurring&&k.recurrence_type==="weekly"?k.recurrence_days_of_week:null,recurrence_day_of_month:k.is_recurring&&k.recurrence_type==="monthly"&&k.monthly_type==="day_of_month"?k.recurrence_day_of_month:null,recurrence_pattern:k.is_recurring&&(k.recurrence_type==="monthly"&&k.monthly_type==="pattern"||k.recurrence_type==="bi_monthly"||k.recurrence_type==="bi_weekly")?k.recurrence_pattern:null});if(O)throw O;R.functions.invoke("send-submission-notification",{body:{type:"event",title:j.title.trim(),details:{Date:j.event_date||(k.is_recurring?"Recurring":""),Time:j.event_time||"",Venue:j.venue||"",Address:j.address||""}}}).catch(G=>console.error("Notification failed:",G)),y({title:"Event Submitted!",description:"Your event has been submitted for admin approval."}),c(!1),q(),F()}catch(O){y({title:"Error",description:O.message,variant:"destructive"})}finally{b(!1)}},q=()=>{N({title:"",description:"",event_date:"",event_time:"",event_end_time:"",venue:"",address:"",tickets_url:"",city_id:"",image_url:"",price:"",google_maps_url:"",youtube_url:""}),C(Ol()),H(!1)},se=async(_,O)=>{try{const{data:G,error:Y}=await R.from("event_rsvps").select("*").eq("event_id",_).order("created_at",{ascending:!1});if(Y)throw Y;m(G||[]),x(O),u(!0)}catch(G){console.error("Error fetching RSVPs:",G)}},D=()=>{if(f.length===0)return;const _=[["Name","Phone Number","RSVP Date"].join(","),...f.map(Y=>[`"${Y.name}"`,`"${Y.phone_number}"`,`"${new Date(Y.created_at).toLocaleDateString()}"`].join(","))].join(` 438`),O=new Blob([_],{type:"text/csv;charset=utf-8;"}),G=document.createElement("a");G.href=URL.createObjectURL(O),G.download=`rsvps-${w.replace(/\s+/g,"-").toLowerCase()}.csv`,G.click()},T=_=>{switch(_){case"approved":return"default";case"pending":return"secondary";case"rejected":return"destructive";default:return"outline"}};return s.jsxs(pe,{children:[s.jsxs(Ae,{className:"flex flex-col gap-4",children:[s.jsxs("div",{children:[s.jsxs(Me,{className:"flex items-center gap-2",children:[s.jsx(rr,{className:"w-5 h-5"}),"Submit Your Event"]}),s.jsx(St,{className:"text-justify",children:"Submit your event for review. Events that don't align with our target demographic will not be considered. Events scheduled to occur within two weeks of the submission date may not be approved. Once approved, events will be published on the public events page. Event promoters that offer a minimum of 10 complementary tickets to our V.I.P members will have their event promoted heavily to our database."})]}),s.jsxs(ht,{open:l,onOpenChange:c,children:[s.jsx(Nn,{asChild:!0,children:s.jsxs(L,{children:[s.jsx(os,{className:"w-4 h-4 mr-2"}),"Submit Event"]})}),s.jsxs(dt,{className:"max-h-[90vh] overflow-y-auto",children:[s.jsx(ft,{children:s.jsx(mt,{children:"Submit New Event"})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(B,{children:"Event Title *"}),s.jsx(Q,{value:j.title,onChange:_=>N(O=>({...O,title:_.target.value})),placeholder:"Enter event title"})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Description"}),s.jsx(Ir,{value:j.description,onChange:_=>N(O=>({...O,description:_.target.value})),placeholder:"Describe your event...",rows:3})]}),s.jsx(K1,{data:k,onChange:C,onDateDisabledChange:H}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsxs(B,{children:["Date ",!E&&"*"]}),s.jsx(Q,{type:"date",value:j.event_date,onChange:_=>N(O=>({...O,event_date:_.target.value})),disabled:E,className:E?"opacity-50 cursor-not-allowed":""}),E&&s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Date is managed by recurrence settings"})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Start Time"}),s.jsx(Q,{type:"time",value:j.event_time,onChange:_=>N(O=>({...O,event_time:_.target.value}))})]})]}),s.jsxs("div",{children:[s.jsx(B,{children:"End Time"}),s.jsx(Q,{type:"time",value:j.event_end_time,onChange:_=>N(O=>({...O,event_end_time:_.target.value}))})]}),s.jsxs("div",{children:[s.jsx(B,{children:"City *"}),s.jsxs(Vt,{value:j.city_id,onValueChange:_=>N(O=>({...O,city_id:_})),children:[s.jsx(Ot,{children:s.jsx(Wt,{placeholder:"Select a city"})}),s.jsx(At,{className:"bg-popover z-50",children:r.map(_=>s.jsx(gt,{value:_.id,children:_.name},_.id))})]})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Venue"}),s.jsx(Q,{value:j.venue,onChange:_=>N(O=>({...O,venue:_.target.value})),placeholder:"Venue name"})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Address"}),s.jsx(Q,{value:j.address,onChange:_=>N(O=>({...O,address:_.target.value})),placeholder:"Full address"})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Price"}),s.jsx(Q,{value:j.price,onChange:_=>N(O=>({...O,price:_.target.value})),placeholder:"e.g., Free, $20, $15-$50"})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Tickets URL"}),s.jsx(Q,{type:"url",value:j.tickets_url,onChange:_=>N(O=>({...O,tickets_url:_.target.value})),placeholder:"https://..."})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Google Maps Link"}),s.jsx(Q,{type:"url",value:j.google_maps_url,onChange:_=>N(O=>({...O,google_maps_url:_.target.value})),placeholder:"https://maps.google.com/..."})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Event Flyer"}),j.image_url?s.jsxs("div",{className:"relative mt-2",children:[s.jsx("img",{src:j.image_url,alt:"Event flyer",className:"w-full h-40 object-cover rounded-lg"}),s.jsx(L,{variant:"destructive",size:"icon",className:"absolute top-2 right-2",onClick:()=>N(_=>({..._,image_url:""})),children:s.jsx(rs,{className:"w-4 h-4"})})]}):s.jsxs("div",{className:"mt-2",children:[s.jsx(Q,{type:"file",accept:"image/*",onChange:U,disabled:v}),v&&s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Uploading..."})]})]}),s.jsx(Z1,{youtube_url:j.youtube_url,onChange:(_,O)=>N(G=>({...G,[_]:O}))}),s.jsx(L,{onClick:ae,className:"w-full",disabled:p,children:p?"Submitting...":"Submit for Approval"})]})]})]})]}),s.jsx(ve,{children:i?s.jsx("div",{className:"text-center py-8",children:s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto"})}):t.length===0?s.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[s.jsx(rr,{className:"w-12 h-12 mx-auto mb-2 opacity-50"}),s.jsx("p",{children:"You haven't submitted any events yet."})]}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Ft,{children:[s.jsx(Ut,{children:s.jsxs(Fe,{children:[s.jsx(te,{children:"Event"}),s.jsx(te,{children:"Date"}),s.jsx(te,{children:"City"}),s.jsx(te,{children:"Status"}),s.jsx(te,{children:"RSVPs"})]})}),s.jsx(zt,{children:t.map(_=>{var O;return s.jsxs(Fe,{children:[s.jsx(J,{children:s.jsxs("div",{className:"flex items-center gap-3",children:[_.image_url&&s.jsx("img",{src:_.image_url,alt:_.title,className:"w-12 h-12 object-cover rounded"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:_.title}),_.venue&&s.jsx("p",{className:"text-sm text-muted-foreground",children:_.venue})]})]})}),s.jsx(J,{children:new Date(_.event_date+"T00:00:00").toLocaleDateString()}),s.jsx(J,{children:((O=_.event_cities)==null?void 0:O.name)||"N/A"}),s.jsx(J,{children:s.jsx(Ie,{variant:T(_.status),children:_.status.charAt(0).toUpperCase()+_.status.slice(1)})}),s.jsx(J,{children:_.status==="approved"&&s.jsx(L,{variant:"outline",size:"sm",onClick:()=>se(_.id,_.title),children:"View RSVPs"})})]},_.id)})})]})})}),s.jsx(ht,{open:d,onOpenChange:u,children:s.jsxs(dt,{className:"max-w-2xl",children:[s.jsx(ft,{children:s.jsxs(mt,{children:["RSVPs for ",w]})}),s.jsx("div",{className:"space-y-4",children:f.length===0?s.jsx("p",{className:"text-center py-8 text-muted-foreground",children:"No RSVPs yet"}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsxs("p",{className:"text-sm text-muted-foreground",children:[f.length," total RSVPs"]}),s.jsxs(L,{variant:"outline",size:"sm",onClick:D,children:[s.jsx(di,{className:"w-4 h-4 mr-2"}),"Download CSV"]})]}),s.jsx("div",{className:"max-h-80 overflow-y-auto",children:s.jsxs(Ft,{children:[s.jsx(Ut,{children:s.jsxs(Fe,{children:[s.jsx(te,{children:"Name"}),s.jsx(te,{children:"Phone"}),s.jsx(te,{children:"RSVP Date"})]})}),s.jsx(zt,{children:f.map(_=>s.jsxs(Fe,{children:[s.jsx(J,{children:_.name}),s.jsx(J,{children:_.phone_number}),s.jsx(J,{children:new Date(_.created_at).toLocaleDateString()})]},_.id))})]})})]})})]})})]})},NL=()=>{var Ce;const[e,t]=h.useState(null),[n,r]=h.useState(null),[a,i]=h.useState(!0),[o,l]=h.useState(""),[c,d]=h.useState(null),[u,f]=h.useState([]),[m,w]=h.useState([]),[x,p]=h.useState(!1),[b,v]=Wg(),[g,y]=h.useState(!1),[j,N]=h.useState(!1),[k,C]=h.useState(""),[E,H]=h.useState([]),[A,F]=h.useState(!1),[U,ae]=h.useState(null),[q,se]=h.useState(""),[D,T]=h.useState(!1),[_,O]=h.useState(!1),G=Et(),{toast:Y}=_t();h.useEffect(()=>{const{data:{subscription:V}}=R.auth.onAuthStateChange((Ne,Pe)=>{r(Pe),t((Pe==null?void 0:Pe.user)??null),Pe!=null&&Pe.user?setTimeout(()=>{I(Pe.user.id)},0):i(!1)});R.auth.getSession().then(({data:{session:Ne}})=>{r(Ne),t((Ne==null?void 0:Ne.user)??null),Ne!=null&&Ne.user?setTimeout(()=>{I(Ne.user.id)},0):i(!1)}),oe(),M();const ge=()=>{!document.hidden&&(e!=null&&e.id)&&I(e.id)};return document.addEventListener("visibilitychange",ge),()=>{V.unsubscribe(),document.removeEventListener("visibilitychange",ge)}},[e==null?void 0:e.id]),h.useEffect(()=>{b.get("upgrade")==="true"&&c&&(p(!0),b.delete("upgrade"),v(b,{replace:!0}))},[b,c]);const oe=async()=>{try{console.log("Fetching membership plans...");const{data:V,error:ge}=await R.from("membership_plans").select("*").order("id");ge?(console.error("Error fetching membership plans:",ge),Y({title:"Error",description:"Failed to load membership plans",variant:"destructive"})):(console.log("Membership plans fetched:",V),f(V||[]))}
438catch(V){console.error("Error fetching membership plans:",V),Y({title:"Error",description:"Failed to load membership plans",variant:"destructive"})}},M=async()=>{try{const{data:V,error:ge}=await R.from("rewards").select(qI).eq("active",!0).order("points_cost");if(ge)console.error("Error fetching rewards:",ge);else{const Ne=await Promise.all((V||[]).map(async Pe=>{if(!Pe.file_url)return Pe;const We=Pe.file_url;if(We.startsWith("http"))return Pe;let xt="reward-files",Je="";const It=We.split("/");It.length>1?(xt=It.shift(),Je=It.join("/")):Je=We.replace(/^reward-files\//,"");try{const{data:on,error:tn}=await R.storage.from(xt).createSignedUrl(Je,604800);if(tn){console.error("Error creating signed URL:",tn);const{data:nn}=R.storage.from(xt).getPublicUrl(Je);return{...Pe,file_url:nn.publicUrl}}return{...Pe,file_url:on.signedUrl}}catch(on){return console.error("Error loading image URL:",on),Pe}}));w(Ne)}}catch(V){console.error("Error fetching rewards:",V)}},I=async V=>{try{const{data:ge,error:Ne}=await R.from("profiles").select(` 439 *, 440 membership_plans ( 441 id, 442 name, 443 price 444 ) 445 `).eq("id",V).maybeSingle();if(Ne)console.error("Error fetching profile:",Ne);else{d(ge),ge&&(!ge.referral_code||ge.referral_code==="")?await he(V):ge!=null&&ge.referral_code&&C(ge.referral_code);const{data:Pe,error:We}=await R.from("claimed_rewards").select(` 446 *, 447 rewards(name, points_cost, description) 448 `).eq("user_id",V).order("claimed_at",{ascending:!1});!We&&Pe&&H(Pe)}}catch(ge){console.error("Error fetching profile:",ge)}finally{i(!1)}},he=async V=>{try{const{data:ge,error:Ne}=await R.rpc("ensure_referral_code",{p_user_id:V});Ne?console.error("Error ensuring referral code:",Ne):(C(ge),await I(V))}catch(ge){console.error("Error ensuring referral code:",ge)}},X=async()=>{try{Object.keys(localStorage).forEach(V=>{(V.startsWith("supabase.auth.")||V.includes("sb-"))&&localStorage.removeItem(V)}),await R.auth.signOut({scope:"global"}),window.location.href="/sign-in"}catch(V){console.error("Error signing out:",V)}},K=async V=>{if(V.preventDefault(),!o.trim()){Y({title:"Error",description:"Please enter a check-in code",variant:"destructive"});return}try{const ge=o.trim().toUpperCase(),{data:Ne,error:Pe}=await R.rpc("process_code_checkin",{p_checkin_code:ge});if(Pe){console.error("Error processing check-in code:",Pe),Y({title:"Check-in Error",description:Pe.message||"Could not process the code. Please try again.",variant:"destructive"});return}const We=Ne;if(!(We!=null&&We.success)){Y({title:"Check-in Failed",description:(We==null?void 0:We.message)||"Could not process the code. Please try again.",variant:"destructive"});return}await I(e.id),Y({title:"Success!",description:We.message}),l("")}catch(ge){console.error("Error during check-in:",ge),Y({title:"Error",description:"Something went wrong",variant:"destructive"})}},P=async(V,ge)=>{try{p(!1);{Y({title:"Redirecting to PayPal",description:"Please wait while we set up your payment..."});const{data:Ne,error:Pe}=await R.functions.invoke("create-paypal-order",{body:{planId:V,planPrice:ge}});if(Pe)throw new Error(Pe.message);if(Ne.approvalUrl)if(/iPhone|iPad|iPod|Android/i.test(navigator.userAgent))window.location.href=Ne.approvalUrl;else{window.open(Ne.approvalUrl,"_blank");const xt=setInterval(async()=>{try{const{data:Je,error:It}=await R.functions.invoke("capture-paypal-order",{body:{orderId:Ne.orderId,planId:V}});!It&&Je.success&&(clearInterval(xt),Y({title:"Payment Successful!",description:"Your membership has been upgraded."}),await I(e.id))}catch{}},3e3);setTimeout(()=>clearInterval(xt),3e5)}}}catch(Ne){console.error("PayPal payment error:",Ne),Y({title:"Payment Error",description:Ne.message||"Failed to process payment",variant:"destructive"})}},Z=k?`https://street-pass-members.com/r/${k}`:"",ee=async()=>{if(Z)try{await navigator.clipboard.writeText(Z),Y({title:"Copied!",description:"Referral link copied to clipboard"})}catch{Y({title:"Error",description:"Failed to copy referral link",variant:"destructive"})}},le=()=>{const V=`Youâre invited to be one of The Street Pass Founding 1,000. 449 450Weâre building a community of people who want to experience the cityânot just live in it. Discover great local businesses, events and experiences, check in, earn Street Cash, unlock member perks and get connected to whatâs worth knowing. 451 452Membership is FREE. Join the community and get The Street Pass: 453 454${Z} 455`,ge=`sms:?body=${encodeURIComponent(V)}`;window.location.href=ge},z=async()=>
455{if(!U)return;const{data:V,error:ge}=await R.rpc("verify_reward_claim_code",{_reward_id:U.id,_code:q.trim()});if(ge||!V){T(!0);return}await _e(U.id),O(!0)},_e=async V=>{try{const ge=m.find(Je=>Je.id===V);if(!ge){Y({title:"Error",description:"Reward not found",variant:"destructive"});return}const{data:Ne}=await R.from("claimed_rewards").select("*").eq("user_id",e.id).eq("reward_id",V).single();if(Ne){Y({title:"Already Claimed",description:"You have already claimed this reward.",variant:"destructive"});return}if(Qe<ge.points_cost){Y({title:"Insufficient Points",description:`You need ${ge.points_cost-Qe} more points to claim this reward.`,variant:"destructive"});return}const{error:Pe}=await R.from("claimed_rewards").insert({user_id:e.id,reward_id:V,status:"pending"});if(Pe)throw Pe;const We=Math.max(0,Qe-ge.points_cost),{error:xt}=await R.from("profiles").update({points:We}).eq("id",e.id);if(xt)throw xt;await I(e.id),Y({title:"Reward Claimed!",description:`You've successfully claimed "${ge.name}" for ${ge.points_cost} points!`})}catch(ge){console.error("Error claiming reward:",ge),Y({title:"Error",description:"Failed to claim reward. Please try again.",variant:"destructive"})}},ue=V=>{switch(V){case 1:return{name:"Introductory",color:"secondary"};case 2:return{name:"Standard",color:"default"};case 3:return{name:"V.I.P.",color:"vip"};case 4:return{name:"Ambassador",color:"default"};case 5:return{name:"Executive",color:"default"};default:return{name:"Introductory",color:"secondary"}}},De=V=>{if(!V)return!1;const ge=new Date;if(V.trial_ends_at){const Ne=new Date(V.trial_ends_at);if(ge>Ne)return!1}if(V.membership_end_date){const Ne=new Date(V.membership_end_date);if(ge>Ne)return!1}return!0},Ve=V=>V?V.trial_ends_at?{date:new Date(V.trial_ends_at),type:"introductory"}:V.membership_end_date?{date:new Date(V.membership_end_date),type:"membership"}:null:null;if(a)return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:s.jsx("div",{className:"text-center",children:s.jsx("p",{className:"text-xl text-muted-foreground",children:"Loading..."})})});if(!e)return G("/sign-in"),null;const lt=ue((c==null?void 0:c.membership_plan_id)||1),vt=((Ce=c==null?void 0:c.checkins)==null?void 0:Ce.length)||0,Qe=(c==null?void 0:c.points)||0,re=De(c),ie=Ve(c);if(!re&&c)return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx("header",{className:"border-b",children:s.jsx("div",{className:"container mx-auto px-4 py-4",children:s.jsx("h1",{className:"text-2xl font-bold text-[#ff0000]",children:"The Street Pass"})})}),s.jsx("main",{className:"container mx-auto px-4 py-8 max-w-4xl",children:s.jsx("div",{className:"text-center",children:s.jsxs(pe,{className:"max-w-md mx-auto",children:[s.jsx(Ae,{children:s.jsx(Me,{className:"text-2xl text-red-600",children:"Membership Expired"})}),s.jsxs(ve,{className:"space-y-4",children:[s.jsxs("p",{className:"text-muted-foreground",children:["Your ",(ie==null?void 0:ie.type)==="introductory"?"30-day introductory membership":"annual membership"," has expired."]}),s.jsx("p",{className:"text-muted-foreground",children:"Please choose a new membership plan to continue accessing your member portal."}),s.jsxs(ht,{open:x,onOpenChange:p,children:[s.jsx(Nn,{asChild:!0,children:s.jsx(L,{className:"w-full",size:"lg",children:"Choose Membership Plan"})}),s.jsxs(dt,{className:"max-w-[95vw] sm:max-w-3xl md:max-w-4xl lg:max-w-5xl max-h-[90vh] overflow-y-auto",children:[s.jsx(ft,{children:s.jsx(mt,{className:"text-xl md:text-2xl",children:"Choose Your Membership Plan"})}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-2 gap-4 py-6",children:[u.length===0&&s.jsx("div",{className:"col-span-full text-center py-8 text-muted-foreground",children:"Loading membership plans..."}),u.filter(V=>V.id>1).map(V=>s.jsx(pe,{className:"cursor-pointer hover:shadow-md transition-shadow h-full",children:s.jsxs(ve,{className:"p-4 lg:p-6 h-full flex flex-col",children:[s.jsxs("div",{className:"flex flex-col gap-3 mb-4",children:[s.jsx("div",{className:"flex justify-between items-start",children:s.jsx("h3",{className:"text-lg md:text-xl font-semibold",children:V.name})}),s.jsxs("p",{className:"text-2xl md:text-3xl font-bold text-primary",children:["$",V.price,s.jsx("span",{className:"text-sm font-normal text-muted-foreground",children:"/year"})]})]}),s.jsxs("div",{className:"space-y-2 text-sm md:text-base flex-1",children:[V.id===2&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex items-center",children:s.jsx("span",{className:"text-foreground",children:"⢠Exclusive member events"})}),s.jsx("div",{className:"flex items-center",children:s.jsx("span",{className:"text-foreground",children:"⢠Priority customer support"})}),s.jsx("div",{className:"flex items-start",children:s.jsx("span",{className:"text-foreground text-justify",children:"⢠$10 Street Cash digital gift card"})})]}),V.id===3&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex items-center",children:s.jsx("span",{className:"text-foreground",children:"⢠All Standard benefits"})}),s.jsx("div",{className:"flex items-center",children:s.jsx("span",{className:"text-foreground",children:"⢠VIP event access"})}),s.jsx("div",{className:"flex items-center",children:s.jsx("span",{className:"text-foreground",children:"⢠Enhanced rewards"})}),s.jsx("div",{className:"flex items-center",children:s.jsx("span",{className:"text-foreground",children:"⢠Personal concierge service"})}),s.jsx("div",{className:"flex items-center",children:s.jsx("span",{className:"text-foreground",children:"⢠25% commission from paid referrals"})}),s.jsx("div",{className:"flex items-start",children:s.jsx("span",{className:"text-foreground text-justify",children:"⢠$50 Street Cash digital gift card"})})]}),V.id===4&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex items-center",children:s.jsx("span",{className:"text-foreground",children:"⢠All Standard and V.I.P. benefits"})}),s.jsx("div",{className:"flex items-center",children:s.jsx("span",{className:"text-foreground",children:"⢠Premium rewards tier"})}),s.jsx("div",{className:"flex items-center",children:s.jsx("span",{className:"text-foreground",children:"⢠50% commission from paid referrals"})}),s.jsx("div",{className:"flex items-center",children:s.jsx("span",{className:"text-foreground",children:"⢠50% discount on event photography"})}),s.jsx("div",{className:"flex items-start",children:s.jsx("span",{className:"text-foreground text-justify",children:"⢠$150 Street Cash digital gift card"})}),s.jsx("div",{className:"flex items-start",children:s.jsx("span",{className:"text-foreground text-justify",children:"⢠Executive/in-store portrait session"})}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 italic",children:"* Note: Event Photography must take place at an event that has been posted to this app."})]}),V.id===5&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex items-center",children:s.jsx("span",{className:"text-foreground",children:"⢠All the benefits of Standard and V.I.P.memberships"})}),s.jsx("div",{className:"flex items-center",children:s.jsx("span",{className:"text-foreground",children:"⢠100% commission from paid referrals"})}),s.jsx("div",{className:"flex items-start",children:s.jsx("span",{className:"text-foreground text-justify",children:"⢠$300 Street Cash digital gift card"})}),s.jsx("div",{className:"flex items-start",children:s.jsx("span",{className:"text-foreground text-justify",children:"⢠Executive/in-store portrait session"})}),s.jsx("div",{className:"flex items-start",children:s.jsx("span",{className:"text-foreground text-justify",children:"⢠In-store DJ set w/ Andre Terrell"})})]})]}),s.jsx(L,{className:"w-full mt-4",size:"sm",onClick:()=>P(V.id,V.price),children:"Choose this membership"})]})},V.id))]})]})]}),s.jsx(L,{variant:"outline",onClick:X,className:"w-full",children:"Sign Out"})]})]})})})]});if(c!=null&&c.fundraiser_org_id&&(c==null?void 0:c.membership_plan_id)===1){const V=u.find(ge=>ge.id===3);return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx("header",{className:"border-b",children:s.jsx("div",{className:"container mx-auto px-4 py-4",children:s.jsx("h1",{className:"text-2xl font-bold text-[#ff0000]",children:"The Street Pass"})})}),s.jsx("main",{className:"container mx-auto px-4 py-8 max-w-lg",children:s.jsxs(pe,{children:[s.jsx(Ae,{children:s.jsx(Me,{className:"text-2xl text-primary text-center",children:"Complete Your V.I.P. Membership"})}),s.jsxs(ve,{className:"space-y-4",children:[s.jsx("p",{className:"text-muted-foreground text-justify",children:"You signed up through a nonprofit fundraiser. To complete your membership, please submit your V.I.P. membership payment below. 50% of your payment goes directly to the fundraising organization."}),V&&s.jsxs("div",{className:"p-4 border rounded-lg text-center space-y-2",children:[s.jsxs("p",{className:"font-bold text-lg",children:[V.name," Membership"]}),s.jsxs("p",{className:"text-2xl font-bold text-primary",children:["$",V.price]}),s.jsx(L,{className:"w-full mt-2",size:"lg",onClick:()=>P(V.id,V.price),children:"Pay with PayPal"})]}),s.jsx(L,{variant:"outline",onClick:X,className:"w-full",children:"Sign Out"})]})]})})]})}return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx("header",{className:"border-b",children:s.jsx("div",{className:"container mx-auto px-4 py-4",children:s.jsx("h1",{className:"text-2xl font-bold text-[#ff0000]",children:"The Street Pass"})})}),s.jsx("main",{className:"container mx-auto px-4 md:px-6 py-8 max-w-4xl w-full flex flex-col items-center",children:s.jsxs("div",{className:"grid gap-6 w-full max-w-full",children:[s.jsxs(pe,{children:[s.jsxs(Ae,{children:[s.jsxs("div",{className:"text-left mb-2",children:[(c==null?void 0:c.founding_member_number)&&c.founding_member_number<=1e3&&s.jsxs("p",{className:"text-xs font-bold tracking-widest text-primary uppercase mb-1",children:["Founding Member #",String(c.founding_member_number).padStart(4,"0")]}),s.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("p",{className:"text-2xl font-bold text-muted-foreground",children:(c==null?void 0:c.name)||"Member"}),s.jsx(Ie,{variant:lt.color,className:"text-xs",children:lt.name}),((c==null?void 0:c.referral_count)||0)>=20&&s.jsx(Ie,{className:"text-xs bg-gradient-to-r from-amber-500 to-yellow-500 text-white border-0",children:"Ambassador"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(ht,{open:x,onOpenChange:p,children:[s.jsx(Nn,{asChild:!0,children:s.jsx(L,{variant:"default",size:"sm",children:"Upgrade Membership"})}),s.jsxs(dt,{className:"max-w-[95vw] sm:max-w-3xl md:max-w-4xl lg:max-w-5xl max-h-[90vh] overflow-y-auto",children:[s.jsx(ft,{children:s.jsx(mt,{className:"text-xl md:text-2xl",children:"Choose Your Membership Plan"})}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-2 gap-4 py-6",children:[u.length===0&&s.jsx("div",{className:"col-span-full text-center py-8 text-muted-foreground",children:"Loading membership plans..."}),u.map(V=>
455s.jsx(pe,{className:`cursor-pointer hover:shadow-md transition-shadow ${V.id===1?"opacity-60":""} h-full`,children:s.jsxs(ve,{className:"p-4 lg:p-6 h-full flex flex-col",children:[s.jsxs("div",{className:"flex flex-col gap-3 mb-4",children:[s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("h3",{className:"text-lg md:text-xl font-semibold",children:V.name}),V.id===((c==null?void 0:c.membership_plan_id)||1)&&s.jsx(Ie,{variant:"secondary",className:"text-xs",children:"Current Plan"})]}),s.jsxs("p",{className:"text-2xl md:text-3xl font-bold text-primary",children:[V.price===0?"Free":`$${V.price}`,V.price>0&&s.jsx("span",{className:"text-sm font-normal text-muted-foreground",children:"/year"})]})]}),s.jsxs("div",{className:"space-y-2 text-sm md:text-base flex-1",children:[V.id===1&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex items-center",children:s.jsx("span",{className:"text-muted-foreground",children:"⢠Weekly drawing entries"})}),s.jsx("div",{className:"flex items-center",children:s.jsx("span",{className:"text-muted-foreground",children:"⢠Basic member perks"})})]}),V.id===2&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex items-center",children:s.jsx("span",{className:"text-foreground",children:"⢠Exclusive member events"})}),s.jsx("div",{className:"flex items-center",children:s.jsx("span",{className:"text-foreground",children:"⢠Priority customer support"})}),s.jsx("div",{className:"flex items-start",children:s.jsx("span",{className:"text-foreground text-justify",children:"⢠$10 Street Cash digital gift card"})})]}),V.id===3&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex items-center",children:s.jsx("span",{className:"text-foreground",children:"⢠All Standard benefits"})}),s.jsx("div",{className:"flex items-center",children:s.jsx("span",{className:"text-foreground",children:"⢠VIP event access"})}),s.jsx("div",{className:"flex items-center",children:s.jsx("span",{className:"text-foreground",children:"⢠Enhanced rewards"})}),s.jsx("div",{className:"flex items-center",children:s.jsx("span",{className:"text-foreground",children:"⢠Personal concierge service"})}),s.jsx("div",{className:"flex items-center",children:s.jsx("span",{className:"text-foreground",children:"⢠25% commission from paid referrals"})}),s.jsx("div",{className:"flex items-start",children:s.jsx("span",{className:"text-foreground text-justify",children:"⢠$50 Street Cash digital gift card"})})]}),V.id===4&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex items-center",children:s.jsx("span",{className:"text-foreground",children:"⢠All Standard and V.I.P. benefits"})}),s.jsx("div",{className:"flex items-center",children:s.jsx("span",{className:"text-foreground",children:"⢠Premium rewards tier"})}),s.jsx("div",{className:"flex items-center",children:s.jsx("span",{className:"text-foreground",children:"⢠50% commission from paid referrals"})}),s.jsx("div",{className:"flex items-center",children:s.jsx("span",{className:"text-foreground",children:"⢠50% discount on event photography"})}),s.jsx("div",{className:"flex items-start",children:s.jsx("span",{className:"text-foreground text-justify",children:"⢠$150 Street Cash digital gift card"})}),s.jsx("div",{className:"flex items-start",children:s.jsx("span",{className:"text-foreground text-justify",children:"⢠Executive/in-store portrait session"})}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 italic",children:"* Note: Event Photography must take place at an event that has been posted to this app."})]}),V.id===5&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex items-center",children:s.jsx("span",{className:"text-foreground",children:"⢠All the benefits of Standard and V.I.P. memberships"})}),s.jsx("div",{className:"flex items-center",children:s.jsx("span",{className:"text-foreground",children:"⢠100% commission from paid referrals"})}),s.jsx("div",{className:"flex items-start",children:s.jsx("span",{className:"text-foreground text-justify",children:"⢠$300 Street Cash digital gift card"})}),s.jsx("div",{className:"flex items-start",children:s.jsx("span",{className:"text-foreground text-justify",children:"⢠Executive/in-store portrait session"})}),s.jsx("div",{className:"flex items-start",children:s.jsx("span",{className:"text-foreground text-justify",children:"⢠In-store DJ set w/ Andre Terrell"})})]})]}),V.id>1&&V.id!==((c==null?void 0:c.membership_plan_id)||1)&&s.jsx(L,{className:"w-full mt-4",size:"sm",onClick:()=>P(V.id,V.price),children:"Choose this membership"})]})},V.id))]})]})]}),s.jsx(L,{variant:"outline",size:"sm",onClick:()=>G("/update-info"),children:"Update Info"})]})]}),s.jsx(L,{variant:"outline",onClick:X,children:"Sign Out"})]}),(c==null?void 0:c.membership_plan_id)&&[3,4,5].includes(c.membership_plan_id)&&s.jsxs("div",{className:"mt-2 text-sm text-muted-foreground",children:[s.jsx("span",{className:"font-medium",children:"Earned Commissions: "}),s.jsxs("span",{className:"text-primary font-semibold",children:["$",((c==null?void 0:c.earnings)||0).toFixed(2)]})]})]}),s.jsx(Me,{children:"Event Check-in"})]}),s.jsxs(ve,{children:[s.jsxs("form",{onSubmit:K,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{htmlFor:"checkin-code",className:"text-sm font-medium",children:"Enter Check-in Code"}),s.jsx(Q,{id:"checkin-code",type:"text",value:o,onChange:V=>l(V.target.value.toUpperCase()),placeholder:"Enter check-in code",maxLength:12,className:"text-center text-lg tracking-widest uppercase"})]}),s.jsx(L,{type:"submit",className:"w-full bg-[#ff0000] hover:bg-[#ff0000]/90 text-white",size:"lg",children:"Check In with Code"})]}),s.jsx("div",{className:"flex gap-2 mt-4 justify-center w-full",children:s.jsxs(ht,{open:j,onOpenChange:N,children:[s.jsx(Nn,{asChild:!0,children:s.jsxs(L,{variant:"outline",className:"flex-1 max-w-full",size:"lg",children:[s.jsx(dn,{className:"w-4 h-4 mr-2"}),"GPS Check-in"]})}),s.jsxs(dt,{className:"max-w-[95vw] md:max-w-4xl max-h-[90vh] overflow-y-auto",children:[s.jsx(ft,{children:s.jsx(mt,{className:"text-lg md:text-xl",children:"GPS Event Check-in"})}),s.jsx(YI,{})]})]})}),s.jsx("div",{className:"mt-4 p-4 bg-muted rounded-lg",children:s.jsx("p",{className:"text-sm text-muted-foreground text-justify",children:"Check-in to events using a code or GPS location. Check-in to one or more events this week to be entered into the weekly drawing."})})]})]}),s.jsxs(pe,{children:[s.jsx(Ae,{children:s.jsx(Me,{children:"Share & Earn Points"})}),s.jsx(ve,{children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"Your Personal Sign-Up Link"}),s.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[s.jsx(Q,{value:Z,readOnly:!0,className:"text-sm",placeholder:"Loading..."}),s.jsx(L,{variant:"outline",size:"icon",onClick:ee,disabled:!Z,children:s.jsx(gu,{className:"h-4 w-4"})})]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-2 text-ju
455stify",children:"Anyone who signs up through this link is credited to you automaticallyâno code to type."})]}),s.jsx("div",{className:"flex flex-col gap-2 w-full",children:s.jsxs(L,{variant:"default",onClick:le,disabled:!k,className:"w-full bg-[#ff0000] hover:bg-[#ff0000]/90 text-white",children:[s.jsx(Ij,{className:"h-4 w-4 mr-2"}),"Share via SMS"]})}),s.jsx("div",{className:"p-3 bg-muted rounded-lg",children:s.jsx("p",{className:"text-sm text-muted-foreground text-justify",children:"Share your personal sign-up link and earn 25 points when someone signs up through your link!"})}),s.jsx("div",{className:"text-center pt-2",children:s.jsx(L,{variant:"link",className:"text-sm font-medium",onClick:()=>G("/manifesto"),children:"The Street Pass manifesto"})})]})})]}),s.jsxs(pe,{children:[s.jsx(Ae,{children:s.jsx(Me,{children:"Host a Fundraiser"})}),s.jsx(ve,{children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"p-3 bg-muted rounded-lg",children:[s.jsx("p",{className:"text-sm text-muted-foreground text-justify",children:"Would you like to raise funds for an organization? Tap the link below to register to host a fundraising event experience for your organization of choice."}),s.jsx("p",{className:"text-xs text-muted-foreground mt-2 italic",children:"*Must be registered 501c3 or 501c7 organization"})]}),s.jsx(L,{variant:"default",className:"w-full",onClick:()=>G("/create-fundraiser"),children:"Register"}),s.jsx(L,{variant:"link",className:"w-full",onClick:()=>G("/my-fundraiser"),children:"View My Fundraiser Stats â"})]})})]}),(c==null?void 0:c.is_business_owner)&&s.jsxs(pe,{children:[s.jsx(Ae,{children:s.jsx(Me,{children:"Get Listed in the Directory"})}),s.jsx(ve,{children:s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"p-3 bg-muted rounded-lg",children:s.jsx("p",{className:"text-sm text-muted-foreground text-justify",children:"Submit your local shop for review. Businesses that don't align with our target demographic will not be considered. If approved, your business listing will be published in the directory of this app."})}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-center w-full items-stretch",children:[s.jsx(L,{variant:"outline",className:"flex-1 max-w-full",onClick:()=>G("/localshops"),children:"View Directory"}),s.jsx(L,{variant:"default",className:"flex-1 max-w-full",onClick:()=>G("/add-business"),children:"Add Your Business"}),s.jsx(L,{variant:"outline",className:"flex-1 max-w-full",onClick:()=>G("/my-listings"),children:"My Listings"})]})]})})]}),(c==null?void 0:c.is_business_owner)&&s.jsxs(pe,{children:[s.jsx(Ae,{children:s.jsx(Me,{children:"Accept Street Cash at your business"})}),s.jsx(ve,{children:s.jsxs("div",{className:"space-y-3",children:[s.jsx("p",{className:"text-sm text-muted-foreground text-justify",children:"Attract customers when you accept Street Cash gift cards at your location. For more information or to sign up, tap the link below."}),s.jsx("a",{href:"https://street-cash-detroit.yiftee.com/start",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center 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 bg-primary text-primary-foreground hover:bg-primary/90 h-10 px-4 py-2 w-full",children:"Sign Up"})]})})]}),(c==null?void 0:c.is_business_owner)&&s.jsxs(pe,{className:"border-2 border-primary/20",children:[s.jsxs(Ae,{children:[s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Ie,{variant:"outline",className:"text-xs",children:"Business Owner"})}),s.jsx(Me,{children:"Marketing Packages"})]}),s.jsx(ve,{children:s.jsxs("div",{className:"space-y-3",children:[s.jsx("p",{className:"text-sm text-muted-foreground text-justify",children:"Exclusive marketing packages available for business owner members. Grow your business with featured listings, media production, and more."}),s.jsx(L,{variant:"default",className:"w-full",onClick:()=>
455G("/marketing"),children:"View Marketing Packages"})]})})]}),s.jsxs(pe,{children:[s.jsx(Ae,{children:s.jsx(Me,{children:"The Street Cash Exchange"})}),s.jsx(ve,{children:s.jsx("div",{className:"space-y-4",children:s.jsxs(ht,{open:g,onOpenChange:y,children:[s.jsx(Nn,{asChild:!0,children:s.jsx(L,{variant:"destructive",className:"w-full",children:"View Rewards"})}),s.jsx("div",{className:"p-3 bg-muted rounded-lg",children:s.jsx("p",{className:"text-sm text-muted-foreground text-justify",children:"View the available rewards you can access with your reward points. Please note: Some rewards are available based on your level of membership."})}),s.jsxs(dt,{className:"max-w-[95vw] md:max-w-2xl max-h-[90vh] overflow-y-auto",children:[s.jsx(ft,{children:s.jsx(mt,{className:"text-lg md:text-xl",children:"Available Rewards"})}),s.jsxs("div",{className:"px-1 py-2 mb-2 text-sm text-muted-foreground text-justify bg-muted/30 rounded-lg",children:[s.jsx("strong",{children:"Attention:"})," The listed rewards and perks are available based on your level of membership. Rewards must be redeemed by a staff member, during an official Street Pass event. Please refer to the details of each reward for instructions."]}),s.jsxs("div",{className:"flex flex-col gap-3 py-4 w-full",children:[m.map(V=>{var tn,nn,En;const ge=(c==null?void 0:c.membership_plan_id)||1,Ne=((tn=V.membership_levels)==null?void 0:tn.includes(ge))||((nn=V.membership_levels)==null?void 0:nn.includes(ge.toString())),Pe=Qe>=V.points_cost,We=((c==null?void 0:c.redemptions)||[]).some($=>$.reward_id===V.id),xt=Ne&&Pe&&!We,Je={1:"Introductory",2:"Standard",3:"VIP",4:"Entrepreneur",5:"Executive"},on=(((En=V.membership_levels)==null?void 0:En.map($=>typeof $=="string"?parseInt($):$))||[]).map($=>Je[$]).filter(Boolean);return s.jsx(pe,{className:`w-full ${xt?"hover:shadow-md transition-shadow":"opacity-60"}`,children:s.jsx(ve,{className:"p-4",children:s.jsxs("div",{className:"w-full space-y-2",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsx("h3",{className:"text-base font-semibold leading-tight",children:V.name}),We?s.jsx(Ie,{variant:"outline",className:"text-xs bg-muted text-muted-foreground shrink-0",children:"Already Claimed"}):xt?s.jsx(Ie,{variant:"secondary",className:"text-xs shrink-0",children:"Available"}):s.jsxs(Ie,{variant:"outline",className:"text-xs shrink-0",children:["Need ",V.points_cost-Qe," more pts"]})]}),V.file_url&&s.jsx("img",{src:V.file_url,alt:`${V.name} reward image`,className:"w-full h-auto rounded-md object-cover"}),V.description&&s.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:V.description}),s.jsxs("div",{className:"flex flex-wrap gap-1 pt-1",children:[s.jsx("span",{className:"text-xs text-muted-foreground self-center",children:"Available to:"}),on.map($=>s.jsx(Ie,{variant:Ne?"secondary":"outline",className:`text-xs ${Ne?"bg-green-100 text-green-800 border-green-200":"bg-red-50 text-red-700 border-red-200"}`,children:$},$))]}),s.jsx("div",{className:"flex flex-wrap items-center justify-between gap-2 pt-1",children:s.jsxs("p",{className:"text-lg font-bold text-primary",children:[V.points_cost," points"]})}),We?s.jsx(L,{className:"w-full text-sm",size:"sm",disabled:!0,variant:"outline",children:"This reward has been claimed"}):xt?s.jsx(L,{className:"w-full text-sm",size:"sm",onClick:()=>{ae(V),se(""),T(!1),O(!1)},children:"Redeem Reward"}):null]})})},V.id)}),m.length===0&&s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No rewards available at this time."})]})]})]})})})]}),s.jsx(ht,{open:!!U,onOpenChange:V=>{V||ae(null)},children:s.jsxs(dt,{className:"sm:max-w-md",children:[s.jsx(ft,{children:s.jsx(mt,{children:"Redeem Reward"})}),_?s.jsxs("div",{className:"flex flex-col items-center gap-4 py-6",children:[s.jsx("div",{className:"text-5xl",children:"ð"}),s.jsx("p",{className:"text-lg font-semibold text-center",children:"Reward Successfully Claimed!"}),s.jsxs("p",{className:"text-sm text-muted-foreground text-center",children:["You've claimed ",s.jsx("strong",{children:U==null?void 0:U.name}),"."]}),s.jsx(L,{className:"w-full",onClick:()=>ae(null),children:"Done"})]}):s.jsxs("div",{className:"space-y-4 pt-2",children:[s.jsx("p",{className:"text-base font-medium text-foreground text-center",children:"This reward must be claimed by a retailer or a Street Pass representative."}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Q,{placeholder:"Enter 4-digit code",value:q,onChange:V=>{const ge=V.target.value.replace(/\D/g,"").slice(0,4);se(ge),T(!1)},maxLength:4,className:`text-center text-2xl tracking-widest font-mono ${D?"border-destructive":""}`,onKeyDown:V=>V.key==="Enter"&&q.length===4&&z()}),D&&s.jsx("p",{className:"text-sm text-destructive text-center",children:"Incorrect code. Please try again."})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(L,{variant:"outline",className:"flex-1",onClick:()=>ae(null),children:"Cancel"}),s.jsx(L,{className:"flex-1",onClick:z,disabled:q.length!==4,children:"Confirm"})]})]})]})}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 w-full max-w-full",children:[s.jsxs(pe,{className:"w-full",children:[s.jsx(Ae,{className:"pb-2 text-center",children:s.jsx(Me,{className:"text-sm text-muted-foreground",children:"Total Check-ins"})}),s.jsx(ve,{className:"text-center",children:s.jsx("div",{className:"text-2xl font-bold",children:vt})})]}),s.jsxs(pe,{className:"w-full",children:[s.jsx(Ae,{className:"pb-2 text-center",children:s.jsx(Me,{className:"text-sm text-muted-foreground",children:"Available Reward Points"})}),s.jsx(ve,{className:"text-center",children:s.jsx("div",{className:"text-2xl font-bold",children:Qe})})]}),s.jsxs(pe,{className:"w-full",children:[s.jsx(Ae,{className:"pb-2 text-center",children:s.jsx(Me,{className:"text-sm text-muted-foreground",children:"Referrals Used"})}),s.jsxs(ve,{className:"text-center",children:[s.jsx("div",{className:"text-2xl font-bold",children:(c==null?void 0:c.referral_count)||0}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Times your code was used"})]})]})]}),(c==null?void 0:c.membership_plan_id)&&[3,4,5].includes(c.membership_plan_id)&&s.jsx(WI,{profile:c}
455),(c==null?void 0:c.membership_plan_id)&&e&&s.jsx(_L,{userId:e.id}),vt>0&&(()=>{const V=new Date;V.setDate(V.getDate()-30);const ge=((c==null?void 0:c.checkins)||[]).filter(Ne=>{const Pe=Ne.date?new Date(Ne.date):Ne.checked_in_at?new Date(Ne.checked_in_at):null;return Pe&&Pe>=V});return ge.length>0?s.jsxs(pe,{children:[s.jsx(Ae,{children:s.jsx(Me,{children:"Recent Check-ins"})}),s.jsx(ve,{children:s.jsx("div",{className:"space-y-2",children:ge.slice(-5).reverse().map((Ne,Pe)=>s.jsxs("div",{className:"flex justify-between items-center p-2 bg-muted rounded",children:[s.jsx("span",{className:"font-medium",children:Ne.event_name}),s.jsxs("div",{className:"text-right",children:[s.jsxs("div",{className:"text-sm font-medium",children:["+",Ne.points_awarded||0," pts"]}),s.jsx("div",{className:"text-xs text-muted-foreground",children:Ne.date?new Date(Ne.date).toLocaleDateString():Ne.checked_in_at?new Date(Ne.checked_in_at).toLocaleDateString():"N/A"})]})]},Pe))})})]}):null})(),s.jsxs(pe,{children:[s.jsx(Ae,{children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Me,{children:"My Claimed Rewards"}),s.jsxs(Ie,{variant:"secondary",children:[E.length," Total"]})]})}),s.jsx(ve,{children:E.length===0?s.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[s.jsx(Eo,{className:"w-12 h-12 mx-auto mb-2 opacity-50"}),s.jsx("p",{children:"No rewards claimed yet"}),s.jsx("p",{className:"text-sm mt-1",children:"Browse rewards and start claiming!"})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"space-y-3",children:E.slice(0,3).map(V=>{var We,xt;const ge=new Date(V.expires_at),Ne=Math.ceil((ge.getTime()-Date.now())/(1e3*60*60*24)),Pe=Ne<=7&&V.status==="pending";return s.jsxs("div",{className:"p-4 bg-muted rounded-lg border",children:[s.jsxs("div",{className:"flex justify-between items-start mb-2",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"font-semibold",children:((We=V.rewards)==null?void 0:We.name)||"Reward"}),s.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[((xt=V.rewards)==null?void 0:xt.points_cost)||0," points"]})]}),s.jsx(Ie,{variant:V.status==="pending"?"secondary":V.status==="delivered"?"default":"destructive",children:V.status.charAt(0).toUpperCase()+V.status.slice(1)})]}),s.jsxs("div",{className:"text-xs text-muted-foreground space-y-1 mt-3",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Claimed:"}),s.jsx("span",{children:new Date(V.claimed_at).toLocaleDateString()})]}),V.status==="delivered"&&V.delivered_at&&s.jsxs("div",{className:"flex justify-between text-green-600",children:[s.jsx("span",{children:"Delivered:"}),s.jsx("span",{children:new Date(V.delivered_at).toLocaleDateString()})]}),V.status==="pending"&&s.jsxs("div",{className:`flex justify-between ${Pe?"text-orange-600 font-medium":""}`,children:[s.jsx("span",{children:"Expires:"}),s.jsxs("span",{children:[ge.toLocaleDateString(),Pe&&` (${Ne} days)`]})]})]}),Pe&&s.jsx("div",{className:"mt-2 p-2 bg-orange-50 border border-orange-200 rounded text-xs text-orange-800",children:"â ï¸ Expiring soon! Please contact support to arrange delivery."})]},V.id)})}),E.length>3&&s.jsxs(ht,{open:A,onOpenChange:F,children:[s.jsx(Nn,{asChild:!0,children:s.jsxs(L,{variant:"outline",className:"w-full mt-4",children:["View All Claimed Rewards (",E.length,")"]})}),s.jsxs(dt,{className:"max-w-[95vw] md:max-w-2xl max-h-[90vh] overflow-y-auto",children:[s.jsx(ft,{children:s.jsx(mt,{children:"All Claimed Rewards"})}),s.jsx("div",{className:"space-y-3 py-4",children:E.map(V=>{var We,xt;const ge=new Date(V.expires_at),Ne=Math.ceil((ge.getTime()-Date.now())/(1e3*60*60*24)),Pe=Ne<=7&&V.status==="pending";return s.jsxs("div",{className:"p-4 bg-muted rounded-lg border",children:[s.jsxs("div",{className:"flex justify-between items-start mb-2",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"font-semibold",children:((We=V.rewards)==null?void 0:We.name)||"Reward"}),s.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[((xt=V.rewards)==null?void 0:xt.points_cost)||0," points"]})]}),s.jsx(Ie,{variant:V.status==="pending"?"secondary":V.status==="delivered"?"default":"destructive",children:V.status.charAt(0).toUpperCase()+V.status.slice(1)})]}),s.jsxs("div",{className:"text-xs text-muted-foreground space-y-1 mt-3",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Claimed:"}),s.jsx("span",{children:new Date(V.claimed_at).toLocaleDateString()})]}),V.status==="delivered"&&V.delivered_at&&s.jsxs("div",{className:"flex justify-between text-green-600",children:[s.jsx("span",{children:"Delivered:"}),s.jsx("span",{children:new Date(V.delivered_at).toLocaleDateString()})]}),V.status==="pending"&&s.jsxs("div",{className:`flex justify-between ${Pe?"text-orange-600 font-medium":""}`,children:[s.jsx("span",{children:"Expires:"}),s.jsxs("span",{children:[ge.toLocaleDateString(),Pe&&` (${Ne} days)`]})]})]}),Pe&&s.jsx("div",{className:"mt-2 p-2 bg-orange-50 border border-orange-200 rounded text-xs text-orange-800",children:"â ï¸ Expiring soon! Please contact support to arrange delivery."})]},V.id)})})]})]})]})})]})]})}),e&&s.jsx("footer",{className:"pb-8 pt-2 text-center",children:s.jsx("button",{type:"button",onClick:()=>G("/deleteaccount"),className:"text-xs text-muted-foreground underline hover:text-destructive",children:"Delete Account"})})]})},SL=Ac("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),zn=h.forwardRef(({className:e,variant:t,...n},r)=>s.jsx("div",{ref:r,role:"alert",className:ke(SL({variant:t}),e),...n}));zn.displayName="Alert";const kL=h.forwardRef(({className:e,...t},n)=>s.jsx("h5",{ref:n,className:ke("mb-1 font-medium leading-none tracking-tight",e),...t}));kL.displayName="AlertTitle";const Bn=h.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ke("text-sm [&_p]:leading-relaxed",e),...t}));Bn.displayName="AlertDescription";const CL=()=>{const[e,t]=h.useState(null),[n,r]=h.useState(null),[a,i]=h.useState(!1),[o,l]=h.useState(""),[c,d]=h.useState(""),[u,f]=h.useState(""),[m,w]=h.useState(!1),[x,p]=h.useState(!1),b=Et(),{toast:v}=_t();h.useEffect(()=>{const j=new URL(window.location.href),N=j.searchParams,k=new URLSearchParams(window.location.hash.replace(/^#/,""));if(N.get("code")!==null||N.get("token_hash")!==null||k.get("access_token")!==null||k.get("refresh_token")!==null||(N.get("type")??k.get("type"))==="signup"){window.location.replace(`/auth/confirm${j.search}${j.hash}`);return}const{data:{subscription:E}}=R.auth.onAuthStateChange((H,A)=>{r(A),t((A==null?void 0:A.user)??null),H==="SIGNED_IN"&&(A!=null&&A.user)&&setTimeout(()=>{window.location.href="/"},0)});return R.auth.getSession().then(({data:{session:H}})=>{r(H),t((H==null?void 0:H.user)??null),H!=null&&H.user&&b("/")}),()=>E.unsubscribe()},[b]);const g=async j=>{if(j.preventDefault(),!o||!c){f("Please fill in all fields");return}i(!0),f("");try{try{await R.auth.signOut({scope:"local"})}catch{}const{data:N,error:k}=await R.auth.signInWithPassword({email:o,password:c});if(k){k.message.includes("Invalid login credentials")?f("Invalid email or password. Please check your credentials and try again."):f(k.message);return}N.user&&(v({title:"Welcome back!",description:"You have successfully signed in."}),window.location.href="/")}catch(N){f(N.message||"An unexpected error occurred")}finally{i(!1)}},y=async()=>
455{if(!o){f("Please enter your email address first");return}i(!0),f("");try{const j=`${window.location.origin}/reset-password`,{error:N}=await R.auth.resetPasswordForEmail(o,{redirectTo:j});if(N){f(N.message);return}p(!0),v({title:"Reset email sent",description:"Check your email for a link to reset your password."})}catch(j){f(j.message||"An unexpected error occurred")}finally{i(!1)}};return e?s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h1",{className:"text-2xl font-bold mb-4",children:"You are already signed in"}),s.jsx(L,{onClick:()=>b("/"),children:"Go to Dashboard"})]})}):s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:s.jsxs(pe,{className:"w-full max-w-md",children:[s.jsxs(Ae,{children:[s.jsx(Me,{className:"text-2xl text-center text-primary",children:"The Street Pass"}),s.jsx(St,{className:"text-center",children:"Sign in to your account to Check-in and start earning Street Cash reward points."})]}),s.jsxs(ve,{children:[s.jsxs("form",{onSubmit:g,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"signin-email",children:"Email"}),s.jsx(Q,{id:"signin-email",type:"email",value:o,onChange:j=>l(j.target.value),placeholder:"Enter your email",autoComplete:"email",required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"signin-password",children:"Password"}),s.jsxs("div",{className:"relative",children:[s.jsx(Q,{id:"signin-password",type:m?"text":"password",value:c,onChange:j=>d(j.target.value),placeholder:"Enter your password",autoComplete:"current-password",required:!0,className:"pr-10"}),s.jsx("button",{type:"button",onClick:()=>w(!m),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:m?s.jsx(ui,{className:"h-4 w-4"}):s.jsx(Os,{className:"h-4 w-4"})})]})]}),x&&s.jsx(zn,{children:s.jsx(Bn,{children:"Password reset email sent! Check your inbox for instructions."})}),u&&s.jsx(zn,{variant:"destructive",children:s.jsx(Bn,{children:u})}),s.jsx(L,{type:"submit",className:"w-full",disabled:a,children:a?"Signing in...":"Sign In"}),s.jsx("button",{type:"button",onClick:y,className:"w-full text-sm text-primary hover:underline text-center",disabled:a,children:"Forgot your password?"})]}),s.jsxs("p",{className:"mt-6 text-center text-sm text-muted-foreground",children:["Don't have an account?"," ",s.jsx(Es,{to:"/sign-up",className:"text-primary font-medium hover:underline",children:"Sign Up"})]})]})]})})};var hv="Switch",[EL,q6]=Hr(hv),[PL,TL]=EL(hv),Q1=h.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:a,defaultChecked:i,required:o,disabled:l,value:c="on",onCheckedChange:d,form:u,...f}=e,[m,w]=h.useState(null),x=wt(t,y=>w(y)),p=h.useRef(!1),b=m?u||!!m.closest("form"):!0,[v=!1,g]=cs({prop:a,defaultProp:i,onChange:d});return s.jsxs(PL,{scope:n,checked:v,disabled:l,children:[s.jsx(Ye.button,{type:"button",role:"switch","aria-checked":v,"aria-required":o,"data-state":eS(v),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:x,onClick:Le(e.onClick,y=>{g(j=>!j),b&&(p.current=y.isPropagationStopped(),p.current||y.stopPropagation())})}),b&&s.jsx(RL,{control:m,bubbles:!p.current,name:r,value:c,checked:v,required:o,disabled:l,form:u,style:{transform:"translateX(-100%)"}})]})});Q1.displayName=hv;var J1="SwitchThumb",X1=h.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=TL(J1,n);return s.jsx(Ye.span,{"data-state":eS(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});X1.displayName=J1;var RL=e=>{const{control:t,checked:n,bubbles:r=!0,...a}=e,i=h.useRef(null),o=Ph(n),l=dh(t);return h.useEffect(()=>{const c=i.current,d=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(d,"checked").set;if(o!==n&&f){const m=new Event("click",{bubbles:r});f.call(c,n),c.dispatchEvent(m)}},[o,n,r]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:i,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function eS(e){return e?"checked":"unchecked"}var tS=Q1,DL=X1;const ca=h.forwardRef(({className:e,...t},n)=>s.jsx(tS,{className:ke("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors 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 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:s.jsx(DL,{className:ke("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")})}
455));ca.displayName=tS.displayName;const fv="/assets/streetpass-signup-header-B5_DXGJ7.jpg",OL=()=>{const[e,t]=h.useState(null),[n,r]=h.useState(null),[a,i]=h.useState(!1),[o,l]=h.useState(""),[c,d]=h.useState(""),[u,f]=h.useState(""),[m,w]=h.useState(""),[x,p]=h.useState(""),[b,v]=h.useState(""),[g,y]=h.useState(""),[j,N]=h.useState(""),[k,C]=h.useState(!1),[E,H]=h.useState(""),[A,F]=h.useState(""),[U,ae]=h.useState(""),[q,se]=h.useState(""),[D,T]=h.useState(""),[_,O]=h.useState(""),[G,Y]=h.useState(""),[oe,M]=h.useState(""),[I,he]=h.useState(!1),[X,K]=h.useState(!1),P=Et();_t();const[Z]=Wg();h.useEffect(()=>{let z=Z.get("ref")||Z.get("referral")||"";if(!z)try{z=localStorage.getItem("streetpass_referral_code")||""}catch{z=""}z&&y(z.trim())},[Z]),h.useEffect(()=>{R.auth.getSession().then(({data:{session:z}})=>{r(z),t((z==null?void 0:z.user)??null),z!=null&&z.user&&P("/")})},[P]);const ee=()=>{Object.keys(localStorage).forEach(z=>{(z.startsWith("supabase.auth.")||z.includes("sb-"))&&localStorage.removeItem(z)}),Object.keys(sessionStorage||{}).forEach(z=>{(z.startsWith("supabase.auth.")||z.includes("sb-"))&&sessionStorage.removeItem(z)})},le=async z=>{if(z.preventDefault(),!o||!c||!u||!m){M("Please fill in all required fields");return}if(c!==u){M("Passwords do not match");return}if(c.length<6){M("Password must be at least 6 characters long");return}i(!0),M("");try{ee();const{data:_e,error:ue}=await R.auth.signUp({email:o,password:c,options:{emailRedirectTo:`${window.location.origin}/auth/confirm`,data:{name:m,phone_number:b||null,resident_city:x||null,referral_code:g||null,fundraiser_code:j||null,is_business_owner:k,business_name:k&&E?E:null,business_address:k&&A||null,business_phone:k&&U||null,business_website:k&&q||null,business_city:k&&D||null,business_state:k&&_||null,business_zip:k&&G||null}}});if(ue){ue.message.includes("User already registered")?M("An account with this email already exists. Please sign in instead."):M(ue.message);return}if(_e.user){try{localStorage.removeItem("streetpass_referral_code")}catch{}await R.auth.signOut({scope:"local"}),P("/email-verified")}}catch(_e){M(_e.message||"An unexpected error occurred")}finally{i(!1)}};return e?s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h1",{className:"text-2xl font-bold mb-4",children:"You are already signed in"}),s.jsx(L,{onClick:()=>P("/"),children:"Go to Dashboard"})]})}):s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:s.jsxs(pe,{className:"w-full max-w-md overflow-hidden",children:[s.jsx("img",{src:fv,alt:"The Street Pass",className:"w-full h-auto"}),s.jsxs(Ae,{children:[s.jsx(Me,{className:"text-2xl text-center text-primary",children:"Sign up now!"}),s.jsx(St,{className:"text-justify",children:"Get The Street Pass introductory Membership for FREE! As a member you will receive email communications from The Street Pass Mktg co., including newsletters and promotional messages. You may opt out at any time via the unsubscribe link in our emails."}),s.jsxs("p",{className:"text-xs text-muted-foreground text-justify mt-2",children:["See our ",s.jsx("a",{href:"/privacy",className:"text-primary font-medium hover:underline",children:"Privacy Policy"})," and Terms of Service for details on how we use and protect your information."]})]}),s.jsxs(ve,{children:[s.jsxs("form",{onSubmit:le,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"signup-name",children:"Name"}),s.jsx(Q,{id:"signup-name",type:"text",value:m,onChange:z=>w(z.target.value),placeholder:"Enter your full name",autoComplete:"name",required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"resident-city",children:"Resident City"}),s.jsx(Q,{id:"resident-city",type:"text",value:x,onChange:z=>p(z.target.value),placeholder:"Enter your city",autoComplete:"address-level2"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"signup-email",children:"Email"}),s.jsx(Q,{id:"signup-email",type:"email",value:o,onChange:z=>l(z.target.value),placeholder:"Enter your email",autoComplete:"email",required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"mobile-number",children:"Mobile Number"}),s.jsx(Q,{id:"mobile-number",type:"tel",value:b,onChange:z=>v(z.target.value),placeholder:"Enter your mobile number",autoComplete:"tel"}),s.jsx("p",{className:"text-xs text-muted-foreground text-justify",children:"By providing your mobile phone number, you consent to receive text messages from us about events and other promotions. Reply HELP for help, and STOP to opt-out. Msg&Data Rates May Apply. SMS SHARING DISCLOSURE: No mobile data will be shared with third parties/affiliates for marketing/promotional purposes at any time."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"signup-password",children:"Password"}),s.jsxs("div",{className:"relative",children:[s.jsx(Q,{id:"signup-password",type:I?"text":"password",value:c,onChange:z=>d(z.target.value),placeholder:"Create a password (min 6 characters)",autoComplete:"new-password",required:!0,className:"pr-10"}),s.jsx("button",{type:"button",onClick:()=>he(!I),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:I?s.jsx(ui,{className:"h-4 w-4"}):s.jsx(Os,{className:"h-4 w-4"})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"confirm-password",children:"Confirm Password"}),s.jsxs("div",{className:"relative",children:[s.jsx(Q,{id:"confirm-password",type:X?"text":"password",value:u,onChange:z=>f(z.target.value),placeholder:"Confirm your password",autoComplete:"new-password",required:!0,className:"pr-10"}),s.jsx("button",{type:"button",onClick:()=>K(!X),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:X?s.jsx(ui,{className:"h-4 w-4"}):s.jsx(Os,{className:"h-4 w-4"})})]})]}),s.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-4",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(B,{htmlFor:"business-owner-toggle",className:"text-sm font-medium",children:"Are you a business owner?"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Get access to add your business to the directory and view sponsorship/marketing packages."})]}),s.jsx(ca,{id:"business-owner-toggle",checked:k,onCheckedChange:C})]}),k&&s.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[s.jsx("p",{className:"text-sm font-medium",children:"Business Information"}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"business-name",children:"Business N
455ame"}),s.jsx(Q,{id:"business-name",type:"text",value:E,onChange:z=>H(z.target.value),placeholder:"Enter your business name",autoComplete:"organization"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"business-address",children:"Address"}),s.jsx(Q,{id:"business-address",type:"text",value:A,onChange:z=>F(z.target.value),placeholder:"Street address",autoComplete:"street-address"})]}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"business-city",children:"City"}),s.jsx(Q,{id:"business-city",type:"text",value:D,onChange:z=>T(z.target.value),placeholder:"City",autoComplete:"address-level2"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"business-state",children:"State"}),s.jsx(Q,{id:"business-state",type:"text",value:_,onChange:z=>O(z.target.value),placeholder:"State",autoComplete:"address-level1"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"business-zip",children:"Zip Code"}),s.jsx(Q,{id:"business-zip",type:"text",inputMode:"numeric",value:G,onChange:z=>Y(z.target.value),placeholder:"Zip",autoComplete:"postal-code"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"business-phone",children:"Business Phone Number"}),s.jsx(Q,{id:"business-phone",type:"tel",value:U,onChange:z=>ae(z.target.value),placeholder:"Business phone number",autoComplete:"tel"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"business-website",children:"Website"}),s.jsx(Q,{id:"business-website",type:"text",value:q,onChange:z=>se(z.target.value),placeholder:"https://yourbusiness.com",autoComplete:"url"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"fundraiser-code",children:"Fundraiser Code (Optional)"}),s.jsx(Q,{id:"fundraiser-code",type:"text",value:j,onChange:z=>N(z.target.value),placeholder:"Enter fundraiser organization code",autoComplete:"off"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"If you were referred by a nonprofit fundraiser, enter the
455ir code here."})]}),oe&&s.jsx(zn,{variant:"destructive",children:s.jsx(Bn,{children:oe})}),s.jsx(L,{type:"submit",className:"w-full",disabled:a,children:a?"Creating account...":"Sign Up"})]}),s.jsxs("p",{className:"mt-6 text-center text-sm text-muted-foreground",children:["Already have an account?"," ",s.jsx(Es,{to:"/sign-in",className:"text-primary font-medium hover:underline",children:"Sign In"})]})]})]})})};var mv="Tabs",[AL,Y6]=Hr(mv,[Ah]),nS=Ah(),[ML,pv]=AL(mv),rS=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:o="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=Eh(l),[f,m]=cs({prop:r,onChange:a,defaultProp:i});return s.jsx(ML,{scope:n,baseId:Cs(),value:f,onValueChange:m,orientation:o,dir:u,activationMode:c,children:s.jsx(Ye.div,{dir:u,"data-orientation":o,...d,ref:t})})});rS.displayName=mv;var sS="TabsList",aS=h.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=pv(sS,n),o=nS(n);return s.jsx(A1,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:s.jsx(Ye.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});aS.displayName=sS;var iS="TabsTrigger",oS=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,o=pv(iS,n),l=nS(n),c=dS(o.baseId,r),d=uS(o.baseId,r),u=r===o.value;return s.jsx(M1,{asChild:!0,...l,focusable:!a,active:u,children:s.jsx(Ye.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:c,...i,ref:t,onMouseDown:Le(e.onMouseDown,f=>{!a&&f.button===0&&f.ctrlKey===!1?o.onValueChange(r):f.preventDefault()}),onKeyDown:Le(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(r)}),onFocus:Le(e.onFocus,()=>{const f=o.activationMode!=="manual";!u&&!a&&f&&o.onValueChange(r)})})})});oS.displayName=iS;var lS="TabsContent",cS=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:i,...o}=e,l=pv(lS,n),c=dS(l.baseId,r),d=uS(l.baseId,r),u=r===l.value,f=h.useRef(u);return h.useEffect(()=>{const m=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(m)},[]),s.jsx(qr,{present:a||u,children:({present:m})=>s.jsx(Ye.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:d,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:m&&i})})});cS.displayName=lS;function dS(e,t){return`${e}-trigger-${t}`}function uS(e,t){return`${e}-content-${t}`}var IL=rS,hS=aS,fS=oS,mS=cS;const pS=IL,gv=h.forwardRef(({className:e,...t},n)=>s.jsx(hS,{ref:n,className:ke("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));gv.displayName=hS.displayName;const Xn=h.forwardRef(({className:e,...t},n)=>s.jsx(fS,{ref:n,className:ke("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Xn.displayName=fS.displayName;const er=h.forwardRef(({className:e,...t},n)=>s.jsx(mS,{ref:n,className:ke("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));er.displayName=mS.displayName;var yt;(function(e){e.assertEqual=a=>a;function t(a){}e.assertIs=t;function n(a){throw new Error}e.assertNever=n,e.arrayToEnum=a=>{const i={};for(const o of a)i[o]=o;return i},e.getValidEnumValues=a=>{const i=e.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),o={};for(const l of i)o[l]=a[l];return e.objectValues(o)},e.objectValues=a=>e.objectKeys(a).map(function(i){return a[i]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},e.find=(a,i)=>{for(const o of a)if(i(o))return o}
vendor: 5,779 bytes, line 455
455,e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function r(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(yt||(yt={}));var yp;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(yp||(yp={}));const Te=yt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Xs=e=>{switch(typeof e){case"undefined":return Te.undefined;case"string":return Te.string;case"number":return isNaN(e)?Te.nan:Te.number;case"boolean":return Te.boolean;case"function":return Te.function;case"bigint":return Te.bigint;case"symbol":return Te.symbol;case"object":return Array.isArray(e)?Te.array:e===null?Te.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Te.promise:typeof Map<"u"&&e instanceof Map?Te.map:typeof Set<"u"&&e instanceof Set?Te.set:typeof Date<"u"&&e instanceof Date?Te.date:Te.object;default:return Te.unknown}},ye=yt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),LL=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class or extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(i){return i.message},r={_errors:[]},a=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let l=r,c=0;for(;c<o.path.length;){const d=o.path[c];c===o.path.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(n(o))):l[d]=l[d]||{_errors:[]},l=l[d],c++}}};return a(this),r}static assert(t){if(!(t instanceof or))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,yt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const a of this.issues)a.path.length>0?(n[a.path[0]]=n[a.path[0]]||[],n[a.path[0]].push(t(a))):r.push(t(a));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}or.create=e=>new or(e);const Oo=(e,t)=>{let n;switch(e.code){case ye.invalid_type:e.received===Te.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case ye.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,yt.jsonStringifyReplacer)}`;break;case ye.unrecognized_keys:n=`Unrecognized key(s) in object: ${yt.joinValues(e.keys,", ")}`;break;case ye.invalid_union:n="Invalid input";break;case ye.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${yt.joinValues(e.options)}`;break;case ye.invalid_enum_value:n=`Invalid enum value. Expected ${yt.joinValues(e.options)}, received '${e.received}'`;break;case ye.invalid_arguments:n="Invalid function arguments";break;case ye.invalid_return_type:n="Invalid function return type";break;case ye.invalid_date:n="Invalid date";break;case ye.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:yt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case ye.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case ye.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case ye.custom:n="Invalid input";break;case ye.invalid_intersection_types:n="Intersection results could not be merged";break;case ye.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ye.not_finite:n="Number must be finite";break;default:n=t.defaultError,yt.assertNever(e)}return{message:n}};let gS=Oo;function $L(e){gS=e}function Ru(){return gS}const Du=e=>
vendor: 7,035 bytes, line 455
455{const{data:t,path:n,errorMaps:r,issueData:a}=e,i=[...n,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let l="";const c=r.filter(d=>!!d).slice().reverse();for(const d of c)l=d(o,{data:t,defaultError:l}).message;return{...a,path:i,message:l}},FL=[];function Ee(e,t){const n=Ru(),r=Du({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Oo?void 0:Oo].filter(a=>!!a)});e.common.issues.push(r)}class Cn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const a of n){if(a.status==="aborted")return Ze;a.status==="dirty"&&t.dirty(),r.push(a.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const a of n){const i=await a.key,o=await a.value;r.push({key:i,value:o})}return Cn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const a of n){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return Ze;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(r[i.value]=o.value)}return{status:t.value,value:r}}}const Ze=Object.freeze({status:"aborted"}),Qi=e=>({status:"dirty",value:e}),An=e=>({status:"valid",value:e}),wp=e=>e.status==="aborted",bp=e=>e.status==="dirty",ic=e=>e.status==="valid",oc=e=>typeof Promise<"u"&&e instanceof Promise;function Ou(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function vS(e,t,n,r,a){if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var ze;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(ze||(ze={}));var xl,yl;class us{constructor(t,n,r,a){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const dw=(e,t)=>{if(ic(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new or(e.common.issues);return this._error=n,this._error}}};function nt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:a}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(o,l)=>{var c,d;const{message:u}=e;return o.code==="invalid_enum_value"?{message:u??l.defaultError}:typeof l.data>"u"?{message:(c=u??r)!==null&&c!==void 0?c:l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:(d=u??n)!==null&&d!==void 0?d:l.defaultError}},description:a}}class ot{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Xs(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Xs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Cn,ctx:{common:t.parent.common,data:t.data,parsedType:Xs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(oc(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const a={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Xs(t)},i=this._parseSync({data:t,path:a.path,parent:a});return dw(a,i)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Xs(t)},a=this._parse({data:t,path:r.path,parent:r}),i=await(oc(a)?a:Promise.resolve(a));return dw(r,i)}refine(t,n){const r=a=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(a):n;return this._refinement((a,i)=>{const o=t(a),l=()=>i.addIssue({code:ye.custom,...r(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(t,n){return this._refinement((r,a)=>t(r)?!0:(a.addIssue(typeof n=="function"?n(r,a):n),!1))}_refinement(t){return new Br({schema:this,typeName:qe.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return ls.create(this,this._def)}nullable(){return Ta.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Lr.create(this,this._def)}promise(){return Mo.create(this,this._def)}or(t){return uc.create([this,t],this._def)}and(t){return hc.create(this,t,this._def)}transform(t){return new Br({...nt(this._def),schema:this,typeName:qe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new vc({...nt(this._def),innerType:this,defaultValue:n,typeName:qe.ZodDefault})}brand(){return new vv({typeName:qe.ZodBranded,type:this,...nt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new xc({...nt(this._def),innerType:this,catchValue:n,typeName:qe.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Bc.create(this,t)}readonly(){return yc.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const UL=/^c[^\s-]{8,}
vendor: 44,287 bytes, line 455
455$/i,zL=/^[0-9a-z]+$/,BL=/^[0-9A-HJKMNP-TV-Z]{26}$/,VL=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,WL=/^[a-z0-9_-]{21}$/i,HL=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,qL=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,YL="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let If;const GL=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,KL=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ZL=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,xS="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",QL=new RegExp(`^${xS}$`);function yS(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function JL(e){return new RegExp(`^${yS(e)}$`)}function wS(e){let t=`${xS}T${yS(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function XL(e,t){return!!((t==="v4"||!t)&&GL.test(e)||(t==="v6"||!t)&&KL.test(e))}class Dr extends ot{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Te.string){const i=this._getOrReturnCtx(t);return Ee(i,{code:ye.invalid_type,expected:Te.string,received:i.parsedType}),Ze}const r=new Cn;let a;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(a=this._getOrReturnCtx(t,a),Ee(a,{code:ye.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(a=this._getOrReturnCtx(t,a),Ee(a,{code:ye.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const o=t.data.length>i.value,l=t.data.length<i.value;(o||l)&&(a=this._getOrReturnCtx(t,a),o?Ee(a,{code:ye.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&Ee(a,{code:ye.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")qL.test(t.data)||(a=this._getOrReturnCtx(t,a),Ee(a,{validation:"email",code:ye.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")If||(If=new RegExp(YL,"u")),If.test(t.data)||(a=this._getOrReturnCtx(t,a),Ee(a,{validation:"emoji",code:ye.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")VL.test(t.data)||(a=this._getOrReturnCtx(t,a),Ee(a,{validation:"uuid",code:ye.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")WL.test(t.data)||(a=this._getOrReturnCtx(t,a),Ee(a,{validation:"nanoid",code:ye.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")UL.test(t.data)||(a=this._getOrReturnCtx(t,a),Ee(a,{validation:"cuid",code:ye.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")zL.test(t.data)||(a=this._getOrReturnCtx(t,a),Ee(a,{validation:"cuid2",code:ye.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")BL.test(t.data)||(a=this._getOrReturnCtx(t,a),Ee(a,{validation:"ulid",code:ye.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),Ee(a,{validation:"url",code:ye.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),Ee(a,{validation:"regex",code:ye.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(t,a),Ee(a,{code:ye.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(a=this._getOrReturnCtx(t,a),Ee(a,{code:ye.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(a=this._getOrReturnCtx(t,a),Ee(a,{code:ye.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?wS(i).test(t.data)||(a=this._getOrReturnCtx(t,a),Ee(a,{code:ye.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?QL.test(t.data)||(a=this._getOrReturnCtx(t,a),Ee(a,{code:ye.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?JL(i).test(t.data)||(a=this._getOrReturnCtx(t,a),Ee(a,{code:ye.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?HL.test(t.data)||(a=this._getOrReturnCtx(t,a),Ee(a,{validation:"duration",code:ye.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?XL(t.data,i.version)||(a=this._getOrReturnCtx(t,a),Ee(a,{validation:"ip",code:ye.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?ZL.test(t.data)||(a=this._getOrReturnCtx(t,a),Ee(a,{validation:"base64",code:ye.invalid_string,message:i.message}),r.dirty()):yt.assertNever(i);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(a=>t.test(a),{validation:n,code:ye.invalid_string,...ze.errToObj(r)})}_addCheck(t){return new Dr({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ze.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ze.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ze.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ze.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ze.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ze.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ze.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ze.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ze.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ze.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...ze.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...ze.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...ze.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...ze.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...ze.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...ze.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...ze.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...ze.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...ze.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...ze.errToObj(n)})}nonempty(t){return this.min(1,ze.errToObj(t))}trim(){return new Dr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Dr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Dr({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Dr.create=e=>{var t;return new Dr({checks:[],typeName:qe.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...nt(e)})};function e5(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r,i=parseInt(e.toFixed(a).replace(".","")),o=parseInt(t.toFixed(a).replace(".",""));return i%o/Math.pow(10,a)}class Ca extends ot{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Te.number){const i=this._getOrReturnCtx(t);return Ee(i,{code:ye.invalid_type,expected:Te.number,received:i.parsedType}),Ze}let r;const a=new Cn;for(const i of this._def.checks)i.kind==="int"?yt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Ee(r,{code:ye.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),Ee(r,{code:ye.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),Ee(r,{code:ye.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?e5(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),Ee(r,{code:ye.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Ee(r,{code:ye.not_finite,message:i.message}),a.dirty()):yt.assertNever(i);return{status:a.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ze.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ze.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ze.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ze.toString(n))}setLimit(t,n,r,a){return new Ca({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ze.toString(a)}]})}_addCheck(t){return new Ca({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ze.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ze.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ze.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ze.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ze.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ze.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:ze.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ze.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ze.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&yt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Ca.create=e=>new Ca({checks:[],typeName:qe.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...nt(e)});class Ea extends ot{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Te.bigint){const i=this._getOrReturnCtx(t);return Ee(i,{code:ye.invalid_type,expected:Te.bigint,received:i.parsedType}),Ze}let r;const a=new Cn;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),Ee(r,{code:ye.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),Ee(r,{code:ye.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Ee(r,{code:ye.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):yt.assertNever(i);return{status:a.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ze.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ze.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ze.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ze.toString(n))}setLimit(t,n,r,a){return new Ea({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ze.toString(a)}]})}_addCheck(t){return new Ea({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ze.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ze.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ze.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ze.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ze.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ea.create=e=>{var t;return new Ea({checks:[],typeName:qe.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...nt(e)})};class lc extends ot{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Te.boolean){const r=this._getOrReturnCtx(t);return Ee(r,{code:ye.invalid_type,expected:Te.boolean,received:r.parsedType}),Ze}return An(t.data)}}lc.create=e=>new lc({typeName:qe.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...nt(e)});class gi extends ot{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Te.date){const i=this._getOrReturnCtx(t);return Ee(i,{code:ye.invalid_type,expected:Te.date,received:i.parsedType}),Ze}if(isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return Ee(i,{code:ye.invalid_date}),Ze}const r=new Cn;let a;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(a=this._getOrReturnCtx(t,a),Ee(a,{code:ye.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(a=this._getOrReturnCtx(t,a),Ee(a,{code:ye.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):yt.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new gi({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:ze.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:ze.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}gi.create=e=>new gi({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:qe.ZodDate,...nt(e)});class Au extends ot{_parse(t){if(this._getType(t)!==Te.symbol){const r=this._getOrReturnCtx(t);return Ee(r,{code:ye.invalid_type,expected:Te.symbol,received:r.parsedType}),Ze}return An(t.data)}}Au.create=e=>new Au({typeName:qe.ZodSymbol,...nt(e)});class cc extends ot{_parse(t){if(this._getType(t)!==Te.undefined){const r=this._getOrReturnCtx(t);return Ee(r,{code:ye.invalid_type,expected:Te.undefined,received:r.parsedType}),Ze}return An(t.data)}}cc.create=e=>new cc({typeName:qe.ZodUndefined,...nt(e)});class dc extends ot{_parse(t){if(this._getType(t)!==Te.null){const r=this._getOrReturnCtx(t);return Ee(r,{code:ye.invalid_type,expected:Te.null,received:r.parsedType}),Ze}return An(t.data)}}dc.create=e=>new dc({typeName:qe.ZodNull,...nt(e)});class Ao extends ot{constructor(){super(...arguments),this._any=!0}_parse(t){return An(t.data)}}Ao.create=e=>new Ao({typeName:qe.ZodAny,...nt(e)});class ri extends ot{constructor(){super(...arguments),this._unknown=!0}_parse(t){return An(t.data)}}ri.create=e=>new ri({typeName:qe.ZodUnknown,...nt(e)});class Is extends ot{_parse(t){const n=this._getOrReturnCtx(t);return Ee(n,{code:ye.invalid_type,expected:Te.never,received:n.parsedType}),Ze}}Is.create=e=>new Is({typeName:qe.ZodNever,...nt(e)});class Mu extends ot{_parse(t){if(this._getType(t)!==Te.undefined){const r=this._getOrReturnCtx(t);return Ee(r,{code:ye.invalid_type,expected:Te.void,received:r.parsedType}),Ze}return An(t.data)}}Mu.create=e=>new Mu({typeName:qe.ZodVoid,...nt(e)});class Lr extends ot{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),a=this._def;if(n.parsedType!==Te.array)return Ee(n,{code:ye.invalid_type,expected:Te.array,received:n.parsedType}),Ze;if(a.exactLength!==null){const o=n.data.length>a.exactLength.value,l=n.data.length<a.exactLength.value;(o||l)&&(Ee(n,{code:o?ye.too_big:ye.too_small,minimum:l?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&n.data.length<a.minLength.value&&(Ee(n,{code:ye.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&n.data.length>a.maxLength.value&&(Ee(n,{code:ye.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,l)=>a.type._parseAsync(new us(n,o,n.path,l)))).then(o=>Cn.mergeArray(r,o));const i=[...n.data].map((o,l)=>a.type._parseSync(new us(n,o,n.path,l)));return Cn.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new Lr({...this._def,minLength:{value:t,message:ze.toString(n)}})}max(t,n){return new Lr({...this._def,maxLength:{value:t,message:ze.toString(n)}})}length(t,n){return new Lr({...this._def,exactLength:{value:t,message:ze.toString(n)}})}nonempty(t){return this.min(1,t)}}Lr.create=(e,t)=>new Lr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:qe.ZodArray,...nt(t)});function $i(e){if(e instanceof Gt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=ls.create($i(r))}return new Gt({...e._def,shape:()=>t})}else return e instanceof Lr?new Lr({...e._def,type:$i(e.element)}):e instanceof ls?ls.create($i(e.unwrap())):e instanceof Ta?Ta.create($i(e.unwrap())):e instanceof hs?hs.create(e.items.map(t=>$i(t))):e}class Gt extends ot{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=yt.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==Te.object){const d=this._getOrReturnCtx(t);return Ee(d,{code:ye.invalid_type,expected:Te.object,received:d.parsedType}),Ze}const{status:r,ctx:a}=this._processInputParams(t),{shape:i,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof Is&&this._def.unknownKeys==="strip"))for(const d in a.data)o.includes(d)||l.push(d);const c=[];for(const d of o){const u=i[d],f=a.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new us(a,f,a.path,d)),alwaysSet:d in a.data})}if(this._def.catchall instanceof Is){const d=this._def.unknownKeys;if(d==="passthrough")for(const u of l)c.push({key:{status:"valid",value:u},value:{status:"valid",value:a.data[u]}});else if(d==="strict")l.length>0&&(Ee(a,{code:ye.unrecognized_keys,keys:l}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const u of l){const f=a.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new us(a,f,a.path,u)),alwaysSet:u in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const d=[];for(const u of c){const f=await u.key,m=await u.value;d.push({key:f,value:m,alwaysSet:u.alwaysSet})}return d}).then(d=>Cn.mergeObjectSync(r,d)):Cn.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return ze.errToObj,new Gt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var a,i,o,l;const c=(o=(i=(a=this._def).errorMap)===null||i===void 0?void 0:i.call(a,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(l=ze.errToObj(t).message)!==null&&l!==void 0?l:c}:{message:c}}}:{}})}strip(){return new Gt({...this._def,unknownKeys:"strip"})}passthrough(){return new Gt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Gt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Gt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:qe.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Gt({...this._def,catchall:t})}pick(t){const n={};return yt.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Gt({...this._def,shape:()=>n})}omit(t){const n={};return yt.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Gt({...this._def,shape:()=>n})}deepPartial(){return $i(this)}partial(t){const n={};return yt.objectKeys(this.shape).forEach(r=>{const a=this.shape[r];t&&!t[r]?n[r]=a:n[r]=a.optional()}),new Gt({...this._def,shape:()=>n})}required(t){const n={};return yt.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof ls;)i=i._def.innerType;n[r]=i}}),new Gt({...this._def,shape:()=>n})}keyof(){return bS(yt.objectKeys(this.shape))}}Gt.create=(e,t)=>new Gt({shape:()=>e,unknownKeys:"strip",catchall:Is.create(),typeName:qe.ZodObject,...nt(t)});Gt.strictCreate=(e,t)=>new Gt({shape:()=>e,unknownKeys:"strict",catchall:Is.create(),typeName:qe.ZodObject,...nt(t)});Gt.lazycreate=(e,t)=>new Gt({shape:e,unknownKeys:"strip",catchall:Is.create(),typeName:qe.ZodObject,...nt(t)});class uc extends ot{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function a(i){for(const l of i)if(l.result.status==="valid")return l.result;for(const l of i)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const o=i.map(l=>new or(l.ctx.common.issues));return Ee(n,{code:ye.invalid_union,unionErrors:o}),Ze}if(n.common.async)return Promise.all(r.map(async i=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(a);{let i;const o=[];for(const c of r){const d={...n,common:{...n.common,issues:[]},parent:null},u=c._parseSync({data:n.data,path:n.path,parent:d});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:d}),d.common.issues.length&&o.push(d.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const l=o.map(c=>new or(c));return Ee(n,{code:ye.invalid_union,unionErrors:l}),Ze}}get options(){return this._def.options}}uc.create=(e,t)=>new uc({options:e,typeName:qe.ZodUnion,...nt(t)});const ys=e=>e instanceof mc?ys(e.schema):e instanceof Br?ys(e.innerType()):e instanceof pc?[e.value]:e instanceof Pa?e.options:e instanceof gc?yt.objectValues(e.enum):e instanceof vc?ys(e._def.innerType):e instanceof cc?[void 0]:e instanceof dc?[null]:e instanceof ls?[void 0,...ys(e.unwrap())]:e instanceof Ta?[null,...ys(e.unwrap())]:e instanceof vv||e instanceof yc?ys(e.unwrap()):e instanceof xc?ys(e._def.innerType):[];class Mh extends ot{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Te.object)return Ee(n,{code:ye.invalid_type,expected:Te.object,received:n.parsedType}),Ze;const r=this.discriminator,a=n.data[r],i=this.optionsMap.get(a);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(Ee(n,{code:ye.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Ze)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const a=new Map;for(const i of n){const o=ys(i.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const l of o){if(a.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);a.set(l,i)}}return new Mh({typeName:qe.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:a,...nt(r)})}}function jp(e,t){const n=Xs(e),r=Xs(t);if(e===t)return{valid:!0,data:e};if(n===Te.object&&r===Te.object){const a=yt.objectKeys(t),i=yt.objectKeys(e).filter(l=>a.indexOf(l)!==-1),o={...e,...t};for(const l of i){const c=jp(e[l],t[l]);if(!c.valid)return{valid:!1};o[l]=c.data}return{valid:!0,data:o}}else if(n===Te.array&&r===Te.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let i=0;i<e.length;i++){const o=e[i],l=t[i],c=jp(o,l);if(!c.valid)return{valid:!1};a.push(c.data)}return{valid:!0,data:a}}else return n===Te.date&&r===Te.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class hc extends ot{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=(i,o)=>{if(wp(i)||wp(o))return Ze;const l=jp(i.value,o.value);return l.valid?((bp(i)||bp(o))&&n.dirty(),{status:n.value,value:l.data}):(Ee(r,{code:ye.invalid_intersection_types}),Ze)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}hc.create=(e,t,n)=>new hc({left:e,right:t,typeName:qe.ZodIntersection,...nt(n)});class hs extends ot{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Te.array)return Ee(r,{code:ye.invalid_type,expected:Te.array,received:r.parsedType}),Ze;if(r.data.length<this._def.items.length)return Ee(r,{code:ye.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ze;!this._def.rest&&r.data.length>this._def.items.length&&(Ee(r,{code:ye.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((o,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new us(r,o,r.path,l)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>Cn.mergeArray(n,o)):Cn.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new hs({...this._def,rest:t})}}hs.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new hs({items:e,typeName:qe.ZodTuple,rest:null,...nt(t)})};class fc extends ot{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Te.object)return Ee(r,{code:ye.invalid_type,expected:Te.object,received:r.parsedType}),Ze;const a=[],i=this._def.keyType,o=this._def.valueType;for(const l in r.data)a.push({key:i._parse(new us(r,l,r.path,l)),value:o._parse(new us(r,r.data[l],r.path,l)),alwaysSet:l in r.data});return r.common.async?Cn.mergeObjectAsync(n,a):Cn.mergeObjectSync(n,a)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof ot?new fc({keyType:t,valueType:n,typeName:qe.ZodRecord,...nt(r)}):new fc({keyType:Dr.create(),valueType:t,typeName:qe.ZodRecord,...nt(n)})}}class Iu extends ot{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Te.map)return Ee(r,{code:ye.invalid_type,expected:Te.map,received:r.parsedType}),Ze;const a=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([l,c],d)=>({key:a._parse(new us(r,l,r.path,[d,"key"])),value:i._parse(new us(r,c,r.path,[d,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of o){const d=await c.key,u=await c.value;if(d.status==="aborted"||u.status==="aborted")return Ze;(d.status==="dirty"||u.status==="dirty")&&n.dirty(),l.set(d.value,u.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const c of o){const d=c.key,u=c.value;if(d.status==="aborted"||u.status==="aborted")return Ze;(d.status==="dirty"||u.status==="dirty")&&n.dirty(),l.set(d.value,u.value)}return{status:n.value,value:l}}}}Iu.create=(e,t,n)=>new Iu({valueType:t,keyType:e,typeName:qe.ZodMap,...nt(n)});class vi extends ot{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Te.set)return Ee(r,{code:ye.invalid_type,expected:Te.set,received:r.parsedType}),Ze;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(Ee(r,{code:ye.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(Ee(r,{code:ye.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());const i=this._def.valueType;function o(c){const d=new Set;for(const u of c){if(u.status==="aborted")return Ze;u.status==="dirty"&&n.dirty(),d.add(u.value)}return{status:n.value,value:d}}const l=[...r.data.values()].map((c,d)=>i._parse(new us(r,c,r.path,d)));return r.common.async?Promise.all(l).then(c=>o(c)):o(l)}min(t,n){return new vi({...this._def,minSize:{value:t,message:ze.toString(n)}})}max(t,n){return new vi({...this._def,maxSize:{value:t,message:ze.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}vi.create=(e,t)=>new vi({valueType:e,minSize:null,maxSize:null,typeName:qe.ZodSet,...nt(t)});class lo extends ot{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Te.function)return Ee(n,{code:ye.invalid_type,expected:Te.function,received:n.parsedType}),Ze;function r(l,c){return Du({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ru(),Oo].filter(d=>!!d),issueData:{code:ye.invalid_arguments,argumentsError:c}})}function a(l,c){return Du({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ru(),Oo].filter(d=>!!d),issueData:{code:ye.invalid_return_type,returnTypeError:c}})}const i={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof Mo){const l=this;return An(async function(...c){const d=new or([]),u=await l._def.args.parseAsync(c,i).catch(w=>{throw d.addIssue(r(c,w)),d}),f=await Reflect.apply(o,this,u);return await l._def.returns._def.type.parseAsync(f,i).catch(w=>{throw d.addIssue(a(f,w)),d})})}else{const l=this;return An(function(...c){const d=l._def.args.safeParse(c,i);if(!d.success)throw new or([r(c,d.error)]);const u=Reflect.apply(o,this,d.data),f=l._def.returns.safeParse(u,i);if(!f.success)throw new or([a(u,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new lo({...this._def,args:hs.create(t).rest(ri.create())})}returns(t){return new lo({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new lo({args:t||hs.create([]).rest(ri.create()),returns:n||ri.create(),typeName:qe.ZodFunction,...nt(r)})}}class mc extends ot{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}mc.create=(e,t)=>new mc({getter:e,typeName:qe.ZodLazy,...nt(t)});class pc extends ot{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Ee(n,{received:n.data,code:ye.invalid_literal,expected:this._def.value}),Ze}return{status:"valid",value:t.data}}get value(){return this._def.value}}pc.create=(e,t)=>new pc({value:e,typeName:qe.ZodLiteral,...nt(t)});function bS(e,t){return new Pa({values:e,typeName:qe.ZodEnum,...nt(t)})}class Pa extends ot{constructor(){super(...arguments),xl.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Ee(n,{expected:yt.joinValues(r),received:n.parsedType,code:ye.invalid_type}),Ze}if(Ou(this,xl)||vS(this,xl,new Set(this._def.values)),!Ou(this,xl).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return Ee(n,{received:n.data,code:ye.invalid_enum_value,options:r}),Ze}return An(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Pa.create(t,{...this._def,...n})}exclude(t,n=this._def){return Pa.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}xl=new WeakMap;Pa.create=bS;class gc extends ot{constructor(){super(...arguments),yl.set(this,void 0)}_parse(t){const n=yt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Te.string&&r.parsedType!==Te.number){const a=yt.objectValues(n);return Ee(r,{expected:yt.joinValues(a),received:r.parsedType,code:ye.invalid_type}),Ze}if(Ou(this,yl)||vS(this,yl,new Set(yt.getValidEnumValues(this._def.values))),!Ou(this,yl).has(t.data)){const a=yt.objectValues(n);return Ee(r,{received:r.data,code:ye.invalid_enum_value,options:a}),Ze}return An(t.data)}get enum(){return this._def.values}}yl=new WeakMap;gc.create=(e,t)=>new gc({values:e,typeName:qe.ZodNativeEnum,...nt(t)});class Mo extends ot{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Te.promise&&n.common.async===!1)return Ee(n,{code:ye.invalid_type,expected:Te.promise,received:n.parsedType}),Ze;const r=n.parsedType===Te.promise?n.data:Promise.resolve(n.data);return An(r.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Mo.create=(e,t)=>new Mo({type:e,typeName:qe.ZodPromise,...nt(t)});class Br extends ot{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===qe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=this._def.effect||null,i={addIssue:o=>{Ee(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(r.data,i);if(r.common.async)return Promise.resolve(o).then(async l=>{if(n.value==="aborted")return Ze;const c=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return c.status==="aborted"?Ze:c.status==="dirty"||n.value==="dirty"?Qi(c.value):c});{if(n.value==="aborted")return Ze;const l=this._def.schema._parseSync({data:o,path:r.path,parent:r});return l.status==="aborted"?Ze:l.status==="dirty"||n.value==="dirty"?Qi(l.value):l}}if(a.type==="refinement"){const o=l=>{const c=a.refinement(l,i);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?Ze:(l.status==="dirty"&&n.dirty(),o(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?Ze:(l.status==="dirty"&&n.dirty(),o(l.value).then(()=>({status:n.value,value:l.value}))))}if(a.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ic(o))return o;const l=a.transform(o.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>ic(o)?Promise.resolve(a.transform(o.value,i)).then(l=>({status:n.value,value:l})):o);yt.assertNever(a)}}Br.create=(e,t,n)=>new Br({schema:e,typeName:qe.ZodEffects,effect:t,...nt(n)});Br.createWithPreprocess=(e,t,n)=>new Br({schema:t,effect:{type:"preprocess",transform:e},typeName:qe.ZodEffects,...nt(n)});class ls extends ot{_parse(t){return this._getType(t)===Te.undefined?An(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ls.create=(e,t)=>new ls({innerType:e,typeName:qe.ZodOptional,...nt(t)});class Ta extends ot{_parse(t){return this._getType(t)===Te.null?An(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ta.create=(e,t)=>new Ta({innerType:e,typeName:qe.ZodNullable,...nt(t)});class vc extends ot{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Te.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}vc.create=(e,t)=>new vc({innerType:e,typeName:qe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...nt(t)});class xc extends ot{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return oc(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new or(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new or(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}xc.create=(e,t)=>new xc({innerType:e,typeName:qe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...nt(t)});class Lu extends ot{_parse(t){if(this._getType(t)!==Te.nan){const r=this._getOrReturnCtx(t);return Ee(r,{code:ye.invalid_type,expected:Te.nan,received:r.parsedType}),Ze}return{status:"valid",value:t.data}}}Lu.create=e=>new Lu({typeName:qe.ZodNaN,...nt(e)});const t5=Symbol("zod_brand");class vv extends ot{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Bc extends ot{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Ze:i.status==="dirty"?(n.dirty(),Qi(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Ze:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(t,n){return new Bc({in:t,out:n,typeName:qe.ZodPipeline})}}class yc extends ot{_parse(t){const n=this._def.innerType._parse(t),r=a=>(ic(a)&&(a.value=Object.freeze(a.value)),a);return oc(n)?n.then(a=>r(a)):r(n)}unwrap(){return this._def.innerType}}yc.create=(e,t)=>new yc({innerType:e,typeName:qe.ZodReadonly,...nt(t)});function jS(e,t={},n){return e?Ao.create().superRefine((r,a)=>{var i,o;if(!e(r)){const l=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,c=(o=(i=l.fatal)!==null&&i!==void 0?i:n)!==null&&o!==void 0?o:!0,d=typeof l=="string"?{message:l}:l;a.addIssue({code:"custom",...d,fatal:c})}}):Ao.create()}const n5={object:Gt.lazycreate};var qe;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(qe||(qe={}));const r5=(e,t={message:`Input not instance of ${e.name}`})=>jS(n=>n instanceof e,t),_S=Dr.create,NS=Ca.create,s5=Lu.create,a5=Ea.create,SS=lc.create,i5=gi.create,o5=Au.create,l5=cc.create,c5=dc.create,d5=Ao.create,u5=ri.create,h5=Is.create,f5=Mu.create,m5=Lr.create,p5=Gt.create,g5=Gt.strictCreate,v5=uc.create,x5=Mh.create,y5=hc.create,w5=hs.create,b5=fc.create,j5=Iu.create,_5=vi.create,N5=lo.create,S5=mc.create,k5=pc.create,C5=Pa.create,E5=gc.create,P5=Mo.create,uw=Br.create,T5=ls.create,R5=Ta.create,D5=Br.createWithPreprocess,O5=Bc.create,A5=()=>_S().optional(),M5=()=>NS().optional(),I5=()=>SS().optional(),L5={string:e=>Dr.create({...e,coerce:!0}),number:e=>Ca.create({...e,coerce:!0}),boolean:e=>lc.create({...e,coerce:!0}),bigint:e=>Ea.create({...e,coerce:!0}),date:e=>gi.create({...e,coerce:!0})},$5=Ze;var F5=Object.freeze({__proto__:null,defaultErrorMap:Oo,setErrorMap:$L,getErrorMap:Ru,makeIssue:Du,EMPTY_PATH:FL,addIssueToContext:Ee,ParseStatus:Cn,INVALID:Ze,DIRTY:Qi,OK:An,isAborted:wp,isDirty:bp,isValid:ic,isAsync:oc,get util(){return yt},get objectUtil(){return yp},ZodParsedType:Te,getParsedType:Xs,ZodType:ot,datetimeRegex:wS,ZodString:Dr,ZodNumber:Ca,ZodBigInt:Ea,ZodBoolean:lc,ZodDate:gi,ZodSymbol:Au,ZodUndefined:cc,ZodNull:dc,ZodAny:Ao,ZodUnknown:ri,ZodNever:Is,ZodVoid:Mu,ZodArray:Lr,ZodObject:Gt,ZodUnion:uc,ZodDiscriminatedUnion:Mh,ZodIntersection:hc,ZodTuple:hs,ZodRecord:fc,ZodMap:Iu,ZodSet:vi,ZodFunction:lo,ZodLazy:mc,ZodLiteral:pc,ZodEnum:Pa,ZodNativeEnum:gc,ZodPromise:Mo,ZodEffects:Br,ZodTransformer:Br,ZodOptional:ls,ZodNullable:Ta,ZodDefault:vc,ZodCatch:xc,ZodNaN:Lu,BRAND:t5,ZodBranded:vv,ZodPipeline:Bc,ZodReadonly:yc,custom:jS,Schema:ot,ZodSchema:ot,late:n5,get ZodFirstPartyTypeKind(){return qe},coerce:L5,any:d5,array:m5,bigint:a5,boolean:SS,date:i5,discriminatedUnion:x5,effect:uw,enum:C5,function:N5,instanceof:r5,intersection:y5,lazy:S5,literal:k5,map:j5,nan:s5,nativeEnum:E5,never:h5,null:c5,nullable:R5,number:NS,object:p5,oboolean:I5,onumber:M5,optional:T5,ostring:A5,pipeline:O5,preprocess:D5,promise:P5,record:b5,set:_5,strictObject:g5,string:_
455S,symbol:o5,transformer:uw,tuple:w5,undefined:l5,union:v5,unknown:u5,void:f5,NEVER:$5,ZodIssueCode:ye,quotelessJson:LL,ZodError:or});function U5({listingId:e}){const[t,n]=h.useState(null);return h.useEffect(()=>{Promise.all([R.from("business_listings").select("deal_type, deal_value").eq("id",e).single(),R.from("business_deal_claims").select("id",{count:"exact",head:!0}).eq("business_id",e)]).then(([r,a])=>{var o,l;const i=!!((o=r.data)!=null&&o.deal_type&&((l=r.data)!=null&&l.deal_value));n({hasDeal:i,claimCount:a.count??0})})},[e]),t?t.hasDeal?s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs(Ie,{variant:"default",className:"w-fit text-xs",children:[s.jsx(Mr,{className:"w-3 h-3 mr-1"}),"Deal Active"]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.claimCount," claimed"]})]}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"No deal"}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"..."})}function z5({listingId:e,initialCode:t,onSaved:n}){const{toast:r}=_t(),[a,i]=h.useState(t||""),[o,l]=h.useState(!1);h.useEffect(()=>{i(t||"")},[t]);const c=async()=>{const d=a.trim().toUpperCase();l(!0);let{error:u}=await R.from("business_listings").update({checkin_code:d||null}).eq("id",e);if(u&&d&&u.message.toLowerCase().includes("unique")){const{data:f}=await R.rpc("admin_find_business_by_checkin_code",{p_code:d}),m=Array.isArray(f)?f[0]:f;if(m&&m.id!==e&&m.check_in_enabled===!1)if(window.confirm(`Code "${d}" is currently assigned to "${m.business_name}" (inactive as a check-in location). Reassign it to this listing?`)){const{error:x}=await R.from("business_listings").update({checkin_code:null}).eq("id",m.id);x?u=x:u=(await R.from("business_listings").update({checkin_code:d}).eq("id",e)).error}else{l(!1);return}}if(l(!1),u){r({title:"Error",description:u.message.toLowerCase().includes("unique")?"That code is already in use by an active check-in location":"Could not save check-in code",variant:"destructive"});return}n(d),r({title:"Saved",description:"Check-in code updated"})};return s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Q,{value:a,onChange:d=>i(d.target.value.toUpperCase()),placeholder:"e.g. SHOP123",className:"h-8 w-28 text-xs",maxLength:20}),s.jsx(L,{size:"sm",variant:"outline",onClick:c,disabled:o,children:s.jsx(gr,{className:"w-3 h-3"})})]})}function B5(){const e=Et(),{toast:t}=_t(),[n,r]=h.useState([]),[a,i]=h.useState([]),[o,l]=h.useState([]),[c,d]=h.useState(""),[u,f]=h.useState(""),[m,w]=h.useState(null),[x,p]=h.useState(""),[b,v]=h.useState(null),[g,y]=h.useState(""),[j,N]=h.useState(!1),[k,C]=h.useState(null);h.useEffect(()=>{E()},[]);const E=async()=>{try{const[M,I,he]=await Promise.all([R.rpc("get_business_listings_with_user_details"),R.from("cities").select("*").order("name"),R.from("business_categories").select("*").order("name")]);if(M.error){console.error("RPC error:",M.error);const{data:X,error:K}=await R.from("business_listings").select(` 456 ${zc}, 457 cities(name), 458 business_categories!category_id(name), 459 business_categories_secondary:business_categories!category_id_secondary(name) 460 `).order("created_at",{ascending:!1});if(X&&!K){const{data:P}=await R.rpc("get_all_users_with_profiles"),Z=new Map((P==null?void 0:P.map(ee=>[ee.id,{name:ee.name,email:ee.email}]))||[]);r(X.map(ee=>{const le=Z.get(ee.user_id);return{...ee,member_name:(le==null?void 0:le.name)||null,member_email:(le==null?void 0:le.email)||null}}))}else K&&console.error("Fallback query error:",K)}else if(M.data){const X=M.data.map(K=>({...K,cities:{name:K.city_name},business_categories:{name:K.category_name},business_categories_secondary:null}));r(X)}I.data&&i(I.data),he.data&&l(he.data)}catch(M){console.error("Error loading data:",M),t({title:"Error",description:"Failed to load directory data",variant:"destructive"})}},H=async M=>{N(!0);try{const{data:{user:I}}=await R.auth.getUser(),{error:he}=await R.from("business_listings").update({status:"approved",approved_at:new Date().toISOString(),approved_by:I==null?void 0:I.id}).eq("id",M);if(he)throw he;t({title:"Success",description:"Business listing approved"}),E()}catch(I){console.error("Error approving listing:",I),t({title:"Error",description:"Failed to approve listing",variant:"destructive"})}finally{N(!1)}},A=async M=>{N(!0);try{const{error:I}=await R.from("business_listings").update({status:"rejected"}).eq("id",M);if(I)throw I;t({title:"Success",description:"Business listing rejected"}),E()}catch(I){console.error("Error rejecting listing:",I),t({title:"Error",description:"Failed to reject listing",variant:"destructive"})}finally{N(!1)}},F=async(M,I)=>{try{const{error:he}=await R.from("business_listings").update({check_in_enabled:!I}).eq("id",M);if(he)throw he;t({title:"Success",description:`Check-in ${I?"disabled":"enabled"}`}),E()}catch(he){console.error("Error toggling check-in:",he),t({title:"Error",description:"Failed to update check-in status",variant:"destructive"})}},U=async(M,I)=>{try{const{error:he}=await R.from("business_listings").update({accepts_street_cash:!I}).eq("id",M);if(he)throw he;r(X=>X.map(K=>
460K.id===M?{...K,accepts_street_cash:!I}:K)),t({title:"Success",description:`$treet Cash ${I?"disabled":"enabled"}`})}catch(he){console.error("Error toggling Street Cash:",he),t({title:"Error",description:"Failed to update $treet Cash status",variant:"destructive"})}},ae=async()=>{if(c.trim())try{const{error:M}=await R.from("cities").insert({name:c.trim()});if(M)throw M;t({title:"Success",description:"City added"}),d(""),E()}catch(M){console.error("Error adding city:",M),t({title:"Error",description:"Failed to add city",variant:"destructive"})}},q=async()=>{if(u.trim())try{const{error:M}=await R.from("business_categories").insert({name:u.trim()});if(M)throw M;t({title:"Success",description:"Category added"}),f(""),E()}catch(M){console.error("Error adding category:",M),t({title:"Error",description:"Failed to add category",variant:"destructive"})}},se=async M=>{try{const{error:I}=await R.from("cities").delete().eq("id",M);if(I)throw I;t({title:"Success",description:"City deleted"}),E()}catch(I){console.error("Error deleting city:",I),t({title:"Error",description:"Cannot delete city with existing listings",variant:"destructive"})}},D=async()=>{if(!(!b||!g.trim()))try{const{error:M}=await R.from("cities").update({name:g.trim()}).eq("id",b.id);if(M)throw M;t({title:"Success",description:"City updated"}),v(null),y(""),E()}catch(M){console.error("Error updating city:",M),t({title:"Error",description:"Failed to update city",variant:"destructive"})}},T=async M=>{try{const{error:I}=await R.from("business_categories").delete().eq("id",M);if(I)throw I;t({title:"Success",description:"Category deleted"}),E()}catch(I){console.error("Error deleting category:",I),t({title:"Error",description:"Cannot delete category with existing listings",variant:"destructive"})}},_=async()=>{if(!(!m||!x.trim()))try{const{error:M}=await R.from("business_categories").update({name:x.trim()}).eq("id",m.id);if(M)throw M;t({title:"Success",description:"Category updated"}),w(null),p(""),E()}catch(M){console.error("Error updating category:",M),t({title:"Error",description:"Failed to update category",variant:"destructive"})}},O=async(M,I)=>{N(!0);try{const he=I==="approved"?"rejected":"approved",{error:X}=await R.from("business_listings").update({status:he}).eq("id",M);if(X)throw X;t({title:"Success",description:`Listing ${he==="approved"?"activated":"deactivated"}`}),E()}catch(he){console.error("Error toggling listing status:",he),t({title:"Error",description:"Failed to update listing status",variant:"destructive"})}finally{N(!1)}},G=async M=>{if(confirm("Are you sure you want to permanently delete this listing?")){N(!0);try{const{error:I}=await R.from("business_listings").delete().eq("id",M);if(I)throw I;t({title:"Success",description:"Business listing deleted"}),E()}catch(I){console.error("Error deleting listing:",I),t({title:"Error",description:"Failed to delete listing",variant:"destructive"})}finally{N(!1)}}},Y=n.filter(M=>M.status==="pending"),oe=n.filter(M=>M.status==="approved"||M.status==="rejected");return s.jsxs("div",{className:"space-y-6",children:[s.jsxs(pe,{className:"w-full p-0",children:[s.jsxs(Ae,{className:"flex flex-row items-center justify-between",children:[s.jsxs(Me,{children:["Pending Business Listings (",Y.length,")"]}),s.jsxs(L,{onClick:()=>e("/add-business"),children:[s.jsx(os,{className:"w-4 h-4 mr-2"}),"Add Business"]})]}),Y.length===0?s.jsx("div",{className:"p-6",children:s.jsx("p",{className:"text-muted-foreground text-center py-4",children:"No pending listings"})}):s.jsxs(Ft,{className:"w-full",containerClassName:"max-w-none px-0 mx-0",children:[s.jsx(Ut,{children:s.jsxs(Fe,{children:[s.jsx(te,{children:"Business Name"}),s.jsx(te,{children:"Owner"}),s.jsx(te,{children:"City"}),s.jsx(te,{children:"Category"}),s.jsx(te,{children:"Submitted"}),s.jsx(te,{className:"text-right",children:"Actions"})]})}),s.jsx(zt,{children:Y.map(M=>s.jsxs(Fe,{children:[s.jsx(J,{className:"font-medium",children:M.business_name}),s.jsx(J,{children:s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{className:"font-medium text-sm",children:M.member_name||"Unknown"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:M.member_email||""})]})}),s.jsx(J,{children:M.cities.name}),s.jsx(J,{children:M.business_categories.name}),s.jsx(J,{children:new Date(M.created_at).toLocaleDateString()}),s.jsx(J,{children:s.jsxs("div",{className:"flex gap-2 justify-end",children:[s.jsxs(L,{size:"sm",variant:"outline",onClick:()=>C(M),children:[s.jsx(Os,{className:"w-4 h-4 mr-1"}),"Preview"]}),s.jsxs(L,{size:"sm",variant:"outline",onClick:()=>e(`/edit-business/${M.id}?mode=admin`),children:[s.jsx(pl,{className:"w-4 h-4 mr-1"}),"Edit"]}),s.jsxs(L,{size:"sm",onClick:()=>H(M.id),disabled:j,children:[s.jsx(gr,{className:"w-4 h-4 mr-1"}),"Approve"]}),s.jsxs(L,{size:"sm",variant:"destructive",onClick:()=>A(M.id),disabled:j,children:[s.jsx(rs,{className:"w-4 h-4 mr-1"}),"Reject"]})]})})]},M.id))})]})]}),s.jsxs("section",{className:"w-full",children:[s.jsx("header",{className:"flex items-center justify-between mb-2",children:s.jsxs("h2",{className:"text-2xl font-semibold leading-none tracking-tight",children:["Approved Listings (",oe.length,")"]})}),s.jsxs(Ft,{className:"w-full",containerClassName:"max-w-none px-0 mx-0",children:[s.jsx(Ut,{children:s.jsxs(Fe,{children:[s.jsx(te,{children:"Business N
460ame"}),s.jsx(te,{children:"Owner"}),s.jsx(te,{children:"City"}),s.jsx(te,{children:"Category"}),s.jsx(te,{children:"Visibility"}),s.jsx(te,{children:"Check-in Location"}),s.jsx(te,{children:"$treet Cash"}),s.jsx(te,{children:"Check-in Code"}),s.jsx(te,{children:"Check-ins"}),s.jsx(te,{children:"Deal Status"}),s.jsx(te,{className:"text-right",children:"Actions"})]})}),s.jsx(zt,{children:oe.map(M=>s.jsxs(Fe,{children:[s.jsx(J,{className:"font-medium",children:M.business_name}),s.jsx(J,{children:s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{className:"font-medium text-sm",children:M.member_name||"Unknown"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:M.member_email||""})]})}),s.jsx(J,{children:M.cities.name}),s.jsx(J,{children:s.jsx("div",{className:"flex flex-col gap-1",children:s.jsx("span",{children:M.business_categories.name})})}),s.jsx(J,{children:s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(L,{size:"sm",variant:M.status==="approved"?"default":"secondary",onClick:()=>O(M.id,M.status),disabled:j,className:M.status==="approved"?"bg-green-600 hover:bg-green-700":"bg-red-600 hover:bg-red-700",children:M.status==="approved"?"ON":"OFF"})})}),s.jsx(J,{children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ca,{checked:M.check_in_enabled,onCheckedChange:()=>F(M.id,M.check_in_enabled)}),s.jsx("span",{className:"text-xs text-muted-foreground",children:M.check_in_enabled?"Active":"Off"})]})}),s.jsx(J,{children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ca,{checked:!!M.accepts_street_cash,onCheckedChange:()=>U(M.id,!!M.accepts_street_cash)}),s.jsx("span",{className:"text-xs text-muted-foreground",children:M.accepts_street_cash?"Accepted":"Off"})]})}),s.jsx(J,{children:s.jsx(z5,{listingId:M.id,initialCode:M.checkin_code||"",onSaved:I=>{r(he=>he.map(X=>X.id===M.id?{...X,checkin_code:I}:X))}})}),s.jsx(J,{children:s.jsx("span",{className:"font-medium",children:M.checkin_count??0})}),s.jsx(J,{children:s.jsx(U5,{listingId:M.id})}),s.jsx(J,{children:s.jsxs("div",{className:"flex gap-2 justify-end",children:[s.jsxs(L,{size:"sm",variant:"outline",onClick:()=>e(`/edit-business/${M.id}?mode=admin`),children:[s.jsx(pl,{className:"w-4 h-4 mr-1"}),"Edit"]}),s.jsxs(L,{size:"sm",variant:"destructive",onClick:()=>G(M.id),disabled:j,children:[s.jsx(xr,{className:"w-4 h-4 mr-1"}),"Delete"]})]})})]},M.id))})]})]}),s.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[s.jsxs(pe,{children:[s.jsx(Ae,{children:s.jsx(Me,{children:"Manage Cities"})}),s.jsxs(ve,{className:"space-y-4",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Q,{placeholder:"New city name",value:c,onChange:M=>d(M.target.value)}),s.jsx(L,{onClick:ae,children:s.jsx(os,{className:"w-4 h-4"})})]}),s.jsx("div",{className:"space-y-2",children:a.map(M=>s.jsx("div",{className:"flex items-center justify-between p-2 border rounded",children:(b==null?void 0:b.id)===M.id?s.jsxs("div",{className:"flex gap-2 flex-1 mr-2",children:[s.jsx(Q,{value:g,onChange:I=>y(I.target.value),onKeyDown:I=>{I.key==="Enter"&&D(),I.key==="Escape"&&v(null)}}),s.jsx(L,{size:"sm",onClick:D,children:s.jsx(gr,{className:"w-4 h-4"})}),s.jsx(L,{size:"sm",variant:"ghost",onClick:()=>v(null),children:s.jsx(rs,{className:"w-4 h-4"})})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{children:M.name}),s.jsxs("div",{className:"flex gap-1",children:[s.jsx(L,{size:"sm",variant:"ghost",onClick:()=>{v(M),y(M.name)},children:s.jsx(pl,{className:"w-4 h-4"})}),s.jsx(L,{size:"sm",variant:"ghost",onClick:()=>se(M.id),children:s.jsx(xr,{className:"w-4 h-4"})})]})]})},M.id))})]})]}),s.jsxs(pe,{children:[s.jsx(Ae,{children:s.jsx(Me,{children:"Manage Categories"})}),s.jsxs(ve,{className:"space-y-4",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Q,{placeholder:"New category name",value:u,onChange:M=>f(M.target.value)}),s.jsx(L,{onClick:q,children:s.jsx(os,{className:"w-4 h-4"})})]}),s.jsx("div",{className:"space-y-2",children:o.map(M=>s.jsx("div",{className:"flex items-center justify-between p-2 border rounded",children:(m==null?void 0:m.id)===M.id?s.jsxs("div",{className:"flex gap-2 flex-1 mr-2",children:[s.jsx(Q,{value:x,onChange:I=>p(I.target.value),onKeyDown:I=>I.key==="Enter"&&_()}),s.jsx(L,{size:"sm",onClick:_,children:s.jsx(gr,{className:"w-4 h-4"})}),s.jsx(L,{size:"sm",variant:"ghost",onClick:()=>w(null),children:s.jsx(rs,{className:"w-4 h-4"})})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{children:M.name}),s.jsxs("div",{className:"flex gap-1",children:[s.jsx(L,{size:"sm",variant:"ghost",onClick:()=>{w(M),p(M.name)},children:s.jsx(pl,{className:"w-4 h-4"})}),s.jsx(L,{size:"sm",variant:"ghost",onClick:()=>T(M.id),children:s.jsx(xr,{className:"w-4 h-4"})})]})]})},M.id))})]})]})]}),s.jsx(ht,{open:!!k,onOpenChange:()=>C(null),children:s.jsxs(dt,{className:"max-w-2xl",children:[s.jsx(ft,{children:s.jsx(mt,{children:"Preview Business Listing"})}),k&&s.jsxs("div",{className:"space-y-4",children:[k.image_url&&s.jsx("img",{src:k.image_url,alt:k.business_name,className:"w-full h-48 object-cover rounded-lg"}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-xl font-semibold",children:k.business_name}),s.jsxs("div",{className:"flex gap-2 mt-2",children:[s.jsx(Ie,{variant:"secondary",children:k.cities.name}),s.jsx(Ie,{variant:"outline",children:k.business_categories.name})]})]}),k.description&&s.jsxs("div",{children:[s.jsx(B,{className:"text-sm font-medium",children:"Description"}),s.jsx("p",{className:"text-muted-foreground mt-1",children:k.description})]}),s.jsxs("div",{className:"flex gap-2 pt-4 border-t",children:[s.jsxs(L,{onClick:()=>{H(k.id),C(null)},disabled:j,className:"flex-1",children:[s.jsx(gr,{className:"w-4 h-4 mr-2"}),"Approve"]}),s.jsxs(L,{variant:"destructive",onClick:()=>{A(k.id),C(null)},disabled:j,className:"flex-1",children:[s.jsx(rs,{className:"w-4 h-4 mr-2"}),"Reject"]})]})]})]})})]})}const V5=({user:e})=>{const[t,n]=h.useState([]),[r,a]=h.useState([]),[i,o]=h.useState([]),[l,c]=h.useState(!0),[d,u]=
460h.useState(!1),[f,m]=h.useState(!1),[w,x]=h.useState(!1),[p,b]=h.useState(!1),[v,g]=h.useState(null),[y,j]=h.useState([]),[N,k]=h.useState(""),[C,E]=h.useState(!1),[H,A]=h.useState(!1),[F,U]=h.useState(""),[ae,q]=h.useState(null),[se,D]=h.useState(""),[T,_]=h.useState(!1),[O,G]=h.useState(""),[Y,oe]=h.useState(!1),{toast:M}=_t(),[I,he]=h.useState({title:"",description:"",event_date:"",event_time:"",event_end_time:"",venue:"",address:"",tickets_url:"",city_id:"",image_url:"",price:"",google_maps_url:"",youtube_url:"",comp_tickets_total:"",comp_ticket_code:""}),[X,K]=h.useState(Ol()),[P,Z]=h.useState(!1);h.useEffect(()=>{ee()},[]);const ee=async()=>{c(!0),await Promise.all([le(),z(),_e()]),c(!1)},le=async()=>{const{data:$,error:ne}=await R.from("event_cities").select("*").order("name");$&&!ne&&a($)},z=async()=>{try{const{data:$,error:ne}=await R.rpc("admin_get_public_events");if(ne)throw ne;const $e=[...new Set(($||[]).map(et=>et.city_id).filter(Boolean))];let Se={};if($e.length>0){const{data:et}=await R.from("event_cities").select("id, name").in("id",$e);Se=Object.fromEntries((et||[]).map(at=>[at.id,at.name]))}const He=($||[]).map(et=>({...et,event_cities:et.city_id?{name:Se[et.city_id]}:null})),Xe=[...new Set((He||[]).map(et=>et.created_by).filter(Boolean))];let je={},st=new Set;if(Xe.length>0){const[et,at]=await Promise.all([R.from("profiles").select("id, name").in("id",Xe),R.from("user_roles").select("user_id, role").in("user_id",Xe)]);et.data&&(je=Object.fromEntries(et.data.map(Zn=>[Zn.id,Zn.name||"Unknown"]))),at.data&&at.data.forEach(Zn=>{(Zn.role==="admin"||Zn.role==="super_admin")&&st.add(Zn.user_id)})}const Yt=(He||[]).map(et=>({...et,profiles:{name:st.has(et.created_by)?"Admin":je[et.created_by]||"Unknown"}}));n(Yt)}catch($){console.error("Error fetching events:",$)}},_e=async()=>{try{const{data:$,error:ne}=await R.from("event_rsvps").select("*").order("created_at",{ascending:!1});if(ne)throw ne;o($||[])}catch($){console.error("Error fetching RSVPs:",$)}},ue=async $=>{var $e;const ne=($e=$.target.files)==null?void 0:$e[0];if(ne){if(!ne.type.startsWith("image/")){M({title:"Invalid File",description:"Please upload an image file",variant:"destructive"});return}A(!0);try{const Se=ne.name.split(".").pop(),He=`admin/${Date.now()}.${Se}`,{error:Xe}=await R.storage.from("event-images").upload(He,ne);if(Xe)throw Xe;const{data:{publicUrl:je}}=R.storage.from("event-images").getPublicUrl(He);he(st=>({...st,image_url:je})),M({title:"Image Uploaded",description:"Event image uploaded successfully"})}catch(Se){M({title:"Upload Failed",description:Se.message,variant:"destructive"})}finally{A(!1)}}},De=async()=>{if(!I.title.trim()||!I.city_id){M({title:"Missing Information",description:"Please fill in the required fields",variant:"destructive"});return}if(!X.is_recurring&&!I.event_date){M({title:"Missing Date",description:"Please select an event date or enable recurring event",variant:"destructive"});return}const $=xp(X);if(!$.valid){M({title:"Invalid Recurrence Settings",description:$.message,variant:"destructive"});return}E(!0);try{const{error:ne}=await R.from("public_events").insert({title:I.title.trim(),description:I.description.trim()||null,event_date:X.is_recurring?new Date().toISOString().split("T")[0]:I.event_date,event_time:I.event_time||null,event_end_time:I.event_end_time||null,venue:I.venue.trim()||null,address:I.address.trim()||null,tickets_url:I.tickets_url.trim()||null,city_id:I.city_id,image_url:I.image_url||null,price:I.price.trim()||null,google_maps_url:I.google_maps_url.trim()||null,youtube_url:I.youtube_url.trim()||null,comp_tickets_total:I.comp_tickets_total?parseInt(I.comp_tickets_total):0,comp_ticket_code:I.comp_ticket_code.trim()||null,created_by:e.id,status:"approved",approved_by:e.id,approved_at:new Date().toISOString(),is_recurring:X.is_recurring,recurrence_type:X.is_recurring?X.recurrence_type:null,recurrence_days_of_week:X.is_recurring&&X.recurrence_type==="weekly"?X.recurrence_days_of_week:null,recurrence_day_of_month:X.is_recurring&&X.recurrence_type==="monthly"&&X.monthly_type==="day_of_month"?X.recurrence_day_of_month:null,recurrence_pattern:X.is_recurring&&(X.recurrence_type==="monthly"&&X.monthly_type==="pattern"||X.recurrence_type==="bi_monthly"||X.recurrence_type==="bi_weekly")?X.recurrence_pattern:null});if(ne)throw ne;M({title:"Event Created",description:"Event has been published"}),u(!1),ge(),z()}catch(ne){M({title:"Error",description:ne.message,variant:"destructive"})}finally{E(!1)}},Ve=async()=>
460{if(!v||!I.title.trim()){M({title:"Missing Information",description:"Please fill required fields",variant:"destructive"});return}if(!X.is_recurring&&!I.event_date){M({title:"Missing Date",description:"Please select an event date or enable recurring event",variant:"destructive"});return}const $=xp(X);if(!$.valid){M({title:"Invalid Recurrence Settings",description:$.message,variant:"destructive"});return}E(!0);try{const{error:ne}=await R.from("public_events").update({title:I.title.trim(),description:I.description.trim()||null,event_date:X.is_recurring?v.event_date:I.event_date,event_time:I.event_time||null,event_end_time:I.event_end_time||null,venue:I.venue.trim()||null,address:I.address.trim()||null,tickets_url:I.tickets_url.trim()||null,city_id:I.city_id||null,image_url:I.image_url||null,price:I.price.trim()||null,google_maps_url:I.google_maps_url.trim()||null,youtube_url:I.youtube_url.trim()||null,comp_tickets_total:I.comp_tickets_total?parseInt(I.comp_tickets_total):0,comp_ticket_code:I.comp_ticket_code.trim()||null,is_recurring:X.is_recurring,recurrence_type:X.is_recurring?X.recurrence_type:null,recurrence_days_of_week:X.is_recurring&&X.recurrence_type==="weekly"?X.recurrence_days_of_week:null,recurrence_day_of_month:X.is_recurring&&X.recurrence_type==="monthly"&&X.monthly_type==="day_of_month"?X.recurrence_day_of_month:null,recurrence_pattern:X.is_recurring&&(X.recurrence_type==="monthly"&&X.monthly_type==="pattern"||X.recurrence_type==="bi_monthly"||X.recurrence_type==="bi_weekly")?X.recurrence_pattern:null}).eq("id",v.id);if(ne)throw ne;M({title:"Event Updated"}),m(!1),ge(),z()}catch(ne){M({title:"Error",description:ne.message,variant:"destructive"})}finally{E(!1)}},lt=async $=>{try{const{error:ne}=await R.from("public_events").update({status:"approved",approved_by:e.id,approved_at:new Date().toISOString()}).eq("id",$);if(ne)throw ne;M({title:"Event Approved"}),z()}catch(ne){M({title:"Error",description:ne.message,variant:"destructive"})}},vt=async $=>{try{const{error:ne}=await R.from("public_events").update({status:"rejected"}).eq("id",$);if(ne)throw ne;M({title:"Event Rejected"}),z()}catch(ne){M({title:"Error",description:ne.message,variant:"destructive"})}},Qe=async $=>{if(confirm("Are you sure you want to delete this event?"))try{const{error:ne}=await R.from("public_events").delete().eq("id",$);if(ne)throw ne;M({title:"Event Deleted"}),z()}catch(ne){M({title:"Error",description:ne.message,variant:"destructive"})}},re=async()=>{if(F.trim())try{const{error:$}=await R.from("event_cities").insert({name:F.trim()});if($)throw $;M({title:"City Added"}),U(""),le()}catch($){M({title:"Error",description:$.message,variant:"destructive"})}},ie=async $=>{if(confirm("Are you sure? Events in this city will lose their city assignment."))try{const{error:ne}=await R.from("event_cities").delete().eq("id",$);if(ne)throw ne;M({title:"City Deleted"}),le()}catch(ne){M({title:"Error",description:ne.message,variant:"destructive"})}},Ce=async $=>{if(se.trim())try{const{error:ne}=await R.from("event_cities").update({name:se.trim()}).eq("id",$);if(ne)throw ne;M({title:"City Updated"}),q(null),D(""),le()}catch(ne){M({title:"Error",description:ne.message,variant:"destructive"})}},V=$=>{g($);const ne=$;he({title:$.title,description:$.description||"",event_date:$.event_date,event_time:$.event_time||"",event_end_time:ne.event_end_time||"",venue:$.venue||"",address:$.address||"",tickets_url:$.tickets_url||"",city_id:$.city_id||"",image_url:$.image_url||"",price:ne.price||"",google_maps_url:ne.google_maps_url||"",youtube_url:ne.youtube_url||"",comp_tickets_total:String(ne.comp_tickets_total||""),comp_ticket_code:ne.comp_ticket_code||""});const $e=ne.is_recurring||!1,Se=ne.recurrence_type||"",He=!!ne.recurrence_pattern;K({is_recurring:$e,recurrence_type:Se,recurrence_days_of_week:ne.recurrence_days_of_week||[],recurrence_day_of_month:ne.recurrence_day_of_month||null,recurrence_pattern:ne.recurrence_pattern||"",monthly_type:He?"pattern":"day_of_month"}),Z($e),m(!0)},ge=()=>{he({title:"",description:"",event_date:"",event_time:"",event_end_time:"",venue:"",address:"",tickets_url:"",city_id:"",image_url:"",price:"",google_maps_url:"",youtube_url:"",comp_tickets_total:"",comp_ticket_code:""}),K(Ol()),Z(!1)},Ne=$=>{const ne=i.filter($e=>$e.event_id===$.id);j(ne),k($.title),b(!0)},Pe=()=>{if(i.length===0)return;const $=[["Event","Name","Phone Number","RSVP Date"].join(","),...i.map(Se=>{const He=t.find(Xe=>Xe.id===Se.event_id);return[`"${(He==null?void 0:He.title)||"Unknown"}"`,`"${Se.name}"`,`"${Se.phone_number}"`,`"${new Date(Se.created_at).toLocaleDateString()}"`].join(",")})].join(` 461`),ne=new Blob([$],{type:"text/csv;charset=utf-8;"}),$e=document.createElement("a");$e.href=URL.createObjectURL(ne),$e.download=`all-event-rsvps-${new Date().toISOString().split("T")[0]}.csv`,$e.click()},We=()=>{if(y.length===0)return;const $=[["Name","Phone Number","RSVP Date"].join(","),...y.map(Se=>[`"${Se.name}"`,`"${Se.phone_number}"`,`"${new Date(Se.created_at).toLocaleDateString()}"`].join(","))].join(` 462`),ne=new Blob([$],{type:"text/csv;charset=utf-8;"}),$e=document.createElement("a");$e.href=URL.createObjectURL(ne),$e.download=`rsvps-${N.replace(/\s+/g,"-").toLowerCase()}.csv`,$e.click()},xt=async($,ne)=>{try{const{error:$e}=await R.from("public_events").update({check_in_enabled:ne}).eq("id",$);if($e)throw $e;M({title:ne?"Check-in Enabled":"Check-in Disabled",description:ne?"Members can now check in to this event":"Check-in has been disabled for this event"}),z()}catch($e){M({title:"Error",description:$e.message,variant:"destructive"})}},Je=async()=>
462{if(O.trim()){oe(!0);try{const{data:$,error:ne}=await R.functions.invoke("scrape-event-url",{body:{url:O.trim()}});if(ne)throw ne;if($!=null&&$.error)throw new Error($.error);const $e=($==null?void 0:$.data)||{};let Se="";if($e.city&&r.length){const He=r.find(Xe=>Xe.name.toLowerCase()===String($e.city).toLowerCase());He&&(Se=He.id)}he({title:$e.title||"",description:$e.description||"",event_date:$e.event_date||"",event_time:$e.event_time||"",event_end_time:$e.event_end_time||"",venue:$e.venue||"",address:$e.address||"",tickets_url:$e.tickets_url||"",city_id:Se,image_url:$e.image_url||"",price:$e.price||"",google_maps_url:$e.google_maps_url||"",youtube_url:$e.youtube_url||"",comp_tickets_total:"",comp_ticket_code:""}),K(Ol()),Z(!1),_(!1),G(""),u(!0),M({title:"Event data extracted",description:"Review and fill in any missing fields before saving."})}catch($){M({title:"Scrape failed",description:$.message,variant:"destructive"})}finally{oe(!1)}}},It=new Date().toISOString().split("T")[0],on=t.filter($=>$.status==="pending"),tn=t.filter($=>$.status==="approved"&&$.event_date>=It),nn=t.filter($=>$.status==="approved"&&$.event_date<It),En=()=>s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(B,{children:"Event Title *"}),s.jsx(Q,{value:I.title,onChange:$=>he(ne=>({...ne,title:$.target.value})),placeholder:"Enter event title"})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Description"}),s.jsx(Ir,{value:I.description,onChange:$=>he(ne=>({...ne,description:$.target.value})),placeholder:"Describe the event...",rows:3})]}),s.jsx(K1,{data:X,onChange:K,onDateDisabledChange:Z}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsxs(B,{children:["Date ",!P&&"*"]}),s.jsx(Q,{type:"date",value:I.event_date,onChange:$=>he(ne=>({...ne,event_date:$.target.value})),disabled:P,className:P?"opacity-50 cursor-not-allowed":""}),P&&s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Date is managed by recurrence settings"})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Start Time"}),s.jsx(Q,{type:"time",value:I.event_time,onChange:$=>he(ne=>({...ne,event_time:$.target.value}))})]})]}),s.jsxs("div",{children:[s.jsx(B,{children:"End Time"}),s.jsx(Q,{type:"time",value:I.event_end_time,onChange:$=>he(ne=>({...ne,event_end_time:$.target.value}))})]}),s.jsxs("div",{children:[s.jsx(B,{children:"City *"}),s.jsxs(Vt,{value:I.city_id,onValueChange:$=>he(ne=>({...ne,city_id:$})),children:[s.jsx(Ot,{children:s.jsx(Wt,{placeholder:"Select a city"})}),s.jsx(At,{className:"bg-popover z-50",children:r.map($=>s.jsx(gt,{value:$.id,children:$.name},$.id))})]})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Venue"}),s.jsx(Q,{value:I.venue,onChange:$=>he(ne=>({...ne,venue:$.target.value})),placeholder:"Venue name"})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Address"}),s.jsx(Q,{value:I.address,onChange:$=>he(ne=>({...ne,address:$.target.value})),placeholder:"Full address"})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Price"}),s.jsx(Q,{value:I.price,onChange:$=>he(ne=>({...ne,price:$.target.value})),placeholder:"e.g., Free, $20, $15-$50"})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Tickets URL"}),s.jsx(Q,{type:"url",value:I.tickets_url,onChange:$=>he(ne=>({...ne,tickets_url:$.target.value})),placeholder:"https://..."})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Google Maps Link"}),s.jsx(Q,{type:"url",value:I.google_maps_url,onChange:$=>he(ne=>({...ne,google_maps_url:$.target.value})),placeholder:"https://maps.google.com/..."})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Event Image/Flyer"}),I.image_url?s.jsxs("div",{className:"relative mt-2",children:[s.jsx("img",{src:I.image_url,alt:"Event",className:"w-full h-40 object-cover rounded-lg"}),s.jsx(L,{variant:"destructive",size:"icon",className:"absolute top-2 right-2",onClick:()=>he($=>({...$,image_url:""})),children:s.jsx(rs,{className:"w-4 h-4"})})]}):s.jsxs("div",{className:"mt-2",children:[s.jsx(Q,{type:"file",accept:"image/*",onChange:ue,disabled:H}),H&&s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Uploading..."})]})]}),s.jsx(Z1,{youtube_url:I.youtube_url,onChange:($,ne)=>he($e=>({...$e,[$]:ne}))}),s.jsxs("div",{className:"border-t pt-4 space-y-3",children:[s.jsxs("div",{children:[s.jsx(B,{className:"text-sm font-semibold",children:"Complementary Upgrade"}),s.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Offer complementary upgrades to V.I.P. members for this event."}),s.jsxs(Vt,{value:I.comp_tickets_total,onValueChange:$=>he(ne=>({...ne,comp_tickets_total:$})),children:[s.jsx(Ot,{children:s.jsx(Wt,{placeholder:"Select number of upgrades (optional)"})}),s.jsxs(At,{className:"bg-popover z-50",children:[s.jsx(gt,{value:"0",children:"None"}),Array.from({length:50},($,ne)=>ne+1).map($=>s.jsxs(gt,{value:String($),children:[$," ",$===1?"Upgrade":"Upgrades"]},$))]})]})]}),I.comp_tickets_total&&I.comp_tickets_total!=="0"&&s.jsxs("div",{children:[s.jsx(B,{children:"4-Digit Claim Code *"}
462),s.jsx(Q,{value:I.comp_ticket_code,onChange:$=>{const ne=$.target.value.replace(/[^0-9]/g,"").slice(0,4);he($e=>({...$e,comp_ticket_code:ne}))},placeholder:"Enter a 4-digit code (e.g. 1234)",maxLength:4}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"You will enter this code when a V.I.P. member arrives and is claiming a complimentary upgrade. *Upgrades available on a first come first serve basis"})]})]})]});return s.jsxs("div",{className:"space-y-6",children:[s.jsxs(pe,{children:[s.jsxs(Ae,{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex flex-row items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs(Me,{className:"flex items-center gap-2",children:[s.jsx(rr,{className:"w-5 h-5"}),"Public Events Management"]}),s.jsx(St,{children:"Manage public events, approve submissions, and view RSVPs"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(ht,{open:w,onOpenChange:x,children:[s.jsx(Nn,{asChild:!0,children:s.jsxs(L,{variant:"outline",children:[s.jsx(dn,{className:"w-4 h-4 mr-2"}),"Manage Cities"]})}),s.jsxs(dt,{children:[s.jsx(ft,{children:s.jsx(mt,{children:"Manage Event Cities"})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Q,{value:F,onChange:$=>U($.target.value),placeholder:"New city name"}),s.jsx(L,{onClick:re,disabled:!F.trim(),children:s.jsx(os,{className:"w-4 h-4"})})]}),s.jsx("div",{className:"max-h-60 overflow-y-auto space-y-2",children:r.map($=>s.jsx("div",{className:"flex items-center justify-between p-2 bg-muted rounded",children:ae===$.id?s.jsxs("div",{className:"flex items-center gap-2 flex-1 mr-2",children:[s.jsx(Q,{value:se,onChange:ne=>D(ne.target.value),className:"h-8",autoFocus:!0,onKeyDown:ne=>{ne.key==="Enter"&&Ce($.id),ne.key==="Escape"&&(q(null),D(""))}}),s.jsx(L,{size:"icon",variant:"ghost",className:"h-8 w-8",onClick:()=>Ce($.id),children:s.jsx(gr,{className:"w-4 h-4 text-green-600"})}),s.jsx(L,{size:"icon",variant:"ghost",className:"h-8 w-8",onClick:()=>{q(null),D("")},children:s.jsx(rs,{className:"w-4 h-4"})})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{children:$.name}),s.jsxs("div",{className:"flex gap-1",children:[s.jsx(L,{variant:"ghost",size:"icon",onClick:()=>{q($.id),D($.name)},children:s.jsx(oa,{className:"w-4 h-4"})}),s.jsx(L,{variant:"ghost",size:"icon",onClick:()=>ie($.id),children:s.jsx(xr,{className:"w-4 h-4 text-destructive"})})]})]})},$.id))})]})]})]}),s.jsxs(L,{variant:"outline",onClick:Pe,disabled:i.length===0,children:[s.jsx(di,{className:"w-4 h-4 mr-2"}),"Export All RSVPs"]})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs(ht,{open:d,onOpenChange:u,children:[s.jsx(Nn,{asChild:!0,children:s.jsxs(L,{children:[s.jsx(os,{className:"w-4 h-4 mr-2"}),"Add Event"]})}),s.jsxs(dt,{className:"max-h-[90vh] overflow-y-auto",children:[s.jsx(ft,{children:s.jsx(mt,{children:"Create New Event"})}),En(),s.jsx(L,{onClick:De,className:"w-full mt-4",disabled:C,children:C?"Creating...":"Create & Publish Event"})]})]}),s.jsxs(ht,{open:T,onOpenChange:_,children:[s.jsx(Nn,{asChild:!0,children:s.jsxs(L,{variant:"outline",children:[s.jsx(Tj,{className:"w-4 h-4 mr-2"}),"Scrape from URL"]})}),s.jsxs(dt,{children:[s.jsx(ft,{children:s.jsx(mt,{children:"Import Event from URL"})}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Paste an event page URL. We'll extract the details and pre-fill the Add Event form. You can edit any missing or incorrect fields before saving."}),s.jsxs("div",{children:[s.jsx(B,{children:"Event URL"}),s.jsx(Q,{type:"url",value:O,onChange:$=>G($.target.value),placeholder:"https://...",disabled:Y})]}),s.jsx(L,{onClick:Je,disabled:Y||!O.trim(),className:"w-full",children:Y?s.jsxs(s.Fragment,{children:[s.jsx(Rr,{className:"w-4 h-4 mr-2 animate-spin"})," Extracting..."]}):s.jsx(s.Fragment,{children:"Extract Event Details"})})]})]})]})]})]}),s.jsx(ve,{children:s.jsxs(pS,{defaultValue:"pending",children:[s.jsxs(gv,{className:"grid w-full grid-cols-3",children:[s.jsxs(Xn,{value:"pending",children:["Pending Approval (",on.length,")"]}),s.jsxs(Xn,{value:"approved",children:["Approved Events (",tn.length,")"]}),s.jsxs(Xn,{value:"past",children:["Past Events (",nn.length,")"]})]}),s.jsx(er,{value:"pending",children:on.length===0?s.jsx("p",{className:"text-center py-8 text-muted-foreground",children:"No pending events"}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Ft,{children:[s.jsx(Ut,{children:s.jsxs(Fe,{children:[s.jsx(te,{children:"Event"}),s.jsx(te,{children:"Date"}),s.jsx(te,{children:"City"}),s.jsx(te,{children:"Submitted By"}),s.jsx(te,{children:"Actions"})]})}),s.jsx(zt,{children:on.map($=>{var ne,$e;return s.jsxs(Fe,{children:[s.jsx(J,{children:s.jsxs("div",{className:"flex items-center gap-3",children:[$.image_url&&s.jsx("img",{src:$.image_url,alt:$.title,className:"w-16 h-16 object-cover rounded"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:$.title}),$.venue&&s.jsx("p",{className:"text-sm text-muted-foreground",children:$.venue})]})]})}),s.jsx(J,{children:new Date($.event_date+"T00:00:00").toLocaleDateString()}),s.jsx(J,{children:((ne=$.event_cities)==null?void 0:ne.name)||"N/A"}),s.jsx(J,{children:(($e=$.profiles)==null?void 0:$e.name)||"Unknown"}),s.jsx(J,{children:s.jsxs("div",{className:"flex gap-2",children:[s.jsx(L,{size:"sm",onClick:()=>
462lt($.id),className:"bg-green-600 hover:bg-green-700",children:s.jsx(gr,{className:"w-4 h-4"})}),s.jsx(L,{size:"sm",variant:"destructive",onClick:()=>vt($.id),children:s.jsx(rs,{className:"w-4 h-4"})}),s.jsx(L,{size:"sm",variant:"outline",onClick:()=>V($),children:s.jsx(oa,{className:"w-4 h-4"})})]})})]},$.id)})})]})})}),s.jsx(er,{value:"approved",children:tn.length===0?s.jsx("p",{className:"text-center py-8 text-muted-foreground",children:"No approved events"}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Ft,{children:[s.jsx(Ut,{children:s.jsxs(Fe,{children:[s.jsx(te,{children:"Event"}),s.jsx(te,{children:"Date"}),s.jsx(te,{children:"City"}),s.jsx(te,{children:"Submitted By"}),s.jsx(te,{children:"RSVPs"}),s.jsx(te,{children:"Actions"})]})}),s.jsx(zt,{children:tn.map($=>{var $e,Se;const ne=i.filter(He=>He.event_id===$.id).length;return s.jsxs(Fe,{children:[s.jsx(J,{children:s.jsxs("div",{className:"flex items-center gap-3",children:[$.image_url&&s.jsxs("div",{className:"relative",children:[s.jsx("img",{src:$.image_url,alt:$.title,className:"w-16 h-16 object-cover rounded"}),$.check_in_enabled&&s.jsx("div",{className:"absolute top-0 left-0 right-0 bg-red-600 text-white text-[6px] font-bold text-center py-0.5 rounded-t",children:"CHECK-IN"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:$.title}),$.venue&&s.jsx("p",{className:"text-sm text-muted-foreground",children:$.venue})]})]})}),s.jsx(J,{children:new Date($.event_date+"T00:00:00").toLocaleDateString()}),s.jsx(J,{children:(($e=$.event_cities)==null?void 0:$e.name)||"N/A"}),s.jsx(J,{children:((Se=$.profiles)==null?void 0:Se.name)||"Unknown"}),s.jsx(J,{children:s.jsxs(L,{size:"sm",variant:"outline",onClick:()=>Ne($),children:[s.jsx(hi,{className:"w-4 h-4 mr-1"}),ne]})}),s.jsx(J,{children:s.jsxs("div",{className:"flex gap-2",children:[s.jsx(L,{size:"sm",variant:$.check_in_enabled?"default":"outline",onClick:()=>xt($.id,!$.check_in_enabled),title:$.check_in_enabled?"Disable Check-in":"Enable Check-in",className:$.check_in_enabled?"bg-red-600 hover:bg-red-700":"",children:s.jsx(dn,{className:"w-4 h-4"})}),s.jsx(L,{size:"sm",variant:"outline",onClick:()=>V($),children:s.jsx(oa,{className:"w-4 h-4"})}),s.jsx(L,{size:"sm",variant:"destructive",onClick:()=>Qe($.id),children:s.jsx(xr,{className:"w-4 h-4"})})]})})]},$.id)})})]})})}),s.jsx(er,{value:"past",children:nn.length===0?s.jsx("p",{className:"text-center py-8 text-muted-foreground",children:"No past events"}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Ft,{children:[s.jsx(Ut,{children:s.jsxs(Fe,{children:[s.jsx(te,{children:"Event"}),s.jsx(te,{children:"Date"}),s.jsx(te,{children:"City"}),s.jsx(te,{children:"Submitted By"}),s.jsx(te,{children:"RSVPs"}),s.jsx(te,{children:"Actions"})]})}),s.jsx(zt,{children:nn.map($=>{var $e,Se;const ne=i.filter(He=>He.event_id===$.id).length;return s.jsxs(Fe,{children:[s.jsx(J,{children:s.jsxs("div",{className:"flex items-center gap-3",children:[$.image_url&&s.jsx("img",{src:$.image_url,alt:$.title,className:"w-16 h-16 object-cover rounded"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:$.title}),$.venue&&s.jsx("p",{className:"text-sm text-muted-foreground",children:$.venue})]})]})}),s.jsx(J,{children:new Date($.event_date+"T00:00:00").toLocaleDateString()}),s.jsx(J,{children:(($e=$.event_cities)==null?void 0:$e.name)||"N/A"}),s.jsx(J,{children:((Se=$.profiles)==null?void 0:Se.name)||"Unknown"}),s.jsx(J,{children:s.jsxs(L,{size:"sm",variant:"outline",onClick:()=>Ne($),children:[s.jsx(hi,{className:"w-4 h-4 mr-1"}),ne]})}),s.jsx(J,{children:s.jsxs("div",{className:"flex gap-2",children:[s.jsx(L,{size:"sm",variant:"outline",onClick:()=>V($),children:s.jsx(oa,{className:"w-4 h-4"})}),s.jsx(L,{size:"sm",variant:"destructive",onClick:()=>Qe($.id),children:s.jsx(xr,{className:"w-4 h-4"})})]})})]},$.id)})})]})})})]})})]}),s.jsx(ht,{open:f,onOpenChange:m,children:s.jsxs(dt,{className:"max-h-[90vh] overflow-y-auto",children:[s.jsx(ft,{children:s.jsx(mt,{children:"Edit Event"})}),En(),s.jsx(L,{onClick:Ve,className:"w-full mt-4",disabled:C,children:C?"Saving...":"Save Changes"})]})}),s.jsx(ht,{open:p,onOpenChange:b,children:s.jsxs(dt,{className:"max-w-2xl",children:[s.jsx(ft,{children:s.jsxs(mt,{children:["RSVPs for ",N]})}),s.jsx("div",{className:"space-y-4",children:y.length===0?s.jsx("p",{className:"text-center py-8 text-muted-foreground",children:"No RSVPs yet"}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsxs("p",{className:"text-sm text-muted-foreground",children:[y.length," total RSVPs"]}),s.jsxs(L,{variant:"outline",size:"sm",onClick:We,children:[s.jsx(di,{className:"w-4 h-4 mr-2"}),"Download CSV"]})]}),s.jsx("div",{className:"max-h-80 overflow-y-auto",children:s.jsxs(Ft,{children:[s.jsx(Ut,{children:s.jsxs(Fe,{children:[s.jsx(te,{children:"Name"}),s.jsx(te,{children:"Phone"}),s.jsx(te,{children:"RSVP Date"})]})}),s.jsx(zt,{children:y.map($=>s.jsxs(Fe,{children:[s.jsx(J,{children:$.name}),s.jsx(J,{children:$.phone_number}),s.jsx(J,{children:new Date($.created_at).toLocaleDateString()})]},$.id))})]})})]})})]})})]})},W5=()=>{const[e,t]=h.useState([]),[n,r]=h.useState(!1),[a,i]=h.useState(null),[o,l]=h.useState([]),[c,d]=h.useState(""),[u,f]=h.useState(""),[m,w]=h.useState(""),[x,p]=h.useState(""),[b,v]=h.useState(null),[g,y]=h.useState(null),[j,N]=h.useState(null),[k,C]=h.useState(null),[E,H]=h.useState(""),[A,F]=h.useState(""),[U,ae]=h.useState(""),[q,se]=h.useState(""),[D,T]=h.useState(!1),{toast:_}=_t();h.useEffect(()=>{O()},[]);const O=async()=>{const{data:P}=await R.from("photo_galleries").select("*, gallery_photos(id)").order("event_date",{ascending:!1});P&&t(P)},G=async P=>{const{data:Z}=await R.from("gallery_photos").select("*").eq("gallery_id",P).order("created_at",{ascending:!0});Z&&l(Z)},Y=async P=>{i(P),await G(P.id)},oe=async P=>{const Z=P.name.split(".").pop(),ee=`logos/${Date.now()}-${Math.random().toString(36).slice(2)}.${Z}`,{error:le}=await R.storage.from("gallery-photos").upload(ee,P);return le?(_({title:"Logo upload failed",description:le.message,variant:"destructive"}),null):R.storage.from("gallery-photos").getPublicUrl(ee).data.publicUrl},M=async()=>
462{if(!c||!u){_({title:"Please fill in title and date",variant:"destructive"});return}T(!0);try{const{data:{user:P}}=await R.auth.getUser();if(!P)throw new Error("Not authenticated");const Z=g?await oe(g):null,{data:ee,error:le}=await R.from("photo_galleries").insert({title:c,event_date:u,created_by:P.id,photographer_name:m||null,photographer_url:x||null,secondary_logo_url:Z}).select().single();if(le)throw le;if(b&&b.length>0){const z=[];for(let _e=0;_e<b.length;_e++){const ue=b[_e],De=ue.name.split(".").pop(),Ve=`${ee.id}/${Date.now()}-${_e}.${De}`,{error:lt}=await R.storage.from("gallery-photos").upload(Ve,ue);if(lt){console.error("Upload error:",lt);continue}const{data:vt}=R.storage.from("gallery-photos").getPublicUrl(Ve);z.push({gallery_id:ee.id,photo_url:vt.publicUrl})}z.length>0&&await R.from("gallery_photos").insert(z)}_({title:"Gallery created successfully!"}),r(!1),d(""),f(""),w(""),p(""),v(null),y(null),O()}catch(P){_({title:"Error",description:P.message,variant:"destructive"})}finally{T(!1)}},I=async P=>{const Z=document.createElement("input");Z.type="file",Z.accept="image/*",Z.multiple=!0,Z.onchange=async ee=>{const le=ee.target.files;if(!(!le||le.length===0)){T(!0);try{const z=[];for(let _e=0;_e<le.length;_e++){const ue=le[_e],De=ue.name.split(".").pop(),Ve=`${P}/${Date.now()}-${_e}.${De}`,{error:lt}=await R.storage.from("gallery-photos").upload(Ve,ue);if(lt)continue;const{data:vt}=R.storage.from("gallery-photos").getPublicUrl(Ve);z.push({gallery_id:P,photo_url:vt.publicUrl})}z.length>0&&(await R.from("gallery_photos").insert(z),_({title:`${z.length} photo(s) added!`})),O(),(a==null?void 0:a.id)===P&&await G(P)}catch(z){_({title:"Error",description:z.message,variant:"destructive"})}finally{T(!1)}}},Z.click()},he=P=>{try{const Z="/object/public/gallery-photos/",ee=P.indexOf(Z);return ee===-1?null:decodeURIComponent(P.substring(ee+Z.length))}catch{return null}},X=async P=>{if(!confirm("Delete this photo?"))return;const Z=he(P.photo_url);Z&&await R.storage.from("gallery-photos").remove([Z]);const{error:ee}=await R.from("gallery_photos").delete().eq("id",P.id);ee?_({title:"Error",description:ee.message,variant:"destructive"}):(_({title:"Photo deleted"}),l(le=>le.filter(z=>z.id!==P.id)),O())},K=async P=>{if(!confirm("Delete this gallery and all its photos?"))return;const{data:Z}=await R.from("gallery_photos").select("photo_url").eq("gallery_id",P);if(Z&&Z.length>0){const le=Z.map(z=>he(z.photo_url)).filter(Boolean);le.length>0&&await R.storage.from("gallery-photos").remove(le)}await R.from("gallery_photos").delete().eq("gallery_id",P);const{error:ee}=await R.from("photo_galleries").delete().eq("id",P);ee?_({title:"Error",description:ee.message,variant:"destructive"}):(_({title:"Gallery deleted"}),(a==null?void 0:a.id)===P&&i(null),O())};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("h2",{className:"text-xl font-semibold",children:"Photo Galleries"}),s.jsxs(ht,{open:n,onOpenChange:r,children:[s.jsx(Nn,{asChild:!0,children:s.jsxs(L,{children:[s.jsx(os,{className:"w-4 h-4 mr-2"})," New Gallery"]})}),s.jsxs(dt,{children:[s.jsx(ft,{children:s.jsx(mt,{children:"Create Photo Gallery"})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(B,{children:"Gallery Title"}),s.jsx(Q,{value:c,onChange:P=>d(P.target.value),placeholder:"e.g. Summer Block Party 2025"})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Event Date"}),s.jsx(Q,{type:"date",value:u,onChange:P=>f(P.target.value)})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Photographer Name (optional)"}),s.jsx(Q,{value:m,onChange:P=>w(P.target.value),placeholder:"e.g. Jane Smith Photography"})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Photographer Website (optional)"}),s.jsx(Q,{value:x,onChange:P=>p(P.target.value),placeholder:"https://example.com"})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Second Logo (optional)"}),s.jsx(Q,{type:"file",accept:"image/png,image/jpeg,image/webp",onChange:P=>{var Z;return y(((Z=P.target.files)==null?void 0:Z[0])||null)}}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Placed opposite the Street Pass logo and baked into downloaded photos."})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Photos (select multiple)"}),s.jsx(Q,{type:"file",accept:"image/*",multiple:!0,onChange:P=>v(P.target.files)})]}),s.jsx(L,{onClick:M,disabled:D,className:"w-full",children:D?"Uploading...":"Create Gallery"})]})]})]})]}),s.jsx(pe,{children:s.jsx(ve,{className:"p-0",children:s.jsxs(Ft,{children:[s.jsx(Ut,{children:s.jsxs(Fe,{children:[s.jsx(te,{children:"Title"}),s.jsx(te,{children:"Date"}),s.jsx(te,{children:"Photos"}),s.jsx(te,{children:"Views"}),s.jsx(te,{children:"Actions"})]})}),s.jsxs(zt,{children:[e.map(P=>{var Z;return s.jsxs(Fe,{children:[s.jsx(J,{className:"font-medium",children:P.title}),s.jsx(J,{children:new Date(P.event_date+"T00:00:00").toLocaleDateString()}),s.jsx(J,{children:((Z=P.gallery_photos)==null?void 0:Z.length)||0}),s.jsx(J,{children:P.view_count||0}),s.jsx(J,{children:s.jsxs("div",{className:"flex gap-2 flex-wrap",children:[s.jsxs(L,{size:"sm",variant:"outline",onClick:()=>Y(P),children:[s.jsx(Os,{className:"w-4 h-4 mr-1"})," Manage"]}),s.jsxs(L,{size:"sm",variant:"outline",onClick:()=>{C(P),H(P.title),F(P.event_date),ae(P.photographer_name||""),se(P.photographer_url||"")},children:[s.jsx(oa,{className:"w-4 h-4 mr-1"})," Edit"]}),s.jsxs(L,{size:"sm",variant:"outline",onClick:()=>I(P.id),disabled:D,children:[s.jsx(sy,{className:"w-4 h-4 mr-1"})," Add"]}),s.jsx(L,{size:"sm",variant:"destructive",onClick:()=>K(P.id),children:s.jsx(xr,{className:"w-4 h-4"})})]})})]},P.id)}),e.length===0&&s.jsx(Fe,{children:s.jsx(J,{colSpan:5,className:"text-center text-muted-foreground",children:"No galleries yet"})})]})]})})}),s.jsx(ht,{open:!!a,onOpenChange:P=>!P&&i(null),children:s.jsxs(dt,{className:"max-w-3xl max-h-[80vh] overflow-y-auto",children:[s.jsx(ft,{children:s.jsxs(mt,{children:[a==null?void 0:a.title," â ",(a==null?void 0:a.event_date)&&new Date(a.event_date+"T00:00:00").toLocaleDateString()]})}),o.length>0?s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:o.map(P=>s.jsxs("div",{className:"relative group rounded-lg overflow-hidden border border-border",children:[s.jsx("img",{src:P.photo_url,alt:"",className:"w-full aspect-square object-cover"}),s.jsx(L,{size:"sm",variant:"destructive",className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity h-7 w-7 p-0",onClick:()=>X(P),children:s.jsx(xr,{className:"w-3 h-3"})})]},P.id))}):s.jsx("p",{className:"text-center text-muted-foreground py-8",children:"No photos in this gallery."}),s.jsxs(L,{variant:"outline",onClick:()=>I(a==null?void 0:a.id),disabled:D,children:[s.jsx(sy,{className:"w-4 h-4 mr-1"})," Add More Photos"]})]})}),s.jsx(ht,{open:!!k,onOpenChange:P=>!P&&C(null),children:s.jsxs(dt,{children:[s.jsx(ft,{children:s.jsx(mt,{children:"Edit Gallery"})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(B,{children:"Gallery Title"}),s.jsx(Q,{value:E,onChange:P=>H(P.target.value)})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Event Date"}),s.jsx(Q,{type:"date",value:A,onChange:P=>F(P.target.value)})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Photographer Name (optional)"}),s.jsx(Q,{value:U,onChange:P=>ae(P.target.value),placeholder:"e.g. Jane Smith Photography"})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Photographer Website (
462optional)"}),s.jsx(Q,{value:q,onChange:P=>se(P.target.value),placeholder:"https://example.com"})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Second Logo (optional)"}),(k==null?void 0:k.secondary_logo_url)&&s.jsxs("div",{className:"flex items-center gap-2 my-2",children:[s.jsx("img",{src:k.secondary_logo_url,alt:"Second logo",className:"h-10 object-contain"}),s.jsx(L,{size:"sm",variant:"destructive",onClick:async()=>{const{error:P}=await R.from("photo_galleries").update({secondary_logo_url:null}).eq("id",k.id);P?_({title:"Error",description:P.message,variant:"destructive"}):(C({...k,secondary_logo_url:null}),_({title:"Logo removed"}),O())},children:"Remove"})]}),s.jsx(Q,{type:"file",accept:"image/png,image/jpeg,image/webp",onChange:P=>{var Z;return N(((Z=P.target.files)==null?void 0:Z[0])||null)}}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Placed opposite the Street Pass logo and baked into downloaded photos."})]}),s.jsx(L,{className:"w-full",disabled:D,onClick:async()=>{if(!E||!A){_({title:"Title and date are required",variant:"destructive"});return}let P;if(j&&(T(!0),P=await oe(j),T(!1),!P))return;const{error:Z}=await R.from("photo_galleries").update({title:E,event_date:A,ph
462otographer_name:U||null,photographer_url:q||null,...P?{secondary_logo_url:P}:{}}).eq("id",k.id);Z?_({title:"Error",description:Z.message,variant:"destructive"}):(_({title:"Gallery updated!"}),C(null),N(null),O())},children:"Save Changes"})]})]})})]})};var kS="AlertDialog",[H5,G6]=Hr(kS,[K_]),$s=K_(),CS=e=>{const{__scopeAlertDialog:t,...n}=e,r=$s(t);return s.jsx(uN,{...r,...n,modal:!0})};CS.displayName=kS;var q5="AlertDialogTrigger",ES=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=$s(n);return s.jsx(hN,{...a,...r,ref:t})});ES.displayName=q5;var Y5="AlertDialogPortal",PS=e=>{const{__scopeAlertDialog:t,...n}=e,r=$s(t);return s.jsx(fN,{...r,...n})};PS.displayName=Y5;var G5="AlertDialogOverlay",TS=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=$s(n);return s.jsx(Jg,{...a,...r,ref:t})});TS.displayName=G5;var co="AlertDialogContent",[K5,Z5]=H5(co),RS=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,i=$s(n),o=h.useRef(null),l=wt(t,o),c=h.useRef(null);return s.jsx(VO,{contentName:co,titleName:DS,docsSlug:"alert-dialog",children:s.jsx(K5,{scope:n,cancelRef:c,children:s.jsxs(Xg,{role:"alertdialog",...i,...a,ref:l,onOpenAutoFocus:Le(a.onOpenAutoFocus,d=>{var u;d.preventDefault(),(u=c.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[s.jsx(bg,{children:r}),s.jsx(J5,{contentRef:o})]})})})});RS.displayName=co;var DS="AlertDialogTitle",OS=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=$s(n);return s.jsx(ev,{...a,...r,ref:t})});OS.displayName=DS;var AS="AlertDialogDescription",MS=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=$s(n);return s.jsx(tv,{...a,...r,ref:t})});MS.displayName=AS;var Q5="AlertDialogAction",IS=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=$s(n);return s.jsx(nv,{...a,...r,ref:t})});IS.displayName=Q5;var LS="AlertDialogCancel",$S=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=Z5(LS,n),i=$s(n),o=wt(t,a);return s.jsx(nv,{...i,...r,ref:o})});$S.displayName=LS;var J5=({contentRef:e})=>{const t=`\`${co}\` requires a description for the component to be accessible for screen reader users. 463 464You can add a description to the \`${co}\` by passing a \`${AS}\` component as a child, which also benefits sighted users by adding visible context to the dialog. 465 466Alternatively, 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 \`${co}\`. 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. 467 468For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return h.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},X5=CS,e3=ES,t3=PS,FS=TS,US=RS,zS=IS,BS=$S,VS=OS,WS=MS;const n3=X5,r3=e3,s3=t3,HS=h.forwardRef(({className:e,...t},n)=>s.jsx(FS,{className:ke("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}));HS.displayName=FS.displayName;const qS=h.forwardRef(({className:e,...t},n)=>s.jsxs(s3,{children:[s.jsx(HS,{}),s.jsx(US,{ref:n,className:ke("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),...t})]}));qS.displayName=US.displayName;const YS=({className:e,...t})=>s.jsx("div",{className:ke("flex flex-col space-y-2 text-center sm:text-left",e),...t});YS.displayName="AlertDialogHeader";const GS=({className:e,...t})=>s.jsx("div",{className:ke("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});GS.displayName="AlertDialogFooter";const KS=h.forwardRef(({className:e,...t},n)=>s.jsx(VS,{ref:n,className:ke("text-lg font-semibold",e),...t}));KS.displayName=VS.displayName;const ZS=h.forwardRef(({className:e,...t},n)=>s.jsx(WS,{ref:n,className:ke("text-sm text-muted-foreground",e),...t}));ZS.displayName=WS.displayName;const QS=h.forwardRef(({className:e,...t},n)=>s.jsx(zS,{ref:n,className:ke(sc(),e),...t}));QS.displayName=zS.displayName;const JS=h.forwardRef(({className:e,...t},n)=>s.jsx(BS,{ref:n,className:ke(sc({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));JS.displayName=BS.displayName;const a3=()=>{const[e,t]=h.useState([]),[n,r]=h.useState(!0),{toast:a}=_t();h.useEffect(()=>{i()},[]);const i=async()=>{try{const{data:f,error:m}=await R.from("fundraiser_organizations").select("*").order("created_at",{ascending:!1});if(m)throw m;const w=[...new Set((f||[]).map(p=>
468p.user_id))];let x={};if(w.length>0){const{data:p}=await R.from("profiles").select("id, name").in("id",w);p&&(x=Object.fromEntries(p.map(b=>[b.id,b.name])))}t((f||[]).map(p=>({...p,registered_by_name:x[p.user_id]||"Unknown"})))}catch(f){console.error("Error fetching fundraiser orgs:",f)}finally{r(!1)}},o=async(f,m)=>{try{const{error:w}=await R.from("fundraiser_organizations").update({status:m}).eq("id",f);if(w)throw w;a({title:"Updated",description:`Organization ${m}`}),i()}catch(w){a({title:"Error",description:w.message,variant:"destructive"})}},l=async f=>{try{const{error:m}=await R.from("fundraiser_organizations").delete().eq("id",f);if(m)throw m;a({title:"Deleted",description:"Organization has been removed"}),i()}catch(m){a({title:"Error",description:m.message,variant:"destructive"})}},c=e.reduce((f,m)=>f+(m.total_signups||0),0),d=e.reduce((f,m)=>f+Number(m.total_sales||0),0),u=e.reduce((f,m)=>f+Number(m.earnings||0),0);return n?s.jsx("p",{children:"Loading fundraiser data..."}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-4",children:[s.jsx(pe,{children:s.jsx(ve,{className:"pt-6",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(ih,{className:"h-6 w-6 text-primary"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Organizations"}),s.jsx("p",{className:"text-xl font-bold",children:e.length})]})]})})}),s.jsx(pe,{children:s.jsx(ve,{className:"pt-6",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(hi,{className:"h-6 w-6 text-primary"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Sign-ups"}),s.jsx("p",{className:"text-xl font-bold",children:c})]})]})})}),s.jsx(pe,{children:s.jsx(ve,{className:"pt-6",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(xu,{className:"h-6 w-6 text-primary"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Sales"}),s.jsxs("p",{className:"text-xl font-bold",children:["$",d.toFixed(2)]})]})]})})}),s.jsx(pe,{children:s.jsx(ve,{className:"pt-6",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(kg,{className:"h-6 w-6 text-primary"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Org Earnings"}),s.jsxs("p",{className:"text-xl font-bold",children:["$",u.toFixed(2)]})]})]})})})]}),s.jsxs(pe,{children:[s.jsxs(Ae,{children:[s.jsx(Me,{children:"Fundraiser Organizations"}),s.jsx(St,{children:"All registered nonprofit fundraiser organizations"})]}),s.jsx(ve,{children:e.length===0?s.jsx("p",{className:"text-muted-foreground text-center py-4",children:"No fundraiser organizations registered yet."}):s.jsxs(Ft,{containerClassName:"max-w-none px-0",children:[s.jsx(Ut,{children:s.jsxs(Fe,{children:[s.jsx(te,{children:"Organization"}),s.jsx(te,{children:"Registered By"}),s.jsx(te,{children:"Phone"}),s.jsx(te,{children:"Code"}),s.jsx(te,{children:"Status"}),s.jsx(te,{className:"text-right",children:"Sign-ups"}),s.jsx(te,{className:"text-right",children:"Sales"}),s.jsx(te,{className:"text-right",children:"Earnings (50%)"}),s.jsx(te,{children:"Created"}),s.jsx(te,{children:"Actions"})]})}),s.jsx(zt,{children:e.map(f=>s.jsxs(Fe,{children:[s.jsx(J,{className:"font-medium",children:f.organization_name}),s.jsx(J,{children:f.registered_by_name}),s.jsx(J,{children:f.phone_number||"â"}),s.jsx(J,{className:"font-mono text-sm",children:f.fundraiser_code}),s.jsx(J,{children:s.jsx(Ie,{variant:f.status==="approved"?"default":f.status==="rejected"?"destructive":"secondary",children:f.status==="approved"?"Approved":f.status==="rejected"?"Rejected":"Pending"})}),s.jsx(J,{className:"text-right",children:f.total_signups||0}),s.jsxs(J,{className:"text-right",children:["$",Number(f.total_sales||0).toFixed(2)]}),s.jsxs(J,{className:"text-right",children:["$",Number(f.earnings||0).toFixed(2)]}),s.jsx(J,{children:new Date(f.created_at).toLocaleDateString()}),s.jsx(J,{children:s.jsxs("div",{className:"flex items-center gap-1",children:[f.status!=="approved"&&s.jsx(L,{variant:"ghost",size:"icon",className:"h-7 w-7 text-green-600",onClick:()=>
468o(f.id,"approved"),title:"Approve",children:s.jsx(ci,{className:"h-4 w-4"})}),f.status!=="rejected"&&s.jsx(L,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive",onClick:()=>o(f.id,"rejected"),title:"Reject",children:s.jsx(_2,{className:"h-4 w-4"})}),s.jsxs(n3,{children:[s.jsx(r3,{asChild:!0,children:s.jsx(L,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive",title:"Delete",children:s.jsx(xr,{className:"h-4 w-4"})})}),s.jsxs(qS,{children:[s.jsxs(YS,{children:[s.jsx(KS,{children:"Delete Organization"}),s.jsxs(ZS,{children:['Are you sure you want to delete "',f.organization_name,'"? This action cannot be undone.']})]}),s.jsxs(GS,{children:[s.jsx(JS,{children:"Cancel"}),s.jsx(QS,{onClick:()=>l(f.id),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})]})]})})]},f.id))})]})})]})]})},Kr=e=>{const t=e==null?void 0:e.timestamp;if(t&&typeof t=="string"){const r=t.includes("T")?t:t.replace(" ","T"),a=new Date(r);if(!isNaN(a.getTime()))return a}const n=e==null?void 0:e.date;if(typeof n=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(n)){const[r,a,i]=n.split("-").map(Number);return new Date(r,a-1,i)}return new Date(n)},i3=()=>{var $v,Fv;const[e,t]=h.useState(null),[n,r]=h.useState(!0),[a,i]=h.useState([]),[o,l]=h.useState([]),[c,d]=h.useState([]),[u,f]=h.useState([]),[m,w]=h.useState([]),[x,p]=h.useState([]),[b,v]=h.useState(0),g=Et(),{toast:y}=_t(),[j,N]=h.useState(!1),[k,C]=h.useState(!1),[E,H]=h.useState(!1),[A,F]=h.useState(!1),[U,ae]=h.useState(!1),[q,se]=h.useState(!1),[D,T]=h.useState(null),[_,O]=h.useState(null),[G,Y]=h.useState(null),[oe,M]=h.useState([]),[I,he]=h.useState(""),[X,K]=h.useState(""),[P,Z]=h.useState({name:"",description:"",points_cost:"",category_id:"",membership_levels:[],file_url:"",external_url:""}),[ee,le]=h.useState(null),[z,_e]=h.useState(!1),[ue,De]=h.useState({name:"",date:"",points:"",address:"",latitude:"",longitude:"",check_in_radius:"5"}),[Ve,lt]=h.useState({name:"",description:""}),[vt,Qe]=h.useState(!1),[re,ie]=h.useState(""),[Ce,V]=h.useState(!1),[ge,Ne]=h.useState(""),[Pe,We]=h.useState(!1),xt=a.filter(S=>{if(Pe&&S.emailConfirmedAt)return!1;if(!ge.trim())return!0;const W=ge.toLowerCase().trim(),we=(S.name||"").toLowerCase(),me=(S.email||"").toLowerCase(),de=(S.referral_code||"").toLowerCase();return we.includes(W)||me.includes(W)||de.includes(W)});h.useEffect(()=>{(async()=>{try{const{data:{session:W}}=await R.auth.getSession();if(!(W!=null&&W.user)){g("/admin-auth"),r(!1);return}const{data:we,error:me}=await R.rpc("is_admin");if(me||!we){y({title:"Access Denied",description:"You don't have admin privileges.",variant:"destructive"}),g("/"),r(!1);return}t(W.user),await Je()}catch(W){console.error("Auth check error:",W),g("/admin-auth")}finally{r(!1)}})()},[]);const Je=async()=>{try{const[S,W,we,me,de,fe,Be,Oe]=await Promise.all([R.rpc("get_all_users_with_profiles"),R.rpc("admin_get_rewards"),R.rpc("admin_get_events"),R.from("membership_plans").select("*"),R.from("reward_categories").select("*"),R.from("payout_requests").select(` 469 *, 470 profiles!user_id(name) 471 `).order("created_at",{ascending:!1}),R.from("claimed_rewards").select(` 472 *, 473 rewards(name, points_cost) 474 `).order("claimed_at",{ascending:!1}),R.from("business_listings").select("*",{count:"exact",head:!0}).eq("check_in_enabled",!0).eq("status","approved")]);if(S.data&&i(S.data),W.data){const Ge=de.data||[],Tt=Object.fromEntries(Ge.map(Ht=>[Ht.id,Ht]));l(W.data.map(Ht=>{var mn;return{...Ht,reward_categories:Ht.category_id?{name:(mn=Tt[Ht.category_id])==null?void 0:mn.name}:null}}))}we.data&&d(we.data),me.data&&f(me.data),de.data&&w(de.data),fe.data&&p(fe.data),Be.data&&M(Be.data),typeof Oe.count=="number"&&v(Oe.count)}catch(S){console.error("Error loading data:",S)}},It=()=>{const S="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";let W="";for(let we=0;we<6;we++)W+=S.charAt(Math.floor(Math.random()*S.length));return W},on=F5.string().trim().min(5,{message:"Address is too short"}).max(200,{message:"Address is too long"}).regex(/^[A-Za-z0-9\s\.,#\-]+$/,{message:"Invalid characters in address"}),tn=async S=>{var W,we;try{console.log("Geocoding via edge function for address:",S);const me=on.safeParse(S);
474if(!me.success)return{latitude:0,longitude:0,error:((we=(W=me.error.issues)==null?void 0:W[0])==null?void 0:we.message)||"Invalid address"};const de=me.data.trim().replace(/\s+/g," ");console.log("Geocoding via edge function for address:",de);const{data:fe,error:Be}=await R.functions.invoke("geocode",{body:{address:de}});if(Be)return console.error("Edge function error:",Be),{latitude:0,longitude:0,error:Be.message||"Edge function error"};console.log("Geocode raw payload:",fe);const Oe=fe;if(typeof Oe=="string")return{latitude:0,longitude:0,error:Oe};if(Oe&&typeof Oe.error=="string")return console.warn("Geocode function returned error:",Oe.error),{latitude:0,longitude:0,error:Oe.error};const Ge=typeof(Oe==null?void 0:Oe.latitude)=="number"?Oe.latitude:typeof(Oe==null?void 0:Oe.latitude)=="string"?parseFloat(Oe.latitude):typeof(Oe==null?void 0:Oe.lat)=="number"?Oe.lat:typeof(Oe==null?void 0:Oe.lat)=="string"?parseFloat(Oe.lat):NaN,Tt=typeof(Oe==null?void 0:Oe.longitude)=="number"?Oe.longitude:typeof(Oe==null?void 0:Oe.longitude)=="string"?parseFloat(Oe.longitude):typeof(Oe==null?void 0:Oe.lon)=="number"?Oe.lon:typeof(Oe==null?void 0:Oe.lon)=="string"?parseFloat(Oe.lon):NaN;if(!Number.isFinite(Ge)||!Number.isFinite(Tt)){const mn=typeof(Oe==null?void 0:Oe.error)=="string"?Oe.error:typeof(Oe==null?void 0:Oe.message)=="string"?Oe.message:"Address not found";return console.error("Invalid geocode response:",Oe),{latitude:0,longitude:0,error:mn}}const Ht={latitude:Ge,longitude:Tt};return console.log("Geocoding success:",Ht),Ht}catch(me){return console.error("Geocoding error:",me),{latitude:0,longitude:0,error:me instanceof Error?me.message:"Unknown error"}}},nn=async()=>{if(!ue.address||ue.address.trim().length===0){y({title:"No Address",description:"Please enter an address first",variant:"destructive"});return}try{y({title:"Geocoding...",description:"Converting address to GPS coordinates"});const S=await tn(ue.address);if(!S||S.error||S.latitude===0||S.longitude===0){y({title:"Geocoding Failed",description:(S==null?void 0:S.error)||"Could not find GPS coordinates for this address",variant:"destructive"});return}De(W=>({...W,latitude:S.latitude.toString(),longitude:S.longitude.toString()})),y({title:"GPS Coordinates Added",description:`Lat: ${S.latitude.toFixed(6)}, Lon: ${S.longitude.toFixed(6)}`})}catch(S){y({title:"Error",description:S.message,variant:"destructive"})}},En=async S=>{if(!S.address){y({title:"No Address",description:"This event doesn't have an address to geocode",variant:"destructive"});return}try{y({title:"Geocoding...",description:"Converting address to GPS coordinates"});const W=await tn(S.address);if(!W){y({title:"Geocoding Failed",description:"Could not find GPS coordinates for this address",variant:"destructive"});return}const{error:we}=await R.from("events").update({latitude:W.latitude,longitude:W.longitude}).eq("id",S.id);if(we)throw we;y({title:"GPS Coordinates Added",description:`Lat: ${W.latitude.toFixed(6)}, Lon: ${W.longitude.toFixed(6)}`}),await Je()}catch(W){y({title:"Error",description:W.message,variant:"destructive"})}},$=async()=>{if(!(!D||!I))try{const S=parseInt(I),{error:W}=await R.rpc("admin_update_user_points",{user_id_to_update:D.id,points_to_add:S});if(W)throw W;y({title:"Points Updated",description:`Added ${S} points to ${D.name}`}),N(!1),he(""),await Je()}catch(S){y({title:"Error",description:S.message,variant:"destructive"})}},ne=async()=>{var S;if(!(!D||!X))try{const W=parseInt(X),{error:we}=await R.rpc("admin_change_user_membership",{user_id_to_update:D.id,new_plan_id:W});if(we)throw we;const me=((S=u.find(de=>de.id===W))==null?void 0:S.name)||"Unknown";y({title:"Membership Updated",description:`Changed ${D.name}'s membership to ${me}`}),N(!1),K(""),await Je()}catch(W){y({title:"Error",description:W.message,variant:"destructive"})}},$e=async S=>{const W=S.name.split(".").pop(),me=`rewards/${`${Date.now()}-${Math.random().toString(36).substring(2)}.${W}`}`,{error:de}=await R.storage.from("reward-files").upload(me,S);if(de)throw de;const{data:fe}=R.storage.from("reward-files").getPublicUrl(me);return fe.publicUrl},Se=async()=>{try{_e(!0);let S="";ee&&(S=await $e(ee));const{error:W}=await R.from("rewards").insert({name:P.name,description:P.description,points_cost:parseInt(P.points_cost),category_id:parseInt(P.category_id),membership_levels:P.membership_levels.map(String),file_url:S||null,external_url:P.external_url||null});if(W)throw W;y({title:"Reward Created",description:`${P.name} has been created`}),H(!1),Z({name:"",description:"",points_cost:"",category_id:"",membership_levels:[],file_url:"",external_url:""}),le(null),await Je()}catch(S){y({title:"Error",description:S.message,variant:"destructive"})}finally{_e(!1)}},He=async()=>
474{if(_)try{_e(!0);let S=_.file_url;ee&&(S=await $e(ee));const{error:W}=await R.from("rewards").update({name:P.name,description:P.description,points_cost:parseInt(P.points_cost),category_id:parseInt(P.category_id),membership_levels:P.membership_levels.map(String),file_url:S||null,external_url:P.external_url||null}).eq("id",_.id);if(W)throw W;y({title:"Reward Updated",description:`${P.name} has been updated`}),C(!1),Z({name:"",description:"",points_cost:"",category_id:"",membership_levels:[],file_url:"",external_url:""}),O(null),le(null),await Je()}catch(S){y({title:"Error",description:S.message,variant:"destructive"})}finally{_e(!1)}},Xe=async()=>{try{const S=It(),{error:W}=await R.from("events").insert({name:ue.name,date:ue.date,points:parseInt(ue.points),checkin_code:S,address:ue.address||null,latitude:ue.latitude?parseFloat(ue.latitude):null,longitude:ue.longitude?parseFloat(ue.longitude):null,check_in_radius:parseInt(ue.check_in_radius)||5});if(W)throw W;y({title:"Event Created",description:`${ue.name} created with code: ${S}`}),F(!1),De({name:"",date:"",points:"",address:"",latitude:"",longitude:"",check_in_radius:"5"}),await Je()}catch(S){y({title:"Error",description:S.message,variant:"destructive"})}},je=async()=>{if(G)try{const{error:S}=await R.from("events").update({name:ue.name,date:ue.date,points:parseInt(ue.points),address:ue.address||null,latitude:ue.latitude?parseFloat(ue.latitude):null,longitude:ue.longitude?parseFloat(ue.longitude):null,check_in_radius:parseInt(ue.check_in_radius)||5}).eq("id",G.id);if(S)throw S;y({title:"Event Updated",description:`${ue.name} has been updated`}),ae(!1),De({name:"",date:"",points:"",address:"",latitude:"",longitude:"",check_in_radius:"5"}),Y(null),await Je()}catch(S){y({title:"Error",description:S.message,variant:"destructive"})}},st=async(S,W)=>{try{const{error:we}=await R.from("events").update({is_active:!W}).eq("id",S);if(we)throw we;y({title:"Event Updated",description:`Event ${W?"deactivated":"activated"}`}),await Je()}catch(we){y({title:"Error",description:we.message,variant:"destructive"})}},Yt=async(S,W)=>{try{const{error:we}=await R.from("rewards").update({active:!W}).eq("id",S);if(we)throw we;y({title:"Reward Updated",description:`Reward ${W?"deactivated":"activated"}`}),await Je()}catch(we){y({title:"Error",description:we.message,variant:"destructive"})}},et=async()=>{try{const{error:S}=await R.from("reward_categories").insert({name:Ve.name,description:Ve.description});if(S)throw S;y({title:"Category Created",description:`${Ve.name} has been created`}),se(!1),lt({name:"",description:""}),await Je()}catch(S){y({title:"Error",description:S.message,variant:"destructive"})}},at=async S=>{try{const{error:W}=await R.from("reward_categories").delete().eq("id",S);if(W)throw W;y({title:"Category Deleted",description:"Category has been deleted"}),await Je()}catch(W){y({title:"Error",description:W.message,variant:"destructive"})}},Zn=async(S,W)=>{if(confirm(`Are you sure you want to delete ${W}? This action cannot be undone and will permanently remove all user data.`))try{const{error:we}=await R.rpc("admin_delete_user",{user_id_to_delete:S});if(we)throw we;y({title:"Member Deleted",description:`${W} has been permanently deleted`}),await Je()}catch(we){y({title:"Error",description:we.message,variant:"destructive"})}},[Fa,Fs]=h.useState({}),Kc=async(S,W)=>{var me;const we=Fa[S];if(we&&Date.now()-we<6e4){const de=Math.ceil((6e4-(Date.now()-we))/1e3);y({title:"Please wait",description:`You can resend to ${W||S} in ${de} seconds. Supabase limits email sending rate.`,variant:"destructive"});return}try{const{error:de}=await R.auth.resend({type:"signup",email:S,options:{emailRedirectTo:`${window.location.origin}/auth/confirm`}});if(de){if((me=de.message)!=null&&me.toLowerCase().includes("rate limit")){y({title:"Rate Limit Exceeded",description:"Supabase limits how often confirmation emails can be sent. Please wait a few minutes before trying again.",variant:"destructive"}),Fs(fe=>({...fe,[S]:Date.now()+24e4}));return}throw de}Fs(fe=>({...fe,[S]:Date.now()})),y({title:"Confirmation Email Sent",description:`A new confirmation email has been sent to ${W||S}.`})}catch(de){y({title:"Error",description:de.message,variant:"destructive"})}},Qo=async()=>{try{await R.auth.signOut(),g("/sign-in")}catch(S){console.error("Logout error:",S),g("/sign-in")}},Lv=async(S,W,we)=>{try{const{error:me}=await R.rpc("process_payout",{p_request_id:S,p_status:W,p_notes:we||null});if(me)throw me;y({title:"Payout Processed",description:`Payout request has been ${W}`}),await Je()}catch(me){y({title:"Error",description:me.message,variant:"destructive"})}},qk=async S=>{try{const{error:W}=await R.from("claimed_rewards").update({status:"delivered",delivered_at:new Date().toISOString(),delivered_by:e.id}).eq("id",S);if(W)throw W;y({title:"Marked as Delivered",description:"Reward has been marked as delivered"}),await Je()}catch(W){y({title:"Error",description:W.message,variant:"destructive"})}},Pt=S=>String(S??"").replace(/[,\r\n]/g," "),Yk=()=>{const S=["Name,Email,Resident City,Phone,Points,Membership,Introductory Expires,Membership Expires,Earnings,Business Owner,Business N
474ame,Business Type,Business Address,Business City,Business State,Business Zip,Business Phone,Business Website,Created",...a.map(de=>{var fe;return[Pt(de.name),Pt(de.email),Pt(de.residentCity),Pt(de.phoneNumber),de.points||0,Pt((fe=de.membership)==null?void 0:fe.name),de.trialEndsAt?new Date(de.trialEndsAt).toLocaleDateString():"",de.membershipEndDate?new Date(de.membershipEndDate).toLocaleDateString():"",de.earnings||0,de.is_business_owner?"Yes":"No",Pt(de.business_name),Pt(de.business_type),Pt(de.business_address),Pt(de.business_city),Pt(de.business_state),Pt(de.business_zip),Pt(de.business_phone),Pt(de.business_website),new Date(de.createdAt).toLocaleDateString()].join(",")})].join(` 475`),W=new Blob([S],{type:"text/csv"}),we=window.URL.createObjectURL(W),me=document.createElement("a");me.href=we,me.download=`street-pass-members-${new Date().toISOString().split("T")[0]}.csv`,me.click(),window.URL.revokeObjectURL(we)},Gk=()=>{const W=["Name,Email,Business Name,Business Type,Business Address,Business City,Business State,Business Zip,Business Phone,Business Website,Resident City,Phone,Membership,Created",...a.filter(fe=>fe.is_business_owner).map(fe=>{var Be;return[Pt(fe.name),Pt(fe.email),Pt(fe.business_name),Pt(fe.business_type),Pt(fe.business_address),Pt(fe.business_city),Pt(fe.business_state),Pt(fe.business_zip),Pt(fe.business_phone),Pt(fe.business_website),Pt(fe.residentCity),Pt(fe.phoneNumber),Pt((Be=fe.membership)==null?void 0:Be.name),new Date(fe.createdAt).toLocaleDateString()].join(",")})].join(` 476`),we=new Blob([W],{type:"text/csv"}),me=window.URL.createObjectURL(we),de=document.createElement("a");de.href=me,de.download=`street-pass-business-owners-${new Date().toISOString().split("T")[0]}.csv`,de.click(),window.URL.revokeObjectURL(me)};return n?s.jsx("div",{className:"min-h-screen flex items-center justify-center",children:s.jsx("div",{className:"text-center",children:"Loading admin panel..."})}):s.jsx("div",{className:"min-h-screen bg-background p-6",children:s.jsxs("div",{className:"max-w-none px-0",children:[s.jsxs("div",{className:"flex justify-between items-center mb-8",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-bold text-primary",children:"Admin Panel"}),s.jsx("p",{className:"text-muted-foreground",children:"Manage members, rewards, and events"})]}),s.jsxs("div",{className:"flex gap-4",children:[s.jsxs(L,{onClick:Yk,variant:"outline",children:[s.jsx(di,{className:"w-4 h-4 mr-2"}),"Export Members"]}),s.jsxs(L,{onClick:Gk,variant:"outline",children:[s.jsx(zm,{className:"w-4 h-4 mr-2"}),"Export Biz Owners"]}),s.jsxs(L,{onClick:Qo,variant:"outline",children:[s.jsx(R2,{className:"w-4 h-4 mr-2"}),"Log Out"]})]})]}),s.jsxs(pS,{defaultValue:"stats",className:"w-full",children:[s.jsxs(gv,{className:"grid w-full grid-cols-9",children:[s.jsxs(Xn,{value:"stats",className:"flex items-center gap-2",children:[s.jsx(b2,{className:"w-4 h-4"}),"Stats"]}),s.jsxs(Xn,{value:"members",className:"flex items-center gap-2",children:[s.jsx(hi,{className:"w-4 h-4"}),"Members"]}),s.jsxs(Xn,{value:"rewards",className:"flex items-center gap-2",children:[s.jsx(Eo,{className:"w-4 h-4"}),"Rewards"]}),s.jsxs(Xn,{value:"events",className:"flex items-center gap-2",children:[s.jsx(rr,{className:"w-4 h-4"}),"Codes"]}),s.jsxs(Xn,{value:"public-events",className:"flex items-center gap-2",children:[s.jsx(Oj,{className:"w-4 h-4"}),"Events"]}),s.jsxs(Xn,{value:"directory",className:"flex items-center gap-2",children:[s.jsx(M2,{className:"w-4 h-4"}),"Directory"]}),s.jsxs(Xn,{value:"photos",className:"flex items-center gap-2",children:[s.jsx(zd,{className:"w-4 h-4"}),"Photos"]}),s.jsxs(Xn,{value:"fundraisers",className:"flex items-center gap-2",children:[s.jsx(ih,{className:"w-4 h-4"}),"Fundraisers"]}),s.jsxs(Xn,{value:"payouts",className:"flex items-center gap-2",children:[s.jsx(di,{className:"w-4 h-4"}),"Payouts"]})]}),s.jsx(er,{value:"members",children:s.jsxs(pe,{children:[s.jsxs(Ae,{children:[s.jsx(Me,{children:"Member Management"}),s.jsx(St,{children:"View and manage member accounts and points"}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mt-4",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(Mj,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(Q,{placeholder:"Search by name, email, or referral code...",value:ge,onChange:S=>Ne(S.target.value),className:"pl-10 max-w-md"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ca,{id:"unverified-filter",checked:Pe,onCheckedChange:We}),s.jsxs(B,{htmlFor:"unverified-filter",className:"text-sm whitespace-nowrap",children:["Show only unverified (",a.filter(S=>!S.emailConfirmedAt).length,")"]})]})]})]}),s.jsx(ve,{className:"p-0",children:s.jsxs(Ft,{className:"w-full",containerClassName:"max-w-none px-0 mx-0",children:[s.jsx(Ut,{children:s.jsxs(Fe,{children:[s.jsx(te,{children:"Name"}),s.jsx(te,{children:"Email"}),s.jsx(te,{children:"Status"}),s.jsx(te,{children:"Resident City"}),s.jsx(te,{children:"Points"}),s.jsx(te,{children:"Membership"}),s.jsx(te,{children:"Expires"}),s.jsx(te,{children:"Referrals"}),s.jsx(te,{children:"Signed Up"}),s.jsx(te,{className:"text-right",children:"Actions"})]})}),s.jsx(zt,{children:xt.sort((S,W)=>new Date(W.createdAt).getTime()-new Date(S.createdAt).getTime()).map(S=>{var de;const W=new Date;let we=null,me=!1;if(S.trialEndsAt){const fe=new Date(S.trialEndsAt);me=W>fe,we={date:fe,type:"Introductory",expired:me}}else if(S.membershipEndDate){const fe=new Date(S.membershipEndDate);me=W>fe,we={date:fe,type:"Membership",expired:me}}return s.jsxs(Fe,{children:[s.jsx(J,{children:s.jsxs("div",{className:"flex items-center gap-1",children:[S.name||"N/A",S.is_business_owner&&s.jsxs(Ie,{variant:"outline",className:"text-xs ml-1",children:[s.jsx(zm,{className:"w-3 h-3 mr-0.5"}),"Biz"]})]})}),s.jsx(J,{children:S.email}),s.jsx(J,{children:s.jsx(Ie,{variant:S.emailConfirmedAt?"default":"secondary",children:S.emailConfirmedAt?"Verified":"Pending"})}),s.jsx(J,{children:S.residentCity||"N/A"}),s.jsx(J,{children:S.points||0}),s.jsx(J,{children:s.jsxs(Ie,{variant:me?"destructive":"secondary",children:[((de=S.membership)==null?void 0:de.name)||"Free"," ",me?"(Expired)":""]})}),s.jsx(J,{children:we?s.jsxs("div",{className:`text-xs ${we.expired?"text-red-600":"text-muted-foreground"}`,children:[we.type,": ",we.date.toLocaleDateString(),we.expired&&s.jsx("div",{className:"font-medium",children:"EXPIRED"})]}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"No expiration"})}),s.jsx(J,{children:S.referral_count||0}),s.jsx(J,{children:s.jsx("span",{className:"text-sm text-muted-foreground",children:S.createdAt?new Date(S.createdAt).toLocaleDateString():"N/A"})}),s.jsx(J,{children:s.jsxs("div",{className:"flex gap-2",children:[!S.emailConfirmedAt&&s.jsx(L,{size:"sm",variant:"secondary",onClick:()=>Kc(S.email,S.name),title:"Resend confirmation email",children:s.jsx(Rj,{className:"w-4 h-4"})}),s.jsxs(L,{size:"sm",variant:"outline",onClick:()=>{var fe;T(S),K(((fe=S.membership_plan_id)==null?void 0:fe.toString())||"1"),N(!0)},children:[s.jsx(oa,{className:"w-4 h-4 mr-1"}),"Edit"]}),s.jsx(L,{size:"sm",variant:"destructive",onClick:()=>Zn(S.id,S.name||S.email),children:s.jsx(xr,{className:"w-4 h-4"})})]})})]},S.id)})})]})})]})}),s.jsx(er,{value:"rewards",children:s.jsxs(pe,{children:[s.jsxs(Ae,{className:"flex flex-row items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(Me,{children:"Rewards Management"}),s.jsx(St,{children:"Create and manage reward offerings"})]}),s.jsxs(ht,{open:E,onOpenChange:H,children:[s.jsx(Nn,{asChild:!0,children:s.jsxs(L,{children:[s.jsx(os,{className:"w-4 h-4 mr-2"}),"Create Reward"]})}),s.jsxs(dt,{className:"max-h-[90vh] overflow-y-auto",children:[s.jsx(ft,{children:s.jsx(mt,{children:"Create New Reward"})}),s.jsxs("div",{className:"space-y-4 max-h-[70vh] overflow-y-auto pr-2",children:[s.jsxs("div",{children:[s.jsx(B,{children:"Name"}),s.jsx(Q,{value:P.name,onChange:S=>Z(W=>({...W,name:S.target.value}))})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Description"}),s.jsx(Ir,{value:P.description,onChange:S=>Z(W=>({...W,description:S.target.value}))})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Points Cost"}),s.jsx(Q,{type:"number",value:P.points_cost,onChange:S=>Z(W=>({...W,points_cost:S.target.value}))})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Category"}),s.jsxs(Vt,{value:P.category_id,onValueChange:S=>Z(W=>({...W,category_id:S})),children:[s.jsx(Ot,{children:s.jsx(Wt,{placeholder:"Select category"})}),s.jsx(At,{children:m.map(S=>s.jsx(gt,{value:S.id.toString(),children:S.name},S.id))})]})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Membership Levels"}),s.jsx("div",{className:"space-y-2 mt-2",children:u.map(S=>s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Do,{id:`create-plan-${S.id}`,checked:P.membership_levels.includes(S.id.toString()),onCheckedChange:W=>{const we=P.membership_levels;Z(W?me=>({...me,membership_levels:[...we,S.id.toString()]}):me=>({...me,membership_levels:we.filter(de=>de!==S.id.toString())}))}}),s.jsx(B,{htmlFor:`create-plan-${S.id}`,className:"text-sm font-normal",children:S.name})]},S.id))})]}),s.jsxs("div",{className:"space-y-4 border-t pt-4",children:[s.jsx(B,{className:"text-sm font-medium",children:"Reward File or Link"}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(B,{htmlFor:"reward-file",className:"text-sm",children:"Upload File"}),s.jsx(Q,{id:"reward-file",type:"file",onChange:S=>{var W;return le(((W=S.target.files)==null?void 0:W[0])||null)},className:"mt-1"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Upload a file that members can download after earning this reward"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"h-px bg-border flex-1"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"OR"}),s.jsx("div",{className:"h-px bg-border flex-1"})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"reward-url",className:"text-sm",children:"Exter
476nal URL"}),s.jsx(Q,{id:"reward-url",type:"url",placeholder:"https://example.com",value:P.external_url,onChange:S=>Z(W=>({...W,external_url:S.target.value})),className:"mt-1"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Provide a link that members can visit after earning this reward"})]})]})]}),s.jsx(L,{onClick:Se,className:"w-full",disabled:z,children:z?"Creating...":"Create Reward"})]})]})]})]}),s.jsxs(ve,{className:"p-0",children:[s.jsxs("div",{className:"mb-6",children:[s.jsxs("div",{className:"flex justify-between items-center mb-4",children:[s.jsx("h3",{className:"text-lg font-semibold",children:"Reward Categories"}),s.jsxs(ht,{open:q,onOpenChange:se,children:[s.jsx(Nn,{asChild:!0,children:s.jsxs(L,{variant:"outline",size:"sm",children:[s.jsx(os,{className:"w-4 h-4 mr-2"}),"Add Category"]})}),s.jsxs(dt,{children:[s.jsx(ft,{children:s.jsx(mt,{children:"Create New Category"})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(B,{children:"Name"}),s.jsx(Q,{value:Ve.name,onChange:S=>lt(W=>({...W,name:S.target.value}))})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Description"}),s.jsx(Ir,{value:Ve.description,onChange:S=>lt(W=>({...W,description:S.target.value}))})]}),s.jsx(L,{onClick:et,className:"w-full",children:"Create Category"})]})]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-6",children:[m.map(S=>s.jsx(pe,{className:"p-4",children:s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"font-medium",children:S.name}),S.description&&s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:S.description})]}),s.jsx(L,{variant:"ghost",size:"sm",onClick:()=>at(S.id),className:"text-destructive hover:text-destructive",children:s.jsx(xr,{className:"w-4 h-4"})})]})},S.id)),m.length===0&&s.jsx(pe,{className:"p-4 col-span-full",children:s.jsx("p",{className:"text-center text-muted-foreground",children:"No categories created yet"})})]})]}),s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Rewards"}),s.jsxs(Ft,{className:"w-full",containerClassName:"max-w-none px-0 mx-0",children:[s.jsx(Ut,{children:s.jsxs(Fe,{children:[s.jsx(te,{children:"Name"}),s.jsx(te,{children:"Points Cost"}),s.jsx(te,{children:"Claim Code"}),s.jsx(te,{children:"Category"}),s.jsx(te,{children:"File/Link"}),s.jsx(te,{children:"Status"}),s.jsx(te,{children:"Actions"})]})}),s.jsx(zt,{children:o.map(S=>{var W;return s.jsxs(Fe,{children:[s.jsx(J,{children:S.name}),s.jsx(J,{children:S.points_cost}),s.jsx(J,{children:s.jsx(Ie,{variant:"outline",className:"font-mono text-base tracking-widest px-3 py-1",children:S.claim_code||"â"})}),s.jsx(J,{children:(W=S.reward_categories)==null?void 0:W.name}),s.jsx(J,{children:s.jsxs("div",{className:"flex items-center gap-2",children:[S.file_url&&s.jsxs(Ie,{variant:"secondary",className:"text-xs",children:[s.jsx(k2,{className:"w-3 h-3 mr-1"}),"File"]}),S.external_url&&s.jsxs(Ie,{variant:"secondary",className:"text-xs",children:[s.jsx(Co,{className:"w-3 h-3 mr-1"}),"Link"]}),!S.file_url&&!S.external_url&&s.jsx("span",{className:"text-muted-foreground text-xs",children:"None"})]})}),s.jsx(J,{children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ca,{checked:S.active,onCheckedChange:()=>Yt(S.id,S.active)}),s.jsx("span",{className:"text-sm",children:S.active?"Active":"Inactive"})]})}),s.jsx(J,{children:s.jsxs(L,{size:"sm",variant:"outline",onClick:()=>{var we;O(S),Z({name:S.name,description:S.description||"",points_cost:S.points_cost.toString(),category_id:((we=S.category_id)==null?void 0:we.toString())||"",membership_levels:S.membership_levels||[],file_url:S.file_url||"",external_url:S.external_url||""}),C(!0)},children:[s.jsx(oa,{className:"w-4 h-4 mr-1"}),"Edit"]})})]},S.id)})})]})]})]})}),s.jsx(er,{value:"events",children:s.jsxs(pe,{children:[s.jsxs(Ae,{className:"flex flex-row items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(Me,{children:"Event Management"}),s.jsx(St,{children:"Create and manage check-in events"})]}),s.jsx("div",{className:"flex gap-2",children:s.jsxs(ht,{open:A,onOpenChange:F,children:[s.jsx(Nn,{asChild:!0,children:s.jsxs(L,{children:[s.jsx(os,{className:"w-4 h-4 mr-2"}),"Create Event"]})}),s.jsxs(dt,{children:[s.jsx(ft,{children:s.jsx(mt,{children:"Create New Event"})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(B,{children:"Event Name"}),s.jsx(Q,{value:ue.name,onChange:S=>De(W=>({...W,name:S.target.value}))})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Date"}),s.jsx(Q,{type:"date",value:ue.date,onChange:S=>De(W=>({...W,date:S.target.value}))})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Points Reward"}),s.jsx(Q,{type:"number",value:ue.points,onChange:S=>De(W=>({...W,points:S.target.value}))})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Address (Optional - for GPS check-in)"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Q,{value:ue.address,onChange:S=>De(W=>({...W,address:S.target.value})),placeholder:"123 Main St, City, State"}),s.jsxs(L,{type:"button",variant:"outline",onClick:nn,disabled:!ue.address||ue.address.trim().length===0,children:[s.jsx(dn,{className:"w-4 h-4 mr-1"}),"Geocode"]})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx(B,{children:"Latitude"}),s.jsx(Q,{type:"number",step:"any",value:ue.latitude,onChange:S=>De(W=>({...W,latitude:S.target.value})),placeholder:"40.7128",readOnly:!0})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Longitude"}),s.jsx(Q,{type:"number",step:"any",value:ue.longitude,onChange:S=>De(W=>({...W,longitude:S.target.value})),placeholder:"-74.0060",readOnly:!0})]})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Check-in Radius (meters)"}),s.jsx(Q,{type:"number",value:ue.check_in_radius,onChange:S=>De(W=>({...W,check_in_radius:S.target.value})),placeholder:"5"})]}),s.jsx(zn,{children:s.jsx(Bn,{children:"A 6-digit alphanumeric check-in code will be automatically generated for this event. Add location data to enable GPS-based check-ins."})}),s.jsx(L,{onClick:Xe,className:"w-full",children:"Create Event"})]})]})]})})]}),s.jsx(ve,{className:"p-0",children:s.jsxs(Ft,{className:"w-full",containerClassName:"max-w-none px-0 mx-0",children:[s.jsx(Ut,{children:s.jsxs(Fe,{children:[s.jsx(te,{children:"Event Name"}),s.jsx(te,{children:"Date"}),s.jsx(te,{children:"Check-in Code"}),s.jsx(te,{children:"Points"}),s.jsx(te,{children:"GPS"}),s.jsx(te,{children:"Status"}),s.jsx(te,{children:"Actions"})]})}),s.jsx(zt,{children:c.map(S=>s.jsxs(Fe,{children:[s.jsx(J,{children:S.name}),s.jsx(J,{children:new Date(S.date).toLocaleDateString()}),s.jsx(J,{children:s.jsx("code",{className:"bg-muted px-2 py-1 rounded text-sm",children:S.checkin_code})}),s.jsx(J,{children:S.points}),s.jsx(J,{children:S.latitude&&S.longitude?s.jsx(Ie,{variant:"default",className:"text-xs",children:"â GPS Set"}):S.address?s.jsxs(L,{size:"sm",variant:"outline",onClick:()=>En(S),className:"text-xs",children:[s.jsx(dn,{className:"w-3 h-3 mr-1"}),"Geocode"]}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"No address"})}),s.jsx(J,{children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ca,{checked:S.is_active,onCheckedChange:()=>st(S.id,S.is_active)}),s.jsx("span",{className:"text-sm",children:S.is_active?"Active":"Inactive"})]})}),s.jsx(J,{children:s.jsxs(L,{size:"sm",variant:"outline",onClick:()=>{var W,we,me;Y(S),De({name:S.name,date:S.date,points:S.points.toString(),address:S.address||"",latitude:((W=S.latitude)==null?void 0:W.toString())||"",longitude:((we=S.longitude)==null?void 0:we.toString())||"",check_in_radius:((me=S.check_in_radius)==null?void 0:me.toString())||"5"}),ae(!0)},children:[s.jsx(oa,{className:"w-4 h-4 mr-1"}),"Edit"]})})]},S.id))})]})})]})}),s.jsx(er,{value:"directory",children:s.jsx(B5,{})}),s.jsx(er,{value:"photos",children:s.jsx(W5,{})}),s.jsx(er,{value:"fundraisers",children:s.jsx(a3,{})}),s.jsx(er,{value:"payouts",children:s.jsxs(pe,{children:[s.jsxs(Ae,{children:[s.jsx(Me,{children:"Payout Requests"}),s.jsx(St,{children:"Review and process Executive Member commission payouts"})]}),s.jsx(ve,{className:"p-0",children:s.jsxs(Ft,{className:"w-full",containerClassName:"max-w-none px-0 mx-0",children:[s.jsx(Ut,{children:s.jsxs(Fe,{children:[s.jsx(te,{children:"Member"}),s.jsx(te,{children:"Amount"}),s.jsx(te,{children:"Payment Method"}),s.jsx(te,{children:"Handle/Email"}),s.jsx(te,{children:"Status"}),s.jsx(te,{children:"Requested"}),s.jsx(te,{children:"Actions"})]})}),s.jsxs(zt,{children:[x.map(S=>{var W;return s.jsxs(Fe,{children:[s.jsx(J,{children:s.jsx("div",{className:"font-medium",children:((W=S.profiles)==null?void 0:W.name)||"Unknown"})}),s.jsx(J,{children:s.jsxs("div",{className:"font-semibold text-green-600",children:["$",S.amount.toFixed(2)]})}),s.jsx(J,{children:S.payment_method==="cashapp"?"Cash App":"PayPal"}),s.jsx(J,{className:"max-w-[200px] truncate",children:S.payment_handle}),s.jsx(J,{children:s.jsx(Ie,{variant:S.status==="pending"?"secondary":S.status==="paid"?"default":S.status==="rejected"?"destructive":"secondary",children:S.status.charAt(0).toUpperCase()+S.status.slice(1)})}),s.jsx(J,{children:new Date(S.created_at).toLocaleDateString()}),s.jsxs(J,{children:[S.status==="pending"&&s.jsxs("div",{className:"flex gap-2",children:[s.jsx(L,{size:"sm",onClick:()=>Lv(S.id,"paid"),className:"bg-green-600 hover:bg-green-700",children:"Mark Paid"}),s.jsx(L,{size:"sm",variant:"destructive",onClick:()=>Lv(S.id,"rejected","Request denied by admin"),children:"Reject"})]}),S.status==="paid"&&s.jsx("span",{className:"text-sm text-green-600",children:"â Completed"}),S.status==="rejected"&&s.jsx("span",{className:"text-sm text-red-600",children:"â Rejected"})]})]},S.id)}),x.length===0&&s.jsx(Fe,{children:s.jsx(J,{colSpan:7,className:"text-center text-muted-foreground py-8",children:"No payout requests found"})})]})]})})]})}),s.jsx(er,{value:"public-events",children:e&&s.jsx(V5,{user:e})}),s.jsxs(er,{value:"stats",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-6",children:[s.jsxs(pe,{children:[s.jsx(Ae,{children:s.jsx(Me,{children:"Total Members"})}),s.jsxs(ve,{children:[s.jsx("p",{className:"text-3xl font-bold text-primary",children:a.length}),s.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["Unverified: ",a.filter(S=>!S.emailConfirmedAt).length]})]})]}),s.jsxs(pe,{children:[s.jsx(Ae,{children:s.jsx(Me,{children:"Active Rewards"})}),s.jsx(ve,{children:s.jsx("p",{className:"text-3xl font-bold text-primary",children:o.filter(S=>S.active).length})})]}),s.jsxs(pe,{children:[s.jsx(Ae,{children:s.jsx(Me,{children:"Active Check-in locations"})}),s.jsx(ve,{children:s.jsx("p",{className:"text-3xl font-bold text-primary",children:b})})]})]}),s.jsxs(pe,{className:"mb-6",children:[s.jsxs(Ae,{children:[s.jsx(Me,{children:"Claimed Rewards"}),s.jsx(St,{children:"Track reward claims and delivery status"})]}),s.jsxs(ve,{className:"p-0",children:[s.jsxs("div",{className:"mb-4 px-6 pt-6",children:[s.jsxs("p",{className:"text-2xl font-bold text-primary",children:["Total Claims: ",oe.length]}),s.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["Pending: ",oe.filter(S=>S.status==="pending").length," | Delivered: ",oe.filter(S=>S.status==="delivered").length," | Expired: ",oe.filter(S=>S.status==="expired").length]})]}),s.jsxs(Ft,{className:"w-full",containerClassName:"max-w-none px-0 mx-0",children:[s.jsx(Ut,{children:s.jsxs(Fe,{children:[s.jsx(te,{children:"Member"}),s.jsx(te,{children:"Email"}),s.jsx(te,{children:"Reward"}),s.jsx(te,{children:"Points"}),s.jsx(te,{children:"Claimed Date"}),s.jsx(te,{children:"Expires"}),s.jsx(te,{children:"Status"}),s.jsx(te,{children:"Actions"})]})}),s.jsxs(zt,{children:[oe.map(S=>{var de,fe;const W=a.find(Be=>
476Be.id===S.user_id),we=new Date(S.expires_at),me=we.getTime()-Date.now()<7*24*60*60*1e3;return s.jsxs(Fe,{children:[s.jsx(J,{children:(W==null?void 0:W.name)||"Unknown"}),s.jsx(J,{children:(W==null?void 0:W.email)||"N/A"}),s.jsx(J,{children:((de=S.rewards)==null?void 0:de.name)||"N/A"}),s.jsx(J,{children:((fe=S.rewards)==null?void 0:fe.points_cost)||0}),s.jsx(J,{children:new Date(S.claimed_at).toLocaleDateString()}),s.jsx(J,{children:s.jsxs("span",{className:me&&S.status==="pending"?"text-orange-600 font-medium":"",children:[we.toLocaleDateString(),me&&S.status==="pending"&&s.jsx("span",{className:"text-xs block",children:"â ï¸ Expiring Soon"})]})}),s.jsx(J,{children:s.jsx(Ie,{variant:S.status==="pending"?"secondary":S.status==="delivered"?"default":"destructive",children:S.status.charAt(0).toUpperCase()+S.status.slice(1)})}),s.jsxs(J,{children:[S.status==="pending"&&s.jsx(L,{size:"sm",onClick:()=>qk(S.id),className:"bg-green-600 hover:bg-green-700",children:"Mark Delivered"}),S.status==="delivered"&&s.jsxs("span",{className:"text-sm text-green-600",children:["â ",new Date(S.delivered_at).toLocaleDateString()]})]})]},S.id)}),oe.length===0&&s.jsx(Fe,{children:s.jsx(J,{colSpan:8,className:"text-center text-muted-foreground py-8",children:"No rewards have been claimed yet"})})]})]})]})]}),s.jsxs(pe,{className:"mb-6",children:[s.jsxs(Ae,{children:[s.jsx(Me,{children:"Total Check-ins This Month"}),s.jsx(St,{children:"Total number of event check-ins for the current month"})]}),s.jsxs(ve,{children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("p",{className:"text-3xl font-bold text-primary",children:(()=>{const S=new Date,W=new Date(S.getFullYear(),S.getMonth(),1),we=new Date(S.getFullYear(),S.getMonth()+1,0);let me=0;return a.forEach(de=>{de.checkins&&Array.isArray(de.checkins)&&(me+=de.checkins.filter(fe=>{const Be=Kr(fe);return Be>=W&&Be<=we}).length)}),me})()}),s.jsx(L,{variant:"outline",onClick:()=>V(!0),children:"View Check-in Log"})]}),(()=>{const S=new Date,W=new Date(S.getFullYear(),S.getMonth(),1),we=new Date(S.getFullYear(),S.getMonth()+1,0),me=[];a.forEach(fe=>{fe.checkins&&Array.isArray(fe.checkins)&&fe.checkins.forEach(Be=>{const Oe=Kr(Be);Oe>=W&&Oe<=we&&me.push({memberName:fe.name||"Unknown",eventName:Be.event_name||Be.business_name||"Unknown",date:Be.date})})}),me.sort((fe,Be)=>new Date(Be.date).getTime()-new Date(fe.date).getTime());const de=me.slice(0,10);return de.length===0?null:s.jsxs("div",{className:"border-t pt-4",children:[s.jsx("p",{className:"text-sm font-semibold mb-2",children:"Recent check-ins"}),s.jsx("div",{className:"space-y-2",children:de.map((fe,Be)=>s.jsxs("div",{className:"flex items-center justify-between text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("span",{className:"font-medium truncate",children:fe.memberName}),s.jsx("span",{className:"text-muted-foreground",children:"â"}),s.jsx("span",{className:"text-primary truncate",children:fe.eventName})]}),s.jsx("span",{className:"text-muted-foreground whitespace-nowrap text-xs",children:Kr(fe).toLocaleDateString()})]},Be))})]})})()]})]}),s.jsxs(pe,{children:[s.jsx(Ae,{children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{children:[s.jsx(Me,{children:"Top 10 Members by Referrals This Month"}),s.jsx(St,{children:"Members with the most successful referrals this month"})]}),s.jsxs(L,{variant:"outline",size:"sm",className:"gap-2",onClick:()=>Qe(!0),children:[s.jsx(rr,{className:"h-4 w-4"}),"View Prior Months"]})]})}),s.jsx(ve,{className:"p-0",children:s.jsxs(Ft,{className:"w-full",containerClassName:"max-w-none px-0 mx-0",children:[s.jsx(Ut,{children:s.jsxs(Fe,{children:[s.jsx(te,{children:"Rank"}),s.jsx(te,{children:"Name"}),s.jsx(te,{children:"Referral Code"}),s.jsx(te,{children:"Referrals This Month"}),s.jsx(te,{children:"Referred Members"})]})}),s.jsx(zt,{children:(()=>{const S=new Date,W=new Date(S.getFullYear(),S.getMonth(),1),we=a.map(me=>{const de=a.filter(fe=>!fe.referred_by||fe.referred_by!==me.id?!1:new Date(fe.createdAt)>=W);return{...me,monthlyReferrals:de.length,referredNames:de.map(fe=>fe.name||"Unknown")}}).filter(me=>me.monthlyReferrals>0).sort((me,de)=>de.monthlyReferrals-me.monthlyReferrals).slice(0,10);return we.length>0?we.map((me,de)=>s.jsxs(Fe,{children:[s.jsxs(J,{className:"font-medium",children:["#",de+1]}),s.jsx(J,{children:me.name||"Unknown"}),s.jsx(J,{className:"font-mono",children:me.referral_code||"N/A"}),s.jsx(J,{children:s.jsx("span",{className:"font-semibold text-primary",children:me.monthlyReferrals})}),s.jsx(J,{className:"text-sm",children:me.referredNames.join(", ")})]},me.id)):s.jsx(Fe,{children:s.jsx(J,{colSpan:5,className:"text-center text-muted-foreground",children:"No referrals found for this month"})})})()})]})})]}),s.jsxs(pe,{className:"mt-6",children:[s.jsxs(Ae,{children:[s.jsx(Me,{children:"Top 10 Members by Check-ins This Month"}),s.jsx(St,{children:"Members with the most event check-ins this month"})]}),s.jsx(ve,{className:"p-0",children:s.jsxs(Ft,{className:"w-full",containerClassName:"max-w-none px-0 mx-0",children:[s.jsx(Ut,{children:s.jsxs(Fe,{children:[s.jsx(te,{children:"Rank"}),s.jsx(te,{children:"Name"}),s.jsx(te,{children:"Check-ins This Month"})]})}),s.jsx(zt,{children:(()=>{const S=new Date,W=new Date(S.getFullYear(),S.getMonth(),1),we=new Date(S.getFullYear(),S.getMonth()+1,0),me=a.map(de=>{const fe=de.checkins&&Array.isArray(de.checkins)?de.checkins.filter(
476Be=>{const Oe=Kr(Be);return Oe>=W&&Oe<=we}).length:0;return{...de,monthlyCheckins:fe}}).filter(de=>de.monthlyCheckins>0).sort((de,fe)=>fe.monthlyCheckins-de.monthlyCheckins).slice(0,10);return me.length>0?me.map((de,fe)=>{var Be;return s.jsxs(Fe,{children:[s.jsxs(J,{className:"font-medium",children:["#",fe+1]}),s.jsx(J,{className:"text-left",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{children:de.name||"Unknown"}),s.jsx(Ie,{variant:"secondary",className:"text-xs",children:((Be=de.membership)==null?void 0:Be.name)||"Free"})]})}),s.jsx(J,{children:s.jsx("span",{className:"font-semibold text-primary",children:de.monthlyCheckins})})]},de.id)}):s.jsx(Fe,{children:s.jsx(J,{colSpan:3,className:"text-center text-muted-foreground",children:"No check-ins found for this month"})})})()})]})})]}),s.jsxs(pe,{className:"mt-6",children:[s.jsxs(Ae,{children:[s.jsx(Me,{children:"Top 10 Events by Check-ins This Month"}),s.jsx(St,{children:"Events with the most check-ins in the current month"})]}),s.jsx(ve,{className:"p-0",children:s.jsxs(Ft,{className:"w-full",containerClassName:"max-w-none px-0 mx-0",children:[s.jsx(Ut,{children:s.jsxs(Fe,{children:[s.jsx(te,{children:"Rank"}),s.jsx(te,{children:"Event Name"}),s.jsx(te,{children:"Date"}),s.jsx(te,{children:"Check-ins This Month"})]})}),s.jsx(zt,{children:(()=>{const S=new Date,W=new Date(S.getFullYear(),S.getMonth(),1),we=new Date(S.getFullYear(),S.getMonth()+1,0),me=new Map;a.forEach(fe=>{fe.checkins&&Array.isArray(fe.checkins)&&fe.checkins.forEach(Be=>{const Oe=Kr(Be);if(Oe>=W&&Oe<=we){const Ge=Be.event_id,Tt=me.get(Ge);if(Tt)Tt.count++;else{const Ht=c.find(mn=>mn.id===Ge);Ht&&me.set(Ge,{event:Ht,count:1})}}})});const de=Array.from(me.values()).sort((fe,Be)=>Be.count-fe.count).slice(0,10);return de.length>0?de.map((fe,Be)=>s.jsxs(Fe,{children:[s.jsxs(J,{className:"font-medium",children:["#",Be+1]}),s.jsx(J,{children:fe.event.name}),s.jsx(J,{children:new Date(fe.event.date).toLocaleDateString()}),s.jsx(J,{children:s.jsx("span",{className:"font-semibold text-primary",children:fe.count})})]}
476,fe.event.id)):s.jsx(Fe,{children:s.jsx(J,{colSpan:4,className:"text-center text-muted-foreground",children:"No check-ins found for this month"})})})()})]})})]}),s.jsxs(pe,{className:"mt-6",children:[s.jsxs(Ae,{children:[s.jsx(Me,{children:"Top 10 Businesses by Check-ins This Month"}),s.jsx(St,{children:"Directory businesses with the most check-ins in the current month"})]}),s.jsx(ve,{className:"p-0",children:s.jsxs(Ft,{className:"w-full",containerClassName:"max-w-none px-0 mx-0",children:[s.jsx(Ut,{children:s.jsxs(Fe,{children:[s.jsx(te,{children:"Rank"}),s.jsx(te,{children:"Business Name"}),s.jsx(te,{children:"Check-ins This Month"})]})}),s.jsx(zt,{children:(()=>{const S=new Date,W=new Date(S.getFullYear(),S.getMonth(),1),we=new Date(S.getFullYear(),S.getMonth()+1,0),me=new Map;a.forEach(fe=>{fe.checkins&&Array.isArray(fe.checkins)&&fe.checkins.forEach(Be=>{if(!Be.business_id)return;const Oe=Kr(Be);if(Oe>=W&&Oe<=we){const Ge=me.get(Be.business_id);Ge?Ge.count++:me.set(Be.business_id,{name:Be.business_name||"Unknown Business",count:1})}})});const de=Array.from(me.values()).sort((fe,Be)=>Be.count-fe.count).slice(0,10);return de.length>0?de.map((fe,Be)=>s.jsxs(Fe,{children:[s.jsxs(J,{className:"font-medium",children:["#",Be+1]}),s.jsx(J,{children:fe.name}),s.jsx(J,{children:s.jsx("span",{className:"font-semibold text-primary",children:fe.count})})]},fe.name+Be)):s.jsx(Fe,{children:s.jsx(J,{colSpan:3,className:"text-center text-muted-foreground",children:"No business check-ins found for this month"})})})()})]})})]})]})]}),s.jsx(ht,{open:j,onOpenChange:N,children:s.jsxs(dt,{children:[s.jsxs(ft,{children:[s.jsxs(mt,{children:["Edit Member: ",D==null?void 0:D.name]}),s.jsx(oo,{children:"Adjust member points and membership level"})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-lg font-semibold",children:"Points Management"}),s.jsx("div",{children:s.jsxs(B,{children:["Current Points: ",(D==null?void 0:D.points)||0]})}),s.jsxs("div",{children:[s.jsx(B,{children:"Points to Add (use negative number to subtract)"}),s.jsx(Q,{type:"number",value:I,onChange:S=>he(S.target.value),placeholder:"Enter points adjustment"})]}),s.jsx(L,{onClick:$,className:"w-full",disabled:!I,children:"Update Points"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-lg font-semibold",children:"Membership Level"}),s.jsx("div",{children:s.jsxs(B,{children:["Current Membership: ",(($v=D==null?void 0:D.membership)==null?void 0:$v.name)||"Free"]})}),s.jsxs("div",{children:[s.jsx(B,{children:"Change Membership Level"}),s.jsxs(Vt,{value:X,onValueChange:K,children:[s.jsx(Ot,{children:s.jsx(Wt,{placeholder:"Select membership level"})}),s.jsx(At,{children:u.map(S=>s.jsxs(gt,{value:S.id.toString(),children:[S.name," - ",S.price===0?"Free":`$${S.price}/year`]},S.id))})]})]}),s.jsx(L,{onClick:ne,className:"w-full",disabled:!X||X===((Fv=D==null?void 0:D.membership_plan_id)==null?void 0:Fv.toString()),children:"Update Membership"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-lg font-semibold",children:"Business Owner Status"}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ca,{id:"business-owner-toggle",checked:(D==null?void 0:D.is_business_owner)||!1,onCheckedChange:async S=>{try{const{error:W}=await R.from("profiles").update({is_business_owner:S}).eq("id",D.id);if(W)throw W;y({title:"Updated",description:`${D.name} is ${S?"now":"no longer"} a business owner`}),T({...D,is_business_owner:S}),await Je()}catch(W){y({title:"Error",description:W.message,variant:"destructive"})}}}),s.jsx(B,{htmlFor:"business-owner-toggle",children:D!=null&&D.is_business_owner?"Business Owner":"Not a Business Owner"})]}),(D==null?void 0:D.business_name)&&s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Business: ",D.business_name," (",D.business_type,")"]})]})]})]})}),s.jsx(ht,{open:k,onOpenChange:C,children:s.jsxs(dt,{className:"max-h-[90vh] overflow-y-auto",children:[s.jsx(ft,{children:s.jsxs(mt,{children:["Edit Reward: ",_==null?void 0:_.name]})}),s.jsxs("div",{className:"space-y-4 max-h-[70vh] overflow-y-auto pr-2",children:[s.jsxs("div",{children:[s.jsx(B,{children:"Name"}),s.jsx(Q,{value:P.name,onChange:S=>Z(W=>({...W,name:S.target.value}))})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Description"}),s.jsx(Ir,{value:P.description,onChange:S=>Z(W=>({...W,description:S.target.value}))})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Points Cost"}),s.jsx(Q,{type:"number",value:P.points_cost,onChange:S=>Z(W=>({...W,points_cost:S.target.value}))})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Category"}),s.jsxs(Vt,{value:P.category_id,onValueChange:S=>Z(W=>({...W,category_id:S})),children:[s.jsx(Ot,{children:s.jsx(Wt,{placeholder:"Select category"})}),s.jsx(At,{children:m.map(S=>s.jsx(gt,{value:S.id.toString(),children:S.name},S.id))})]})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Membership Levels"}),s.jsx("div",{className:"space-y-2 mt-2",children:u.map(S=>s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Do,{id:`edit-plan-${S.id}`,checked:P.membership_levels.includes(S.id.toString()),onCheckedChange:W=>{const we=P.membership_levels;Z(W?me=>({...me,membership_levels:[...we,S.id.toString()]}):me=>({...me,membership_levels:we.filter(de=>de!==S.id.toString())}))}}),s.jsx(B,{htmlFor:`edit-plan-${S.id}`,className:"text-sm font-normal",children:S.name})]},S.id))})]}),s.jsxs("div",{className:"space-y-4 border-t pt-4",children:[s.jsx(B,{className:"text-sm font-medium",children:"Reward File or Link"}),((_==null?void 0:_.file_url)||(_==null?void 0:_.external_url))&&s.jsxs("div",{className:"p-3 bg-muted rounded-md",children:[s.jsx("p",{className:"text-sm font-medium mb-2",children:"Current:"}),(_==null?void 0:_.file_url)&&s.jsxs("p",{className:"text-sm text-muted-foreground",children:["File: ",_.file_url.split("/").pop()]}),(_==null?void 0:_.external_url)&&s.jsxs("p",{className:"text-sm text-muted-foreground",children:["URL: ",_.external_url]}
476)]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(B,{htmlFor:"edit-reward-file",className:"text-sm",children:"Upload New File"}),s.jsx(Q,{id:"edit-reward-file",type:"file",onChange:S=>{var W;return le(((W=S.target.files)==null?void 0:W[0])||null)},className:"mt-1"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Upload a new file to replace the current one"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"h-px bg-border flex-1"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"OR"}),s.jsx("div",{className:"h-px bg-border flex-1"})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"edit-reward-url",className:"text-sm",children:"External URL"}),s.jsx(Q,{id:"edit-reward-url",type:"url",placeholder:"https://example.com",value:P.external_url,onChange:S=>Z(W=>({...W,external_url:S.target.value})),className:"mt-1"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Provide a link that members can visit after earning this reward"})]})]})]}),s.jsx(L,{onClick:He,className:"w-full",disabled:z,children:z?"Updating...":"Update Reward"})]})]})}),s.jsx(ht,{open:U,onOpenChange:ae,children:s.jsxs(dt,{children:[s.jsx(ft,{children:s.jsxs(mt,{children:["Edit Event: ",G==null?void 0:G.name]})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(B,{children:"Event Name"}),s.jsx(Q,{value:ue.name,onChange:S=>De(W=>({...W,name:S.target.value}))})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Date"}),s.jsx(Q,{type:"date",value:ue.date,onChange:S=>De(W=>({...W,date:S.target.value}))})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Points Reward"}),s.jsx(Q,{type:"number",value:ue.points,onChange:S=>De(W=>({...W,points:S.target.value}))})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Address (Optional - for GPS check-in)"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Q,{value:ue.address,onChange:S=>De(W=>({...W,address:S.target.value})),placeholder:"123 Main St, City, State"}),s.jsxs(L,{type:"button",variant:"outline",onClick:nn,disabled:!ue.address||ue.address.trim().length===0,children:[s.jsx(dn,{className:"w-4 h-4 mr-1"}),"Geocode"]})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx(B,{children:"Latitude"}),s.jsx(Q,{type:"number",step:"any",value:ue.latitude,onChange:S=>De(W=>({...W,latitude:S.target.value})),placeholder:"40.7128",readOnly:!0})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Longitude"}),s.jsx(Q,{type:"number",step:"any",value:ue.longitude,onChange:S=>De(W=>({...W,longitude:S.target.value})),placeholder:"-74.0060",readOnly:!0})]})]}),(ue.latitude||ue.longitude)&&s.jsxs(L,{type:"button",variant:"destructive",onClick:()=>De(S=>({...S,latitude:"",longitude:""})),className:"w-full",children:[s.jsx(xr,{className:"w-4 h-4 mr-2"}),"Clear GPS Coordinates"]}),s.jsxs("div",{children:[s.jsx(B,{children:"Check-in Radius (meters)"}),s.jsx(Q,{type:"number",value:ue.check_in_radius,onChange:S=>De(W=>({...W,check_in_radius:S.target.value})),placeholder:"5"})]}),s.jsx(zn,{children:s.jsx(Bn,{children:"Check-in code cannot be changed for existing events. Update location data to enable GPS-based check-ins."})}),s.jsx(L,{onClick:je,className:"w-full",children:"Update Event"})]})]})}),s.jsx(ht,{open:Ce,onOpenChange:V,children:s.jsxs(dt,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[s.jsxs(ft,{children:[s.jsx(mt,{children:"Check-in Log for This Month"}),s.jsxs(oo,{children:["Detailed list of all check-ins for ",new Date().toLocaleDateString("en-US",{month:"long",year:"numeric"})]})]}),s.jsx("div",{className:"space-y-4",children:s.jsxs(Ft,{children:[s.jsx(Ut,{children:s.jsxs(Fe,{children:[s.jsx(te,{children:"Member Name"}),s.jsx(te,{children:"Event"}),s.jsx(te,{children:"Date"}),s.jsx(te,{children:"Points Awarded"})]})}),s.jsx(zt,{children:(()=>{const S=new Date,W=new Date(S.getFullYear(),S.getMonth(),1),we=new Date(S.getFullYear(),S.getMonth()+1,0),me=[];return a.forEach(de=>{de.checkins&&Array.isArray(de.checkins)&&de.checkins.forEach(fe=>{const Be=Kr(fe);Be>=W&&Be<=we&&me.push({memberName:de.name||"Unknown",eventName:fe.event_name||"Unknown Event",date:fe.date,pointsAwarded:fe.points_awarded||0})})}),me.sort((de,fe)=>new Date(fe.date).getTime()-new Date(de.date).getTime()),me.length>0?me.map((de,fe)=>s.jsxs(Fe,{children:[s.jsx(J,{children:de.memberName}),s.jsx(J,{children:de.eventName}),s.jsx(J,{children:Kr(de).toLocaleDateString()}),s.jsx(J,{children:s.jsxs(Ie,{variant:"secondary",children:[de.pointsAwarded," pts"]})})]},fe)):s.jsx(Fe,{children:s.jsx(J,{colSpan:4,className:"text-center text-muted-foreground py-8",children:"No check-ins found for this month"})})})()})]})})]})}),s.jsx(ht,{open:vt,onOpenChange:Qe,children:s.jsxs(dt,{className:"max-w-6xl max-h-[90vh] overflow-y-auto",children:[s.jsxs(ft,{children:[s.jsx(mt,{children:"Historical Top 10 Stats"}),s.jsx(oo,{children:"View top performers for any month"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(B,{children:"Select Month"}),s.jsx(Q,{type:"month",value:re,onChange:S=>ie(S.target.value),max:new Date().toISOString().slice(0,7)})]}),re&&(()=>{const[S,W]=re.split("-").map(Number),we=new Date(S,W-1,1),me=new Date(S,W,0),de=a.map(Ge=>{const Tt=a.filter(Ht=>{if(!Ht.referred_by||Ht.referred_by!==Ge.id)return!1;const mn=new Date(Ht.createdAt);return mn>=we&&mn<=me}).length;return{...Ge,monthlyReferrals:Tt}}).filter(Ge=>Ge.monthlyReferrals>0).sort((Ge,Tt)=>Tt.monthlyReferrals-Ge.monthlyReferrals).slice(0,10),fe=a.map(Ge=>{const Tt=Ge.checkins&&Array.isArray(Ge.checkins)?Ge.checkins.filter(Ht=>{const mn=Kr(Ht);return mn>=we&&mn<=me}).length:0;return{...Ge,monthlyCheckins:Tt}}).filter(Ge=>Ge.monthlyCheckins>0).sort((Ge,Tt)=>Tt.monthlyCheckins-Ge.monthlyCheckins).slice(0,10),Be=new Map;a.forEach(Ge=>{Ge.checkins&&Array.isArray(Ge.checkins)&&Ge.checkins.forEach(Tt=>{const Ht=Kr(Tt);if(Ht>=we&&Ht<=me){const mn=Tt.event_id,Uv=Be.get(mn);if(Uv)Uv.count++;else{const zv=c.find(Kk=>Kk.id===mn);zv&&Be.set(mn,{event:zv,count:1})}}})});const Oe=Array.from(Be.values()).sort((Ge,Tt)=>Tt.count-Ge.count).slice(0,10);return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"text-sm text-muted-foreground",children:["Showing stats for ",new Date(S,W-1).toLocaleDateString("en-US",{month:"long",year:"numeric"})]}),s.jsxs(pe,{children:[s.jsx(Ae,{children:s.jsx(Me,{children:"Top 10 Members by Referrals"})}),s.jsx(ve,{children:s.jsxs(Ft,{children:[s.jsx(Ut,{children:s.jsxs(Fe,{children:[s.jsx(te,{children:"Rank"}),s.jsx(te,{children:"Name"}),s.jsx(te,{children:"Referral Code"}),s.jsx(te,{children:"Referrals"})]})}),s.jsx(zt,{children:de.length>0?de.map((Ge,Tt)=>s.jsxs(Fe,{children:[s.jsxs(J,{className:"font-medium",children:["#",Tt+1]}),s.jsx(J,{children:Ge.name||"Unknown"}),s.jsx(J,{className:"font-mono",children:Ge.referral_code||"N/A"}),s.jsx(J,{children:s.jsx("span",{className:"font-semibold text-primary",children:Ge.monthlyReferrals})})]},Ge.id)):s.jsx(Fe,{children:s.jsx(J,{colSpan:4,className:"text-center text-muted-foreground",children:"No referrals found for this month"})})})]})})]}),s.jsxs(pe,{children:[s.jsx(Ae,{children:s.jsx(Me,{children:"Top 10 Members by Check-ins"})}),s.jsx(ve,{children:s.jsxs(Ft,{children:[s.jsx(Ut,{children:s.jsxs(Fe,{children:[s.jsx(te,{children:"Rank"}),s.jsx(te,{children:"Name"}),s.jsx(te,{children:"Check-ins"})]})}),s.jsx(zt,{children:fe.length>0?fe.map((Ge,Tt)=>{var Ht;return s.jsxs(Fe,{children:[s.jsxs(J,{className:"font-medium",children:["#",Tt+1]}),s.jsx(J,{className:"text-left",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{children:Ge.name||"Unknown"}),s.jsx(Ie,{variant:"secondary",className:"text-xs",children:((Ht=Ge.membership)==null?void 0:Ht.name)||"Free"})]})}),s.jsx(J,{children:s.jsx("span",{className:"font-semibold text-primary",children:Ge.monthlyCheckins})})]},Ge.id)}):s.jsx(Fe,{children:s.jsx(J,{colSpan:3,className:"text-center text-muted-foreground",children:"No check-ins found for this month"})})})]})})]}),s.jsxs(pe,{children:[s.jsx(Ae,{children:s.jsx(Me,{children:"Top 10 Events by Check-ins"})}),s.jsx(ve,{children:s.jsxs(Ft,{children:[s.jsx(Ut,{children:s.jsxs(Fe,{children:[s.jsx(te,{children:"Rank"}),s.jsx(te,{children:"Event Name"}),s.jsx(te,{children:"Date"}),s.jsx(te,{children:"Check-ins"})]})}),s.jsx(zt,{children:Oe.length>0?Oe.map((Ge,Tt)=>s.jsxs(Fe,{children:[s.jsxs(J,{className:"font-medium",children:["#",Tt+1]}),s.jsx(J,{children:Ge.event.name}),s.jsx(J,{children:new Date(Ge.event.date).toLocaleDateString()}),s.jsx(J,{children:s.jsx("span",{className:"font-semibold text-primary",children:Ge.count})})]}
476,Ge.event.id)):s.jsx(Fe,{children:s.jsx(J,{colSpan:4,className:"text-center text-muted-foreground",children:"No check-ins found for this month"})})})]})})]})]})})()]})]})})]})})},o3=()=>{const[e,t]=h.useState(null),[n,r]=h.useState(null),[a,i]=h.useState(!1),[o,l]=h.useState(""),[c,d]=h.useState(""),[u,f]=h.useState(""),m=Et(),{toast:w}=_t();h.useEffect(()=>{const{data:{subscription:p}}=R.auth.onAuthStateChange((b,v)=>{r(v),t((v==null?void 0:v.user)??null)});return R.auth.getSession().then(({data:{session:b}})=>{r(b),t((b==null?void 0:b.user)??null),b!=null&&b.user&&R.rpc("is_admin").then(({data:v,error:g})=>{!g&&v&&m("/admin")})}),()=>p.unsubscribe()},[m]);const x=async p=>{if(p.preventDefault(),!o||!c){f("Please fill in all fields");return}i(!0),f("");try{try{await R.auth.signOut({scope:"local"})}catch{}const{data:b,error:v}=await R.auth.signInWithPassword({email:o,password:c});if(v){v.message.includes("Invalid login credentials")?f("Invalid admin credentials. Please check your email and password."):v.message.includes("Email not confirmed")?f("Please check your email and click the confirmation link before signing in."):f(v.message);return}if(b.user){await new Promise(j=>setTimeout(j,100));const{data:g,error:y}=await R.rpc("is_admin");if(y||!g){console.error("Admin check failed:",y),f("Access denied. Admin privileges required."),await R.auth.signOut();return}w({title:"Admin Access Granted",description:"Welcome to the admin panel."}),window.location.href="/admin"}}catch(b){f(b.message||"An unexpected error occurred")}finally{i(!1)}};return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:s.jsxs(pe,{className:"w-full max-w-md",children:[s.jsxs(Ae,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(L,{variant:"ghost",size:"icon",onClick:()=>m("/sign-in"),className:"h-8 w-8",children:s.jsx(Kn,{className:"h-4 w-4"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(A2,{className:"h-6 w-6 text-primary"}),s.jsx(Me,{className:"text-2xl text-primary",children:"Admin Portal"})]})]}),s.jsx(St,{className:"text-center",children:"Admin access required"})]}),s.jsxs(ve,{children:[s.jsxs("form",{onSubmit:x,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"admin-email",children:"Admin Email"}),s.jsx(Q,{id:"admin-email",type:"email",value:o,onChange:p=>l(p.target.value),placeholder:"Enter admin email",required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"admin-password",children:"Admin Password"}),s.jsx(Q,{id:"admin-password",type:"password",value:c,onChange:p=>d(p.target.value),placeholder:"Enter admin password",required:!0})]}),u&&s.jsx(zn,{variant:"destructive",children:s.jsx(Bn,{children:u})}),s.jsx(L,{type:"submit",className:"w-full",disabled:a,children:a?"Verifying access...":"Access Admin Panel"})]}),s.jsx("div",{className:"mt-4 text-center",children:s.jsx(L,{variant:"link",onClick:async()=>{if(!o){f("Please enter your admin email address first");return}i(!0);const{error:p}=await R.auth.resetPasswordForEmail(o,{redirectTo:`${window.location.origin}/reset-password`});i(!1),p?f(p.message):w({title:"Reset link sent",description:"Check your email for the password reset link."})},className:"text-sm text-muted-foreground",children:"Forgot your password?"})}),s.jsx("div",{className:"mt-2 text-center",children:s.jsx(L,{variant:"link",onClick:()=>m("/sign-in"),className:"text-sm text-muted-foreground",children:"Back to Member Login"})})]})]})})},l3=()=>s.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:s.jsx(pe,{className:"w-full max-w-md mx-auto",children:s.jsxs(ve,{className:"p-8 text-center space-y-6",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx(ci,{className:"h-16 w-16 text-green-500"})}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Success!"}),s.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Welcome to The Street Pass! You're now part of a growing community that is connected to a curated list of local events, businesses, and unique experiences. Welcome aboard!"})]}),s.jsxs("div",{className:"space-y-4 pt-2",children:[s.jsx("p",{className:"text-foreground font-bold",children:"Tap your app market below to download the Street Pass app."}),s.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4",children:[s.jsx("a",{href:"https://apps.apple.com/us/app/the-street-pass/id557242348",target:"_blank",rel:"noopener noreferrer",children:s.jsx("img",{src:"https://developer.apple.com/assets/elements/badges/download-on-the-app-store.svg",alt:"Download on the App Store",className:"h-12"})}),s.jsx("a",{href:"https://play.google.com/store/apps/details?id=app.thestreetpassapp.android",target:"_blank",rel:"noopener noreferrer",children:s.jsx("img",{src:"https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png",alt:"Get it on Google Play",className:"h-16 -my-2"})})]})]})]})})}),c3=()=>{const e=Yo();return h.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h1",{className:"text-4xl font-bold mb-4",children:"404"}),s.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Oops! Page not found"}),s.jsx("a",{href:"/",className:"text-blue-500 hover:text-blue-700 underline",children:"Return to Home"})]})})};function XS({open:e,onOpenChange:t,businessId:n,businessName:r,dealType:a,dealValue:i,dealCode:o,dealVersion:l,onClaimed:c}){const{toast:d}=_t(),[u,f]=h.useState(""),[m,w]=h.useState(!1),x=v=>{const g=v.target.value.replace(/\D/g,"").slice(0,4);f(g)}
476,p=async()=>{if(u.length!==4){d({title:"Invalid code",description:"Please enter a valid 4-digit code",variant:"destructive"});return}if(u!==o){d({title:"Incorrect code",description:"The code entered does not match. Please ask the business owner to enter the correct code.",variant:"destructive"});return}w(!0);try{const{data:{user:v}}=await R.auth.getUser();if(!v)throw new Error("Not authenticated");const{error:g}=await R.from("business_deal_claims").insert({business_id:n,user_id:v.id,deal_version:l,points_awarded:25});if(g){if(g.code==="23505"){d({title:"Already claimed",description:"You have already claimed this deal",variant:"destructive"});return}throw g}const{data:y}=await R.from("profiles").select("points").eq("id",v.id).single();y&&await R.from("profiles").update({points:Math.min((y.points||0)+25,1e6)}).eq("id",v.id),d({title:"Deal claimed!",description:"You earned 25 reward points!"}),c(),t(!1),f("")}catch(v){console.error("Error claiming deal:",v),d({title:"Error",description:"Failed to claim deal. Please try again.",variant:"destructive"})}finally{w(!1)}},b=a==="percentage"?`${i} Discount`:i;return s.jsx(ht,{open:e,onOpenChange:t,children:s.jsxs(dt,{className:"sm:max-w-md",children:[s.jsxs(ft,{children:[s.jsxs(mt,{className:"flex items-center gap-2",children:[s.jsx(Mr,{className:"w-5 h-5 text-primary"}),"V.I.P. Members Deal"]}),s.jsxs(oo,{className:"text-justify",children:["Exclusive V.I.P. deal from ",r]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-muted p-4 rounded-lg text-center",children:[s.jsx("p",{className:"text-lg font-bold text-primary",children:b}),s.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["at ",r]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"claimCode",children:"To claim this deal, the business owner must enter their 4-digit code below:"}),s.jsx(Q,{id:"claimCode",value:u,onChange:x,placeholder:"Enter 4-digit code",maxLength:4,inputMode:"numeric",className:"text-center text-2xl tracking-widest"})]}),s.jsx(L,{onClick:p,disabled:m||u.length!==4,className:"w-full",children:m?"Claiming...":s.jsxs(s.Fragment,{children:[s.jsx(gr,{className:"w-4 h-4 mr-2"}),"Claim Deal & Earn 25 Points"]})})]})]})})}function d3(){const e=Et(),{toast:t}=_t(),[n,r]=h.useState([]),[a,i]=h.useState([]),[o,l]=h.useState([]),[c,d]=h.useState(new Map),[u,f]=h.useState("all"),[m,w]=h.useState("all"),[x,p]=h.useState(!0),[b,v]=h.useState(null),[g,y]=h.useState(!1),[j,N]=h.useState(new Set),[k,C]=h.useState(!1),[E,H]=h.useState(null);h.useEffect(()=>{A(),q(),F()},[]),h.useEffect(()=>{u&&(sessionStorage.setItem("selectedCity",u),w("all")),se()},[u]),h.useEffect(()=>{se()},[m]);const A=async()=>{var D;try{const[T,_]=await Promise.all([R.from("cities").select("*").order("name"),R.from("business_categories").select("*").order("name")]);if(T.error)throw T.error;if(_.error)throw _.error;r(T.data||[]),i(_.data||[]);const O=sessionStorage.getItem("selectedCity");O&&(O==="all"||(D=T.data)!=null&&D.some(G=>G.id===O))?f(O):f("all")}catch(T){console.error("Error loading data:",T),t({title:"Error",description:"Failed to load directory data",variant:"destructive"})}finally{p(!1)}},F=async()=>{const{data:{user:D}}=await R.auth.getUser();if(D){v(D.id),U(D.id);const{data:T}=await R.from("profiles").select("membership_plan_id").eq("id",D.id).single();T&&T.membership_plan_id&&T.membership_plan_id>=3&&y(!0)}},U=async D=>{try{const{data:T}=await R.from("business_deal_claims").select("business_id, deal_version").eq("user_id",D);if(T){const _=new Set(T.map(O=>`${O.business_id}-${O.deal_version}`));N(_)}}catch(T){console.error("Error loading claimed deals:",T)}},ae=()=>{b&&U(b)},q=async()=>{try{const{data:D,error:T}=await R.from("business_reviews").select("business_id, rating");if(T)throw T;const _=new Map;if(D){const O=D.reduce((G,Y)=>(G[Y.business_id]||(G[Y.business_id]={total:0,count:0}),G[Y.business_id].total+=Y.rating,G[Y.business_id].count+=1,G),{});Object.entries(O).forEach(([G,{total:Y,count:oe}])=>{_.set(G,{business_id:G,average:Y/oe,count:oe})})}d(_)}catch(D){console.error("Error loading ratings:",D)}},se=async()=>{try{let D=R.from("business_listings").select(` 477 ${zc}, 478 cities(name), 479 business_categories!category_id(name), 480 business_categories_secondary:business_categories!category_id_secondary(name) 481 `).eq("status","approved");u!=="all"&&(D=D.eq("city_id",u)),m==="check-in-locations"?D=D.eq("check_in_enabled",!0):m!=="all"&&(D=D.or(`category_id.eq.${m},category_id_secondary.eq.${m}`));const{data:T,error:_}=await D.order("business_name");if(_)throw _;l(T||[])}catch(D){console.error("Error loading listings:",D),t({title:"Error",description:"Failed to load business listings",variant:"destructive"})}};return x?s.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:s.jsx("p",{className:"text-muted-foreground",children:"Loading directory..."})}):s.jsx("div",{className:"min-h-screen bg-background",children:s.jsx("div",{className:"container mx-auto px-4 py-8",children:s.jsxs("div",{className:"max-w-6xl mx-auto",children:[s.jsx("h1",{className:"text-3xl md:text-4xl font-bold mb-2",children:"Local Shops Directory"}
481),s.jsxs("p",{className:"text-muted-foreground mb-4 text-justify",children:["Explore local shops in the city. Members can earn points when they claim available deals displayed for select businesses that are listed in this directory. Look for the"," ",s.jsx(Ie,{className:"text-xs bg-[hsl(140,70%,32%)] text-white hover:bg-[hsl(140,70%,28%)] align-middle",children:"$treet Cash"})," ","indicator for businesses that accept the Street Cash digital gift card."]}),s.jsxs("div",{className:"flex flex-col md:flex-row gap-4 mb-8",children:[s.jsxs("div",{className:"flex-1",children:[s.jsxs("label",{className:"text-sm font-medium mb-2 flex items-center gap-2",children:[s.jsx(dn,{className:"w-4 h-4"}),"Select City"]}),s.jsxs(Vt,{value:u,onValueChange:f,children:[s.jsx(Ot,{children:s.jsx(Wt,{placeholder:"Choose a city"})}),s.jsxs(At,{children:[s.jsx(gt,{value:"all",children:"All Cities"}),n.map(D=>s.jsx(gt,{value:D.id,children:D.name},D.id))]})]})]}),s.jsxs("div",{className:"flex-1",children:[s.jsxs("label",{className:"text-sm font-medium mb-2 flex items-center gap-2",children:[s.jsx(E2,{className:"w-4 h-4"}),"Filter by Category"]}),s.jsxs(Vt,{value:m,onValueChange:w,children:[s.jsx(Ot,{children:s.jsx(Wt,{placeholder:"All Categories"})}),s.jsxs(At,{children:[s.jsx(gt,{value:"all",children:"All Categories"}),s.jsx(gt,{value:"check-in-locations",children:"Check-in Locations"}),a.map(D=>s.jsx(gt,{value:D.id,children:D.name},D.id))]})]})]})]}),o.length===0?s.jsx(pe,{children:s.jsx(ve,{className:"py-12 text-center",children:s.jsx("p",{className:"text-muted-foreground",children:"No businesses found in this city yet."})})}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:o.map(D=>s.jsxs(pe,{className:"overflow-hidden hover:shadow-lg transition-shadow cursor-pointer",children:[s.jsxs("div",{className:"relative",children:[D.image_url?s.jsx("img",{src:D.image_url,alt:D.business_name,className:"w-full h-48 object-cover"}):s.jsx("div",{className:"w-full h-48 bg-muted flex items-center justify-center",children:s.jsx("p",{className:"text-muted-foreground",children:"No image"})}),D.check_in_enabled&&s.jsxs(Ie,{variant:"destructive",className:"absolute top-2 right-2",children:["check-in to this location",typeof D.checkin_count=="number"&&` · ${D.checkin_count} check-ins`]})]}),s.jsxs(ve,{className:"p-4",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("h3",{className:"font-semibold text-lg",children:D.business_name}),c.get(D.id)&&s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(vu,{className:"w-4 h-4 fill-yellow-400 text-yellow-400"}),s.jsx("span",{className:"text-sm font-medium",children:c.get(D.id).average.toFixed(1)}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",c.get(D.id).count,")"]})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2 mb-2",children:[D.accepts_street_cash&&s.jsx(Ie,{className:"text-xs bg-[hsl(140,70%,32%)] text-white hover:bg-[hsl(140,70%,28%)]",children:"$treet Cash"}),s.jsxs(Ie,{variant:"outline",className:"text-xs",children:[s.jsx(dn,{className:"w-3 h-3 mr-1"}),D.cities.name]}),s.jsx(Ie,{variant:"secondary",className:"text-xs",children:D.business_categories.name}),D.business_categories_secondary&&s.jsx(Ie,{variant:"secondary",className:"text-xs",children:D.business_categories_secondary.name})]}),D.address&&s.jsxs("p",{className:"text-sm text-muted-foreground mb-2 flex items-center gap-1",children:[s.jsx(dn,{className:"w-3 h-3"}),D.address,D.google_maps_url&&s.jsx("a",{href:D.google_maps_url,target:"_blank",rel:"noopener noreferrer",onClick:T=>T.stopPropagation(),className:"text-primary hover:underline ml-2",children:"Navigate"})]}),s.jsx("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 text-justify",children:D.description||"No description available"}),s.jsxs("div",{className:"flex flex-col items-center gap-2",children:[D.deal_type&&D.deal_value&&(b?j.has(`${D.id}-${D.deal_version}`)?s.jsxs(Ie,{variant:"secondary",className:"text-xs",children:[s.jsx(Mr,{className:"w-3 h-3 mr-1"}),"Claimed"]}):g?s.jsxs(L,{size:"sm",variant:"default",onClick:T=>{T.stopPropagation(),H(D),C(!0)},className:"w-full text-xs",children:[s.jsx(Mr,{className:"w-3 h-3 mr-1"}),"V.I.P. MEMBERS DEAL AVAILABLE"]}):s.jsxs(L,{size:"sm",variant:"secondary",onClick:T=>{T.stopPropagation(),t({title:"V.I.P. Members Only",description:"Sorry you must be a V.I.P member to claim this deal.",variant:"destructive",action:s.jsx(Eg,{altText:"Upgrade to V.I.P.",onClick:()=>e("/?upgrade=true"),children:"Upgrade"})})},className:"w-full text-xs",children:[s.jsx(Mr,{className:"w-3 h-3 mr-1"}),"V.I.P. MEMBERS DEAL AVAILABLE"]}):null),s.jsx("button",{onClick:()=>e(`/local-shops/${D.id}`),className:"text-destructive font-bold hover:underline text-sm",children:"VIEW THE DETAILS, RATE & REVIEW"})]})]})]},D.id))}),E&&s.jsx(XS,{open:k,onOpenChange:C,businessId:E.id,businessName:E.business_name,dealType:E.deal_type,dealValue:E.deal_value,dealCode:E.deal_code,dealVersion:E.deal_version,onClaimed:ae})]})})})}function u3({businessId:e}){const{toast:t}=_t(),[n,r]=h.useState([]),[a,i]=h.useState(0),[o,l]=h.useState(0),[c,d]=h.useState(0),[u,f]=h.useState(0),[m,w]=h.useState(!1),[x,p]=h.useState(""),[b,v]=h.useState(!1),[g,y]=h.useState(null),[j,N]=h.useState(null),[k,C]=h.useState(!0),[E,H]=h.useState(!1);h.useEffect(()=>{A(),F()},[e]);const A=async()=>{const{data:{user:T}}=await R.auth.getUser();y((T==null?void 0:T.id)||null)},F=async()=>{try{const{data:T,error:_}=await R.from("business_reviews").select("*").eq("business_id",e).order("created_at",{ascending:!1});if(_)throw _;const O=[...new Set((T==null?void 0:T.map(I=>
481I.user_id))||[])],{data:G}=await R.from("profiles").select("id, name").in("id",O),Y=new Map((G==null?void 0:G.map(I=>[I.id,I.name]))||[]),oe=(T||[]).map(I=>({...I,user_name:Y.get(I.user_id)||"Anonymous"}));if(r(oe),T&&T.length>0){const I=T.reduce((he,X)=>he+X.rating,0)/T.length;i(I),l(T.length)}const{data:{user:M}}=await R.auth.getUser();if(M){const I=T==null?void 0:T.find(he=>he.user_id===M.id);I&&(N(I),d(I.rating),p(I.review_text||""))}}catch(T){console.error("Error loading reviews:",T)}finally{C(!1)}},U=T=>{if(!g){t({title:"Login Required",description:"You must be a member to rate and review businesses.",variant:"destructive"});return}d(T),w(!0)},ae=async()=>{if(g){if(c===0){t({title:"Rating Required",description:"Please select a star rating.",variant:"destructive"});return}v(!0);try{if(j){const{error:T}=await R.from("business_reviews").update({rating:c,review_text:x.trim()||null}).eq("id",j.id);if(T)throw T;t({title:"Review Updated",description:"Your review has been updated successfully!"})}else{const{error:T}=await R.from("business_reviews").insert({business_id:e,user_id:g,rating:c,review_text:x.trim()||null});if(T)throw T;t({title:"Review Submitted",description:"Thank you for your review!"})}await F(),w(!1)}catch(T){console.error("Error submitting review:",T),t({title:"Error",description:T.message||"Failed to submit review",variant:"destructive"})}finally{v(!1)}}},q=T=>T>=4?{label:"Great",color:"text-green-600"}:T===3?{label:"Neutral",color:"text-yellow-600"}:{label:"Bad",color:"text-red-600"},se=T=>new Date(T).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),D=(T,_=!1)=>s.jsx("div",{className:"flex gap-1",children:[1,2,3,4,5].map(O=>s.jsx(vu,{className:ke("w-5 h-5 transition-all duration-150",_&&"cursor-pointer hover:scale-110",(_?(u||c)>=O:T>=O)?"fill-yellow-400 text-yellow-400":"text-muted-foreground"),onClick:()=>_&&U(O),onMouseEnter:()=>_&&f(O),onMouseLeave:()=>_&&f(0)},O))});return k?s.jsx("div",{className:"animate-pulse h-8 bg-muted rounded w-40"}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[D(c||a,!0),o>0&&s.jsxs("span",{className:"text-sm text-muted-foreground",children:["⢠",a.toFixed(1)," (",o," ",o===1?"rating":"ratings",")"]}),o>0&&s.jsx("span",{className:ke("text-sm font-medium",q(a).color),children:q(a).label})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-sm text-muted-foreground",children:"rate/review this business"}),n.length>0&&s.jsxs("span",{className:"text-sm text-primary hover:underline cursor-pointer",onClick:()=>H(!E),children:["read reviews (",n.length,")"]})]})]}),!g&&s.jsx("p",{className:"text-sm text-muted-foreground",children:"Sign in to rate and review this business"}),m&&g&&s.jsxs("div",{className:"space-y-4 p-4 bg-muted/50 rounded-lg border animate-in slide-in-from-top-2 duration-200",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium",children:"Your Rating"}),s.jsxs("div",{className:"flex items-center gap-2",children:[D(c,!0),s.jsx("span",{className:ke("text-sm font-medium",q(c).color),children:c>0&&q(c).label})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium",children:"Your Review (optional)"}),s.jsx(Ir,{value:x,onChange:T=>p(T.target.value),placeholder:"Share your experience with this business...",rows:4,className:"resize-none"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(L,{onClick:ae,disabled:b||c===0,children:b?"Submitting...":j?"Update Review":"Submit Review"}),s.jsx(L,{variant:"outline",onClick:()=>{w(!1),j?(d(j.rating),p(j.review_text||"")):(d(0),p(""))},children:"Cancel"})]})]})]}),n.length>0&&E&&s.jsx("div",{className:"space-y-4",children:n.map(T=>s.jsxs("div",{className:"p-4 bg-muted/30 rounded-lg border space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex gap-0.5",children:[1,2,3,4,5].map(_=>s.jsx(vu,{className:ke("w-4 h-4",T.rating>=_?"fill-yellow-400 text-yellow-400":"text-muted-foreground")},_))}),s.jsx("span",{className:ke("text-xs font-medium",q(T.rating).color),children:q(T.rating).label})]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:se(T.created_at)})]}),s.jsx("p",{className:"text-sm font-medium",children:T.user_name}),T.review_text&&s.jsx("p",{className:"text-sm text-muted-foreground",children:T.review_text}),T.user_id===g&&s.jsx(L,{variant:"ghost",size:"sm",className:"text-xs",onClick:()=>{d(T.rating),p(T.review_text||""),w(!0)},children:"Edit your review"})]},T.id))})]})}function h3(){const{id:e}=vh(),t=Et(),{toast:n}=_t(),[r,a]=h.useState(null),[i,o]=h.useState(!0),[l,c]=h.useState(null),[d,u]=h.useState(!1),[f,m]=h.useState(!1),[w,x]=h.useState(!1);h.useEffect(()=>{b(),p()},[e]);const p=async()=>{const{data:{user:v}}=await R.auth.getUser();if(v){c(v.id);const{data:g}=await R.from("profiles").select("membership_plan_id").eq("id",v.id).single();g&&g.membership_plan_id&&g.membership_plan_id>=3&&x(!0)}},b=async()=>
481{if(e)try{const{data:v,error:g}=await R.from("business_listings").select(` 482 ${zc}, 483 cities(name), 484 business_categories!category_id(name), 485 business_categories_secondary:business_categories!category_id_secondary(name) 486 `).eq("id",e).eq("status","approved").single();if(g)throw g;a(v);const{data:{user:y}}=await R.auth.getUser();if(y&&v.deal_type&&v.deal_value){const{data:j}=await R.from("business_deal_claims").select("id").eq("business_id",e).eq("user_id",y.id).eq("deal_version",v.deal_version||0);u(!!j&&j.length>0)}}catch(v){console.error("Error loading listing:",v),n({title:"Error",description:"Failed to load business listing",variant:"destructive"}),t("/localshops")}finally{o(!1)}};return i?s.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:s.jsx("p",{className:"text-muted-foreground",children:"Loading..."})}):r?s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx("div",{className:"container mx-auto px-4 py-8",children:s.jsxs("div",{className:"max-w-4xl mx-auto",children:[s.jsxs(L,{variant:"ghost",onClick:()=>t("/localshops"),className:"mb-4",children:[s.jsx(Kn,{className:"w-4 h-4 mr-2"}),"Back to Directory"]}),s.jsxs(pe,{children:[s.jsxs(Ae,{children:[s.jsx(Me,{className:"text-2xl md:text-3xl",children:r.business_name}),s.jsx("div",{className:"mt-3",children:s.jsx(u3,{businessId:r.id})}),r.check_in_enabled&&s.jsx("div",{className:"mt-2",children:s.jsx(Ie,{variant:"destructive",children:"Check-in Available"})}),s.jsxs("div",{className:"flex gap-2 flex-wrap mt-2",children:[r.accepts_street_cash&&s.jsx(Ie,{className:"bg-[hsl(140,70%,32%)] text-white hover:bg-[hsl(140,70%,28%)]",children:"$treet Cash"}),s.jsx(Ie,{variant:"outline",children:r.cities.name}),s.jsx(Ie,{variant:"outline",children:r.business_categories.name}),r.business_categories_secondary&&s.jsx(Ie,{variant:"outline",children:r.business_categories_secondary.name})]})]}),s.jsxs(ve,{className:"space-y-6",children:[r.image_url?s.jsx("img",{src:r.image_url,alt:r.business_name,className:"w-full h-64 md:h-96 object-cover rounded-lg"}):s.jsx("div",{className:"w-full h-64 md:h-96 bg-muted flex items-center justify-center rounded-lg",children:s.jsx("p",{className:"text-muted-foreground",children:"No image available"})}),r.deal_type&&r.deal_value&&s.jsxs("div",{className:"bg-muted p-4 rounded-lg",children:[s.jsxs("div",{children:[s.jsxs("h3",{className:"text-lg font-semibold flex items-center gap-2",children:[s.jsx(Mr,{className:"w-5 h-5 text-primary"}),"V.I.P. Members Deal"]}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:r.deal_type==="percentage"?`${r.deal_value} Discount`:r.deal_value})]}),s.jsx("div",{className:"mt-3",children:l?d?s.jsx(Ie,{variant:"secondary",children:"Claimed"}):w?s.jsxs(L,{className:"w-full",onClick:()=>m(!0),children:[s.jsx(Mr,{className:"w-4 h-4 mr-2"}),"Claim Deal"]}):s.jsxs("div",{className:"flex flex-col items-center gap-2",children:[s.jsxs(L,{className:"w-full",variant:"secondary",onClick:()=>n({title:"V.I.P. Members Only",description:"Sorry you must be a V.I.P member to claim this deal.",variant:"destructive",action:s.jsx(Eg,{altText:"Upgrade to V.I.P.",onClick:()=>t("/?upgrade=true"),children:"Upgrade"})}),children:[s.jsx(Mr,{className:"w-4 h-4 mr-2"}),"Claim Deal"]}),s.jsx("a",{href:"/?upgrade=true",className:"text-xs text-primary hover:underline",children:"Upgrade to V.I.P. to claim deals"})]}):s.jsx("p",{className:"text-xs text-muted-foreground",children:"Log in to claim"})})]}),r.description&&s.jsxs("div",{children:[s.jsx("h3",{className:"text-xl font-semibold mb-3",children:"About"}),s.jsx("p",{className:"text-muted-foreground whitespace-pre-wrap text-justify",children:r.description})]}),s.jsxs("div",{className:"space-y-4",children:[r.address&&s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(dn,{className:"w-5 h-5 text-muted-foreground shrink-0 mt-0.5"}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium mb-1",children:"Address"}),s.jsxs("p",{className:"text-muted-foreground",children:[r.address,r.google_maps_url&&s.jsx("a",{href:r.google_maps_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline ml-2",children:"Navigate"})]})]})]}),r.phone_number&&s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(O2,{className:"w-5 h-5 text-muted-foreground shrink-0 mt-0.5"}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium mb-1",children:"Phone"}),s.jsx("a",{href:`tel:${r.phone_number}`,className:"text-muted-foreground hover:text-foreground transition-colors",children:r.phone_number})]})]}),r.hours_of_operation&&s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(ah,{className:"w-5 h-5 text-muted-foreground shrink-0 mt-0.5"}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium mb-1",children:"Hours of Operation"}),s.jsx("p",{className:"text-muted-foreground whitespace-pre-wrap",children:r.hours_of_operation})]})]}),r.website&&s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(Tj,{className:"w-5 h-5 text-muted-foreground shrink-0 mt-0.5"}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium mb-1",children:"Website"}),s.jsxs(L,{variant:"destructive",size:"sm",onClick:()=>window.open(r.website,"_blank","noopener,noreferrer"),children:[s.jsx(Co,{className:"w-4 h-4 mr-2"}),"Visit the Website"]})]})]})]}),(r.facebook_url||r.instagram_url||r.twitter_url||r.linkedin_url||r.tiktok_url||r.youtube_url)&&s.jsxs("div",{children:[s.jsx("h3",{className:"text-xl font-semibold mb-3",children:"Connect With Us"}),s.jsxs("div",{className:"flex gap-3 flex-wrap",children:[r.facebook_url&&s.jsxs("a",{href:r.facebook_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-4 py-2 rounded-md bg-muted hover:bg-muted/80 transition-colors",children:[s.jsx(S2,{className:"w-5 h-5"}),s.jsx("span",{children:"Facebook"})]}),r.instagram_url&&s.jsxs("a",{href:r.instagram_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-4 py-2 rounded-md bg-muted hover:bg-muted/80 transition-colors",children:[s.jsx(P2,{className:"w-5 h-5"}),s.jsx("span",{children:"Instagram"})]}),r.twitter_url&&s.jsxs("a",{href:r.twitter_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-4 py-2 rounded-md bg-muted hover:bg-muted/80 transition-colors",children:[s.jsx(L2,{className:"w-5 h-5"}),s.jsx("span",{children:"Twitter/X"})]}),r.linkedin_url&&s.jsxs("a",{href:r.linkedin_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-4 py-2 rounded-md bg-muted hover:bg-muted/80 transition-colors",children:[s.jsx(T2,{className:"w-5 h-5"}),s.jsx("span",{children:"LinkedIn"})]}),r.tiktok_url&&s.jsxs("a",{href:r.tiktok_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-4 py-2 rounded-md bg-muted hover:bg-muted/80 transition-colors",children:[s.jsx("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"
486currentColor",children:s.jsx("path",{d:"M19.59 6.69a4.83 4.83 0 0 1-3.77-4.25V2h-3.45v13.67a2.89 2.89 0 0 1-5.2 1.74 2.89 2.89 0 0 1 2.31-4.64 2.93 2.93 0 0 1 .88.13V9.4a6.84 6.84 0 0 0-1-.05A6.33 6.33 0 0 0 5 20.1a6.34 6.34 0 0 0 10.86-4.43v-7a8.16 8.16 0 0 0 4.77 1.52v-3.4a4.85 4.85 0 0 1-1-.1z"})}),s.jsx("span",{children:"TikTok"})]}),r.youtube_url&&s.jsxs("a",{href:r.youtube_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-4 py-2 rounded-md bg-muted hover:bg-muted/80 transition-colors",children:[s.jsx($2,{className:"w-5 h-5"}),s.jsx("span",{children:"YouTube"})]})]})]})]})]})]})}),r.deal_type&&r.deal_value&&r.deal_code&&s.jsx(XS,{open:f,onOpenChange:m,businessId:r.id,businessName:r.business_name,dealType:r.deal_type,dealValue:r.deal_value,dealCode:r.deal_code,dealVersion:r.deal_version||0,onClaimed:()=>u(!0)})]}):null}var f3="Separator",hw="horizontal",m3=["horizontal","vertical"],ek=h.forwardRef((e,t)=>{const{decorative:n,orientation:r=hw,...a}=e,i=p3(r)?r:hw,l=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return s.jsx(Ye.div,{"data-orientation":i,...l,...a,ref:t})});ek.displayName=f3;function p3(e){return m3.includes(e)}var tk=ek;const nk=h.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>s.jsx(tk,{ref:a,decorative:n,orientation:t,className:ke("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));nk.displayName=tk.displayName;function rk({dealType:e,setDealType:t,dealValue:n,setDealValue:r,dealCode:a,setDealCode:i}){const o=l=>{const c=l.target.value.replace(/\D/g,"").slice(0,4);i(c)};return s.jsxs("div",{className:"space-y-4",children:[s.jsx(nk,{}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Mr,{className:"w-5 h-5 text-primary"}),s.jsx("h3",{className:"text-lg font-medium",children:"V.I.P. Member Deal (Optional)"})]}),s.jsx("p",{className:"text-sm text-muted-foreground text-justify",children:"Offer an exclusive discount or deal to Street Pass V.I.P. members. Only V.I.P. Members can claim this deal when visiting your business."}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"dealType",children:"Deal Type"}),s.jsxs(Vt,{value:e,onValueChange:t,children:[s.jsx(Ot,{id:"dealType",children:s.jsx(Wt,{placeholder:"Select deal type"})}),s.jsxs(At,{children:[s.jsx(gt,{value:"none",children:"No Deal"}),s.jsx(gt,{value:"percentage",children:"Discount Percentage"}),s.jsx(gt,{value:"custom",children:"Custom Deal"})]})]})]}),e==="percentage"&&s.jsxs("div",{children:[s.jsx(B,{htmlFor:"dealValue",children:"Discount Percentage"}),s.jsxs(Vt,{value:n,onValueChange:r,children:[s.jsx(Ot,{id:"dealValue",children:s.jsx(Wt,{placeholder:"Select percentage"})}),s.jsx(At,{children:[5,10,15,20,25,30,35,40,45,50].map(l=>s.jsxs(gt,{value:`${l}%`,children:[l,"% Off"]},l))})]})]}),e==="custom"&&s.jsxs("div",{children:[s.jsx(B,{htmlFor:"dealValue",children:"Deal Description"}),s.jsx(Q,{id:"dealValue",value:n,onChange:l=>r(l.target.value),placeholder:"e.g., Buy one get one free",maxLength:200})]}),e&&e!=="none"&&s.jsxs("div",{children:[s.jsx(B,{htmlFor:"dealCode",children:"4-Digit Unlock Code *"}),s.jsx(Q,{id:"dealCode",value:a,onChange:o,placeholder:"Enter a 4-digit code",maxLength:4,inputMode:"numeric",pattern:"\\d{4}"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"This code will be used by you to unlock the deal for the member at your location."})]})]})}function g3(){const e=Et(),{toast:t}=_t(),[n,r]=h.useState(!1),[a,i]=h.useState([]),[o,l]=h.useState([]),[c,d]=h.useState(""),[u,f]=h.useState(""),[m,w]=h.useState(""),[x,p]=h.useState(""),[b,v]=h.useState(""),[g,y]=h.useState(""),[j,N]=h.useState(""),[k,C]=h.useState(""),[E,H]=h.useState(""),[A,F]=h.useState(""),[U,ae]=h.useState(""),[q,se]=h.useState(""),[D,T]=h.useState(""),[_,O]=h.useState(null),[G,Y]=h.useState(""),[oe,M]=h.useState(""),[I,he]=h.useState(""),[X,K]=h.useState(""),[P,Z]=h.useState(!1),[ee,le]=h.useState(""),[z,_e]=h.useState(""),[ue,De]=h.useState("");h.useEffect(()=>{Ve(),lt()},[]);const Ve=async()=>{const{data:{user:ie}}=await R.auth.getUser();ie||(t({title:"Authentication required",description:"Please log in to add a business",variant:"destructive"}),e("/sign-in"))},lt=async()=>{try{const[ie,Ce]=await Promise.all([R.from("cities").select("*").order("name"),R.from("business_categories").select("*").order("name")]);ie.data&&i(ie.data),Ce.data&&l(Ce.data)}catch(ie){console.error("Error loading data:",ie)}},vt=ie=>{var ge;const Ce=(ge=ie.target.files)==null?void 0:ge[0];if(!Ce)return;if(!Ce.type.startsWith("image/")){t({title:"Invalid file type",description:"Please select an image file",variant:"destructive"});return}if(Ce.size>5*1024*1024){t({title:"File too large",description:"Image must be less than 5MB",variant:"destructive"});return}O(Ce);const V=new FileReader;V.onloadend=()=>{Y(V.result)},V.readAsDataURL(Ce)},Qe=async ie=>{if(!_)return null;Z(!0);try{const Ce=_.name.split(".").pop(),V=`${ie}/${Date.now()}.${Ce}`,{error:ge,data:Ne}=await R.storage.from("business-images").upload(V,_);if(ge)throw ge;const{data:{publicUrl:Pe}}=R.storage.from("business-images").getPublicUrl(V);return Pe}catch(Ce){return console.error("Error uploading image:",Ce),t({title:"Upload failed",description:"Failed to upload image",variant:"destructive"}),null}finally{Z(!1)}},re=async ie=>{if(ie.preventDefault(),!c.trim()||!oe||!I){t({title:"Missing information",description:"Please fill in all required fields",variant:"destructive"});return}r(!0);try{const{data:{user:Ce}}=await R.auth.getUser();if(!Ce)throw new Error("Not authenticated");let V=null;_&&(V=await Qe(Ce.id));const ge=ee&&ee!=="none"&&z.trim()&&ue.length===4,{error:Ne}=await R.from("business_listings").insert({user_id:Ce.id,business_name:c.trim(),description:u.trim(),address:m.trim()||null,phone_number:x.trim()||null,hours_of_operation:b.trim()||null,website:g.trim()||null,facebook_url:j.trim()||null,instagram_url:k.trim()||null,twitter_url:E.trim()||null,linkedin_url:A.trim()||null,tiktok_url:U.trim()||null,youtube_url:q.trim()||null,google_maps_url:D.trim()||null,image_url:V,city_id:oe,category_id:I,category_id_secondary:X||null,status:"pending",deal_type:ge?ee:null,deal_value:ge?z.trim():null,deal_code:ge?ue:null,deal_version:ge?1:0});if(Ne)throw Ne;R.functions.invoke("send-submission-notification",{body:{type:"business",title:c.trim(),details:{Address:m.trim(),Phone:x.trim(),Website:g.trim()}}}).catch(Pe=>console.error("Notification failed:",Pe)),e("/business-submission-success")}catch(Ce){console.error("Error submitting business:",Ce),t({title:"Submission failed",description:"Failed to submit your business listing",variant:"destructive"})}finally{r(!1)}};return s.jsx("div",{className:"min-h-screen bg-background",children:s.jsx("div",{className:"container mx-auto px-4 py-8",children:s.jsxs("div",{className:"max-w-2xl mx-auto",children:[s.jsxs(L,{variant:"ghost",onClick:()=>e("/"),className:"mb-4",children:[s.jsx(Kn,{className:"w-4 h-4 mr-2"}),"Back to Profile"]}),s.jsxs(pe,{children:[s.jsxs(Ae,{children:[s.jsx(Me,{children:"Add Your Business"}),s.jsx(St,{children:"Submit your business to be featured in the Street Pass Local Shops Directory."})]}),s.jsx(ve,{children:s.jsxs("form",{onSubmit:re,className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx(B,{htmlFor:"businessName",children:"Business N
486ame *"}),s.jsx(Q,{id:"businessName",value:c,onChange:ie=>d(ie.target.value),placeholder:"Enter your business name",required:!0})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"city",children:"City *"}),s.jsxs(Vt,{value:oe,onValueChange:M,required:!0,children:[s.jsx(Ot,{id:"city",children:s.jsx(Wt,{placeholder:"Select a city"})}),s.jsx(At,{children:a.map(ie=>s.jsx(gt,{value:ie.id,children:ie.name},ie.id))})]})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"category",children:"Category *"}),s.jsxs(Vt,{value:I,onValueChange:he,required:!0,children:[s.jsx(Ot,{id:"category",children:s.jsx(Wt,{placeholder:"Select a category"})}),s.jsx(At,{children:o.map(ie=>s.jsx(gt,{value:ie.id,children:ie.name},ie.id))})]})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"category-secondary",children:"Secondary Category (Optional)"}),s.jsxs(Vt,{value:X,onValueChange:K,children:[s.jsx(Ot,{id:"category-secondary",children:s.jsx(Wt,{placeholder:"None"})}),s.jsx(At,{children:o.map(ie=>s.jsx(gt,{value:ie.id,children:ie.name},ie.id))})]})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"address",children:"Address"}),s.jsx(Q,{id:"address",value:m,onChange:ie=>w(ie.target.value),placeholder:"123 Main St, City, State ZIP"})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"googleMapsUrl",children:"Google Maps Link"}),s.jsx(Q,{id:"googleMapsUrl",value:D,onChange:ie=>T(ie.target.value),placeholder:"https://maps.google.com/...",type:"url"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Paste your Google Maps link to enable navigation"})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"phoneNumber",children:"Phone Number"}),s.jsx(Q,{id:"phoneNumber",value:x,onChange:ie=>p(ie.target.value),placeholder:"(555) 123-4567",type:"tel"})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"website",children:"Website"}),s.jsx(Q,{id:"website",value:g,onChange:ie=>y(ie.target.value),placeholder:"https://www.yourbusiness.com",type:"url"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-lg font-medium",children:"Social Media Links"}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"facebookUrl",children:"Facebook"}),s.jsx(Q,{id:"facebookUrl",value:j,onChange:ie=>N(ie.target.value),placeholder:"https://facebook.com/yourbusiness",type:"url"})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"instagramUrl",children:"Instagram"}),s.jsx(Q,{id:"instagramUrl",value:k,onChange:ie=>C(ie.target.value),placeholder:"https://instagram.com/yourbusiness",type:"url"})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"twitterUrl",children:"Twitter/X"}),s.jsx(Q,{id:"twitterUrl",value:E,onChange:ie=>H(ie.target.value),placeholder:"https://twitter.com/yourbusiness",type:"url"})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"linkedinUrl",children:"LinkedIn"}),s.jsx(Q,{id:"linkedinUrl",value:A,onChange:ie=>F(ie.target.value),placeholder:"https://linkedin.com/company/yourbusiness",type:"url"})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"tiktokUrl",children:"TikTok"}),s.jsx(Q,{id:"tiktokUrl",value:U,onChange:ie=>ae(ie.target.value),placeholder:"https://tiktok.com/@yourbusiness",type:"url"})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"youtubeUrl",children:"YouTube"}),s.jsx(Q,{id:"youtubeUrl",value:q,onChange:ie=>se(ie.target.value),placeholder:"https://youtube.com/@yourbusiness",type:"url"})]})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"hoursOfOperation",children:"Hours of Operation"}),s.jsx(Ir,{id:"hoursOfOperation",value:b,onChange:ie=>v(ie.target.value),placeholder:`Mon-Fri: 9AM-5PM 487Sat: 10AM-4PM 488Sun: Closed`,rows:3})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"image",children:"Business Image"}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Q,{id:"image",type:"file",accept:"image/*",onChange:vt,className:"cursor-pointer"})}),G&&s.jsx("div",{className:"relative w-full h-48 rounded-lg overflow-hidden border",children:s.jsx("img",{src:G,alt:"Preview",className:"w-full h-full object-cover"})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Upload an image of your business (max 5MB)"})]})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"description",children:"About Your Business"}),s.jsx(Ir,{id:"description",value:u,onChange:ie=>f(ie.target.value),placeholder:"Describe your business...",rows:6})]}),s.jsx(rk,{dealType:ee,setDealType:le,dealValue:z,setDealValue:_e,dealCode:ue,setDealCode:De}),s.jsx(L,{type:"submit",className:"w-full",disabled:n||P,children:n||P?"Submitting...":"Submit Business Listing"})]})})]})]})})})}function v3(){const{id:e}=vh(),t=Et(),[n]=Wg(),{toast:r}=_t(),[a,i]=h.useState(!1),[o,l]=h.useState(!0),[c,d]=h.useState([]),[u,f]=h.useState([]),[m,w]=h.useState(""),[x,p]=h.useState(""),[b,v]=h.useState(""),[g,y]=h.useState(""),[j,N]=h.useState(""),[k,C]=h.useState(""),[E,H]=h.useState(""),[A,F]=h.useState(""),[U,ae]=h.useState(""),[q,se]=h.useState(""),[D,T]=h.useState(""),[_,O]=h.useState(""),[G,Y]=h.useState(""),[oe,M]=h.useState(null),[I,he]=h.useState(""),[X,K]=h.useState(""),[P,Z]=h.useState(""),[ee,le]=h.useState(""),[z,_e]=h.useState(""),[ue,De]=h.useState(!1),[Ve,lt]=h.useState(!1),[vt,Qe]=h.useState([]),[re,ie]=h.useState(""),[Ce,V]=h.useState(""),[ge,Ne]=h.useState(""),[Pe,We]=h.useState(""),[xt,Je]=h.useState(""),[It,on]=h.useState(""),[tn,nn]=h.useState(""),[En,$]=h.useState(0),ne=n.get("mode")==="admin";h.useEffect(()=>{$e()},[e]);const $e=async()=>{try{const{data:{user:je}}=await R.auth.getUser();if(!je){r({title:"Authentication required",description:"Please log in to edit a business",variant:"destructive"}),t("/sign-in");return}const{data:st,error:Yt}=await R.rpc("is_admin");if(Yt)throw Yt;const et=st===!0&≠if(lt(et),et){const{data:Kc}=await R.rpc("get_all_users_with_profiles");Kc&&Qe(Kc.map(Qo=>({id:Qo.id,name:Qo.name||"Unknown",email:Qo.email||""})))}else Qe([]),V("");const{data:at,error:Zn}=await R.from("business_listings").select(zc).eq("id",e).single();if(Zn)throw Zn;if(!et&&at.user_id!==je.id){r({title:"Access denied",description:"You can only edit your own listings",variant:"destructive"}),t("/");return}w(at.business_name),p(at.description||""),v(at.address||""),y(at.phone_number||""),N(at.hours_of_operation||""),C(at.website||""),H(at.facebook_url||""),F(at.instagram_url||""),ae(at.twitter_url||""),se(at.linkedin_url||""),T(at.tiktok_url||""),O(at.youtube_url||""),Y(at.google_maps_url||""),K(at.image_url||""),he(at.image_url||""),Z(at.city_id),le(at.category_id),_e(at.category_id_secondary||""),ie(at.user_id),Ne(at.deal_type||""),We(at.deal_value||""),Je(at.deal_code||""),on(at.deal_value||""),nn(at.deal_type||""),$(at.deal_version||0);const[Fa,Fs]=await Promise.all([R.from("cities").select("*").order("name"),R.from("business_categories").select("*").order("name")]);Fa.data&&d(Fa.data),Fs.data&&f(Fs.data)}catch(je){console.error("Error loading:",je),r({title:"Error",description:"Failed to load business listing",variant:"destructive"}),t("/")}finally{l(!1)}},Se=je=>{var et;const st=(et=je.target.files)==null?void 0:et[0];if(!st)return;if(!st.type.startsWith("image/")){r({title:"Invalid file type",description:"Please select an image file",variant:"destructive"});return}if(st.size>5*1024*1024){r({title:"File too large",description:"Image must be less than 5MB",variant:"destructive"});return}M(st);const Yt=new FileReader;Yt.onloadend=()=>{he(Yt.result)}
488,Yt.readAsDataURL(st)},He=async je=>{if(!oe)return null;De(!0);try{const st=oe.name.split(".").pop(),Yt=`${je}/${Date.now()}.${st}`,{error:et}=await R.storage.from("business-images").upload(Yt,oe);if(et)throw et;const{data:{publicUrl:at}}=R.storage.from("business-images").getPublicUrl(Yt);return at}catch(st){return console.error("Error uploading image:",st),r({title:"Upload failed",description:"Failed to upload image",variant:"destructive"}),null}finally{De(!1)}},Xe=async je=>{if(je.preventDefault(),!m.trim()||!P||!ee){r({title:"Missing information",description:"Please fill in all required fields",variant:"destructive"});return}i(!0);try{const{data:{user:st}}=await R.auth.getUser();if(!st)throw new Error("Not authenticated");let Yt=X;if(oe){const Fs=await He(st.id);Fs&&(Yt=Fs)}const et={business_name:m.trim(),description:x.trim(),address:b.trim()||null,phone_number:g.trim()||null,hours_of_operation:j.trim()||null,website:k.trim()||null,facebook_url:E.trim()||null,instagram_url:A.trim()||null,twitter_url:U.trim()||null,linkedin_url:q.trim()||null,tiktok_url:D.trim()||null,youtube_url:_.trim()||null,google_maps_url:G.trim()||null,image_url:Yt,city_id:P,category_id:ee,category_id_secondary:z||null},at=ge&&ge!=="none"&&Pe.trim()&&xt.length===4,Zn=Pe.trim()!==It||ge!==tn;at?(et.deal_type=ge,et.deal_value=Pe.trim(),et.deal_code=xt,Zn&&(et.deal_version=En+1)):(et.deal_type=null,et.deal_value=null,et.deal_code=null),Ve&&re&&(et.user_id=re);const{error:Fa}=await R.from("business_listings").update(et).eq("id",e);if(Fa)throw Fa;r({title:"Success",description:"Business listing updated successfully"}),t(Ve?"/admin":"/my-listings")}catch(st){console.error("Error updating business:",st),r({title:"Update failed",description:"Failed to update business listing",variant:"destructive"})}finally{i(!1)}};return o?s.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:s.jsx("p",{className:"text-muted-foreground",children:"Loading..."})}):s.jsx("div",{className:"min-h-screen bg-background",children:s.jsx("div",{className:"container mx-auto px-4 py-8",children:s.jsxs("div",{className:"max-w-2xl mx-auto",children:[s.jsxs(L,{variant:"ghost",onClick:()=>t(Ve?"/admin":"/my-listings"),className:"mb-4",children:[s.jsx(Kn,{className:"w-4 h-4 mr-2"}),"Back"]}),s.jsxs(pe,{children:[s.jsxs(Ae,{children:[s.jsx(Me,{children:"Edit Business Listing"}),s.jsx(St,{children:"Update your business information"})]}),s.jsx(ve,{children:s.jsxs("form",{onSubmit:Xe,className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx(B,{htmlFor:"businessName",children:"Business Name *"}),s.jsx(Q,{id:"businessName",value:m,onChange:je=>w(je.target.value),placeholder:"Enter your business name",required:!0})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"city",children:"City *"}),s.jsxs(Vt,{value:P,onValueChange:Z,required:!0,children:[s.jsx(Ot,{id:"city",children:s.jsx(Wt,{placeholder:"Select a city"})}),s.jsx(At,{children:c.map(je=>s.jsx(gt,{value:je.id,children:je.name},je.id))})]})]}),Ve===!0&&s.jsxs("div",{children:[s.jsx(B,{htmlFor:"owner",children:"Assign Owner"}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"relative",children:[s.jsx(Mj,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(Q,{placeholder:"Search members...",value:Ce,onChange:je=>V(je.target.value),className:"pl-10"})]}),s.jsxs(Vt,{value:re,onValueChange:ie,children:[s.jsx(Ot,{id:"owner",children:s.jsx(Wt,{placeholder:"Select a member"})}),s.jsx(At,{children:vt.filter(je=>{if(!Ce.trim())return!0;const st=Ce.toLowerCase();return je.name.toLowerCase().includes(st)||je.email.toLowerCase().includes(st)}).map(je=>s.jsxs(gt,{value:je.id,children:[je.name," (",je.email,")"]},je.id))})]})]})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"category",children:"Category *"}),s.jsxs(Vt,{value:ee,onValueChange:le,required:!0,children:[s.jsx(Ot,{id:"category",children:s.jsx(Wt,{placeholder:"Select a category"})}),s.jsx(At,{children:u.map(je=>s.jsx(gt,{value:je.id,children:je.name},je.id))})]})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"category-secondary",children:"Secondary Category (Optional)"}),s.jsxs(Vt,{value:z,onValueChange:_e,children:[s.jsx(Ot,{id:"category-secondary",children:s.jsx(Wt,{placeholder:"None"})}),s.jsx(At,{children:u.map(je=>s.jsx(gt,{value:je.id,children:je.name},je.id))})]})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"address",children:"Address"}),s.jsx(Q,{id:"address",value:b,onChange:je=>v(je.target.value),placeholder:"123 Main St, City, State ZIP"})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"googleMapsUrl",children:"Google Maps Link"}),s.jsx(Q,{id:"googleMapsUrl",value:G,onChange:je=>Y(je.target.value),placeholder:"https://maps.google.com/...",type:"url"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Paste your Google Maps link to enable navigation"})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"phoneNumber",children:"Phone Number"}),s.jsx(Q,{id:"phoneNumber",value:g,onChange:je=>y(je.target.value),placeholder:"(555) 123-4567",type:"tel"})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"website",children:"Website"}),s.jsx(Q,{id:"website",value:k,onChange:je=>C(je.target.value),placeholder:"https://www.yourbusiness.com",type:"url"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-lg font-medium",children:"Social Media Links"}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"facebookUrl",children:"Facebook"}),s.jsx(Q,{id:"facebookUrl",value:E,onChange:je=>H(je.target.value),placeholder:"https://facebook.com/yourbusiness",type:"url"})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"instagramUrl",children:"Instagram"}),s.jsx(Q,{id:"instagramUrl",value:A,onChange:je=>F(je.target.value),placeholder:"https://instagram.com/yourbusiness",type:"url"})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"twitterUrl",children:"Twitter/X"}),s.jsx(Q,{id:"twitterUrl",value:U,onChange:je=>ae(je.target.value),placeholder:"https://twitter.com/yourbusiness",type:"url"})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"linkedinUrl",children:"LinkedIn"}),s.jsx(Q,{id:"linkedinUrl",value:q,onChange:je=>se(je.target.value),placeholder:"https://linkedin.com/company/yourbusiness",type:"url"})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"tiktokUrl",children:"TikTok"}),s.jsx(Q,{id:"tiktokUrl",value:D,onChange:je=>T(je.target.value),placeholder:"https://tiktok.com/@yourbusiness",type:"url"})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"youtubeUrl",children:"YouTube"}
488),s.jsx(Q,{id:"youtubeUrl",value:_,onChange:je=>O(je.target.value),placeholder:"https://youtube.com/@yourbusiness",type:"url"})]})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"hoursOfOperation",children:"Hours of Operation"}),s.jsx(Ir,{id:"hoursOfOperation",value:j,onChange:je=>N(je.target.value),placeholder:`Mon-Fri: 9AM-5PM 489Sat: 10AM-4PM 490Sun: Closed`,rows:3})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"image",children:"Business Image"}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Q,{id:"image",type:"file",accept:"image/*",onChange:Se,className:"cursor-pointer"}),I&&s.jsx("div",{className:"relative w-full h-48 rounded-lg overflow-hidden border",children:s.jsx("img",{src:I,alt:"Preview",className:"w-full h-full object-cover"})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Upload a new image to replace the current one (max 5MB)"})]})]}),s.jsxs("div",{children:[s.jsx(B,{htmlFor:"description",children:"About Your Business"}),s.jsx(Ir,{id:"description",value:x,onChange:je=>p(je.target.value),placeholder:"Describe your business...",rows:6})]}),s.jsx(rk,{dealType:ge,setDealType:Ne,dealValue:Pe,setDealValue:We,dealCode:xt,setDealCode:Je}),s.jsx(L,{type:"submit",className:"w-full",disabled:a||ue,children:a||ue?"Updating...":"Update Business Listing"})]})})]})]})})})}function x3(){const e=Et(),{toast:t}=_t(),[n,r]=h.useState([]),[a,i]=h.useState(!0),[o,l]=h.useState({});h.useEffect(()=>{c()},[]);const c=async()=>{try{const{data:{user:u}}=await R.auth.getUser();if(!u){t({title:"Authentication required",description:"Please log in to view your listings",variant:"destructive"}),e("/sign-in");return}const{data:f,error:m}=await R.from("business_listings").select(` 491 ${zc}, 492 cities(name), 493 business_categories!category_id(name), 494 business_categories_secondary:business_categories!category_id_secondary(name) 495 `).eq("user_id",u.id).order("created_at",{ascending:!1});if(m)throw m;if(r(f||[]),f&&f.length>0){const w=f.map(p=>p.id),{data:x}=await R.from("business_deal_claims").select("business_id").in("business_id",w);if(x){const p={};x.forEach(b=>{p[b.business_id]=(p[b.business_id]||0)+1}),l(p)}}}catch(u){console.error("Error loading listings:",u),t({title:"Error",description:"Failed to load your listings",variant:"destructive"})}finally{i(!1)}},d=u=>{switch(u){case"approved":return s.jsx(Ie,{variant:"default",children:"Approved"});case"pending":return s.jsx(Ie,{variant:"outline",children:"Pending Review"});case"rejected":return s.jsx(Ie,{variant:"destructive",children:"Rejected"});default:return s.jsx(Ie,{variant:"outline",children:u})}};return a?s.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:s.jsx("p",{className:"text-muted-foreground",children:"Loading..."})}):s.jsx("div",{className:"min-h-screen bg-background",children:s.jsx("div",{className:"container mx-auto px-4 py-8",children:s.jsxs("div",{className:"max-w-6xl mx-auto",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs(L,{variant:"ghost",onClick:()=>e("/"),children:[s.jsx(Kn,{className:"w-4 h-4 mr-2"}),"Back to Profile"]}),s.jsx(L,{onClick:()=>e("/add-business"),children:"Add New Business"})]}),s.jsxs(pe,{children:[s.jsx(Ae,{children:s.jsx(Me,{children:"My Business Listings"})}),s.jsx(ve,{children:n.length===0?s.jsxs("div",{className:"text-center py-8",children:[s.jsx("p",{className:"text-muted-foreground mb-4",children:"You haven't submitted any business listings yet"}),s.jsx(L,{onClick:()=>e("/add-business"),children:"Add Your First Business"})]}):s.jsx("div",{className:"space-y-4",children:n.map(u=>s.jsx(pe,{children:s.jsx(ve,{className:"p-4",children:s.jsxs("div",{className:"flex gap-4",children:[u.image_url?s.jsx("img",{src:u.image_url,alt:u.business_name,className:"w-24 h-24 object-cover rounded-lg"}):s.jsx("div",{className:"w-24 h-24 bg-muted flex items-center justify-center rounded-lg",children:s.jsx("span",{className:"text-muted-foreground text-xs",children:"No image"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[s.jsx("h3",{className:"font-semibold text-lg truncate",children:u.business_name}),d(u.status)]}),s.jsxs("div",{className:"flex gap-2 flex-wrap mb-2",children:[s.jsx(Ie,{variant:"outline",children:u.cities.name}),s.jsx(Ie,{variant:"outline",children:u.business_categories.name}),u.business_categories_secondary&&s.jsx(Ie,{variant:"outline",children:u.business_categories_secondary.name}),u.deal_type&&u.deal_value&&s.jsxs(Ie,{variant:"secondary",children:[o[u.id]||0," Deal",(o[u.id]||0)!==1?"s":""," Claimed"]})]}),u.description&&s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mb-3",children:u.description}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(L,{size:"sm",variant:"outline",onClick:()=>e(`/edit-business/${u.id}`),children:[s.jsx(pl,{className:"w-4 h-4 mr-2"}),"Edit"]}),u.status==="approved"&&s.jsx(L,{size:"sm",variant:"outline",onClick:()=>e(`/local-shops/${u.id}`),children:"View Listing"})]})]})]})})},u.id))})})]})]})})})}function y3(){const e=Et();return s.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:s.jsxs(pe,{className:"max-w-md w-full",children:[s.jsxs(Ae,{className:"text-center",children:[s.jsx("div",{className:"flex justify-center mb-4",children:s.jsx(ci,{className:"w-16 h-16 text-green-500"})}),s.jsx(Me,{className:"text-2xl",children:"Submission Successful!"})]}),s.jsxs(ve,{className:"text-center space-y-4",children:[s.jsx("p",{className:"text-muted-foreground",children:"Your business listing has been submitted successfully and is now pending approval from our admin team."}),s.jsx("p",{className:"text-muted-foreground",children:"You'll be notified once your listing is reviewed and approved."}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 mt-6",children:[s.jsx(L,{onClick:()=>e("/"),className:"flex-1",children:"Return to Profile"}),s.jsx(L,{onClick:()=>e("/localshops"),variant:"outline",className:"flex-1",children:"View Directory"})]})]})]})})}const w3=e=>{var t,n;
495try{const r=new URL(e);let a="";return r.hostname.includes("youtube.com")?(a=r.searchParams.get("v")||"",!a&&r.pathname.startsWith("/embed/")&&(a=((t=r.pathname.split("/embed/")[1])==null?void 0:t.split(/[?&]/)[0])||""),!a&&r.pathname.startsWith("/shorts/")&&(a=((n=r.pathname.split("/shorts/")[1])==null?void 0:n.split(/[?&]/)[0])||"")):r.hostname==="youtu.be"&&(a=r.pathname.slice(1).split(/[?&]/)[0]||""),a?`https://www.youtube.com/embed/${a}`:null}catch{return null}},b3=e=>`https://w.soundcloud.com/player/?url=${encodeURIComponent(e)}&color=%23ff5500&auto_play=false&hide_related=true&show_comments=false&show_user=true&show_reposts=false&show_teaser=false`,j3=e=>{try{const n=new URL(e).pathname;return`https://player-widget.mixcloud.com/widget/iframe/?hide_cover=1&feed=${encodeURIComponent(n)}`}catch{return""}},sk=({soundcloud_url:e,youtube_url:t,mixcloud_url:n})=>e||t||n?s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-lg font-semibold flex items-center gap-2",children:"ðµ Media"}),t&&(()=>{const a=w3(t);return a?s.jsx("div",{className:"aspect-video w-full rounded-lg overflow-hidden",children:s.jsx("iframe",{src:a,className:"w-full h-full",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,title:"YouTube video"})}):null})(),e&&s.jsx("div",{className:"w-full rounded-lg overflow-hidden",children:s.jsx("iframe",{width:"100%",height:"166",scrolling:"no",frameBorder:"no",allow:"autoplay",src:b3(e),title:"SoundCloud player"})}),n&&(()=>{const a=j3(n);return a?s.jsx("div",{className:"w-full rounded-lg overflow-hidden",children:s.jsx("iframe",{width:"100%",height:"120",src:a,frameBorder:"0",allow:"autoplay",title:"Mixcloud player"})}):null})()]}):null;function jt(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 cr(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Rn(e,t){const n=jt(e);return isNaN(t)?cr(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Vr(e,t){const n=jt(e);if(isNaN(t))return cr(e,NaN);if(!t)return n;const r=n.getDate(),a=cr(e,n.getTime());a.setMonth(n.getMonth()+t+1,0);const i=a.getDate();return r>=i?a:(n.setFullYear(a.getFullYear(),a.getMonth(),r),n)}const xv=6048e5,_3=864e5;let N3={};function Vc(){return N3}function fs(e,t){var l,c,d,u;const n=Vc(),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??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,a=jt(e),i=a.getDay(),o=(i<r?7:0)+i-r;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function xi(e){return fs(e,{weekStartsOn:1})}function ak(e){const t=jt(e),n=t.getFullYear(),r=cr(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const a=xi(r),i=cr(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const o=xi(i);return t.getTime()>=a.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function Io(e){const t=jt(e);return t.setHours(0,0,0,0),t}function $u(e){const t=jt(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 ss(e,t){const n=Io(e),r=Io(t),a=+n-$u(n),i=+r-$u(r);return Math.round((a-i)/_3)}function S3(e){const t=ak(e),n=cr(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),xi(n)}function _p(e,t){const n=t*7;return Rn(e,n)}function k3(e,t){return Vr(e,t*12)}function C3(e){let t;return e.forEach(function(n){const r=jt(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function E3(e){let t;return e.forEach(n=>{const r=jt(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function Vn(e,t){const n=Io(e),r=Io(t);return+n==+r}function yv(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function P3(e){if(!yv(e)&&typeof e!="number")return!1;const t=jt(e);return!isNaN(Number(t))}function wc(e,t){const n=jt(e),r=jt(t),a=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return a*12+i}function T3(e,t,n){const r=fs(e,n),a=fs(t,n),i=+r-$u(r),o=+a-$u(a);return Math.round((i-o)/xv)}function wv(e){const t=jt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function Yn(e){const t=jt(e);return t.setDate(1),t.setHours(0,0,0,0),t}function ik(e){const t=jt(e),n=cr(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function bv(e,t){var l,c,d,u;const n=Vc(),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??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,a=jt(e),i=a.getDay(),o=(i<r?-7:0)+6-(i-r);return a.setDate(a.getDate()+o),a.setHours(23,59,59,999),a}function ok(e){return bv(e,{weekStartsOn:1}
vendor: 13,722 bytes, line 495
495)}const R3={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"}},D3=(e,t,n)=>{let r;const a=R3[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Lf(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const O3={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},A3={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},M3={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},I3={date:Lf({formats:O3,defaultWidth:"full"}),time:Lf({formats:A3,defaultWidth:"full"}),dateTime:Lf({formats:M3,defaultWidth:"full"})},L3={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},$3=(e,t,n,r)=>L3[e];function cl(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):o;a=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[l]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return a[i]}}const F3={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},U3={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},z3={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"]},B3={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","Friday","Saturday"]},V3={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"}},W3={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"}},H3=(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"},q3={ordinalNumber:H3,era:cl({values:F3,defaultWidth:"wide"}),quarter:cl({values:U3,defaultWidth:"wide",argumentCallback:e=>e-1}),month:cl({values:z3,defaultWidth:"wide"}),day:cl({values:B3,defaultWidth:"wide"}),dayPeriod:cl({values:V3,defaultWidth:"wide",formattingValues:W3,defaultFormattingWidth:"wide"})};function dl(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;const o=i[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?G3(l,f=>f.test(o)):Y3(l,f=>f.test(o));let d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const u=t.slice(o.length);return{value:d,rest:u}}}function Y3(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function G3(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function K3(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const a=r[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const l=t.slice(a.length);return{value:o,rest:l}}}const Z3=/^(\d+)(th|st|nd|rd)?/i,Q3=/\d+/i,J3={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},X3={any:[/^b/i,/^(a|c)/i]},e$={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},t$={any:[/1/i,/2/i,/3/i,/4/i]},n$={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},r$={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]},s$={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},a$={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]},i$={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},o$={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}},l$={ordinalNumber:K3({matchPattern:Z3,parsePattern:Q3,valueCallback:e=>parseInt(e,10)}),era:dl({matchPatterns:J3,defaultMatchWidth:"wide",parsePatterns:X3,defaultParseWidth:"any"}),quarter:dl({matchPatterns:e$,defaultMatchWidth:"wide",parsePatterns:t$,defaultParseWidth:"any",valueCallback:e=>e+1}),month:dl({matchPatterns:n$,defaultMatchWidth:"wide",parsePatterns:r$,defaultParseWidth:"any"}),day:dl({matchPatterns:s$,defaultMatchWidth:"wide",parsePatterns:a$,defaultParseWidth:"any"}),dayPeriod:dl({matchPatterns:i$,defaultMatchWidth:"any",parsePatterns:o$,defaultParseWidth:"any"})},lk={code:"en-US",formatDistance:D3,formatLong:I3,formatRelative:$3,localize:q3,match:l$,options:{weekStartsOn:0,firstWeekContainsDate:1}};function c$(e){const t=jt(e);return ss(t,ik(t))+1}function ck(e){const t=jt(e),n=+xi(t)-+S3(t);return Math.round(n/xv)+1}function dk(e,t){var u,f,m,w;const n=jt(e),r=n.getFullYear(),a=Vc(),i=(t==null?void 0:t.firstWeekContainsDate)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??a.firstWeekContainsDate??((w=(m=a.locale)==null?void 0:m.options)==null?void 0:w.firstWeekContainsDate)??1,o=cr(e,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const l=fs(o,t),c=cr(e,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const d=fs(c,t);return n.getTime()>=l.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function d$(e,t){var l,c,d,u;const n=Vc(),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??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,a=dk(e,t),i=cr(e,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),fs(i,t)}function uk(e,t){const n=jt(e),r=+fs(n,t)-+d$(n,t);return Math.round(r/xv)+1}function kt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Ws={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(),a=Math.trunc(r*Math.pow(10,n-3));return kt(a,t.length)}},Mi={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},fw={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(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return Ws.y(e,t)},Y:function(e,t,n,r){const a=dk(e,r),i=a>0?a:1-a;if(t==="YY"){const o=i%100;return kt(o,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):kt(i,t.length)},R:function(e,t){const n=ak(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 Ws.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 a=uk(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):kt(a,t.length)},I:function(e,t,n){const r=ck(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"}):Ws.d(e,t)},D:function(e,t,n){const r=c$(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 a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return kt(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return kt(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return kt(a,t.length);case"io":return n.ordinalNumber(a,{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 a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let a;switch(r===12?a=Mi.noon:r===0?a=Mi.midnight:a=r/12>
vendor: 4,693 bytes, line 495
495=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let a;switch(r>=17?a=Mi.evening:r>=12?a=Mi.afternoon:r>=4?a=Mi.morning:a=Mi.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{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 Ws.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ws.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"}):Ws.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ws.s(e,t)},S:function(e,t){return Ws.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return pw(r);case"XXXX":case"XX":return qa(r);case"XXXXX":case"XXX":default:return qa(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return pw(r);case"xxxx":case"xx":return qa(r);case"xxxxx":case"xxx":default:return qa(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+mw(r,":");case"OOOO":default:return"GMT"+qa(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+mw(r,":");case"zzzz":default:return"GMT"+qa(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 mw(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+t+kt(i,2)}function pw(e,t){return e%60===0?(e>0?"-":"+")+kt(Math.abs(e)/60,2):qa(e,t)}function qa(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=kt(Math.trunc(r/60),2),i=kt(r%60,2);return n+a+t+i}const gw=(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"})}},hk=(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"})}},u$=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return gw(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",gw(r,t)).replace("{{time}}",hk(a,t))},h$={p:hk,P:u$},f$=/^D+$/,m$=/^Y+$/,p$=["D","DD","YY","YYYY"];function g$(e){return f$.test(e)}function v$(e){return m$.test(e)}function x$(e,t,n){const r=y$(e,t,n);if(console.warn(r),p$.includes(e))throw new RangeError(r)}function y$(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 w$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,b$=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,j$=/^'([^]*?)'?$/,_$=/''/g,N$=/[a-zA-Z]/;function Si(e,t,n){var u,f,m,w,x,p,b,v;const r=Vc(),a=(n==null?void 0:n.locale)??r.locale??lk,i=(n==null?void 0:n.firstWeekContainsDate)??((f=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??r.firstWeekContainsDate??((w=(m=r.locale)==null?void 0:m.options)==null?void 0:w.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((p=(x=n==null?void 0:n.locale)==null?void 0:x.options)==null?void 0:p.weekStartsOn)??r.weekStartsOn??((v=(b=r.locale)==null?void 0:b.options)==null?void 0:v.weekStartsOn)??0,l=jt(e);if(!P3(l))throw new RangeError("Invalid time value");let c=t.match(b$).map(g=>{const y=g[0];if(y==="p"||y==="P"){const j=h$[y];return j(g,a.formatLong)}return g}).join("").match(w$).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const y=g[0];if(y==="'")return{isToken:!1,value:S$(g)};if(fw[y])return{isToken:!0,value:g};
495if(y.match(N$))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");return{isToken:!1,value:g}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return c.map(g=>{if(!g.isToken)return g.value;const y=g.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&v$(y)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&g$(y))&&x$(y,t,String(e));const j=fw[y[0]];return j(l,y,a.localize,d)}).join("")}function S$(e){const t=e.match(j$);return t?t[1].replace(_$,"'"):e}function k$(e){const t=jt(e),n=t.getFullYear(),r=t.getMonth(),a=cr(e,0);return a.setFullYear(n,r+1,0),a.setHours(0,0,0,0),a.getDate()}function C$(e){return Math.trunc(+jt(e)/1e3)}function E$(e){const t=jt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function P$(e,t){return T3(E$(e),Yn(e),t)+1}function Np(e,t){const n=jt(e),r=jt(t);return n.getTime()>r.getTime()}function fk(e,t){const n=jt(e),r=jt(t);return+n<+r}function jv(e,t){const n=jt(e),r=jt(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function T$(e,t){const n=jt(e),r=jt(t);return n.getFullYear()===r.getFullYear()}function $f(e,t){return Rn(e,-t)}function Ff(e,t){const n=jt(e),r=n.getFullYear(),a=n.getDate(),i=cr(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const o=k$(i);return n.setMonth(t,Math.min(a,o)),n}function vw(e,t){const n=jt(e);return isNaN(+n)?cr(e,NaN):(n.setFullYear(t),n)}var Ke=function(){return Ke=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ke.apply(this,arguments)};function R$(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 a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function mk(e,t,n){for(var r=0,a=t.length,i;r<a;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}function Wc(e){return e.mode==="multiple"}function Hc(e){return e.mode==="range"}function Ih(e){return e.mode==="single"}var D$={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:"rdp-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 O$(e,t){return Si(e,"LLLL y",t)}function A$(e,t){return Si(e,"d",t)}function M$(e,t){return Si(e,"LLLL",t)}function I$(e){return"".concat(e)}function L$(e,t){return Si(e,"cccccc",t)}function $$(e,t){return Si(e,"yyyy",t)}var F$=Object.freeze({__proto__:null,formatCaption:O$,formatDay:A$,formatMonthCaption:M$,formatWeekNumber:I$,formatWeekdayName:L$,formatYearCaption:$$}),U$=function(e,t,n){return Si(e,"do MMMM (EEEE)",n)},z$=function(){return"Month: "},B$=function(){return"Go to next month"},V$=function(){return"Go to previous month"},W$=function(e,t){return Si(e,"cccc",t)},H$=function(e){return"Week n. ".concat(e)},q$=function(){return"Year: "},Y$=Object.freeze({__proto__:null,labelDay:U$,labelMonthDropdown:z$,labelNext:B$,labelPrevious:V$,labelWeekNumber:H$,labelWeekday:W$,labelYearDropdown:q$});function G$(){var e="buttons",t=D$,n=lk,r={},a={},i=1,o={},l=new Date;return{captionLayout:e,classNames:t,formatters:F$,labels:Y$,locale:n,modifiersClassNames:r,modifiers:a,numberOfMonths:i,styles:o,today:l,mode:"default"}}function K$(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,a=e.toMonth,i=e.fromDate,o=e.toDate;return r?i=Yn(r):t&&(i=new Date(t,0,1)),a?o=wv(a):n&&(o=new Date(n,11,31)),{fromDate:i?Io(i):void 0,toDate:o?Io(o):void 0}}var pk=h.createContext(void 0);function Z$(e){var t,n=e.initialProps,r=G$(),a=K$(n),i=a.fromDate,o=a.toDate,l=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;l!=="buttons"&&(!i||!o)&&(l="buttons");var c;(Ih(n)||Wc(n)||Hc(n))&&(c=n.onSelect);var d=Ke(Ke(Ke({},r),n),{captionLayout:l,classNames:Ke(Ke({},r.classNames),n.classNames),components:Ke({}
495,n.components),formatters:Ke(Ke({},r.formatters),n.formatters),fromDate:i,labels:Ke(Ke({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:Ke(Ke({},r.modifiers),n.modifiers),modifiersClassNames:Ke(Ke({},r.modifiersClassNames),n.modifiersClassNames),onSelect:c,styles:Ke(Ke({},r.styles),n.styles),toDate:o});return s.jsx(pk.Provider,{value:d,children:e.children})}function Mt(){var e=h.useContext(pk);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function gk(e){var t=Mt(),n=t.locale,r=t.classNames,a=t.styles,i=t.formatters.formatCaption;return s.jsx("div",{className:r.caption_label,style:a.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:i(e.displayMonth,{locale:n})})}function Q$(e){return s.jsx("svg",Ke({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:s.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 vk(e){var t,n,r=e.onChange,a=e.value,i=e.children,o=e.caption,l=e.className,c=e.style,d=Mt(),u=(n=(t=d.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:Q$;return s.jsxs("div",{className:l,style:c,children:[s.jsx("span",{className:d.classNames.vhidden,children:e["aria-label"]}),s.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:d.classNames.dropdown,style:d.styles.dropdown,value:a,onChange:r,children:i}),s.jsxs("div",{className:d.classNames.caption_label,style:d.styles.caption_label,"aria-hidden":"true",children:[o,s.jsx(u,{className:d.classNames.dropdown_icon,style:d.styles.dropdown_icon})]})]})}function J$(e){var t,n=Mt(),r=n.fromDate,a=n.toDate,i=n.styles,o=n.locale,l=n.formatters.formatMonthCaption,c=n.classNames,d=n.components,u=n.labels.labelMonthDropdown;if(!r)return s.jsx(s.Fragment,{});if(!a)return s.jsx(s.Fragment,{});var f=[];if(T$(r,a))for(var m=Yn(r),w=r.getMonth();w<=a.getMonth();w++)f.push(Ff(m,w));else for(var m=Yn(new Date),w=0;w<=11;w++)f.push(Ff(m,w));var x=function(b){var v=Number(b.target.value),g=Ff(Yn(e.displayMonth),v);e.onChange(g)},p=(t=d==null?void 0:d.Dropdown)!==null&&t!==void 0?t:vk;return s.jsx(p,{name:"months","aria-label":u(),className:c.dropdown_month,style:i.dropdown_month,onChange:x,value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:o}),children:f.map(function(b){return s.jsx("option",{value:b.getMonth(),children:l(b,{locale:o})},b.getMonth())})})}function X$(e){var t,n=e.displayMonth,r=Mt(),a=r.fromDate,i=r.toDate,o=r.locale,l=r.styles,c=r.classNames,d=r.components,u=r.formatters.formatYearCaption,f=r.labels.labelYearDropdown,m=[];if(!a)return s.jsx(s.Fragment,{});if(!i)return s.jsx(s.Fragment,{});for(var w=a.getFullYear(),x=i.getFullYear(),p=w;p<=x;p++)m.push(vw(ik(new Date),p));var b=function(g){var y=vw(Yn(n),Number(g.target.value));e.onChange(y)},v=(t=d==null?void 0:d.Dropdown)!==null&&t!==void 0?t:vk;return s.jsx(v,{name:"years","aria-label":f(),className:c.dropdown_year,style:l.dropdown_year,onChange:b,value:n.getFullYear(),caption:u(n,{locale:o}),children:m.map(function(g){return s.jsx("option",{value:g.getFullYear(),children:u(g,{locale:o})},g.getFullYear())})})}function eF(e,t){var n=h.useState(e),r=n[0],a=n[1],i=t===void 0?r:t;return[i,a]}function tF(e){var t=e.month,n=e.defaultMonth,r=e.today,a=t||n||r||new Date,i=e.toDate,o=e.fromDate,l=e.numberOfMonths,c=l===void 0?1:l;if(i&&wc(i,a)<0){var d=-1*(c-1);a=Vr(i,d)}return o&&wc(a,o)<0&&(a=o),Yn(a)}function nF(){var e=Mt(),t=tF(e),n=eF(t,e.month),r=n[0],a=n[1],i=function(o){var l;if(!e.disableNavigation){var c=Yn(o);a(c),(l=e.onMonthChange)===null||l===void 0||l.call(e,c)}};return[r,i]}function rF(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,a=Yn(e),i=Yn(Vr(a,r)),o=wc(i,a),l=[],c=0;c<o;c++){var d=Vr(a,c);l.push(d)}return n&&(l=l.reverse()),l}function sF(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,a=t.numberOfMonths,i=a===void 0?1:a,o=r?i:1,l=Yn(e);if(!n)return Vr(l,o);var c=wc(n,e);if(!(c<i))return Vr(l,o)}}function aF(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,a=t.numberOfMonths,i=a===void 0?1:a,o=r?i:1,l=Yn(e);if(!n)return Vr(l,-o);var c=wc(l,n);if(!(c<=0))return Vr(l,-o)}}var xk=h.createContext(void 0);function iF(e){var t=Mt(),n=nF(),r=n[0],a=n[1],i=rF(r,t),o=sF(r,t),l=aF(r,t),c=function(f){return i.some(function(m){return jv(f,m)})},d=function(f,m){c(f)||(m&&fk(f,m)?a(Vr(f,1+t.numberOfMonths*-1)):a(f))},u={currentMonth:r,displayMonths:i,goToMonth:a,goToDate:d,previousMonth:l,nextMonth:o,isDateDisplayed:c};return s.jsx(xk.Provider,{value:u,children:e.children})}function qc(){var e=h.useContext(xk);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function xw(e){var t,n=Mt(),r=n.classNames,a=n.styles,i=n.components,o=qc().goToMonth,l=function(u){o(Vr(u,e.displayIndex?-e.dis
495playIndex:0))},c=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:gk,d=s.jsx(c,{id:e.id,displayMonth:e.displayMonth});return s.jsxs("div",{className:r.caption_dropdowns,style:a.caption_dropdowns,children:[s.jsx("div",{className:r.vhidden,children:d}),s.jsx(J$,{onChange:l,displayMonth:e.displayMonth}),s.jsx(X$,{onChange:l,displayMonth:e.displayMonth})]})}function oF(e){return s.jsx("svg",Ke({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:s.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 lF(e){return s.jsx("svg",Ke({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:s.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 Fu=h.forwardRef(function(e,t){var n=Mt(),r=n.classNames,a=n.styles,i=[r.button_reset,r.button];e.className&&i.push(e.className);var o=i.join(" "),l=Ke(Ke({},a.button_reset),a.button);return e.style&&Object.assign(l,e.style),s.jsx("button",Ke({},e,{ref:t,type:"button",className:o,style:l}))});function cF(e){var t,n,r=Mt(),a=r.dir,i=r.locale,o=r.classNames,l=r.styles,c=r.labels,d=c.labelPrevious,u=c.labelNext,f=r.components;if(!e.nextMonth&&!e.previousMonth)return s.jsx(s.Fragment,{});var m=d(e.previousMonth,{locale:i}),w=[o.nav_button,o.nav_button_previous].join(" "),x=u(e.nextMonth,{locale:i}),p=[o.nav_button,o.nav_button_next].join(" "),b=(t=f==null?void 0:f.IconRight)!==null&&t!==void 0?t:lF,v=(n=f==null?void 0:f.IconLeft)!==null&&n!==void 0?n:oF;return s.jsxs("div",{className:o.nav,style:l.nav,children:[!e.hidePrevious&&s.jsx(Fu,{name:"previous-month","aria-label":m,className:w,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:a==="rtl"?s.jsx(b,{className:o.nav_icon,style:l.nav_icon}):s.jsx(v,{className:o.nav_icon,style:l.nav_icon})}),!e.hideNext&&s.jsx(Fu,{name:"next-month","aria-label":x,className:p,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:a==="rtl"?s.jsx(v,{className:o.nav_icon,style:l.nav_icon}):s.jsx(b,{className:o.nav_icon,style:l.nav_icon})})]})}function yw(e){var t=Mt().numberOfMonths,n=qc(),r=n.previousMonth,a=n.nextMonth,i=n.goToMonth,o=n.displayMonths,l=o.findIndex(function(x){return jv(e.displayMonth,x)}),c=l===0,d=l===o.length-1,u=t>1&&(c||!d),f=t>1&&(d||!c),m=function(){r&&i(r)},w=function(){a&&i(a)};return s.jsx(cF,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:f,nextMonth:a,previousMonth:r,onPreviousClick:m,onNextClick:w})}function dF(e){var t,n=Mt(),r=n.classNames,a=n.disableNavigation,i=n.styles,o=n.captionLayout,l=n.components,c=(t=l==null?void 0:l.CaptionLabel)!==null&&t!==void 0?t:gk,d;return a?d=s.jsx(c,{id:e.id,displayMonth:e.displayMonth}):o==="dropdown"?d=s.jsx(xw,{displayMonth:e.displayMonth,id:e.id}):o==="dropdown-buttons"?d=s.jsxs(s.Fragment,{children:[s.jsx(xw,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),s.jsx(yw,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):d=s.jsxs(s.Fragment,{children:[s.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),s.jsx(yw,{displayMonth:e.displayMonth,id:e.id})]}),s.jsx("div",{className:r.caption,style:i.caption,children:d})}function uF(e){var t=Mt(),n=t.footer,r=t.styles,a=t.classNames.tfoot;return n?s.jsx("tfoot",{className:a,style:r.tfoot,children:s.jsx("tr",{children:s.jsx("td",{colSpan:8,children:n})})}):s.jsx(s.Fragment,{})}function hF(e,t,n){for(var r=n?xi(new Date):fs(new Date,{locale:e,weekStartsOn:t}),a=[],i=0;i<7;i++){var o=Rn(r,i);a.push(o)}return a}function fF(){var e=Mt(),t=e.classNames,n=e.styles,r=e.showWeekNumber,a=e.locale,i=e.weekStartsOn,o=e.ISOWeek,l=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,d=hF(a,i,o);return s.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&s.jsx("td",{style:n.head_cell,className:t.head_cell}),d.map(function(u,f){return s.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":c(u,{locale:a}),children:l(u,{locale:a})},f)})]})}function mF(){var e,t=Mt(),n=t.classNames,r=t.styles,a=t.components,i=(e=a==null?void 0:a.HeadRow)!==null&&e!==void 0?e:fF;return s.jsx("thead",{style:r.head,className:n.head,children:s.jsx(i,{})})}function pF(e){var t=Mt(),n=t.locale,r=t.formatters.formatDay;return s.jsx(s.Fragment,{children:r(e.date,{locale:n})})}var _v=h.createContext(void 0);function gF(e){if(!Wc(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return s.jsx(_v.Provider,{value:t,children:e.children})}return s.jsx(vF,{initialProps:e.initialProps,children:e.children})}function vF(e){var t=e.initialProps,n=e.children,r=t.selected,a=t.min,i=t.max,o=function(d,u,f){var m,w;(m=t.onDayClick)===null||m===void 0||m.call(t,d,u,f);var x=!!(u.selected&&a&&(r==null?void 0:r.length)===a);if(!x){var p=!!(!u.selected&&i&&(r==null?void 0:r.length)===i);if(!p){var b=r?mk([],r):[];if(u.selected){var v=b.findIndex(function(g){return Vn(d,g)});b.splice(v,1)}else b.push(d);(w=t.onSelect)===null||w===void 0||w.call(t,b,d,u,f)}}},l={disabled:[]};r&&l.disabled.push(function(d){var u=i&&r.length>i-1,f=r.some(function(m){return Vn(m,d)});return!!(u&&!f)});var c={selected:r,onDayClick:o,modifiers:l};return s.jsx(_v.Provider,{value:c,children:n})}function Nv(){var e=h.useContext(_v);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function xF(e,t){var n=t||{},r=n.from,a=n.to;return r&&a?Vn(a,e)&&Vn(r,e)?void 0:Vn(a,e)?{from:a,to:void 0}:Vn(r,e)?void 0:Np(r,e)?{from:e,to:a}:{from:r,to:e}:a?Np(e,a)?{from:a,to:e}:{from:e,to:a}:r?fk(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var Sv=h.createContext(void 0);function yF(e){if(!Hc(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return s.jsx(Sv.Provider,{value:t,children:e.children})}return s.jsx(wF,{initialProps:e.initialProps,children:e.children})}function wF(e){var t=e.initialProps,n=e.children,r=t.selected,a=r||{},i=a.from,o=a.to,l=t.min,c=t.max,d=function(w,x,p){var b,v;(b=t.onDayClick)===null||b===void 0||b.call(t,w,x,p);var g=xF(w,r);(v=t.onSelect)===null||v===void 0||v.call(t,g,w,x,p)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(u.range_start=[i],o?(u.range_end=[o],Vn(i,o)||(u.range_middle=[{after:i,before:o}])):u.range_end=[i]):o&&(u.range_start=[o],u.range_end=[o]),l&&(i&&!o&&u.disabled.push({after:$f(i,l-1),before:Rn(i,l-1)}),i&&o&&u.disabled.push({after:i,before:Rn(i,l-1)}),!i&&o&&u.disabled.push({after:$f(o,l-1),before:Rn(o,l-1)})),c){if(i&&!o&&(u.disabled.push({before:Rn(i,-c+1)}),u.disabled.push({after:Rn(i,c-1)})),i&&o){var f=ss(o,i)+1,m=c-f;u.disabled.push({before:$f(i,m)}),u.disabled.push({after:Rn(o,m)})}!i&&o&&(u.disabled.push({before:Rn(o,-c+1)}),u.disabled.push({after:Rn(o,c-1)}))}return s.jsx(Sv.Provider,{value:{selected:r,onDayClick:d,modifiers:u},children:n})}function kv(){var e=h.useContext(Sv);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function Hd(e){return Array.isArray(e)?mk([],e):e!==void 0?[e]:[]}function bF(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],a=n[1];t[r]=Hd(a)}),t}var Wr;(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"})(Wr||(Wr={}));var jF=Wr.Selected,gs=Wr.Disabled,_F=Wr.Hidden,NF=Wr.Today,Uf=Wr.RangeEnd,zf=Wr.RangeMiddle,Bf=Wr.RangeStart,SF=Wr.Outside;
495function kF(e,t,n){var r,a=(r={},r[jF]=Hd(e.selected),r[gs]=Hd(e.disabled),r[_F]=Hd(e.hidden),r[NF]=[e.today],r[Uf]=[],r[zf]=[],r[Bf]=[],r[SF]=[],r);return e.fromDate&&a[gs].push({before:e.fromDate}),e.toDate&&a[gs].push({after:e.toDate}),Wc(e)?a[gs]=a[gs].concat(t.modifiers[gs]):Hc(e)&&(a[gs]=a[gs].concat(n.modifiers[gs]),a[Bf]=n.modifiers[Bf],a[zf]=n.modifiers[zf],a[Uf]=n.modifiers[Uf]),a}var yk=h.createContext(void 0);function CF(e){var t=Mt(),n=Nv(),r=kv(),a=kF(t,n,r),i=bF(t.modifiers),o=Ke(Ke({},a),i);return s.jsx(yk.Provider,{value:o,children:e.children})}function wk(){var e=h.useContext(yk);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function EF(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function PF(e){return!!(e&&typeof e=="object"&&"from"in e)}function TF(e){return!!(e&&typeof e=="object"&&"after"in e)}function RF(e){return!!(e&&typeof e=="object"&&"before"in e)}function DF(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function OF(e,t){var n,r=t.from,a=t.to;if(r&&a){var i=ss(a,r)<0;i&&(n=[a,r],r=n[0],a=n[1]);var o=ss(e,r)>=0&&ss(a,e)>=0;return o}return a?Vn(a,e):r?Vn(r,e):!1}function AF(e){return yv(e)}function MF(e){return Array.isArray(e)&&e.every(yv)}function IF(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(AF(n))return Vn(e,n);if(MF(n))return n.includes(e);if(PF(n))return OF(e,n);if(DF(n))return n.dayOfWeek.includes(e.getDay());if(EF(n)){var r=ss(n.before,e),a=ss(n.after,e),i=r>0,o=a<0,l=Np(n.before,n.after);return l?o&&i:i||o}return TF(n)?ss(e,n.after)>0:RF(n)?ss(n.before,e)>0:typeof n=="function"?n(e):!1})}function Cv(e,t,n){var r=Object.keys(t).reduce(function(i,o){var l=t[o];return IF(e,l)&&i.push(o),i},[]),a={};return r.forEach(function(i){return a[i]=!0}),n&&!jv(e,n)&&(a.outside=!0),a}function LF(e,t){for(var n=Yn(e[0]),r=wv(e[e.length-1]),a,i,o=n;o<=r;){var l=Cv(o,t),c=!l.disabled&&!l.hidden;if(!c){o=Rn(o,1);continue}if(l.selected)return o;l.today&&!i&&(i=o),a||(a=o),o=Rn(o,1)}return i||a}var $F=365;function bk(e,t){var n=t.moveBy,r=t.direction,a=t.context,i=t.modifiers,o=t.retry,l=o===void 0?{count:0,lastFocused:e}:o,c=a.weekStartsOn,d=a.fromDate,u=a.toDate,f=a.locale,m={day:Rn,week:_p,month:Vr,year:k3,startOfWeek:function(b){return a.ISOWeek?xi(b):fs(b,{locale:f,weekStartsOn:c})},endOfWeek:function(b){return a.ISOWeek?ok(b):bv(b,{locale:f,weekStartsOn:c})}},w=m[n](e,r==="after"?1:-1);r==="before"&&d?w=C3([d,w]):r==="after"&&u&&(w=E3([u,w]));var x=!0;if(i){var p=Cv(w,i);x=!p.disabled&&!p.hidden}return x?w:l.count>$F?l.lastFocused:bk(w,{moveBy:n,direction:r,context:a,modifiers:i,retry:Ke(Ke({},l),{count:l.count+1})})}var jk=h.createContext(void 0);function FF(e){var t=qc(),n=wk(),r=h.useState(),a=r[0],i=r[1],o=h.useState(),l=o[0],c=o[1],d=LF(t.displayMonths,n),u=a??(l&&t.isDateDisplayed(l))?l:d,f=function(){c(a),i(void 0)},m=function(b){i(b)},w=Mt(),x=function(b,v){if(a){var g=bk(a,{moveBy:b,direction:v,context:w,modifiers:n});Vn(a,g)||(t.goToDate(g,a),m(g))}},p={focusedDay:a,focusTarget:u,blur:f,focus:m,focusDayAfter:function(){return x("day","after")},focusDayBefore:function(){return x("day","before")},focusWeekAfter:function(){return x("week","after")},focusWeekBefore:function(){return x("week","before")},focusMonthBefore:function(){return x("month","before")},focusMonthAfter:function(){return x("month","after")},focusYearBefore:function(){return x("year","before")},focusYearAfter:function(){return x("year","after")},focusStartOfWeek:function(){return x("startOfWeek","before")},focusEndOfWeek:function(){return x("endOfWeek","after")}};return s.jsx(jk.Provider,{value:p,children:e.children})}function Ev(){var e=h.useContext(jk);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function UF(e,t){var n=wk(),r=Cv(e,n,t);return r}var Pv=h.createContext(void 0);function zF(e){if(!Ih(e.initialProps)){var t={selected:void 0};return s.jsx(Pv.Provider,{value:t,children:e.children})}return s.jsx(BF,{initialProps:e.initialProps,children:e.children})}function BF(e){var t=e.initialProps,n=e.children,r=function(i,o,l){var c,d,u;
495if((c=t.onDayClick)===null||c===void 0||c.call(t,i,o,l),o.selected&&!t.required){(d=t.onSelect)===null||d===void 0||d.call(t,void 0,i,o,l);return}(u=t.onSelect)===null||u===void 0||u.call(t,i,i,o,l)},a={selected:t.selected,onDayClick:r};return s.jsx(Pv.Provider,{value:a,children:n})}function _k(){var e=h.useContext(Pv);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function VF(e,t){var n=Mt(),r=_k(),a=Nv(),i=kv(),o=Ev(),l=o.focusDayAfter,c=o.focusDayBefore,d=o.focusWeekAfter,u=o.focusWeekBefore,f=o.blur,m=o.focus,w=o.focusMonthBefore,x=o.focusMonthAfter,p=o.focusYearBefore,b=o.focusYearAfter,v=o.focusStartOfWeek,g=o.focusEndOfWeek,y=function(T){var _,O,G,Y;Ih(n)?(_=r.onDayClick)===null||_===void 0||_.call(r,e,t,T):Wc(n)?(O=a.onDayClick)===null||O===void 0||O.call(a,e,t,T):Hc(n)?(G=i.onDayClick)===null||G===void 0||G.call(i,e,t,T):(Y=n.onDayClick)===null||Y===void 0||Y.call(n,e,t,T)},j=function(T){var _;m(e),(_=n.onDayFocus)===null||_===void 0||_.call(n,e,t,T)},N=function(T){var _;f(),(_=n.onDayBlur)===null||_===void 0||_.call(n,e,t,T)},k=function(T){var _;(_=n.onDayMouseEnter)===null||_===void 0||_.call(n,e,t,T)},C=function(T){var _;(_=n.onDayMouseLeave)===null||_===void 0||_.call(n,e,t,T)},E=function(T){var _;(_=n.onDayPointerEnter)===null||_===void 0||_.call(n,e,t,T)},H=function(T){var _;(_=n.onDayPointerLeave)===null||_===void 0||_.call(n,e,t,T)},A=function(T){var _;(_=n.onDayTouchCancel)===null||_===void 0||_.call(n,e,t,T)},F=function(T){var _;(_=n.onDayTouchEnd)===null||_===void 0||_.call(n,e,t,T)},U=function(T){var _;(_=n.onDayTouchMove)===null||_===void 0||_.call(n,e,t,T)},ae=function(T){var _;(_=n.onDayTouchStart)===null||_===void 0||_.call(n,e,t,T)},q=function(T){var _;(_=n.onDayKeyUp)===null||_===void 0||_.call(n,e,t,T)},se=function(T){var _;switch(T.key){case"ArrowLeft":T.preventDefault(),T.stopPropagation(),n.dir==="rtl"?l():c();break;case"ArrowRight":T.preventDefault(),T.stopPropagation(),n.dir==="rtl"?c():l();break;case"ArrowDown":T.preventDefault(),T.stopPropagation(),d();break;case"ArrowUp":T.preventDefault(),T.stopPropagation(),u();break;case"PageUp":T.preventDefault(),T.stopPropagation(),T.shiftKey?p():w();break;case"PageDown":T.preventDefault(),T.stopPropagation(),T.shiftKey?b():x();break;case"Home":T.preventDefault(),T.stopPropagation(),v();break;case"End":T.preventDefault(),T.stopPropagation(),g();break}(_=n.onDayKeyDown)===null||_===void 0||_.call(n,e,t,T)},D={onClick:y,onFocus:j,onBlur:N,onKeyDown:se,onKeyUp:q,onMouseEnter:k,onMouseLeave:C,onPointerEnter:E,onPointerLeave:H,onTouchCancel:A,onTouchEnd:F,onTouchMove:U,onTouchStart:ae};return D}function WF(){var e=Mt(),t=_k(),n=Nv(),r=kv(),a=Ih(e)?t.selected:Wc(e)?n.selected:Hc(e)?r.selected:void 0;return a}function HF(e){return Object.values(Wr).includes(e)}function qF(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var a=e.modifiersClassNames[r];if(a)n.push(a);else if(HF(r)){var i=e.classNames["day_".concat(r)];i&&n.push(i)}}),n}function YF(e,t){var n=Ke({},e.styles.day);return Object.keys(t).forEach(function(r){var a;n=Ke(Ke({},n),(a=e.modifiersStyles)===null||a===void 0?void 0:a[r])}),n}function GF(e,t,n){var r,a,i,o=Mt(),l=Ev(),c=UF(e,t),d=VF(e,c),u=WF(),f=!!(o.onDayCl
495ick||o.mode!=="default");h.useEffect(function(){var k;c.outside||l.focusedDay&&f&&Vn(l.focusedDay,e)&&((k=n.current)===null||k===void 0||k.focus())},[l.focusedDay,e,n,f,c.outside]);var m=qF(o,c).join(" "),w=YF(o,c),x=!!(c.outside&&!o.showOutsideDays||c.hidden),p=(i=(a=o.components)===null||a===void 0?void 0:a.DayContent)!==null&&i!==void 0?i:pF,b=s.jsx(p,{date:e,displayMonth:t,activeModifiers:c}),v={style:w,className:m,children:b,role:"gridcell"},g=l.focusTarget&&Vn(l.focusTarget,e)&&!c.outside,y=l.focusedDay&&Vn(l.focusedDay,e),j=Ke(Ke(Ke({},v),(r={disabled:c.disabled,role:"gridcell"},r["aria-selected"]=c.selected,r.tabIndex=y||g?0:-1,r)),d),N={isButton:f,isHidden:x,activeModifiers:c,selectedDays:u,buttonProps:j,divProps:v};return N}function KF(e){var t=h.useRef(null),n=GF(e.date,e.displayMonth,t);return n.isHidden?s.jsx("div",{role:"gridcell"}):n.isButton?s.jsx(Fu,Ke({name:"day",ref:t},n.buttonProps)):s.jsx("div",Ke({},n.divProps))}function ZF(e){var t=e.number,n=e.dates,r=Mt(),a=r.onWeekNumberClick,i=r.styles,o=r.classNames,l=r.locale,c=r.labels.labelWeekNumber,d=r.formatters.formatWeekNumber,u=d(Number(t),{locale:l});if(!a)return s.jsx("span",{className:o.weeknumber,style:i.weeknumber,children:u});var f=c(Number(t),{locale:l}),m=function(w){a(t,n,w)};return s.jsx(Fu,{name:"week-number","aria-label":f,className:o.weeknumber,style:i.weeknumber,onClick:m,children:u})}function QF(e){var t,n,r=Mt(),a=r.styles,i=r.classNames,o=r.showWeekNumber,l=r.components,c=(t=l==null?void 0:l.Day)!==null&&t!==void 0?t:KF,d=(n=l==null?void 0:l.WeekNumber)!==null&&n!==void 0?n:ZF,u;return o&&(u=s.jsx("td",{className:i.cell,style:a.cell,children:s.jsx(d,{number:e.weekNumber,dates:e.dates})})),s.jsxs("tr",{className:i.row,style:a.row,children:[u,e.dates.map(function(f){return s.jsx("td",{className:i.cell,style:a.cell,role:"presentation",children:s.jsx(c,{displayMonth:e.displayMonth,date:f})},C$(f))})]})}function ww(e,t,n){for(var r=n!=null&&n.ISOWeek?ok(t):bv(t,n),a=n!=null&&n.ISOWeek?xi(e):fs(e,n),i=ss(r,a),o=[],l=0;l<=i;l++)o.push(Rn(a,l));var c=o.reduce(function(d,u){var f=n!=null&&n.ISOWeek?ck(u):uk(u,n),m=d.find(function(w){return w.weekNumber===f});return m?(m.dates.push(u),d):(d.push({weekNumber:f,dates:[u]}),d)},[]);return c}function JF(e,t){var n=ww(Yn(e),wv(e),t);if(t!=null&&t.useFixedWeeks){var r=P$(e,t);if(r<6){var a=n[n.length-1],i=a.dates[a.dates.length-1],o=_p(i,6-r),l=ww(_p(i,1),o,t);n.push.apply(n,l)}}return n}function XF(e){var t,n,r,a=Mt(),i=a.locale,o=a.classNames,l=a.styles,c=a.hideHead,d=a.fixedWeeks,u=a.components,f=a.weekStartsOn,m=a.firstWeekContainsDate,w=a.ISOWeek,x=JF(e.displayMonth,{useFixedWeeks:!!d,ISOWeek:w,locale:i,weekStartsOn:f,firstWeekContainsDate:m}),p=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:mF,b=(n=u==null?void 0:u.Row)!==null&&n!==void 0?n:QF,v=(r=u==null?void 0:u.Footer)!==null&&r!==void 0?r:uF;return s.jsxs("table",{id:e.id,className:o.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&s.jsx(p,{}),s.jsx("tbody",{className:o.tbody,style:l.tbody,children:x.map(function(g){return s.jsx(b,{displayMonth:e.displayMonth,dates:g.dates,weekNumber:g.weekNumber},g.weekNumber)})}),s.jsx(v,{displayMonth:e.displayMonth})]})}function eU(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var tU=eU()?h.useLayoutEffect:h.useEffect,Vf=!1,nU=0;function bw(){return"react-day-picker-".concat(++nU)}function rU(e){var t,n=e??(Vf?bw():null),r=h.useState(n),a=r[0],i=r[1];return tU(function(){a===null&&i(bw())},[]),h.useEffect(function(){Vf===!1&&(Vf=!0)},[]),(t=e??a)!==null&&t!==void 0?t:void 0}function sU(e){var t,n,r=Mt(),a=r.dir,i=r.classNames,o=r.styles,l=r.components,c=qc().displayMonths,d=rU(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),u=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,f=[i.month],m=o.month,w=e.displayIndex===0,x=e.displayIndex===c.length-1,p=!w&&!x;a==="rtl"&&(t=[w,x],x=t[0],w=t[1]),w&&(f.push(i.caption_start),m=Ke(Ke({},m),o.caption_start)),x&&(f.push(i.caption_end),m=Ke(Ke({},m),o.caption_end)),p&&(f.push(i.caption_between),m=Ke(Ke({},m),o.caption_between));var b=(n=l==null?void 0:l.Caption)!==null&&n!==void 0?n:dF;return s.jsxs("div",{className:f.join(" "),style:m,children:[s.jsx(b,{id:d,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),s.jsx(XF,{id:u,"aria-labelledby":d,displayMonth:e.displayMonth})]},e.displayIndex)}function aU(e){var t=Mt(),n=t.classNames,r=t.styles;return s.jsx("div",{className:n.months,style:r.months,children:e.children})}function iU(e){var t,n,r=e.initialProps,a=Mt(),i=Ev(),o=qc(),l=h.useState(!1),c=l[0],d=l[1];h.useEffect(function(){a.initialFocus&&i.focusTarget&&(c||(i.focus(i.focusTarget),d(!0)))},[a.initialFocus,c,i.focus,i.focusTarget,i]);var u=[a.classNames.root,a.className];a.numberOfMonths>1&&u.push(a.classNames.multiple_months),a.showWeekNumber&&u.push(a.classNames.with_weeknumber);var f=Ke(Ke({},a.styles.root),a.style),m=Object.keys(r).filter(function(x){return x.startsWith("data-")}).reduce(function(x,p){var b;return Ke(Ke({},x),(b={},b[p]=r[p],b))},{}),w=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:aU;return s.jsx("div",Ke({className:u.join(" "),style:f,dir:a.dir,id:a.id,nonce:r.nonce,title:r.title,lang:r.lang},m,{children:s.jsx(w,{children:o.displayMonths.map(function(x,p){return s.jsx(sU,{displayIndex:p,displayMonth:x},p)})})}))}function oU(e){var t=e.children,n=R$(e,["children"]);return s.jsx(Z$,{initialProps:n,children:s.jsx(iF,{children:s.jsx(zF,{initialProps:n,children:s.jsx(gF,{initialProps:n,children:s.jsx(yF,{initialProps:n,children:s.jsx(CF,{children:s.jsx(FF,{children:t})})})})})})})}function lU(e){return s.jsx(oU,Ke({},e,{children:s.jsx(iU,{initialProps:e})}))}function Nk({className:e,classNames:t,showOutsideDays:n=!0,...r}){return s.jsx(lU,{showOutsideDays:n,className:ke("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:sp
495ace-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:ke(sc({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:ke(sc({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:({...a})=>s.jsx(Ej,{className:"h-4 w-4"}),IconRight:({...a})=>s.jsx(Pj,{className:"h-4 w-4"})},...r})}Nk.displayName="Calendar";var Tv="Popover",[Sk,K6]=Hr(Tv,[Ho]),Yc=Ho(),[cU,$a]=Sk(Tv),kk=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!1}=e,l=Yc(t),c=h.useRef(null),[d,u]=h.useState(!1),[f=!1,m]=cs({prop:r,defaultProp:a,onChange:i});return s.jsx(h_,{...l,children:s.jsx(cU,{scope:t,contentId:Cs(),triggerRef:c,open:f,onOpenChange:m,onOpenToggle:h.useCallback(()=>m(w=>!w),[m]),hasCustomAnchor:d,onCustomAnchorAdd:h.useCallback(()=>u(!0),[]),onCustomAnchorRemove:h.useCallback(()=>u(!1),[]),modal:o,children:n})})};kk.displayName=Tv;var Ck="PopoverAnchor",dU=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=$a(Ck,n),i=Yc(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=a;return h.useEffect(()=>(o(),()=>l()),[o,l]),s.jsx(uh,{...i,...r,ref:t})});dU.displayName=Ck;var Ek="PopoverTrigger",Pk=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=$a(Ek,n),i=Yc(n),o=wt(t,a.triggerRef),l=s.jsx(Ye.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Ak(a.open),...r,ref:o,onClick:Le(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:s.jsx(uh,{asChild:!0,...i,children:l})});Pk.displayName=Ek;var Rv="PopoverPortal",[uU,hU]=Sk(Rv,{forceMount:void 0}),Tk=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=$a(Rv,t);return s.jsx(uU,{scope:t,forceMount:n,children:s.jsx(qr,{present:n||i.open,children:s.jsx(Dc,{asChild:!0,container:a,children:r})})})};Tk.displayName=Rv;var Lo="PopoverContent",Rk=h.forwardRef((e,t)=>{const n=hU(Lo,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=$a(Lo,e.__scopePopover);return s.jsx(qr,{present:r||i.open,children:i.modal?s.jsx(fU,{...a,ref:t}):s.jsx(mU,{...a,ref:t})})});Rk.displayName=Lo;var fU=h.forwardRef((e,t)=>{const n=$a(Lo,e.__scopePopover),r=h.useRef(null),a=wt(t,r),i=h.useRef(!1);return h.useEffect(()=>{const o=r.current;if(o)return Yg(o)},[]),s.jsx(wh,{as:ja,allowPinchZoom:!0,children:s.jsx(Dk,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Le(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),i.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Le(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:Le(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),mU=h.forwardRef((e,t)=>{const n=$a(Lo,e.__scopePopover),r=h.useRef(!1),a=h.useRef(!1);return s.jsx(Dk,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),Dk=h.forwardRef((e,t)=>
495{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...f}=e,m=$a(Lo,n),w=Yc(n);return qg(),s.jsx(xh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(zo,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:s.jsx(Lg,{"data-state":Ak(m.open),role:"dialog",id:m.contentId,...w,...f,ref:t,style:{...f.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)"}})})})}),Ok="PopoverClose",pU=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=$a(Ok,n);return s.jsx(Ye.button,{type:"button",...r,ref:t,onClick:Le(e.onClick,()=>a.onOpenChange(!1))})});pU.displayName=Ok;var gU="PopoverArrow",vU=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Yc(n);return s.jsx($g,{...a,...r,ref:t})});vU.displayName=gU;function Ak(e){return e?"open":"closed"}var xU=kk,yU=Pk,wU=Tk,Mk=Rk;const bU=xU,jU=yU,Ik=h.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>s.jsx(wU,{children:s.jsx(Mk,{ref:a,align:t,sideOffset:n,className:ke("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})}));Ik.displayName=Mk.displayName;function _U(e,t){var n;if(!e.is_recurring||!e.recurrence_type)return null;if(e.recurrence_type==="weekly"&&((n=e.recurrence_days_of_week)!=null&&n.length))return NU(e.recurrence_days_of_week,t);if(e.recurrence_type==="monthly"){if(e.recurrence_day_of_month)return SU(e.recurrence_day_of_month,t);if(e.recurrence_pattern)return kU(e.recurrence_pattern,t)}return e.recurrence_type==="bimonthly"&&e.recurrence_pattern?CU(e.recurrence_pattern,e.event_date,t):e.recurrence_type==="bi_weekly"&&e.recurrence_pattern?EU(e.recurrence_pattern,t):null}function NU(e,t){const n=new Date(t);n.setHours(0,0,0,0);const r=n.getDay(),a=[...e].sort((i,o)=>i-o);for(let i=0;i<7;i++){const o=(r+i)%7;if(a.includes(o)){const l=new Date(n);return l.setDate(l.getDate()+i),l}}return null}function SU(e,t){const n=new Date(t.getFullYear(),t.getMonth(),e);return n<t&&n.setMonth(n.getMonth()+1),n}function kU(e,t){const n=e.toLowerCase().split("_");if(n.length!==2)return null;const r={first:1,second:2,third:3,fourth:4,last:-1},a={sunday:0,monday:1,tuesday:2,wednesday:3,thursday:4,friday:5,saturday:6},i=r[n[0]],o=a[n[1]];if(i===void 0||o===void 0)return null;for(let c=0;c<=1;c++){const d=t.getFullYear(),u=t.getMonth()+c,f=bc(i,o,d,u);if(f&&f>=t)return f}return bc(i,o,t.getFullYear(),t.getMonth()+2)}function CU(e,t,n){const r=e.toLowerCase().split("_");if(r.length!==2)return null;const a={first:1,second:2,third:3,fourth:4,last:-1},i={sunday:0,monday:1,tuesday:2,wednesday:3,thursday:4,friday:5,saturday:6},o=a[r[0]],l=i[r[1]];if(o===void 0||l===void 0)return null;const c=new Date(t+"T00:00:00"),d=c.getFullYear()*12+c.getMonth(),u=n.getFullYear()*12+n.getMonth();for(let f=u;f<=u+4;f++){if((f-d)%2!==0)continue;const m=Math.floor(f/12),w=f%12,x=bc(o,l,m,w);if(x&&x>=n)return x}return null}function EU(e,t){const n=e.toLowerCase().split("_");if(n.length!==3)return null;const a={sunday:0,monday:1,tuesday:2,wednesday:3,thursday:4,friday:5,saturday:6}[n[2]];if(a===void 0)return null;let i;if(n[0]==="first"&&n[1]==="third")i=[1,3];else if(n[0]==="second"&&n[1]==="fourth")i=[2,4];else return null;for(let o=0;o<=1;o++){const l=t.getFullYear(),c=t.getMonth()+o;for(const d of i){const u=bc(d,a,l,c);if(u&&u>=t)return u}}for(const o of i){const l=bc(o,a,t.getFullYear(),t.getMonth()+2);if(l)return l}return null}function bc(e,t,n,r){if(e===-1){const l=new Date(n,r+1,0);let c=new Date(l);for(;c.getDay()!==t;)c.setDate(c.getDate()-1);return c}const a=new Date(n,r,1);let i=new Date(a);for(;i.getDay()!==t;)i.setDate(i.getDate()+1);const o=new Date(i);return o.setDate(o.getDate()+(e-1)*7),o.getMonth()!==(r%12+12)%12?null:o}const PU=({description:e})=>{const[t,n]=h.useState(!1),r=e.length>150;return s.jsxs("div",{className:"text-sm text-muted-foreground",children:[s.jsx("p",{className:t?"":"line-clamp-3",children:e}),r&&s.jsx("button",{onClick:()=>
495n(!t),className:"text-red-500 hover:text-red-600 font-medium mt-1 transition-colors",children:t?"Read less":"Read more"})]})},TU=()=>{const[e,t]=h.useState([]),[n,r]=h.useState([]),[a,i]=h.useState("all"),[o,l]=h.useState(!0),[c,d]=h.useState(void 0),[u,f]=h.useState(!1),[m,w]=h.useState(!1),[x,p]=h.useState(null),[b,v]=h.useState(!1),[g,y]=h.useState(!1),[j,N]=h.useState(""),[k,C]=h.useState(""),[E,H]=h.useState(null),[A,F]=h.useState(null),[U,ae]=h.useState(null),[q,se]=h.useState(null),[D,T]=h.useState(!1),[_,O]=h.useState(null),[G,Y]=h.useState(""),[oe,M]=h.useState(!1),[I,he]=h.useState(new Set),{toast:X}=_t(),K=Et();h.useEffect(()=>{const{data:{subscription:re}}=R.auth.onAuthStateChange((ie,Ce)=>{F(Ce),H((Ce==null?void 0:Ce.user)??null),Ce!=null&&Ce.user?setTimeout(()=>{Z(Ce.user.id),P(Ce.user.id)},0):(ae(null),he(new Set))});return R.auth.getSession().then(({data:{session:ie}})=>{F(ie),H((ie==null?void 0:ie.user)??null),ie!=null&&ie.user&&(Z(ie.user.id),P(ie.user.id))}),le(),ee(),()=>re.unsubscribe()},[]);const P=async re=>{const{data:ie}=await R.from("comp_ticket_claims").select("event_id").eq("user_id",re);ie&&he(new Set(ie.map(Ce=>Ce.event_id)))},Z=async re=>{const{data:ie,error:Ce}=await R.from("profiles").select("name, phone_number, membership_plan_id").eq("id",re).single();ie&&!Ce&&ae(ie)},ee=async()=>{try{const re=new Date().toISOString().split("T")[0],[ie,Ce]=await Promise.all([R.from("public_events").select(`${Tu}, event_cities(name)`).eq("status","approved").eq("is_recurring",!1).gte("event_date",re).order("event_date",{ascending:!0}),R.from("public_events").select(`${Tu}, event_cities(name)`).eq("status","approved").eq("is_recurring",!0)]);if(ie.error){console.error("Error fetching events:",ie.error);return}if(Ce.error){console.error("Error fetching recurring events:",Ce.error);return}const V=new Date;V.setHours(0,0,0,0);const ge=(Ce.data||[]).map(Pe=>{const We=_U(Pe,V);return We?{...Pe,event_date:We.toISOString().split("T")[0]}:null}).filter(Boolean),Ne=[...ie.data||[],...ge];Ne.sort((Pe,We)=>Pe.event_date.localeCompare(We.event_date)),t(Ne)}catch(re){console.error("Error:",re)}finally{l(!1)}},le=async()=>{const{data:re,error:ie}=await R.from("event_cities").select("*").order("name");re&&!ie&&r(re)},z=e.filter(re=>{const ie=a==="all"||re.city_id===a,Ce=!c||re.event_date===c.toISOString().split("T")[0];return ie&&Ce}),_e=e.map(re=>new Date(re.event_date+"T00:00:00")),ue=re=>{p(re),N((U==null?void 0:U.name)||""),C((U==null?void 0:U.phone_number)||""),w(!0)},De=async()=>{if(!x)return;const re=j.trim(),ie=k.trim();if(re.length===0){X({title:"Name required",description:"Please enter your name",variant:"destructive"});return}if(ie.replace(/\D/g,"").length<10){X({title:"Valid phone required",description:"Please enter a valid phone number (at least 10 digits)",variant:"destructive"});return}v(!0);try{const{error:Ce}=await R.from("event_rsvps").insert({event_id:x.id,user_id:(E==null?void 0:E.id)??null,name:re,phone_number:ie});if(Ce)throw Ce;X({title:"RSVP Confirmed!",description:`You're registered for ${x.title}`}),y(!0)}catch(Ce){X({title:"Error",description:Ce.message||"Failed to submit RSVP",variant:"destructive"})}finally{v(!1)}},Ve=async()=>{if(!(!_||!E)){if(G.length!==4){X({title:"Invalid Code",description:"Please enter a valid 4-digit code",variant:"destructive"});return}M(!0);try{const{data:re,error:ie}=await R.rpc("claim_comp_ticket",{p_event_id:_.id,p_code:G});if(ie)throw ie;const Ce=re;Ce!=null&&Ce.success?(X({title:"ð Upgrade Claimed!",description:Ce.message}),T(!1),Y(""),he(V=>new Set(V).add(_.id)),O(null),ee()):X({title:"Unable to Claim",description:(Ce==null?void 0:Ce.message)||"Something went wrong",variant:"destructive"})}catch(re){X({title:"Error",description:re.message,variant:"destructive"})}finally{M(!1)}}},lt=re=>{var Je;if(!x)return"";const ie=x.event_date.replace(/-/g,""),Ce=x.event_time?x.event_time.replace(/:/g,"").substring(0,4)+"00":"000000",V=x.event_end_time?x.event_end_time.replace(/:/g,"").substring(0,4)+"00":"",ge=`${ie}T${Ce}`,Ne=V?`${ie}T${V}`:`${ie}
495T235959`,Pe=[x.venue,x.address].filter(Boolean).join(", "),We=((Je=x.description)==null?void 0:Je.substring(0,500))||"",xt=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",`DTSTART:${ge}`,`DTEND:${Ne}`,`SUMMARY:${x.title}`,`DESCRIPTION:${We.replace(/\n/g,"\\n")}`,`LOCATION:${Pe}`,"END:VEVENT","END:VCALENDAR"].join(`\r 496`);return URL.createObjectURL(new Blob([xt],{type:"text/calendar"}))},vt=re=>new Date(re+"T00:00:00").toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"}),Qe=re=>{if(!re)return null;const[ie,Ce]=re.split(":"),V=new Date;return V.setHours(parseInt(ie),parseInt(Ce)),V.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})};return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx("header",{className:"bg-primary text-primary-foreground py-6",children:s.jsx("div",{className:"container mx-auto px-4",children:s.jsx("div",{className:"flex items-center justify-between",children:s.jsxs(Es,{to:"/",className:"flex items-center gap-2 text-primary-foreground hover:opacity-80 transition-opacity",children:[s.jsx(Kn,{className:"w-5 h-5"}),"Back to Home"]})})})}),s.jsx("section",{className:"bg-gradient-to-b from-primary/10 to-background py-12",children:s.jsxs("div",{className:"container mx-auto px-4 text-center",children:[s.jsx("h1",{className:"text-4xl md:text-5xl font-bold mb-4",children:"Upcoming Events"}),s.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto mb-8",children:"View our curated list of events in select cities. RSVP for a chance to win tickets and/or other perks. Select your city below."}),s.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-3 max-w-md mx-auto",children:[s.jsxs(Vt,{value:a,onValueChange:i,children:[s.jsx(Ot,{className:"bg-background",children:s.jsx(Wt,{placeholder:"Select a city"})}),s.jsxs(At,{className:"bg-popover z-50",children:[s.jsx(gt,{value:"all",children:"All Cities"}),n.map(re=>s.jsx(gt,{value:re.id,children:re.name},re.id))]})]}),s.jsxs(bU,{open:u,onOpenChange:f,children:[s.jsx(jU,{asChild:!0,children:s.jsxs(L,{variant:"outline",className:"bg-background w-full sm:w-auto",children:[s.jsx(rr,{className:"w-4 h-4 mr-2"}),c?c.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"Pick a date"]})}),s.jsx(Ik,{className:"w-auto p-0",align:"center",children:s.jsx(Nk,{mode:"single",selected:c,onSelect:re=>{d(re),f(!1)},modifiers:{hasEvent:_e},modifiersClassNames:{hasEvent:"bg-primary/20 font-bold"},className:"p-3 pointer-events-auto"})})]}),c&&s.jsx(L,{variant:"ghost",size:"sm",onClick:()=>d(void 0),children:"Clear date"})]})]})}),s.jsx("section",{className:"py-12",children:s.jsx("div",{className:"max-w-[1600px] mx-auto px-3 sm:px-4 md:px-6 lg:px-8",children:o?s.jsxs("div",{className:"text-center py-12",children:[s.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto"}),s.jsx("p",{className:"mt-4 text-muted-foreground",children:"Loading events..."})]}):z.length===0?s.jsxs("div",{className:"text-center py-12",children:[s.jsx(rr,{className:"w-16 h-16 text-muted-foreground mx-auto mb-4"}),s.jsx("h2",{className:"text-2xl font-semibold mb-2",children:"No Upcoming Events"}),s.jsx("p",{className:"text-muted-foreground",children:a!=="all"?"No events found for this city. Try selecting a different city.":"Check back soon for new events!"})]}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4 md:gap-6",children:z.map(re=>{var ie;return s.jsxs(pe,{className:"overflow-hidden flex flex-col",children:[re.image_url?s.jsxs("div",{className:"w-full relative overflow-hidden",children:[re.check_in_enabled&&s.jsx("div",{className:"absolute top-0 left-0 right-0 bg-red-600 text-white text-xs font-bold text-center py-1.5 z-10",children:"MEMBERS CAN CHECK-IN TO THIS EVENT"}),s.jsx("img",{src:re.image_url,alt:re.title,className:"w-full h-auto object-contain"})]}):s.jsxs("div",{className:"aspect-video bg-gradient-to-br from-primary/20 to-primary/5 flex items-center justify-center relative",children:[re.check_in_enabled&&s.jsx("div",{className:"absolute top-0 left-0 right-0 bg-red-600 text-white text-xs font-bold text-center py-1.5 z-10",children:"MEMBERS CAN CHECK-IN TO THIS EVENT"}),s.jsx(rr,{className:"w-16 h-16 text-primary/40"})]}),s.jsxs(Ae,{className:"pb-2",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsx(Me,{className:"text-xl line-clamp-2",children:re.title}),((ie=re.event_cities)==null?void 0:ie.name)&&s.jsx(Ie,{variant:"secondary",className:"shrink-0",children:re.event_cities.name})]}),s.jsxs(St,{className:"flex flex-col gap-1 mt-2",children:[s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(rr,{className:"w-4 h-4"}),vt(re.event_date)]}),(re.event_time||re.event_end_time)&&s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(ah,{className:"w-4 h-4"}),re.event_time&&Qe(re.event_time),re.event_time&&re.event_end_time&&" - ",re.event_end_time&&Qe(re.event_end_time)]}),(re.venue||re.address)&&s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(dn,{className:"w-4 h-4"}
496),[re.venue,re.address].filter(Boolean).join(", ")]}),re.price&&s.jsxs("span",{className:"flex items-center gap-2 font-medium text-primary",children:[s.jsx("span",{className:"text-sm font-bold",children:"COST:"}),re.price]})]})]}),s.jsx(ve,{className:"flex-1",children:re.description&&s.jsx(PU,{description:re.description})}),(re.comp_tickets_total??0)>0&&s.jsx(ve,{className:"pt-0",children:s.jsxs("div",{className:"bg-primary/5 border border-primary/20 rounded-lg p-3",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx(Eo,{className:"w-4 h-4 text-primary"}),s.jsx("span",{className:"font-semibold text-primary text-sm",children:"Upgrade Your Experience (V.I.P Members Only)"})]}),s.jsxs("p",{className:"text-xs text-muted-foreground mb-2",children:[Math.max(0,(re.comp_tickets_total??0)-(re.comp_tickets_claimed??0))," of ",re.comp_tickets_total," upgrades available ⢠First come, first served"]}),s.jsx("p",{className:"text-xs text-muted-foreground mb-2 italic",children:"*Check-in with The Street Pass event staff to claim your upgrade."}),I.has(re.id)?s.jsx(Ie,{variant:"secondary",className:"w-full justify-center",children:"â You've already claimed an upgrade"}):(re.comp_tickets_total??0)-(re.comp_tickets_claimed??0)>0?s.jsxs(L,{size:"sm",variant:"outline",className:"w-full border-primary text-primary hover:bg-primary hover:text-primary-foreground",onClick:()=>{if(!E){X({title:"Login Required",description:"Please log in to claim an upgrade",variant:"destructive"}),K("/sign-in");return}if(!U||![3,4,5].includes(U.membership_plan_id??0)){X({title:"V.I.P. Members Only",description:"Complimentary upgrades are available exclusively for V.I.P. members",variant:"destructive"});return}O(re),T(!0)},children:[s.jsx(Eo,{className:"w-4 h-4 mr-2"})," UPGRADE"]}):s.jsx(Ie,{variant:"secondary",className:"w-full justify-center",children:"All upgrades have been claimed"})]})}),s.jsxs(Hg,{className:"flex flex-wrap gap-2 pt-4 border-t",children:[re.tickets_url&&s.jsx(L,{variant:"outline",size:"sm",className:"flex-1",asChild:!0,children:s.jsxs("a",{href:re.tickets_url,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(Lj,{className:"w-4 h-4 mr-2"}),"Get Tickets",s.jsx(Co,{className:"w-3 h-3 ml-1"})]})}),re.youtube_url&&s.jsxs(L,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>se(re),children:[s.jsx(Aj,{className:"w-4 h-4 mr-2"}),"View Media"]}),re.google_maps_url&&s.jsx(L,{variant:"outline",size:"sm",className:"flex-1",asChild:!0,children:s.jsxs("a",{href:re.google_maps_url,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(Dj,{className:"w-4 h-4 mr-2"}),"View on Map",s.jsx(Co,{className:"w-3 h-3 ml-1"})]})}),s.jsxs(L,{size:"sm",className:"flex-1",onClick:()=>ue(re),children:[s.jsx(hi,{className:"w-4 h-4 mr-2"}),"RSVP"]})]})]},re.id)})})})}),s.jsx(ht,{open:!!q,onOpenChange:re=>{re||se(null)},children:s.jsxs(dt,{className:"max-w-2xl",children:[s.jsx(ft,{children:s.jsx(mt,{children:"Media"})}),(q==null?void 0:q.youtube_url)&&s.jsx(sk,{youtube_url:q.youtube_url})]})}),s.jsx(ht,{open:m,onOpenChange:re=>{w(re),re||(y(!1),p(null),N(""),C(""))},children:s.jsxs(dt,{children:[s.jsx(ft,{children:s.jsx(mt,{children:g?"â
RSVP Confirmed!":`RSVP for ${x==null?void 0:x.title}`})}),g?s.jsxs("div",{className:"space-y-3",children:[s.jsxs("p",{className:"text-sm text-muted-foreground",children:["You're registered for ",s.jsx("span",{className:"font-medium",children:x==null?void 0:x.title}),". Add it to your calendar so you don't miss it!"]}),s.jsxs(L,{className:"w-full bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{const re=lt(),ie=document.createElement("a");ie.href=re,ie.download=`${(x==null?void 0:x.title)||"event"}.ics`,document.body.appendChild(ie),ie.click(),document.body.removeChild(ie)},children:[s.jsx(rr,{className:"w-4 h-4 mr-2"})," Add to Calendar"]}),s.jsx(L,{variant:"ghost",className:"w-full",onClick:()=>{w(!1),y(!1),p(null),N(""),C("")},children:"Done"})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-muted/50 p-3 rounded-lg text-sm",children:[s.jsx("p",{className:"font-medium",children:x==null?void 0:x.title}),s.jsx("p",{className:"text-muted-foreground",children:x&&vt(x.event_date)}),(x==null?void 0:x.venue)&&s.jsx("p",{className:"text-muted-foreground",children:x.venue})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"rsvp-name",children:"Name"}
496),s.jsx(Q,{id:"rsvp-name",value:j,onChange:re=>N(re.target.value),placeholder:"Your full name",maxLength:100})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"rsvp-phone",children:"Phone Number"}),s.jsx(Q,{id:"rsvp-phone",type:"tel",inputMode:"tel",value:k,onChange:re=>C(re.target.value),placeholder:"(555) 555-5555",maxLength:20})]}),s.jsx(L,{onClick:De,className:"w-full",disabled:b,children:b?"Submitting...":"Confirm RSVP"})]})]})}),s.jsx(ht,{open:D,onOpenChange:re=>{T(re),re||(Y(""),O(null))},children:s.jsxs(dt,{children:[s.jsx(ft,{children:s.jsx(mt,{children:"Claim Complimentary Upgrade (V.I.P Members Only)"})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-muted/50 p-3 rounded-lg text-sm",children:[s.jsx("p",{className:"font-medium",children:_==null?void 0:_.title}),s.jsx("p",{className:"text-muted-foreground",children:_&&vt(_.event_date)}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[Math.max(0,((_==null?void 0:_.comp_tickets_total)??0)-((_==null?void 0:_.comp_tickets_claimed)??0))," upgrades remaining ⢠First come, first served"]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 italic",children:"*Check-in with The Street Pass event staff to claim your upgrade."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"comp-code",children:"Event staff must enter code to claim upgrade"}),s.jsx(Q,{id:"comp-code",maxLength:4,value:G,onChange:re=>Y(re.target.value.replace(/[^0-9a-zA-Z]/g,"").substring(0,4)),placeholder:"Enter code",className:"text-center text-lg tracking-widest"})]}),s.jsx(L,{onClick:Ve,className:"w-full",disabled:oe||G.length!==4,children:oe?"Claiming...":"Claim Upgrade"})]})]})})]})},RU=()=>{var K;const{id:e}=vh(),t=Et(),{toast:n}=_t(),[r,a]=h.useState(null),[i,o]=h.useState(!0),[l,c]=h.useState(null),[d,u]=h.useState(null),[f,m]=h.useState(null),[w,x]=h.useState(!1),[p,b]=h.useState(!1),[v,g]=h.useState(!1),[y,j]=h.useState(""),[N,k]=h.useState(""),[C,E]=h.useState(!1),[H,A]=h.useState(!1),[F,U]=h.useState(""),[ae,q]=h.useState(!1),[se,D]=h.useState(!1),T=P=>{var vt;if(!r)return"";const Z=r.event_date.replace(/-/g,""),ee=r.event_time?r.event_time.replace(/:/g,"").substring(0,4)+"00":"000000",le=r.event_end_time?r.event_end_time.replace(/:/g,"").substring(0,4)+"00":"",z=`${Z}T${ee}`,_e=le?`${Z}T${le}`:`${Z}T235959`,ue=[r.venue,r.address].filter(Boolean).join(", "),De=((vt=r.description)==null?void 0:vt.substring(0,500))||"",Ve=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",`DTSTART:${z}`,`DTEND:${_e}`,`SUMMARY:${r.title}`,`DESCRIPTION:${De.replace(/\n/g,"\\n")}`,`LOCATION:${ue}`,"END:VEVENT","END:VCALENDAR"].join(`\r 497`),lt=new Blob([Ve],{type:"text/calendar"});return URL.createObjectURL(lt)};h.useEffect(()=>{const{data:{subscription:P}}=R.auth.onAuthStateChange((Z,ee)=>{u(ee),c((ee==null?void 0:ee.user)??null),ee!=null&&ee.user?setTimeout(()=>{O(ee.user.id),e&&_(ee.user.id,e)},0):(m(null),D(!1))});return R.auth.getSession().then(({data:{session:Z}})=>{u(Z),c((Z==null?void 0:Z.user)??null),Z!=null&&Z.user&&(O(Z.user.id),e&&_(Z.user.id,e))}),e&&G(e),()=>P.unsubscribe()},[e]);const _=async(P,Z)=>{const{data:ee}=await R.from("comp_ticket_claims").select("id").eq("user_id",P).eq("event_id",Z).maybeSingle();D(!!ee)},O=async P=>{const{data:Z}=await R.from("profiles").select("name, phone_number, membership_plan_id").eq("id",P).single();Z&&m(Z)},G=async P=>{var Z;try{const{data:ee,error:le}=await R.from("public_events").select(`${Tu}, event_cities(name)`).eq("id",P).eq("status","approved").single();if(le||!ee)a(null);else{a(ee),document.title=`${ee.title} | The Street Pass`;const z=(_e,ue)=>{let De=document.querySelector(`meta[property="${_e}"]`)||document.querySelector(`meta[name="${_e}"]`);De&&De.setAttribute("content",ue)};z("og:title",ee.title),z("og:description",((Z=ee.description)==null?void 0:Z.substring(0,160))||`${ee.title} - Event`),ee.image_url&&(z("og:image",ee.image_url),z("twitter:image",ee.image_url)),z("og:url",`${window.location.origin}/events/${P}`)}}catch{a(null)}finally{o(!1)}},Y=P=>new Date(P+"T00:00:00").toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"}),oe=P=>{if(!P)return null;const[Z,ee]=P.split(":"),le=new Date;return le.setHours(parseInt(Z),parseInt(ee)),le.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})},M=()=>{j((f==null?void 0:f.name)||""),k((f==null?void 0:f.phone_number)||""),x(!0)},I=async()=>
497{if(!r)return;const P=y.trim(),Z=N.trim();if(P.length===0){n({title:"Name required",description:"Please enter your name",variant:"destructive"});return}if(Z.replace(/\D/g,"").length<10){n({title:"Valid phone required",description:"Please enter a valid phone number (at least 10 digits)",variant:"destructive"});return}b(!0);try{const{error:ee}=await R.from("event_rsvps").insert({event_id:r.id,user_id:(l==null?void 0:l.id)??null,name:P,phone_number:Z});if(ee)throw ee;n({title:"RSVP Confirmed!",description:`You're registered for ${r.title}`}),g(!0)}catch(ee){n({title:"Error",description:ee.message||"Failed to submit RSVP",variant:"destructive"})}finally{b(!1)}},he=async()=>{if(!(!r||!l)){if(F.length!==4){n({title:"Invalid Code",description:"Please enter a valid 4-digit code",variant:"destructive"});return}q(!0);try{const{data:P,error:Z}=await R.rpc("claim_comp_ticket",{p_event_id:r.id,p_code:F});if(Z)throw Z;const ee=P;ee!=null&&ee.success?(n({title:"ð Upgrade Claimed!",description:ee.message}),A(!1),U(""),D(!0),e&&G(e)):n({title:"Unable to Claim",description:(ee==null?void 0:ee.message)||"Something went wrong",variant:"destructive"})}catch(P){n({title:"Error",description:P.message,variant:"destructive"})}finally{q(!1)}}};if(i)return s.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto"}),s.jsx("p",{className:"mt-4 text-muted-foreground",children:"Loading event..."})]})});if(!r)return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx("header",{className:"bg-primary text-primary-foreground py-6",children:s.jsx("div",{className:"container mx-auto px-4",children:s.jsxs(Es,{to:"/events",className:"flex items-center gap-2 text-primary-foreground hover:opacity-80 transition-opacity",children:[s.jsx(Kn,{className:"w-5 h-5"})," Back to Events"]})})}),s.jsxs("div",{className:"container mx-auto px-4 py-16 text-center",children:[s.jsx(rr,{className:"w-16 h-16 text-muted-foreground mx-auto mb-4"}),s.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Event Not Found"}),s.jsx("p",{className:"text-muted-foreground mb-6",children:"This event may have been removed or is no longer available."}),s.jsx(L,{asChild:!0,children:s.jsx(Es,{to:"/events",children:"View All Events"})})]})]});const X=r.description?r.description.substring(0,160):`${Y(r.event_date)}${r.venue?` at ${r.venue}`:""}`;return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsxs("title",{children:[r.title," | The Street Pass"]}),s.jsx("meta",{name:"description",content:X}),s.jsx("header",{className:"bg-primary text-primary-foreground py-6",children:s.jsx("div",{className:"container mx-auto px-4",children:s.jsxs(Es,{to:"/events",className:"flex items-center gap-2 text-primary-foreground hover:opacity-80 transition-opacity",children:[s.jsx(Kn,{className:"w-5 h-5"})," Back to Events"]})})}),s.jsx("div",{className:"container mx-auto px-4 py-8 max-w-3xl",children:s.jsxs(pe,{className:"overflow-hidden",children:[r.image_url&&s.jsxs("div",{className:"w-full relative overflow-hidden",children:[r.check_in_enabled&&s.jsx("div",{className:"absolute top-0 left-0 right-0 bg-destructive text-destructive-foreground text-xs font-bold text-center py-1.5 z-10",children:"MEMBERS CAN CHECK-IN TO THIS EVENT"}),s.jsx("img",{src:r.image_url,alt:r.title,className:"w-full object-cover"})]}),s.jsxs(Ae,{children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsx(Me,{className:"text-2xl md:text-3xl",children:r.title}),((K=r.event_cities)==null?void 0:K.name)&&s.jsx(Ie,{variant:"secondary",className:"shrink-0",children:r.event_cities.name})]}),s.jsxs(St,{className:"flex flex-col gap-2 mt-3 text-base",children:[s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(rr,{className:"w-5 h-5"})," ",Y(r.event_date)]}),(r.event_time||r.event_end_time)&&s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(ah,{className:"w-5 h-5"}),r.event_time&&oe(r.event_time),r.event_time&&r.event_end_time&&" - ",r.event_end_time&&oe(r.event_end_time)]}),(r.venue||r.address)&&s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(dn,{className:"w-5 h-5"}
497),[r.venue,r.address].filter(Boolean).join(", ")]}),r.price&&s.jsxs("span",{className:"flex items-center gap-2 font-medium text-primary",children:[s.jsx("span",{className:"text-sm font-bold",children:"COST:"})," ",r.price]})]})]}),r.description&&s.jsx(ve,{children:s.jsx("p",{className:"text-muted-foreground whitespace-pre-line",children:r.description})}),(r.comp_tickets_total??0)>0&&s.jsx(ve,{className:"pt-0",children:s.jsxs("div",{className:"bg-primary/5 border border-primary/20 rounded-lg p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(Eo,{className:"w-5 h-5 text-primary"}),s.jsx("h3",{className:"font-semibold text-primary",children:"Upgrade Your Experience (V.I.P Members Only)"})]}),s.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[Math.max(0,(r.comp_tickets_total??0)-(r.comp_tickets_claimed??0))," of ",r.comp_tickets_total," upgrades available"]}),s.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"Upgrades are available on a first come, first served basis."}),s.jsx("p",{className:"text-xs text-muted-foreground mb-3 italic",children:"*Check-in with The Street Pass event staff to claim your upgrade."}),se?s.jsx(Ie,{variant:"secondary",children:"â You've already claimed an upgrade"}):(r.comp_tickets_total??0)-(r.comp_tickets_claimed??0)>0?s.jsxs(L,{size:"sm",onClick:()=>{if(!l){n({title:"Login Required",description:"Please log in to claim an upgrade",variant:"destructive"}),t("/sign-in");return}if(!f||![3,4,5].includes(f.membership_plan_id??0)){n({title:"V.I.P. Members Only",description:"Complimentary upgrades are available exclusively for V.I.P. members",variant:"destructive"});return}A(!0)},children:[s.jsx(Eo,{className:"w-4 h-4 mr-2"})," UPGRADE"]}):s.jsx(Ie,{variant:"secondary",children:"All upgrades have been claimed"})]})}),s.jsxs(Hg,{className:"flex flex-wrap gap-2 pt-4 border-t",children:[r.tickets_url&&s.jsx(L,{variant:"outline",size:"sm",className:"flex-1",asChild:!0,children:s.jsxs("a",{href:r.tickets_url,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(Lj,{className:"w-4 h-4 mr-2"})," Get Tickets ",s.jsx(Co,{className:"w-3 h-3 ml-1"})]})}),r.youtube_url&&s.jsxs(L,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>E(!0),children:[s.jsx(Aj,{className:"w-4 h-4 mr-2"})," View Media"]}),r.google_maps_url&&s.jsx(L,{variant:"outline",size:"sm",className:"flex-1",asChild:!0,children:s.jsxs("a",{href:r.google_maps_url,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(Dj,{className:"w-4 h-4 mr-2"})," View on Map ",s.jsx(Co,{className:"w-3 h-3 ml-1"})]})}),s.jsxs(L,{size:"sm",className:"flex-1",onClick:M,children:[s.jsx(hi,{className:"w-4 h-4 mr-2"})," RSVP"]})]})]})}),s.jsx(ht,{open:C,onOpenChange:E,children:s.jsxs(dt,{className:"max-w-2xl",children:[s.jsx(ft,{children:s.jsx(mt,{children:"Media"})}),r.youtube_url&&s.jsx(sk,{youtube_url:r.youtube_url})]})}),s.jsx(ht,{open:w,onOpenChange:P=>{x(P),P||(g(!1),j(""),k(""))},children:s.jsxs(dt,{children:[s.jsx(ft,{children:s.jsx(mt,{children:v?"â
RSVP Confirmed!":`RSVP for ${r.title}`})}),v?s.jsxs("div",{className:"space-y-3",children:[s.jsxs("p",{className:"text-sm text-muted-foreground",children:["You're registered for ",s.jsx("span",{className:"font-medium",children:r.title}),". Add it to your calendar so you don't miss it!"]}),s.jsxs(L,{className:"w-full bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{const P=T(),Z=document.createElement("a");Z.href=P,Z.download=`${r.title||"event"}.ics`,document.body.appendChild(Z),Z.click(),document.body.removeChild(Z)},children:[s.jsx(rr,{className:"w-4 h-4 mr-2"})," Add to Calendar"]}),s.jsx(L,{variant:"ghost",className:"w-full",onClick:()=>{x(!1),g(!1),j(""),k("")},children:"Done"})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-muted/50 p-3 rounded-lg text-sm",children:[s.jsx("p",{className:"font-medium",children:r.title}),s.jsx("p",{className:"text-muted-foreground",children:Y(r.event_date)}),r.venue&&s.jsx("p",{className:"text-muted-foreground",children:r.venue})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"rsvp-name-detail",children:"Name"}
497),s.jsx(Q,{id:"rsvp-name-detail",value:y,onChange:P=>j(P.target.value),placeholder:"Your full name",maxLength:100})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"rsvp-phone-detail",children:"Phone Number"}),s.jsx(Q,{id:"rsvp-phone-detail",type:"tel",inputMode:"tel",value:N,onChange:P=>k(P.target.value),placeholder:"(555) 555-5555",maxLength:20})]}),s.jsx(L,{onClick:I,className:"w-full",disabled:p,children:p?"Submitting...":"Confirm RSVP"})]})]})}),s.jsx(ht,{open:H,onOpenChange:P=>{A(P),P||U("")},children:s.jsxs(dt,{children:[s.jsx(ft,{children:s.jsx(mt,{children:"Claim Complimentary Upgrade (V.I.P Members Only)"})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-muted/50 p-3 rounded-lg text-sm",children:[s.jsx("p",{className:"font-medium",children:r.title}),s.jsx("p",{className:"text-muted-foreground",children:Y(r.event_date)}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[Math.max(0,(r.comp_tickets_total??0)-(r.comp_tickets_claimed??0))," upgrades remaining â first come, first served."]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 italic",children:"*Check-in with The Street Pass event staff to claim your upgrade."})]}),s.jsxs("div",{children:[s.jsx(B,{children:"Event staff must enter code to claim upgrade"}),s.jsx(Q,{value:F,onChange:P=>U(P.target.value.replace(/[^0-9]/g,"").slice(0,4)),placeholder:"Enter code",maxLength:4,className:"text-center text-2xl tracking-widest font-mono"})]}),s.jsx(L,{onClick:he,className:"w-full",disabled:ae||F.length!==4,children:ae?"Claiming...":"Claim Upgrade"})]})]})})]})},DU=()=>{const[e,t]=h.useState(""),[n,r]=h.useState(""),[a,i]=h.useState(!1),[o,l]=h.useState(!1),[c,d]=h.useState(!1),[u,f]=h.useState(""),[m,w]=h.useState(!1),[x,p]=h.useState(!1),[b,v]=h.useState(!0),g=Et(),{toast:y}=_t();h.useEffect(()=>{(async()=>{const{data:{session:C}}=await R.auth.getSession(),E=new URLSearchParams(window.location.hash.substring(1));((new URLSearchParams(window.location.search).get("type")??E.get("type"))==="recovery"||C)&&p(!0),v(!1)})();const{data:{subscription:k}}=R.auth.onAuthStateChange((C,E)=>{C==="PASSWORD_RECOVERY"&&p(!0)});return()=>k.unsubscribe()},[]);const j=async N=>{if(N.preventDefault(),!e||!n){f("Please fill in all fields");return}if(e!==n){f("Passwords do not match");return}if(e.length<6){f("Password must be at least 6 characters long");return}d(!0),f("");try{const{error:k}=await R.auth.updateUser({password:e});if(k){f(k.message);return}await R.auth.signOut({scope:"local"}),w(!0),y({title:"Password updated!",description:"Please close this browser and sign in from the Street Pass app."})}catch(k){f(k.message||"An unexpected error occurred")}finally{d(!1)}};return b?s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:s.jsx("div",{className:"text-center",children:s.jsx("p",{className:"text-muted-foreground",children:"Verifying reset link..."})})}):x?m?s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:s.jsx(pe,{className:"w-full max-w-md",children:s.jsxs(Ae,{children:[s.jsx("div",{className:"flex justify-center mb-4",children:s.jsx(ci,{className:"h-16 w-16 text-green-500"})}),s.jsx(Me,{className:"text-2xl text-center text-primary",children:"Password Reset Successful!"}),s.jsxs(St,{className:"text-center space-y-2",children:[s.jsx("span",{className:"block",children:"Your password has been updated."}),s.jsx("span",{className:"block font-medium text-foreground",children:"Please close this browser, open the Street Pass app, and log into your member portal."})]})]})})}):s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:s.jsxs(pe,{className:"w-full max-w-md",children:[s.jsxs(Ae,{children:[s.jsx(Me,{className:"text-2xl text-center text-primary",children:"Reset Your Password"}),s.jsx(St,{className:"text-center",children:"Enter your new password below."})]}),s.jsx(ve,{children:s.jsxs("form",{onSubmit:j,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"new-password",children:"New Password"}),s.jsxs("div",{className:"relative",children:[s.jsx(Q,{id:"new-password",type:a?"text":"password",value:e,onCh
497ange:N=>t(N.target.value),placeholder:"Enter your new password (min 6 characters)",autoComplete:"new-password",required:!0,className:"pr-10"}),s.jsx("button",{type:"button",onClick:()=>i(!a),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:a?s.jsx(ui,{className:"h-4 w-4"}):s.jsx(Os,{className:"h-4 w-4"})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"confirm-new-password",children:"Confirm New Password"}),s.jsxs("div",{className:"relative",children:[s.jsx(Q,{id:"confirm-new-password",type:o?"text":"password",value:n,onChange:N=>r(N.target.value),placeholder:"Confirm your new password",autoComplete:"new-password",required:!0,className:"pr-10"}),s.jsx("button",{type:"button",onClick:()=>l(!o),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:o?s.jsx(ui,{className:"h-4 w-4"}):s.jsx(Os,{className:"h-4 w-4"})})]})]}),u&&s.jsx(zn,{variant:"destructive",children:s.jsx(Bn,{children:u})}),s.jsx(L,{type:"submit",className:"w-full",disabled:c,children:c?"Updating password...":"Reset Password"}),s.jsx(L,{type:"button",variant:"outline",className:"w-full",onClick:()=>g("/sign-in"),children:"Back to Login"})]})})]})}):s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:s.jsxs(pe,{className:"w-full max-w-md",children:[s.jsxs(Ae,{children:[s.jsx(Me,{className:"text-2xl text-center text-primary",children:"Invalid Reset Link"}),s.jsx(St,{className:"text-center",children:"This password reset link is invalid or has expired."})]}),s.jsxs(ve,{className:"space-y-4",children:[s.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"Please request a new password reset link from the login page."}),s.jsx(L,{onClick:()=>g("/sign-in"),className:"w-full",children:"Go to Login"})]})]})})},OU=()=>s.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:s.jsx(pe,{className:"w-full max-w-md mx-auto",children:s.jsxs(ve,{className:"p-8 text-center space-y-6",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx(Rj,{className:"h-16 w-16 text-primary"})}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Registration Successfully Submitted!"}),s.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Please check your email and tap the verification link to confirm your Street Pass membership. Once verified, you'll be ready to start earning Street Cash reward points."})]})]})})}),AU=()=>s.jsx("div",{className:"min-h-screen bg-background py-8 px-4",children:s.jsxs("div",{className:"max-w-3xl mx-auto",children:[s.jsx(Es,{to:"/",children:s.jsxs(L,{variant:"ghost",className:"mb-6",children:[s.jsx(Kn,{className:"mr-2 h-4 w-4"})," Back to Home"]})}),s.jsx("h1",{className:"text-3xl font-bold text-primary mb-8",children:"Privacy & Terms"}),s.jsxs("div",{className:"prose prose-sm max-w-none space-y-6 text-foreground",children:[s.jsxs("section",{children:[s.jsx("h2",{className:"text-xl font-semibold text-primary",children:"Terms of Use"}),s.jsx("p",{className:"text-muted-foreground text-justify",children:"Except as may be otherwise indicated in specific documents within the website, you are authorized to view, print and download documents found on our website for personal, informational, and noncommercial purposes only. You may not modify any of the content of this website including but not limited to copying, distributing, transmitting, displaying, performing, reproducing, publishing, licensing, creating derivative works from, transferring or selling any information or work contained on this website. Except as authorized under the copyright laws, you are responsible for obtaining permission before reusing any copyrighted material that is available on the website. For purposes of these terms, the use of any such material on any other website or networked computer environment is prohibited. You may not remove any copyright, trademark or other proprietary notices from material found on this website."}),s.jsx("p",{className:"text-muted-foreground text-justify mt-4",children:`All trademarks and trade names of StreetVision.com LLC used herein (including but not limited to: the StreetVision.com name, StreetVision.com LLC and SV corporate logos and The Street Pass are trademarks of StreetVision.com LLC. You may not use, copy, reproduce, republish, upload, post, transmit, distribute or modify these trademarks in any way, including in advertising or publicity pertaining to distribution of materials on this website, without StreetVision.com LLC's written consent. The use of StreetVision.com's trademarks on any other website or network computer environment is not allowed. You may not use the StreetVision.com trademarks as a "hot" link on to any non-home page or any other website without StreetVision.com's written consent.`})]}),s.jsxs("section",{children:[s.jsx("h2",{className:"text-xl font-semibold text-primary",children:"Privacy Policy"}),s.jsx("p",{className:"text-muted-foreground text-justify",children:"When you visit StreetVision.com and or The Street Pass app or correspond, via e-mail or otherwise, we will respect your privacy. Your information will not be given to any unrelated third party without your consent. Your name and address information will allow us to keep an updated file in case you need a Card replaced, information changed, etc. The information you provide us will be used to send you information on special offers, new discounts, chances to win prizes and updates about StreetVision.com's products and The Street Pass app. However, keep in mind that whenever you give out personal information online it can be collected and used by people you don't know. While StreetVision.com strives to protect its users personal information and privacy, we cannot guarantee the security of any information you disclose online so you do so at your own risk."}),s.jsx("p",{className:"text-muted-foreground text-justify mt-4",children:"The Street Pass policy does not extend to anything that is inherent in the operation of the internet, and therefore, beyond StreetVision.com's control, and is not to be applied in any manner contrary to applicable law or governmental regulation."}),s.jsx("p",{className:"text-muted-foreground text-justify mt-4",children:"Opt out of SMS: we collect mobile numbers for marketing only. You can opt out at any time by replying to any message with the word STOP."}),s.jsx("p",{className:"text-muted-foreground text-justify mt-4",children:"The Street Pass app contains links to other sites on the Internet that are owned and operated by third parties. In some instances these sites are co-branded and the third parties are entitled to use StreetVision.com's name and logo on these sites. StreetVision.com does not control the information, products, or services on these third party sites. The inclusion of any link does not imply endorsement by StreetVision.com/The Street Pass of the site or any association with their operators. Because StreetVision.com has no control over such sites and resources, you agree that StreetVision.com is not responsible or liable for the availability or the operation of such external sites, for any material located on or available from any such sites, or for the protection of your privacy data by third parties. Any dealings with or participation in promotions of advertisers on our site, including the payment and delivery of related goods or services, and any other terms, conditions, warranties, or representations associated with such dealings or promotions, are solely between you and the advertiser or other third party. You further agree that StreetVision.com/The Street Pass shall not be responsible or liable, directly or indirectly, for any loss or damage caused by the use of or reliance on any such material available on or through any such site or any such dealings or promotions."}),s.jsxs("p",{className:"text-muted-foreground text-justify mt-4",children:["We reserve the right at our discretion to make changes to this policy at any time. Please check this page periodically for changes. If you want to send feedback to us about a privacy issue or removing your data, e-mail us at"," ",s.jsx("a",{href:"mailto:[email protected]",className:"text-primary hover:underline",children:"[email protected]"}),"."]})]}),s.jsxs("section",{children:[s.jsx("h2",{className:"text-xl font-semibold text-primary",children:"Copyright"}),s.jsx("p",{className:"text-muted-foreground text-justify",children:"All text, images, animation, website design, graphics, text selections and arrangements are Copyright 2000-2024, StreetVision.com, LLC and The Street Pass and name and corporate logos and trademarks of StreetVision.com. All rights reserved."})]})]})]})}),MU="/assets/photos-placeholder-BpIcqYzV.jpg",IU=()=>{const[e,t]=h.useState([]),[n,r]=h.useState(""),[a,i]=h.useState([]),[o,l]=h.useState(!0),[c,d]=h.useState(null),[u,f]=h.useState(!1),[m,w]=h.useState(!1),{toast:x}=_t();Et();const p=h.useRef(null),b=h.useRef(null);h.useEffect(()=>
497{v()},[]),h.useEffect(()=>{n?(g(n),R.rpc("increment_gallery_view",{_gallery_id:n}).then(({error:F})=>{F&&console.error("increment_gallery_view failed",F)})):i([])},[n]);const v=async()=>{const{data:F}=await R.from("photo_galleries").select("*").order("event_date",{ascending:!1});F&&t(F),l(!1)},g=async F=>{const{data:U}=await R.from("gallery_photos").select("*").eq("gallery_id",F).order("created_at",{ascending:!0});U&&i(U)},y=()=>/iPad|iPhone|iPod/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,j=async(F,U)=>{var ae;f(!0);try{const q=await N(F),se=`event-photo-${U+1}.jpg`,D=new File([q],se,{type:"image/jpeg"});if((ae=navigator.canShare)!=null&&ae.call(navigator,{files:[D]})){await navigator.share({files:[D],title:"Street Pass event photo"});return}if(y()){const O=URL.createObjectURL(q);window.open(O,"_blank"),x({title:"Long-press to save",description:"Press and hold the photo, then choose Save Image or Share."}),setTimeout(()=>URL.revokeObjectURL(O),6e4);return}const T=URL.createObjectURL(q),_=document.createElement("a");_.href=T,_.download=se,_.style.display="none",document.body.appendChild(_),_.click(),setTimeout(()=>{document.body.removeChild(_),URL.revokeObjectURL(T)},1e3),x({title:"Download started",description:"The photo was saved to your device."})}catch(q){if((q==null?void 0:q.name)==="AbortError")return;console.error("Share failed:",q),window.open(F,"_blank"),x({title:"Long-press to save",description:"Press and hold the photo, then choose Save Image or Share."})}finally{f(!1)}},N=async F=>{const ae=await(await fetch(F)).blob(),q=URL.createObjectURL(ae),se=new Image;se.src=q,await new Promise((I,he)=>{se.onload=()=>I(),se.onerror=()=>he(new Error("Failed to load photo"))});const D=new Image;D.src="/images/streetpass-logo-watermark.png",await new Promise((I,he)=>{D.onload=()=>I(),D.onerror=()=>he(new Error("Failed to load logo"))});const T=document.createElement("canvas");T.width=se.naturalWidth,T.height=se.naturalHeight;const _=T.getContext("2d");_.drawImage(se,0,0);const O=Math.max(se.naturalWidth*.15,80),G=D.naturalHeight/D.naturalWidth*O,Y=se.naturalWidth*.02;_.drawImage(D,se.naturalWidth-O-Y,se.naturalHeight-G-Y,O,G);const oe=A==null?void 0:A.secondary_logo_url;if(oe)try{const he=await(await fetch(oe)).blob(),X=URL.createObjectURL(he),K=new Image;K.src=X,await new Promise((ee,le)=>{K.onload=()=>ee(),K.onerror=()=>le(new Error("Failed to load second logo"))});const P=G,Z=K.naturalWidth/K.naturalHeight*P;_.drawImage(K,Y,se.naturalHeight-P-Y,Z,P),URL.revokeObjectURL(X)}catch(I){console.error("Second logo watermark failed",I)}URL.revokeObjectURL(q);const M=await new Promise(I=>T.toBlob(he=>I(he),"image/jpeg",.92));if(!M)throw new Error("Canvas toBlob returned null");return M},k=async(F,U)=>{var ae;w(!0);try{const q=await N(F),se=`event-photo-${U+1}.jpg`;if(y()){const _=new File([q],se,{type:"image/jpeg"});if((ae=navigator.canShare)!=null&&ae.call(navigator,{files:[_]}))try{await navigator.share({files:[_],title:"Street Pass event photo"});return}catch(G){if((G==null?void 0:G.name)==="AbortError")return}const O=URL.createObjectURL(q);window.open(O,"_blank"),x({title:"Long-press to save",description:"Press and hold the photo, then choose Save Image."}),setTimeout(()=>URL.revokeObjectURL(O),6e4);return}const D=URL.createObjectURL(q),T=document.createElement("a");T.href=D,T.download=se,T.style.display="none",document.body.appendChild(T),T.click(),setTimeout(()=>{document.body.removeChild(T),URL.revokeObjectURL(D)},1e3),x({title:"Download started",description:"The photo is being saved to your device."})}catch(q){console.error("Download failed:",q),window.open(F,"_blank")}finally{w(!1)}},C=F=>{p.current=F.changedTouches[0].screenX},E=F=>{b.current=F.changedTouches[0].screenX,H()},H=()=>{if(p.current===null||b.current===null||c===null)return;const F=p.current-b.current,U=50;F>U&&c<a.length-1?d(c+1):F<-U&&c>0&&d(c-1),p.current=null,b.current=null},A=e.find(F=>F.id===n);return s.jsx("div",{className:"min-h-screen bg-background",children:s.jsxs("div",{className:"container mx-auto px-4 py-8 max-w-6xl",children:[s.jsxs("div",{className:"mb-8 text-center",children:[s.jsx("h1",{className:"text-3xl font-bold text-foreground mb-2",children:"Event Photos"}),s.jsx("p",{className:"text-muted-foreground",children:"View photos from past events. Choose an event from the drop-down menu below."})]}),s.jsx("div",{className:"max-w-md mx-auto mb-8",children:s.jsxs(Vt,{value:n,onValueChange:r,children:[s.jsx(Ot,{className:"bg-background",children:s.jsx(Wt,{placeholder:"Select an event gallery"})}),s.jsx(At,{className:"bg-background z-50",children:e.map(F=>s.jsxs(gt,{value:F.id,children:[F.title," â ",new Date(F.event_date+"T00:00:00").toLocaleDateString()]},F.id))})]})}),A&&s.jsxs("div",{className:"text-center mb-6",children:[s.jsxs("h2",{className:"text-xl font-semibold text-foreground",children:[A.title," â ",new Date(A.event_date+"T00:00:00").toLocaleDateString()]}),A.photographer_name&&s.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["Photography by"," ",A.photographer_url?s.jsx("a",{href:A.photographer_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline hover:text-primary/80",children:A.photographer_name}):s.jsx("span",{children:A.photographer_name})]})]}),a.length>0?s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3",children:a.map((F,U)=>s.jsx("div",{className:"rounded-lg overflow-hidden border border-border bg-card shadow-sm cursor-pointer",onClick:()=>d(U),children:s.jsxs("div",{className:"relative",children:[s.jsx("img",{src:F.photo_url,alt:`Event photo ${U+1}`,className:"w-full aspect-square object-cover",loading:"lazy"}),s.jsx("img",{src:"/images/streetpass-logo-watermark.png",alt:"",className:"absolute bottom-1 right-1 w-12 pointer-events-none"}),(A==null?void 0:A.secondary_logo_url)&&s.jsx("img",{src:A.secondary_logo_url,alt:"",className:"absolute bottom-1 left-1 h-6 object-contain pointer-events-none"})]})},F.id))}):n?s.jsx("p",{className:"text-center text-muted-foreground",children:"No photos in this gallery yet."}):o?null:s.jsx("div",{className:"max-w-2xl mx-auto",children:s.jsx("img",{src:MU,alt:"Event photos preview",className:"w-full rounded-lg"})}),s.jsx(ht,{open:c!==null,onOpenChange:F=>!F&&d(null),children:s.jsx(dt,{className:"max-w-3xl p-2 sm:p-4",children:c!==null&&a[c]&&s.jsxs("div",{className:"flex flex-col items-center gap-3 pt-4",children:[s.jsxs("div",{className:"relative w-full",onTouchStart:C,onTouchEnd:E,children:[c>0&&s.jsx("button",{className:"absolute left-1 top-1/2 -translate-y-1/2 z-10 bg-background/70 hover:bg-background/90 rounded-full p-1 transition-colors",onClick:()=>d(c-1),children:s.jsx(Ej,{className:"w-6 h-6 text-foreground"})}),c<a.length-1&&s.jsx("button",{className:"absolute right-1 top-1/2 -translate-y-1/2 z-10 bg-background/70 hover:bg-background/90 rounded-full p-1 transition-colors",onClick:()=>d(c+1),children:s.jsx(Pj,{className:"w-6 h-6 text-foreground"})}),s.jsx("img",{src:a[c].photo_url,alt:`Event photo ${c+1}`,className:"w-full rounded-md"}),s.jsx("img",{src:"/images/streetpass-logo-watermark.png",alt:"",className:"absolute bottom-2 right-2 w-24 pointer-events-none"}),(A==null?void 0:A.secondary_logo_url)&&s.jsx("img",{src:A.secondary_logo_url,alt:"",className:"absolute bottom-2 left-2 h-12 object-contain pointer-events-none"})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[c+1," / ",a.length]}),s.jsxs("div",{className:"flex gap-2 w-full",children:[s.jsxs(L,{variant:"outline",size:"sm",className:"flex-1",disabled:u,onClick:()=>j(a[c].photo_url,c),children:[u?s.jsx(Rr,{className:"w-4 h-4 mr-1 animate-spin"}):s.jsx(di,{className:"w-4 h-4 mr-1"}),u?"Preparing...":"Share"]}),s.jsxs(L,{variant:"outline",size:"sm",className:"flex-1",disabled:m,onClick:()=>k(a[c].photo_url,c),children:[m?s.jsx(Rr,{className:"w-4 h-4 mr-1 animate-spin"}):s.jsx(di,{className:"w-4 h-4 mr-1"}),m?"Downloading...":"Download"]})]})]})})})]})})},LU=()=>{const[e,t]=h.useState(!0),[n,r]=h.useState(!1),[a,i]=h.useState(null),[o,l]=h.useState(null),[c,d]=h.useState(""),[u,f]=h.useState(""),[m,w]=h.useState(""),[x,p]=h.useState(""),b=Et(),{toast:v}=_t();h.useEffect(()=>{(async()=>{const{data:{session:j}}=await R.auth.getSession();if(!(j!=null&&j.user)){b("/sign-in");return}i(j.user),f(j.user.email||"");const{data:N}=await R.from("profiles").select("*").eq("id",j.user.id).maybeSingle();N&&(l(N),d(N.name||""),w(N.phone_number||""),p(N.resident_city||"")),t(!1)})()},[b]);const g=async()=>
497{if(a){r(!0);try{const{error:y}=await R.from("profiles").update({resident_city:x||null,phone_number:m||null,name:c.trim()||null}).eq("id",a.id);if(y)throw y;if(u!==a.email){const{error:j}=await R.auth.updateUser({email:u.trim()});if(j)throw j;v({title:"Confirmation Required",description:"A confirmation email has been sent to your new email address. Please check your inbox."})}v({title:"Info Updated",description:"Your information has been updated successfully."}),b("/")}catch(y){console.error("Error updating info:",y),v({title:"Error",description:y.message||"Failed to update your information.",variant:"destructive"})}finally{r(!1)}}};return e?s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:s.jsx("p",{className:"text-xl text-muted-foreground",children:"Loading..."})}):s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx("header",{className:"border-b",children:s.jsxs("div",{className:"container mx-auto px-4 py-4 flex items-center gap-3",children:[s.jsx(L,{variant:"ghost",size:"icon",onClick:()=>b("/"),children:s.jsx(Kn,{className:"h-5 w-5"})}),s.jsx("h1",{className:"text-2xl font-bold text-[#ff0000]",children:"Update Info"})]})}),s.jsx("main",{className:"container mx-auto px-4 py-8 max-w-lg",children:s.jsxs(pe,{children:[s.jsx(Ae,{children:s.jsx(Me,{children:"Update Your Information"})}),s.jsxs(ve,{className:"space-y-5",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"name",children:"Name"}),s.jsx(Q,{id:"name",value:c,onChange:y=>d(y.target.value),placeholder:"Your name"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"email",children:"Email Address"}),s.jsx(Q,{id:"email",type:"email",value:u,onChange:y=>f(y.target.value),placeholder:"[email protected]"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Changing your email will require confirmation via the new email address."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"phone",children:"Phone Number"}),s.jsx(Q,{id:"phone",type:"tel",value:m,onChange:y=>w(y.target.value),placeholder:"(555) 123-4567"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"city",children:"Resident City"}),s.jsx(Q,{id:"city",value:x,onChange:y=>p(y.target.value),placeholder:"Enter your city"})]}),s.jsxs("div",{className:"flex gap-3 pt-2",children:[s.jsx(L,{variant:"outline",className:"flex-1",onClick:()=>b("/"),children:"Cancel"}),s.jsx(L,{className:"flex-1",onClick:g,disabled:n,children:n?"Saving...":"Save Changes"})]})]})]})})]})},$U=()=>{const[e,t]=h.useState(null),[n,r]=h.useState(null),[a,i]=h.useState(!1),[o,l]=h.useState(""),[c,d]=h.useState(""),[u,f]=h.useState(""),[m,w]=h.useState(""),[x,p]=h.useState(""),[b,v]=h.useState(""),[g,y]=h.useState(""),[j,N]=h.useState(""),[k,C]=h.useState(""),[E,H]=h.useState(""),[A,F]=h.useState(""),[U,ae]=h.useState(""),[q,se]=h.useState(""),[D,T]=h.useState(""),[_,O]=h.useState(""),[G,Y]=h.useState(!1),[oe,M]=h.useState(!1),I=Et();_t(),h.useEffect(()=>{R.auth.getSession().then(({data:{session:K}})=>{r(K),t((K==null?void 0:K.user)??null),K!=null&&K.user&&I("/")})},[I]);const he=()=>{Object.keys(localStorage).forEach(K=>{(K.startsWith("supabase.auth.")||K.includes("sb-"))&&localStorage.removeItem(K)}),Object.keys(sessionStorage||{}).forEach(K=>{(K.startsWith("supabase.auth.")||K.includes("sb-"))&&sessionStorage.removeItem(K)})},X=async K=>{if(K.preventDefault(),!o||!c||!u||!m){O("Please fill in all required fields");return}if(!k.trim()){O("Business address is required â you must have a physical location");return}if(c!==u){O("Passwords do not match");return}if(c.length<6){O("Password must be at least 6 characters long");return}i(!0),O("");try{he();const P=new URLSearchParams(window.location.search).get("next"),Z=`${window.location.origin}/auth/confirm${P?`?next=${encodeURIComponent(P)}`:""}`,{data:ee,error:le}=await R.auth.signUp({email:o,password:c,options:{emailRedirectTo:Z,data:{name:m,phone_number:b||null,resident_city:x||null,referral_code:g||null,is_business_owner:!0,business_name:j||null,business_address:k||null,business_phone:E||null,business_website:A||null,business_city:U||null,business_state:q||null,business_zip:D||null}}});if(le){le.message.includes("User already registered")?O("An account with this email already exists. Please sign in instead."):O(le.message);return}ee.user&&(await R.auth.signOut({scope:"local"}),I("/marketing"))}catch(P){O(P.message||"An unexpected error occurred")}finally{i(!1)}};return e?s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h1",{className:"text-2xl font-bold mb-4",children:"You are already signed in"}),s.jsx(L,{onClick:()=>I("/"),children:"Go to Dashboard"})]})}):s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:s.jsxs(pe,{className:"w-full max-w-md overflow-hidden",children:[s.jsx("img",{src:fv,alt:"The Street Pass",className:"w-full h-auto"}),s.jsxs(Ae,{children:[s.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[s.jsx(zm,{className:"h-6 w-6 text-primary"}),s.jsx(Me,{className:"text-2xl text-center text-primary",children:"Business Owner Sign Up"})]}
497),s.jsx(St,{className:"text-justify",children:"Join The Street Pass as a Business Owner Member! Get access to exclusive marketing packages, featured directory listings, and promotions to grow your business. As a member you will receive email communications from The Street Pass Mktg co., including newsletters and promotional messages. You may opt out at any time via the unsubscribe link in our emails."}),s.jsxs("p",{className:"text-xs text-muted-foreground text-justify mt-2",children:["See our ",s.jsx("a",{href:"/privacy",className:"text-primary font-medium hover:underline",children:"Privacy Policy"})," and Terms of Service for details on how we use and protect your information."]})]}),s.jsxs(ve,{children:[s.jsxs("form",{onSubmit:X,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"biz-name",children:"Your Name *"}),s.jsx(Q,{id:"biz-name",type:"text",value:m,onChange:K=>w(K.target.value),placeholder:"Enter your full name",autoComplete:"name",required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"biz-city",children:"Resident City"}),s.jsx(Q,{id:"biz-city",type:"text",value:x,onChange:K=>p(K.target.value),placeholder:"Enter your city",autoComplete:"address-level2"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"biz-email",children:"Email *"}),s.jsx(Q,{id:"biz-email",type:"email",value:o,onChange:K=>l(K.target.value),placeholder:"Enter your email",autoComplete:"email",required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"biz-mobile",children:"Mobile Number"}),s.jsx(Q,{id:"biz-mobile",type:"tel",value:b,onChange:K=>v(K.target.value),placeholder:"Enter your mobile number",autoComplete:"tel"}),s.jsx("p",{className:"text-xs text-muted-foreground text-justify",children:"By providing your mobile phone number, you consent to receive text messages from us about events and other promotions. Reply HELP for help, and STOP to opt-out. Msg&Data Rates May Apply. SMS SHARING DISCLOSURE: No mobile data will be shared with third parties/affiliates for marketing/promotional purposes at any time."})]}),s.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[s.jsx("p",{className:"text-sm font-medium",children:"Business Information"}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"biz-business-name",children:"Business Name *"}),s.jsx(Q,{id:"biz-business-name",type:"text",value:j,onChange:K=>N(K.target.value),placeholder:"Enter your business name",autoComplete:"organization",required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"biz-address",children:"Address *"}),s.jsx(Q,{id:"biz-address",type:"text",value:k,onChange:K=>C(K.target.value),placeholder:"Street address",autoComplete:"street-address",required:!0}),s.jsx("p",{className:"text-xs text-muted-foreground text-justify",children:"*You must have a physical location. This is a mandatory field."})]}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[s.jsxs("div",{className:"space-y-2 sm:col-span-1",children:[s.jsx(B,{htmlFor:"biz-business-city",children:"City"}),s.jsx(Q,{id:"biz-business-city",type:"text",value:U,onChange:K=>ae(K.target.value),placeholder:"City",autoComplete:"address-level2"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"biz-business-state",children:"State"}),s.jsx(Q,{id:"biz-business-state",type:"text",value:q,onChange:K=>se(K.target.value),placeholder:"State",autoComplete:"address-level1"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"biz-business-zip",children:"Zip Code"}),s.jsx(Q,{id:"biz-business-zip",type:"text",inputMode:"numeric",value:D,onChange:K=>T(K.target.value),placeholder:"Zip",autoComplete:"postal-code"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"biz-business-phone",children:"Business Phone Number"}),s.jsx(Q,{id:"biz-business-phone",type:"tel",value:E,onChange:K=>H(K.target.value),placeholder:"Business phone number",autoComplete:"tel"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"biz-website",children:"Website"}),s.jsx(Q,{id:"biz-website",type:"text",value:A,onChange:K=>F(K.target.value),placeholder:"https://yourbusiness.com",autoComplete:"url"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"biz-password",children:"Password *"}),s.jsxs("div",{className:"relative",children:[s.jsx(Q,{id:"biz-password",type:G?"text":"password",value:c,onChange:K=>d(K.target.value),placeholder:"Create a password (min 6 characters)",autoComplete:"new-password",required:!0,className:"pr-10"}),s.jsx("button",{type:"button",onClick:()=>Y(!G),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:G?s.jsx(ui,{className:"h-4 w-4"}):s.jsx(Os,{className:"h-4 w-4"})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"biz-confirm-password",children:"Confirm Password *"}),s.jsxs("div",{className:"relative",children:[s.jsx(Q,{id:"biz-confirm-password",type:oe?"text":"password",value:u,onChange:K=>f(K.target.value),placeholder:"Confirm your password",autoComplete:"new-password",required:!0,className:"pr-10"}),s.jsx("button",{type:"button",onClick:()=>M(!oe),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:oe?s.jsx(ui,{className:"h-4 w-4"}):s.jsx(Os,{className:"h-4 w-4"})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"biz-referral",children:"Referral Code (Optional)"}),s.jsx(Q,{id:"biz-referral",type:"text",value:g,onChange:K=>y(K.target.value),placeholder:"Enter referral code if you have one",autoComplete:"off"})]}),_&&s.jsx(zn,{variant:"destructive",children:s.jsx(Bn,{children:_})}),s.jsx(L,{type:"submit",className:"w-full",disabled:a,children:a?"Creating account...":"Sign Up as Business Owner"})]}),s.jsxs("p",{className:"mt-6 text-center text-sm text-muted-foreground",children:["Already have an account?"," ",s.jsx(Es,{to:"/sign-in",className:"text-primary font-medium hover:underline",children:"Sign In"})]}),s.jsxs("p",{className:"mt-2 text-center text-sm text-muted-foreground",children:["Not a business owner?"," ",s.jsx(Es,{to:"/sign-up",className:"text-primary font-medium hover:underline",children:"Regular Sign Up"})]})]})]})})};function FU(e){return Object.prototype.toString.call(e)==="[object Object]"}function jw(e){return FU(e)||Array.isArray(e)}function UU(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Dv(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const a=JSON.stringify(Object.keys(e.breakpoints||{})),i=JSON.stringify(Object.keys(t.breakpoints||{}));return a!==i?!1:n.every(o=>{const l=e[o],c=t[o];return typeof l=="function"?`${l}`==`${c}`:!jw(l)||!jw(c)?l===c:Dv(l,c)})}function _w(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function zU(e,t){if(e.length!==t.length)return!1;const n=_w(e),r=_w(t);return n.every((a,i)=>{const o=r[i];return Dv(a,o)})}function Ov(e){return typeof e=="number"}function Sp(e){return typeof e=="string"}function Lh(e){return typeof e=="boolean"}function Nw(e){return Object.prototype.toString.call(e)==="[object Object]"}function Zt(e){return Math.abs(e)}function Av(e){return Math.sign(e)}function Al(e,t){return Zt(e-t)}function BU(e,t){if(e===0||t===0||Zt(e)<=Zt(t))return 0;const n=Al(Zt(e),Zt(t));return Zt(n/e)}function jc(e){return _c(e).map(Number)}function $r(e){return e[Gc(e)]}function Gc(e){return Math.max(0,e.length-1)}function Mv(e,t){return t===Gc(e)}function Sw(e,t=0){return Array.from(Array(e),(n,r)=>t+r)}function _c(e){return Object.keys(e)}function Lk(e,t){return[e,t].reduce((n,r)=>(_c(r).forEach(a=>{const i=n[a],o=r[a],l=Nw(i)&&Nw(o);n[a]=l?Lk(i,o):o}),n),{})}function kp(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function VU(e,t){const n={start:r,center:a,end:i};function r(){return 0}function a(c){return i(c)/2}function i(c){return t-c}
vendor: 4,113 bytes, line 497
497function o(c,d){return Sp(e)?n[e](c):e(t,c,d)}return{measure:o}}function Nc(){let e=[];function t(a,i,o,l={passive:!0}){let c;if("addEventListener"in a)a.addEventListener(i,o,l),c=()=>a.removeEventListener(i,o,l);else{const d=a;d.addListener(o),c=()=>d.removeListener(o)}return e.push(c),r}function n(){e=e.filter(a=>a())}const r={add:t,clear:n};return r}function WU(e,t,n,r){const a=Nc(),i=1e3/60;let o=null,l=0,c=0;function d(){a.add(e,"visibilitychange",()=>{e.hidden&&x()})}function u(){w(),a.clear()}function f(b){if(!c)return;o||(o=b);const v=b-o;for(o=b,l+=v;l>=i;)n(i),l-=i;const g=l/i;r(g),c&&t.requestAnimationFrame(f)}function m(){c||(c=t.requestAnimationFrame(f))}function w(){t.cancelAnimationFrame(c),o=null,l=0,c=0}function x(){o=null,l=0}return{init:d,destroy:u,start:m,stop:w,update:()=>n(i),render:r}}function HU(e,t){const n=t==="rtl",r=e==="y",a=r?"y":"x",i=r?"x":"y",o=!r&&n?-1:1,l=u(),c=f();function d(x){const{height:p,width:b}=x;return r?p:b}function u(){return r?"top":n?"right":"left"}function f(){return r?"bottom":n?"left":"right"}function m(x){return x*o}return{scroll:a,cross:i,startEdge:l,endEdge:c,measureSize:d,direction:m}}function yi(e=0,t=0){const n=Zt(e-t);function r(d){return d<e}function a(d){return d>t}function i(d){return r(d)||a(d)}function o(d){return i(d)?r(d)?e:t:d}function l(d){return n?d-n*Math.ceil((d-t)/n):d}return{length:n,max:t,min:e,constrain:o,reachedAny:i,reachedMax:a,reachedMin:r,removeOffset:l}}function $k(e,t,n){const{constrain:r}=yi(0,e),a=e+1;let i=o(t);function o(m){return n?Zt((a+m)%a):r(m)}function l(){return i}function c(m){return i=o(m),f}function d(m){return u().set(l()+m)}function u(){return $k(e,l(),n)}const f={get:l,set:c,add:d,clone:u};return f}function qU(e,t,n,r,a,i,o,l,c,d,u,f,m,w,x,p,b,v,g){const{cross:y,direction:j}=e,N=["INPUT","SELECT","TEXTAREA"],k={passive:!1},C=Nc(),E=Nc(),H=yi(50,225).constrain(w.measure(20)),A={mouse:300,touch:400},F={mouse:500,touch:600},U=x?43:25;let ae=!1,q=0,se=0,D=!1,T=!1,_=!1,O=!1;function G(z){if(!g)return;function _e(De){(Lh(g)||g(z,De))&&X(De)}const ue=t;C.add(ue,"dragstart",De=>De.preventDefault(),k).add(ue,"touchmove",()=>{},k).add(ue,"touchend",()=>{}).add(ue,"touchstart",_e).add(ue,"mousedown",_e).add(ue,"touchcancel",P).add(ue,"contextmenu",P).add(ue,"click",Z,!0)}function Y(){C.clear(),E.clear()}function oe(){const z=O?n:t;E.add(z,"touchmove",K,k).add(z,"touchend",P).add(z,"mousemove",K,k).add(z,"mouseup",P)}function M(z){const _e=z.nodeName||"";return N.includes(_e)}function I(){return(x?F:A)[O?"mouse":"touch"]}function he(z,_e){const ue=f.add(Av(z)*-1),De=u.byDistance(z,!x).distance;return x||Zt(z)<H?De:b&&_e?De*.5:u.byIndex(ue.get(),0).distance}function X(z){const _e=kp(z,r);O=_e,_=x&&_e&&!z.buttons&&ae,ae=Al(a.get(),o.get())>=2,!(_e&&z.button!==0)&&(M(z.target)||(D=!0,i.pointerDown(z),d.useFriction(0).useDuration(0),a.set(o),oe(),q=i.readPoint(z),se=i.readPoint(z,y),m.emit("pointerDown")))}function K(z){if(!kp(z,r)&&z.touches.length>=2)return P(z);const ue=i.readPoint(z),De=i.readPoint(z,y),Ve=Al(ue,q),lt=Al(De,se);if(!T&&!O&&(!z.cancelable||(T=Ve>lt,!T)))return P(z);const vt=i.pointerMove(z);Ve>p&&(_=!0),d.useFriction(.3).useDuration(.75),l.start(),a.add(j(vt)),z.preventDefault()}function P(z){const ue=u.byDistance(0,!1).index!==f.get(),De=i.pointerUp(z)*I(),Ve=he(j(De),ue),lt=BU(De,Ve),vt=U-10*lt,Qe=v+lt/50;T=!1,D=!1,E.clear(),d.useDuration(vt).useFriction(Qe),c.distance(Ve,!x),O=!1,m.emit("pointerUp")}function Z(z){_&&(z.stopPropagation(),z.preventDefault(),_=!1)}function ee(){return D}return{init:G,destroy:Y,pointerDown:ee}}function YU(e,t){let r,a;function i(f){return f.timeStamp}function o(f,m){const x=`client${(m||e.scroll)==="x"?"X":"Y"}`;return(kp(f,t)?f:f.touches[0])[x]}function l(f){return r=f,a=f,o(f)}function c(f){const m=o(f)-o(a),w=i(f)-i(r)>170;return a=f,w&&(r=f),m}function d(f){if(!r||!a)return 0;const m=o(a)-o(r),w=i(f)-i(r),x=i(f)-i(a)>170,p=m/w;return w&&!x&&Zt(p)>.1?p:0}return{pointerDown:l,pointerMove:c,pointerUp:d,readPoint:o}}function GU(){function e(n){const{offsetTop:r,offsetLeft:a,offsetWidth:i,offsetHeight:o}=n;
vendor: 11,753 bytes, line 497
497return{top:r,right:a+i,bottom:r+o,left:a,width:i,height:o}}return{measure:e}}function KU(e){function t(r){return e*(r/100)}return{measure:t}}function ZU(e,t,n,r,a,i,o){const l=[e].concat(r);let c,d,u=[],f=!1;function m(b){return a.measureSize(o.measure(b))}function w(b){if(!i)return;d=m(e),u=r.map(m);function v(g){for(const y of g){if(f)return;const j=y.target===e,N=r.indexOf(y.target),k=j?d:u[N],C=m(j?e:r[N]);if(Zt(C-k)>=.5){b.reInit(),t.emit("resize");break}}}c=new ResizeObserver(g=>{(Lh(i)||i(b,g))&&v(g)}),n.requestAnimationFrame(()=>{l.forEach(g=>c.observe(g))})}function x(){f=!0,c&&c.disconnect()}return{init:w,destroy:x}}function QU(e,t,n,r,a,i){let o=0,l=0,c=a,d=i,u=e.get(),f=0;function m(k){const C=k/1e3,E=c*C,H=r.get()-e.get(),A=!c;let F=0;return A?(o=0,n.set(r),e.set(r),F=H):(n.set(e),o+=H/E,o*=d,u+=o,e.add(o*C),F=u-f),l=Av(F),f=u,N}function w(){const k=r.get()-t.get();return Zt(k)<.001}function x(){return c}function p(){return l}function b(){return o}function v(){return y(a)}function g(){return j(i)}function y(k){return c=k,N}function j(k){return d=k,N}const N={direction:p,duration:x,velocity:b,seek:m,settled:w,useBaseFriction:g,useBaseDuration:v,useFriction:j,useDuration:y};return N}function JU(e,t,n,r,a){const i=a.measure(10),o=a.measure(50),l=yi(.1,.99);let c=!1;function d(){return!(c||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function u(w){if(!d())return;const x=e.reachedMin(t.get())?"min":"max",p=Zt(e[x]-t.get()),b=n.get()-t.get(),v=l.constrain(p/o);n.subtract(b*v),!w&&Zt(b)<i&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function f(w){c=!w}return{shouldConstrain:d,constrain:u,toggleActive:f}}function XU(e,t,n,r,a){const i=yi(-t+e,0),o=f(),l=u(),c=m();function d(x,p){return Al(x,p)<1}function u(){const x=o[0],p=$r(o),b=o.lastIndexOf(x),v=o.indexOf(p)+1;return yi(b,v)}function f(){return n.map((x,p)=>{const{min:b,max:v}=i,g=i.constrain(x),y=!p,j=Mv(n,p);return y?v:j||d(b,g)?b:d(v,g)?v:g}).map(x=>parseFloat(x.toFixed(3)))}function m(){if(t<=e+a)return[i.max];if(r==="keepSnaps")return o;const{min:x,max:p}=l;return o.slice(x,p)}return{snapsContained:c,scrollContainLimit:l}}function e6(e,t,n){const r=t[0],a=n?r-e:$r(t);return{limit:yi(a,r)}}function t6(e,t,n,r){const i=t.min+.1,o=t.max+.1,{reachedMin:l,reachedMax:c}=yi(i,o);function d(m){return m===1?c(n.get()):m===-1?l(n.get()):!1}function u(m){if(!d(m))return;const w=e*(m*-1);r.forEach(x=>x.add(w))}return{loop:u}}function n6(e){const{max:t,length:n}=e;function r(i){const o=i-t;return n?o/-n:0}return{get:r}}function r6(e,t,n,r,a){const{startEdge:i,endEdge:o}=e,{groupSlides:l}=a,c=f().map(t.measure),d=m(),u=w();function f(){return l(r).map(p=>$r(p)[o]-p[0][i]).map(Zt)}function m(){return r.map(p=>n[i]-p[i]).map(p=>-Zt(p))}function w(){return l(d).map(p=>p[0]).map((p,b)=>p+c[b])}return{snaps:d,snapsAligned:u}}function s6(e,t,n,r,a,i){const{groupSlides:o}=a,{min:l,max:c}=r,d=u();function u(){const m=o(i),w=!e||t==="keepSnaps";return n.length===1?[i]:w?m:m.slice(l,c).map((x,p,b)=>{const v=!p,g=Mv(b,p);if(v){const y=$r(b[0])+1;return Sw(y)}if(g){const y=Gc(i)-$r(b)[0]+1;return Sw(y,$r(b)[0])}return x})}return{slideRegistry:d}}function a6(e,t,n,r,a){const{reachedAny:i,removeOffset:o,constrain:l}=r;function c(x){return x.concat().sort((p,b)=>Zt(p)-Zt(b))[0]}function d(x){const p=e?o(x):l(x),b=t.map((g,y)=>({diff:u(g-p,0),index:y})).sort((g,y)=>Zt(g.diff)-Zt(y.diff)),{index:v}=b[0];return{index:v,distance:p}}function u(x,p){const b=[x,x+n,x-n];if(!e)return x;if(!p)return c(b);const v=b.filter(g=>Av(g)===p);return v.length?c(v):$r(b)-n}function f(x,p){const b=t[x]-a.get(),v=u(b,p);return{index:x,distance:v}}function m(x,p){const b=a.get()+x,{index:v,distance:g}=d(b),y=!e&&i(b);if(!p||y)return{index:v,distance:x};const j=t[v]-g,N=x+u(j,0);return{index:v,distance:N}}return{byDistance:m,byIndex:f,shortcut:u}}function i6(e,t,n,r,a,i,o){function l(f){const m=f.distance,w=f.index!==t.get();i.add(m),m&&(r.duration()?e.start():(e.update(),e.render(1),e.update())),w&&(n.set(t.get()),t.set(f.index),o.emit("select"))}function c(f,m){const w=a.byDistance(f,m);l(w)}function d(f,m){const w=t.clone().set(f),x=a.byIndex(w.get(),m);l(x)}return{distance:c,index:d}}function o6(e,t,n,r,a,i,o,l){const c={passive:!0,capture:!0};let d=0;function u(w){if(!l)return;function x(p){if(new Date().getTime()-d>10)return;o.emit("slideFocusStart"),e.scrollLeft=0;const g=n.findIndex(y=>y.includes(p));Ov(g)&&(a.useDuration(0),r.index(g,0),o.emit("slideFocus"))}i.add(document,"keydown",f,!1),t.forEach((p,b)=>{i.add(p,"focus",v=>{(Lh(l)||l(w,v))&&x(b)},c)})}function f(w){w.code==="Tab"&&(d=new Date().getTime())}return{init:u}}function wl(e){let t=e;function n(){return t}function r(c){t=o(c)}function a(c){t+=o(c)}function i(c){t-=o(c)}function o(c){return Ov(c)?c:c.get()}return{get:n,set:r,add:a,subtract:i}}function Fk(e,t){const n=e.scroll==="x"?i:o,r=t.style;let a=!1;function i(f){return`translate3d(${f}px,0px,0px)`}function o(f){return`translate3d(0px,${f}px,0px)`}function l(f){a||(r.transform=n(e.direction(f)))}function c(f){a=!f}function d(){a||(r.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:d,to:l,toggleActive:c}}function l6(e,t,n,r,a,i,o,l,c){const u=jc(a),f=jc(a).reverse(),m=v().concat(g());function w(C,E){return C.reduce((H,A)=>H-a[A],E)}function x(C,E){return C.reduce((H,A)=>w(H,E)>0?H.concat([A]):H,[])}function p(C){return i.map((E,H)=>({start:E-r[H]+.5+C,end:E+t-.5+C}))}function b(C,E,H){const A=p(E);return C.map(F=>{const U=H?0:-n,ae=H?n:0,q=H?"end":"start",se=A[F][q];return{index:F,loopPoint:se,slideLocation:wl(-1),translate:Fk(e,c[F]),target:()=>l.get()>se?U:ae}})}function v(){const C=o[0],E=x(f,C);return b(E,n,!1)}function g(){const C=t-o[0]-1,E=x(u,C);return b(E,-n,!0)}function y(){return m.every(({index:C})=>{const E=u.filter(H=>H!==C);return w(E,t)<=.1})}function j(){m.forEach(C=>{const{target:E,translate:H,slideLocation:A}=C,F=E();F!==A.get()&&(H.to(F),A.set(F))})}function N(){m.forEach(C=>C.translate.clear())}return{canLoop:y,clear:N,loop:j,loopPoints:m}}function c6(e,t,n){let r,a=!1;function i(c){if(!n)return;function d(u){for(const f of u)if(f.type==="childList"){c.reInit(),t.emit("slidesChanged");break}}r=new MutationObserver(u=>{a||(Lh(n)||n(c,u))&&d(u)}),r.observe(e,{childList:!0})}function o(){r&&r.disconnect(),a=!0}return{init:i,destroy:o}}function d6(e,t,n,r){const a={};let i=null,o=null,l,c=!1;function d(){l=new IntersectionObserver(x=>{c||(x.forEach(p=>{const b=t.indexOf(p.target);a[b]=p}),i=null,o=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:r}),t.forEach(x=>l.observe(x))}function u(){l&&l.disconnect(),c=!0}function f(x){return _c(a).reduce((p,b)=>{const v=parseInt(b),{isIntersecting:g}=a[v];return(x&&g||!x&&!g)&&p.push(v),p},[])}function m(x=!0){if(x&&i)return i;if(!x&&o)return o;const p=f(x);return x&&(i=p),x||(o=p),p}return{init:d,destroy:u,get:m}}function u6(e,t,n,r,a,i){const{measureSize:o,startEdge:l,endEdge:c}=e,d=n[0]&&a,u=x(),f=p(),m=n.map(o),w=b();function x(){if(!d)return 0;const g=n[0];return Zt(t[l]-g[l])}function p(){if(!d)return 0;const g=i.getComputedStyle($r(r));return parseFloat(g.getPropertyValue(`margin-${c}`))}function b(){return n.map((g,y,j)=>{const N=!y,k=Mv(j,y);return N?m[y]+u:k?m[y]+f:j[y+1][l]-g[l]}).map(Zt)}return{slideSizes:m,slideSizesWithGaps:w,startGap:u,endGap:f}}function h6(e,t,n,r,a,i,o,l,c){const{startEdge:d,endEdge:u,direction:f}=e,m=Ov(n);function w(v,g){return jc(v).filter(y=>y%g===0).map(y=>v.slice(y,y+g))}function x(v){return v.length?jc(v).reduce((g,y,j)=>{const N=$r(g)||0,k=N===0,C=y===Gc(v),E=a[d]-i[N][d],H=a[d]-i[y][u],A=!r&&k?f(o):0,F=!r&&C?f(l):0,U=Zt(H-F-(E+A));return j&&U>t+c&&g.push(y),C&&g.push(v.length),g},[]).map((g,y,j)=>{const N=Math.max(j[y-1]||0);return v.slice(N,g)}):[]}function p(v){return m?w(v,n):x(v)}return{groupSlides:p}}function f6(e,t,n,r,a,i,o){const{align:l,axis:c,direction:d,startIndex:u,loop:f,duration:m,dragFree:w,dragThreshold:x,inViewThreshold:p,slidesToScroll:b,skipSnaps:v,containScroll:g,watchResize:y,watchSlides:j,watchDrag:N,watchFocus:k}=i,C=2,E=GU(),H=E.measure(t),A=n.map(E.measure),F=HU(c,d),U=F.measureSize(H),ae=KU(U),q=VU(l,U),se=!f&&!!g,D=f||!!g,{slideSizes:T,slideSizesWithGaps:_,startGap:O,endGap:G}=u6(F,H,A,n,D,a),Y=h6(F,U,b,f,H,A,O,G,C),{snaps:oe,snapsAligned:M}=r6(F,q,H,A,Y),I=-$r(oe)+$r(_),{snapsContained:he,scrollContainLimit:X}=XU(U,I,M,g,C),K=se?he:M,{limit:P}=e6(I,K,f),Z=$k(Gc(K),u,f),ee=Z.clone(),le=jc(n),z=({dragHandler:It,scrollBody:on,scrollBounds:tn,options:{loop:nn}},En)=>{nn||tn.constrain(It.pointerDown()),on.seek(En)},_e=({scrollBody:It,translate:on,location:tn,offsetLocation:nn,scrollLooper:En,slideLooper:$,dragHandler:ne,animation:$e,eventHandler:Se,scrollBounds:He,options:{loop:Xe}},je)=>{const st=It.settled(),Yt=!He.shouldConstrain(),et=Xe?st:st&&Yt;et&&!ne.pointerDown()&&($e.stop(),Se.emit("settle")),et||Se.emit("scroll");const at=tn.get()*je+vt.get()*(1-je);nn.set(at),Xe&&(En.loop(It.direction()),$.loop()),on.to(nn.get())},ue=WU(r,a,It=>z(Je,It),It=>_e(Je,It)),De=.68,Ve=K[Z.get()],lt=wl(Ve),vt=wl(Ve),Qe=wl(Ve),re=wl(Ve),ie=QU(lt,Qe,vt,re,m,De),Ce=a6(f,K,I,P,re),V=i6(ue,Z,ee,ie,Ce,re,o),ge=n6(P),Ne=Nc(),Pe=d6(t,n,o,p),{slideRegistry:We}=s6(se,g,K,X,Y,le),xt=o6(e,n,We,V,ie,Ne,o,k),Je={ownerDocument:r,ownerWindow:a,eventHandler:o,containerRect:H,slideRects:A,animation:ue,axis:F,dragHandler:qU(F,e,r,a,re,YU(F,a),lt,ue,V,ie,Ce,Z,o,ae,w,x,v,De,N),eventStore:Ne,percentOfView:ae,index:Z,indexPrevious:ee,limit:P,location:lt,offsetLocation:Qe,previousLocation:vt,options:i,resizeHandler:ZU(t,o,a,n,F,y,E),scrollBody:ie,scrollBounds:JU(P,Qe,re,ie,ae),scrollLooper:t6(I,P,Qe,[lt,Qe,vt,re]),scrollProgress:ge,scrollSnapList:K.map(ge.get),scrollSnaps:K,scrollTarget:Ce,scrollTo:V,slideLooper:l6(F,U,I,T,_,oe,K,Qe,n),slideFocus:xt,slidesHandler:c6(t,o,j),slidesInView:Pe,slideIndexes:le,slideRegistry:We,slidesToScroll:Y,target:re,translate:Fk(F,t)};return Je}function m6(){let e={},t;function n(d){t=d}function r(d){return e[d]||[]}function a(d){return r(d).forEach(u=>u(t,d)),c}function i(d,u){return e[d]=r(d).concat([u]),c}function o(d,u){return e[d]=r(d).filter(f=>f!==u),c}function l(){e={}}const c={init:n,emit:a,off:o,on:i,clear:l};return c}const p6={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function g6(e){function t(i,o){return Lk(i,o||{})}function n(i){const o=i.breakpoints||{},l=_c(o).filter(c=>e.matchMedia(c).matches).map(c=>o[c]).reduce((c,d)=>t(c,d),{});return t(i,l)}function r(i){return i.map(o=>_c(o.breakpoints||{})).reduce((o,l)=>o.concat(l),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function v6(e){let t=[];function n(i,o){return t=o.filter(({options:l})=>e.optionsAtMedia(l).active!==!1),t.forEach(l=>l.init(i,e)),o.reduce((l,c)=>Object.assign(l,{[c.name]:c}),{})}function r(){t=t.filter(i=>i.destroy())}return{init:n,destroy:r}}function Uu(e,t,n){const r=e.ownerDocument,a=r.defaultView,i=g6(a),o=v6(i),l=Nc(),c=m6(),{mergeOptions:d,optionsAtMedia:u,optionsMediaQueries:f}=i,{on:m,off:w,emit:x}=c,p=F;let b=!1,v,g=d(p6,Uu.globalOptions),y=d(g),j=[],N,k,C;function E(){const{container:le,slides:z}=y;k=(Sp(le)?e.querySelector(le):le)||e.children[0];const ue=Sp(z)?k.querySelectorAll(z):z;C=[].slice.call(ue||k.children)}function H(le){const z=f6(e,k,C,r,a,le,c);if(le.loop&&!z.slideLooper.canLoop()){const _e=Object.assign({},le,{loop:!1});return H(_e)}return z}function A(le,z){b||(g=d(g,le),y=u(g),j=z||j,E(),v=H(y),f([g,...j.map(({options:_e})=>
497_e)]).forEach(_e=>l.add(_e,"change",F)),y.active&&(v.translate.to(v.location.get()),v.animation.init(),v.slidesInView.init(),v.slideFocus.init(ee),v.eventHandler.init(ee),v.resizeHandler.init(ee),v.slidesHandler.init(ee),v.options.loop&&v.slideLooper.loop(),k.offsetParent&&C.length&&v.dragHandler.init(ee),N=o.init(ee,j)))}function F(le,z){const _e=Y();U(),A(d({startIndex:_e},le),z),c.emit("reInit")}function U(){v.dragHandler.destroy(),v.eventStore.clear(),v.translate.clear(),v.slideLooper.clear(),v.resizeHandler.destroy(),v.slidesHandler.destroy(),v.slidesInView.destroy(),v.animation.destroy(),o.destroy(),l.clear()}function ae(){b||(b=!0,l.clear(),U(),c.emit("destroy"),c.clear())}function q(le,z,_e){!y.active||b||(v.scrollBody.useBaseFriction().useDuration(z===!0?0:y.duration),v.scrollTo.index(le,_e||0))}function se(le){const z=v.index.add(1).get();q(z,le,-1)}function D(le){const z=v.index.add(-1).get();q(z,le,1)}function T(){return v.index.add(1).get()!==Y()}function _(){return v.index.add(-1).get()!==Y()}function O(){return v.scrollSnapList}function G(){return v.scrollProgress.get(v.location.get())}function Y(){return v.index.get()}function oe(){return v.indexPrevious.get()}function M(){return v.slidesInView.get()}function I(){return v.slidesInView.get(!1)}function he(){return N}function X(){return v}function K(){return e}function P(){return k}function Z(){return C}const ee={canScrollNext:T,canScrollPrev:_,containerNode:P,internalEngine:X,destroy:ae,off:w,on:m,emit:x,plugins:he,previousScrollSnap:oe,reInit:p,rootNode:K,scrollNext:se,scrollPrev:D,scrollProgress:G,scrollSnapList:O,scrollTo:q,selectedScrollSnap:Y,slideNodes:Z,slidesInView:M,slidesNotInView:I};return A(t,n),setTimeout(()=>c.emit("init"),0),ee}Uu.globalOptions=void 0;function Iv(e={},t=[]){const n=h.useRef(e),r=h.useRef(t),[a,i]=h.useState(),[o,l]=h.useState(),c=h.useCallback(()=>{a&&a.reInit(n.current,r.current)},[a]);return h.useEffect(()=>{Dv(n.current,e)||(n.current=e,c())},[e,c]),h.useEffect(()=>{zU(r.current,t)||(r.current=t,c())},[t,c]),h.useEffect(()=>{if(UU()&&o){Uu.globalOptions=Iv.globalOptions;const d=Uu(o,n.current,r.current);return i(d),()=>d.destroy()}else i(void 0)},[o,i]),[l,a]}Iv.globalOptions=void 0;const Uk=h.createContext(null);function $h(){const e=h.useContext(Uk);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}const zk=h.forwardRef(({orientation:e="horizontal",opts:t,setApi:n,plugins:r,className:a,children:i,...o},l)=>{const[c,d]=Iv({...t,axis:e==="horizontal"?"x":"y"},r),[u,f]=h.useState(!1),[m,w]=h.useState(!1),x=h.useCallback(g=>{g&&(f(g.canScrollPrev()),w(g.canScrollNext()))},[]),p=h.useCallback(()=>{d==null||d.scrollPrev()},[d]),b=h.useCallback(()=>{d==null||d.scrollNext()},[d]),v=h.useCallback(g=>{g.key==="ArrowLeft"?(g.preventDefault(),p()):g.key==="ArrowRight"&&(g.preventDefault(),b())},[p,b]);return h.useEffect(()=>{!d||!n||n(d)},[d,n]),h.useEffect(()=>{if(d)return x(d),d.on("reInit",x),d.on("select",x),()=>{d==null||d.off("select",x)}},[d,x]),s.jsx(Uk.Provider,{value:{carouselRef:c,api:d,opts:t,orientation:e||((t==null?void 0:t.axis)==="y"?"vertical":"horizontal"),scrollPrev:p,scrollNext:b,canScrollPrev:u,canScrollNext:m},children:s.jsx("div",{ref:l,onKeyDownCapture:v,className:ke("relative",a),role:"region","aria-roledescription":"carousel",...o,children:i})})});zk.displayName="Carousel";const Bk=h.forwardRef(({className:e,...t},n)=>{const{carouselRef:r,orientation:a}=$h();return s.jsx("div",{ref:r,className:"overflow-hidden",children:s.jsx("div",{ref:n,className:ke("flex",a==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})});Bk.displayName="CarouselContent";const Vk=h.forwardRef(({className:e,...t},n)=>{const{orientation:r}=$h();return s.jsx("div",{ref:n,role:"group","aria-roledescription":"slide",className:ke("min-w-0 shrink-0 grow-0 basis-full",r==="horizontal"?"pl-4":"pt-4",e),...t})});Vk.displayName="CarouselItem";const Wk=h.forwardRef(({className:e,variant:t="outline",size:n="icon",...r},a)=>{const{orientation:i,scrollPrev:o,canScrollPrev:l}=$h();return s.jsxs(L,{ref:a,variant:t,size:n,className:ke("absolute h-8 w-8 rounded-full",i==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:o,...r,children:[s.jsx(Kn,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Previous slide"})]})});
497Wk.displayName="CarouselPrevious";const Hk=h.forwardRef(({className:e,variant:t="outline",size:n="icon",...r},a)=>{const{orientation:i,scrollNext:o,canScrollNext:l}=$h();return s.jsxs(L,{ref:a,variant:t,size:n,className:ke("absolute h-8 w-8 rounded-full",i==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:o,...r,children:[s.jsx(y2,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Next slide"})]})});Hk.displayName="CarouselNext";const x6="/assets/portrait-sample-1-DqriNUT_.jpg",y6="/assets/portrait-sample-2-C7bO5SJP.jpg",w6="/assets/portrait-sample-3-hUHvdTy2.jpg",b6=()=>{const[e,t]=h.useState(null),[n,r]=h.useState(null),[a,i]=h.useState(null),[o,l]=h.useState(!0),[c,d]=h.useState(!1),u=Et(),{toast:f}=_t();h.useEffect(()=>{const{data:{subscription:b}}=R.auth.onAuthStateChange((v,g)=>{r(g),t((g==null?void 0:g.user)??null),g!=null&&g.user?setTimeout(()=>m(g.user.id),0):l(!1)});return R.auth.getSession().then(({data:{session:v}})=>{r(v),t((v==null?void 0:v.user)??null),v!=null&&v.user?setTimeout(()=>m(v.user.id),0):l(!1)}),()=>b.unsubscribe()},[]);const m=async b=>{try{const{data:v,error:g}=await R.from("profiles").select("*").eq("id",b).single();if(g)throw g;i(v)}catch(v){console.error("Error fetching profile:",v)}finally{l(!1)}},[w,x]=h.useState(null),p=async(b,v)=>{if(!e){u("/biz-sign-up?next=/marketing");return}d(!0),x(b);try{const{data:g,error:y}=await R.functions.invoke("create-marketing-order",{body:{packageId:b,price:v}});if(y)throw y;if(g!=null&&g.approvalUrl)window.location.href=g.approvalUrl;else throw new Error("No approval URL received")}catch(g){f({title:"Error",description:g.message||"Failed to create order. Please try again.",variant:"destructive"})}finally{d(!1),x(null)}};return o?s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:s.jsx(Rr,{className:"h-8 w-8 animate-spin text-primary"})}):s.jsx("div",{className:"min-h-screen bg-background p-4 md:p-8",children:s.jsxs("div",{className:"max-w-4xl mx-auto",children:[s.jsxs(L,{variant:"ghost",onClick:()=>u("/"),className:"mb-6",children:[s.jsx(Kn,{className:"w-4 h-4 mr-2"}),"Back to Dashboard"]}),s.jsxs("div",{className:"text-center mb-8",children:[s.jsx("h1",{className:"text-3xl md:text-4xl font-bold text-primary mb-2",children:"Marketing Packages"}),s.jsx("p",{className:"text-muted-foreground text-lg",children:"Grow your business with The Street Pass"})]}),s.jsxs(pe,{className:"overflow-hidden border-2 border-primary/20",children:[s.jsxs("div",{className:"bg-gradient-to-r from-primary/10 to-primary/5 p-6 md:p-8",children:[s.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-foreground",children:"The Check-in Sponsorship Package"}),s.jsx("p",{className:"text-muted-foreground mt-2 text-lg",children:"Become an official check-in location and drive foot traffic to your business"})]}),s.jsxs(ve,{className:"p-6 md:p-8",children:[s.jsxs("div",{className:"flex items-baseline gap-1 mb-6",children:[s.jsx("span",{className:"text-4xl font-bold text-primary",children:"$149.99"}),s.jsx("span",{className:"text-muted-foreground text-lg",children:"/ year"})]}),s.jsxs("div",{className:"space-y-4 mb-8",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(dn,{className:"h-5 w-5 text-primary mt-0.5 shrink-0"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Listed as a Check-In Location for One Year"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Your business featured as an official check-in destination in The Street Pass app for 12 months"})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(C2,{className:"h-5 w-5 text-primary mt-0.5 shrink-0"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Custom Check-In Code Poster"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Receive a branded check-in code poster to display at your location"})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(Oj,{className:"h-5 w-5 text-primary mt-0.5 shrink-0"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Featured Social Media Post"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Your business highlighted on The Street Pass social media channels"})]})]})]}),s.jsxs("div",{className:"rounded-lg border border-primary/30 bg-primary/5 p-4 mb-8",children:[s.jsx("p",{className:"font-semibold text-primary",children:"*Bonus"}),s.jsx("p",{className:"text-sm text-muted-foreground text-justify",children:"Qualifying businesses that achieve 100 check-ins at their location within a month will receive a live on-location DJ set with Andre Terrell."})]}),!(a!=null&&a.is_business_owner)&&s.jsx(zn,{className:"mb-6",children:s.jsxs(Bn,{children:["This package is available to business owner members. If you're a business owner, please contact us to update your account or"," ",s.jsx("a",{href:"/biz-sign-up",className:"text-primary font-medium hover:underline",children:"sign up as a business owner"}),"."]})}),s.jsx(L,{onClick:()=>p("check-in-activation",149.99),disabled:c||!(a!=null&&a.is_business_owner),className:"w-full text-lg py-6",size:"lg",children:w==="check-in-activation"?s.jsxs(s.Fragment,{children:[s.jsx(Rr,{className:"w-5 h-5 mr-2 animate-spin"}),"Processing..."]}):s.jsxs(s.Fragment,{children:[s.jsx(gd,{className:"w-5 h-5 mr-2"}),"Purchase for $149.99"]})}),s.jsx("p",{className:"text-xs text-muted-foreground text-center mt-4",children:"Secure payment processed via PayPal. You will be redirected to PayPal to complete your purchase."})]})]}),s.jsxs(pe,{className:"overflow-hidden border-2 border-primary/20 mt-8",children:[s.jsxs("div",{className:"bg-gradient-to-r from-primary/10 to-primary/5 p-6 md:p-8",children:[s.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-foreground",children:"ID Marketing Package"}),s.jsx("p",{className:"text-muted-foreground mt-2 text-lg",children:"An essential boost for your local business"})]}),s.jsxs(ve,{className:"p-6 md:p-8",children:[s.jsxs("div",{className:"flex items-baseline gap-1 mb-6",children:[s.jsx("span",{className:"text-4xl font-bold text-primary",children:"$149.99"}),s.jsx("span",{className:"text-muted-foreground text-lg",children:"one-time"})]}),s.jsxs("div",{className:"space-y-4 mb-8",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(zd,{className:"h-5 w-5 text-primary mt-0.5 shrink-0"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Professional In-Store Portrait Session"}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:["One on-location portrait session at your business."," ",s.jsxs(ht,{children:[s.jsx(Nn,{asChild:!0,children:s.jsx("button",{type:"button",className:"text-primary font-medium hover:underline",children:"View sample images"})}),s.jsxs(dt,{className:"max-w-2xl",children:[s.jsx(ft,{children:s.jsx(mt,{children:"Sample Portrait Sessions"})}),s.jsxs(zk,{className:"w-full",children:[s.jsx(Bk,{children:[x6,y6,w6].map((b,v)=>s.jsx(Vk,{children:s.jsx("img",{src:b,alt:`Portrait sample ${v+1}`,className:"w-full h-auto rounded-md"})},v))}),s.jsx(Wk,{className:"left-2"}),s.jsx(Hk,{className:"right-2"})]})]})]})]})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(Mr,{className:"h-5 w-5 text-primary mt-0.5 shrink-0"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"10% Discount on Additional Marketing Services"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Save on any future marketing services from The Street Pass"})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(dn,{className:"h-5 w-5 text-primary mt-0.5 shrink-0"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Promoted as a Check-In Location for One Month"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Drive foot traffic with our check-in rewards program for 30 days"})]})]})]}),!(a!=null&&a.is_business_owner)&&s.jsx(zn,{className:"mb-6",children:s.jsxs(Bn,{children:["This package is available to business owner members. If you're a business owner, please contact us to update your account or"," ",s.jsx("a",{href:"/biz-sign-up",className:"text-primary font-medium hover:underline",children:"sign up as a business owner"}),"."]})}),s.jsx(L,{onClick:()=>p("id-marketing",149.99),disabled:c||!(a!=null&&a.is_business_owner),className:"w-full text-lg py-6",size:"lg",children:w==="id-marketing"?s.jsxs(s.Fragment,{children:[s.jsx(Rr,{className:"w-5 h-5 mr-2 animate-spin"}),"Processing..."]}):s.jsxs(s.Fragment,{children:[s.jsx(gd,{className:"w-5 h-5 mr-2"}),"Purchase for $149.99"]})}),s.jsx("p",{className:"text-xs text-muted-foreground text-center mt-4",children:"Secure payment processed via PayPal. You will be redirected to PayPal to complete your purchase."})]})]}),s.jsxs(pe,{className:"overflow-hidden border-2 border-primary/20 mt-8",children:[s.jsxs("div",{className:"bg-gradient-to-r from-primary/10 to-primary/5 p-6 md:p-8",children:[s.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-foreground",children:"Event Experience with live DJ"}),s.jsx("p",{className:"text-muted-foreground mt-2 text-lg",children:"Elevate your in store promotional event with professional entertainment and coverage"})]}),s.jsxs(ve,{className:"p-6 md:p-8",children:[s.jsxs("div",{className:"flex items-baseline gap-1 mb-6",children:[s.jsx("span",{className:"text-4xl font-bold text-primary",children:"$300.00"}),s.jsx("span",{className:"text-muted-foreground text-lg",children:"one-time"})]}),s.jsxs("div",{className:"space-y-4 mb-8",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(D2,{className:"h-5 w-5 text-primary mt-0.5 shrink-0"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Live DJ Performance"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Professional DJ to keep the energy high and your guests engaged throughout your event"})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(Ij,{className:"h-5 w-5 text-primary mt-0.5 shrink-0"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Social Media Marketing of the Event"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Promote your event across The Street Pass social channels to drive attendance and buzz"})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(zd,{className:"h-5 w-5 text-primary mt-0.5 shrink-0"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Photo & Video Coverage of the Event"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Professional photography and videography to capture the highlights of your event"})]})]})]}),!(a!=null&&a.is_business_owner)&&s.jsx(zn,{className:"mb-6",children:s.jsxs(Bn,{children:["This package is available to business owner members. If you're a business owner, please contact us to update your account or"," ",s.jsx("a",{href:"/biz-sign-up",className:"text-primary font-medium hover:underline",children:"sign up as a business owner"}),"."]})}),s.jsx(L,{onClick:()=>p("event-experience-dj",300),disabled:c||!(a!=null&&a.is_business_owner),className:"w-full text-lg py-6",size:"lg",children:w==="event-experience-dj"?s.jsxs(s.Fragment,{children:[s.jsx(Rr,{className:"w-5 h-5 mr-2 animate-spin"}),"Processing..."]}):s.jsxs(s.Fragment,{children:[s.jsx(gd,{className:"w-5 h-5 mr-2"}),"Purchase for $300.00"]})}),s.jsx("p",{className:"text-xs text-muted-foreground text-center mt-4",children:"Secure payment processed via PayPal. You will be redirected to PayPal to complete your purchase."})]})]}),s.jsxs(pe,{className:"overflow-hidden border-2 border-primary/20 mt-8",children:[s.jsxs("div",{className:"bg-gradient-to-r from-primary/10 to-primary/5 p-6 md:p-8",children:[s.jsx("div",{className:"flex items-center gap-3 mb-2",children:s.jsx(Ie,{className:"bg-primary text-primary-foreground text-sm px-3 py-1",children:"Featured Package"})}),s.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-foreground",children:"The Street Pass Sponsorship Package"}),s.jsx("p",{className:"text-muted-foreground mt-2 text-lg",children:"The ultimate local business marketing package"})]}),s.jsxs(ve,{className:"p-6 md:p-8",children:[s.jsxs("div",{className:"flex items-baseline gap-1 mb-6",children:[s.jsx("span",{className:"text-4xl font-bold text-primary",children:"$449.99"}),s.jsx("span",{className:"text-muted-foreground text-lg",children:"one-time"})]}),s.jsxs("div",{className:"space-y-4 mb-8",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(zd,{className:"h-5 w-5 text-primary mt-0.5 shrink-0"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"2 Hours Digital Media Production"}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Professional photography and/or video production for your business."," ",s.jsxs(ht,{children:[s.jsx(Nn,{asChild:!0,children:s.jsx("button",{type:"button",className:"text-primary font-medium hover:underline",children:"View sample video"})}),s.jsxs(dt,{className:"max-w-3xl",children:[s.jsx(ft,{children:s.jsx(mt,{children:"Sample Video Production"})}),s.jsx("div",{className:"aspect-video w-full rounded-lg overflow-hidden",children:s.jsx("iframe",{src:"https://www.youtube.com/embed/Sz_lOICouPk",className:"w-full h-full",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,title:"Sample video production"})})]})]})]})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(Mr,{className:"h-5 w-5 text-primary mt-0.5 shrink-0"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"25% Discount on Additional Marketing Services"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Save on any future marketing services from The Street Pass"})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(vu,{className:"h-5 w-5 text-primary mt-0.5 shrink-0"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Featured Directory Listing for One Year"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Your business highlighted in the Local Shops directory for 12 months"})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(dn,{className:"h-5 w-5 text-primary mt-0.5 shrink-0"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Promoted as a Check-In to Win Location"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Drive foot traffic with our check-in rewards program"})]})]})]}),!(a!=null&&a.is_business_owner)&&s.jsx(zn,{className:"mb-6",children:s.jsxs(Bn,{children:["This package is available to business owner members. If you're a business owner, please contact us to update your account or"," ",s.jsx("a",{href:"/biz-sign-up",className:"text-primary font-medium hover:underline",children:"sign up as a business owner"}),"."]})}),s.jsx(L,{onClick:()=>p("street-pass-sponsorship",449.99),disabled:c||!(a!=null&&a.is_business_owner),className:"w-full text-lg py-6",size:"lg",children:w==="street-pass-sponsorship"?s.jsxs(s.Fragment,{children:[s.jsx(Rr,{className:"w-5 h-5 mr-2 animate-spin"}),"Processing..."]}):s.jsxs(s.Fragment,{children:[s.jsx(gd,{className:"w-5 h-5 mr-2"}),"Purchase for $449.99"]})}),s.jsx("p",{className:"text-xs text-muted-foreground text-center mt-4",children:"Secure payment processed via PayPal. You will be redirected to PayPal to complete your purchase."})]})]})]})})},j6=()=>{const e=Et();return s.jsx("div",{className:"min-h-screen bg-background p-4 md:p-8",children:s.jsxs("div",{className:"max-w-2xl mx-auto
497space-y-6",children:[s.jsx(L,{variant:"ghost",onClick:()=>e(-1),className:"px-0",children:"â Back"}),s.jsxs(pe,{children:[s.jsxs(Ae,{className:"text-center",children:[s.jsx(Me,{className:"text-3xl md:text-4xl font-bold tracking-tight",children:"THE STREET PASS"}),s.jsx("p",{className:"text-lg text-muted-foreground mt-2",children:"Your Pass to the City."})]}),s.jsxs(ve,{className:"space-y-6 text-justify text-foreground/90 leading-relaxed",children:[s.jsx("p",{children:"We believe the best parts of a city aren't always the easiest to find."}),s.jsx("p",{children:"They're in the neighborhood restaurant you haven't tried yet."}),s.jsx("p",{children:"The boutique you keep driving past."}),s.jsx("p",{children:"The DJ playing somewhere you didn't know about."}),s.jsx("p",{children:"The chef everyone will be talking about next year."}),s.jsx("p",{children:"The entrepreneur building something important."}),s.jsx("p",{children:"The party you wish somebody had told you about."}),s.jsx("p",{children:"The Street Pass exists to connect those dots."}),s.jsx("p",{children:"We're a community of people who want to experience our cityânot simply live in it."}),s.jsx("p",{children:"We discover."}),s.jsx("p",{children:"We show up."}),s.jsx("p",{children:"We support local businesses."}),s.jsx("p",{children:"We meet people."}),s.jsx("p",{children:"We experience culture."}),s.jsx("p",{children:"And we get rewarded for participating."}),s.jsx("p",{children:"Street Pass members don't need to know everything happening in the city."}),s.jsx("p",{children:"We just need to know what's worth knowing."}),s.jsx("p",{className:"text-center font-bold tracking-widest pt-4",children:"DISCOVER. EXPERIENCE. CONNECT. GET REWARDED."})]})]})]})})},_6=()=>{const[e,t]=h.useState(null),[n,r]=h.useState(!0),[a,i]=h.useState(!1),[o,l]=h.useState(""),[c,d]=h.useState(""),[u,f]=h.useState(""),[m,w]=h.useState(""),[x,p]=h.useState(""),[b,v]=h.useState([]),g=Et(),{toast:y}=_t();h.useEffect(()=>{R.auth.getSession().then(({data:{session:C}})=>{if(!(C!=null&&C.user)){g("/sign-in");return}t(C.user),j(C.user.id),r(!1)})},[g]);const j=async C=>{const{data:E}=await R.from("fundraiser_organizations").select("*").eq("user_id",C).order("created_at",{ascending:!1});E&&v(E)},N=async C=>{if(C.preventDefault(),!!o.trim()){i(!0);try{const{data:E,error:H}=await R.rpc("generate_fundraiser_code",{p_org_name:o.trim()});if(H)throw H;const{data:A,error:F}=await R.from("fundraiser_organizations").insert({user_id:e.id,organization_name:o.trim(),fundraiser_code:E,phone_number:c.trim()||null,payment_method:u||null,payment_handle:m.trim()||null}).select().single();if(F)throw F;p(E),y({title:"Fundraiser Created!",description:`Your organization code is: ${E}`}),l(""),d(""),f(""),w(""),j(e.id)}catch(E){y({title:"Error",description:E.message||"Failed to create fundraiser",variant:"destructive"})}finally{i(!1)}}},k=C=>{navigator.clipboard.writeText(C),y({title:"Copied!",description:"Fundraiser code copied to clipboard"})};return n?s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:s.jsx("p",{children:"Loading..."})}):s.jsx("div",{className:"min-h-screen bg-background p-4",children:s.jsxs("div",{className:"max-w-lg mx-auto space-y-6",children:[s.jsxs(L,{variant:"ghost",onClick:()=>g("/"),className:"mb-2",children:[s.jsx(Kn,{className:"h-4 w-4 mr-2"}),"Back to Dashboard"]}),s.jsxs(pe,{children:[s.jsxs(Ae,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ih,{className:"h-6 w-6 text-primary"}),s.jsx(Me,{className:"text-2xl text-primary",children:"Create a Fundraiser"})]}),s.jsx(St,{className:"text-justify",children:"Register to raise funds for the nonprofit organization of your choice and host a V.I.P experience with Andre Terrell. A unique code will be generated for your organization. When someone signs up for a Street Pass V.I.P membership using your fundraiser code, your organization will earn 50% from each sale."}),s.jsx("p",{className:"text-xs text-muted-foreground mt-2 italic",children:"*A check for the total amount raised will be presented directly to the organization."})]}),s.jsxs(ve,{children:[s.jsxs("form",{onSubmit:N,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"org-name",children:"Organization Name"}),s.jsx(Q,{id:"org-name",type:"text",value:o,onChange:C=>l(C.target.value),placeholder:"Enter your nonprofit organization name",required:!0,maxLength:100})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"phone",children:"Contact Phone Number"}),s.jsx(Q,{id:"phone",type:"tel",value:c,onChange:C=>d(C.target.value),placeholder:"Enter a contact phone number",required:!0,maxLength:20})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"payment-method",children:"Payment Method"}),s.jsxs(Vt,{value:u,onValueChange:f,children:[s.jsx(Ot,{children:s.jsx(Wt,{placeholder:"Select payment method"})}),s.jsxs(At,{children:[s.jsx(gt,{value:"paypal",children:"PayPal"}),s.jsx(gt,{value:"cashapp",children:"Cash App"})]})]})]}),u&&s.jsxs("div",{className:"space-y-2",children:[s.jsx(B,{htmlFor:"payment-handle",children:u==="paypal"?"PayPal Email Address":"Cash App Tag"}),s.jsx(Q,{id:"payment-handle",type:u==="paypal"?"email":"text",value:m,onChange:C=>w(C.target.value),placeholder:u==="paypal"?"[email protected]":"$YourCashTag",required:!0,maxLength:100})]}),s.jsx(L,{type:"submit",className:"w-full",disabled:a,children:a?"Creating...":"Register Organization"})]}),x&&s.jsx(zn,{className:"mt-4",children:s.jsxs(Bn,{className:"space-y-2",children:[s.jsx("p",{className:"font-semibold",children:"Your fundraiser has been submitted for review!"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Q,{value:x,readOnly:!0,className:"text-center text-lg font-mono tracking-widest"}),s.jsx(L,{variant:"outline",size:"icon",onClick:()=>k(x),children:s.jsx(gu,{className:"h-4 w-4"})})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Your organization is pending admin a
497pproval. A representative will be contacting you shortly. Once approved, supporters can use this code when signing up."})]})})]})]}),b.length>0&&s.jsxs(pe,{children:[s.jsx(Ae,{children:s.jsx(Me,{children:"Your Fundraiser Organizations"})}),s.jsxs(ve,{children:[s.jsx("div",{className:"space-y-3",children:b.map(C=>s.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted rounded-lg",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("p",{className:"font-medium",children:C.organization_name}),s.jsx(Ie,{variant:C.status==="approved"?"default":C.status==="rejected"?"destructive":"secondary",children:C.status==="approved"?"Approved":C.status==="rejected"?"Rejected":"Pending"})]}),s.jsx("p",{className:"text-sm text-muted-foreground font-mono",children:C.fundraiser_code})]}),s.jsx(L,{variant:"outline",size:"icon",onClick:()=>k(C.fundraiser_code),children:s.jsx(gu,{className:"h-4 w-4"})})]},C.id))}),s.jsx(L,{variant:"link",className:"mt-3 w-full",onClick:()=>g("/my-fundraiser"),children:"View Fundraiser Stats â"})]})]})]})})},N6=()=>{const[e,t]=h.useState(!0),[n,r]=h.useState([]),a=Et(),{toast:i}=_t();h.useEffect(()=>{R.auth.getSession().then(({data:{session:f}})=>{if(!(f!=null&&f.user)){a("/sign-in");return}o(f.user.id)})},[a]);const o=async f=>{try{const{data:m,error:w}=await R.from("fundraiser_organizations").select("*").eq("user_id",f).order("created_at",{ascending:!1});if(w)throw w;r(m||[])}catch(m){console.error("Error fetching organizations:",m)}finally{t(!1)}},l=f=>{navigator.clipboard.writeText(f),i({title:"Copied!",description:"Code copied to clipboard"})};if(e)return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:s.jsx("p",{children:"Loading..."})});const c=n.reduce((f,m)=>f+Number(m.earnings||0),0),d=n.reduce((f,m)=>f+(m.total_signups||0),0),u=n.reduce((f,m)=>f+Number(m.total_sales||0),0);return s.jsx("div",{className:"min-h-screen bg-background p-4",children:s.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[s.jsxs(L,{variant:"ghost",onClick:()=>a("/"),className:"mb-2",children:[s.jsx(Kn,{className:"h-4 w-4 mr-2"}),"Back to Dashboard"]}),s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx(ih,{className:"h-6 w-6 text-primary"}),s.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"My Fundraiser Stats"})]}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[s.jsx(pe,{children:s.jsx(ve,{className:"pt-6",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(hi,{className:"h-8 w-8 text-primary"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Sign-ups"}),s.jsx("p",{className:"text-2xl font-bold",children:d})]})]})})}),s.jsx(pe,{children:s.jsx(ve,{className:"pt-6",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(xu,{className:"h-8 w-8 text-primary"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Sales"}),s.jsxs("p",{className:"text-2xl font-bold",children:["$",u.toFixed(2)]})]})]})})}),s.jsx(pe,{children:s.jsx(ve,{className:"pt-6",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(kg,{className:"h-8 w-8 text-primary"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Your Earnings (50%)"}),s.jsxs("p",{className:"text-2xl font-bold",children:["$",c.toFixed(2)]})]})]})})})]}),n.length===0?s.jsx(pe,{children:s.jsxs(ve,{className:"pt-6 text-center",children:[s.jsx("p",{className:"text-muted-foreground mb-4",children:"You haven't created any fundraisers yet."}),s.jsx(L,{onClick:()=>a("/create-fundraiser"),children:"Create a Fundraiser"})]})}):s.jsxs("div",{className:"space-y-4",children:[s.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"Your Organizations"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Performance breakdown by organization"}),n.map(f=>s.jsxs(pe,{children:[s.jsx(Ae,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[s.jsx(Me,{className:"text-lg",children:f.organization_name}),s.jsx(Ie,{variant:f.status==="approved"?"default":f.status==="rejected"?"destructive":"secondary",children:f.status==="approved"?"Approved":f.status==="rejected"?"Rejected":"Pending"})]})}),s.jsxs(ve,{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-muted-foreground",children:"Code:"}),s.jsx("span",{className:"font-mono text-sm font-medium",children:f.fundraiser_
497code}),s.jsx(L,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>l(f.fundraiser_code),children:s.jsx(gu,{className:"h-3 w-3"})})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[s.jsxs("div",{className:"text-center p-3 rounded-md bg-muted/50",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"Sign-ups"}),s.jsx("p",{className:"text-lg font-bold",children:f.total_signups||0})]}),s.jsxs("div",{className:"text-center p-3 rounded-md bg-muted/50",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"Sales"}),s.jsxs("p",{className:"text-lg font-bold",children:["$",Number(f.total_sales||0).toFixed(2)]})]}),s.jsxs("div",{className:"text-center p-3 rounded-md bg-muted/50",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"Earnings"}),s.jsxs("p",{className:"text-lg font-bold",children:["$",Number(f.earnings||0).toFixed(2)]})]})]})]})]},f.id))]}),s.jsx("div",{className:"text-center",children:s.jsx(L,{onClick:()=>a("/create-fundraiser"),children:"Register Another Organization"})})]})})},S6=()=>s.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:s.jsx(pe,{className:"w-full max-w-md mx-auto",children:s.jsxs(ve,{className:"p-8 text-center space-y-6",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx(ci,{className:"h-16 w-16 text-green-500"})}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Welcome to the Street Pass Community!"}),s.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Your email has been verified and your account is now active. Download the Street Pass app, then launch it and log in with the credentials you created to start earning Street Cash reward points."})]}),s.jsxs("div",{className:"space-y-4 pt-2",children:[s.jsx("p",{className:"text-foreground font-bold",children:"Tap your app market below to download the Street Pass app."}),s.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4",children:[s.jsx("a",{href:"https://apps.apple.com/us/app/the-street-pass/id557242348",target:"_blank",rel:"noopener noreferrer",children:s.jsx("img",{src:"https://developer.apple.com/assets/elements/badges/download-on-the-app-store.svg",alt:"Download on the App Store",className:"h-12"})}),s.jsx("a",{href:"https://play.google.com/store/apps/details?id=app.thestreetpassapp.android",target:"_blank",rel:"noopener noreferrer",children:s.jsx("img",{src:"https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png",alt:"Get it on Google Play",className:"h-16 -my-2"})})]})]})]})})}),kw=()=>{const e=Et();return h.useEffect(()=>{(async()=>{const n=new URL(window.location.href),r=n.searchParams.get("next"),a=new URLSearchParams(window.location.hash.replace(/^#/,"")),i=n.searchParams.get("type")??a.get("type"),o=()=>{if(i==="recovery"){window.location.replace(`/reset-password${window.location.hash||""}`);return}window.location.replace(r||"/email-verified")};try{const l=n.searchParams.get("code");if(l){const{error:c}=await R.auth.exchangeCodeForSession(l);c&&console.error("Email confirmation failed:",c.message)}else await R.auth.getSession();!r&&i!=="recovery"&&await R.auth.signOut({scope:"local"}),o()}catch(l){console.error("Email confirmation failed:",l),o()}})()},[e]),null},Cw=()=>{const[e,t]=h.useState(null),[,n]=h.useState(null);h.useState(!1);const r=Et();_t(),h.useEffect(()=>{const{data:{subscription:o}}=R.auth.onAuthStateChange((l,c)=>{n(c),t((c==null?void 0:c.user)??null)});return R.auth.getSession().then(({data:{session:l}})=>{n(l),t((l==null?void 0:l.user)??null)}),()=>o.unsubscribe()},[]);const a=[{title:"One-Year Featured Check-In Location Listing",desc:"Your business will be featured in The Street Pass App directory as an official Check-In Location for 12 months."},{title:"Professional Content Creation",desc:"Photo and video content created to help showcase your business, products, services, and customer experience."},{title:"Social Media Promotion",desc:"Mentions and exposure across The Street Pass social media channels announcing your business."},{title:"$100 Marketing Credit",desc:"Receive a $100 credit that can be applied toward additional marketing services offered by The Street Pass Marketing Company."},{title:"Official Street Pass Check-In Tag",desc:"Receive a unique in-store Check-In Tag to display at your location."}],i=["Increased foot traffic","Enhanced customer engagement","Greater visibility within the community","Social media exposure","Professional marketing content","Repeat visits from loyal customers","Inclusion in a citywide rewards ecosystem"];return s.jsxs("div",{className:"min-h-screen bg-background pb-8",children:[s.jsx("img",{src:fv,alt:"The Street Pass",className:"w-full h-auto"}),s.jsxs("div",{className:"max-w-3xl mx-auto p-4 md:p-8",children:[s.jsxs("div",{className:"text-center mb-8",children:[s.jsx(Ie,{className:"mb-3",children:"Business Activation"}),s.jsx("h1",{className:"text-3xl md:text-4xl font-bold text-primary mb-3",children:"The Street Pass Check-in Sponsorship Package"}
497),s.jsx("p",{className:"text-muted-foreground text-lg text-justify",children:"Increase Visibility. Drive Foot Traffic. Reward Customer Engagement."})]}),s.jsx(pe,{className:"mb-6",children:s.jsx(ve,{className:"p-6 md:p-8",children:s.jsx("p",{className:"text-justify text-foreground",children:"The Street Pass Check-in Sponsorship Package is designed to help local businesses attract new customers, increase repeat visits, and gain valuable exposure through our growing network of members who actively support local businesses."})})}),s.jsx(pe,{className:"mb-6",children:s.jsxs(ve,{className:"p-6 md:p-8",children:[s.jsx("h2",{className:"text-2xl font-bold mb-4",children:"What's Included"}),s.jsx("div",{className:"space-y-4",children:a.map(o=>s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(gr,{className:"h-5 w-5 text-primary mt-1 shrink-0"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-semibold",children:o.title}),s.jsx("p",{className:"text-sm text-muted-foreground text-justify",children:o.desc})]})]},o.title))}),s.jsxs("div",{className:"mt-6 rounded-lg border border-primary/30 bg-primary/5 p-4",children:[s.jsx("p",{className:"font-semibold text-primary",children:"*Bonus"}),s.jsx("p",{className:"text-sm text-muted-foreground text-justify",children:"Qualifying businesses that achieve 100 check-ins at their location within a month will receive a live on-location DJ set with Andre Terrell."})]}),s.jsxs("div",{className:"mt-8 pt-6 border-t flex flex-wrap items-baseline gap-x-6 gap-y-2",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Promotional Value"}),s.jsx("p",{className:"text-xl font-semibold line-through text-muted-foreground",children:"$500"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Investment"}),s.jsx("p",{className:"text-3xl font-bold text-primary",children:"$149.99"})]})]})]})}),s.jsx(pe,{className:"mb-6",children:s.jsxs(ve,{className:"p-6 md:p-8",children:[s.jsx("h2",{className:"text-2xl font-bold mb-4",children:"How It Works"}),s.jsx("p",{className:"text-justify mb-3",children:"When Street Pass members visit your business, they simply enter the code from your Check-In Tag through The Street Pass App. Members earn reward points every time they check in to a new location."}),s.jsx("p",{className:"text-justify",children:"Those points can be redeemed for exclusive perks, prizes, event experiences, discounts, and giveawaysâcreating an incentive for members to visit participating businesses and engage with your brand."})]})}),s.jsx(pe,{className:"mb-6",children:s.jsxs(ve,{className:"p-6 md:p-8",children:[s.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Benefits to Your Business"}),s.jsx("ul",{className:"space-y-2",children:i.map(o=>s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx(gr,{className:"h-4 w-4 text-primary mt-1 shrink-0"}),s.jsx("span",{children:o})]},o))})]})}),s.jsx(pe,{className:"mb-6",children:s.jsxs(ve,{className:"p-6 md:p-8",children:[s.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Ideal For"}),s.jsx("p",{className:"text-justify text-muted-foreground",children:"Restaurants ⢠Cafés ⢠Retail Shops ⢠Salons ⢠Barbershops ⢠Fitness Studios ⢠Bars ⢠Entertainment Venues ⢠and other brick-and-mortar retail businesses."})]})}),s.jsx(pe,{className:"mb-8",children:s.jsxs(ve,{className:"p-6 md:p-8",children:[s.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Join the Network"}),s.jsx("p",{className:"text-justify",children:"Become an official Street Pass Check-In Location and connect your business to a community of consumers who are actively looking for places to shop, dine, and experience."})]})}),s.jsxs("div",{className:"sticky bottom-4 z-10",children:[s.jsx(L,{size:"lg",className:"w-full text-lg h-14 shadow-lg",onClick:()=>r("/biz-sign-up?next=/activate_checkin"),children:"Sign Up"}),s.jsx("p",{className:"text-center text-xs text-muted-foreground mt-2",children:"After signing up and verifying your email, you'll be returned here to complete payment via PayPal."})]})]})]})},Ew=()=>{const[e,t]=h.useState(!1),[n,r]=h.useState(!1),[a,i]=h.useState(!0),o=Et(),{toast:l}=_t();h.useEffect(()=>{R.auth.getUser().then(({data:d})=>{d.user?i(!1):o("/sign-in")})}
497,[o]);const c=async()=>{r(!0);try{const{data:d,error:u}=await R.functions.invoke("delete-account");if(u||d!=null&&d.error)throw new Error((u==null?void 0:u.message)||(d==null?void 0:d.error));Object.keys(localStorage).forEach(f=>{(f.startsWith("supabase.auth.")||f.includes("sb-"))&&localStorage.removeItem(f)}),await R.auth.signOut({scope:"global"}).catch(()=>{}),l({title:"Account deleted",description:"Your account and data have been permanently removed."}),window.location.href="/sign-in"}catch(d){console.error("Error deleting account:",d),l({title:"Could not delete account",description:d.message||"Please try again or contact support.",variant:"destructive"}),r(!1)}};return a?s.jsx("div",{className:"min-h-screen flex items-center justify-center text-muted-foreground",children:"Loading..."}):s.jsx("div",{className:"min-h-screen bg-background py-10 px-4",children:s.jsx("main",{className:"max-w-lg mx-auto",children:s.jsxs(pe,{className:"border-destructive/40",children:[s.jsx(Ae,{children:s.jsxs(Me,{className:"flex items-center gap-2 text-destructive",children:[s.jsx(I2,{className:"h-5 w-5"}),"Delete Account"]})}),s.jsxs(ve,{className:"space-y-5",children:[s.jsxs("div",{className:"space-y-3 text-sm text-muted-foreground text-justify",children:[s.jsx("p",{children:"If you proceed, your Street Pass account will be closed and all of your data will be permanently deleted."}),s.jsx("p",{children:"This includes your profile, membership, Street Cash points, check-in history, claimed rewards, referrals, reviews, event RSVPs, and any business listings you submitted."}),s.jsx("p",{className:"font-medium text-foreground",children:"This action cannot be undone and your data cannot be recovered."})]}),s.jsxs("div",{className:"flex items-start gap-3 rounded-md border p-3",children:[s.jsx(Do,{id:"confirm-delete",checked:e,onCheckedChange:d=>t(d===!0)}),s.jsx("label",{htmlFor:"confirm-delete",className:"text-sm leading-snug",children:"I understand that my account will be closed and all of my data will be deleted permanently."})]}),s.jsx(L,{variant:"destructive",className:"w-full",disabled:!e||n,onClick:c,children:n?"Deleting...":"Delete My Account"}),s.jsx(L,{variant:"outline",className:"w-full",onClick:()=>o("/"),children:"Cancel"})]})]})})})},Pw=()=>{const{code:e}=vh(),t=Et();return h.useEffect(()=>{const n=(e||"").trim();if(n){try{localStorage.setItem("streetpass_referral_code",n)}catch{}t(`/sign-up?ref=${encodeURIComponent(n)}`,{replace:!0})}else t("/sign-up",{replace:!0})},[e,t]),s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:s.jsx("p",{className:"text-muted-foreground",children:"Taking you to sign upâ¦"})})},k6=new VD,C6=()=>s.jsx(HD,{client:k6,children:s.jsxs(wD,{children:[s.jsx(yT,{}),s.jsx(GT,{}),s.jsx(z4,{children:s.jsxs(O4,{children:[s.jsx(pt,{path:"/",element:s.jsx(NL,{})}),s.jsx(pt,{path:"/sign-in",element:s.jsx(CL,{})}),s.jsx(pt,{path:"/sign-up",element:s.jsx(OL,{})}),s.jsx(pt,{path:"/r/:code",element:s.jsx(Pw,{})}),s.jsx(pt,{path:"/join/:code",element:s.jsx(Pw,{})}),s.jsx(pt,{path:"/auth",element:s.jsx(kw,{})}),s.jsx(pt,{path:"/admin",element:s.jsx(i3,{})}),s.jsx(pt,{path:"/admin-auth",element:s.jsx(o3,{})}),s.jsx(pt,{path:"/validation-success",element:s.jsx(l3,{})}),s.jsx(pt,{path:"/localshops",element:s.jsx(d3,{})}),s.jsx(pt,{path:"/local-shops/:id",element:s.jsx(h3,{})}),s.jsx(pt,{path:"/add-business",element:s.jsx(g3,{})}),s.jsx(pt,{path:"/edit-business/:id",element:s.jsx(v3,{})}),s.jsx(pt,{path:"/my-listings",element:s.jsx(x3,{})}),s.jsx(pt,{path:"/business-submission-success",element:s.jsx(y3,{})}),s.jsx(pt,{path:"/events",element:s.jsx(TU,{})}),s.jsx(pt,{path:"/events/:id",element:s.jsx(RU,{})}),s.jsx(pt,{path:"/registration-submitted",element:s.jsx(OU,{})}),s.jsx(pt,{path:"/reset-password",element:s.jsx(DU,{})}),s.jsx(pt,{path:"/photos",element:s.jsx(IU,{})}),s.jsx(pt,{path:"/update-info",element:s.jsx(LU,{})}),s.jsx(pt,{path:"/privacy",element:s.jsx(AU,{})}),s.jsx(pt,{path:"/biz-sign-up",element:s.jsx($U,{})}),s.jsx(pt,{path:"/marketing",element:s.jsx(b6,{})}),s.jsx(pt,{path:"/manifesto",element:s.jsx(j6,{})}),s.jsx(pt,{path:"/create-fundraiser",element:s.jsx(_6,{})}),s.jsx(pt,{path:"/my-fundraiser",element:s.jsx(N6,{})}),s.jsx(pt,{path:"/auth/confirm",element:s.jsx(kw,{})}),s.jsx(pt,{path:"/email-verified",element:s.jsx(S6,{})}),s.jsx(pt,{path:"/activate_checkin",element:s.jsx(Cw,{})}),s.jsx(pt,{path:"/activate-checkin",element:s.jsx(Cw,{})}),s.jsx(pt,{path:"/deleteaccount",element:s.jsx(Ew,{})}),s.jsx(pt,{path:"/delete-account",element:s.jsx(Ew,{})}),s.jsx(pt,{path:"*",element:s.jsx(c3,{})})]})})]})});Xb(document.getElementById("root")).render(s.jsx(C6,{}));
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.